summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/exesheet/exesheet.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/exesheet/exesheet.dtx')
-rw-r--r--macros/latex/contrib/exesheet/exesheet.dtx140
1 files changed, 84 insertions, 56 deletions
diff --git a/macros/latex/contrib/exesheet/exesheet.dtx b/macros/latex/contrib/exesheet/exesheet.dtx
index c703f6434b..26ce619f4a 100644
--- a/macros/latex/contrib/exesheet/exesheet.dtx
+++ b/macros/latex/contrib/exesheet/exesheet.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2020 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+% Copyright (C) 2020-2021 by Antoine Missier <antoine.missier@ac-toulouse.fr>
% ----------------------------------------------------------------------
%
% This file may be distributed and/or modified under the
@@ -23,7 +23,7 @@
%<class>\ProvidesClass{exesheet}
%<package>\ProvidesPackage{exesheet}
%<*class|package>
- [2020/07/22 v1.0 .dtx exesheet file]
+ [2020/08/30 v1.1 .dtx exesheet file]
%</class|package>
%
%<*driver>
@@ -77,7 +77,7 @@
%\author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}}
\subject{Antoine Missier \\
\texttt{antoine.missier@ac-toulouse.fr}}
-\date{July 22, 2020, \fileversion}
+\date{August 30, 2021, \fileversion}
\hypersetup{%
colorlinks,
linkcolor=blue,
@@ -91,7 +91,7 @@
%</driver>
% \fi
%
-% \CheckSum{637}
+% \CheckSum{638}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -113,6 +113,8 @@
% \changes{v0.0}{2010/09/01}{Initial personal version}
% \changes{v0.9}{2020/01/02}{Initial documentation in french}
% \changes{v1.0}{2020/07/22}{Initial public version with documentation in english}
+% \changes{v1.1}{2021/08/30}{macro tablenum replaced by tablenum1, small modifications due
+% to changes in tasks package}
%
% \GetFileInfo{exesheet.dtx}
%
@@ -150,7 +152,8 @@
% we can do a correct version for all exercises together, or a correct version per exercise,
% per part (subpart of exercise), per question, per sub-question.
%
-% Finally the original fonctionality of this package is the display of a detailed marking scheme,
+% Finally the original fonctionality of this package is the display
+% of a detailed marking scheme,
% with optional explanations, in the margin of exercise answers.
%
% There are two possible options: \texttt{notoc} (see \ref{par:notoc})
@@ -177,22 +180,26 @@
% Try to use this first command now, it's easy.
%
% \bigskip
+% |\hrulefill| can be put in the optional argument to produce an horizontal rule.
+%
% To bring additional text closer to the exercise number,
% we can use the |\unskip| command
% which eliminates preceding space, see the following example, obtained with
-% |\exercise[\unskip : calculation]|:
-% \exercise[\unskip: calculation]
+% |\exercise[\unskip : calculation\ \hrulefill]|:
+% \exercise[\unskip: calculation \ \hrulefill]
% \psframe(-0.25,1.3)(12.75,-0.4)
% Calculate $1+1$.
%
% \bigskip
% \DescribeMacro{\exercisename}
-% The word \emph{\exercisename} has automatic translation in a few languages\footnote{Translation
+% The word \emph{\exercisename} has automatic translation
+% in a few languages\footnote{Translation
% is currently integrated into the package for the following languages: French,
% German, Spanish, Italian, Portuguese.}
% when the \textsf{babel} package is loaded.
% It can be redefined, with |\renewcommand|, which should be placed
-% after |\begin{document}|, or else we can use macros from the \textsf{babel} package (allowing dynamic language change), e.g.\\
+% after |\begin{document}|, or else we can use macros from the \textsf{babel}
+% package (allowing dynamic language change), e.g.\\
% |\addto\captionssweedish{\def\exercisename{\"Ovning}}| (in the preamble).
%
% \DescribeMacro{\labelexercise}
@@ -248,7 +255,6 @@
% uses |\subpartname| (with automatic translation in a few languages
% if \textsf{babel} is loaded),
% |\labelsubpart| and |\labelsubpartstyle|, which are editable.
-% \pagebreak
%
% \DescribeMacro{\subpart*}
% Like |\exercise*|, the starred version |\subpart*|\oarg{opt}\marg{label}
@@ -257,12 +263,13 @@
%
% \subsection{The \texttt{\bs annex} command}
% \DescribeMacro{\annex}
-% The |\annex|\oarg{opt} command typesets the title \textbf{ANNEX}, in uppercase letters, centred
+% The |\annex|\oarg{opt} command typesets the title \textbf{ANNEX},
+% in uppercase letters, centred
% and in the subsection style,
% with an optional parameter, added on the same line.
%
% \vspace{-\baselineskip}
-% \noindent\psframe(-0.25,-0.25)(12.75,-1.25)
+% \noindent\psframe(-0.25,-0.3)(12.75,-1.25)
% \annex[(to return)]
%
% \DescribeMacro{\annexname}
@@ -287,7 +294,8 @@
%
% \subsection{Short exercises: the \texttt{\bs exe} command}
% \DescribeMacro{\exe}
-% The |\exe| command starts an exercise by the abbreviation \textbf{\exname}.\ followed by the exercise number,
+% The |\exe| command starts an exercise by the abbreviation \textbf{\exname}.\
+% followed by the exercise number,
% without using sectioning commands, and the exercise body begins on the same
% line. An exercise starts a new paragraph without indentation.
%
@@ -311,7 +319,7 @@
% The starred version prints no separator as shown below:
%
% \vspace{-\baselineskip}
-% \noindent\psframe(-0.25,-0.35)(12.75,-1.2)
+% \noindent\psframe(-0.25,-0.35)(12.75,-1.1)
% \exe* Another short exercise without separator.
%
% \subsection{The \texttt{\bs points} command}
@@ -319,7 +327,8 @@
% The |\points|\marg{pts} command displays the number of points awarded to an exercise.
% It is intended to be entered in the optional argument of the
% |\exercise| command\footnote{This command which has to be used
-% in the optional argument of \texttt{\bs exercise}, as several others presented below, is incompatible with
+% in the optional argument of \texttt{\bs exercise}, as several others presented below,
+% is incompatible with
% the \textsf{memoir} class which redefines section commands.}.
% |\exercise[\points{5}]| yields:
% \exercise[\points{5}]
@@ -374,7 +383,8 @@
% \end{enumerate}
%
% \DescribeMacro{nosetlist}
-% We can avoid enumeration list modifications and restore the \LaTeX\ default settings by passing the option
+% We can avoid enumeration list modifications and restore the \LaTeX\
+% default settings by passing the option
% \texttt{nosetlist} to the \texttt{exesheet} class or package.
%
% \subsection{List of exercises : the \texttt{exenumerate} environment}
@@ -382,13 +392,14 @@
% When an exercise sheet is made of short independant exercises,
% it would be ill-advised to display the complete title \emph{\exercisename} for each.
% In addition to the |\exe| command, previously presented,
-% we provide an even lighter solution with the |exenumerate| environment, which is only an enumeration list in which
+% we provide an even lighter solution with the |exenumerate| environment,
+% which is only an enumeration list in which
% spaces between items are further increased compared with those of \texttt{enumerate}.
% Here is an example (the main list is an \texttt{exenumerate} environment but
% sublists are produced with regular \texttt{enumerate} environments):
%
% \vspace{-\baselineskip}
-% \noindent\psframe(-0.25,-0.3)(12.75,-7.05)
+% \noindent\psframe(-0.25,-0.3)(12.75,-6.75)
% \begin{exenumerate}
% \item Translate the following sentences in english:
% \begin{enumerate}
@@ -405,54 +416,56 @@
% \item Nulla ullamcorper vestibulum turpis.
% \end{enumerate}
% \end{exenumerate}
-% The environment takes an optional parameter, like \texttt{enumerate}, which enables, among others,
+% The environment takes an optional parameter, like \texttt{enumerate},
+% which enables, among others,
% to typeset alternative list labels, e.g.
% |\begin{exenumerate}[A.]|.
% There are many other options (see the \textsf{enumitem} package documentation).
%
-% \subsection{Items aligned by lines: \texttt{tablenum}}
-% \DescribeEnv{tablenum}
+% \subsection{Items aligned by lines}
+% \DescribeEnv{tablenum1}
% \DescribeEnv{tablenuma}
% \DescribeEnv{tablitem}
-% These three environments are used to typeset short questions (\texttt{tablenum}),
+% These three environments are used to typeset short questions (\texttt{tablenum1}),
% sub-questions (\texttt{tablenuma}) or \texttt{itemize} lists (\texttt{tablitem})
% on the same line. They have the same syntax:
-% |\begin{tablenum}|\oarg{opt}|(|\meta{cols}|)|.
+% |\begin{tablenum1}|\oarg{opt}|(|\meta{cols}|)|.
% The \meta{cols} parameter is the number of columns used by the environment. It must be
% \emph{in parentheses}. This parameter can be omitted, then its value is 2.
% As for classic lists, each item begins with the |\item| command.
%
% These three environments are defined by the
-% |\NewTasks| macro, from the \textsf{tasks} package by Clemens Niederberger.
+% |\NewTasksEnvironment| macro, from the \textsf{tasks} package by Clemens Niederberger.
% They take an optional argument \meta{opt}
% explained in the documentation of this package,
-% e.g.\ |counter-format=tsk[r])| gives a roman numbering
-% following by a closing parenthesis.
+% e.g.\ |label=1)| gives a roman numbering
+% following by a closing parenthesis (like in \texttt{enumitem}
+% or \texttt{enumerate} packages.
% There are also many possibilities to place items in an original way,
% for instance, the |\item*| command allows to
% specify the number of columns the item is supposed to span.
% In the following example,
% the five |\item| are placed in order between
-% |\begin{tablenum}(3)| and |\end{tablenum}|.
+% |\begin{tablenum1}(3)| and |\end{tablenum1}|.
% Notice that numbering is made line by line.
%
% \exercise
% \psframe(-0.25,1.3)(12.75,-2.7)
% Give the derivative of the following functions:
-% \begin{tablenum}(3)
+% \begin{tablenum1}(3)
% \item $\ds f(x) = \frac{1-x^2}{\mathrm{e}^x +\mathrm{e}^{-x}}$,
% \item $\ds g(x) = \ln \left( \frac{1-x}{1+x^2}\right)$,
% \item $\ds h(x) = \int_{0}^{1}\mathrm{e}^{xy}\, \mathrm{d}y$,
% \item $\ds k(x) = \sum_{i=1}^{\infty}\frac{1}{x^i}$,
% \item $\ds l(x) = \int_{\frac{1}{x}}^{x}\frac{1}{\ln t}\, \mathrm{d}t$.
-% \end{tablenum}
+% \end{tablenum1}
%
% For \texttt{tablenuma}, labels are
% letters (a, b, c, \ldots) surrounded
% by parentheses. This cannot be modified globally
-% (except by redefining the environment with |\RenewTasks|).
+% (except by redefining the environment with |\RenewTasksEnvironment|).
% If the \textsf{exesheet} package is called with option \texttt{nosetlist},
-% labels of \texttt{tablenum} and \texttt{tablenuma} environments
+% labels of \texttt{tablenum1} and \texttt{tablenuma} environments
% are displayed in normal font with indentation, as for
% \texttt{enumerate}.
%
@@ -502,7 +515,7 @@
% and a number of items which can be different from one column to the other.
% Moreover, an advantage of \texttt{colsenum} is that the choice of labels
% is automatic depending on the list level (and the language),
-% unlike \texttt{tablenum} or \texttt{tablenuma}.
+% unlike \texttt{tablenum1} or \texttt{tablenuma}.
%
% \DescribeEnv{colsitem}
% \DescribeEnv{colsitem*}
@@ -510,7 +523,8 @@
% produces items aligned by columns rather than by lines as for
% \texttt{tablitem}:
% |\begin{colsitem}|\oarg{opt}\marg{cols}. The optional parameter,
-% which is passed to the underlying \texttt{itemize} environment, allows to change the item label (bullet by default).
+% which is passed to the underlying \texttt{itemize} environment,
+% allows to change the item label (bullet by default).
% And, as for \texttt{colsenum*}, the \texttt{colsitem*} environment
% produces an alignment of columns from the bottom.
%
@@ -541,7 +555,8 @@
% the title \textbf{\correctionname} is displayed at the beginning
% of the \texttt{answers} environment.
% It is defined by the |\correctionname| macro (with translation in a few languages
-% and that we can change:\footnote{Except for English, if you want to change package keywords you have to do it \emph{after} \texttt{\bs begin\{document\}}
+% and that we can change:\footnote{Except for English, if you want to change package
+% keywords you have to do it \emph{after} \texttt{\bs begin\{document\}}
% because \textsf{babel} will modify these definitions at the end of the preamble.}
% for example we may prefer \emph{Solution}
% than \emph{\correctionname}).
@@ -672,16 +687,19 @@
% \DescribeMacro{\displaypts}
% The display of the marking scheme, as above, is internally controlled by the
% \texttt{marginpts} boolean.
-% The |\displaypts| command, which has to be placed in the preamble, defines \texttt{marginpts} to \texttt{true},
+% The |\displaypts| command, which has to be placed in the preamble,
+% defines \texttt{marginpts} to \texttt{true},
% places marginal notes to the left (and not to the right which
% is the default behavior of \LaTeX)
% and shifts the text body right to increase the left margin compared
% with the right one, with a ratio 3:2,
% as it is in the present document.
% This ratio is defined by the
-% |geometry| macro from the \textsf{geometry} package (by Hideo Umeki) and is valid for the whole document.
+% |geometry| macro from the \textsf{geometry} package (by Hideo Umeki)
+% and is valid for the whole document.
%
-% \subsection{The \texttt{\bs totalexe}, \texttt{\bs note} and \texttt{\bs totalpoints} commands}
+% \subsection{The \texttt{\bs totalexe}, \texttt{\bs note}
+% and \texttt{\bs totalpoints} commands}
% \label{totalpoints}
% \DescribeMacro{\totalexe}
% \DescribeMacro{\note}
@@ -701,14 +719,15 @@
% \psframe(-3.5,1.3)(12.75,-3.1)
% For each following question, say if the assertion is true or false.
% Justify the answer carefully.
-% \begin{tablenum}
+% \begin{tablenum1}
% \item $\ds \int_{0}^{\sqrt{3}}\frac{1}{x+\sqrt{3}} \,\mathrm{d}x = \ln 2$,
% \item $\ds \int_{2}^{\mathrm{e}} \frac{1}{x\ln x} \,\mathrm{d}x = -\ln 2$,
% \item* The function $F$ defined on $\mathbf{R}$ by
-% $F(x) = \ds \int_{0}^{x}\frac{1}{,t^2+t+1}\,\mathrm{d} t$, is increasing on $\mathbf{R}$.
-% \end{tablenum}
+% $F(x) = \ds \int_{0}^{x}\frac{1}{,t^2+t+1}\,\mathrm{d} t$ is increasing on $\mathbf{R}$.
+% \end{tablenum1}
% \end{questions}
%
+% \pagebreak
% \begin{answers}
% \vspace{-\baselineskip}
% \noindent\psframe(-4.7,0.9)(12.75,-10.25)
@@ -789,13 +808,15 @@
% to \texttt{true}, chooses the left margin for display marginal notes
% and sets the ratio between left and right margins to 3:2\footnote{So
% that the effect on the margin ratio is correct, the
-% \texttt{\bs displaypoints} macro must be placed after other commands that could alter the page geometry, for example the \texttt{\bs pagestyle}
+% \texttt{\bs displaypoints} macro must be placed after other commands
+% that could alter the page geometry, for example the \texttt{\bs pagestyle}
% of the \textsf{schooldocs} package.}.
% Points will then be displayed without the comments.
%
% \DescribeMacro{\displaynotes}
% The |\displaynotes|\oarg{align} macro, to be placed also in the preamble,
-% defines both booleans to \texttt{true} and allows then the complete display of points and comments.
+% defines both booleans to \texttt{true} and allows then the complete display
+% of points and comments.
% The ratio between left/right margins is then set to 5/1\footnote{The
% present document kept a ratio of 3/2 because
% the \textsf{ltxdoc} class, used here, leaves large enough margins
@@ -1093,7 +1114,9 @@
%
% When using \textsf{babel} with the \texttt{french} option\footnote{The \texttt{french} option
% of \textsf{babel} superseeds the \texttt{frenchb} option.},
-% \texttt{itemize} lists are modified with the same dash label for each list level. These modifications are cancelled here to restore default \LaTeX\ \texttt{itemize} lists (labels and spaces).
+% \texttt{itemize} lists are modified with the same dash label for each list level.
+% These modifications are cancelled here to restore default
+% \LaTeX\ \texttt{itemize} lists (labels and spaces).
% As for |\exetranslate|,
% we have create the |\standardfrenchlists| command who must be called into
% |AtBeginDocument| or not, depending on whether
@@ -1135,37 +1158,38 @@
% \end{macrocode}
% \end{macro}
-% \DescribeEnv{tablenum} \DescribeEnv{tablenuma}
+% \DescribeEnv{tablenum1} \DescribeEnv{tablenuma}
% The |\NewTasks| command comes from the \textsf{tasks} package.
-% It allows to define the environments \texttt{tablenum}, \texttt{tablenuma}
+% It allows to define the environments \texttt{tablenum1}, \texttt{tablenuma}
% and \texttt{tablitem}.
% The horizontal spaces are adjusted to get a good alignment with
% items of other \texttt{enumerate} (or \texttt{itemize}) environments.
%
% \begin{macrocode}
\ifthenelse{\boolean{nosetlist}}{
- \NewTasks[counter-format=tsk[1].,
+ \NewTasksEnvironment[label=1.,
column-sep=1em,
- after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum}[\item](2)
- \NewTasks[counter-format=(tsk[a]),
+ after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
+ \NewTasksEnvironment[label=(a),
column-sep=1em,label-align=right,
item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
}{% by default
- \NewTasks[counter-format=tsk[1].,label-format=\bfseries,
+ \NewTasksEnvironment[label=1.,label-format=\bfseries,
column-sep=1em,label-align=right,
item-indent=1.5em,label-width=1em,label-offset=0.5em,
- after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum}[\item](2)
- \NewTasks[counter-format=(tsk[a]),label-format=\bfseries,
+ after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
+ \NewTasksEnvironment[label=(a),label-format=\bfseries,
column-sep=1em,label-align=right,
item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
}
+\PackageWarning{exesheet}{Environment tablenum is deprecated and replaced by tablenum1}
% \end{macrocode}
% \DescribeEnv{tablitem}
% \begin{macrocode}
-\NewTasks[label=\labelitemi,
+\NewTasksEnvironment[label=\labelitemi,
label-align=right,
item-indent=2.3333em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablitem}[\item](2)
@@ -1239,9 +1263,11 @@
%
% \begin{environment}{questions}
% It is the |\comment| and |\endcomment| macros, provided by the \textsf{versions} package,
-% that allow the magic of conditional displays (we can also find them in the \textsf{verbatim} or \textsf{version} packages).
+% that allow the magic of conditional displays (we can also find them
+% in the \textsf{verbatim} or \textsf{version} packages).
% The noteworthy \textsf{codesection} package, allows to encapsulate
-% optional code between the macros |\BeginCodeSection|\marg{skip} and |\EndCodeSection|\marg{skip},
+% optional code between the macros |\BeginCodeSection|\marg{skip}
+% and |\EndCodeSection|\marg{skip},
% both in the text body and in the preamble,
% but these macros cannot be used inside an environment
% as we did here for |\comment| and |\endcomment|.
@@ -1351,7 +1377,8 @@
% The commands |\displaypts|, |\displaypoints| and |\displaynotes|
% change the ratio between left and right margins\footnote{So
% that the effect on the margin ratio is correct, these
-% macros must be called, in the preamble, after other commands that also could alter the page geometry.}.
+% macros must be called, in the preamble, after other commands
+% that also could alter the page geometry.}.
%
% \DescribeMacro{\pts} \DescribeMacro{\displaypts}
% \begin{macrocode}
@@ -1378,7 +1405,8 @@
%
% \begin{macro}{\totalexe}
% In the following macros using
-% |\marginpar|, percent symbols and |\ignorespaces| are necessary to avoid too much space in the text (or the margin)
+% |\marginpar|, percent symbols and |\ignorespaces| are necessary
+% to avoid too much space in the text (or the margin)
% where these macros are inserted.
% \begin{macrocode}
\newlength{\ptsboxlength}