summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xsim/doc/xsim_manual.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/xsim/doc/xsim_manual.tex')
-rw-r--r--macros/latex/contrib/xsim/doc/xsim_manual.tex167
1 files changed, 86 insertions, 81 deletions
diff --git a/macros/latex/contrib/xsim/doc/xsim_manual.tex b/macros/latex/contrib/xsim/doc/xsim_manual.tex
index e3328631df..e301758b60 100644
--- a/macros/latex/contrib/xsim/doc/xsim_manual.tex
+++ b/macros/latex/contrib/xsim/doc/xsim_manual.tex
@@ -817,7 +817,7 @@ depending on different settings:
\end{itemize}
\begin{example}
- \begin{exercise}[print=false]
+ \begin{exercise}[print=false,ID=invisible]
This exercise will not be printed but the exercise counter will be
incremented nonetheless. Its solution will be printed in the list of
solutions.
@@ -912,15 +912,16 @@ the environments' names are the module names for the options (here using the
If you know type and \property{id} of an exercise you can (re-)insert every
existing exercise, \ie, every exercise whose external file exists.
\begin{commands}
- \command{printexercise}[\marg{type}\marg{id}]
- Inserts the exercise of type \meta{type} with the \property{id}
- \meta{id}.
- \command{xprintexercise}[\marg{type}\marg{id}]
- \sinceversion{0.16}The same as \cs{printexercise} but expands \meta{type}
- and \meta{id} before it uses them.
+ \command{printexercise}[\marg{type}\marg{csv of ids}]
+ \changedversion{0.17a}Inserts the exercise or exercises of type
+ \meta{type} with the \property{id}s or \property{ID}s given in \meta{csv
+ of ids}.
+ \command{xprintexercise}[\marg{type}\marg{csv of ids}]
+ \sincechanged{0.16}{0.17a}The same as \cs{printexercise} but expands
+ \meta{type} and the items of \meta{csv of ids} before it uses them.
\end{commands}
\begin{example}
- \printexercise{exercise}{5}
+ \printexercise{exercise}{invisible}
\end{example}
\section{Collecting Exercises}\label{sec:collecting-exercises}
@@ -1290,14 +1291,17 @@ yourself in order to achieve certain layouts\footnote{I plan to incorporate
information on style files\index{style file}).
\item[\code{margin}] A layout rather similar to the one by package
\pkg{exsheets}, see section~\ref{sec:margin-template}. Available through
- the style file \code{layouts} (see section~\vref{sec:style-files} for more
- information on style files\index{style file}).
- \item[\code{minimal}] A\sinceversion{0.13a} minimalistic layout, see
- section~\ref{sec:minimal-template}. Available through the style file
- \code{layouts} (see section~\vref{sec:style-files} for more information on
- style files\index{style file}).
+ the style file \code{layouts}.
+ \item[\code{minimal}] A\sinceversion{0.13} minimalistic layout, see
+ section~\ref{sec:minimal-template}. As the others inspired by an
+ \pkg{exsheets} layout. Available through the style file \code{layouts}.
+ \item[\code{inline}] A\sinceversion{0.18} minimalistic layout, the same as
+ \code{minimal} but doesn't add \cs*{par} at the beginning and end.
+ Available through the style file \code{layouts}.
+ \item[\code{centered}] A\sinceversion{0.18} layout with a centered heading.
+ Available through the style file \code{layouts}.
\end{description}
-
+
\collectexercises{layouts}
\begin{exercise}[subtitle=The Subtitle,points=2.5,ID=showlayout]
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
@@ -1544,11 +1548,11 @@ yourself in order to achieve certain layouts\footnote{I plan to incorporate
\item \code{\#6}: the \property{bonus-points} property of the exercise
\end{itemize}
\command{XSIMprint}[\Marg{exercise|solution}\marg{type}\marg{id}]
- \sinceversion{0.16}Inserts the either the exercise or the solution of type
- \meta{type} with the \property{id} \meta{id}.
+ \sincechanged{0.16}{0.17a}Inserts the either the exercise or the solution
+ of type \meta{type} with the \property{id} or \property{ID} \meta{id}.
\command{XSIMxprint}[\Marg{exercise|solution}\marg{type}\marg{id}]
- \sinceversion{0.16}The same as \cs{XSIMprint} but expands \meta{type} and
- \meta{id} before it uses them.
+ \sincechanged{0.16}{0.17a}The same as \cs{XSIMprint} but expands
+ \meta{type} and \meta{id} before it uses them.
\expandable\command{XSIMtranslate}[\marg{keyword}]
Delivers the translation of \meta{keyword} according to the current
document language (in the meaning of a \pkg{babel}~\cite{pkg:babel} or
@@ -1627,6 +1631,67 @@ The predefined templates are \enquote{\code{default}} and
\enquote{\code{default*}}, see sections~\vref{sec:table-templ-default}
and~\vref{sec:table-templ-default*}.
+\subsection{Create and Use \xsim\ Style Files}\label{sec:style-files}
+\index{style file|(}
+
+\xsim\changedversion{0.11} offers you the possibility to create own
+\emph{style files}. Let's say you want to have a style called
+\code{math-exam}. Then you need to save all necessary definitions in a file
+called:
+\begin{center}
+ \code{xsim.style.math-exam.code.tex}
+\end{center}
+The first command in the file should be \cs{xsimstyle}\Marg{math-exam}. This
+file can now be loaded into your document using
+\cs{loadxsimstyle}\Marg{math-exam} or by using
+\cs{xsimsetup}\Marg{load-style=math-exam}:
+\begin{sourcecode}
+ \documentclass[DIV=18,parskip=half]{scrartcl}
+ \usepackage[T1]{fontenc}
+ \usepackage[utf8]{inputenc}
+
+ \usepackage[clear-aux]{xsim}
+ \loadxsimstyle{math-exam}
+
+ \title{Math Exam \#3}
+ \date{2017-03-28}
+\end{sourcecode}
+
+In this style file stuff like template and property definitions should
+happen. This is more or less a convenient way to
+\begin{itemize}
+ \item keep the preamble \enquote{clean} and
+ \item define re-usable styles without the need of copying the document
+ preamble to another document.
+\end{itemize}
+A style file is like a package or class file, \ie, \code{@} has category
+code~11 (letter).
+
+The formal description of the commands:
+\begin{commands}
+ \command{xsimstyle}[\sarg\marg{style name}]
+ The\changedversion{0.11} first command in a \xsim\ style file called
+ \code{xsim.style.\meta{style name}.code.tex} which defines the \xsim\
+ style \meta{style name}. The starred version activates expl3
+ syntax\footnote{Those users who want this will know what it means. If you
+ don't know what it means you will not need it.}.
+ \command{loadxsimstyle}[\marg{csv list of style names}]
+ Load one or more styles into the document.
+\end{commands}
+\begin{options}
+ \keyval{load-style}{csv list of style names}
+ Another\sinceversion{0.14} interface for \cs{loadxsimstyle}\marg{csv list
+ of style names}.
+\end{options}
+
+\begin{bewareofthedog}
+ At the moment this mechanism offers no advantages over creating a custom
+ package or simply \cs*{input}ing a file. Future versions might provide
+ additional features.
+\end{bewareofthedog}
+
+\index{style file|)}
+
\subsection{Examples}\label{sec:template-examples}
The repository of this package\footnote{GitHub:
@@ -1793,6 +1858,7 @@ This shows the implementation of the \code{minimal} template:
\begin{sourcecode}
\DeclareExerciseEnvironmentTemplate{minimal}
{%
+ \par
\textbf{\GetExerciseProperty{counter}}%
\IfInsideSolutionF{%
\GetExercisePropertyT{points}{%
@@ -1803,7 +1869,7 @@ This shows the implementation of the \code{minimal} template:
}%
}%
}
- {}
+ {\par}
\end{sourcecode}
\subsubsection{The Headings Templates}\label{sec:headings-templates}
@@ -2184,67 +2250,6 @@ The usage is now as follows:
\end{exercise}
\end{example}
-\subsection{\dots Create and Use \xsim\ Style Files?}\label{sec:style-files}
-\index{style file|(}
-
-\xsim\changedversion{0.11} offers you the possibility to create own
-\emph{style files}. Let's say you want to have a style called
-\code{math-exam}. Then you need to save all necessary definitions in a file
-called:
-\begin{center}
- \code{xsim.style.math-exam.code.tex}
-\end{center}
-The first command in the file should be \cs{xsimstyle}\Marg{math-exam}. This
-file can now be loaded into your document using
-\cs{loadxsimstyle}\Marg{math-exam} or by using
-\cs{xsimsetup}\Marg{load-style=math-exam}:
-\begin{sourcecode}
- \documentclass[DIV=18,parskip=half]{scrartcl}
- \usepackage[T1]{fontenc}
- \usepackage[utf8]{inputenc}
-
- \usepackage[clear-aux]{xsim}
- \loadxsimstyle{math-exam}
-
- \title{Math Exam \#3}
- \date{2017-03-28}
-\end{sourcecode}
-
-In this style file stuff like template and property definitions should
-happen. This is more or less a convenient way to
-\begin{itemize}
- \item keep the preamble \enquote{clean} and
- \item define re-usable styles without the need of copying the document
- preamble to another document.
-\end{itemize}
-A style file is like a package or class file, \ie, \code{@} has category
-code~11 (letter).
-
-The formal description of the commands:
-\begin{commands}
- \command{xsimstyle}[\sarg\marg{style name}]
- The\changedversion{0.11} first command in a \xsim\ style file called
- \code{xsim.style.\meta{style name}.code.tex} which defines the \xsim\
- style \meta{style name}. The starred version activates expl3
- syntax\footnote{Those users who want this will know what it means. If you
- don't know what it means you will not need it.}.
- \command{loadxsimstyle}[\marg{csv list of style names}]
- Load one or more styles into the document.
-\end{commands}
-\begin{options}
- \keyval{load-style}{csv list of style names}
- Another\sinceversion{0.14} interface for \cs{loadxsimstyle}\marg{csv list
- of style names}.
-\end{options}
-
-\begin{bewareofthedog}
- At the moment this mechanism offers no advantages over creating a custom
- package or simply \cs*{input}ing a file. Future versions might provide
- additional features.
-\end{bewareofthedog}
-
-\index{style file|)}
-
\subsection{\dots Print All Solutions Grouped by Section?}
Here is an idea how to get a list of all solutions grouped by the section the
corresponding exercises are appearing in.