diff options
Diffstat (limited to 'macros/latex/contrib/exam/examdoc.tex')
-rw-r--r-- | macros/latex/contrib/exam/examdoc.tex | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/macros/latex/contrib/exam/examdoc.tex b/macros/latex/contrib/exam/examdoc.tex index 579d551ae6..dfca897c85 100644 --- a/macros/latex/contrib/exam/examdoc.tex +++ b/macros/latex/contrib/exam/examdoc.tex @@ -53,7 +53,7 @@ \newcommand{\bs}{\texorpdfstring{\char`\\}{}} \newcommand{\docversion}{2.7} -\newcommand{\docdate}{February 26, 2021} +\newcommand{\docdate}{August 14, 2022} %\newcommand{\docdate}{Draft: \today} %-------------------------------------------------------------------- @@ -595,7 +595,8 @@ on all pages after the first, give the commands Sections~\ref{sec:beginexamples} through \ref{sec:endexamples} contain many other examples of headers and footers, and the full explanation -of the commands for headers and footers is in +of the commands for headers and footers (including header and footer +commands other than the ones we've just mentioned) is in sections~\ref{sec:pagestyle}--\ref{sec:QuesSpan}. \index{header|)} @@ -7568,7 +7569,7 @@ on all other pages, you would give the commands \begin{verbatim} \lhead{Math 115} \chead[Second Exam]{} -\rhead[July 4, 1776]{Second Exam Continued)} +\rhead[July 4, 1776]{Second Exam (Continued)} \end{verbatim} Any of the three parts of the header can have multiple lines. To @@ -7591,6 +7592,32 @@ appear on every page, you would give the commands \index{header!three parts|)} +%-------------------------------------------------------------------- +\subsubsection{Commands with optional arguments} +\label{sec:OptArg} +\index{optional arguments} + +\LaTeX{} has the property that if a command takes an optional +argument, and if that optional argument contains a command that also +has an optional argument, then \emph{that inner command must be + enclosed within curly braces}. For example, if you want the right +justified part of the first page header to be +\samplehead{}{}{Name:\enspace\makebox[2in]{\hrulefill}}{} but you want +the right justified part of the header on pages after the first to be +empty, then you should give the command +\begin{verbatim} +\rhead[{Name:\enspace\makebox[2in]{\hrulefill}}]{} +\end{verbatim} +Note that the optional argument to the \verb"\rhead" command is +\begin{verbatim} +{Name:\enspace\makebox[2in]{\hrulefill}} +\end{verbatim} +and not +\begin{verbatim} +Name:\enspace\makebox[2in]{\hrulefill} +\end{verbatim} +This is due to the way that \LaTeX{} delimits optional arguments, and +is nothing special about the \verb"exam" document class. %--------------------------------------------------------------------- \subsubsection*{Leaving extra room for multiple line headers} @@ -8334,11 +8361,14 @@ incomplete. \pagestyle{headandfoot} \lhead{\large\bfseries Mathematics 115\\ First Exam, July 4, 1776} \chead{} -\rhead[\large\bfseries Name:\enspace\makebox[2in]{\hrulefill}]{} +\rhead[{\large\bfseries Name:\enspace\makebox[2in]{\hrulefill}}]{} \lfoot{} \cfoot[]{Page \thepage} \rfoot{} \end{verbatim} + (For an explanation of why there seems to be an extra pair of curly + braces in the optional argument to the \verb"\rhead" command, see + section~\ref{sec:OptArg}.) \end{example} %-------------------------------------------------------------------- |