From f84e6a7cb7a889c2a8c7297f9d5ca4894eab7687 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 20 Dec 2016 22:54:48 +0000 Subject: exam-n (20dec16) git-svn-id: svn://tug.org/texlive/trunk@42755 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/exam-n/A1.clo | 82 ++ Master/texmf-dist/doc/latex/exam-n/README | 29 +- Master/texmf-dist/doc/latex/exam-n/README.ctan | 3 + .../texmf-dist/doc/latex/exam-n/exam-n-example.tex | 6 +- Master/texmf-dist/doc/latex/exam-n/exam-n.html | 63 +- Master/texmf-dist/doc/latex/exam-n/exam-n.pdf | Bin 269024 -> 271514 bytes .../doc/latex/exam-n/move-to-texmf/A1.clo | 82 -- .../doc/latex/exam-n/move-to-texmf/exam-n.cls | 1251 -------------------- .../doc/latex/exam-n/notes-for-authors.pdf | Bin 226217 -> 228150 bytes .../doc/latex/exam-n/notes-for-authors.tex | 304 +++++ .../texmf-dist/doc/latex/exam-n/release-notes.html | 39 +- Master/texmf-dist/doc/latex/exam-n/sample/Makefile | 15 +- .../texmf-dist/doc/latex/exam-n/sample/cosmo1.tex | 16 +- .../texmf-dist/doc/latex/exam-n/sample/excos1.tex | 4 +- .../doc/latex/exam-n/sample/fig/spiral.eps | 22 + .../doc/latex/exam-n/sample/fig/spiral.pdf | Bin 0 -> 1799 bytes .../latex/exam-n/sample/numerical1-solution.pdf | Bin 26704 -> 0 bytes .../latex/exam-n/sample/numerical1-solution.tex | 3 + .../doc/latex/exam-n/sample/numerical2.tex | 3 + .../doc/latex/exam-n/sample/numerical3.tex | 4 + .../doc/latex/exam-n/sample/sample_exam.pdf | Bin 191391 -> 0 bytes .../doc/latex/exam-n/sample/sample_exam.tex | 3 +- .../latex/exam-n/sample/sample_exam_solution.pdf | Bin 244992 -> 0 bytes .../latex/exam-n/sample/sample_exam_solution.tex | 3 +- .../texmf-dist/doc/latex/exam-n/sample/spiral.eps | 22 - .../texmf-dist/doc/latex/exam-n/sample/spiral.pdf | Bin 1799 -> 0 bytes Master/texmf-dist/doc/latex/exam-n/sample_exam.pdf | Bin 191391 -> 192111 bytes .../doc/latex/exam-n/sample_exam_solution.pdf | Bin 244992 -> 246164 bytes Master/texmf-dist/source/latex/exam-n/exam-n.drv | 8 +- Master/texmf-dist/source/latex/exam-n/exam-n.dtx | 450 ++++--- Master/texmf-dist/tex/latex/exam-n/exam-n.cls | 195 ++- Master/tlpkg/libexec/ctan2tds | 1 + 32 files changed, 1008 insertions(+), 1600 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/exam-n/A1.clo create mode 100644 Master/texmf-dist/doc/latex/exam-n/README.ctan delete mode 100644 Master/texmf-dist/doc/latex/exam-n/move-to-texmf/A1.clo delete mode 100644 Master/texmf-dist/doc/latex/exam-n/move-to-texmf/exam-n.cls create mode 100644 Master/texmf-dist/doc/latex/exam-n/notes-for-authors.tex create mode 100644 Master/texmf-dist/doc/latex/exam-n/sample/fig/spiral.eps create mode 100644 Master/texmf-dist/doc/latex/exam-n/sample/fig/spiral.pdf delete mode 100644 Master/texmf-dist/doc/latex/exam-n/sample/numerical1-solution.pdf delete mode 100644 Master/texmf-dist/doc/latex/exam-n/sample/sample_exam.pdf delete mode 100644 Master/texmf-dist/doc/latex/exam-n/sample/sample_exam_solution.pdf delete mode 100644 Master/texmf-dist/doc/latex/exam-n/sample/spiral.eps delete mode 100644 Master/texmf-dist/doc/latex/exam-n/sample/spiral.pdf diff --git a/Master/texmf-dist/doc/latex/exam-n/A1.clo b/Master/texmf-dist/doc/latex/exam-n/A1.clo new file mode 100644 index 00000000000..d40b8c26a96 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exam-n/A1.clo @@ -0,0 +1,82 @@ +\ProvidesFile{A1.clo}[2016/12/19 1.1.4] +\typeout{A1 exam options, 1.1.4} +%%%% Source: Mercurial revision e8a612cb25f4, 2016-12-19 16:49 +0000, tag exam-n-1.1.4 + 0 +%%%% File: A1.clo +%%%% Copyright 2005--2016, Norman Gray +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Norman Gray +%% +%% This work consists of the files exam-n.dtx and exam-n.ins, +%% the derived file exam-n.cls, +%% and the associated *.clo files. + +% Nothing here beyond the constants sheet +\constantssheet{ +\begin{center} +\def\e{{\rm e}}\def\deg{^\circ} +\def\dmin{^{\rm m}} +\def\dsec{^{\rm s}} +\def\ez{\epsilon_{\rm 0}} % permittivity of free space +\def\er{\epsilon_{\rm r}} % relative permittivity +\def\ep{\epsilon} % permittivity +\def\muz{\mu_{\rm 0}} % permeability of free space +\def\mur{\mu_{\rm r}} % relative permeability +\def\me{m_{\rm e}} % mass of the electron +\def\mprot{m_{\rm p}} % mass of the proton +\def\az{\a_{\rm 0}} % Bohr radius +\def\mub{\mu_{\rm B}} % Bohr magneton +% +\def\tothe#1{$^{#1}$} % raise to the power #1 +\def\metre{\,{\rm m}} +\def\kg{\,{\rm kg}} +\def\sec{\,{\rm s}} +\def\mm{\,{\rm mm}} +\def\mol{\,{\rm mol}} +\def\kelvin{\,{\rm K}} +\def\joule{\,{\rm J}} +\def\farad{\,{\rm F}} +\def\ampere{\,{\rm A}} +\def\ev{\,{\rm eV}} +\def\hz{\,{\rm Hz}} +\def\volt{\,{\rm V}} +\def\watt{\,{\rm W}} +\def\newton{\,{\rm N}} +\def\unit#1{\,{\rm #1}} +% +{\Large\textbf{Values of astrophysical constants}}\\[\bigskipamount] +\begin{tabular}{lll} \hline\\[-1.5ex] % slightly hacky extra space after hline + speed of light & $c$ & $2.998\times 10^8 \metre\sec^{-1}$\\ + gravitational constant & $G$ & $6.673\times10^{-11}\newton\metre^2\kg^{-2}$\\ + Planck constant & $h$ & $6.626\times10^{-34}\joule\sec$\\ + Boltzmann constant & $k_{\rm B}$ & $1.381\times10^{-23} \joule\kelvin^{-1}$\\ + Stefan-Boltzmann constant & $\sigma$ & $5.671\times10^{-8}\watt\metre^{-2}\kelvin^{-4}$\\ + Rydberg constant & $R_\infty$ &$1.097\times10^{7}\metre^{-1}$\\ + Avogadro constant & $N_{\rm A}$ & $6.022\times 10^{23}\unit{mol}^{-1}$\\ + gas constant & $R$ & $8.315 \joule\mol^{-1}\kelvin^{-1}$\\ + proton mass & $\mprot$ & $1.673\times10^{-27} \kg$\\ + electron mass & $\me$ & $9.109\times10^{-31} \kg$\\ + elementary charge & $e$ & $1.602\times 10^{-19}\unit{C}$\\ + electronvolt & ${\rm eV}$ & $1.602\times 10^{-19}\unit{J}$\\[3pt] + astronomical unit & au & $1.496\times10^{11} \metre$\\ + parsec & pc & $3.086\times10^{16}\metre$\\ + light year & ly & $9.461\times10^{15} \metre$\\[3pt] + solar mass & $M_\odot$ & $1.989\times10^{30} \kg$\\ + solar radius & $R_\odot$ & $6.960\times10^8 \metre$\\ + solar luminosity & $L_\odot$ & $3.826\times10^{26}\watt$\\ + Earth mass & $M_\oplus$ & $5.976\times10^{24} \kg$\\ + Earth radius & $R_\oplus$ & $6.378\times10^6 \metre$\\ + obliquity of the ecliptic & $\epsilon$ & $23^\circ\,26'$\\[\medskipamount] +\hline +\end{tabular} +\end{center} +} diff --git a/Master/texmf-dist/doc/latex/exam-n/README b/Master/texmf-dist/doc/latex/exam-n/README index ac55c1037a6..a128c336efe 100644 --- a/Master/texmf-dist/doc/latex/exam-n/README +++ b/Master/texmf-dist/doc/latex/exam-n/README @@ -1,6 +1,8 @@ -exam-n: LaTeX class file for exams, version 1.1, 2014 May 03. -[ Mercurial revision 6f818b549982, 2014-05-03 13:42 +0100, tag 1.1 + 0 ] +exam-n: LaTeX class file for exams, version 1.1.4, 2016 December 19. +==================================== + +[ Mercurial revision e8a612cb25f4, 2016-12-19 16:49 +0000, tag exam-n-1.1.4 + 0 ] Overview @@ -10,28 +12,31 @@ The class is designed to be localised to a particular institution's exam layout, by a suitably skilled LaTeX hacker. There are three possible ways of doing this, in increasing order of sophistication: - 1. Make suitable adjustments to individual exam `.tex` files. + 1. Make suitable adjustments to individual exam `.tex` files; or 2. Rename the distributed `exam-n.dtx` file to something more locally suitable, and edit it with suitable changes (search for - `%%%CONFIGURE` for hints on where to adjust). + `%%%CONFIGURE` for hints on where to adjust); or 3. Fork the Mercurial repository at [bitbucket](https://bitbucket.org/nxg/exam-n), change the value of the `EXAM-N` variable in the `Makefile`, and then edit the `exam-n.dtx` file. See the comments at the top of the - `Makefile`. The command `make dist` will assemble a tarball - release of the class file. + `Makefile`. -In the last two cases, if you change the `.dtx` file, you _must_ also -change its name, to avoid confusion. +In case 2, you _must_ change the name of the `.dtx` file, and in case +3, you must change the `EXAM-N` variable, to avoid terrible confusion +(you probably also want to avoid the names of the other exam style +files at CTAN, since they just might have found their way into your +TEXINPUTS path). For general details, talk to Norman Gray . This is free software, and you are encouraged to use and adapt it as -you see fit. If, however, you need more substantial help with the -customisations of option 3 above, or need continuing support, then -[Norman can help](http://8ameter.com), on a commercial basis. +you see fit. Norman can give advice. If, however, you need more +substantial help with the customisations of option 3 above, or need +continuing support, then we can surely arrange something more +elaborate. With the version 1.1 release, the interface should now be regarded as rather stable. However version 1.1 was the first to be released @@ -59,6 +64,6 @@ There are brief release notes in exam-n.html. Distribution and copyright -------------------------- -Copyright 2005--2014, Norman Gray +Copyright 2005--2016, Norman Gray Distributed under the terms of The LaTeX Project Public License (LPPL); see the file lppl.txt for details. diff --git a/Master/texmf-dist/doc/latex/exam-n/README.ctan b/Master/texmf-dist/doc/latex/exam-n/README.ctan new file mode 100644 index 00000000000..872ae0b92ad --- /dev/null +++ b/Master/texmf-dist/doc/latex/exam-n/README.ctan @@ -0,0 +1,3 @@ +On CTAN, this package lives in /macros/latex/contrib/exam-n. + +Its canonical CTAN URL is https://www.ctan.org/pkg/exam-n diff --git a/Master/texmf-dist/doc/latex/exam-n/exam-n-example.tex b/Master/texmf-dist/doc/latex/exam-n/exam-n-example.tex index 396c01ae8f0..b7287c67a58 100644 --- a/Master/texmf-dist/doc/latex/exam-n/exam-n-example.tex +++ b/Master/texmf-dist/doc/latex/exam-n/exam-n-example.tex @@ -6,10 +6,10 @@ %% %% exam-n.dtx (with options: `example') %% exam-n: format exam questions -%% Release version 1.1, 2014 May 03. +%% Release version 1.1.4, 2016 December 19. %% %%%% File: exam-n.dtx -%%%% Copyright 2005--2014, Norman Gray +%%%% Copyright 2005--2016, Norman Gray %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -27,7 +27,7 @@ %% the derived file exam-n.cls, %% and the associated *.clo files. -%%%% Source: Mercurial revision 6f818b549982, 2014-05-03 13:42 +0100, tag 1.1 + 0 +%%%% Source: Mercurial revision e8a612cb25f4, 2016-12-19 16:49 +0000, tag exam-n-1.1.4 + 0 %% diff --git a/Master/texmf-dist/doc/latex/exam-n/exam-n.html b/Master/texmf-dist/doc/latex/exam-n/exam-n.html index 438b017bf49..717d683aa95 100644 --- a/Master/texmf-dist/doc/latex/exam-n/exam-n.html +++ b/Master/texmf-dist/doc/latex/exam-n/exam-n.html @@ -14,11 +14,11 @@ dd ul { padding: 0pt; margin: 0pt; }

Format exam papers

-

Version 1.1, 2014 May 03.

+

Version 1.1.4, 2016 December 19.

Overview

@@ -68,9 +71,9 @@ little more detail within the class file documentation. as sectioning, per-part running marks, ‘Question n continued’ catchwords, and so on.
  • Designed to be locally adaptable.
  • -
  • The class file is freely adaptable (LPPL), but the author is -available for paid support if that is -useful.
  • +
  • The class file is freely adaptable (LPPL). The author can provide +the usual basic free-software support, or potentially more elaborate +support with a different arrangement.
  • The focus of the ‘exam-n’ class is on the careful collaborative @@ -78,11 +81,6 @@ process of assembling an exam, and many of the features are to do with checks to avoid mistakes. The result has, in effect, been validated by practice.

    -

    To install

    -

    Unpack the distribution tarball or zip -file, and move the directory move-to-texmf to some -location on the LaTeX search path. You're probably looking for a -directory called texmf-local, or something like that.

    Releases

    @@ -104,7 +102,44 @@ generically useful to other institutions.

    -
    1.1, 2014 May 3
    +
    1.1.4, 2016 December 19
    +
      +
    • Documentation: add notes about use of pdfpages.
    • +
    • Added [largefont] option. +Note: +option [hugefont] has replaced [bigfont]; +the latter is now deprecated, and may be removed in v1.2.
    • +
    • Use of the \part macro is now supported within +solutions (it produced the wrong numbers before), and there is a new +\StylePartNumber customisation macro.
    • +
    + +
    1.1.3
    +
      +
    • Version 1.1.3 was never released
    • +
    + +
    1.1.2, 2015 November 26
    +
      +
    • Handled trailing floats at end of document (generated by packages +such as rotating.
    • +
    • \label within question environment now refers to the +question number.
    • +
    • Work around a problem when a paragraph starts with {\bf ...} +rather than (post-1995) \textbf{...}.
    • +
    • \begin{questiondata} now starts a new paragraph.
    • +
    • Some documentation adjustments.
    • +
    + +
    1.1.1, 2014 November 27
    +
      +
    • Adjust \partmarks* behaviour; now behaves differently +within display maths (addresses +issue 1).
    • +
    • Various documentation and release fixes.
    • +
    + +
    1.1, 2014 May 3
    Converted to a generic class, exam-n, ready for wider distribution. Available on bitbucket @@ -119,7 +154,7 @@ and at CTAN.
    Norman Gray
    -2014 May 03 +2016 December 19
    diff --git a/Master/texmf-dist/doc/latex/exam-n/exam-n.pdf b/Master/texmf-dist/doc/latex/exam-n/exam-n.pdf index eceefe9c068..66e4392de81 100644 Binary files a/Master/texmf-dist/doc/latex/exam-n/exam-n.pdf and b/Master/texmf-dist/doc/latex/exam-n/exam-n.pdf differ diff --git a/Master/texmf-dist/doc/latex/exam-n/move-to-texmf/A1.clo b/Master/texmf-dist/doc/latex/exam-n/move-to-texmf/A1.clo deleted file mode 100644 index fd79818b0c2..00000000000 --- a/Master/texmf-dist/doc/latex/exam-n/move-to-texmf/A1.clo +++ /dev/null @@ -1,82 +0,0 @@ -\ProvidesFile{A1.clo}[2014/05/03 1.1] -\typeout{A1 exam options, 1.1} -%%%% Source: Mercurial revision 6f818b549982, 2014-05-03 13:42 +0100, tag 1.1 + 0 -%%%% File: A1.clo -%%%% Copyright 2005--2014, Norman Gray -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Norman Gray -%% -%% This work consists of the files exam-n.dtx and exam-n.ins, -%% the derived file exam-n.cls, -%% and the associated *.clo files. - -% Nothing here beyond the constants sheet -\constantssheet{ -\begin{center} -\def\e{{\rm e}}\def\deg{^\circ} -\def\dmin{^{\rm m}} -\def\dsec{^{\rm s}} -\def\ez{\epsilon_{\rm 0}} % permittivity of free space -\def\er{\epsilon_{\rm r}} % relative permittivity -\def\ep{\epsilon} % permittivity -\def\muz{\mu_{\rm 0}} % permeability of free space -\def\mur{\mu_{\rm r}} % relative permeability -\def\me{m_{\rm e}} % mass of the electron -\def\mprot{m_{\rm p}} % mass of the proton -\def\az{\a_{\rm 0}} % Bohr radius -\def\mub{\mu_{\rm B}} % Bohr magneton -% -\def\tothe#1{$^{#1}$} % raise to the power #1 -\def\metre{\,{\rm m}} -\def\kg{\,{\rm kg}} -\def\sec{\,{\rm s}} -\def\mm{\,{\rm mm}} -\def\mol{\,{\rm mol}} -\def\kelvin{\,{\rm K}} -\def\joule{\,{\rm J}} -\def\farad{\,{\rm F}} -\def\ampere{\,{\rm A}} -\def\ev{\,{\rm eV}} -\def\hz{\,{\rm Hz}} -\def\volt{\,{\rm V}} -\def\watt{\,{\rm W}} -\def\newton{\,{\rm N}} -\def\unit#1{\,{\rm #1}} -% -{\Large\textbf{Values of astrophysical constants}}\\[\bigskipamount] -\begin{tabular}{lll} \hline\\[-1.5ex] % slightly hacky extra space after hline - speed of light & $c$ & $2.998\times 10^8 \metre\sec^{-1}$\\ - gravitational constant & $G$ & $6.673\times10^{-11}\newton\metre^2\kg^{-2}$\\ - Planck constant & $h$ & $6.626\times10^{-34}\joule\sec$\\ - Boltzmann constant & $k_{\rm B}$ & $1.381\times10^{-23} \joule\kelvin^{-1}$\\ - Stefan-Boltzmann constant & $\sigma$ & $5.671\times10^{-8}\watt\metre^{-2}\kelvin^{-4}$\\ - Rydberg constant & $R_\infty$ &$1.097\times10^{7}\metre^{-1}$\\ - Avogadro constant & $N_{\rm A}$ & $6.022\times 10^{23}\unit{mol}^{-1}$\\ - gas constant & $R$ & $8.315 \joule\mol^{-1}\kelvin^{-1}$\\ - proton mass & $\mprot$ & $1.673\times10^{-27} \kg$\\ - electron mass & $\me$ & $9.109\times10^{-31} \kg$\\ - elementary charge & $e$ & $1.602\times 10^{-19}\unit{C}$\\ - electronvolt & ${\rm eV}$ & $1.602\times 10^{-19}\unit{J}$\\[3pt] - astronomical unit & au & $1.496\times10^{11} \metre$\\ - parsec & pc & $3.086\times10^{16}\metre$\\ - light year & ly & $9.461\times10^{15} \metre$\\[3pt] - solar mass & $M_\odot$ & $1.989\times10^{30} \kg$\\ - solar radius & $R_\odot$ & $6.960\times10^8 \metre$\\ - solar luminosity & $L_\odot$ & $3.826\times10^{26}\watt$\\ - Earth mass & $M_\oplus$ & $5.976\times10^{24} \kg$\\ - Earth radius & $R_\oplus$ & $6.378\times10^6 \metre$\\ - obliquity of the ecliptic & $\epsilon$ & $23^\circ\,26'$\\[\medskipamount] -\hline -\end{tabular} -\end{center} -} diff --git a/Master/texmf-dist/doc/latex/exam-n/move-to-texmf/exam-n.cls b/Master/texmf-dist/doc/latex/exam-n/move-to-texmf/exam-n.cls deleted file mode 100644 index 68a03b55c61..00000000000 --- a/Master/texmf-dist/doc/latex/exam-n/move-to-texmf/exam-n.cls +++ /dev/null @@ -1,1251 +0,0 @@ -%% -%% This is file `exam-n.cls', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% exam-n.dtx (with options: `package') -%% exam-n: format exam questions -%% Release version 1.1, 2014 May 03. -%% -%%%% File: exam-n.dtx -%%%% Copyright 2005--2014, Norman Gray -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Norman Gray -%% -%% This work consists of the files exam-n.dtx and exam-n.ins, -%% the derived file exam-n.cls, -%% and the associated *.clo files. - -%%%% Source: Mercurial revision 6f818b549982, 2014-05-03 13:42 +0100, tag 1.1 + 0 -%% - -\NeedsTeXFormat{LaTeX2e} -\ProvidesClass{exam-n}[2014/05/03 1.1] -\typeout{Class: `exam-n 1.1 <2014/05/03>} - - - -\newcount\@draftstatus -\@draftstatus=0 % default is final -\DeclareOption{compose}{\@draftstatus=2 - \@showsolutionstrue - \@pageperquestiontrue} -\DeclareOption{draft}{\@draftstatus=1 - \@showsolutionstrue - \@pageperquestionfalse} -\DeclareOption{final}{\@draftstatus=0 - \@showsolutionsfalse - \@pageperquestionfalse} -\newif\if@psfonts\@psfontsfalse -\DeclareOption{psfonts}{\@psfontstrue} -\DeclareOption{cmfonts}{\@psfontsfalse} -\newcount\examn@mtselect \examn@mtselect=0 -\DeclareOption{mathptm}{\@psfontstrue\examn@mtselect=0} -\DeclareOption{mathtime}{\@psfontstrue\examn@mtselect=1} -\DeclareOption{mtpro2}{\@psfontstrue\examn@mtselect=2} -\newif\ifexamn@serif -\examn@seriftrue -\DeclareOption{serif}{\examn@seriftrue} -\DeclareOption{sansserif}{\examn@seriffalse} -\newif\if@showsolutions -\@showsolutionsfalse -\DeclareOption{showsolutions}{\@showsolutionstrue} -\DeclareOption{noshowsolutions}{\@showsolutionsfalse} -\newif\if@pageperquestion -\@pageperquestionfalse -\DeclareOption{pageperquestion}{\@pageperquestiontrue} -\DeclareOption{nopageperquestion}{\@pageperquestionfalse} -\newif\if@perquestionmarks -\@perquestionmarkstrue -\DeclareOption{perquestionmarks}{\@perquestionmarkstrue} -\DeclareOption{noperquestionmarks}{\@perquestionmarksfalse} -\newif\if@showmarktotals -\@showmarktotalstrue -\DeclareOption{showmarktotals}{\@showmarktotalstrue} -\DeclareOption{noshowmarktotals}{\@showmarktotalsfalse} -\newif\if@twosidepages -\@twosidepagesfalse -\DeclareOption{twoside}{\@twosidepagestrue} -\DeclareOption{oneside}{\@twosidepagesfalse} -\newif\if@fleqn -\@fleqnfalse -\DeclareOption{fleqn}{ - \@fleqntrue - \PassOptionsToPackage{fleqn}{amsmath} - \PassOptionsToClass{fleqn}{article} -} -\newif\if@fussydescription -\@fussydescriptiontrue -\DeclareOption{sloppydescription}{\@fussydescriptionfalse} -\def\examn@header@shoutformat#1{{\Large\bfseries #1}} -\DeclareOption{mono}{ - \PassOptionsToPackage{monochrome}{color} - \def\examn@header@shoutformat#1{{\Huge\bfseries #1}} -} -\DeclareOption{colour}{} -\newif\ifbigfont -\bigfontfalse -\DeclareOption{bigfont}{\bigfonttrue} -\PassOptionsToClass{a4paper}{article} -\newtoks\@styleoverrides -\@styleoverrides={} -\def\OverrideFormatting{\@styleoverrides=} -\newtoks\@constantstoks -\def\@@displayconstants{% - \clearpage - \begingroup - \the\@constantstoks - \endgroup - \clearpage } -\newtoks\@constantstoks -\@constantstoks={} -\let\@displayconstants\relax -\def\constantssheet{\let\@displayconstants\@@displayconstants - \@constantstoks=} -\AtBeginDocument{\the\@styleoverrides} -\DeclareOption*{\InputIfFileExists{\CurrentOption.clo}{} - {\ClassError{exam-n} - {Bad option \CurrentOption} - {I don't understand the option \CurrentOption\MessageBreak - (I didn't find file \CurrentOption.clo, if that's what you meant)}}} -\InputIfFileExists{exam-n.config}{}{} -\ProcessOptions -\if@twosidepages - \PassOptionsToClass{twoside}{article} -\else - \PassOptionsToClass{oneside}{article} -\fi -\PassOptionsToClass{12pt}{article} -\PassOptionsToPackage{final}{graphicx} -\PassOptionsToPackage{final}{pdfpages} -\def\UniLogo#1{\vbox to 15.5mm{% - \hrule - \vss\hbox to #1{% Aspect ratio of logo is 100x31 - \hss no logo available\hss - }% - \vss - \hrule}} -\RequirePackage[english]{babel} % UK hyphenation -\RequirePackage{amsmath} -\RequirePackage{color} -\LoadClass{article} -\def\examn@setdocident{% - \begingroup - % yes, a big \ifcase would be more straightforward; - % no, that wouldn't be any fun at all - % (also it ends up looking messy and even tricksier). - \def\@step##1##2\@nil{\advance\@tempcnta##1 \def\@tempa{##2}} - \def\@tempa{{31}{28}{31}{30}{31}{30}{31}{31}{30}{31}{30}{31}}% - \@tempcnta=\day % day of month - \@tempcntb=\month % month of year (unit-offset) - \loop - \advance\@tempcntb-1 - \ifnum \@tempcntb>0 - \expandafter\@step\@tempa\@nil - \repeat - \@tempcntb=\year % yes, do calculate leap years - \divide\@tempcntb 4 \multiply\@tempcntb 4 - \ifnum\@tempcntb=\year - \ifnum\month>2 % but let's not worry about century years... - \advance\@tempcnta 1 - \fi - \fi - % remove any \\ or ~ in the coursecode fields - \let\\\space - \let~\space - \xdef\examn@docident{% first element is based on uni/school course code - \ifx\@coursetitle\@empty - \ifx\@schoolcoursecode\@empty - exam% - \else - \@schoolcoursecode - \fi - \else - \@coursetitle - \fi - /\the\@tempcnta % day-of-year - -\the\time} % minutes since midnight - \endgroup -} -\RequirePackage{ifpdf} -\def\@SetDocumentInfo{% - \ifpdf - {\pdfinfo{/Title (\examn@docident)}}% - % Don't put out an /Author(xxx) info entry -- there may be - % multiple authors, and it isn't obviously useful - \fi -} -\AtBeginDocument{\examn@setdocident\@SetDocumentInfo} -\if@psfonts - \ifcase\examn@mtselect - \ifexamn@serif - \RequirePackage{times} - \else - \RequirePackage{helvet} - \fi - \RequirePackage{mathptm} - \ClassWarningNoLine{exam-n}{Using mathptm fonts} - \or % use mathtime fonts - \RequirePackage[LY1]{fontenc} % specify text font encoding - \RequirePackage[LY1,mtbold]{mathtime} % switch math fonts - \ifexamn@serif - \RequirePackage{times} - \else - \RequirePackage{helvet} - \fi - \ClassWarningNoLine{exam-n}{Using Mathtime fonts} - \or % use mtpro2 fonts - \RequirePackage[T1]{fontenc} - \RequirePackage{textcomp} - \ifexamn@serif - \renewcommand\rmdefault{ptm} % the default - \else - \RequirePackage[scaled=0.9]{helvet} - \renewcommand\rmdefault{phv} - \fi - \RequirePackage[mtpbb]{mtpro2} - \ClassWarningNoLine{exam-n}{Using MTPro2 fonts} - \else - \ClassError{exam-n}{Impossible value of mtselect: \examn@mtselect} - \fi -\else - \ClassWarningNoLine{exam-n}{Using CM fonts} -\fi -\def\examn@bodyfontchange{} -\ifexamn@serif \else - \ClassWarningNoLine{exam-n}{Using sans serif fonts} - \DeclareRobustCommand\normalfont - {\usefont\encodingdefault\sfdefault\seriesdefault\shapedefault \relax} -\fi -\ifbigfont - \def\examn@bodyfontchange{ - \renewcommand\normalsize{% - \@setfontsize\normalsize{36}{42}% - \abovedisplayskip 36\p@ \@plus7\p@ \@minus17.5\p@ - \abovedisplayshortskip \z@ \@plus10.5\p@ - \belowdisplayshortskip 21\p@ \@plus10.5\p@ \@minus10.5\p@ - \belowdisplayskip \abovedisplayskip - \let\@listi\@listI} - \parindent=48pt - \parskip=36pt - % Redefine \FormatPartMarks so that it doesn't push the text off the paper - \def\FormatPartMarks##1{ - \setbox0=\hbox{\hskip 1em \textbf{[##1]}} - \@tempdima=0.8\marginsize - \ifdim\wd0>\@tempdima - \advance\@tempdima -\wd0 - \hbox to 0pt{\hskip\@tempdima \box0\hss}% - \else - \hbox to 0pt{\box0\hss} - \fi}} -\fi -\def\@exambanner{} -\def\exambanner{\def\@exambanner} - -\def\@schoolcoursecode{} -\def\schoolcoursecode{\def\@schoolcoursecode} - -\def\@universitycoursecode{} -\def\universitycoursecode{\def\@universitycoursecode} - -\def\@paperident{} -\def\paperident{\def\@paperident} - -\def\@examdate{} -\def\examdate{\def\@examdate} - -\def\@examtime{} -\def\examtime{\def\@examtime} - -\def\@coursetitle{} -\def\coursetitle{\def\@coursetitle} -\def\@degreedescriptions{} -\def\degreedescriptions{\def\@degreedescriptions} -\def\@displaydegreedescriptions{% - \let\@tempb\leavevmode - \def\dd##1\\{% - \def\@tempa{##1}% - \ifx\@tempa\@empty - \let\next\relax - \else - \@tempb\hbox{##1}\let\next\dd - \fi - \def\@tempb{\discretionary{}{}{\kern0.5em--\kern0.5em}}% - \next} - \expandafter\dd\@degreedescriptions\\} -\def\@rubric{} -\def\rubric{\long\def\@rubric} -\def\norubric{\let\@rubric\@nnil} - -\def\@baserubric{% -\textbf{Answer each question in a separate booklet}\par -Candidates are reminded that devices able to store or display text or -images may not be used in examinations without prior arrangement. -\if@perquestionmarks - \par - Approximate marks are indicated in brackets as a guide for candidates. -\fi -} -\def\baserubric{\long\def\@baserubric} -\def\@numquestions{} -\def\numquestions{\def\@numquestions} -\def\CheckTotalQuestions{% - \ifnum\@draftstatus < 2 - \ifx\@numquestions\@empty \else - \ifnum\questionnumber=\@numquestions \else - \ClassWarning{exam-n} - {Expected \@numquestions\space questions, got \the\questionnumber!} - \ifnum\@draftstatus > 0 % draft mode - \begin{center} - \textbf{\highlighted{Expected \@numquestions\space questions, got \the\questionnumber}} - \end{center} - \fi - \fi - \fi - \fi -} -\if@fleqn - \mathindent\parindent - \@mathmargin=\parindent -\fi -\newdimen\marginsize - \marginsize=35mm - -\headheight=15pt -\headsep=15pt -\definecolor{meta}{rgb}{0.7,0.2,0.2} -\def\highlighted{\textcolor{meta}} -\definecolor{solutiontext}{rgb}{0.2,0.2,0.5} -\definecolor{discreettext}{rgb}{0.6,0.6,0.6} -\newcommand\@settextblock[1]{ - \textwidth=\paperwidth - \advance\textwidth -2\marginsize - \textheight=\paperheight - \advance\textheight -2\marginsize - \oddsidemargin=\marginsize - \advance\oddsidemargin -1in - \advance\oddsidemargin -#1 - \evensidemargin=\oddsidemargin - \topmargin=\marginsize - \advance\topmargin -\headheight - \advance\topmargin -\headsep - \advance\topmargin -1in - \marginparwidth=\marginsize - \advance\marginparwidth -1.5cm - \advance\marginparwidth #1 -%% \typeout{paperwidth=\the\paperwidth, paperheight=\the\paperheight, -%% textwidth=\the\textwidth, textheight=\the\textheight, -%% oddsidemargin=\the\oddsidemargin, -%% headheight=\the\headheight, headsep=\the\headsep, topmargin=\the\topmargin} - \marginparsep=0.5cm -} - -\ifnum\@draftstatus > 0 - \@settextblock{2cm} -\else - \@settextblock{0pt} -\fi -\let\leftnudge\@settextblock -\renewcommand\@marginparreset{% - \reset@font - \@setminipage - \raggedright - \small -} -\setlength{\parindent}{2em} -\setlength{\parskip}{\bigskipamount} -\ifcase\@draftstatus % Final version - \def\ClosingText{ - \begin{center}\textbf{End of Paper}\\\end{center} - \mark{END}} -\or % Draft version - \def\ClosingText{ - \begin{center}\textbf{End of Draft Paper}\\\end{center} - \mark{END}} -\else % Compose version (nothing, because this would be on a page by itself) - \def\ClosingText{\mark{END}} -\fi -\RequirePackage{fancyhdr} -\pagestyle{fancy} -\setlength{\headwidth}{\textwidth} -\renewcommand{\headrulewidth}{0pt} -\renewcommand{\footrulewidth}{0pt} -\fancyhead{} -\fancyfoot{} -\fancyfoot[L]{{\tiny\textcolor{discreettext}{% - \ifx\@paperident\@empty\examn@docident\else\@paperident\fi -}}} -\fancyfoot[R]{% - \def\@tempa{END} - \xdef\examn@topmark{\botmark} - \ifx\examn@topmark\@empty - \formatcontinuations{Paper continued over}% - \else\ifx\examn@topmark\@tempa - \formatcontinuations{END} - \else - \formatcontinuations{Q\,\examn@topmark\ continued over\dots}% - \fi\fi -} -\fancyfoot[C]{\thepage/\pageref{lastpage}} -\def\examn@topmark{} -\ifnum\@draftstatus=0 - \fancyhead[L]{% - \ifx\examn@topmark\@empty \else - \formatcontinuations{Q\,\examn@topmark\ continued}% - \fi - } -\fi -\def\examn@bighead#1{\strut\vbox to 0pt{\vss\hbox{\examn@header@shoutformat{#1}}\vskip 10mm}} -\ifnum\@draftstatus = 1 - \if@showsolutions - \fancyhead[C]{\examn@bighead{\highlighted{DRAFT + SOLUTIONS, p\thepage/\pageref{lastpage}}}} - \else - \fancyhead[C]{\examn@bighead{\highlighted{DRAFT, p\thepage/\pageref{lastpage}}}} - \fi -\else - \if@showsolutions - % Add a very prominent banner - \fancyhead[C]{\examn@bighead{\highlighted{SHOWING SOLUTIONS}}} - \fi -\fi -\def\formatcontinuations#1{\textbf{#1}} -\def\WriteLastPageLabel{\label{lastpage}} -\def\ps@titlepage{ - \def\@oddhead{} - \def\@oddfoot{\xdef\examn@topmark{\botmark}} -} -\renewcommand\maketitle{ - \ifnum\@draftstatus < 2 % final or draft version - \ifx\@examdate\@empty - \ClassError{exam-n} - {No exam date given} - {Specify an exam date using \protect\examdate} - \fi - \ifx\@examtime\@empty - \ClassError{exam-n} - {No exam time given} - {Specify an exam time using \protect\examtime} - \fi - \ifx\@exambanner\@empty - \ClassError{exam-n} - {No exam banner given} - {Specify an exam banner (eg Examination for the degree...) using \protect\exambanner} - \fi - \if@fussydescription - \ifx\@schoolcoursecode\@empty - \ClassError{exam-n} - {No school course code given} - {Specify a school course code (eg P304H) using \protect\schoolcoursecode} - \fi - \ifx\@universitycoursecode\@empty - \ClassError{exam-n} - {No paper title given} - {Specify a university course code (eg PHYS3031) using \protect\universitycoursecode} - \fi - \ifx\@coursetitle\@empty - \ClassError{exam-n} - {No course title given} - {Specify a course title (eg Quantum Mechanics) using \protect\coursetitle} - \fi - \ifx\@degreedescriptions\@empty - \ClassError{exam-n} - {No paper subject given} - {Specify a 'degree description' (eg Physics 3) using \protect\degreedescriptions} - \fi - \ifx\@rubric\@empty - \ClassError{exam-n} - {No rubric given} - {Specify a rubric using \protect\rubric, or declare its absence with \protect\norubric} - \fi - \fi - \thispagestyle{titlepage} - \begin{center} - \null - \vskip -1.5cm - \if@showsolutions - \nointerlineskip - \vbox to 0pt{\vss - \examn@header@shoutformat{\shout{SHOWING SOLUTIONS}} - \vskip 1.5\bigskipamount} - \else - \ifnum\examn@shoutcounttotal>0 - \typeout{SHOUTS: \the\examn@shoutcounttotal} - \nointerlineskip - \vbox to 0pt{\vss - \examn@header@shoutformat - {\highlighted{SHOUTS: \the\examn@shoutcounttotal\ (see end)}} - \vskip 1.5\bigskipamount} - \fi - \fi - \nointerlineskip - \hbox to \textwidth{% date and time - \vbox to 0pt{\vskip-2ex \UniLogo{50mm}\vss} - \hss - \setbox0=\hbox{\vtop{% \vtop or \vbox here? - % Opinions differ: - % This week, Norman prefers \vtop because it gives a cleaner top line. - \hsize=0.5\textwidth - \leftskip=0pt plus1fil \rightskip=0pt \parfillskip=0pt - \baselineskip=2.5ex - \parskip=0.25ex - \let\\\par - \ifx\@examdate\@empty - \shout{missing exam date} - \else - \@examdate - \fi - \par - \ifx\@examtime\@empty - \shout{missing exam time} - \else - \@examtime - \fi - \par}} - \dp0=0pt - \box0} - \vskip4\bigskipamount - %\UoGname\\[\medskipamount] - {\uppercase\expandafter{\@exambanner}}\\[\medskipamount] - \vbox{}\hrule - \ifx\@degreedescriptions\@empty\else - \@displaydegreedescriptions\\ - \fi - \vskip 2\baselineskip plus 0.3fil - \def\@tempa{\def\@tempa{\vskip 0.5\baselineskip}} - \ifx\@schoolcoursecode\@empty\else - \@tempa - {\large\textbf{\@schoolcoursecode}} - \fi - \ifx\@universitycoursecode\@empty\else - \@tempa - {\large\textbf{[~\@universitycoursecode~]}} - \fi - \ifx\@coursetitle\@empty\else - \setbox0=\hbox{\Huge\textbf{\@coursetitle}} - \ifdim\wd0>\columnwidth - \setbox0=\hbox{\LARGE\textbf{\@coursetitle}} - \ifdim\wd0>\columnwidth - % we're not going any smaller than this - \setbox0=\vbox{\hsize\columnwidth - \Large\bfseries - \@coursetitle} - \fi - \fi - \vskip 1.2\ht0 % generous vertical skip, size-dependent - \ifhbox0 - \hbox to \columnwidth{\hss\box0\hss} - \else - \box0 - \fi - \fi - \vskip 2\baselineskip plus 0.3fil - \parindent=0pt - \parskip=0.5\baselineskip - \ifbigfont - % Don't put the rubric here (see below) - \else - \ifx\@rubric\@empty\else - \ifx\@rubric\@nnil\else - % if there's a rubric, separate from the base rubric, then - % separate the two with an hrule (the per-exam rubric - % presumably represents special instructions for this exam, - % so should be highlighted - \vbox{\let\emph\textbf - \@rubric - \par} - \vskip2\baselineskip - \hrule - \vskip1.5\baselineskip - \fi - \fi - \ifx\@baserubric\@empty \else - \@baserubric \par - \fi - \fi % end \ifbigfont\else - \end{center} - \vskip 2\baselineskip plus 0.6fil % \newpage is {\vfil\penalty-\@M} - \vbox to 0pt{\hbox to \textwidth{% - \tiny - \textcolor{discreettext} - {\hfil\ifx\@paperident\@empty\examn@docident\else\@paperident\fi\hfil}}\vss} - \penalty -\@M - \@displayconstants - \else % compose version - \begin{tabular}{rl} - \textbf{Exam}& - {\def\\{ / }\@schoolcoursecode}\\ - \textbf{Course codes}& - \@universitycoursecode\\ - %% \textbf{Subject}& - %% {\def\and{and}\begin{tabular} - %% {\@degreedescriptionstemplate}\@degreedescriptions - %% \end{tabular}}\\ - \textbf{Date \& time}& - {\def\\{, }\@examdate, \@examtime}\\ - \end{tabular} - \fi - \ifcase\@draftstatus - % Final version - \typeout{Exam \@schoolcoursecode: FINAL VERSION} - \or % Draft version - \typeout{Exam \@schoolcoursecode: DRAFT VERSION} - \else % Compose version - \typeout{Exam \@schoolcoursecode: COMPOSE VERSION} - \fi - % - \examn@bodyfontchange - \normalfont\normalsize - \ifbigfont - % Put the rubric on a second page, in the 'huge' size. - \begin{center} - \parskip=18pt - \let\emph\textbf \@rubric\par - \vskip\baselineskip - \hrule - \vskip\baselineskip - \ifx\@baserubric\@empty \else - \@baserubric \par - \fi - \end{center} - \newpage - \fi -} -\setcounter{secnumdepth}{0} -\renewcommand\section{ - \@ifundefined{@currentquestion}\@@section - {\ClassError{exam-n}{Misplaced section} - {You can't have a section inside a question;\MessageBreak - move it before the {question} environment starts}}} -\newcommand\@@section{\@startsection{section}{1}{\z@}% - {-3.5ex \@plus -1ex \@minus -.2ex}% - {1ex \@plus.1ex \@minus 0.5ex}% - {\fmt@section}} -\def\fmt@section#1{% - \examn@prequestionspace{} - \hbox to \textwidth{{\hfil\bfseries SECTION #1\hfil}}% -} -\renewcommand\subsection{ - \@ifundefined{@currentquestion}\@@subsection - {\ClassError{exam-n}{Misplaced subsection} - {You can't have a subsection inside a question;\MessageBreak - move it before the {question} environment starts}}} -\newcommand\@@subsection{\@startsection{subsection}{2}{\z@} - {-2ex \@plus -3ex \@minus -0.2ex} - {0.5ex \@plus .1ex \@minus 0.1ex} - {\fmt@subsection}} -\def\fmt@subsection#1{% - \examn@prequestionspace{} - \noindent\textbf{#1}} -\let\sectionmark\@gobble -\let\subsectionmark\@gobble -\def\@badsection#1#2{\ClassError{guexam}{Bad section} - {The exam class goes not support subdivisions like #1{#2}}} -\def\subsubsection{\@badsection{subsubsection}} -\def\paragraph{\@badsection{paragraph}} -\def\subparagraph{\@badsection{subparagraph}} -\newcount\marktotal % number of marks accumulated so far -\newcount\markgoal % number of marks we should have in the end - -\newcount\questionnumber -\questionnumber=0 -\newcounter{partnumber} -\renewcommand\part{% - \if@nobreak \else - \par - \@nobreakfalse - \fi - \ifvmode - \vskip 0pt plus 4\bigskipamount - \penalty-50 - \fi - \stepcounter{partnumber}% - \noindent\FormatPartNumber -} -\newcommand\FormatPartNumber{\hbox to \parindent{(\alph{partnumber})\hss}} -\newif\if@newpagebeforequestion -\if@pageperquestion - \@newpagebeforequestiontrue -\else - \@newpagebeforequestionfalse -\fi -\def\examn@prequestionspace#1{% - \if@pageperquestion - \if@newpagebeforequestion - % Add all the stretchability here, rather than stretching out - % displays and lists above this on the page. - \newpage - % Clear the \@newpagebeforequestion flag, to suppress the action - % of any following calls to \examn@prequestionspace, until the end - % of the next question. - \global\@newpagebeforequestionfalse - \fi - \else - #1% - \fi -} -\long\def\examn@endquestion#1{% - \mark{} % the position of this call is slightly sensitive (but this works) - \if@pageperquestion - \global\@newpagebeforequestiontrue - \fi - #1 - \@nobreakfalse - \everypar{} -} -\def\partmarks{% - \@ifstar{\@tempswatrue \@partmarks}{\@tempswafalse \@partmarks}} -\newdimen\@partmarksspace - \@partmarksspace=2em % default value -\def\@partmarks#1{% - \if@perquestionmarks - \if@insolution - % visual display only -- doesn't count towards mark total - \setbox0=\vbox to 0pt{\vss - \hbox to \textwidth{\hfil\hbox to 0pt{\quad\small[\dots #1]\hss}} - \vskip0.25ex } - % the next line is probably unnecessary, but guarantees that box0 - % has zero depth, so no extra vertical space appears because of - % this new box - \dp0=0pt - \ifvmode - \box0 - \else - \vadjust{\nointerlineskip\box0}% - \fi - \else - \global\advance\marktotal #1 - \if@tempswa - \setbox0=\vbox to 0pt{\vss - \hbox to \textwidth{\strut\hfill\FormatPartMarks{#1}}% - \vskip 1\baselineskip} % vskip means box has zero depth - \ifvmode - \box0 - \else - \vadjust{\box0}% - \fi - \else - \ifdim\@partmarksspace > 0pt - {\unskip\nobreak\hfil\penalty50 \hskip\@partmarksspace - \hbox{}\nobreak\hfil\FormatPartMarks{#1}% - \parfillskip=0pt \finalhyphendemerits=0 \par} - \else - \unskip\nobreak\hfill\FormatPartMarks{#1}\par - \fi - \fi - \fi - \else - \ClassError{exam-n}{\string\partmarks\ is not compatible with - noperquestionmarks}{Either remove \string\partmarks\ or remove - the noperquestionmarks option} - \fi - \ignorespaces -} -\@endparpenalty=\@M - -\newcommand\FormatPartMarks[1]{\hbox to 0pt{\hskip1em \textbf{[#1]}\hss}} -\@partmarksspace=\z@ -\newcommand\question{% - \if@perquestionmarks - \let\ex@next\@questionmarks - \else - \let\ex@next\@questionnomarks - \fi - \@ifnextchar[%] - {\ex@next}{\ex@next[]}} -\def\@questionmarks[#1]#2{% - \def\@tempa{#2}% marks available for this question - \ifx\@tempa\@empty - \ClassError{exam-n} - {Missing mark goal for question (using 0 instead)} - {Missing mark goal for question (using 0 instead)} - \def\@tempa{0} - \fi - \ifx\@includequestionoverridenumber\@empty - \do@question{#1}{\@tempa}% - \else - \ClassWarning{exam-n}{Forcing question number - \@includequestionoverridenumber, in included question #2} - \do@question{\@includequestionoverridenumber}{\@tempa}% - \fi -} -\def\@questionnomarks[#1]{% - \do@question{#1}{0}% -} -\newcount\ex@nmcq -\ex@nmcq=-1 -\newcount\ex@mcqnanswer -\def\multiplechoiceanswers#1{\ex@nmcq=#1} -\newenvironment{mcq} - {\parindent=0pt - \ifnum\ex@nmcq<1 - \ClassError{exam-n} - {mcq environment without preceding multiplechoiceanswers declaration} - {The mcq environment may only be used if the number of - permitted MCQ answers has been declared with \string\multiplechoiceanswers} - \else - \def\item{\@tempswafalse\ex@mcqitem} - \def\answer{\@tempswatrue\ex@mcqitem} - \ex@mcqi=0 - \ex@mcqnanswer=0 - \do@question{}{1} - \fi} - {\par - \ifnum\ex@mcqi<\ex@nmcq - \ClassWarning{exam-n}{Too few potential answers in MCQ \the\questionnumber} - \@shout{Too few potential answers in MCQ \the\questionnumber} - \ifnum\@draftstatus > 0 - \highlighted{TOO FEW ANSWERS}\par - \fi - \fi - \ifcase\ex@mcqnanswer - \ClassWarning{exam-n} - {No correct MCQ answer provided in question \the\questionnumber} - \@shout{No correct MCQ answer provided in question \the\questionnumber} - \ifnum\@draftstatus > 0 - \highlighted{NO CORRECT ANSWER PROVIDED}\par - \fi - \or - % ex@mcqanswer=1: correct -- do nothing - \else - \ClassWarning{exam-n} - {Too many correct MCQ answers provided in question \the\questionnumber} - \@shout{Too many correct MCQ answers provided in question \the\questionnumber} - \ifnum\@draftstatus > 0 - \highlighted{TOO MANY CORRECT ANSWERS}\par - \fi - \fi - \examn@endquestion{\relax} - } -\newcount\ex@mcqi -\def\ex@mcqitem{% - \par - \ifnum\ex@mcqi=0 - % first one - \smallskip - \parskip=0pt % nothing fancy -- we assume these won't spread - % over more than one line - \advance\leftskip by 2em - \fi - \advance\ex@mcqi by 1 - \noindent - \if@tempswa - % the correct answer - \advance\ex@mcqnanswer 1 - \if@showsolutions - \hbox to 0pt{\hss \highlighted{$\Longrightarrow$ \@Alph\ex@mcqi . }}% - \else - \hbox to 0pt{\hss \@Alph\ex@mcqi . }% - \fi - \else - \hbox to 0pt{\hss \@Alph\ex@mcqi . }% - \fi -} -\def\do@question#1#2{% - \par % get that out of the way... - \markgoal=#2 - \marktotal=0 - \ifx\examn@questionpreamble\@empty - \else - \vspace{2\baselineskip} - \hbox to \textwidth{\hfil\textbf{\examn@questionpreamble}\hfil} - \questionpreamble{} - \fi - \setcounter{partnumber}{0} - \global\advance\questionnumber 1 - \examn@prequestionspace{% - \if@nobreak - % after a heading (or something like that) - \else - % we're not forcing a new page here, but this would be a good point to choose - \vskip 2\baselineskip plus 8\baselineskip - \penalty-200 - \fi - } - \if@questionnumberchecks - \def\@tempa{#1}% intended question number - \ifx\@tempa\@empty - % no optional argument -- easy - \def\@currentquestion{\the\questionnumber} - \else - \setbox0=\hbox{\@tempcnta=#1} - \ifdim\wd0>0pt - \ClassWarning{exam-n}{Non-numeric question number, #1. - You probably want to put \string\QuestionNumberChecksOff in the preamble} - \par\textbf{Non-numeric question number, #1. - You probably want to put \hbox{$\backslash$\ttfamily QuestionNumberChecksOff} in the preamble} - (the formatting below may be messed up).\par - \fi - \ifcase\@draftstatus - % Final version - \@tempcnta=#1 - \ifnum\questionnumber=\@tempcnta - \def\@currentquestion{#1} - \else - \ifx\@includequestionoverridenumber\@empty - \ClassError{exam-n} - {\string\question[#1] is actually question \the\questionnumber!} - {The question in {question} environment number - \the\questionnumber\space is specified as - \string\question[#1].\MessageBreak - This is an error in 'final' mode.\MessageBreak - Perhaps you need \string\QuestionNumberChecksOff?} - \def\@currentquestion{???} - \else - \ClassWarning{exam-n}{Forcing question number \@includequestionoverridenumber, - in {question} environment number \the\questionnumber} - \edef\@currentquestion{\@includequestionoverridenumber}% this doesn't seem to expand in fact! - \message{current question=\@currentquestion, override \@includequestionoverridenumber} - \fi - \fi - \or - % Draft version -- let the given number override - % \the\questionnumber, but warn if there's a difference. - \@tempcnta=#1 - \ifnum\questionnumber=\@tempcnta \else - \ClassWarning{exam-n} - {\string\question[#1] is actually question \the\questionnumber!} - \fi - \def\@currentquestion{#1} - \else - % compose mode -- argument overrides without question - \def\@currentquestion{#1} - \fi - \fi - \else - % skip question-number checks - \def\@tempa{#1}% intended question number - \ifx\@tempa\@empty - % no optional argument -- this is possibly an error, so warn - \ClassWarning{exam-n}{\string\QuestionNumberChecksOff\ is in - force, but this question has no [number]} - \def\@currentquestion{\the\questionnumber} - \else - \typeout{Forcing question \the\questionnumber\space to be #1} - \def\@currentquestion{#1} - \fi - \fi - \everypar{\setbox0=\lastbox % discard \box0 - \FormatQuestionNumber - \mark{\@currentquestion}% - \everypar{}} -} -\newcommand\FormatQuestionNumber - {\hbox to 0pt{\hss \textbf{\@currentquestion}\hskip1em}} -\def\endquestion{% - \ifnum\marktotal=\markgoal - \typeout{Question \@currentquestion\if@perquestionmarks, \the\marktotal\space marks\fi} - \iffalse % all of this is redundant, and ends up too shouty - \ifcase\@draftstatus - % Final version -- do nothing - \relax - \or % draft version - \relax % no, the above is too much; do nothing - \else % compose version - \par - \hfil\textbf{\highlighted{[Q\,\@currentquestion\if@perquestionmarks, \the\marktotal\space marks\fi]}}% - \break - \fi - \fi - \else - \ClassWarning{exam-n} - {Question \@currentquestion\space has a total of \the\marktotal\space marks, - \MessageBreak - when it should have \the\markgoal} - \begin{center} - \edef\@tempa{Question \@currentquestion\space - has a total of \the\marktotal\space marks, - when it should have \the\markgoal} - \expandafter\shout\expandafter{\@tempa} - \end{center} - \fi - \examn@endquestion{% - \if@showmarktotals - \par % into vertical mode - \nobreak % keep the marks total with the question - \vbox to 2\baselineskip{ - \vss - % this should be very similar to the call to - % \FormatPartMarks in \@partmarks, above - \hbox to \textwidth{\strut\hfill\FormatPartMarks{Total: \the\markgoal - \ifnum\@draftstatus>0 - % in draft modes, put a fairly discreet confirmation in the total - \space - \highlighted{\ifnum\marktotal=\markgoal OK\else X\fi}% - \fi}}} - \fi - } -} -\newenvironment{questiondata}{% - \penalty50 % poor break - \vbox\bgroup - \slshape - \parindent=0pt \parskip=\medskipamount - \smallskip - \hrule - \nobreak - \smallskip - \noindent \ignorespaces -}{% - \par - \nobreak - \medskip - \hrule width \textwidth - \par - \egroup -} -\newcommand\questionpreamble[1]{\gdef\examn@questionpreamble{#1}} -\let\examn@questionpreamble\@empty -\newif\if@questionnumberchecks -\@questionnumbercheckstrue -\newcommand\QuestionNumberChecksOff{\@questionnumberchecksfalse} -\def\enumerate{% - \ifnum \@enumdepth >\thr@@\@toodeep\else - \advance\@enumdepth\@ne - \edef\@enumctr{enum\romannumeral\the\@enumdepth}% - \expandafter - \list - \csname label\@enumctr\endcsname - {\usecounter\@enumctr - \topsep0pt - \partopsep0pt - %\parskip=5.0pt \parsep=\parskip - \def\makelabel##1{\hss\llap{##1}}}% - \fi} -\def\itemize{% - \ifnum \@itemdepth >\thr@@\@toodeep\else - \advance\@itemdepth\@ne - \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% - \expandafter - \list - \csname\@itemitem\endcsname - {\topsep0pt - \partopsep0pt - \def\makelabel##1{\hss\llap{##1}}}% - \fi} -\renewcommand\theenumi{\@roman\c@enumi} -\newcommand\comment[1]{% - \ifnum\@draftstatus > 0 - \marginpar{\highlighted{#1}}% - % should we \@shout this, too? - \fi - \ignorespaces -} -\renewcommand\author[1]{\comment{Author: #1}} -\newtoks\@allshouts \@allshouts={} -\def\@shout#1{\edef\@tempa{#1}\expandafter\@@shout\expandafter{\@tempa}} -\def\@@shout#1{\global\@allshouts=\expandafter{\the\@allshouts\t{#1}}} -\def\showthe@shouts{% - {\def\t##1{{\LARGE\noindent\highlighted{NOTE: ##1}\par}}% - \the\@allshouts}% - % Remark on the number of shouts in the aux file - {\@tempcnta=0 \def\t##1{\advance\@tempcnta1}\the\@allshouts - \protected@write\@auxout{}% - {\string\examn@shoutcount{\the\@tempcnta}}}} -\def\shout#1{\textbf{\highlighted{#1}}\@shout{#1}} -\newcount\examn@shoutcounttotal -\examn@shoutcounttotal=0 -\def\examn@shoutcount#1{\global\examn@shoutcounttotal=#1} -\def\dummy@documentclass{% - \@ifnextchar[\dummy@@documentclass{\dummy@@documentclass[]}} -\def\dummy@@documentclass[#1]#2{} -\def\includequestion{ - \@ifnextchar[%] - {\@includequestion}{\@includequestion[]}} -\def\@includequestion[#1]#2{% - \begingroup - \let\documentclass\dummy@documentclass - \let\document\@empty % not \relax: makes \begin think {document} is undef'd - \let\enddocument\relax - \def\@tempa{#1} - \ifx\@tempa\@empty \else - \def\@includequestionoverridenumber{#1} - \message{includequestion override: \@includequestionoverridenumber} - \fi - \def\usepackage##1{\ClassWarning{exam-n} - {Ignoring \string\usepackage{##1} in included question #2}} - \input{#2} - \endgroup -} -\let\@includequestionoverridenumber\@empty -\newif\if@insolution -\@insolutionfalse -\def\@formatsolution{\par - \if@insolution - \ClassError{exam-n}{Misplaced solution}{You can't have a solution within a solution} - \else - \@insolutiontrue % this happens within a group - \fi - \examn@dummycaptions % dummy captions within solutions - \typeout{SHOWING SOLUTIONS} - \vskip 1ex plus 2\bigskipamount % add stretchable space... - \penalty-\@lowpenalty % ...and encouragement to break here - \parskip 0.5\baselineskip - \raggedright - \color{solutiontext}%\slshape - \ifbigfont\else - \small - \fi - \hrule - \hbox to \textwidth{\vrule height 1ex \hfil \vrule height 1ex} - \nobreak - \vskip -\parskip % cancel out the following parskip - \textbf{\highlighted{Solution:}}\hskip2em - \ignorespaces -} -\def\end@formatsolution{% - \par - \nobreak - \vskip -0.5ex - \hbox to \textwidth{\vrule height 1ex \hfil \vrule height 1ex} - \hrule -} -\if@showsolutions - \let\solution\@formatsolution - \let\endsolution\end@formatsolution -\else - \def\solution{% - \if@insolution - \ClassError{exam-n}{Misplaced solution}{You can't have a solution within a solution} - \fi - \let\endfigure\endfloat@skipsolutions - \let\endtable\endfloat@skipsolutions - \examn@dummycaptions % dummy captions avoid counter increments - \@ifundefined{includepdf}{}{\let\includepdf\examn@disabledpdfpages} - \par - \setbox\@tempboxa\vbox\bgroup - \@insolutiontrue} - \def\endsolution{% - \egroup % ...and do nothing with this box - } -\fi -\def\examn@badfloat#1[#2]{ - \ClassError{exam-n} - {Bad #1 option #2 ignored} - {In the exam-n class, the 'floating' environments take no argument,\MessageBreak - and are always placed 'here'} - \examn@float{#1}} -\def\examn@float#1{% - % re-using the standard LaTeX parameter means that \caption works - \def\@captype{#1} - \setbox\@tempboxa\vbox\bgroup} -\def\examn@endfloat{% - \egroup % end \@tempboxa - \unskip - \nobreak - % add lots of stretchability, but non-infinite, for the sake of tidiness - \vskip 0pt plus 0.5\textheight - \penalty50 % a pagebreak here discards following vskip - % (cf TeXBook p106; or try \filbreak of p111) - \vskip 2ex plus -0.5\textheight % negative stretch cancels previous vskip - \box\@tempboxa - %\vskip 1ex - \nobreak -} -\def\endfloat@skipsolutions{% - % variant when skipping solutions -- end the \@tempboxa and do nothing - \egroup -} -\def\figure{% - \@ifnextchar[{\examn@badfloat{figure}}{\examn@float{figure}}%] -} -\def\table{% - \@ifnextchar[{\examn@badfloat{table}}{\examn@float{table}}%] -} -\let\endfigure\examn@endfloat -\let\endtable\examn@endfloat -\def\examn@dummycaptions{% - \def\fnum@figure{\figurename} % 'Figure nnn' changed to just 'Figure' - \def\fnum@table{\tablename} - \def\caption{% - \ifx\@captype\@undefined - \@latex@error{\noexpand\caption outside float}\@ehd - \expandafter\@gobble - \else - %\refstepcounter\@captype % omit this line from the standard definition - \expandafter\@firstofone - \fi - {\@dblarg{\@caption\@captype}}% - } -} -\def\examn@disabledpdfpages{\@ifnextchar[% ] - \examn@disabledpdfpages@ - {\examn@disabledpdfpages@[]}} -\def\examn@disabledpdfpages@[#1]#2{\relax} -\AtEndDocument{ - \CheckTotalQuestions - \ClosingText - \showthe@shouts - \WriteLastPageLabel} -\ifcase\examn@mtselect - % mathptm fonts - % This is a very clumsy version, but it appears to be our only option - \def\vec#1{\mathchoice{\mbox{\boldmath $\displaystyle #1$}} - {\mbox{\boldmath $ #1$}} - {\mbox{\boldmath $\scriptstyle #1$}} - {\mbox{\boldmath $\scriptscriptstyle #1$}}} -\or % mathtime (should this be the same for mathtime as for mtpro2? - \let\vec\mathbf -\or % mtpro2 - \let\vec\mathbold -\fi -\newcommand\BSc{B.Sc.{}} -\newcommand\MSci{M.Sci.{}} -\newcommand\MSc{M.Sc.{}} -\newcommand\MA{M.A.{}} -\newcommand\MEng{M.Eng.{}} -\newcommand\BEng{B.Eng.{}} -\newcommand{\dd}{\mathrm{d}} -\newcommand{\ddd}{\,\mathrm{d}} % inside an integral, including thinspace - -\def\Diffl{\@ifstar\@Difflflat\@Diffl} -\def\Partial{\@ifstar\@Partialflat\@Partial} -\def\@Partial{\@ifnextchar[{\@@Diffl\partial}{\@@Diffl\partial[]}} -\def\@Partialflat{\@ifnextchar[{\@@Difflflat\partial}{\@@Difflflat\partial[]}} -\def\@Diffl{\@ifnextchar[{\@@Diffl\dd}{\@@Diffl\dd[]}} -\def\@Difflflat{\@ifnextchar[{\@@Difflflat\dd}{\@@Difflflat\dd[]}} -\def\@@Diffl#1[#2]#3#4{% - \def\@tempa{#2}% - \ifx\@tempa\empty - \frac{#1#3}{#1#4}% - \else - \frac{{#1}^{#2}#3}{#1{#4}^{#2}}% - \fi} -\def\@@Difflflat#1[#2]#3#4{% - \def\@tempa{#2}% - \ifx\@tempa\empty - #1#3\mskip-0.8mu/\mskip-1.2mu #1#4% - \else - {#1}^{#2}#3\mskip-0.8mu /\mskip-1.2mu #1{#4}^{#2}% - \fi} -\def\e{{\mathrm e}} -\def\units{\begingroup - \catcode`\.=\active - \@ifstar{\let\un@tsspace\relax \un@ts}% - {\let\un@tsspace\thinspace\un@ts}} -\begingroup - \catcode`\.=\active - \gdef\un@ts#1{\let~\thinspace\let.\thinspace - \ifmmode - \un@tsspace\mathrm{#1}% - \else - \nobreak$\un@tsspace\mathrm{#1}$% - \fi - \endgroup} -\endgroup -\def\au{au} -\def\lambdabar{\setbox\@tempboxa\hbox{$\lambda$}% - \hbox to 0pt{\hbox to \wd\@tempboxa{\hss$\bar{}$\hss}\hss}\box\@tempboxa} -\endinput -%% -%% End of file `exam-n.cls'. diff --git a/Master/texmf-dist/doc/latex/exam-n/notes-for-authors.pdf b/Master/texmf-dist/doc/latex/exam-n/notes-for-authors.pdf index 0c50ae77f7f..ca51908af30 100644 Binary files a/Master/texmf-dist/doc/latex/exam-n/notes-for-authors.pdf and b/Master/texmf-dist/doc/latex/exam-n/notes-for-authors.pdf differ diff --git a/Master/texmf-dist/doc/latex/exam-n/notes-for-authors.tex b/Master/texmf-dist/doc/latex/exam-n/notes-for-authors.tex new file mode 100644 index 00000000000..de9e3a8ba70 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exam-n/notes-for-authors.tex @@ -0,0 +1,304 @@ +\documentclass[10pt]{scrartcl} +%\documentclass[11pt]{scrartcl} + +\usepackage{url,pdfpages,moreverb,color} +\definecolor{cscolour}{rgb}{0.5,0.1,0.1} + +\title{Notes for exam question authors} +\author{Norman Gray} +\date{exam-n 1.1.4, 2016 December 19} + +\parindent=0pt +\parskip=\medskipamount + +\makeatletter +\def\csarg#1{\texttt\{\textit{#1}\texttt\}% + \advance\@tempcnta-1 + \ifnum\@tempcnta>0 + \let\next\csarg + \else + \let\next\endgroup % begun in \cs + \fi + \next} +\newcommand\cs[2][0]{\begingroup + \color{cscolour}% + $\backslash$\texttt{#2}% + \@tempcnta=#1 + \ifnum\@tempcnta>0 + \let\next\csarg + \else + \let\next\endgroup + \fi + \next} + +\def\env#1{\texttt{\textcolor{cscolour}{#1}}} +\def\opt#1{\texttt{[#1]}} + +\setcounter{secnumdepth}0 + +\begin{document} +\maketitle + +The full documentation for the \texttt{exam-n} document class is in +the file \texttt{exam-n.pdf}, but some of this is quite detailed, and +addressed to the exams convener, who has to assemble the overall +exam. This document is a compact account of how to use the exams +class as a question author. + +You can find updated versions of the \texttt{exam-n} document class, and the +complete documentation, at \url{http://purl.org/nxg/dist/exam-n}. + +\subsection{Template} +\label{s:template} +\listinginput1{template-question.tex} + +Notice first that this is a standalone document -- you can \LaTeX\ it +to produce a formatted exam paper, as long as you include the +\opt{compose} option in the document class line. This complete +document can later be given to the exams convener, who can +input it unchanged into the master file which pulls the various questions +together. It follows from that that you should be hesitant about putting anything into +the preamble other than \cs{usepackage} commands, and you should +consult with the exams convener to ensure that such packages go into +the master file, too. It's probably a safe bet that the `graphicx' +package will be included in the master file. If you want to include +a \cs{newcommand}, or anything like that, +it can be placed inside the \env{question} environment. For +other customisations, negotiate with the exams convener. + +The \env{question} environment contains (surprise) a question, broken into +parts (a, b, c, \dots) by \cs{part} commands, and with the distribution of marks within +the question being indicated by \cs[1]{partmarks}n; the class will check that the +marks in \cs{partmarks} do add up to the question goal given as an +argument in \cs[1]{begin\{question\}}{markgoal}. Within the +question there can be one or more \env{solution} environments, which are +not displayed in the final version (obviously), but which do appear in +draft modes. You'll most typically have a \cs{partmarks} macro and a +\env{solution} environment for each \cs{part}, but they don't have to +match up, and you can have the entire solution at the end if you prefer. +The \cs[1]{partmarks*}n command is almost the same, but places the +mark indicator in a slightly different position which looks better +when there would otherwise be a gap at the right of the page. It can +be placed after a list, or inside but at the end of an equation. +Note that \cs{partmarks} ends a paragraph (\cs{partmarks*} doesn't): this is +probably good style, but if you insist on mid-paragraph marks, then a following +\verb|\noindent| will be useful. It's helpful to use \cs{partmarks} inside a +\env{solution} to indicate the distribution of marks -- this doesn't mess up +the mark-totalling calculation. + +One common exam or test question type is a multiple-choice question. +This is indicated by a \cs{begin\{mcq\}} environment, which contains a +textual question followed by a sequence of possible answers indicated by +\cs{item}, including precisely one correct answer, indicated by +\cs{answer} (this is of course formatted identically to the others, +unless the \opt{showsolutions} option is present). Before you can use +the \env{mcq} environment, you must call +\cs[1]{multiplechoiceanswers}{n} to indicate how many options are +required in each question. +It's OK to have a \env{solution} within an \env{mcq} environment, +perhaps to provide commentary on or explanation of the correct answer. + +You can include a \env{questiondata} environment at (typically) the end of +the question: this is intended for extra equations or constants which +are useful for the examinee. + +The \env{figure} and \env{table} environments act differently from the +way they usually act in \LaTeX: \emph{`floats' don't float}. In each +case, the content is forced to be always `here', and in addition is +also tied to the text which follows it, so that a page break will not +occur immediately after a figure or table. There are \emph{no} figure +or float options permitted in this class's `floating' environments +(that is, option \texttt{[h]} is neither necessary nor permissible). +If you need to tune the page breaking, then you should use +\verb|\goodbreak|, \verb|\vspace| or, in extremis, \verb|\newpage|. +The \cs[1]{caption}{text} command works as usual; the figure and table +numbering sequences continue through the solutions, if they're shown, +but this isn't expected to be a problem. + +If you use \cs{label} within a \env{question} environment, that label +will, as you might expect, refer to the question number. + +Hints: +Figures can be included with \cs{includegraphics} as usual, as long as +the `graphicx' package has been included at the top of the master +file. If you want to include complete pages from a PDF (most +typically containing a scanned handwritten model answer), then you can +do so by including the `pdfpages' package at the top of the file, and +then \cs[1]{includepdf[pages=\{-\}]}{filename} inside a \env{solution} +environment. +The \texttt{pages=\{-\}} option means that all pages from the file are +inserted; you may wish to use \texttt{scale=0.8} to shrink the PDF; +the option \verb|pagecommand={\thispagestyle{fancy}}| will cause the other +class apparatus, such as page numbers and headers, to be +superimposed on the included pages. +See the documentation of the `pdfpages' package for more information. + +Include marginal notes with \cs[1]{comment}{remark} -- these show up in drafting +modes (\opt{draft} and \opt{compose}), but not in the final version. +The \cs[1]{author}{name} command is just +a type of comment. If you need to make more noise, then +\cs[1]{shout}{remark} inserts a highlighted \emph{remark} in the flow of text +(so it can be used anywhere) and includes the remark in a prominent +list of exclamations at the end of the document. + +At the bottom of each page, you see a faint identification code, such +as `QM/123-456'. This consists of an exam identifier, extracted from +the exam preamble, plus a code which changes each time \LaTeX\ is +run. This helps you avoid collation accidents, and to distinguish +between slightly different versions of the printed document. + +\subsection{Various convenience commands} +\label{s:othercommands} + +\makeatletter +% Definitions edited in at build time... +% Abbreviations for degrees. +% \begin{macrocode} +\newcommand\BSc{B.Sc.{}} +\newcommand\MSci{M.Sci.{}} +\newcommand\MSc{M.Sc.{}} +\newcommand\MA{M.A.{}} +\newcommand\MEng{M.Eng.{}} +\newcommand\BEng{B.Eng.{}} +% \end{macrocode} +% +% Tweaks to differentials. +% \begin{macrocode} +\newcommand{\dd}{\mathrm{d}} +\newcommand{\ddd}{\,\mathrm{d}} % inside an integral, including thinspace + +\def\Diffl{\@ifstar\@Difflflat\@Diffl} +\def\Partial{\@ifstar\@Partialflat\@Partial} +\def\@Partial{\@ifnextchar[{\@@Diffl\partial}{\@@Diffl\partial[]}} +\def\@Partialflat{\@ifnextchar[{\@@Difflflat\partial}{\@@Difflflat\partial[]}} +\def\@Diffl{\@ifnextchar[{\@@Diffl\dd}{\@@Diffl\dd[]}} +\def\@Difflflat{\@ifnextchar[{\@@Difflflat\dd}{\@@Difflflat\dd[]}} +\def\@@Diffl#1[#2]#3#4{% + \def\@tempa{#2}% + \ifx\@tempa\empty + \frac{#1#3}{#1#4}% + \else + \frac{{#1}^{#2}#3}{#1{#4}^{#2}}% + \fi} +\def\@@Difflflat#1[#2]#3#4{% + \def\@tempa{#2}% + \ifx\@tempa\empty + #1#3\mskip-0.8mu/\mskip-1.2mu #1#4% + \else + {#1}^{#2}#3\mskip-0.8mu /\mskip-1.2mu #1{#4}^{#2}% + \fi} +% \end{macrocode} +% +% The exponential sign +% \begin{macrocode} +\def\e{{\mathrm e}} +% \end{macrocode} +% +% Physical units in |\rm|. Unstarred version includes leading +% |\thinspace|. Starred version doesn't, and is used when referring to +% the unit by itself (eg axis is |$B/\units*T$|), and is not qualifying +% a number. +% FIXME: |\mu| in |\units| can come out wrong in some fonts (mtpro2?) +% -- needs investigation. +% \begin{macrocode} +\def\units{\begingroup + \catcode`\.=\active + \@ifstar{\let\un@tsspace\relax \un@ts}% + {\let\un@tsspace\thinspace\un@ts}} +\begingroup + \catcode`\.=\active + \gdef\un@ts#1{\let~\thinspace\let.\thinspace + \ifmmode + \un@tsspace\mathrm{#1}% + \else + \nobreak$\un@tsspace\mathrm{#1}$% + \fi + \endgroup} +\endgroup +% \end{macrocode} +% +% Other miscellaneous symbols: +% The AU is nothing exciting, but may be adjusted in future +% \begin{macrocode} +\def\au{au} +% \end{macrocode} +% The symbol for Compton wavelength is a crossed lambda -- the following isn't perfect, but is OK for now. +% \begin{macrocode} +\def\lambdabar{\setbox\@tempboxa\hbox{$\lambda$}% + \hbox to 0pt{\hbox to \wd\@tempboxa{\hss$\bar{}$\hss}\hss}\box\@tempboxa} +% \end{macrocode} +\makeatother + +Macro \cs[1]{vec}{v} is redefined to give bold-font vectors, rather than +vectors with arrows, which is the (weird) \LaTeX\ default. This +should work for bold greek as well as roman. + +Macros \cs{dd} and \cs{ddd}: \cs{dd} is a roman d, as used for +differentials; \cs{ddd} is the same with a preceding thinspace, +as used within integrals; for example +\[ + \verb|\int f(x)\ddd x = \int f(x)\,\dd x| = \int f(x)\ddd x +\] + +You can typeset derivatives neatly: +\begin{center} +\def\dd{\mathrm{d}} +\begin{tabular}{rl} +\verb|\Diffl{a}{b}| & $\displaystyle \Diffl ab$ \\[3ex] +\verb|\Diffl[2]{a}{b}| & $\displaystyle \Diffl[2]ab$\\[3ex] +\verb|\Diffl*{a}{b}| & $\Diffl* ab$ \\[2ex] +\verb|\Diffl*[2]{a}{b}| & $\Diffl*[2]ab$\\ +\end{tabular} +\end{center} +The unstarred versions are for displayed equations, the starred +ones for inline maths. +There is analogous support for partial derivatives with \cs[2]{Partial}ab. + +Macros \cs[1]{units}{expr}, \cs[1]{units*}{expr}: These typeset +physical units in an upright shape, with tilde or dot acting as a +separator between units. Since this is typeset in maths mode, all +other spacing is ignored. For example, \verb|$v=10\units{m.\mu s^{-1}}$| +gives $v=10\units{m.\mu s^{-1}}$. The unstarred version includes some +leading space; the starred version can be used when referring to the +unit by itself, where it is not qualifying a number (eg labelling an +axis with units \verb|$B/\units*T$|, or $B/\units*T$). These macros +might be replaced, in the future, by a recommendation to use the +\texttt{siunitx} package. + +For some other useful symbols, see the table below: + +\def\arraystretch{1.5} +\begin{tabular}{rcp{8cm}} +\cs{e}&$\e^{i\pi}+1=0$& the exponential is typeset in an upright rather than +an italic shape, as in \verb|$\e^{i\pi} + 1 = 0$|.\\ +\cs{au}&10\units\au& astronomical units: +\verb|10\units{\au}|.\\ +\cs{lambdabar}&$\lambdabar$& the Compton wavelength, as a lambda with a +bar through it.\\ +\end{tabular} + + +\subsection{Extra: Creating complete exams} +\label{s:complete} +As a question author, you are typically only concerned with one or two +single questions, and that is why this brief guide concentrates +exclusively on the \opt{compose} mode. But you might be interested to see +how your text appears in the final exam. A template master file is +below. For more detail, see the complete documentation in \texttt{exam-n.pdf}. +\goodbreak +\listinginput1{template-master.tex} + +The \texttt{exam-n} class currently supports a sample class option \opt{A1}. +This automatically includes a suitable constants sheet in the +formatted paper. + +On the following pages, you can see the result of \LaTeX ing the sample file on +p.\pageref{s:template}, and of processing the master file above. +As you can see, the \opt{compose} mode by default shows solutions, +and collects the \cs[1]{shout}{text} remarks to the end. +In the \opt{final} mode (which is the default mode), solutions +disappear, but the shouted-out alerts remain, just to make sure no-one +can miss them. +\includepdf{template-question.pdf} +\includepdf[pages={2,1},angle=90,nup=1x2,column]{template-master.pdf} +\end{document} diff --git a/Master/texmf-dist/doc/latex/exam-n/release-notes.html b/Master/texmf-dist/doc/latex/exam-n/release-notes.html index 063e8fbe84a..9f843e11f69 100644 --- a/Master/texmf-dist/doc/latex/exam-n/release-notes.html +++ b/Master/texmf-dist/doc/latex/exam-n/release-notes.html @@ -14,7 +14,44 @@ dd ul { padding: 0pt; margin: 0pt; }
    -
    1.1, 2014 May 3
    +
    1.1.4, 2016 December 19
    +
      +
    • Documentation: add notes about use of pdfpages.
    • +
    • Added [largefont] option. +Note: +option [hugefont] has replaced [bigfont]; +the latter is now deprecated, and may be removed in v1.2.
    • +
    • Use of the \part macro is now supported within +solutions (it produced the wrong numbers before), and there is a new +\StylePartNumber customisation macro.
    • +
    + +
    1.1.3
    +
      +
    • Version 1.1.3 was never released
    • +
    + +
    1.1.2, 2015 November 26
    +
      +
    • Handled trailing floats at end of document (generated by packages +such as rotating.
    • +
    • \label within question environment now refers to the +question number.
    • +
    • Work around a problem when a paragraph starts with {\bf ...} +rather than (post-1995) \textbf{...}.
    • +
    • \begin{questiondata} now starts a new paragraph.
    • +
    • Some documentation adjustments.
    • +
    + +
    1.1.1, 2014 November 27
    +
      +
    • Adjust \partmarks* behaviour; now behaves differently +within display maths (addresses +issue 1).
    • +
    • Various documentation and release fixes.
    • +
    + +
    1.1, 2014 May 3
    Converted to a generic class, exam-n, ready for wider distribution. Available on bitbucket diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/Makefile b/Master/texmf-dist/doc/latex/exam-n/sample/Makefile index ff34e72ae46..253245e5345 100644 --- a/Master/texmf-dist/doc/latex/exam-n/sample/Makefile +++ b/Master/texmf-dist/doc/latex/exam-n/sample/Makefile @@ -1,3 +1,7 @@ +%.pdf: %.tex ../exam-n.cls + TEXINPUTS=..: pdflatex $< + if grep 'Rerun to get cross' ${<:.tex=.log}; then TEXINPUTS=..: pdflatex $<; else :; fi + all: sample_exam.pdf sample_exam.pdf: numerical1-solution.pdf @@ -8,9 +12,12 @@ sample_exam_solution.tex: sample_exam.tex rm -f $@ sed '1s/documentclass/documentclass[showsolutions]/' sample_exam.tex >sample_exam_solution.tex -%.pdf: %.tex - TEXINPUTS=..: pdflatex $< - if grep 'Rerun to get cross' ${<:.tex=.log}; then TEXINPUTS=..: pdflatex $<; else :; fi +# This will depend somehow on the .dtx file in the parent directory, +# but expressing that here second-guesses how that file is actually +# generated, so skip this ('don't repeat yourself'; also, this is only +# occasionally used while testing) +../exam-n.cls: + cd ..; $(MAKE) exam-n.cls clean: - rm -f sample_exam*.pdf sample_exam_solution.tex *.log *.aux + rm -f *.pdf *.log *.aux sample_exam_solution.tex diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/cosmo1.tex b/Master/texmf-dist/doc/latex/exam-n/sample/cosmo1.tex index cd9ae51974f..27045d026a6 100644 --- a/Master/texmf-dist/doc/latex/exam-n/sample/cosmo1.tex +++ b/Master/texmf-dist/doc/latex/exam-n/sample/cosmo1.tex @@ -1,10 +1,11 @@ \documentclass[compose]{exam-n} \usepackage{graphics} +\graphicspath{{fig/}} \begin{document} -\begin{question}{20} \author{Andrew Davies} +\begin{question}{20} \author{Reginald Q Whimsy} % Have a blank line here, to check that the question number remains % nicely lined up, even if there are lines between the environment % opening and the text. @@ -22,15 +23,15 @@ included as a graphic. Fully zenned up? Then let us begin\dots. \part Show that, under the action of gravity alone, the scale size of the Universe varies according to -\begin{equation*} +\begin{equation} \ddot{R}=-\frac{4\pi G \rho_0}{3R^2} -\end{equation*} +\end{equation} \partmarks*{4} and that, consequently, \begin{equation*} \dot{R}^2=-\frac{8\pi G \rho_0}{3R}=-K. -\end{equation*} \partmarks*{3} +\end{equation*} Express $K$ in terms of the present values of the Hubble constant $H_0$ and of the density parameter $\Omega_0$. @@ -68,6 +69,10 @@ More content&in row 2 \end{tabular} \caption{\label{t:dullness}A remarkably dull table} \end{table} +Finis. +\begin{questiondata} +Hubble's law: $v=H_0 D$ +\end{questiondata} \partmarks{4} \begin{solution} Explanations are superfluous; all that is, is. @@ -84,8 +89,5 @@ adds nothing to our understanding of our place in the cosmos, but it you work out how many deuterium nuclei decayed during the typing of this table?). \end{solution} -\begin{questiondata} -Hubble's law: $v=H_0 D$ -\end{questiondata} \end{question} \end{document} diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/excos1.tex b/Master/texmf-dist/doc/latex/exam-n/sample/excos1.tex index 34fa6966ec4..511902dc1ab 100644 --- a/Master/texmf-dist/doc/latex/exam-n/sample/excos1.tex +++ b/Master/texmf-dist/doc/latex/exam-n/sample/excos1.tex @@ -9,7 +9,7 @@ In 1908, where was there an airburst `impact'? \answer Tunguska \item Arizona \item Off the Mexican coast -\item Egypt +\item Swindon \begin{solution} The evidence for this is a dirty big hole in the ground in Siberia. \end{solution} @@ -20,7 +20,7 @@ The fossil record suggests that mass extinction events occur once every how many \item 2.6 Billion Years \item 260 Million Years \item 26 Million Years % not marked as correct -\item 26 Thousand Years +\item 4 Thousand Years after the dominant lifeform invents fire \end{mcq} \begin{mcq} diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/fig/spiral.eps b/Master/texmf-dist/doc/latex/exam-n/sample/fig/spiral.eps new file mode 100644 index 00000000000..fcf91bb97d1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/exam-n/sample/fig/spiral.eps @@ -0,0 +1,22 @@ +%!PS-Adobe-3.0 EPSF-3.0 +% Shrinking squares, cgl Feb 97 +% Adapted from http://www.ntg.nl/maps/pdf/19_12.pdf +% this version... +%%Creator: norman@astro.gla.ac.uk +%%BoundingBox: 0 0 200 125 +/b 0.6180339887 def % (\sqrt5-1)/2 +/x 200 def +/y x b mul def +/square { + 0 y lineto y y lineto y 0 lineto + y 0 y 180 90 arcn y y translate +} def +0.35 setlinewidth +16 { + 0 0 moveto square -90 rotate + /x y def /y x b mul def +} repeat +stroke + +%showpage + diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/fig/spiral.pdf b/Master/texmf-dist/doc/latex/exam-n/sample/fig/spiral.pdf new file mode 100644 index 00000000000..0119b77d38b Binary files /dev/null and b/Master/texmf-dist/doc/latex/exam-n/sample/fig/spiral.pdf differ diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/numerical1-solution.pdf b/Master/texmf-dist/doc/latex/exam-n/sample/numerical1-solution.pdf deleted file mode 100644 index 5da7ebd7f71..00000000000 Binary files a/Master/texmf-dist/doc/latex/exam-n/sample/numerical1-solution.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/numerical1-solution.tex b/Master/texmf-dist/doc/latex/exam-n/sample/numerical1-solution.tex index 3c9b175984b..b8862899a1a 100644 --- a/Master/texmf-dist/doc/latex/exam-n/sample/numerical1-solution.tex +++ b/Master/texmf-dist/doc/latex/exam-n/sample/numerical1-solution.tex @@ -6,6 +6,9 @@ opposed to superimposed on each other), and disappear when the noshowsolutions option is present. +(In the real situation, the corresponding PDF would be a scan of a hand-written +solution.) + \fontsize{72}{72}\selectfont \centering Numerical 1 solution, page one diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/numerical2.tex b/Master/texmf-dist/doc/latex/exam-n/sample/numerical2.tex index b47bed21815..0843f1bc6ee 100644 --- a/Master/texmf-dist/doc/latex/exam-n/sample/numerical2.tex +++ b/Master/texmf-dist/doc/latex/exam-n/sample/numerical2.tex @@ -9,6 +9,9 @@ in the $AB$ plane, and use it to distinguish between the most probable joint values of $(A,B)$ and the most probable value of $A$ given (a different) $B$. \partmarks{5} +\label{q:numerical2} +Note that this is question \ref{q:numerical2} on p.\pageref{q:numerical2}. + Explain what is meant by \emph{marginalisation} in Bayesian inference and how it can be interpreted in terms the above plot. \partmarks{5} diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/numerical3.tex b/Master/texmf-dist/doc/latex/exam-n/sample/numerical3.tex index 554de298e9d..2354c5db6f0 100644 --- a/Master/texmf-dist/doc/latex/exam-n/sample/numerical3.tex +++ b/Master/texmf-dist/doc/latex/exam-n/sample/numerical3.tex @@ -6,6 +6,10 @@ Distinguish between frequentist and Bayesian definitions of probability, and explain carefully how parameter estimation is performed in each regime.\partmarks{10} +\label{q:numerical3} +Note that this is question \ref{q:numerical3} on +p.\pageref{q:numerical3}. It's the one after question~\ref{q:numerical2}. + A square ccd with $M\times M$ pixels takes a dark frame for calibration purposes, registering a small number of electrons in each pixel from thermal noise. The probability of there being $n_i$ diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam.pdf b/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam.pdf deleted file mode 100644 index 89072959f30..00000000000 Binary files a/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam.tex b/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam.tex index b8a3eb4a3d2..98031e60911 100644 --- a/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam.tex +++ b/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam.tex @@ -1,5 +1,6 @@ \documentclass{exam-n} -%\documentclass[bigfont,sansserif]{exam-n} +%\documentclass[largefont]{exam-n} +%\documentclass[hugefont,sansserif]{exam-n} %\documentclass[mtpro2,showsolutions]{exam-n} %\documentclass[mtpro2,showsolutions,sansserif]{exam-n} %\documentclass[draft,showsolutions,sansserif]{exam-n} diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam_solution.pdf b/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam_solution.pdf deleted file mode 100644 index 327cdf20faa..00000000000 Binary files a/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam_solution.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam_solution.tex b/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam_solution.tex index 098c453572b..853bccbce91 100644 --- a/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam_solution.tex +++ b/Master/texmf-dist/doc/latex/exam-n/sample/sample_exam_solution.tex @@ -1,5 +1,6 @@ \documentclass[showsolutions]{exam-n} -%\documentclass[bigfont,sansserif]{exam-n} +%\documentclass[largefont]{exam-n} +%\documentclass[hugefont,sansserif]{exam-n} %\documentclass[mtpro2,showsolutions]{exam-n} %\documentclass[mtpro2,showsolutions,sansserif]{exam-n} %\documentclass[draft,showsolutions,sansserif]{exam-n} diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/spiral.eps b/Master/texmf-dist/doc/latex/exam-n/sample/spiral.eps deleted file mode 100644 index fcf91bb97d1..00000000000 --- a/Master/texmf-dist/doc/latex/exam-n/sample/spiral.eps +++ /dev/null @@ -1,22 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -% Shrinking squares, cgl Feb 97 -% Adapted from http://www.ntg.nl/maps/pdf/19_12.pdf -% this version... -%%Creator: norman@astro.gla.ac.uk -%%BoundingBox: 0 0 200 125 -/b 0.6180339887 def % (\sqrt5-1)/2 -/x 200 def -/y x b mul def -/square { - 0 y lineto y y lineto y 0 lineto - y 0 y 180 90 arcn y y translate -} def -0.35 setlinewidth -16 { - 0 0 moveto square -90 rotate - /x y def /y x b mul def -} repeat -stroke - -%showpage - diff --git a/Master/texmf-dist/doc/latex/exam-n/sample/spiral.pdf b/Master/texmf-dist/doc/latex/exam-n/sample/spiral.pdf deleted file mode 100644 index 0119b77d38b..00000000000 Binary files a/Master/texmf-dist/doc/latex/exam-n/sample/spiral.pdf and /dev/null differ diff --git a/Master/texmf-dist/doc/latex/exam-n/sample_exam.pdf b/Master/texmf-dist/doc/latex/exam-n/sample_exam.pdf index 89072959f30..db389f7e34b 100644 Binary files a/Master/texmf-dist/doc/latex/exam-n/sample_exam.pdf and b/Master/texmf-dist/doc/latex/exam-n/sample_exam.pdf differ diff --git a/Master/texmf-dist/doc/latex/exam-n/sample_exam_solution.pdf b/Master/texmf-dist/doc/latex/exam-n/sample_exam_solution.pdf index 327cdf20faa..994205d6e9e 100644 Binary files a/Master/texmf-dist/doc/latex/exam-n/sample_exam_solution.pdf and b/Master/texmf-dist/doc/latex/exam-n/sample_exam_solution.pdf differ diff --git a/Master/texmf-dist/source/latex/exam-n/exam-n.drv b/Master/texmf-dist/source/latex/exam-n/exam-n.drv index 95836a54824..ee1e949bbd2 100644 --- a/Master/texmf-dist/source/latex/exam-n/exam-n.drv +++ b/Master/texmf-dist/source/latex/exam-n/exam-n.drv @@ -6,10 +6,10 @@ %% %% exam-n.dtx (with options: `driver') %% exam-n: format exam questions -%% Release version 1.1, 2014 May 03. +%% Release version 1.1.4, 2016 December 19. %% %%%% File: exam-n.dtx -%%%% Copyright 2005--2014, Norman Gray +%%%% Copyright 2005--2016, Norman Gray %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -27,13 +27,13 @@ %% the derived file exam-n.cls, %% and the associated *.clo files. -%%%% Source: Mercurial revision 6f818b549982, 2014-05-03 13:42 +0100, tag 1.1 + 0 +%%%% Source: Mercurial revision e8a612cb25f4, 2016-12-19 16:49 +0000, tag exam-n-1.1.4 + 0 %% \documentclass{ltxdoc} \title{exam-n: exam papers} \author{Norman Gray\\(\texttt{norman@astro.gla.ac.uk})} -\date{Release 1.1} +\date{Release 1.1.4} \usepackage{url} \newcommand\Lopt[1]{\textsf {#1}} % options \newcommand\file[1]{\texttt {#1}} diff --git a/Master/texmf-dist/source/latex/exam-n/exam-n.dtx b/Master/texmf-dist/source/latex/exam-n/exam-n.dtx index 4d870699207..043d2c9f7c9 100644 --- a/Master/texmf-dist/source/latex/exam-n/exam-n.dtx +++ b/Master/texmf-dist/source/latex/exam-n/exam-n.dtx @@ -3,10 +3,10 @@ % % Generated file : DO NOT EDIT % -%% Release version 1.1, 2014 May 03. +%% Release version 1.1.4, 2016 December 19. %% %%%% File: exam-n.dtx -%%%% Copyright 2005--2014, Norman Gray +%%%% Copyright 2005--2016, Norman Gray %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -17,27 +17,27 @@ %% version 2005/12/01 or later. %% %% This work has the LPPL maintenance status `maintained'. -%% +%% %% The Current Maintainer of this work is Norman Gray %% %% This work consists of the files exam-n.dtx and exam-n.ins, %% the derived file exam-n.cls, %% and the associated *.clo files. -%<+package|driver|example>%%%% Source: Mercurial revision 6f818b549982, 2014-05-03 13:42 +0100, tag 1.1 + 0 +%<+package|driver|example>%%%% Source: Mercurial revision e8a612cb25f4, 2016-12-19 16:49 +0000, tag exam-n-1.1.4 + 0 %% %<*package|driver> % %<+package>\NeedsTeXFormat{LaTeX2e} -%<+package>\ProvidesClass{exam-n}[2014/05/03 1.1] -%<+package>\typeout{Class: `exam-n 1.1 <2014/05/03>} +%<+package>\ProvidesClass{exam-n}[2016/12/19 1.1.4] +%<+package>\typeout{Class: `exam-n 1.1.4 <2016/12/19>} % %<*driver> \documentclass{ltxdoc} \title{exam-n: exam papers} \author{Norman Gray\\(\texttt{norman@astro.gla.ac.uk})} -\date{Release 1.1} +\date{Release 1.1.4} \usepackage{url} \newcommand\Lopt[1]{\textsf {#1}} % options \newcommand\file[1]{\texttt {#1}} @@ -203,7 +203,7 @@ % should use \Lopt{draft}; and you should use \Lopt{final} only for % the final version. % The \Lopt{draft} option switches on the \Lopt{showsolutions} -% option (below), displays |\comment| remarks, +% option (below), displays |\comment| remarks, % and makes some mild layout changes. % The \Lopt{compose} option implies the \Lopt{showsolutions} option, % causes questions to be formatted one per page, and turns off @@ -273,8 +273,8 @@ % superstition -- there seems remarkably little actual evidence % either way). % -% \item[\Lopt{bigfont}] -% Produce a version of the paper in a `huge' font (36pt size) for +% \item[\Lopt{largefont}, or \Lopt{hugefont}] +% Produce a version of the paper in a `big' font (18pt) or `huge' font (36pt) for % the benefit of students with visual impairments. See notes below. % % \end{description} @@ -284,7 +284,7 @@ % modifications. Most typically, these changes will affect the % rubric, and the sheet of physical constants. % The only generic style option is \Lopt{A1} -% (which is included as an example of how such a file is written). +% (which is included as an example of how such a file is written). % See section~\ref{s:custom} below. % % In some circumstances -- for example when processing exam scripts @@ -292,7 +292,7 @@ % control package options from outside the package. If there is a % file called \texttt{exam-n.config} in the input path (most likely in % the same directory as the exam paper), then this is read in when any -% exam script is processed, and will supplement, any +% exam script is processed, and will supplement any % options in the |\documentclass| line. For example, if this file were present % and contained the line |\ExecuteOptions{showsolutions}|, then the % typeset exam would include the solutions. Note that this will @@ -303,17 +303,20 @@ % make immediate use of amsmath features if you wish (see % \texttt{\small http://www.ams.org/tex/amslatex.html} for discussion). % -% The change of font size with the \Lopt{bigfont} option requires a -% couple of minor layout changes. You may need to make some other -% changes by hand, in this case. You can do that by bracketing the -% adjusted text in \cmd|\ifbigfont\else\fi|. The \Lpackage{amsmath} +% The change of font size with the \Lopt{hugefont} option requires a +% couple of minor layout changes. You may need to force some similar +% changes in the exam paper, in this case. You can do that by bracketing the +% adjusted text in \cmd|\ifbigfont\else\fi|; the |\ifbigfont| flag is true in the case of +% \Lopt{hugefont}, but not \Lopt{largefont}. If you want the +% |\ifbigfont| flag to apply to \Lopt{largefont}, too, then you may +% set |\bigfonttrue| in a suitable place. The \Lpackage{amsmath} % \texttt{multline} environment can be useful here. The exams % convener should review the result carefully: a few judicious % \cmd|\ifbigfont\newpage\fi| insertions can make the result look less -% awful. The \Lopt{bigfont} option applies to the content of -% solutions if the \Lopt{showsolutions} option is present; this may or -% may not be the optimal choice. +% awful. The \Lopt{largefont} and \Lopt{hugefont} options apply to +% the content of solutions if the \Lopt{showsolutions} option is +% present; this may or may not be the optimal choice. % % At the bottom of each page, you see a faint identification code, such % as `QM/123-456'. This consists of an exam identifier, extracted from @@ -328,7 +331,7 @@ % \label{s:question} % % Within the document, you include questions within a \Lenv{question} -% environment, within which you may further have +% environment, within which you may further have % \Lenv{questiondata} and \Lenv{solution} environments. % % \DescribeEnv{question} @@ -353,37 +356,47 @@ % \Lopt{perquestionmarks} option is present or not. If it is present % (the default) then the \Lenv{question} environment takes a non-empty % argument showing the total marks available for a question. -% In addition, the class checks that the |\partmarks| within the -% question add up to this declared goal mark. +% In addition, the class checks that the |\partmarks| commands within the +% question (see below) add up to this declared goal mark. +% If the \Lopt{showmarktotals} option is present, then this (expected and +% checked) total is displayed at the end of the question. % -% If the option is not present, then questions have no individual marks, the +% If the \Lopt{perquestionmarks} option is \emph{not} present, +% then questions have no individual marks, the % environment takes no marks argument, and no marks are shown (this is usual % in essay-question exams, which typically comprise a sequence of -% short equal-valued questions with an explanatory rubric). The -% |\partmarks| command cannot be used within the question. If the -% \Lopt{showmarktotals} option is present, then this (expected and -% checked) total is displayed at the end of the question. +% short equal-valued questions with an explanatory rubric). +% Also, in this case the |\partmarks| command cannot be used within the question. % % The \Lenv{question} environment takes an optional argument, giving % the expected question number. In \Lopt{compose} mode, this is used % as the question number (unsurprisingly). In the two other modes, -% this is compared with the expected question number, based on the -% number of preceding \Lenv{question} environments in the file, so +% this is compared with the question number which would be generated based on the +% position in the sequence of \Lenv{question} environments in the file, so % that the first \Lenv{question} environment is for question one, the % second for question two, and so on. If these do not match, the exam % class displays a warning in \Lopt{draft} mode, and produces a fatal -% error in \Lopt{final} mode. You should generally give this argument -% -- it is intended to help catch embarrassing errors. +% error in \Lopt{final} mode. +% The intention is that this can act as a check that all expected +% questions are present; see also the |\numquestions| command. +% \iffalse XXX How useful is this in fact? Should I just discard this, +% especially since includequestion has a similar features? \fi % +% \DescribeMacro{\QuestionNumberChecksOff} % In some cases, the questions are not numbered in this % straightforward fashion, so that you might have questions~`2A' -% and~`2B'. In this case, the check is not meaningful, and you can +% and~`2B'. In this case, the check is not meaningful, and you must % suppress it by calling the macro |\QuestionNumberChecksOff| in the -% preamble, and the question-number argument is required (though it -% must still appear within square brackets). If these checks are off, -% but a \Lenv{question} appears without a forced question number, then -% the class warns about this, but still numbers the question as the -% next one in sequence. +% preamble. After that, you must provide a question-number argument +% (in square brackets) for every question. +% +% In some odder circumstances, you might not want to have any question +% numbers at all; for example, you might want to require examinees to +% attempt \emph{all} of the questions, and so simply have a mark for +% the whole exam. There isn't a mode for this as such, but if you use +% the \cs{QuestionNumberChecksOff} macro, and give |[\space]| as the +% optional `question number' at the beginning of the \Lenv{question} +% environment, then this will have the desired effect. % % \DescribeEnv{solution} % The \Lenv{solution} environment, contained within the \Lenv{question} @@ -494,22 +507,36 @@ % controlled by the exam style, as customised in % Sect.~\ref{s:custom}. This macro starts a new paragraph. % +% You can use the |\part| macro within solutions: this is useful if +% you have the entire \Lenv{solution} environment at the end of the +% question, but distracting if you intersperse the \Lenv{solution} +% environments between question parts. The |\part| macro within +% solutions increments separately from the increments within the question, +% so if you use this in the solutions, you must have as many +% |\part|s in the solution as there are parts in the question. +% % \DescribeMacro{\partmarks} +% \DescribeMacro{\partmarks*} % Macros \cmd|\partmarks{}| and \cmd|\partmarks*{}| announce % the number of marks associated with the current part of a question. % The class checks that the number of marks here does add up to the % number declared at the beginning of the {question} environment. % You will typically have just one |\partmarks| per |\part|, but % you can have more if you want. -% The starred version should be used when a part ends with an unnumbered -% equation, as it adjusts the spacing appropriately; it might also -% be useful at the end of a part which finishes with an +% The starred version differs by adjusting the position of the mark +% indicator, and should be used either (i) after (for example) an % itemized list, or some other structure which leaves an expanse of -% white space on the right-hand side of the page. +% white space on the right-hand side of the page; or (ii) within +% an \emph{unnumbered} equation. If, in case (ii), the style of +% the part-marks indicators is such that the indicator may be +% mistaken for an equation number, then it would be wise to use +% either |\partmarks*| or plain |\partmarks| after the equation, +% instead. +% % The unstarred version should only be used at the end of a % paragraph, and in fact forces a paragraph end; the starred -% version should generally be used only at the end of a paragraph, -% but it doesn't force one. +% version should on stylistic grounds generally be used only at the +% end of a paragraph, but it doesn't force one. % % \DescribeMacro{\comment} % \cmd|\comment{}| associates a comment with a part of the text. @@ -527,11 +554,11 @@ % \DescribeMacro{\shout} % If there is part of a question which is, for example, incomplete, % and which needs a more prominent callout than `comment', then you -% should |\shout{...}| it. Shouts appear in all modes (including +% should |\shout{...}| it. Shouts appear in all modes (\emph{including} % \Lopt{final}) and appear whether or not the class is showing solutions. % This makes a prominent remark in the text, and also in a list of -% shouts at the end of the text. Your co-authors really have no -% excuse for missing it after that. +% shouts at the end of the text. Your co-authors, or the exam +% proof-checker, really have no excuse for missing it after that. % % \DescribeMacro{\leftnudge} % For various reasons, most often because of printing problems, it can @@ -571,8 +598,8 @@ % \begin{description} % \item[University course code] % This is the code for the course (and thus for the paper) as it -% appears in university information systems (for example, -% MyCampus), and is a university-unique code such as `PHYS3031'. +% appears in university information systems, and is a +% university-unique code such as `PHYS3031'. % \item[School course code] % This is a more informal, but more recognisable, code for the % course/paper, as it is generally recognised within the school; @@ -584,7 +611,7 @@ % This is a textual description of the qualifications that the % students doing this exam are heading for. This text has little % formal weight, but might help a lost student realise they're in -% completely the wrong exam room\dots. This is something like +% completely the wrong exam room\dots. This is something like % |{Physics 3\\Chemical Physics 3}| (separate each description % using |\\|). % \end{description} @@ -599,7 +626,7 @@ % \DescribeMacro{\paperident} % It can be convenient to add some identification to each page, if for % no other reason than to double-check that you haven't inserted a -% field theory question into an ExCos exam. The command |\paperident| +% field theory question into an `astronomy for poets' exam. The command |\paperident| % allows you to declare some text which appears at the bottom of each % page of the exam. It will typically repeat some of the text in the % |\schoolcoursecode| or |\degreedescriptions| arguments. @@ -724,7 +751,7 @@ % The most typical changes here will be to adjust the exam rubric for % a particular class, with the command |\baserubric|, and to change the % sheet of physical constants, with the command |\constantssheet|. -% See the file |A1.clo| for examples. +% See the sample file |A1.clo| for examples. % % Examine this sample \file{SpecialExam.clo} file: % \begin{verbatim} @@ -734,7 +761,8 @@ % \OverrideFormatting{ % \renewcommand\FormatPartMarks[1]{\{#1\}} % \renewcommand\FormatPartNumber -% {\hbox to 0pt{\hss (\alph{partnumber})\hskip1em}} +% {\hbox to 0pt{\hss (\StylePartNumber{partnumber})\hskip1em}} +% \let\StylePartNumber\roman % as opposed to \alph % \renewcommand\FormatQuestionNumber % {\hbox to 0pt{\hss \textbf{\@currentquestion}\hskip2.5em}} % } @@ -776,6 +804,11 @@ % markers will jut into the left-hand margin, rather than being % run-in. % +% \item[StylePartNumber] +% This overrides how to style the |\part| markers. The default is +% |\alph|, but you might prefer, for example, |\Roman| or |\arabic|. +% Override this with |\let\StylePartNumber\Roman|. +% % \item[FormatQuestionNumber] % If you adjust the part marks, you should probably adjust the % formatting of the question number also. @@ -1100,12 +1133,30 @@ have a clue. \DeclareOption{colour}{} % \end{macrocode} % -% Option \Lopt{bigfont} prints a version of the exam in a `huge' -% font, to help students with visual impairments. +% Options \Lopt{largefont} and \Lopt{hugefont} print versions of the +% exam in `big' or `huge' font sizes, to help students with visual impairments. +% The available font variants are represented as numbers. +% Note: the |\examn@fontvariant| mechanism is in principle more +% general than simply size variants, but some of the code below +% assumes that |\examn@fontvariant| greater than zero means large +% text, and so would need to be adjusted if this becomes untrue. +% +% The flag |\ifbigfont| is true if the font is `significantly large'; +% option \Lopt{hugefont} sets it true, option \Lopt{largefont} does +% not; it's intended to be a user-visible and -settable flag. +% \emph{Note:} the \Lopt{hugefont} option used to be \Lopt{bigfont}; +% the latter is deprecated and may be removed in v1.2. % \begin{macrocode} +\newcount\examn@fontvariant + \examn@fontvariant=0 % the default \newif\ifbigfont -\bigfontfalse -\DeclareOption{bigfont}{\bigfonttrue} + \bigfontfalse +\DeclareOption{largefont}{\examn@fontvariant=1 \bigfontfalse} +% Deprecate [bigfont]; consider removing in v1.2 +\DeclareOption{bigfont}{% + \ClassWarning{exam-n}{OPTION [bigfont] HAS BEEN DEPRECATED; use [hugefont] instead} + \examn@fontvariant=2 \bigfonttrue} +\DeclareOption{hugefont}{\examn@fontvariant=2 \bigfonttrue} % \end{macrocode} % % This class is based on the article class. Load it, and pass the \texttt{a4paper} @@ -1253,7 +1304,7 @@ have a clue. % \begin{macrocode} \def\examn@setdocident{% \begingroup - % yes, a big \ifcase would be more straightforward; + % yes, a big \ifcase would be more straightforward; % no, that wouldn't be any fun at all % (also it ends up looking messy and even tricksier). \def\@step##1##2\@nil{\advance\@tempcnta##1 \def\@tempa{##2}} @@ -1328,15 +1379,15 @@ have a clue. \fi \ClassWarningNoLine{exam-n}{Using Mathtime fonts} \or % use mtpro2 fonts - \RequirePackage[T1]{fontenc} - \RequirePackage{textcomp} + \RequirePackage[T1]{fontenc} + \RequirePackage{textcomp} \ifexamn@serif \renewcommand\rmdefault{ptm} % the default \else - \RequirePackage[scaled=0.9]{helvet} + \RequirePackage[scaled=0.9]{helvet} \renewcommand\rmdefault{phv} \fi - \RequirePackage[mtpbb]{mtpro2} + \RequirePackage[mtpbb]{mtpro2} \ClassWarningNoLine{exam-n}{Using MTPro2 fonts} \else \ClassError{exam-n}{Impossible value of mtselect: \examn@mtselect} @@ -1362,7 +1413,25 @@ have a clue. % implement both of them by redefining |\examn@bodyfontchange|, so % they're not in practice (a future fix, perhaps). % \begin{macrocode} -\ifbigfont +\ifcase\examn@fontvariant + % default: do nothing +\or + % font variant 1: 18pt + \def\examn@bodyfontchange{ + \renewcommand\normalsize{% + \@setfontsize\normalsize{18}{24}% + \abovedisplayskip 18\p@ \@plus3.5\p@ \@minus9\p@ + \abovedisplayshortskip \z@ \@plus5\p@ + \belowdisplayshortskip 10\p@ \@plus5\p@ \@minus5\p@ + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI} + \parindent=24pt + \parskip=18pt + % Redefine \FormatPartMarks so that it doesn't push the text off the paper + \let\FormatPartMarks\examn@variantFormatPartMarks + } +\or + % font variant 2: 36pt \def\examn@bodyfontchange{ \renewcommand\normalsize{% \@setfontsize\normalsize{36}{42}% @@ -1374,18 +1443,28 @@ have a clue. \parindent=48pt \parskip=36pt % Redefine \FormatPartMarks so that it doesn't push the text off the paper - \def\FormatPartMarks##1{ - \setbox0=\hbox{\hskip 1em \textbf{[##1]}} - \@tempdima=0.8\marginsize - \ifdim\wd0>\@tempdima - \advance\@tempdima -\wd0 - \hbox to 0pt{\hskip\@tempdima \box0\hss}% - \else - \hbox to 0pt{\box0\hss} - \fi}} + \let\FormatPartMarks\examn@variantFormatPartMarks + } +\else + % Bad font variant + \ClassError{exam-n} + {Bad font variant \examn@fontvariant} + {I didn't expect to see that number (broken style file re largefont/hugefont?)} \fi % \end{macrocode} -% +% The above font variants require a |\FormatPartMarks| variant which +% avoids being pushed off the edge of the page. +% \begin{macrocode} +\def\examn@variantFormatPartMarks#1{% + \setbox0=\hbox{\hskip 1em \textbf{[#1]}}% + \@tempdima=0.8\marginsize + \ifdim\wd0>\@tempdima + \advance\@tempdima -\wd0 + \hbox to 0pt{\hskip\@tempdima \box0\hss}% + \else + \hbox to 0pt{\box0\hss}% + \fi} +% \end{macrocode} % % \subsubsection{Exam metadata} % @@ -1420,7 +1499,7 @@ have a clue. \let\@tempb\leavevmode \def\dd##1\\{% \def\@tempa{##1}% - \ifx\@tempa\@empty + \ifx\@tempa\@empty \let\next\relax \else \@tempb\hbox{##1}\let\next\dd @@ -1459,12 +1538,12 @@ images may not be used in examinations without prior arrangement. \def\CheckTotalQuestions{% \ifnum\@draftstatus < 2 \ifx\@numquestions\@empty \else - \ifnum\questionnumber=\@numquestions \else + \ifnum\c@questionnumber=\@numquestions \else \ClassWarning{exam-n} - {Expected \@numquestions\space questions, got \the\questionnumber!} + {Expected \@numquestions\space questions, got \thequestionnumber!} \ifnum\@draftstatus > 0 % draft mode \begin{center} - \textbf{\highlighted{Expected \@numquestions\space questions, got \the\questionnumber}} + \textbf{\highlighted{Expected \@numquestions\space questions, got \thequestionnumber}} \end{center} \fi \fi @@ -1581,7 +1660,7 @@ images may not be used in examinations without prior arrangement. % |begingroup |ttfamily % \catcode`\{=12 \catcode`\}=12 \catcode`\\=12 % |noindent \newcommand\FormatPartNumber{|linebreak -% |noindent|quad\hbox to 2em{(\alph{partnumber})\hss}} +% |noindent|quad\hbox to 2em{(\StylePartNumber{partnumber})\hss}} % |endgroup % \end{quotation} % works adequately as a part number, @@ -1592,19 +1671,38 @@ images may not be used in examinations without prior arrangement. \setlength{\parskip}{\bigskipamount} % \end{macrocode} % +% We must clear out any floats at the end of the paper, without +% forcing a new page (figures and tables don't float, but there are +% other packages which can generate floats, such as the +% \Lenv{sidewaystable} from the \Lpackage{rotating} package). +% This technique is simplified form Donald Arsenau's \Lpackage{placeins} package. +% \begin{macrocode} +\def\examn@flushfloats{\par + \begingroup + \edef\@tempa{\@deferlist\@dbldeferlist} + \ifx\@tempa\@empty \else + \clearpage + \fi + \endgroup +} +% \end{macrocode} % Text at the end of the paper. Command |\ClosingText| is added to % |\AtEndDocument|, below. % \begin{macrocode} \ifcase\@draftstatus % Final version \def\ClosingText{ + \examn@flushfloats \begin{center}\textbf{End of Paper}\\\end{center} \mark{END}} \or % Draft version \def\ClosingText{ + \examn@flushfloats \begin{center}\textbf{End of Draft Paper}\\\end{center} \mark{END}} \else % Compose version (nothing, because this would be on a page by itself) - \def\ClosingText{\mark{END}} + \def\ClosingText{ + \examn@flushfloats + \mark{END}} \fi % \end{macrocode} % @@ -1649,7 +1747,7 @@ images may not be used in examinations without prior arrangement. \def\@tempa{END} \xdef\examn@topmark{\botmark} \ifx\examn@topmark\@empty - \formatcontinuations{Paper continued over}% + \formatcontinuations{Paper continued over\dots}% \else\ifx\examn@topmark\@tempa \formatcontinuations{END} \else @@ -1817,7 +1915,7 @@ images may not be used in examinations without prior arrangement. \leftskip=0pt plus1fil \rightskip=0pt \parfillskip=0pt \baselineskip=2.5ex \parskip=0.25ex - \let\\\par + \let\\\par \ifx\@examdate\@empty \shout{missing exam date} \else @@ -1883,15 +1981,16 @@ images may not be used in examinations without prior arrangement. \vskip 2\baselineskip plus 0.3fil \parindent=0pt \parskip=0.5\baselineskip - \ifbigfont + \ifnum\examn@fontvariant > 0 % Don't put the rubric here (see below) + {\LARGE Rubric: see overleaf} \else \ifx\@rubric\@empty\else \ifx\@rubric\@nnil\else - % if there's a rubric, separate from the base rubric, then + % If there's a rubric, separate from the base rubric, then % separate the two with an hrule (the per-exam rubric % presumably represents special instructions for this exam, - % so should be highlighted + % so should be highlighted) \vbox{\let\emph\textbf \@rubric \par} @@ -1903,10 +2002,10 @@ images may not be used in examinations without prior arrangement. % \end{macrocode} % Let the base rubric be a justified block of text near the bottom. % \begin{macrocode} - \ifx\@baserubric\@empty \else - \@baserubric \par - \fi - \fi % end \ifbigfont\else + \ifx\@baserubric\@empty \else + \@baserubric \par + \fi + \fi % end \ifbigfont \else ... \end{center} % \end{macrocode} % These various fractions of fil glue don't add up as I'd expect @@ -1955,7 +2054,7 @@ images may not be used in examinations without prior arrangement. % \examn@bodyfontchange \normalfont\normalsize - \ifbigfont + \ifnum\examn@fontvariant>0 % Put the rubric on a second page, in the 'huge' size. \begin{center} \parskip=18pt @@ -2016,7 +2115,7 @@ images may not be used in examinations without prior arrangement. % their arguments. If we don't, then \LaTeX\ gets \emph{terribly} % confused about what the mark is. I don't quite follow what happens % in this case, but symptoms include Babel blowing up, and -% \TeX\ running out of stack space. +% \TeX\ running out of stack space. So: bad. % \begin{macrocode} \let\sectionmark\@gobble \let\subsectionmark\@gobble @@ -2032,13 +2131,24 @@ images may not be used in examinations without prior arrangement. \def\subparagraph{\@badsection{subparagraph}} % \end{macrocode} % +% The above redefinitions break the |\tableofcontents| macro. +% It's unlikely but \emph{possibly} useful, in some cases, to have a +% table of contents in an exam paper. Whether or not it is, we should +% avoid breaking it, on a principle of least surprise. The following +% makes the macro work again, even though it's not particularly +% pretty. +% \begin{macrocode} +\renewcommand\tableofcontents{\bigskip + \hbox to \textwidth{\hfil\textbf{\Large Contents}\hfil}% + \@starttoc{toc}} +% \end{macrocode} +% % Counters: % \begin{macrocode} \newcount\marktotal % number of marks accumulated so far \newcount\markgoal % number of marks we should have in the end - -\newcount\questionnumber -\questionnumber=0 +\newcounter{questionnumber} +\setcounter{questionnumber}0 % \end{macrocode} % % Counter partnumber holds the number (i,ii,iii, etc) of the parts @@ -2063,7 +2173,14 @@ images may not be used in examinations without prior arrangement. % The default |\FormatPartNumber| creates a box the same size as a % parindent. This therefore assumes that it's following a |\noindent|. % \begin{macrocode} -\newcommand\FormatPartNumber{\hbox to \parindent{(\alph{partnumber})\hss}} +\newcommand\FormatPartNumber{\hbox to \parindent{(\StylePartNumber{partnumber})\hss}} +% \end{macrocode} +% And by default we use alphanumeric counters for parts (we abstract +% this, rather than simply including |\alph| in the definition of +% |\FormatPartNumber|, so that we use the same style for the +% `answerpartnumber' counter. +% \begin{macrocode} +\let\StylePartNumber\alph % \end{macrocode} % % A flag indicating whether we should start a new page before the next @@ -2139,7 +2256,7 @@ images may not be used in examinations without prior arrangement. % visual display only -- doesn't count towards mark total \setbox0=\vbox to 0pt{\vss \hbox to \textwidth{\hfil\hbox to 0pt{\quad\small[\dots #1]\hss}} - \vskip0.25ex } + \vskip0.25ex }% % the next line is probably unnecessary, but guarantees that box0 % has zero depth, so no extra vertical space appears because of % this new box @@ -2153,25 +2270,48 @@ images may not be used in examinations without prior arrangement. \global\advance\marktotal #1 \if@tempswa % \end{macrocode} -% Just after maths (or some other display which doesn't fill the line) -% -- move the part mark up a bit. We don't automatically end the +% This is the starred form of |\partmarks|. That is, this is being invoked +% (i) just after maths (or some other display which doesn't fill the line), +% \emph{or} (ii) at the end of an unnumbered equation. In case (i), +% we move the part mark up a bit; in case (ii), we format the +% partmarks as a type of equation number +% +% We handle case (ii) first, by detecting whether we're in a maths +% display. If so, we format the partmarks as an equation number, using +% |\eqno|. Note that \Lpackage{amsmath} maths (which is what we're +% using here) formats this differently if the material following +% |\eqno| is of zero size, so we make this slightly larger than that. +% \begin{macrocode} + \ifdim\displaywidth>0pt + \if@eqnsw + \ClassError{exam-n}{\string\partmarks* may not be used + within numbered equations}{Replace \string\partmarks* + with a \string\partmarks\ after the equation} + \global\advance\marktotal -#1 % to cause the mark total to be wrong + \else + \eqno \hbox to 1sp{\FormatPartMarks{#1}\hfil}% + \fi +% \end{macrocode} +% Case (i), not in maths: We don't automatically end the % paragraph here, because a display will often not be the end of a paragraph. % I am not at all convinced that this is the correct approach % to nudging the partmarks text up the right amount. The % following appears to do roughly the right thing, but there's a % strong element of trial and error in it. % \begin{macrocode} - \setbox0=\vbox to 0pt{\vss - \hbox to \textwidth{\strut\hfill\FormatPartMarks{#1}}% - \vskip 1\baselineskip} % vskip means box has zero depth - \ifvmode - \box0 \else - \vadjust{\box0}% + \setbox0=\vbox to 0pt{\vss + \hbox to \textwidth{\strut\hfill\FormatPartMarks{#1}}% + \vskip 1\baselineskip}% vskip means box has zero depth + \ifvmode + \box0 + \else + \vadjust{\box0}% + \fi \fi % \end{macrocode} -% Not after maths. We also end the paragraph here. -% This is filched from the TeXBook, p106. +% We've called the unstarred version of |\partmarks|. We also end the paragraph here +% (this technique is filched from the TeXBook, p106). % \begin{macrocode} \else \ifdim\@partmarksspace > 0pt @@ -2235,8 +2375,8 @@ images may not be used in examinations without prior arrangement. {Missing mark goal for question (using 0 instead)} {Missing mark goal for question (using 0 instead)} \def\@tempa{0} - \fi - \ifx\@includequestionoverridenumber\@empty + \fi + \ifx\@includequestionoverridenumber\@empty \do@question{#1}{\@tempa}% \else \ClassWarning{exam-n}{Forcing question number @@ -2304,16 +2444,16 @@ images may not be used in examinations without prior arrangement. % \begin{macrocode} {\par \ifnum\ex@mcqi<\ex@nmcq - \ClassWarning{exam-n}{Too few potential answers in MCQ \the\questionnumber} - \@shout{Too few potential answers in MCQ \the\questionnumber} + \ClassWarning{exam-n}{Too few potential answers in MCQ \thequestionnumber} + \@shout{Too few potential answers in MCQ \thequestionnumber} \ifnum\@draftstatus > 0 \highlighted{TOO FEW ANSWERS}\par \fi \fi \ifcase\ex@mcqnanswer \ClassWarning{exam-n} - {No correct MCQ answer provided in question \the\questionnumber} - \@shout{No correct MCQ answer provided in question \the\questionnumber} + {No correct MCQ answer provided in question \thequestionnumber} + \@shout{No correct MCQ answer provided in question \thequestionnumber} \ifnum\@draftstatus > 0 \highlighted{NO CORRECT ANSWER PROVIDED}\par \fi @@ -2321,8 +2461,8 @@ images may not be used in examinations without prior arrangement. % ex@mcqanswer=1: correct -- do nothing \else \ClassWarning{exam-n} - {Too many correct MCQ answers provided in question \the\questionnumber} - \@shout{Too many correct MCQ answers provided in question \the\questionnumber} + {Too many correct MCQ answers provided in question \thequestionnumber} + \@shout{Too many correct MCQ answers provided in question \thequestionnumber} \ifnum\@draftstatus > 0 \highlighted{TOO MANY CORRECT ANSWERS}\par \fi @@ -2380,7 +2520,18 @@ images may not be used in examinations without prior arrangement. \questionpreamble{} \fi \setcounter{partnumber}{0} - \global\advance\questionnumber 1 + \setcounter{answerpartnumber}{0} +% \end{macrocode} +% If the argument |#1| is non-empty, then it is a number, forcing the +% question number. This is local, however -- don't use it to change +% the sequence of questions, so don't set the `questionnumber' +% counter, but only the current label. +% \begin{macrocode} + \refstepcounter{questionnumber} + \def\@tempa{#1} + \ifx\@tempa\@empty \else + \edef\@currentlabel{#1} + \fi % \end{macrocode} % % If |pageperquestion| is true, then start a new page here (unless @@ -2410,9 +2561,9 @@ images may not be used in examinations without prior arrangement. % \begin{macrocode} \ifx\@tempa\@empty % no optional argument -- easy - \def\@currentquestion{\the\questionnumber} + \def\@currentquestion{\thequestionnumber} % \end{macrocode} -% +% % We have a non-null optional argument in |#1|. % Check the question number in the argument. If there's a % mismatch, warn in draft mode, and fail in final mode. First, @@ -2433,27 +2584,26 @@ images may not be used in examinations without prior arrangement. (the formatting below may be messed up).\par \fi % \end{macrocode} -% Switch on the draft status: in the final version, this mismatch is -% an error +% Switch on the draft status: in the final version, this mismatch is an error % \begin{macrocode} \ifcase\@draftstatus % Final version \@tempcnta=#1 - \ifnum\questionnumber=\@tempcnta + \ifnum\c@questionnumber=\@tempcnta \def\@currentquestion{#1} \else \ifx\@includequestionoverridenumber\@empty \ClassError{exam-n} - {\string\question[#1] is actually question \the\questionnumber!} + {\string\question[#1] is actually question \thequestionnumber!} {The question in {question} environment number - \the\questionnumber\space is specified as + \thequestionnumber\space is specified as \string\question[#1].\MessageBreak This is an error in 'final' mode.\MessageBreak Perhaps you need \string\QuestionNumberChecksOff?} \def\@currentquestion{???} \else \ClassWarning{exam-n}{Forcing question number \@includequestionoverridenumber, - in {question} environment number \the\questionnumber} + in {question} environment number \thequestionnumber} \edef\@currentquestion{\@includequestionoverridenumber}% this doesn't seem to expand in fact! \message{current question=\@currentquestion, override \@includequestionoverridenumber} \fi @@ -2465,9 +2615,9 @@ images may not be used in examinations without prior arrangement. % Draft version -- let the given number override % \the\questionnumber, but warn if there's a difference. \@tempcnta=#1 - \ifnum\questionnumber=\@tempcnta \else + \ifnum\c@questionnumber=\@tempcnta \else \ClassWarning{exam-n} - {\string\question[#1] is actually question \the\questionnumber!} + {\string\question[#1] is actually question \thequestionnumber!} \fi \def\@currentquestion{#1} \else @@ -2482,9 +2632,9 @@ images may not be used in examinations without prior arrangement. % no optional argument -- this is possibly an error, so warn \ClassWarning{exam-n}{\string\QuestionNumberChecksOff\ is in force, but this question has no [number]} - \def\@currentquestion{\the\questionnumber} + \def\@currentquestion{\thequestionnumber} \else - \typeout{Forcing question \the\questionnumber\space to be #1} + \typeout{Forcing question \thequestionnumber\space to be #1} \def\@currentquestion{#1} \fi \fi @@ -2498,11 +2648,18 @@ images may not be used in examinations without prior arrangement. % question number: if it happens before, and there is a page-break % immediately before the new question, we can get a spurious % `Q?? continued' on the previous page. +% +% If a paragraph starts inside a level of grouping -- for example +% |{\bf 1} text...| or even just |{T}ext| -- then the |\everypar| +% tokens are expanded inside that group, which means that the +% resetting of |\everypar| is local, with the result that the tokens +% are reused for the next paragraph. Make the emptying of |\everypar| +% global for that reason. % \begin{macrocode} \everypar{\setbox0=\lastbox % discard \box0 \FormatQuestionNumber \mark{\@currentquestion}% - \everypar{}} + \global\everypar{}} } % \end{macrocode} % Format the question number. This command is documented as existing, @@ -2512,8 +2669,7 @@ images may not be used in examinations without prior arrangement. {\hbox to 0pt{\hss \textbf{\@currentquestion}\hskip1em}} % \end{macrocode} % -% Finish off the question. -% +% Finish off the question: % Format the indication of the total number % of marks, and do a few consistency checks. % \begin{macrocode} @@ -2532,6 +2688,9 @@ images may not be used in examinations without prior arrangement. \break \fi \fi +% \end{macrocode} +% In the case where the mark total doesn't match, make a noise about it. +% \begin{macrocode} \else \ClassWarning{exam-n} {Question \@currentquestion\space has a total of \the\marktotal\space marks, @@ -2544,6 +2703,9 @@ images may not be used in examinations without prior arrangement. \expandafter\shout\expandafter{\@tempa} \end{center} \fi +% \end{macrocode} +% Make a few tidyups in the end-question wrapper. +% \begin{macrocode} \examn@endquestion{% \if@showmarktotals \par % into vertical mode @@ -2567,8 +2729,10 @@ images may not be used in examinations without prior arrangement. % % The \Lenv{questiondata} environment allows the author to provide % some additional data or equations for the question. +% This environment ends a preceding paragraph. % \begin{macrocode} \newenvironment{questiondata}{% + \par \penalty50 % poor break \vbox\bgroup \slshape @@ -2584,7 +2748,7 @@ images may not be used in examinations without prior arrangement. \medskip \hrule width \textwidth \par - \egroup + \egroup % end of \vbox } % \end{macrocode} % @@ -2672,7 +2836,7 @@ images may not be used in examinations without prior arrangement. % remark to a list of exclamations which are highlighted at the end of % the document. % The argument to |\@shout| can have expandable things (such as -% |\the\questionnumber|) in it. +% |\thequestionnumber|) in it. % Shouts appear in all modes and cannot be suppressed. % \begin{macrocode} \newtoks\@allshouts \@allshouts={} @@ -2744,6 +2908,22 @@ images may not be used in examinations without prior arrangement. \@insolutionfalse % \end{macrocode} % +% We want to use |\part| within solutions. If we were to do so naively +% however, we would end up incrementing the |partnumber| counter +% which that macro uses, which either disturbs the numbering of the +% parts in the question (if the solutions are interspersed in the +% question) or starts out of sequence (if the solutions are at the +% end). So we maintain a separate counter. Additionally, we want to +% force the formatting of the solution parts, to be independent of the +% formatting in the main question +% \begin{macrocode} +\newcounter{answerpartnumber} +\newcommand{\examn@solutionpart}{% + \par + \stepcounter{answerpartnumber} + \noindent\hbox to \parindent{(\StylePartNumber{answerpartnumber})\hss}} +% \end{macrocode} +% % Specify how solutions should be shown. The following makes them % ragged right, slightly smaller and slanted, with rules fore and aft. % This doesn't leap out, but the difference should be detectable. @@ -2759,6 +2939,7 @@ images may not be used in examinations without prior arrangement. \fi \examn@dummycaptions % dummy captions within solutions \typeout{SHOWING SOLUTIONS} + \let\part\examn@solutionpart % \end{macrocode} % Checks done; now get on with the layout % \begin{macrocode} @@ -2767,7 +2948,7 @@ images may not be used in examinations without prior arrangement. \parskip 0.5\baselineskip \raggedright \color{solutiontext}%\slshape - \ifbigfont\else + \ifbigfont \else \small \fi \hrule @@ -2776,6 +2957,7 @@ images may not be used in examinations without prior arrangement. \vskip -\parskip % cancel out the following parskip \textbf{\highlighted{Solution:}}\hskip2em \ignorespaces + \parindent=2em } % \end{macrocode} % The end of the solution environment is simple, and simply matches @@ -2789,7 +2971,7 @@ images may not be used in examinations without prior arrangement. \hrule } % \end{macrocode} -% +% % The content of the \Lenv{solution} environment is balanced \LaTeX\ % text, and so does not have to be complicated; in particular, it does % not have to have the generality, and the consequent restrictions, of @@ -2897,7 +3079,7 @@ images may not be used in examinations without prior arrangement. } } % \end{macrocode} -% +% % \subsubsection{Solutions and pdfpages} % % It appears that the \Lpackage{pdfpages} package is incompatible with diff --git a/Master/texmf-dist/tex/latex/exam-n/exam-n.cls b/Master/texmf-dist/tex/latex/exam-n/exam-n.cls index 68a03b55c61..fb7e2ce8345 100644 --- a/Master/texmf-dist/tex/latex/exam-n/exam-n.cls +++ b/Master/texmf-dist/tex/latex/exam-n/exam-n.cls @@ -6,10 +6,10 @@ %% %% exam-n.dtx (with options: `package') %% exam-n: format exam questions -%% Release version 1.1, 2014 May 03. +%% Release version 1.1.4, 2016 December 19. %% %%%% File: exam-n.dtx -%%%% Copyright 2005--2014, Norman Gray +%%%% Copyright 2005--2016, Norman Gray %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -27,12 +27,12 @@ %% the derived file exam-n.cls, %% and the associated *.clo files. -%%%% Source: Mercurial revision 6f818b549982, 2014-05-03 13:42 +0100, tag 1.1 + 0 +%%%% Source: Mercurial revision e8a612cb25f4, 2016-12-19 16:49 +0000, tag exam-n-1.1.4 + 0 %% \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{exam-n}[2014/05/03 1.1] -\typeout{Class: `exam-n 1.1 <2014/05/03>} +\ProvidesClass{exam-n}[2016/12/19 1.1.4] +\typeout{Class: `exam-n 1.1.4 <2016/12/19>} @@ -94,9 +94,15 @@ \def\examn@header@shoutformat#1{{\Huge\bfseries #1}} } \DeclareOption{colour}{} +\newcount\examn@fontvariant + \examn@fontvariant=0 % the default \newif\ifbigfont -\bigfontfalse -\DeclareOption{bigfont}{\bigfonttrue} + \bigfontfalse +\DeclareOption{largefont}{\examn@fontvariant=1 \bigfontfalse} +\DeclareOption{bigfont}{% + \ClassWarning{exam-n}{OPTION [bigfont] HAS BEEN DEPRECATED; use [hugefont] instead} + \examn@fontvariant=2 \bigfonttrue} +\DeclareOption{hugefont}{\examn@fontvariant=2 \bigfonttrue} \PassOptionsToClass{a4paper}{article} \newtoks\@styleoverrides \@styleoverrides={} @@ -228,7 +234,25 @@ \DeclareRobustCommand\normalfont {\usefont\encodingdefault\sfdefault\seriesdefault\shapedefault \relax} \fi -\ifbigfont +\ifcase\examn@fontvariant + % default: do nothing +\or + % font variant 1: 18pt + \def\examn@bodyfontchange{ + \renewcommand\normalsize{% + \@setfontsize\normalsize{18}{24}% + \abovedisplayskip 18\p@ \@plus3.5\p@ \@minus9\p@ + \abovedisplayshortskip \z@ \@plus5\p@ + \belowdisplayshortskip 10\p@ \@plus5\p@ \@minus5\p@ + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI} + \parindent=24pt + \parskip=18pt + % Redefine \FormatPartMarks so that it doesn't push the text off the paper + \let\FormatPartMarks\examn@variantFormatPartMarks + } +\or + % font variant 2: 36pt \def\examn@bodyfontchange{ \renewcommand\normalsize{% \@setfontsize\normalsize{36}{42}% @@ -240,16 +264,23 @@ \parindent=48pt \parskip=36pt % Redefine \FormatPartMarks so that it doesn't push the text off the paper - \def\FormatPartMarks##1{ - \setbox0=\hbox{\hskip 1em \textbf{[##1]}} - \@tempdima=0.8\marginsize - \ifdim\wd0>\@tempdima - \advance\@tempdima -\wd0 - \hbox to 0pt{\hskip\@tempdima \box0\hss}% - \else - \hbox to 0pt{\box0\hss} - \fi}} + \let\FormatPartMarks\examn@variantFormatPartMarks + } +\else + % Bad font variant + \ClassError{exam-n} + {Bad font variant \examn@fontvariant} + {I didn't expect to see that number (broken style file re largefont/hugefont?)} \fi +\def\examn@variantFormatPartMarks#1{% + \setbox0=\hbox{\hskip 1em \textbf{[#1]}}% + \@tempdima=0.8\marginsize + \ifdim\wd0>\@tempdima + \advance\@tempdima -\wd0 + \hbox to 0pt{\hskip\@tempdima \box0\hss}% + \else + \hbox to 0pt{\box0\hss}% + \fi} \def\@exambanner{} \def\exambanner{\def\@exambanner} @@ -303,12 +334,12 @@ images may not be used in examinations without prior arrangement. \def\CheckTotalQuestions{% \ifnum\@draftstatus < 2 \ifx\@numquestions\@empty \else - \ifnum\questionnumber=\@numquestions \else + \ifnum\c@questionnumber=\@numquestions \else \ClassWarning{exam-n} - {Expected \@numquestions\space questions, got \the\questionnumber!} + {Expected \@numquestions\space questions, got \thequestionnumber!} \ifnum\@draftstatus > 0 % draft mode \begin{center} - \textbf{\highlighted{Expected \@numquestions\space questions, got \the\questionnumber}} + \textbf{\highlighted{Expected \@numquestions\space questions, got \thequestionnumber}} \end{center} \fi \fi @@ -365,16 +396,28 @@ images may not be used in examinations without prior arrangement. } \setlength{\parindent}{2em} \setlength{\parskip}{\bigskipamount} +\def\examn@flushfloats{\par + \begingroup + \edef\@tempa{\@deferlist\@dbldeferlist} + \ifx\@tempa\@empty \else + \clearpage + \fi + \endgroup +} \ifcase\@draftstatus % Final version \def\ClosingText{ + \examn@flushfloats \begin{center}\textbf{End of Paper}\\\end{center} \mark{END}} \or % Draft version \def\ClosingText{ + \examn@flushfloats \begin{center}\textbf{End of Draft Paper}\\\end{center} \mark{END}} \else % Compose version (nothing, because this would be on a page by itself) - \def\ClosingText{\mark{END}} + \def\ClosingText{ + \examn@flushfloats + \mark{END}} \fi \RequirePackage{fancyhdr} \pagestyle{fancy} @@ -390,7 +433,7 @@ images may not be used in examinations without prior arrangement. \def\@tempa{END} \xdef\examn@topmark{\botmark} \ifx\examn@topmark\@empty - \formatcontinuations{Paper continued over}% + \formatcontinuations{Paper continued over\dots}% \else\ifx\examn@topmark\@tempa \formatcontinuations{END} \else @@ -552,15 +595,16 @@ images may not be used in examinations without prior arrangement. \vskip 2\baselineskip plus 0.3fil \parindent=0pt \parskip=0.5\baselineskip - \ifbigfont + \ifnum\examn@fontvariant > 0 % Don't put the rubric here (see below) + {\LARGE Rubric: see overleaf} \else \ifx\@rubric\@empty\else \ifx\@rubric\@nnil\else - % if there's a rubric, separate from the base rubric, then + % If there's a rubric, separate from the base rubric, then % separate the two with an hrule (the per-exam rubric % presumably represents special instructions for this exam, - % so should be highlighted + % so should be highlighted) \vbox{\let\emph\textbf \@rubric \par} @@ -569,10 +613,10 @@ images may not be used in examinations without prior arrangement. \vskip1.5\baselineskip \fi \fi - \ifx\@baserubric\@empty \else - \@baserubric \par - \fi - \fi % end \ifbigfont\else + \ifx\@baserubric\@empty \else + \@baserubric \par + \fi + \fi % end \ifbigfont \else ... \end{center} \vskip 2\baselineskip plus 0.6fil % \newpage is {\vfil\penalty-\@M} \vbox to 0pt{\hbox to \textwidth{% @@ -606,7 +650,7 @@ images may not be used in examinations without prior arrangement. % \examn@bodyfontchange \normalfont\normalsize - \ifbigfont + \ifnum\examn@fontvariant>0 % Put the rubric on a second page, in the 'huge' size. \begin{center} \parskip=18pt @@ -654,11 +698,13 @@ images may not be used in examinations without prior arrangement. \def\subsubsection{\@badsection{subsubsection}} \def\paragraph{\@badsection{paragraph}} \def\subparagraph{\@badsection{subparagraph}} +\renewcommand\tableofcontents{\bigskip + \hbox to \textwidth{\hfil\textbf{\Large Contents}\hfil}% + \@starttoc{toc}} \newcount\marktotal % number of marks accumulated so far \newcount\markgoal % number of marks we should have in the end - -\newcount\questionnumber -\questionnumber=0 +\newcounter{questionnumber} +\setcounter{questionnumber}0 \newcounter{partnumber} \renewcommand\part{% \if@nobreak \else @@ -672,7 +718,8 @@ images may not be used in examinations without prior arrangement. \stepcounter{partnumber}% \noindent\FormatPartNumber } -\newcommand\FormatPartNumber{\hbox to \parindent{(\alph{partnumber})\hss}} +\newcommand\FormatPartNumber{\hbox to \parindent{(\StylePartNumber{partnumber})\hss}} +\let\StylePartNumber\alph \newif\if@newpagebeforequestion \if@pageperquestion \@newpagebeforequestiontrue @@ -713,7 +760,7 @@ images may not be used in examinations without prior arrangement. % visual display only -- doesn't count towards mark total \setbox0=\vbox to 0pt{\vss \hbox to \textwidth{\hfil\hbox to 0pt{\quad\small[\dots #1]\hss}} - \vskip0.25ex } + \vskip0.25ex }% % the next line is probably unnecessary, but guarantees that box0 % has zero depth, so no extra vertical space appears because of % this new box @@ -726,13 +773,24 @@ images may not be used in examinations without prior arrangement. \else \global\advance\marktotal #1 \if@tempswa - \setbox0=\vbox to 0pt{\vss - \hbox to \textwidth{\strut\hfill\FormatPartMarks{#1}}% - \vskip 1\baselineskip} % vskip means box has zero depth - \ifvmode - \box0 + \ifdim\displaywidth>0pt + \if@eqnsw + \ClassError{exam-n}{\string\partmarks* may not be used + within numbered equations}{Replace \string\partmarks* + with a \string\partmarks\ after the equation} + \global\advance\marktotal -#1 % to cause the mark total to be wrong + \else + \eqno \hbox to 1sp{\FormatPartMarks{#1}\hfil}% + \fi \else - \vadjust{\box0}% + \setbox0=\vbox to 0pt{\vss + \hbox to \textwidth{\strut\hfill\FormatPartMarks{#1}}% + \vskip 1\baselineskip}% vskip means box has zero depth + \ifvmode + \box0 + \else + \vadjust{\box0}% + \fi \fi \else \ifdim\@partmarksspace > 0pt @@ -770,8 +828,8 @@ images may not be used in examinations without prior arrangement. {Missing mark goal for question (using 0 instead)} {Missing mark goal for question (using 0 instead)} \def\@tempa{0} - \fi - \ifx\@includequestionoverridenumber\@empty + \fi + \ifx\@includequestionoverridenumber\@empty \do@question{#1}{\@tempa}% \else \ClassWarning{exam-n}{Forcing question number @@ -802,16 +860,16 @@ images may not be used in examinations without prior arrangement. \fi} {\par \ifnum\ex@mcqi<\ex@nmcq - \ClassWarning{exam-n}{Too few potential answers in MCQ \the\questionnumber} - \@shout{Too few potential answers in MCQ \the\questionnumber} + \ClassWarning{exam-n}{Too few potential answers in MCQ \thequestionnumber} + \@shout{Too few potential answers in MCQ \thequestionnumber} \ifnum\@draftstatus > 0 \highlighted{TOO FEW ANSWERS}\par \fi \fi \ifcase\ex@mcqnanswer \ClassWarning{exam-n} - {No correct MCQ answer provided in question \the\questionnumber} - \@shout{No correct MCQ answer provided in question \the\questionnumber} + {No correct MCQ answer provided in question \thequestionnumber} + \@shout{No correct MCQ answer provided in question \thequestionnumber} \ifnum\@draftstatus > 0 \highlighted{NO CORRECT ANSWER PROVIDED}\par \fi @@ -819,8 +877,8 @@ images may not be used in examinations without prior arrangement. % ex@mcqanswer=1: correct -- do nothing \else \ClassWarning{exam-n} - {Too many correct MCQ answers provided in question \the\questionnumber} - \@shout{Too many correct MCQ answers provided in question \the\questionnumber} + {Too many correct MCQ answers provided in question \thequestionnumber} + \@shout{Too many correct MCQ answers provided in question \thequestionnumber} \ifnum\@draftstatus > 0 \highlighted{TOO MANY CORRECT ANSWERS}\par \fi @@ -862,7 +920,12 @@ images may not be used in examinations without prior arrangement. \questionpreamble{} \fi \setcounter{partnumber}{0} - \global\advance\questionnumber 1 + \setcounter{answerpartnumber}{0} + \refstepcounter{questionnumber} + \def\@tempa{#1} + \ifx\@tempa\@empty \else + \edef\@currentlabel{#1} + \fi \examn@prequestionspace{% \if@nobreak % after a heading (or something like that) @@ -876,7 +939,7 @@ images may not be used in examinations without prior arrangement. \def\@tempa{#1}% intended question number \ifx\@tempa\@empty % no optional argument -- easy - \def\@currentquestion{\the\questionnumber} + \def\@currentquestion{\thequestionnumber} \else \setbox0=\hbox{\@tempcnta=#1} \ifdim\wd0>0pt @@ -889,21 +952,21 @@ images may not be used in examinations without prior arrangement. \ifcase\@draftstatus % Final version \@tempcnta=#1 - \ifnum\questionnumber=\@tempcnta + \ifnum\c@questionnumber=\@tempcnta \def\@currentquestion{#1} \else \ifx\@includequestionoverridenumber\@empty \ClassError{exam-n} - {\string\question[#1] is actually question \the\questionnumber!} + {\string\question[#1] is actually question \thequestionnumber!} {The question in {question} environment number - \the\questionnumber\space is specified as + \thequestionnumber\space is specified as \string\question[#1].\MessageBreak This is an error in 'final' mode.\MessageBreak Perhaps you need \string\QuestionNumberChecksOff?} \def\@currentquestion{???} \else \ClassWarning{exam-n}{Forcing question number \@includequestionoverridenumber, - in {question} environment number \the\questionnumber} + in {question} environment number \thequestionnumber} \edef\@currentquestion{\@includequestionoverridenumber}% this doesn't seem to expand in fact! \message{current question=\@currentquestion, override \@includequestionoverridenumber} \fi @@ -912,9 +975,9 @@ images may not be used in examinations without prior arrangement. % Draft version -- let the given number override % \the\questionnumber, but warn if there's a difference. \@tempcnta=#1 - \ifnum\questionnumber=\@tempcnta \else + \ifnum\c@questionnumber=\@tempcnta \else \ClassWarning{exam-n} - {\string\question[#1] is actually question \the\questionnumber!} + {\string\question[#1] is actually question \thequestionnumber!} \fi \def\@currentquestion{#1} \else @@ -929,16 +992,16 @@ images may not be used in examinations without prior arrangement. % no optional argument -- this is possibly an error, so warn \ClassWarning{exam-n}{\string\QuestionNumberChecksOff\ is in force, but this question has no [number]} - \def\@currentquestion{\the\questionnumber} + \def\@currentquestion{\thequestionnumber} \else - \typeout{Forcing question \the\questionnumber\space to be #1} + \typeout{Forcing question \thequestionnumber\space to be #1} \def\@currentquestion{#1} \fi \fi \everypar{\setbox0=\lastbox % discard \box0 \FormatQuestionNumber \mark{\@currentquestion}% - \everypar{}} + \global\everypar{}} } \newcommand\FormatQuestionNumber {\hbox to 0pt{\hss \textbf{\@currentquestion}\hskip1em}} @@ -987,6 +1050,7 @@ images may not be used in examinations without prior arrangement. } } \newenvironment{questiondata}{% + \par \penalty50 % poor break \vbox\bgroup \slshape @@ -1002,7 +1066,7 @@ images may not be used in examinations without prior arrangement. \medskip \hrule width \textwidth \par - \egroup + \egroup % end of \vbox } \newcommand\questionpreamble[1]{\gdef\examn@questionpreamble{#1}} \let\examn@questionpreamble\@empty @@ -1080,6 +1144,11 @@ images may not be used in examinations without prior arrangement. \let\@includequestionoverridenumber\@empty \newif\if@insolution \@insolutionfalse +\newcounter{answerpartnumber} +\newcommand{\examn@solutionpart}{% + \par + \stepcounter{answerpartnumber} + \noindent\hbox to \parindent{(\StylePartNumber{answerpartnumber})\hss}} \def\@formatsolution{\par \if@insolution \ClassError{exam-n}{Misplaced solution}{You can't have a solution within a solution} @@ -1088,12 +1157,13 @@ images may not be used in examinations without prior arrangement. \fi \examn@dummycaptions % dummy captions within solutions \typeout{SHOWING SOLUTIONS} + \let\part\examn@solutionpart \vskip 1ex plus 2\bigskipamount % add stretchable space... \penalty-\@lowpenalty % ...and encouragement to break here \parskip 0.5\baselineskip \raggedright \color{solutiontext}%\slshape - \ifbigfont\else + \ifbigfont \else \small \fi \hrule @@ -1102,6 +1172,7 @@ images may not be used in examinations without prior arrangement. \vskip -\parskip % cancel out the following parskip \textbf{\highlighted{Solution:}}\hskip2em \ignorespaces + \parindent=2em } \def\end@formatsolution{% \par diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 9da2201c617..7050fd4448f 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -1562,6 +1562,7 @@ $standardtex = '(\.(.bx|4ht|cls|clo|cmap|code\.tex|def|fd|fontspec|ldf|sty)' 'etdipa', 'NULL', # doc says "copy all files" 'europasscv', '(icon|logo).*\.pdf|' . $standardtex, 'europecv', 'EuropeFlag|europasslogo|\.cls|\.def', + 'exam-n', '\.cls', # not .clo example file 'fancytooltips', 'fancytipmark\..*|' . $standardtex, 'figflow', '\.tex', 'fjodor', 'fjodor\.sty', # not srbook-mem.sty -- cgit v1.2.3