Skip to content
Snippets Groups Projects
Commit 8fb1446e authored by Vít Novotný's avatar Vít Novotný
Browse files

Added `\ifthesis@blocks@assignment@hideIfDigital@` to `mu/base` style.

This conditional determines, whether the scanned assignment
specified by the `assignment` key is going to be hidden in the
digital version of the document. It is by default, but some style
files (`/mu/sci`) switch this, so that the scanned assignment is
included in the digital version.
parent 3fa28f10
No related branches found
No related tags found
No related merge requests found
Showing
with 53 additions and 23 deletions
PDFFILES=fi.pdf sci.pdf ped.pdf med.pdf fss.pdf fsps.pdf phil.pdf \
law.pdf econ.pdf
TEX=pdflatex -shell-escape
TEX=pdflatex --shell-escape
.PHONY: all clean
all: clean
make all -C resources
......
......@@ -908,14 +908,21 @@
% \end{macro}\begin{macro}{\thesis@blocks@assignment}
% The |\thesis@blocks@assignment| macro produces a different output
% depending on the values of the |\thesis@assignmentFiles|.
% |\ifthesis@blocks@assignment@|, and |\ifthesis@digital| macros.
% |\ifthesis@blocks@assignment@|,
% |\ifthesis@blocks@assignment@hideIfDigital@|, and
% |\ifthesis@digital| macros.
%
% The default value of the \DescribeMacro{\ifthesis@blocks@assig^^A
% nment@}|\ifthesis@blocks@assignment@| conditional is
% The default value of the
% \DescribeMacro{\ifthesis@blocks@assignment@}^^A
% |\ifthesis@blocks@assignment@| and
% \DescribeMacro{\ifthesis@blocks@assignment@hideIfDigital}^^A
% |\ifthesis@blocks@assignment@hideIfDigital@| conditionals is
% \texttt{true}.
% \begin{macrocode}
\newif\ifthesis@blocks@assignment@
\thesis@blocks@assignment@true
\newif\ifthesis@blocks@assignment@hideIfDigital@
\thesis@blocks@assignment@hideIfDigital@true
\def\thesis@blocks@assignment{%
% \end{macrocode}
% If the |\ifthesis@blocks@assignment@| conditional is
......@@ -932,37 +939,49 @@
\end{alwayssingle}%
\else
% \end{macrocode}
% Locally define \DescribeMacro{\@inject}|\@inject| as our routine
% for injecting lists of PDF documents.
% \begin{macrocode}
{\edef\@pdfList{\thesis@assignmentFiles}%
\let\ea\expandafter
% Injects the specified PDF documents.
\def\@inject##1,{\thesis@blocks@clear
\def\@args{##1}\def\@relax{\relax}%
\ifx\@args\@relax\else
% Trim leading spaces.
\edef\@trimmed{\romannumeral-`\.##1}%
% Rewind the pages and include the PDF.
\thesis@rewind\includepdf[pages=-]\@trimmed
\ea\@inject\fi}%
% \end{macrocode}
% If the |\ifthesis@blocks@assignment@| conditional is
% \textsf{true} and the |\thesis@assignmentFiles| macro is neither
% undefined nor empty, then typeset a placeholder page, if the
% |\ifthesis@digital@| conditional is \textsf{true}.
% |\ifthesis@digital@| conditional is \textsf{true} and the
% |\ifthesis@blocks@assignmane@hideIfDigital@| conditional is
% \textsf{true}
% \begin{macrocode}
{\edef\@pdfList{\thesis@assignmentFiles}%
\ifx\@pdfList\empty\else
\ifthesis@digital@
\thesis@blocks@clear
\begin{alwayssingle}%
\thispagestyle{empty}\thesis@rewind
\noindent\textit{\thesis@@{assignment}}%
\end{alwayssingle}%
\ifthesis@blocks@assignment@hideIfDigital@
\thesis@blocks@clear
\begin{alwayssingle}%
\thispagestyle{empty}\thesis@rewind
\noindent\textit{\thesis@@{assignment}}%
\end{alwayssingle}%
% \end{macrocode}
% If the |\ifthesis@blocks@assignment@| conditional is
% \textsf{true} and the |\thesis@assignmentFiles| macro is neither
% undefined nor empty, then inject the PDF documents specified in
% the |\thesis@assignmentFiles|, if the |\ifthesis@digital@|
% conditional is \textsf{false}.
% conditional is \textsf{false} or the
% |\ifthesis@blocks@assignment@hideIfDigital@| conditional is
% \textsf{false}.
% \begin{macrocode}
\else
\ea\@inject\@pdfList,\relax,%
\fi
\else
\let\ea\expandafter
% Inject the specified PDF documents.
\def\@inject##1,{\thesis@blocks@clear
\def\@args{##1}\def\@relax{\relax}%
\ifx\@args\@relax\else
% Trim leading spaces.
\edef\@trimmed{\romannumeral-`\.##1}%
% Rewind the pages and include the PDF.
\thesis@rewind\includepdf[pages=-]\@trimmed
\ea\@inject\fi}%
\ea\@inject\@pdfList,\relax,%
\fi
\fi}%
......
......@@ -46,6 +46,11 @@
\thesis@blocks@assignment@false
\fi\fi
% \end{macrocode}
% Enable the inclusion of the scanned assignment inside the digital
% version of the document.
% \begin{macrocode}
\thesis@blocks@assignment@hideIfDigital@false
% \end{macrocode}
% \begin{macro}{\thesis@blocks@bibEntry}
% The |\thesis@blocks@bibEntry| macro typesets a
% bibliographical entry. Along with the macros required by the
......
......@@ -35,7 +35,13 @@ SOURCES=base-digital.tex base-printed.tex base-10pt.tex \
fi-digital-someassignment.tex fi-printed-emptyassignment.tex \
fi-printed-noassignment.tex \
fi-printed-someassignment-oneside.tex \
fi-printed-someassignment-twoside.tex
fi-printed-someassignment-twoside.tex \
sci-digital-emptyassignment.tex sci-digital-noassignment.tex \
sci-digital-someassignment-oneside.tex \
sci-digital-someassignment-twoside.tex \
sci-printed-emptyassignment.tex sci-printed-noassignment.tex \
sci-printed-someassignment-oneside.tex \
sci-printed-someassignment-twoside.tex
BIB_UNSOLICITED=econ-bibliography-unsolicited.tex \
fi-bibliography-unsolicited.tex \
fsps-bibliography-unsolicited.tex \
......
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment