Debian Codegraph @

texmf-dist/doc/latex/exam-n/notes-for-authors.tex

raw
1 \documentclass[10pt]{scrartcl}
2 %\documentclass[11pt]{scrartcl}
3
4 \usepackage{url,pdfpages,moreverb,color}
5 \definecolor{cscolour}{rgb}{0.5,0.1,0.1}
6
7 \title{Notes for exam question authors}
8 \author{Norman Gray}
9 \date{Version exam-n-1.4.0, 2022 October 10}
10
11 \parindent=0pt
12 \parskip=\medskipamount
13
14 \makeatletter
15 \def\cs@arg#1{\texttt\{\textit{#1}\texttt\}%
16 \advance\@tempcnta-1
17 \ifnum\@tempcnta>0
18 \let\next\cs@arg
19 \else
20 \let\next\endgroup % begun in \cs
21 \fi
22 \next}
23 {\catcode`\|=0 \catcode`\\=12
24 |gdef|cs@textbackslash#1{|texttt{\#1}}}
25 % \cs{foo} typeset \foo
26 % \cs[2]{foo}{bar}{baz} typeset \foo{bar}{baz}
27 \newcommand\cs[2][0]{\begingroup
28 \color{cscolour}%
29 \cs@textbackslash{#2}%
30 \@tempcnta=#1
31 \ifnum\@tempcnta>0
32 \let\next\cs@arg
33 \else
34 \let\next\endgroup
35 \fi
36 \next}
37
38 \let\origvec\vec
39 % We'd like to say here
40 % \newif\ifexamn@uprightpi \examn@uprightpitrue
41 % but that's not supported for CM fonts
42 \usepackage{examndefs}
43
44 \makeatother
45
46 \def\env#1{\texttt{\textcolor{cscolour}{\{#1\}}}}
47 \def\opt#1{\texttt{[#1]}}
48 \def\package#1{\textsf{#1}}
49
50 \setcounter{secnumdepth}0
51
52 \begin{document}
53 \maketitle
54
55 The full documentation for the \texttt{exam-n} document class is in
56 the file \texttt{exam-n.pdf}, but some of this is quite detailed, and
57 addressed to the exams convener, who has to assemble the overall
58 exam. This document is a compact account of how to use the exams
59 class as a question author.
60
61 You can find updated versions of the \texttt{exam-n} document class, and the
62 complete documentation, at \url{http://purl.org/nxg/dist/exam-n}.
63
64 \subsection{Template}
65 \label{s:template}
66 \listinginput1{template-question.tex}
67
68 Notice first that this is a standalone document -- you can \LaTeX\ it
69 to produce a formatted exam paper, as long as you include the
70 \opt{compose} option in the document class line. This complete
71 document can later be given to the exams convener, who can
72 input it unchanged into the master file which pulls the various questions
73 together. It follows from that that you should be hesitant about putting anything into
74 the preamble other than \cs{usepackage} commands, and you should
75 consult with the exams convener to ensure that such packages go into
76 the master file, too. It's probably a safe bet that the `graphicx'
77 package will be included in the master file. If you want to include
78 a \cs{newcommand}, or anything like that,
79 it can be placed inside the \env{question} environment. For
80 other customisations, negotiate with the exams convener.
81
82 The \env{question} environment contains (surprise) a question, broken into
83 parts (a, b, c, \dots) by \cs{part} commands, and with the distribution of marks within
84 the question being indicated by \cs[1]{partmarks}n; the class will check that the
85 marks in \cs{partmarks} do add up to the question goal given as an
86 argument in \cs[1]{begin\{question\}}{markgoal}. Within the
87 question there can be one or more \env{solution} environments, which are
88 not displayed in the final version (obviously), but which do appear in
89 draft modes. You'll most typically have a \cs{partmarks} macro and a
90 \env{solution} environment for each \cs{part}, but they don't have to
91 match up, and you can have the entire solution at the end if you prefer.
92
93 The \cs{partmarks} command will most typically go at the end of a
94 paragraph, but it may also appear inside an equation (that is, in
95 \verb|\[...\]|; don't use \verb|$$...$$|), inside one or other
96 \package{amsmath} display environments, or in a list or other
97 environment. If it appears inside an environment, the indicator will
98 appear at the \emph{end} of the environment, independent of where in
99 the environment the command was typed (which implies that you can't
100 have more than one inside an environment).
101
102 The starred version is similar, but budges its indicator upwards
103 a little, and is a heuristic alternative which is useful in some
104 cases \emph{after} a list or display, or after a numbered equation, if the placement of the
105 indicator is otherwise inaesthetic
106 (if the style of the part-marks indicators happens to be such
107 that the indicator may be mistaken for an equation number, then
108 it would be wise to use either \cs{partmarks} or \cs{partmarks*}
109 after the equation, instead). If you use \cs{partmarks*} within a
110 display, you might be confronted by an error message, talking
111 about \cs{eqno} in maths mode, which is even more incomprehensible
112 than most \LaTeX\ messages.
113
114 Note that \cs{partmarks} ends a paragraph (\cs{partmarks*} doesn't): this is
115 probably good style, but if you insist on mid-paragraph marks, then a following
116 \verb|\noindent| will be useful. It's helpful to use \cs{partmarks} inside a
117 \env{solution} to indicate the distribution of marks -- this doesn't mess up
118 the mark-totalling calculation.
119
120 You may optionally give a question number as an argument to the
121 \env{question} environment: \cs[1]{begin\{question\}[n]}{markgoal}.
122 In \opt{compose} mode, this simply sets the question number, but in the other
123 modes, when the question file is included in a master file, this
124 checks that the given number~$n$ is what would be assigned
125 automatically, to help detect missing or out-of-order questions. If
126 the question identifier is not a number, such as `D1', then you can
127 provide that identifier here also, but in this case you must also set
128 \cs{QuestionNumberChecksOff} in the question preamble.
129
130 The \cs{partmarks} command has an optional argument which
131 indicates the category of the question, thus `bookwork', `unseen',
132 and so on. If this is present -- for example
133 \cs[1]{partmarks[bookwork]}{5} -- then the category is included in the
134 marks indicator.
135 As you might hope, the \cs{partmarks*} command can take this
136 optional argument also: \cs[1]{partmarks*[bookwork]}{5}.
137 This extra text will typically be only one or two words long, but if
138 the text is much longer than that, it will be turned into a footnote.
139
140 One common exam or test question type is a multiple-choice question.
141 This is indicated by a \cs{begin\{mcq\}} environment, which contains a
142 textual question followed by a sequence of possible answers indicated by
143 \cs{item}, including precisely one correct answer, indicated by
144 \cs{answer} (this is of course formatted identically to the others,
145 unless the \opt{showsolutions} option is present). Before you can use
146 the \env{mcq} environment, you must call
147 \cs[1]{multiplechoiceanswers}{n} to indicate how many options are
148 required in each question.
149 It's OK to have a \env{solution} within an \env{mcq} environment,
150 perhaps to provide commentary on or explanation of the correct answer.
151
152 You can include a \env{questiondata} environment at (typically) the end of
153 the question: this is intended for extra equations or constants which
154 are useful for the examinee.
155
156 The \env{figure} and \env{table} environments act differently from the
157 way they usually act in \LaTeX: \emph{`floats' don't float}. In each
158 case, the content is forced to be always `here', and in addition is
159 also tied to the text which follows it, so that a page break will not
160 occur immediately after a figure or table. There are \emph{no} figure
161 or float options permitted in this class's `floating' environments
162 (that is, option \texttt{[h]} is neither necessary nor permissible).
163 If you need to tune the page breaking, then you should use
164 \verb|\goodbreak|, \verb|\vspace| or, in extremis, \verb|\newpage|.
165 The \cs[1]{caption}{text} command works as usual; the figure and table
166 numbering sequences continue through the solutions, if they're shown,
167 but this isn't expected to be a problem.
168
169 There is neither a \env{figure*} nor a \env{table*} environment,
170 because this is a single-column class.
171 Use the no-option unstarred versions instead.
172
173 \subsection{Hints}
174
175 Figures can be included with \cs{includegraphics} as usual, as long as
176 the \package{graphicx} package has been included at the top of the master
177 file. If you want to include complete pages from a PDF (most
178 typically containing a scanned handwritten model answer), then you can
179 do so by including the \package{pdfpages} package at the top of the file, and
180 then \cs[1]{includepdf[pages=\{-\}]}{filename} inside a \env{solution}
181 environment.
182 The \texttt{pages=\{-\}} option means that all pages from the file are
183 inserted; you may wish to use \texttt{scale=0.8} to shrink the PDF;
184 the option \verb|pagecommand={\thispagestyle{fancy}}| will cause the other
185 class apparatus, such as page numbers and headers, to be
186 superimposed on the included pages.
187 See the documentation of the \package{pdfpages} package for more information.
188
189 If you use \cs{label} within a \env{question} environment, that label
190 will, as you might expect, refer to the question number.
191
192 Include marginal notes with \cs[1]{comment}{remark} -- these show up in drafting
193 modes (\opt{draft} and \opt{compose}), but not in the final version.
194 The \cs[1]{author}{name} command is just
195 a type of comment. If you need to make more noise, then
196 \cs[1]{shout}{remark} inserts a highlighted \emph{remark} in the flow of text
197 (so it can be used anywhere) and includes the remark in a prominent
198 list of exclamations at the end of the document. Note that \cs{shout}
199 text \emph{appears in the \opt{final} version}: it is to draw
200 attention to problems (for example \cs[1]{shout}{solution wrong!})
201 which must be resolved before the exam is presented to students.
202
203 At the bottom of each page, you see a faint identification code, such
204 as `QM/123-456'. This consists of an exam identifier, extracted from
205 the exam preamble, plus a code which changes each time \LaTeX\ is
206 run, but which is otherwise meaningless.
207 This helps you avoid collation accidents, and to distinguish
208 between slightly different versions of the printed document.
209
210 \subsection{Various convenience commands}
211 \label{s:othercommands}
212
213 Macro \cs[1]{vec}{v} is redefined to give bold-font vectors
214 rather than vectors with arrows, which is the (weird) \LaTeX\ default
215 -- thus $\vec v$ rather than $\origvec v$.
216 This is intended to work for bold greek as well as roman,
217 but it does so reliably only for the \opt{mtpro2} and \opt{stix2}
218 options.
219
220 Macros \cs{dd} and \cs{ddd}: \cs{dd} is a roman d, as used for
221 differentials; \cs{ddd} is the same with a preceding thinspace,
222 as used within integrals; for example
223 \[
224 \verb|\int f(x)\ddd x = \int f(x)\,\dd x| = \int f(x)\ddd x
225 \]
226
227 You can typeset derivatives neatly:
228 \begin{center}
229 \def\dd{\mathrm{d}}
230 \begin{tabular}{rl}
231 \verb|\Diffl{a}{b}| & $\displaystyle \Diffl ab$ \\[3ex]
232 \verb|\Diffl[2]{a}{b}| & $\displaystyle \Diffl[2]ab$\\[3ex]
233 \verb|\Diffl*{a}{b}| & $\Diffl* ab$ \\[2ex]
234 \verb|\Diffl*[2]{a}{b}| & $\Diffl*[2]ab$\\
235 \end{tabular}
236 \end{center}
237 The unstarred versions are for displayed equations, the starred
238 ones for inline maths.
239 There is analogous support for partial derivatives with \cs[2]{Partial}ab.
240
241 You should generally type units, and numbers with units, using the
242 \package{siunitx} package (use the \opt{siunitx} \cs{documentclass} option).
243
244 However this package currently also
245 supports a basic \verb|\units| command, described here. This macro
246 is very likely to be removed in a future version of this package.
247 Macros \cs[1]{units}{expr}, \cs[1]{units*}{expr}: These typeset
248 physical units in an upright shape, with tilde or dot acting as a
249 separator between units. Since this is typeset in maths mode, all
250 other spacing is ignored. For example, \verb|$v=10\units{m.\mu s^{-1}}$|
251 gives $v=10\units{m.\mu s^{-1}}$. The unstarred version includes some
252 leading space; the starred version can be used when referring to the
253 unit by itself, where it is not qualifying a number (eg labelling an
254 axis with units \verb|$B/\units*T$|, or $B/\units*T$).
255
256 The command \cs{e} sets an upright~`e':
257 \verb|$\e^{i\pi} + 1 = 0$| produces $\e^{i\pi} + 1 = 0$.
258 Other shortcuts may be available in customisations of this class.\footnote{%
259 The package used to support an \cs{au} macro, for astronomical
260 unit, and \cs{lambdabar} for Compton wavelength, but these have
261 since been removed. The former is available via \package{siunitx}.}
262
263 Note: $\pi$ is set as an italic pi character, matching the
264 \LaTeX\ default. Since it's (usually) used as the circular constant,
265 it should more properly be set upright, and you can get that using the
266 \opt{uprightpi} option. This option also defines a \verb|\italicpi|
267 command, for completeness. This option is at present
268 implemented only for the \opt{mtpro2} and \opt{stix2} options.
269
270 \subsection{Extra: Creating complete exams}
271 \label{s:complete}
272 As a question author, you are typically only concerned with one or two
273 single questions, and that is why this brief guide concentrates
274 exclusively on the \opt{compose} mode. But you might be interested to see
275 how your text appears in the final exam. A template master file is
276 below. For more detail, see the complete documentation in \texttt{exam-n.pdf}.
277 \goodbreak
278 \listinginput1{template-master.tex}
279
280 The \texttt{exam-n} class currently supports a sample class option \opt{myclass}.
281 This automatically includes a suitable constants sheet in the
282 formatted paper.
283
284 On the following pages, you can see the result of \LaTeX ing the sample file on
285 p.\pageref{s:template}, and of processing the master file above.
286 As you can see, the \opt{compose} mode by default shows solutions,
287 and collects the \cs[1]{shout}{text} remarks to the end.
288 In the \opt{final} mode (which is the default mode), solutions
289 disappear, but the shouted-out alerts remain, just to make sure no-one
290 can miss them.
291 \includepdf{template-question.pdf}
292 \includepdf[pages={2,1},angle=90,nup=1x2,column]{template-master.pdf}
293 \end{document}