diff --git a/ouexam.dtx b/ouexam.dtx index d6bd02c..3cb2a82 100644 --- a/ouexam.dtx +++ b/ouexam.dtx @@ -1375,6 +1375,7 @@ % \changes{2.3.2}{2014/10/09}{NJS Fixed crashing bug with verbatim environments % appearing at the end of questions.} % \changes{2.4}{2013/05/31}{NJS Check question depth when opening the environment.} +% \changes{2.4}{2015/08/19}{NJS Changed how question marks are positioned.} % \begin{environment}{question} % The \textsf{question} environment specifies a top-level question, and produces % questions numbered in the form ``1.'', ``2.'', etc. It has one mandatory @@ -1424,10 +1425,10 @@ \setcounter{qrunning}{\value{qexpected}}% % \end{macrocode} % -% The total number of marks for the question is then printed right-justified on the line as ``(\emph{m} marks)'' where \emph{m} is the value of the |qrunning| counter. The environment determines whether to print ``mark'' or ``marks'' automatically, and figures out whether the number of marks will fit on the last line of the question or needs to be placed on the next line. The code for handling the line breaking is derived from an example on page 106 of \emph{The \TeX{}book}: +% The total number of marks for the question is then printed right-justified on the line as ``(\emph{m} marks)'' where \emph{m} is the value of the |qrunning| counter. The environment determines whether to print ``mark'' or ``marks'' automatically, and figures out whether the number of marks will fit on the last line of the question or needs to be placed on the next line. The code for handling the line breaking is derived from an example on page 106 of \emph{The \TeX{}book}, with the addition of a \cs{leavevmode} to prevents \cs{unskip} (which can't be used in vertical mode) from crashing when the marks immediately follow a |verbatim| type environment. This may cause slightly more vertical space after environments (e.g., lists) than is ideal, but not enough to be a major problem. % % \begin{macrocode} - \vskip-\lastskip\nobreak\hfil\penalty50\hskip2em\hbox{}\nobreak% + \leavevmode\unskip\nobreak\hfil\penalty50\hskip2em\hbox{}\nobreak% \hfil(\theqrunning~\ifnum\theqrunning=1 mark\else marks\fi)% \parfillskip=0pt \finalhyphendemerits=0 \par% % \end{macrocode} @@ -1472,8 +1473,8 @@ % of marks in output.} % \changes{2.3.2}{2014/10/09}{NJS Fixed crashing bug with verbatim environments % appearing at the end of subquestions.} -% \changes{2.4}{2013/05/31}{NJS Check question depth when opening the -% environment.} +% \changes{2.4}{2013/05/31}{NJS Check question depth when opening the environment.} +% \changes{2.4}{2015/08/19}{NJS Changed how question marks are positioned.} % The \textsf{subquestion} environment is the analogue of \textsf{question} for % sub-questions. On initialisation, it sets |subqexpected| to the value of the % mandatory argument (defaulting to zero if the argument is empty), increments @@ -1519,7 +1520,7 @@ % Then the number of marks for the sub-question are typeset in a similar manner % to the \textsf{question} environment: % \begin{macrocode} - \vskip-\lastskip\nobreak\hfil\penalty50\hskip2em\hbox{}\nobreak% + \leavevmode\unskip\nobreak\hfil\penalty50\hskip2em\hbox{}\nobreak% \hfil(\thesubqrunning~\ifnum\thesubqrunning=1 mark\else marks\fi)% \parfillskip=0pt \finalhyphendemerits=0 \par% % \end{macrocode} @@ -1553,8 +1554,8 @@ % of marks in output.} % \changes{2.3.2}{2014/10/09}{NJS Fixed crashing bug with verbatim environments % appearing at the end of subsubquestions.} -% \changes{2.4}{2013/05/31}{NJS Check question depth when opening the -% environment.} +% \changes{2.4}{2013/05/31}{NJS Check question depth when opening the environment.} +% \changes{2.4}{2015/08/19}{NJS Changed how question marks are positioned.} % This is similar to both \textsf{question} and \textsf{subquestion}, and % generates an appropriately numbered sub-sub-question (``(i)'', ``(ii)'', etc.). % \begin{macrocode} @@ -1593,7 +1594,7 @@ \addtocounter{qrunning}{\value{subsubqexpected}}% \addtocounter{subqrunning}{\value{subsubqexpected}}% \setcounter{lastexpected}{\value{subsubqexpected}}% - \vskip-\lastskip\nobreak\hfil\penalty50\hskip2em\hbox{}\nobreak% + \leavevmode\unskip\nobreak\hfil\penalty50\hskip2em\hbox{}\nobreak% \hfil(\thesubsubqexpected~\ifnum\thesubsubqexpected=1 mark% \else marks\fi)% \parfillskip=0pt \finalhyphendemerits=0 \par%