summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-06-28 21:55:58 +0000
committerKarl Berry <karl@freefriends.org>2013-06-28 21:55:58 +0000
commit864a1bbab21506fbb07551883dfca2ad457f2514 (patch)
tree630558a1f9e533f65ab5339e6d6a9748bff2c5b0 /Master
parent35f4733179fc116420810062bf3bd6891f86b5d9 (diff)
exsheets (28jun13)
git-svn-id: svn://tug.org/texlive/trunk@31008 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/exsheets/README7
-rw-r--r--Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdfbin693353 -> 639328 bytes
-rw-r--r--Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex1769
-rw-r--r--Master/texmf-dist/doc/latex/exsheets/translations_en.pdfbin408785 -> 425157 bytes
-rw-r--r--Master/texmf-dist/doc/latex/exsheets/translations_en.tex99
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/exsheets.sty67
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/translations.sty208
7 files changed, 866 insertions, 1284 deletions
diff --git a/Master/texmf-dist/doc/latex/exsheets/README b/Master/texmf-dist/doc/latex/exsheets/README
index c0684082854..ccb7a57df5a 100644
--- a/Master/texmf-dist/doc/latex/exsheets/README
+++ b/Master/texmf-dist/doc/latex/exsheets/README
@@ -1,10 +1,9 @@
--------------------------------------------------------------------------
-EXSHEETS 2013/05/26
-
+EXSHEETS 2013/06/28
bundled packages:
-the EXSHEETS package v0.9f
+the EXSHEETS package v0.9h
Yet another package for the creation of exercise sheets
-the TRANSLATIONS package v0.9d
+the TRANSLATIONS package v0.10
a simple translator
the CNTFORMATS package v0.5
A different way to read counters.
diff --git a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf
index b70f61851f6..5805105ab7f 100644
--- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf
+++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex
index 7b61f2870aa..deb80de722d 100644
--- a/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex
+++ b/Master/texmf-dist/doc/latex/exsheets/exsheets_en.tex
@@ -86,7 +86,11 @@
\edef\cntfmtsversion{\@cntfmts@version}
\edef\tasksversion{v\@tasks@version}
\makeatother
-\usepackage{libertinehologopatch}
+
+% this messes with the solutions headings in the appendix:
+% \usepackage{libertinehologopatch}
+% => figure out why
+
\cnpkgusecolorscheme{friendly}
\usepackage[biblatex]{embrac}[2012/06/29]
@@ -215,7 +219,7 @@
}
@package{esami,
title = {esami},
- author = {Grazia Messi­neo and Sal­va­tore Vas­sallo},
+ author = {Grazia Messineo and Salvatore Vassallo},
date = {2013-03-08},
version = {1.0},
url = {http://mirror.ctan.org/macros/latex/contrib/esami/}
@@ -303,6 +307,9 @@
\NewPatternFormat{aa}{\alphalph}
\NewCounterPattern{testa}{ta}
+\usepackage{etoolbox}
+\robustify\code
+
% ----------------------------------------------------------------------------
% custom commands
\newcommand*\Default[1]{%
@@ -350,12 +357,13 @@
\TitlePicture{%
\parbox{.8\linewidth}{%
\ExSheets provides means to create exercises or questions and their
- corresponding solutions. The questions can be divided into classes and can
- be printed selectively. Meta-data to questions can be added and recovered.
+ corresponding solutions. The questions can be divided into classes and
+ can be printed selectively. Meta-data to questions can be added and
+ recovered.
\par
- The solutions may be printed where they are, can be collected and printed at
- a later point in the document alltogether or section-wise or selectively by
- \acs{id}.\par
+ The solutions may be printed where they are, can be collected and printed
+ at a later point in the document alltogether or section-wise or
+ selectively by \acs{id}.\par
\ExSheets provides a comprehensive interface for styling the headings of
questions and solutions.}}
@@ -365,127 +373,135 @@
\section{Licence and Requirements}
\secidx[Licence]{Preliminary}\secidx[Requirements]{Preliminary}
\ExSheets is placed under the terms of the \LaTeX{} Project Public License,
-version 1.3 or later (\url{http://www.latex-project.org/lppl.txt}).
-It has the status ``maintained.''
+version 1.3 or later (\url{http://www.latex-project.org/lppl.txt}). It has
+the status ``maintained.''
\ExSheets loads and needs the following packages: \paket*{l3kernel},
\paket{xparse}, \paket{xtemplate}, \paket{l3sort}, \paket{l3keys2e},
\paket{xcolor}, \paket{ulem}, \paket{etoolbox}, \paket{environ}, and
-\paket{pgfcore}. \ExSheets calls \cmd{normalem} (from the \paket{ulem} package).
+\paket{pgfcore}. \ExSheets calls \cmd{normalem} (from the \paket{ulem}
+package).
\section{Motivation}\secidx[Motivation]{Preliminary}
-There are already quite a number of packages that allow the creation of exercise
-sheets or written exams. Just to name the most common ones:
+There are already quite a number of packages that allow the creation of
+exercise sheets or written exams. Just to name the most common ones:
\paket*{eqexam}~\cite{eqexam}, \paket*{exam}~\cite{exam},
\paket*{examdesign}~\cite{examdesign}, \paket*{exercise}~\cite{exercise},
\paket*{probsoln}~\cite{probsoln}, \paket*{answers}~\cite{answers},
-\paket*{esami}~\cite{esami}, \paket*{exsol}~\cite{exsol} (and many more%
-\footnote{see \url{http://www.ctan.org/characterization/primary/document-types/exams-exercise-sets-and-answers/}}).
-
-One thing I missed in all packages that I've tried out\footnote{Well, probably I
-didn't try hard enough\ldots} was a high flexibility in choosing which questions
-and solutions should be printed, where which solutions should be printed and so
-on, combined with the possibility to assign questions to different classes so one
-could for example create two versions of an exam out of the box. And --~I can't
-get enough~-- I also want to be able to use/design different layouts for questions
-additional to a standard section-like format. All these points are realized in
-\ExSheets.
+\paket*{esami}~\cite{esami}, \paket*{exsol}~\cite{exsol} (and many
+more\footnote{see
+ \url{http://www.ctan.org/characterization/primary/document-types/exams-exercise-sets-and-answers/}}).
+
+One thing I missed in all packages that I've tried out\footnote{Well, probably
+ I didn't try hard enough\ldots} was a high flexibility in choosing which
+questions and solutions should be printed, where which solutions should be
+printed and so on, combined with the possibility to assign questions to
+different classes so one could for example create two versions of an exam out
+of the box. And --~I can't get enough~-- I also want to be able to use/design
+different layouts for questions additional to a standard section-like format.
+All these points are realized in \ExSheets.
Additionally one should be able to assign some sort of meta-data to questions
-that of course should be easily reusable. How this can be done is explained
+that of course should be easily reusable. How this can be done is explained
in section~\ref{sec:additional_info}.
Then there is --~at least in Germany~-- the habit of having lists of exercises
aligned in columns but counting from the left to the right instead from up to
-down. \ExSheets provides a possibility for that (see part~\ref{part:tasks}).
-I am not quite content with it as it works now, though\footnote{There are still
-other possibilities, for example take a look here:
-\url{http://tex.stackexchange.com/questions/67966/enumerate-in-multicols} or at
-the \paket*{multienum} package~\cite{multienum}.}.
+down. \ExSheets provides a possibility for that (see part~\ref{part:tasks}).
+I am not quite content with it as it works now, though\footnote{There are
+ still other possibilities, for example take a look here:
+ \url{http://tex.stackexchange.com/questions/67966/enumerate-in-multicols} or
+ at the \paket*{multienum} package~\cite{multienum}.}.
On the other hand \ExSheets doesn't --~and probably won't~-- offer a real
-possibility for creating multiple choice questions. As a fact it doesn't provide
-many (if any) means to specify the \emph{type} of question or the structure. If
-these are your needs take a look at \paket{examdesign}~\cite{examdesign}, for
-example. Or exploit the possibilities \paket{enumitem}~\cite{enumitem} gives you.
-
-I had the idea for this package in 2008. Back then my \TeX{} skills were by far
-not good enough to write it. Actually, even today I wouldn't have been able to
-realize it without all the l3 packages like \paket*{l3kernel} and \paket*{l3packages}.
-I actively began to develop \ExSheets in spring~2011 but it wasn't until now
-(September~2012) that I consider it stable enough for wider usage. At the time
-of writing (\today) there still are probably lots of rough edges let alone bugs
-so I am very interested in all kinds of feedback.
+possibility for creating multiple choice questions. As a fact it doesn't
+provide many (if any) means to specify the \emph{type} of question or the
+structure. If these are your needs take a look at
+\paket{examdesign}~\cite{examdesign}, for example. Or exploit the
+possibilities \paket{enumitem}~\cite{enumitem} gives you.
+
+I had the idea for this package in 2008. Back then my \TeX{} skills were by
+far not good enough to write it. Actually, even today I wouldn't have been
+able to realize it without all the l3 packages like \paket*{l3kernel} and
+\paket*{l3packages}. I actively began to develop \ExSheets in spring~2011 but
+it wasn't until now (September~2012) that I consider it stable enough for
+wider usage. At the time of writing (\today) there still are probably lots of
+rough edges let alone bugs so I am very interested in all kinds of feedback.
\section{Additional Packages}
\ExSheets actually bundles four packages: \ExSheets, \Tasks, \translations and
-\cntformats. \Tasks is described in part~\ref{part:tasks}, \translations is
-described in part~\ref{part:translations} and \cntformats in part~\ref{part:cntformats}.
-These packages provide functionality that is used by \ExSheets. They can, however,
-be used independently from \ExSheets.
+\cntformats. \Tasks is described in part~\ref{part:tasks}, \translations is
+described in part~\ref{part:translations} and \cntformats in
+part~\ref{part:cntformats}. These packages provide functionality that is used
+by \ExSheets. They can, however, be used independently from \ExSheets.
The packages \translations and \cntformats both aren't really useful on a
user-level but maybe for package writers.
-\section{Installation}\secidx[Installation]{Preliminary}
+\section{Installation and Documentation}\secidx[Installation]{Preliminary}
If you install \ExSheets manually beware to put the files
\begin{itemize}
- \item[]\verb+exsheets_headings.def+
- \item[]\verb+exsheets_headings.cfg+
+ \item[]\verb+exsheets_headings.def+
+ \item[]\verb+exsheets_headings.cfg+
\end{itemize}
-in the same directory as the \code{exsheets.sty} file\footnote{That is, a directory
-like \code{texmf-local/tex/latex/exsheets}, probably}. You \emph{can} install the
-other packages, \Tasks, \translations and \cntformats, in different locations but
-since they belong to \ExSheets they probably should be placed in the same directory.
+in the same directory as the \code{exsheets.sty} file\footnote{That is, a
+ directory like \code{texmf-local/tex/latex/exsheets}, probably}. You
+\emph{can} install the other packages, \Tasks, \translations and \cntformats,
+in different locations but since they belong to \ExSheets they probably should
+be placed in the same directory.
-You should put the file \code{tasks.cfg} in the same directory as the \code{tasks.sty}
-file.
+You should put the file \code{tasks.cfg} in the same directory as the
+\code{tasks.sty} file.
-As with every manual package installation you need to make sure to put the files
-in a directory where \TeX\ can find them and afterwards update the database.
+As with every manual package installation you need to make sure to put the
+files in a directory where \TeX\ can find them and afterwards update the
+database.
\section{News}
-With version~0.7 there has been a potentially breaking change: the \code{tasks}
-environment previously provided by \ExSheets has been extracted into a package
-of its own. This does not change any syntax \emph{per se}. However, if you used
-custom settings then you'll probably run into some problems. The options for the
-environment are no longer set with \cmd{SetupExSheets} but with \cmd{settasks}.
-Also the object that is used for the list template and its instances has been
-renamed from \code{exsheets-tasks} into \code{tasks}.
+With version~0.7 there has been a potentially breaking change: the
+\code{tasks} environment previously provided by \ExSheets has been extracted
+into a package of its own. This does not change any syntax \emph{per
+ se}. However, if you used custom settings then you'll probably run into some
+problems. The options for the environment are no longer set with
+\cmd{SetupExSheets} but with \cmd{settasks}. Also the object that is used for
+the list template and its instances has been renamed from
+\code{exsheets-tasks} into \code{tasks}.
What's probably even more of a breaking change is a syntax difference of the
\code{tasks} environment: the optional argument for the number of columns is
-\emph{no longer set in braces but parentheses}. This is deliberate as it
+\emph{no longer set in braces but parentheses}. This is deliberate as it
reflects the optional nature of the argument better and is consistent with the
syntax of \cmd{NewTasks}, too.
-Additionally the labels of the list got an additional offset of \code{1ex} from
-the items which will lead to slightly different output. In some cases this might
-actually lead to the most annoying changes. In this case say
+Additionally the labels of the list got an additional offset of \code{1ex}
+from the items which will lead to slightly different output. In some cases
+this might actually lead to the most annoying changes. In this case say
\cmd{settasks}{label-offset=0pt} which should cure things again.
-I am very sorry for any inconvenience! I am trying to keep such changes as minimal
-and rare as possibly. However, it is not always avoidable when a package is new
-and still a child. It will grow up eventually.
+I am very sorry for any inconvenience! I am trying to keep such changes as
+minimal and rare as possibly. However, it is not always avoidable when a
+package is new and still a child. It will grow up eventually.
\ExSheets' other packages -- \href{tasks_en.pdf}{\Tasks},
-\href{translations_en.pdf}{\translations} and \href{cntformats_en.pdf}{\cntformats}
--- have gotten their own documentation which are essentially extracted from this
-very document you're reading now. They still will be documented in the main
-documentation (this document), though. Right now (April~25th~2013) the separate
-documentations do not contain much more information than is written here but they
-might, in time, get more details about the corresponding package.
+\href{translations_en.pdf}{\translations} and
+\href{cntformats_en.pdf}{\cntformats} -- have gotten their own documentation
+which are essentially extracted from this very document you're reading now.
+They still will be documented in the main documentation (this document),
+though. Right now (April~25th~2013) the separate documentations do not
+contain much more information than is written here but they might, in time,
+get more details about the corresponding package.
\section{Thanks}
-I need to thank the many users who gave me feedback so far! For one thing this
-shows me that \ExSheets is useful to people. It also led to many improvements
-like new features and countless bug fixes.
+I need to thank the many users who gave me feedback so far! For one thing
+this shows me that \ExSheets is useful to people. It also led to many
+improvements like new features and countless bug fixes.
\secidx*{Preliminary}
\part{The \ExSheets package}\label{part:exsheets}\secidx{\ExSheets}[ExSheets]
\section{Setup}\secidx{Setup}
-The \ExSheets package has three different types of options, kind of. The first
-type are the classic package options which are used when you load \ExSheets:
+The \ExSheets package has three different types of options, kind of. The
+first type are the classic package options which are used when you load
+\ExSheets:
\begin{beispiel}[code only]
\usepackage[<options>]{exsheets}
\end{beispiel}
@@ -502,115 +518,123 @@ or can be set with the setup command:
\begin{beschreibung}
\Befehl{SetupExSheets}[<module>]{<options>}
\end{beschreibung}
-The options of the second type all belong to \textcolor{module}{\code{modules}}.
-Let's say you want to specify some options of the \code{question} environment.
-You can then say the following:
+The options of the second type all belong to
+\textcolor{module}{\code{modules}}. Let's say you want to specify some
+options of the \code{question} environment. You can then say the following:
\begin{beispiel}[code only]
\SetupExSheets[question]{option1,option2=value2}
% or:
\SetupExSheets{question/option1,question/option2=value2}
\end{beispiel}
-The \textcolor{module}{\code{module}} an option belongs to is written in the left
-margin next to the when the option is described.
+The \textcolor{module}{\code{module}} an option belongs to is written in the
+left margin next to the when the option is described.
-The third type aren't options at all, actually. However, thanks to the great
+The third type aren't options at all, actually. However, thanks to the great
\paket{xtemplate} package you are able to define your own instances of some of
-the objects used by \ExSheets. This is explained in a little more detail in
-part~\ref{part:style} on page~\pageref{part:style}\,ff.
+the objects used by \ExSheets. This is explained in a little more detail in
+part~\ref{part:style} on page~\pageref{part:style}\,ff. This third type,
+however, brings in a possible instability: the \paket{xtemplate} package is in
+an experimental and developping state. This means that the sytax of the
+package may and possibly will change sometime in the future. I cannot foresee
+what any consequences of that will be for \ExSheets.
\secidx*{Setup}
\section{Package Options}\label{sec:options}\secidx{Package Options}
The package \ExSheets has some options, namely the following ones:
\begin{beschreibung}
- %% color
- \Option{color}{<colour>}\Default{exsheetsblue}
- A custom colour that is used in certain but very rare circumstances.
- %% counter-format
- \Option{counter-format}{<counter-format>}\Default{qu.}
- Formatting of the counter of the questions. This option takes a special kind
- of string that is described in section~\ref{ssec:counter}.
- \Option{counter-within}{<counter>}\Default{}
- Resets the \code{question} counter with every step of \code{<counter>}.
- %% auto-label
- \Option{auto-label}{\default{true}|false}\Default{false}
- If set to true \ExSheets will automatically place a \cmd*{label}{qu:<id>}
- for each question. It will also create the question properties \code{ref}
- and \code{pageref}, see section~\ref{sec:additional_info} for more on this.
- %% headings
- \Option{headings}{<instance>}\Default{block}
- Choose the style of the questions' and solutions' headings. There are two
- predefined styles: \code{block} and \code{runin}.
- %% headings-format
- \Option{headings-format}{<code>}\Default{\cmd{normalsize}\cmd{bfseries}}
- This code is placed immediately before the headings of the questions and
- solutions.
- %% load-headings
- \Option{load-headings}{\default{true}|false}\Default{false}
- Loads additional styles for the headings. More on this is described in
- section~\ref{sec:exsheets-headings}.
- %% load-tasks
- \Option{load-tasks}{\default{true}|false}\Default{false}
- Loads additional styles for the \code{tasks} environment. See part~\ref{part:tasks}.
- %% totoc
- \Option{totoc}{\default{true}|false}\Default{false}
- This option adds the questions and solutions with their names and numbers to
- the table of contents.
- %% questions-totoc
- \Option{questions-totoc}{\default{true}|false}\Default{false}
- This option adds the questions with their names and numbers to the table of
- contents.
- %% solutions-totoc
- \Option{solutions-totoc}{\default{true}|false}\Default{false}
- This option adds the solutions with their names and numbers to the table of
- contents.
- %% toc-level
- \Option{toc-level}{<toc level>}\Default{subsection}
- This option sets the level in which questions and solutions should appear in
- the table of contents.
- %% questions-toc-level
- \Option{questions-toc-level}{<toc level>}\Default{subsection}
- This option sets the level in which questions should appear in the table of
- contents.
- %% solutions-toc-level
- \Option{solutions-toc-level}{<toc level>}\Default{subsection}
- This option sets the level in which solutions should appear in the table of
- contents.
- %% use-ref
- \Option{use-ref}{\default{true}|false}\Default{false}
- enable referencing to sections and chapters in a way that the references can
- be used with \cmd{printsolutions}, see section~\ref{sssec:print_specific_section}
- for details.
+ %% color
+ \Option{color}{<colour>}\Default{exsheetsblue}
+ A custom colour that is used in certain but very rare circumstances.
+ %% counter-format
+ \Option{counter-format}{<counter-format>}\Default{qu.}
+ Formatting of the counter of the questions. This option takes a special
+ kind of string that is described in section~\ref{ssec:counter}.
+ \Option{counter-within}{<counter>}\Default{}
+ Resets the \code{question} counter with every step of \code{<counter>}.
+ %% auto-label
+ \Option{auto-label}{\default{true}|false}\Default{false}
+ If set to true \ExSheets will automatically place a \cmd*{label}{qu:<id>}
+ for each question. It will also create the question properties \code{ref}
+ and \code{pageref}, see section~\ref{sec:additional_info} for more on
+ this.
+ %% headings
+ \Option{headings}{<instance>}\Default{block}
+ Choose the style of the questions' and solutions' headings. There are two
+ predefined styles: \code{block} and \code{runin}.
+ %% headings-format
+ \Option{headings-format}{<code>}\Default{\cmd{normalsize}\cmd{bfseries}}
+ This code is placed immediately before the headings of the questions and
+ solutions.
+ %% load-headings
+ \Option{load-headings}{\default{true}|false}\Default{false}
+ Loads additional styles for the headings. More on this is described in
+ section~\ref{sec:exsheets-headings}.
+ %% load-tasks
+ \Option{load-tasks}{\default{true}|false}\Default{false}
+ Loads additional styles for the \code{tasks} environment. See
+ part~\ref{part:tasks}.
+ %% totoc
+ \Option{totoc}{\default{true}|false}\Default{false}
+ This option adds the questions and solutions with their names and numbers
+ to the table of contents.
+ %% questions-totoc
+ \Option{questions-totoc}{\default{true}|false}\Default{false}
+ This option adds the questions with their names and numbers to the table
+ of contents.
+ %% solutions-totoc
+ \Option{solutions-totoc}{\default{true}|false}\Default{false}
+ This option adds the solutions with their names and numbers to the table
+ of contents.
+ %% toc-level
+ \Option{toc-level}{<toc level>}\Default{subsection}
+ This option sets the level in which questions and solutions should appear
+ in the table of contents.
+ %% questions-toc-level
+ \Option{questions-toc-level}{<toc level>}\Default{subsection}
+ This option sets the level in which questions should appear in the table
+ of contents.
+ %% solutions-toc-level
+ \Option{solutions-toc-level}{<toc level>}\Default{subsection}
+ This option sets the level in which solutions should appear in the table
+ of contents.
+ %% use-ref
+ \Option{use-ref}{\default{true}|false}\Default{false}
+ enable referencing to sections and chapters in a way that the references
+ can be used with \cmd{printsolutions}, see
+ section~\ref{sssec:print_specific_section} for details.
\end{beschreibung}
-The \code{toc} options are demonstrated with section~\ref{sec:solutions:list} and
-the solutions printed there being listed in the table of contents.
+The \code{toc} options are demonstrated with section~\ref{sec:solutions:list}
+and the solutions printed there being listed in the table of contents.
+
\secidx*{Package Options}
\section{Create Questions/Exercises and their Solutions}
-Now, let's start with the most important part: the questions and (possibly) their
-respective solutions.
+Now, let's start with the most important part: the questions and (possibly)
+their respective solutions.
\subsection{The \code{question} Environment}\label{ssec:questions}
Questions are written inside the \code{question} environment:
\begin{beschreibung}
- \Umg{question}[<options>]{\unskip\ma{<points>} ... }
+ \Umg{question}[<options>]{\unskip\ma{<points>} ... }
\end{beschreibung}
\begin{beispiel}
\begin{question}
This is our very first very difficult to solve question!
\end{question}
\end{beispiel}
-As you can see a heading is automatically created and the question is numbered.
-You can of course change both the numbering and the naming, but more on that later.
+As you can see a heading is automatically created and the question is
+numbered. You can of course change both the numbering and the naming, but
+more on that later.
-The \code{question} environment takes an optional argument \ma{<points>} that can
-be used to assign points to the question (as is common in written exams):
+The \code{question} environment takes an optional argument \ma{<points>} that
+can be used to assign points to the question (as is common in written exams):
\begin{beispiel}
\begin{question}{3}
This is our first difficult question that is worth 3 points!
\end{question}
\end{beispiel}
-These points are saved internally (see section~\ref{sec:points} for reasons why)
-and are written to the right margin next to the question heading in the default
-setting.
+These points are saved internally (see section~\ref{sec:points} for reasons
+why) and are written to the right margin next to the question heading in the
+default setting.
You can also assign bonus points by inserting \code{<point>+<bonus points>} as
argument.
@@ -625,39 +649,41 @@ argument.
\sinceversion{0.3}On additional thing: you might want to define custom
commands that should behave differently if they're inside or outside of the
-\code{question} environment. In this case you can use these commands:
+\code{question} environment. In this case you can use these commands:
\begin{beschreibung}
- \expandable\Befehl{IfInsideQuestionTF}{<true code>}\ma{<false code>}
- \expandable\Befehl{IfInsideQuestionT}{<true code>}
- \expandable\Befehl{IfInsideQuestionF}{<false code>}
+ \expandable\Befehl{IfInsideQuestionTF}{<true code>}\ma{<false code>}
+ \expandable\Befehl{IfInsideQuestionT}{<true code>}
+ \expandable\Befehl{IfInsideQuestionF}{<false code>}
\end{beschreibung}
\subsection{Options to the \code{question} Environment}\secidx[options]{questions}
The \code{question} environment takes one or more of the following options:
\begin{beschreibung}
- \Option[question]{type}{exam|exercise}\Default{exercise}
- determines the type of question and changes the default name of a question
- from ``Exercise'' to ``Question''. These default names are language dependent.\\
- If you use \cmd*{usepackage}[ngerman]{babel}, for example, then the names
- are ``\"Ubung and ``Aufgabe''.
- \Option[question]{name}{<name>}\Default{}
- sets a custom name. All predefined names are discarded.
- \Option[question]{print}{\default{true}|false}\Default{true}
- prints or hides the question.
- \Option[question]{ID}{<id>}\Default{}
- assigns a custom \acs{id} to the question. See section~\ref{ssec:ids} for further
- information.
- \Option[question]{label}{<label>}\Default{}
- Places a \cmd*{label}{<label>} for the question. This will overwrite any label
- that is placed by the \key{auto-label} option.
- \Option[question]{class}{<class>}\Default{}
- assigns a class to the question. See section~\ref{sec:classes} for further
- information.
- \Option[question]{topic}{<topic>}\Default{}
- assigns a topic to the question. See section~\ref{sec:topics} for further
- information.
- \Option[question]{use}{\default{true}|false}\Default{true}
- discards the question. Or not.
+ \Option[question]{type}{exam|exercise}\Default{exercise}
+ determines the type of question and changes the default name of a question
+ from ``Exercise'' to ``Question''. These default names are language
+ dependent.
+
+ If you use \cmd*{usepackage}[ngerman]{babel}, for example, then the names
+ are ``\"Ubung and ``Aufgabe''.
+ \Option[question]{name}{<name>}\Default{}
+ sets a custom name. All predefined names are discarded.
+ \Option[question]{print}{\default{true}|false}\Default{true}
+ prints or hides the question.
+ \Option[question]{ID}{<id>}\Default{}
+ assigns a custom \acs{id} to the question. See section~\ref{ssec:ids} for
+ further information.
+ \Option[question]{label}{<label>}\Default{}
+ Places a \cmd*{label}{<label>} for the question. This will overwrite any
+ label that is placed by the \key{auto-label} option.
+ \Option[question]{class}{<class>}\Default{}
+ assigns a class to the question. See section~\ref{sec:classes} for
+ further information.
+ \Option[question]{topic}{<topic>}\Default{}
+ assigns a topic to the question. See section~\ref{sec:topics} for further
+ information.
+ \Option[question]{use}{\default{true}|false}\Default{true}
+ discards the question. Or not.
\end{beschreibung}
\begin{beispiel}
\begin{question}[type=exam]
@@ -673,19 +699,21 @@ The \code{question} environment takes one or more of the following options:
\end{beispiel}
The difference between \key{print} and \key{use} lies behind the scenes: with
-\key{print}{false} the question is not printed, but it still gets an individual
-\ac{id}, is numbered, and a possible solution is saved. This is for example useful
-when you want to print a sample solution for an exam. With \key{use}{false} it
-is fully discarded which means it is not accessible through an \acs{id} and a
-possible solution will not be saved.
+\key{print}{false} the question is not printed, but it still gets an
+individual \ac{id}, is numbered, and a possible solution is saved. This is
+for example useful when you want to print a sample solution for an exam. With
+\key{use}{false} it is fully discarded which means it is not accessible
+through an \acs{id} and a possible solution will not be saved.
+
\secidx*{questions}
\subsection{The \code{solution} Environment}\secidx{solutions}
-If you want to save/print (more on the exact usage in section~\ref{sec:solutions})
-a solution you have to use the \code{solution} environment \emph{after} the
-question it belongs to and \emph{before} the next question.
+If you want to save/print (more on the exact usage in
+section~\ref{sec:solutions}) a solution you have to use the \code{solution}
+environment \emph{after} the question it belongs to and \emph{before} the next
+question.
\begin{beschreibung}
- \Umg{solution}[<options>]{...}
+ \Umg{solution}[<options>]{...}
\end{beschreibung}
\begin{beispiel}
\begin{question}[ID=first]\label{qu:question_with_solution}
@@ -695,17 +723,17 @@ question it belongs to and \emph{before} the next question.
This is the solution to exercise~\ref{qu:question_with_solution}!
\end{solution}
\end{beispiel}
-You can see that in the default settings the solution is \emph{not} written to the
-document. It has been saved, though, for possible later usage. We will see the
-solution later!
+You can see that in the default settings the solution is \emph{not} written to
+the document. It has been saved, though, for possible later usage. We will
+see the solution later!
\subsection{Options to the \code{solution} Environment}\secidx[options]{solutions}
The \code{solutions} environment also has options, namely these:
\begin{beschreibung}
- \Option[solution]{name}{<name>}\Default{}
- sets a custom name.
- \Option[solution]{print}{\default{true}|false}\Default{false}
- prints or hides the solution.
+ \Option[solution]{name}{<name>}\Default{}
+ sets a custom name.
+ \Option[solution]{print}{\default{true}|false}\Default{false}
+ prints or hides the solution.
\end{beschreibung}
Their meaning is the same as those for the \code{question} environment.
\begin{beispiel}
@@ -729,26 +757,27 @@ Their meaning is the same as those for the \code{question} environment.
\secidx*{solutions}
\subsection{Setting the Counter}\label{ssec:counter}\secidx{Setting the Counter}
-The package option \key{counter-format} allows you to specify how
-the question counter is formatted.
+The package option \key{counter-format} allows you to specify how the question
+counter is formatted.
The input is an arbitrary string which means you can have anything as counter
-number. However, the letter combinations \code{ch}, \code{se}, \code{qu} and
+number. However, the letter combinations \code{ch}, \code{se}, \code{qu} and
\code{tsk} are replaced with the counters for the chapter, section, question
-or tasks (see part~\ref{part:tasks}), respectively. While the last one is not
-really useful in this case the others allow for a combined numbering. Each of
-these letter combinations can have an optional argument that specifies the format
-of the respective counter. \code{1}: \cmd{arabic}, \code{a}: \cmd{alph}, \code{A}:
-\cmd{Alph}, \code{r}: \cmd{roman} and \code{R}: \cmd{Roman}.
+or tasks (see part~\ref{part:tasks}), respectively. While the last one is not
+really useful in this case the others allow for a combined numbering. Each of
+these letter combinations can have an optional argument that specifies the
+format of the respective counter. \code{1}: \cmd{arabic}, \code{a}:
+\cmd{alph}, \code{A}: \cmd{Alph}, \code{r}: \cmd{roman} and \code{R}:
+\cmd{Roman}.
\begin{beispiel}
\SetupExSheets{counter-format=Nr~se~(qu[a])}
\begin{question}
A question with a differently formatted number.
\end{question}
\end{beispiel}
-Since the strings associated with the counters are replaced one has to hide them
-if they are actually wanted in the counter format. The easiest way would to
-hide them in braces.
+Since the strings associated with the counters are replaced one has to hide
+them if they are actually wanted in the counter format. The easiest way would
+to hide them in braces.
\begin{beispiel}
\SetupExSheets{counter-format={section}\,se~{question}\,(qu[a])}
\begin{question}
@@ -758,11 +787,11 @@ hide them in braces.
\secidx*{Setting the Counter}
\subsection{Language Settings}\secidx{Language Settings}
-The names of the questions and solutions are language dependent. If you use
+The names of the questions and solutions are language dependent. If you use
\paket{babel} or \paket{polyglossia} \ExSheets will adapt to the document
-language. Exsheets has a number of translations but surely not all! If you miss
-a language please drop me a line in an email%
-\footnote{\href{mailto:contact@mychemistry.eu}{contact@mychemistry.eu}}
+language. \ExSheets has a number of translations but surely not all! If you
+miss a language please drop me a line in an
+email\footnote{\href{mailto:contact@mychemistry.eu}{contact@mychemistry.eu}}
containing the \paket{babel} language name and the correct translations for
questions (possibly distinguishing between exercises and exam questions) and
solutions.
@@ -778,55 +807,59 @@ for Danish) and try if it works:
{Opl\o{}sning}
\end{beispiel}
If this isn't working it means that the language you're using is unknown to
-the \translations package (see part~\ref{part:translations}). In this case please
-notify me, too. You then can still use the \key{name} options.
+the \translations package (see part~\ref{part:translations}). In this case
+please notify me, too. You then can still use the \key{name} options.
+
\secidx*{Language Settings}
\section{Counting Points}\label{sec:points}\secidx{Counting Points}
\subsection{The Commands}
You have seen in section~\ref{ssec:questions} that you can assign points to a
-question. If you do so these points are printed into the margin\footnote{Well,
-not necessarily. It depends on the heading style you have chosen.} and are counted
-internally. But there are additional commands to assign points or bonus points
-and a number of commands to retrieve the sum of points and/or bonus points.
+question. If you do so these points are printed into the
+margin\footnote{Well, not necessarily. It depends on the heading style you
+ have chosen.} and are counted internally. But there are additional commands
+to assign points or bonus points and a number of commands to retrieve the sum
+of points and/or bonus points.
\begin{beschreibung}
- \Befehl{addpoints}*{<num>}\newline
- This command can be used to add points assigned to subquestions.
- \cmd{addpoints} will print the points (with ``unit'') \emph{and} add them to
- the sum of all points, \cmd{addpoints}* will only add them but print nothing.
- \Befehl{points}*{<num>}\newline
- This command will only print the points (with ``unit'') but won't add them
- to the sum of points.
- \Befehl{addbonus}*{<num>}\newline
- This command can be used to add bonus points assigned to subquestions.
- \cmd{addbonus} will print the points (with ``unit'') \emph{and} add them to
- the sum of all bonus points, \cmd{addbonus}* will only add them but print nothing.
- \Befehl{bonus}*{<num>}\newline
- This command will only print the bonus points (with ``unit'') but won't add them
- to the sum of bonus points.
- \Befehl{pointssum}*\newline
- Prints the sum of all points with or without (starred version) ``unit'':
- \pointssum
- \Befehl{currentpointssum}*\newline
- Prints the current sum of points with or without (starred version) ``unit'':
- \currentpointssum
- \Befehl{bonussum}*\newline
- Prints the sum of all bonus points with or without (starred version) ``unit'':
- \bonussum
- \Befehl{currentbonussum}*\newline
- Prints the current sum of bonus points with or without (starred version) ``unit'':
- \currentbonussum
- \Befehl{totalpoints}*\newline
- prints the sum of the points \emph{and} the sum of the bonus points with ``unit'':
- \totalpoints\space
- The starred version prints the sum of the points without ``unit'': \totalpoints*.
+ \Befehl{addpoints}*{<num>}\newline
+ This command can be used to add points assigned to subquestions.
+ \cmd{addpoints} will print the points (with ``unit'') \emph{and} add them
+ to the sum of all points, \cmd{addpoints}* will only add them but print
+ nothing.
+ \Befehl{points}*{<num>}\newline
+ This command will only print the points (with ``unit'') but won't add them
+ to the sum of points.
+ \Befehl{addbonus}*{<num>}\newline
+ This command can be used to add bonus points assigned to subquestions.
+ \cmd{addbonus} will print the points (with ``unit'') \emph{and} add them
+ to the sum of all bonus points, \cmd{addbonus}* will only add them but
+ print nothing.
+ \Befehl{bonus}*{<num>}\newline
+ This command will only print the bonus points (with ``unit'') but won't
+ add them to the sum of bonus points.
+ \Befehl{pointssum}*\newline
+ Prints the sum of all points with or without (starred version) ``unit'':
+ \pointssum
+ \Befehl{currentpointssum}*\newline
+ Prints the current sum of points with or without (starred version)
+ ``unit'': \currentpointssum
+ \Befehl{bonussum}*\newline
+ Prints the sum of all bonus points with or without (starred version)
+ ``unit'': \bonussum
+ \Befehl{currentbonussum}*\newline
+ Prints the current sum of bonus points with or without (starred version)
+ ``unit'': \currentbonussum
+ \Befehl{totalpoints}*\newline
+ prints the sum of the points \emph{and} the sum of the bonus points with
+ ``unit'': \totalpoints\space The starred version prints the sum of the
+ points without ``unit'': \totalpoints*.
\end{beschreibung}
-The commands \cmd{pointssum}, \cmd{bonussum} and \cmd{totalpoints} need at least
-\emph{two} \LaTeX\ runs to get the sum right.
+The commands \cmd{pointssum}, \cmd{bonussum} and \cmd{totalpoints} need at
+least \emph{two} \LaTeX\ runs to get the sum right.
Suppose you have an exercise worth \points{4} which consists of four questions
-listed with an \code{enumerate} environment that are all worth \points{1} each.
-You have two possibilities to display and count them:
+listed with an \code{enumerate} environment that are all worth \points{1}
+each. You have two possibilities to display and count them:
\begin{beispiel}
% uses package `enumitem'
\begin{question}{4}
@@ -849,42 +882,47 @@ You have two possibilities to display and count them:
\subsection{Options}\secidx[options]{Counting Points}
\begin{beschreibung}
- \Option[points]{name}{<name>}\Default{P.}
- Choose the ``unit'' for the points. If you like to differentiate between a
- single point and more than one point you can give a plural ending separated
- with a slash: \key{name}{point/s}. This sets also the name of the bonus points.
- \Option[points]{name-plural}{<plural form of name>}\Default{}
- Instead of forming the plural form with an ending to the singular form this
- option allows to set an extra word for it. This sets also the plural form for
- the bonus points.
- \Option[points]{bonus-name}{<name>}\Default{P.}
- Choose the ``unit'' for the bonus points. If you like to differentiate between a
- single point and more than one point you can give a plural ending separated
- with a slash: \key{bonus-name}{point/s}.
- \Option[points]{bonus-plural}{<plural form of name>}\Default{}
- Instead of forming the plural form with an ending to the singular form this
- option allows to set an extra word for it.
- \Option[points]{use-name}{\default{true}|false}\Default{true}
- Don't display the name at all. Or do.
+ \Option[points]{name}{<name>}\Default{P.}
+ Choose the ``unit'' for the points. If you like to differentiate between
+ a single point and more than one point you can give a plural ending
+ separated with a slash: \key{name}{point/s}. This sets also the name of
+ the bonus points.
+ \Option[points]{name-plural}{<plural form of name>}\Default{}
+ Instead of forming the plural form with an ending to the singular form
+ this option allows to set an extra word for it. This sets also the plural
+ form for the bonus points.
+ \Option[points]{bonus-name}{<name>}\Default{P.}
+ Choose the ``unit'' for the bonus points. If you like to differentiate
+ between a single point and more than one point you can give a plural
+ ending separated with a slash: \key{bonus-name}{point/s}.
+ \Option[points]{bonus-plural}{<plural form of name>}\Default{}
+ Instead of forming the plural form with an ending to the singular form
+ this option allows to set an extra word for it.
+ \Option[points]{use-name}{\default{true}|false}\Default{true}
+ Don't display the name at all. Or do.
\Option[points]{format}{<code>}\Default{\cmd*{@firtsofone}}
- \sinceversion{0.9d}Format number plus name as a whole. Ideally \code{<code>} would
- end with a command that takes an argument. Else number plus name will be braced.
- \Option[points]{number-format}{<any code>}\Default{}
- This option allows formatting of the number, \eg italics:
- \key{number-format}{\cmd{textit}}.
- \Option[points]{bonus-format}{<any code>}\Default{}
- This option allows formatting of the number of the bonus points, \eg italics:
- \key{bonus-format}{\cmd{textit}}.
- \Option[points]{parse}{\default{true}|false}\Default{true}
- If set to \code{false} the points are not counted and the \cmd{totalpoints},
- \cmd{pointssum} and \cmd{bonussum} commands won't know their value.
- \Option[points]{separate-bonus}{\default{true}|false}\Default{false}
- This option determines whether points and bonus points each get their own
- unit when they appear together (in the margin or with \cmd{totalpoints}).
- \Option[points]{pre-bonus}{<tokens>}\Default{(+}
- Code to be inserted before the bonus points when they follow normal points.
- \Option[points]{post-bonus}{<tokens>}\Default{)}
- Code to be inserted after the bonus points when they follow normal points.
+ \sinceversion{0.9d}Format number plus name as a whole. Ideally
+ \code{<code>} would end with a command that takes an argument. Else
+ number plus name will be braced.
+ \Option[points]{number-format}{<any code>}\Default{}
+ This option allows formatting of the number, \eg italics:
+ \key{number-format}{\cmd{textit}}.
+ \Option[points]{bonus-format}{<any code>}\Default{}
+ This option allows formatting of the number of the bonus points, \eg
+ italics: \key{bonus-format}{\cmd{textit}}.
+ \Option[points]{parse}{\default{true}|false}\Default{true}
+ If set to \code{false} the points are not counted and the
+ \cmd{totalpoints}, \cmd{pointssum} and \cmd{bonussum} commands won't know
+ their value.
+ \Option[points]{separate-bonus}{\default{true}|false}\Default{false}
+ This option determines whether points and bonus points each get their own
+ unit when they appear together (in the margin or with \cmd{totalpoints}).
+ \Option[points]{pre-bonus}{<tokens>}\Default{(+}
+ Code to be inserted before the bonus points when they follow normal
+ points.
+ \Option[points]{post-bonus}{<tokens>}\Default{)}
+ Code to be inserted after the bonus points when they follow normal
+ points.
\end{beschreibung}
\begin{beispiel}
\SetupExSheets[points]{name=point/s,number-format=\color{red}}
@@ -899,15 +937,17 @@ You have two possibilities to display and count them:
\section{Printing Solutions}\label{sec:solutions}\secidx[print]{solutions}
You have already seen that you can print solutions where they are using the
-\key[solution]{print} option. But \ExSheets offers you quite more possibilities.
+\key[solution]{print} option. But \ExSheets offers you quite more
+possibilities.
In the next subsections the usage of the command
\begin{beschreibung}
- \Befehl{printsolutions}[<setting>]
+ \Befehl{printsolutions}[<setting>]
\end{beschreibung}
is discussed.
-Before we do that a hint: remember that you can set the option \key{print} globally:
+Before we do that a hint: remember that you can set the option \key{print}
+globally:
\begin{beispiel}[code only]
% in the preamble
\SetupExSheets{solution/print=true}
@@ -916,24 +956,24 @@ Before we do that a hint: remember that you can set the option \key{print} globa
Now if you want to typeset some text depending on the option being true or not
you can use the following commands:
\begin{beschreibung}
- \expandable\Befehl{PrintSolutionsTF}{<true code>}\ma{<false code>}
- \expandable\Befehl{PrintSolutionsT}{<true code>}
- \expandable\Befehl{PrintSolutionsF}{<false code>}
+ \expandable\Befehl{PrintSolutionsTF}{<true code>}\ma{<false code>}
+ \expandable\Befehl{PrintSolutionsT}{<true code>}
+ \expandable\Befehl{PrintSolutionsF}{<false code>}
\end{beschreibung}
-They might come in handy if you want two versions of an exercise sheet, one with
-the exercises and one with the solutions, and you want to add different titles
-to these versions, for instance.
+They might come in handy if you want two versions of an exercise sheet, one
+with the exercises and one with the solutions, and you want to add different
+titles to these versions, for instance.
\subsection{Print all}\secidx[print!all]{solutions}
The first and easiest usage of \cmd{printsolutions} is the following:
\begin{beispiel}[code only]
\printsolutions
\end{beispiel}
-There is nothing more to say, really. It prints all solutions you have specified
-except those belonging to a question with option \key{use}{false}. Yes, there's
-one more point: \cmd{printsolutions} only knows the solutions that have been set
-\emph{before} its usage! This is also true for every usage explained in the next
-sections.
+There is nothing more to say, really. It prints all solutions you have
+specified except those belonging to a question with option \key{use}{false}.
+Yes, there's one more point: \cmd{printsolutions} only knows the solutions
+that have been set \emph{before} its usage! This is also true for every usage
+explained in the next sections.
\begin{beispiel}[below]
\printsolutions
@@ -941,17 +981,18 @@ sections.
\subsection{Print per chapter/section}\secidx[print!per section/chapter]{solutions}
\minisec{Current chapter/section}
-If you are not creating an exercise sheet or an exam but are writing a textbook
-you maybe want a section at the end of each chapter showing the solution to the
-exercises presented in that chapter. In this case use the command as follows:
+If you are not creating an exercise sheet or an exam but are writing a
+textbook you maybe want a section at the end of each chapter showing the
+solution to the exercises presented in that chapter. In this case use the
+command as follows:
\begin{beispiel}[code only]
\printsolutions[section]
% or
\printsolutions[chapter]
\end{beispiel}
-Again, this is pretty much self-explaining. The solutions to the questions of the
-current chapter\footnote{Only if the document class you're using \emph{has}
-chapters, of course!} or section are printed.
+Again, this is pretty much self-explaining. The solutions to the questions of
+the current chapter\footnote{Only if the document class you're using
+ \emph{has} chapters, of course!} or section are printed.
\begin{beispiel}
\begin{question}
This is the first and only question in this section.
@@ -966,25 +1007,25 @@ chapters, of course!} or section are printed.
\minisec{Specific chapter/section}\label{sssec:print_specific_section}
You can also print only the solutions from chapters or sections other than the
-current ones. The syntax is fairly easy:
+current ones. The syntax is fairly easy:
\begin{beispiel}[below]
\printsolutions[section={1-7,10}]
% the same for chapters:
% \printsolutions[chapter={1-7,10}]
\end{beispiel}
-Don't forget that \cmd{printsolutions} cannot know the solutions from section~10
-yet. It is just used to demonstrate the syntax. You can also use an open range,
-\eg something like
+Don't forget that \cmd{printsolutions} cannot know the solutions from
+section~10 yet. It is just used to demonstrate the syntax. You can also use
+an open range, \eg something like
\begin{beispiel}[code only]
\printsolutions[section={-4,10-}]
\end{beispiel}
This would print the solutions from sections~1--4 and from all sections with
-number 10\footnote{Or rather where \cmd{value}{section} is 10 or greater -- the
-actual counter formatting is irrelevant.} and greater.
+number 10\footnote{Or rather where \cmd{value}{section} is 10 or greater --
+ the actual counter formatting is irrelevant.} and greater.
-There is an obvious disadvantage: you have to know the section numbers! But there
-is a solution: use the package option \key{use-ref}{true}. Then you can do something
-like
+There is an obvious disadvantage: you have to know the section numbers! But
+there is a solution: use the package option \key{use-ref}{true}. Then you can
+do something like
\begin{beispiel}[code only]
% in the preamble:
\usepackage[use-ref]{exsheets}
@@ -995,18 +1036,19 @@ like
% which will print all solutions from questions up to and
% including the really cool section
\end{beispiel}
-With the package option \key{use-ref}{true} each usage of \cmd{label} will create
-additional labels (one preceded with \code{exse:} and another one with \code{exch:})
-which store the section number and the chapter number, respectively. These are used
-internally by two commands \cmd{S} and \cmd{C} which refer to the section number
-and the chapter number the label was created in. \emph{These commands are only
-available as arguments of} \cmd{printsolutions}.
+With the package option \key{use-ref}{true} each usage of \cmd{label} will
+create additional labels (one preceded with \code{exse:} and another one with
+\code{exch:}) which store the section number and the chapter number,
+respectively. These are used internally by two commands \cmd{S} and \cmd{C}
+which refer to the section number and the chapter number the label was created
+in. \emph{These commands are only available as arguments of}
+\cmd{printsolutions}.
Since some packages like the well known \paket{hyperref} for example redefine
-\cmd{label} \key{use-ref} won't work in together with it. In this case don't
+\cmd{label} \key{use-ref} won't work in together with it. In this case don't
use \key{use-ref} and set \cmd{exlabel}{<label>} instead to remember the
-section/the chapter number. Its usage is just like \cmd{label}. So the safest way
-is as follows:
+section/the chapter number. Its usage is just like \cmd{label}. So the
+safest way is as follows:
\begin{beispiel}[code only]
% in the preamble:
\usepackage{exsheets}
@@ -1017,17 +1059,17 @@ is as follows:
% which will print all solutions from questions up to and
% including the really cool section
\end{beispiel}
-Please be aware that the labels must be processed in a previous \LaTeX\ run before
-\cmd{S} and \cmd{C} can pass them on to \cmd{printsolutions}.
+Please be aware that the labels must be processed in a previous \LaTeX\ run
+before \cmd{S} and \cmd{C} can pass them on to \cmd{printsolutions}.
\subsection{Print by \acs{id}}\label{ssec:ids}\secidx[print!by ID]{solutions}
-Now comes the best part: you can also print selected solutions! Every question
-has an \acs{id}. To see which \acs{id} a question has you can call the following
-command:
+Now comes the best part: you can also print selected solutions! Every
+question has an \acs{id}. To see which \acs{id} a question has you can call
+the following command:
\begin{beschreibung}
- \Befehl{DebugExSheets}{true|false}
- \Befehl{CurrentQuestionID}\newline\sinceversion{0.4a}%
- expands to the current question \acs{id} (after two expansions).
+ \Befehl{DebugExSheets}{true|false}
+ \Befehl{CurrentQuestionID}\newline\sinceversion{0.4a}%
+ expands to the current question \acs{id} (after two expansions).
\end{beschreibung}
Let's create some more questions and take a look what this command does:
\begin{beispiel}
@@ -1050,27 +1092,28 @@ So now we can call some specific solutions:
\begin{beispiel}
\printsolutions[byID={first,nice!,10,14}]
\end{beispiel}
-This makes use of the \paket{l3sort} package which at the time of writing is still
-considered experimental. In case you wonder where solution~14 is: question~14
-has no solution given.
+This makes use of the \paket{l3sort} package which at the time of writing is
+still considered experimental. In case you wonder where solution~14 is:
+question~14 has no solution given.
-If you don't want that the solutions are sorted automatically but appear in the
-order given you can use the option
+If you don't want that the solutions are sorted automatically but appear in
+the order given you can use the option
\begin{beschreibung}
- \Option[solution]{sorted}{\default{true}|false}\Default{true}
- Sort solutions given by \acs{id} or don't.
+ \Option[solution]{sorted}{\default{true}|false}\Default{true}
+ Sort solutions given by \acs{id} or don't.
\end{beschreibung}
\section{Dividing Questions into Classes}\label{sec:dividing-concepts}
\subsection{Using Classes}\label{sec:classes}\secidx{Classes}
\secidx[Classes]{Dividing Concepts}
-For creating different variants of a written exam or different difficulty levels
-of an exercise sheet it comes in handy if one can assign certain classes to questions
-and then tell \ExSheets only to use one ore more specific classes.
+For creating different variants of a written exam or different difficulty
+levels of an exercise sheet it comes in handy if one can assign certain
+classes to questions and then tell \ExSheets only to use one ore more specific
+classes.
\begin{beschreibung}
- \Option{use-classes}{<list of classes>}\Default{}
- When this option is used only the questions belonging to the specified classes
- are printed and have their solutions saved.
+ \Option{use-classes}{<list of classes>}\Default{}
+ When this option is used only the questions belonging to the specified
+ classes are printed and have their solutions saved.
\end{beschreibung}
\begin{beispiel}
\SetupExSheets{use-classes={A,C}}
@@ -1084,8 +1127,9 @@ and then tell \ExSheets only to use one ore more specific classes.
Belonging to class C!
\end{question}
\end{beispiel}
-Questions of classes that are not used are fully discarded. \emph{This also means
-that questions that don't have a class assigned are discarded.}
+Questions of classes that are not used are fully discarded. \emph{This also
+ means that questions that don't have a class assigned are discarded.}
+
\secidx*{Classes}
\ExplSyntaxOn
\bool_set_false:N \g__exsheets_use_classes_bool
@@ -1096,9 +1140,9 @@ that questions that don't have a class assigned are discarded.}
Similarly to classes one can assign topics to questions. The usage is practically
identical, the semantic meaning is different.
\begin{beschreibung}
- \Option{use-topics}{<list of topics>}\Default{}
- When this option is used only the questions belonging to the specified topics
- are printed and have their solutions saved.
+ \Option{use-topics}{<list of topics>}\Default{}
+ When this option is used only the questions belonging to the specified
+ topics are printed and have their solutions saved.
\end{beschreibung}
\begin{beispiel}
\SetupExSheets{use-topics={trigonometry}}
@@ -1109,42 +1153,42 @@ identical, the semantic meaning is different.
A arithmetics question
\end{question}
\end{beispiel}
-Questions of topics that are not used are fully discarded. \emph{This also means
-that questions that don't have a topic assigned are discarded.}
+Questions of topics that are not used are fully discarded. \emph{This also
+ means that questions that don't have a topic assigned are discarded.}
If you set both \key{use-classes} and \key{use-topics} then only questions
will be used that \emph{match both categories}.
-Ideally one could assign more than one topic to a question but this is \emph{not}
-supported yet.
+Ideally one could assign more than one topic to a question but this is
+\emph{not} supported yet.
\secidx*{Topics}
\ExplSyntaxOn
\bool_set_false:N \g__exsheets_use_topics_bool
\ExplSyntaxOff
\subsection{Own Dividing Concepts}\secidx{Dividing Concepts}
-\noindent\sinceversion{0.8}Actually both classes and topics are introduced into
-\ExSheets internally this way:
+\noindent\sinceversion{0.8}Actually both classes and topics are introduced
+into \ExSheets internally this way:
\begin{beispiel}[code only]
\DeclareQuestionClass{class}{classes}
\DeclareQuestionClass{topic}{topics}
\end{beispiel}
which means you can do the same introducing your own dividing concepts.
\begin{beschreibung}
- \Befehl{DeclareQuestionClass}{<singular name>}\ma{<plural name>}\newline
- Introduces a new dividing concept and defines both new options for the
- \code{question} environment and new global options.
+ \Befehl{DeclareQuestionClass}{<singular name>}\ma{<plural name>}\newline
+ Introduces a new dividing concept and defines both new options for the
+ \code{question} environment and new global options.
\end{beschreibung}
-For example you could decide you want to group your questions according to their
-difficulty. You could place the following line in your preamble:
+For example you could decide you want to group your questions according to
+their difficulty. You could place the following line in your preamble:
\begin{beispiel}[code only]
\DeclareQuestionClass{difficulty}{difficulties}
\end{beispiel}
-This would define an option \key{use-difficulties} analogous to \key{use-classes}
-and \key{use-topics}. It would also define an option \key{difficulty} for the
-\code{question} environment. This means you could now do something like the
-following:
+This would define an option \key{use-difficulties} analogous to
+\key{use-classes} and \key{use-topics}. It would also define an option
+\key{difficulty} for the \code{question} environment. This means you could
+now do something like the following:
\begin{beispiel}
\SetupExSheets{use-difficulties={easy,hard}}
\begin{question}[difficulty=easy]
@@ -1164,29 +1208,30 @@ following:
\section{Adding and Using Additional Information to Questions}\label{sec:additional_info}
\secidx{Additional Information to Questions}
-For managing lots of questions and corresponding solutions it can be very useful
-to be able to save and recover additional information to the questions. This is
-possible with the following commands. First the ones for saving:
+For managing lots of questions and corresponding solutions it can be very
+useful to be able to save and recover additional information to the questions.
+This is possible with the following commands. First the ones for saving:
\begin{beschreibung}
- \Befehl{DeclareQuestionProperty}{<name>}\newline
- This command defines a question property \code{<name>}. It can only be used
- in the document preamble.
- \Befehl{SetQuestionProperties}{<name>=<value>,...}\newline
- Set the properties for a specific question. this command can only be used
- inside the \code{question} environment.
+ \Befehl{DeclareQuestionProperty}{<name>}\newline
+ This command defines a question property \code{<name>}. It can only be
+ used in the document preamble.
+ \Befehl{SetQuestionProperties}{<name>=<value>,...}\newline
+ Set the properties for a specific question. this command can only be used
+ inside the \code{question} environment.
\end{beschreibung}
Now the commands for recovering the properties:
\begin{beschreibung}
- \Befehl{QuestionNumber}{<id>}\newline
- Recover the number of the question with the \acs{id} \code{<id>}. The number
- is displayed according to the format set with \key{counter-format}.
- \Befehl{GetQuestionProperty}{<name>}\ma{<id>}\newline
- Recover the property \code{<name>} of the question with the \acs{id} \code{<id>}.
- Of course the property must have been declared before.
+ \Befehl{QuestionNumber}{<id>}\newline
+ Recover the number of the question with the \acs{id} \code{<id>}. The
+ number is displayed according to the format set with
+ \key{counter-format}.
+ \Befehl{GetQuestionProperty}{<name>}\ma{<id>}\newline
+ Recover the property \code{<name>} of the question with the \acs{id}
+ \code{<id>}. Of course the property must have been declared before.
\end{beschreibung}
-Let's say we have declared the properties \code{notes}, \code{reference}
-and \code{topic}. By default the property \code{points} is available and gets the
+Let's say we have declared the properties \code{notes}, \code{reference} and
+\code{topic}. By default the property \code{points} is available and gets the
value of the optional argument of the \code{question} environment.
We can now do the following:
@@ -1243,9 +1288,9 @@ It is now possible to recover these values later:
\end{center}
\end{beispiel}
-\sinceversion{0.7a}If you use the package option \key{auto-label} the properties
-\code{ref} and \code{pageref} are predefined which will call the corresponding
-\cmd*{ref} or \cmd*{pageref}, respectively.
+\sinceversion{0.7a}If you use the package option \key{auto-label} the
+properties \code{ref} and \code{pageref} are predefined which will call the
+corresponding \cmd*{ref} or \cmd*{pageref}, respectively.
Please note that these properties \emph{are not the same} as the dividing
concepts explained in section~\ref{sec:dividing-concepts} although they may
@@ -1253,16 +1298,17 @@ seem similar in meaning or even have the same name.
\sinceversion{0.3}There are additional commands that might prove useful:
\begin{beschreibung}
- \Befehl{ForEachQuestion}{<code to be executed for each used question>}\newline
- Inside the argument one can refer to the \ac{id} of a question with \code{\#1}.
- Beware that this command only knows of questions used before it is issued.
- \expandable\Befehl{numberofquestions}\newline
- Returns the current number of used questions. Beware that this command only knows
- of questions used before it is issued.
- \expandable\Befehl{iflastquestion}{<true code>}\ma{<false code>}\newline
- Although this command is available in the whole document it is only useful
- inside \cmd{ForEachQuestion}. It tells you if the end of the loop is reached
- or not.
+ \Befehl{ForEachQuestion}{<code to be executed for each used question>}\newline
+ Inside the argument one can refer to the \ac{id} of a question with
+ \code{\#1}. Beware that this command only knows of questions used before
+ it is issued.
+ \expandable\Befehl{numberofquestions}\newline
+ Returns the current number of used questions. Beware that this command
+ only knows of questions used before it is issued.
+ \expandable\Befehl{iflastquestion}{<true code>}\ma{<false code>}\newline
+ Although this command is available in the whole document it is only useful
+ inside \cmd{ForEachQuestion}. It tells you if the end of the loop is
+ reached or not.
\end{beschreibung}
For example one could use these commands to create a grading table:
\begin{beispiel}[code only]
@@ -1277,7 +1323,8 @@ For example one could use these commands to create a grading table:
\ForEachQuestion{\iflastquestion{}{&}} & \\ \hline
\end{tabular}
\end{beispiel}
-For four questions the table now would look similar to figure~\ref{fig:grading-table}.
+For four questions the table now would look similar to
+figure~\ref{fig:grading-table}.
\begin{figure}[ht]
\centering
@@ -1294,26 +1341,27 @@ For four questions the table now would look similar to figure~\ref{fig:grading-t
\section{Variations of an Exam}\secidx{Variations}
\noindent\sinceversion{0.6}It is a quite common task to design an exam in two
-different variants. This is of course possible with \ExSheets' classes (see
-section~\ref{sec:classes}). However, often not the whole question is to be
-different but only small details, the numbers in a maths exam, say. For this
+different variants. This is of course possible with \ExSheets' classes (see
+section~\ref{sec:classes}). However, often not the whole question is to be
+different but only small details, the numbers in a maths exam, say. For this
purpose \ExSheets provides the following commands:
\begin{beschreibung}
- \Befehl{SetVariations}{<num>}\newline
- Set the number of different variants. This will determine how many arguments
- the command \cmd*{vary} will get. \code{<num>} must at least be \code{2} and
- is initially set to \code{2}.
- \Befehl{variant}{<num>}\newline
- Choose the active variant. The argument must be a number between \code{1}
- and the number set with \cmd*{SetVariations}. Initially set to \code{1}.
- \Befehl{vary}{<variant 1>}\ma{<variant 2>}\newline
- This command is the one actually used in the document. It has a number of
- required arguments equal to the number set with \cmd*{SetVariations}. All of
- its arguments are discarded except the one specified with \cmd*{variant}.
- \Befehl{lastvariant}\newline% TODO: richtige version einfügen!
- \sinceversion{0.7b}Each time \cmd{vary} is called it stores the value it
- chose in \cmd{lastversion}. This might be convenient to use if one
- otherwise would have to repeatedly write the same \cmd{vary}.
+ \Befehl{SetVariations}{<num>}\newline
+ Set the number of different variants. This will determine how many
+ arguments the command \cmd*{vary} will get. \code{<num>} must at least be
+ \code{2} and is initially set to \code{2}.
+ \Befehl{variant}{<num>}\newline
+ Choose the active variant. The argument must be a number between \code{1}
+ and the number set with \cmd*{SetVariations}. Initially set to \code{1}.
+ \Befehl{vary}{<variant 1>}\ma{<variant 2>}\newline
+ This command is the one actually used in the document. It has a number of
+ required arguments equal to the number set with \cmd*{SetVariations}. All
+ of its arguments are discarded except the one specified with
+ \cmd*{variant}.
+ \Befehl{lastvariant}\newline% TODO: richtige version einfügen!
+ \sinceversion{0.7b}Each time \cmd{vary} is called it stores the value it
+ chose in \cmd{lastversion}. This might be convenient to use if one
+ otherwise would have to repeatedly write the same \cmd{vary}.
\end{beschreibung}
\begin{beispiel}
@@ -1334,11 +1382,11 @@ purpose \ExSheets provides the following commands:
\secidx*{Variations}
\section{A Grade Distribution}\secidx{Grade Distribution}
-Probably this is a rather esoteric feature but it could proof useful in some cases.
-Suppose you are a German math teacher and want to grade exactly corresponding to
-the number of points relative to the sum of total points, regardless of how big
-that might be. You could do something like this to present your grading decisions
-for the exam:
+Probably this is a rather esoteric feature but it could proof useful in some
+cases. Suppose you are a German math teacher and want to grade exactly
+corresponding to the number of points relative to the sum of total points,
+regardless of how big that might be. You could do something like this to
+present your grading decisions for the exam:
\begin{beispiel}
% preamble:
% \DeclareRelGrades{
@@ -1362,18 +1410,19 @@ for the exam:
These are the available commands and options:
\begin{beschreibung}
- \Befehl{DeclareRelGrades}{<grade>=<num>,...}\newline
- This command is used to define grades and assign the percentage of total
- points to them.
- \Befehl{grade}*{<grade>}\newline
- Gives the number of points corresponding to a grade depending on the value
- of \cmd{pointssum} with or without (starred version) ``unit''.
- \Option[grades]{round}{<num>}\Default{0}
- The number of decimals the points of a grade are rounded to. This doesn't apply
- to the maximum number of points if the rounded number would be bigger than the
- actual sum.
- \Option[grades]{half}{\default{true}|false}\Default{false}
- If set to \code{true} points are rounded either to full or to half points.
+ \Befehl{DeclareRelGrades}{<grade>=<num>,...}\newline
+ This command is used to define grades and assign the percentage of total
+ points to them.
+ \Befehl{grade}*{<grade>}\newline
+ Gives the number of points corresponding to a grade depending on the value
+ of \cmd{pointssum} with or without (starred version) ``unit''.
+ \Option[grades]{round}{<num>}\Default{0}
+ The number of decimals the points of a grade are rounded to. This doesn't
+ apply to the maximum number of points if the rounded number would be
+ bigger than the actual sum.
+ \Option[grades]{half}{\default{true}|false}\Default{false}
+ If set to \code{true} points are rounded either to full or to half
+ points.
\end{beschreibung}
\secidx*{Grade Distribution}
@@ -1382,17 +1431,17 @@ These are the available commands and options:
\subsection{Caveat}
I need to say some words of caution: the \cmd{includequestions} that will be
presented shortly is probably \ExSheets' most experimental one at the time of
-writing (\today). Thanks to feedback of users it is constantly improved and
-bugs are fixed. It is not a very efficient way to insert question regarding
-performance and you shouldn't wonder if compilation slows down when you use it.
-It probably needs to be re-written all over but on the one hand that would
-introduce new bugs and on the other hand for the time being I don't have the
-capacities, anyway, so you'll have to live it, I'm afraid.
+writing (\today). Thanks to feedback of users it is constantly improved and
+bugs are fixed. It is not a very efficient way to insert question regarding
+performance and you shouldn't wonder if compilation slows down when you use
+it. It probably needs to be re-written all over but on the one hand that
+would introduce new bugs and on the other hand for the time being I don't have
+the capacities, anyway, so you'll have to live it, I'm afraid.
\subsection{How it works}
-Suppose you have one or more files with questions prepared to use them as a kind
-of database. One for class A, say, one for class B, one for class C and so one,
-something like this:
+Suppose you have one or more files with questions prepared to use them as a
+kind of database. One for class A, say, one for class B, one for class C and
+so one, something like this:
\begin{beispiel}[code only]
% this is file classA.tex
\begin{question}[class=A,ID=A1,topic=X]
@@ -1411,25 +1460,25 @@ something like this:
% end of file classA.tex
\endinput
\end{beispiel}
-You can of course just \cmd{input} or \cmd{include} it but that would of course
-include the whole file into your document. But would't it be nice to just include
-selected questions? Or maybe a five random questions from the file? That is
-possible with the following command:
+You can of course just \cmd{input} or \cmd{include} it but that would of
+course include the whole file into your document. But would't it be nice to
+just include selected questions? Or maybe a five random questions from the
+file? That is possible with the following command:
\begin{beschreibung}
- \Befehl{includequestions}[<options>]{<list of filenames>}
+ \Befehl{includequestions}[<options>]{<list of filenames>}
\end{beschreibung}
-If you use it without options it will have the same effect as \cmd{input}. There
-are however the following options:
+If you use it without options it will have the same effect as
+\cmd{input}. There are however the following options:
\begin{beschreibung}
- \Option[include]{all}{\default{true}|false}
- \Option[include]{IDs}{<list of IDs>}\Default{}
- Includes only the specified questions.
- \Option[include]{random}{<num>}\Default{}
- Includes \code{<num>} randomly selected questions. This option uses the
- \paket{pgfcore} package to create the pseudo-random numbers.
- \Option[include]{exclude}{<list of IDs>}\Default{}
- Questions who's \acp{id} are specified here are \emph{not} included. This
- option can be combined with the \key{random} option.
+ \Option[include]{all}{\default{true}|false}
+ \Option[include]{IDs}{<list of IDs>}\Default{}
+ Includes only the specified questions.
+ \Option[include]{random}{<num>}\Default{}
+ Includes \code{<num>} randomly selected questions. This option uses the
+ \paket{pgfcore} package to create the pseudo-random numbers.
+ \Option[include]{exclude}{<list of IDs>}\Default{}
+ Questions who's \acp{id} are specified here are \emph{not} included. This
+ option can be combined with the \key{random} option.
\end{beschreibung}
The usage should be self-explainable:
\begin{beispiel}[code only]
@@ -1439,10 +1488,11 @@ The usage should be self-explainable:
\includequestions[random=3]{classA}
\end{beispiel}
In order to be able to select the questions \ExSheets needs to \cmd{input} the
-file twice. The first time the available questions are determined, the second time
-the selected questions are used. This unfortunately means that anything that is
-\emph{not} part of a question or solution is also input twice. Either don't put
-anything else into the file or use one of the following commands for control:
+file twice. The first time the available questions are determined, the second
+time the selected questions are used. This unfortunately means that anything
+that is \emph{not} part of a question or solution is also input twice. Either
+don't put anything else into the file or use one of the following commands for
+control:
\begin{beschreibung}
\Befehl{PrintIfIncludeActiveTF}\ma{<true code>}\ma{<false code>}
\Befehl{PrintIfIncludeActiveT}\ma{<true code>}
@@ -1457,31 +1507,31 @@ using \cmd{includequestions}.
included questions is available as an unordered comma separated list in the
following macro:
\begin{beschreibung}
- \Befehl{questionsincludedlast}\newline
- Unordered comma separated list of question \acp{id} included with the last
- usage of \cmd{includequestions}.
+ \Befehl{questionsincludedlast}\newline
+ Unordered comma separated list of question \acp{id} included with the last
+ usage of \cmd{includequestions}.
\end{beschreibung}
\secidx*{Include from External Files}
\section{Own Question/Solution Pairs}
\noindent\changedversion{0.9}\ExSheets provides he possibility to create new
-environments that behave like the \code{question} and \code{solution} environments.
-This would allow, for example, to define a \code{question*}/\code{solution*}
-environment pair for bonus questions. The following commands may be used in the
-document preamble:
+environments that behave like the \code{question} and \code{solution}
+environments. This would allow, for example, to define a
+\code{question*}/\code{solution*} environment pair for bonus questions. The
+following commands may be used in the document preamble:
\begin{beschreibung}
- \Befehl{NewQuSolPair}{<question>}\oa{<question options>}\oa{<general options>}%
- \ma{<solution>}\oa{<solution options>}\oa{<general options>}
- \Befehl{RenewQuSolPair}{<question>}\oa{<question options>}\oa{<general options>}%
- \ma{<solution>}\oa{<solution options>}\oa{<general options>}
+ \Befehl{NewQuSolPair}{<question>}\oa{<question options>}\oa{<general options>}%
+ \ma{<solution>}\oa{<solution options>}\oa{<general options>}
+ \Befehl{RenewQuSolPair}{<question>}\oa{<question options>}\oa{<general options>}%
+ \ma{<solution>}\oa{<solution options>}\oa{<general options>}
\end{beschreibung}
The standard environments are defined as follows:
\begin{beispiel}[code only]
\NewQuSolPair{question}{solution}
\end{beispiel}
-Let's say we want the possibility to add bonus questions. A simple way would be
-to define starred variants that add a star in the margin left to the title:
+Let's say we want the possibility to add bonus questions. A simple way would
+be to define starred variants that add a star in the margin left to the title:
\begin{beispiel}
% preamble:
% \NewQuSolPair
@@ -1499,32 +1549,34 @@ standard \code{question} and \code{solution} environments.
\section{Filling in the Blanks}\secidx{Blanks}
\subsection{Cloze}\secidx[Cloze]{Blanks}
-\noindent\changedversion{0.4}Both in exercise sheets and in exams it is sometimes
-desirable to be able to create \blank{blanks} that have to be filled in. Or may
-be some more lines: \blank[width=5\linewidth]{}
+\noindent\changedversion{0.4}Both in exercise sheets and in exams it is
+sometimes desirable to be able to create \blank{blanks} that have to be filled
+in. Or maybe some more lines: \blank[width=5\linewidth]{}
\begin{beschreibung}
- \Befehl{blank}*[<options>]{<text to be filled in>}\newline
- creates a blank in normal text or in a question but fills the text of its
- argument if inside a solution. If used at the \emph{begin of a paragraph}
- \cmd{blank} will do two things: it will set the linespread according to an
- option explained below and will insert \cmd*{par} after the lines. If you
- don't want that use the starred version.
+ \Befehl{blank}*[<options>]{<text to be filled in>}\newline
+ creates a blank in normal text or in a question but fills the text of its
+ argument if inside a solution. If used at the \emph{begin of a paragraph}
+ \cmd{blank} will do two things: it will set the linespread according to an
+ option explained below and will insert \cmd*{par} after the lines. If you
+ don't want that use the starred version.
\end{beschreibung}
The options are these:
\begin{beschreibung}
- \Option[blank]{style}{line|wave|dline|dotted|dashed}\Default{line}
- The style of the line. This uses the corresponding command from the \paket{ulem}
- package and is the whole reason why \ExSheets loads it in the first place.
- \Option[blank]{scale}{<num>}\Default{1}
- Scales the width of the blank by factor \code{<num>} unless the width is
- explicitly set.
- \Option[blank]{width}{<dim>}\Default{}
- The width of the line. If it is not used the width of the filled in text is used.
- \Option[blank]{linespread}{<num>}\Default{1}
- Set the linespread for the blank lines. This only has an effect if \cmd{blank}
- is used at the begin of a paragraph.
+ \Option[blank]{style}{line|wave|dline|dotted|dashed}\Default{line}
+ The style of the line. This uses the corresponding command from the
+ \paket{ulem} package and is the whole reason why \ExSheets loads it in the
+ first place.
+ \Option[blank]{scale}{<num>}\Default{1}
+ Scales the width of the blank by factor \code{<num>} unless the width is
+ explicitly set.
+ \Option[blank]{width}{<dim>}\Default{}
+ The width of the line. If it is not used the width of the filled in text
+ is used.
+ \Option[blank]{linespread}{<num>}\Default{1}
+ Set the linespread for the blank lines. This only has an effect if
+ \cmd{blank} is used at the begin of a paragraph.
\end{beschreibung}
\begin{beispiel}
\begin{question}
@@ -1545,18 +1597,18 @@ A number of empty lines are easily created by setting the width option:
\end{beispiel}
\subsection{Vertical Space for answers}\secidx[vertical space]{Blanks}
-\noindent\sinceversion{0.3}When you're creating an exam you might want to add some
-vertical space where the students can write down their answers. While you can
-always use \cmd*{vspace} this is not always handy when the space left on the
-page is less than you want. In this case it would be nice if a) there would be
-no warning and b) the rest of the space would be added at the top of the next
-page. This is what the following command is for:
+\noindent\sinceversion{0.3}When you're creating an exam you might want to add
+some vertical space where the students can write down their answers. While
+you can always use \cmd*{vspace} this is not always handy when the space left
+on the page is less than you want. In this case it would be nice if a) there
+would be no warning and b) the rest of the space would be added at the top of
+the next page. This is what the following command is for:
\begin{beschreibung}
- \Befehl{examspace}*{<dim>}\newline
- Add space as specified in \ma{<dim>}. If the space available on the current
- page is not enough the rest of the space will be added at the top of the
- next page. The starred version will silently drop any leftover space instead
- of adding it to the next page.
+ \Befehl{examspace}*{<dim>}\newline
+ Add space as specified in \ma{<dim>}. If the space available on the
+ current page is not enough the rest of the space will be added at the top
+ of the next page. The starred version will silently drop any leftover
+ space instead of adding it to the next page.
\end{beschreibung}
\begin{beispiel}
\begin{question}
@@ -1569,23 +1621,23 @@ page. This is what the following command is for:
\section{Styling your Exercise/Exam Sheets}\label{part:style}
\subsection{Background}
-The \ExSheets package makes extensive use of \LaTeX3's coffins\footnote{See the
-documentation to the \paket*{xcoffins} package for more information on that.} as
-well as its templates concept\footnote{Have a look into the documentation to the
-\paket*{xtemplate} package.}. The latter allows a rather easy extension and
-customization of some of \ExSheets' environments. To be more precise: you can
-define your own instances for the headings used for questions and solutions
-and for the \code{tasks} environment.
+The \ExSheets package makes extensive use of \LaTeX3's coffins\footnote{See
+ the documentation to the \paket*{xcoffins} package for more information on
+ that.} as well as its templates concept\footnote{Have a look into the
+ documentation to the \paket*{xtemplate} package.}. The latter allows a
+rather easy extension and customization of some of \ExSheets' environments.
+To be more precise: you can define your own instances for the headings used
+for questions and solutions and for the \code{tasks} environment.
What this package doesn't provide is changing the background of questions or
-framing them. But this is easily possible using the \paket{mdframed} package
+framing them. But this is easily possible using the \paket{mdframed} package
and its \cmd*{surroundwithmdframed} command.
\subsection{The \code{exsheets-headings} Object}\label{sec:exsheets-headings}
\secidx{The `exsheets-headings' Object}
\ExSheets defines the object \code{exsheets-headings} and one template for it,
-the `default' template. The package also defines two instances of this template,
-the `block' instance and the `runin' instance.
+the `default' template. The package also defines two instances of this
+template, the `block' instance and the `runin' instance.
\begin{beispiel}
\SetupExSheets{headings=block}
@@ -1600,8 +1652,9 @@ the `block' instance and the `runin' instance.
\subsubsection{Available Options}
This section only lists the options that can be used when defining an instance
-of the `default' template. The following subsections will give loads of examples
-of their usage. The options are listed in the definition for the template interface:
+of the `default' template. The following subsections will give loads of
+examples of their usage. The options are listed in the definition for the
+template interface:
\begin{beispiel}[code only]
\DeclareTemplateInterface{exsheets-heading}{default}{3}
@@ -1632,21 +1685,23 @@ of their usage. The options are listed in the definition for the template interf
\end{beispiel}
-Each heading is built with at most four coffins available with the names `main',
-`title', `number' and `points'. Those coffins place possibly the whole heading,
-the title, the question number and the assigned points. The only coffin that's
-always typeset is the `main' coffin, which is empty per default.
+Each heading is built with at most four coffins available with the names
+`main', `title', `number' and `points'. Those coffins place possibly the
+whole heading, the title, the question number and the assigned points. The
+only coffin that's always typeset is the `main' coffin, which is empty per
+default.
-Coffins can be joined (two become one, the first extends its bounding box to contain
-the second) using the following syntax:
+Coffins can be joined (two become one, the first extends its bounding box to
+contain the second) using the following syntax:
\begin{beispiel}[code only]
join = coffin1[handle11,handle12]coffin2[handle21,handle22](x-offset,y-offset)
\end{beispiel}
The syntax for attaching (two become one, the first does \emph{not} extend its
bounding box around the second) is the same.
-More on coffin handles is described in the documentation for the \paket{xcoffins}.
-Figure~\ref{fig:handles} briefly demonstrates the available handle pairs.
+More on coffin handles is described in the documentation for the
+\paket{xcoffins}. Figure~\ref{fig:handles} briefly demonstrates the available
+handle pairs.
\begin{figure}[ht]
\centering
@@ -1659,9 +1714,9 @@ Figure~\ref{fig:handles} briefly demonstrates the available handle pairs.
\end{figure}
The following subsections will show all definitions of the instances available
-with the package option \key{load-headings} and how they look. This will hopefully
-give you enough ideas to create your own instance if you want to have another
-heading style than the ones available.
+with the package option \key{load-headings} and how they look. This will
+hopefully give you enough ideas to create your own instance if you want to
+have another heading style than the ones available.
Of you use the option \key{load-headings} each of the following instances is
available through the option \key{headings}{<instance>}.
@@ -1733,7 +1788,6 @@ The following examples use a sample text defined as follows:
A `simple' heading. \sample
\end{question}
-\newpage % FIXME: watch pagebreaks!
\subsubsection{The `empty' Instance}
\sinceversion{0.9a}
\begin{beispiel}[code only]
@@ -1900,7 +1954,6 @@ The following examples use a sample text defined as follows:
A `runin-wp-rev' heading. \sample
\end{question}
-\newpage % FIXME: watch pagebreaks!
\subsubsection{The `runin-nr' Instance}
\begin{beispiel}[code only]
\DeclareInstance{exsheets-heading}{runin-nr}{default}
@@ -2075,7 +2128,6 @@ Text before
A `margin' heading. \sample
\end{question}
-\newpage % FIXME: watch pagebreaks!
\subsubsection{The `margin-nr' Instance}
\begin{beispiel}[code only]
\DeclareInstance{exsheets-heading}{margin-nr}{default}
@@ -2174,654 +2226,25 @@ will be loaded \cmd*{AtBeginDocument}.
\part{The \Tasks package (\tasksversion)}\label{part:tasks}
\secidx{\Tasks}[tasks]
\section{About the Documentation}
-\noindent\sinceversion{0.9a}The \Tasks package got its own documentation --
-\url{tasks_en.pdf}. This effectively means that the following part won't be
-updated any more. Updates will go in the linked file instead.
-
-\section{Motivation}\secidx[Motivation]{\Tasks}[tasks]
-\noindent\changedversion{0.7}Originally \Tasks has been an integral part of
-\ExSheets. However, users told me that it indeed could be useful to have it as a
-standalone package not having to load the whole \ExSheets beast just for having
-the \code{tasks} environment available. Since I agree with this the environment
-has been extracted into a package if its own, \Tasks.
-
-The reason for the \code{tasks} environment is an unwritten agreement in German
-maths textbooks (in (junior) high school, especially) to organize exercises in
-columns counting horizontally rather than vertically. That is what \code{tasks}
-primarily is for. If you don't need this feature you're better off using traditional
-\LaTeX{} lists and the \paket{enumitem} package for customization.
-
-\section{Requirements}\secidx[Requirements]{\Tasks}[tasks]
-\Tasks requires packages \paket{l3kernel} ,\paket{xparse}, \paket{l3keys2e},
-\paket{epic}, \paket*{cntformats}\footnote{Part of the \ExSheets bundle, see
-part~\ref{part:cntformats}}, \paket{xtemplate} and \paket{environ}.
-
-\section{How it works}
-\subsection{The Basics}
-The \code{tasks} environment is similar to a list like \code{enumerate} but not
-the same:
-\begin{itemize}
- \item The first difference: there is no pagebreak possible inside an item but
- only between items.
- \item The second difference: the enumeration default is a), b), c) \ldots
- \item The third difference: there is a split at \emph{every} occurrence of the
- item separator. For this reason the default separator is not \cmd*{item} but
- \cmd{task} so it is unique to this environment only.
- \item The fourth difference: the \code{tasks} environment cannot be nested. You
- can, however, use an \code{itemize} environment or something in it.
- \item The fifth difference: verbatim material cannot be used in it. You'll
- have to use \cmd*{string}, \cmd*{texttt} or \cmd*{detokenize}. If this won't
- suffice then don't use \code{tasks}.
-\end{itemize}
-
-\begin{beschreibung}
- \Umg{tasks}[<options>]{\unskip\da{<num of columns>} \cmd{task}\ldots}
-\end{beschreibung}
-Let's see an example:
-\begin{beispiel}[code only]
- Some text before the list.
- \begin{tasks}
- \task \sample
- \task \sample
- \task \sample
- \end{tasks}
- And also some text after it.
-\end{beispiel}
-Some text before the list.
-\begin{tasks}
- \task \sample
- \task \sample
- \task \sample
-\end{tasks}
-And also some text after it.
-
-The environment takes the optional argument \da{<num of columns>} with which the
-number of columns used by the environment is specified.
-\begin{beispiel}[code only]
- \begin{tasks}(2)
- \task \sample
- \task \s\ \s
- \task \s
- \task \sample
- \task \s\par\s
- \end{tasks}
-\end{beispiel}
-\begin{tasks}(2)
- \task \sample
- \task \s\ \s
- \task \s
- \task \sample
- \task \s\par\s
-\end{tasks}
-
-\subsection{Introducing a New Row}
-\noindent\sinceversion{0.9}Sometimes it may come in handy if the current
-row of items could be terminated and a new one is started. This is possible
-with the following command:
-\begin{beschreibung}
- \Befehl{startnewitemline}
-\end{beschreibung}
-\begin{beispiel}[code only]
- \begin{tasks}(4)
- \task the first
- \task the second
- \task the third
- \task the fourth
- \task \rlap{the fifth item is way too long for this so we start a new row} \startnewitemline
- \task the sixth
- \task the seventh
- \task \rlap{the eighth item also is too long} \startnewitemline
- \task the nineth
- \task the tenth
- \end{tasks}
-\end{beispiel}
-\begin{tasks}(4)
- \task the first
- \task the second
- \task the third
- \task the fourth
- \task \rlap{the fifth item is way too long for this so we start a new row} \startnewitemline
- \task the sixth
- \task the seventh
- \task \rlap{the eighth item also is too long} \startnewitemline
- \task the nineth
- \task the tenth
-\end{tasks}
-
-\section{Available Options}\secidx[Options]{\Tasks}[tasks]\label{sec:tasks:options}
-The \Tasks package has one package option which also is called when you load
-\ExSheets with the \key{load-tasks} option.
-\begin{beschreibung}
- \Option{more}\newline
- load additional instances for the \code{tasks} object, details are explained
- later in section~\ref{sec:tasks:instances}.
-\end{beschreibung}
-
-The environment itself has some more options, namely these:
-\begin{beschreibung}
- \Option{style}{<instance>}\Default{}
- Choose the instance to be used. Read more on this in section~\ref{sec:tasks}.
- \Option{counter-format}{<counter specs>}\Default{}
- \sinceversion{0.9}Sets a custom label. The letters \code{tsk} are replaced
- with the task-counter. An optional argument directly following these letters
- specifies the counter format: \code{1}: \cmd{arabic}, \code{a}: \cmd{alph},
- \code{A}: \cmd{Alph}, \code{r}: \cmd{roman} and \code{R}: \cmd{Roman}.
- \Option{label-format}{<code>}\Default{}
- \changedversion{0.9}Can be used to apply a formatting like, \emph{e.g.},
- \cmd*{bfseries} to the labels.
- \Option{label}{<code>}\Default{}
- \changedversion{0.9}Overwrite the automatic label to a custom one.
- \Option{label-width}{<dim>}\Default{1em}
- Sets the width of the item labels.
- \Option{label-offset}{<dim>}\Default{.3333em}
- \sinceversion{0.7}Sets the offset, \emph{i.e.}, the distance between label and item.
- \Option{item-indent}\Default{2.5em}
- \sinceversion{0.9a}The indent of an item, \textit{i.e.}, the horizontal space
- available for both label and label-offset. If \code{indent = label-width + label=offset}
- the label will align with the textblock above (if \key{label-align}{left} is
- set).
- \Option{label-align}{left|right|center}\Default{left}
- \sinceversion{0.7}Determines how the labels are aligned within the label-box
- whose width is set with \key{label-width}
- \Option{before-skip}{<skip>}\Default{0pt}
- Sets the skip before the list.
- \Option{after-skip}{<skip>}\Default{0pt}
- Sets the skip after the list.
- \Option{after-item-skip}{<skip>}\Default{1ex plus 1ex minus 1ex}
- \sinceversion{0.9}This vertical skip is inserted between rows of items.
- \Option{resume}{\default{true}|false}\Default{false}
- The enumeration will resume from a previous \code{tasks} environment. In order
- to use this option properly you shouldn't mix different \code{tasks} environments
- that both count their items.
-\end{beschreibung}
-These options can also be set using a setup command:
-\begin{beschreibung}
- \Befehl{settasks}{<options>}
-\end{beschreibung}
-
-Now the same list as above but with three columns and a different label:
-\begin{beispiel}[code only]
- \begin{tasks}[counter-format=(tsk[r]),label-width=4ex](3)
- \task \sample
- \task \s\ \s
- \task \s
- \task \sample
- \task \s\par\s
- \end{tasks}
-\end{beispiel}
-\begin{tasks}[counter-format=(tsk[r]),label-width=4ex](3)
- \task \sample
- \task \s\ \s
- \task \s
- \task \sample
- \task \s\par\s
-\end{tasks}
-
-Let's use it inside a question:
-\begin{beispiel}
- % since settings are local the following ones will be lost
- % outside this example; see the appendix how the solution
- % appears there
- \settasks{counter-format=qu.tsk,label-width=5ex}
- \begin{question}[type=exam]{4}
- I have these two tasks for you. Shall we begin?
- \begin{tasks}(2)
- \task The first task: easy!
- \task The second task: even more so!
- \end{tasks}
- \end{question}
- \begin{solution}[print]
- Now, let's see\ldots\ ah, yes:
- \begin{tasks}
- \task This is the first solution. Told you it was easy.
- \task This is the second solution. And of course you knew that!
- \end{tasks}
- \end{solution}
-\end{beispiel}
-
-\section{Available Instances}\label{sec:tasks:instances}
-When you use the package option \key{more} of the \Tasks package or load \ExSheets
-with the \key{load-tasks} option there are currently three additional instances
-for the \code{tasks} object available:
-\begin{description}
- \item[itemize] uses \cmd{labelitemi} as labels.
- \item[enumerate] enumerates the items with 1., 2., \ldots
- \item[multiplechoice] a --~well~-- `multiple choice' list.
-\end{description}
-\begin{beispiel}
- \begin{tasks}[style=itemize](2)
- \task that's just how\ldots
- \task \ldots we expected
- \end{tasks}
- \begin{tasks}[style=enumerate](2)
- \task that's just how\ldots
- \task \ldots we expected
- \end{tasks}
- \begin{tasks}[style=multiplechoice](2)
- \task that's just how\ldots
- \task \ldots we expected
- \end{tasks}
-\end{beispiel}
-
-\section{Custom Labels}\secidx[Custom Labels]{\Tasks}[tasks]
-If you want to change a single label inside a list, you can use the optional
-argument of \cmd{task}. This will temporarily overwrite the default label.
-\begin{beispiel}
- \begin{tasks}[style=itemize]
- \task a standard item
- \task another one
- \task[+] a different one
- \task and another one
- \end{tasks}
-\end{beispiel}
-
-\section{New Tasks}\secidx[Own Environments]{\Tasks}[tasks]
-It is possible to add custom environments that work like the \code{tasks} environment.
-\begin{beschreibung}
- \Befehl{NewTasks}[<options>]{<name>}\oa{<separator}\da{<cols>}\newline
- Define environment \ma{<name>} that uses \code{<separator>} to introduce a
- new item. Default for \code{<separator>} is \cmd{task}, default for
- \code{<cols>} is \code{1}. The \code{<options>} are the ones described in
- section~\ref{sec:tasks:options}.
- \Befehl{RenewTasks}[<options>]{<name>}\oa{<separator}\da{<cols>}\newline
- Renew environment previously defined with \cmd{NewTasks}.
-\end{beschreibung}
-The \code{tasks} environment is defined as follows:
-\begin{beispiel}[code only]
- \NewTasks{tasks}
-\end{beispiel}
-
-The separator does not have to be a control sequence:
-\begin{beispiel}
- % preamble:
- % \usepackage{dingbat}
- \NewTasks[label=\footnotesize\leftthumbsup,label-width=1.3em]{done}[*]
- \begin{done}
- * First task
- * Second Task
- \end{done}
-\end{beispiel}
-Although this might seem handy or even nice I strongly advice against using
-something different than a command sequence. Remember that the items will be
-split at \emph{every} occurrence of the separator. So in order to use the
-separator (here for example for a starred variant of a command) within an item
-it has to be hidden in braces. This is avoided of you use a command sequence
-which even doesn't have to be defined.
-
-Let's say you want a \code{choices} environment that has three columns in its
-default state. You could do something like this:
-\begin{beispiel}
- % preamble:
- % \NewTasks[style=multiplechoice]{choices}[\choice](3)
- % \newcommand*\correct{\PrintSolutionsTF{\checkedchoicebox}{\choicebox}}
- \begin{question}
- \begin{choices}
- \choice First choice
- \choice Second choice
- \choice[\correct] Third choice
- \end{choices}
- \end{question}
- \begin{solution}[print]
- \begin{choices}
- \choice First choice
- \choice Second choice
- \choice[\correct] Third choice
- \end{choices}
- \end{solution}
-\end{beispiel}
-
-The last example shows you two additional commands:
-\begin{beschreibung}
- \Befehl{choicebox} \choicebox
- \Befehl{checkedchoicebox} \checkedchoicebox
-\end{beschreibung}
-
-\section{Styling \Tasks}
-Equivalent to the styling of \ExSheets{} \Tasks uses \paket{xtemplate} to
-declare additional instances for the lists.
-
-\subsection{The \code{tasks} Object}\label{sec:tasks}\secidx{The `tasks' Object}
-The object that's defined by \Tasks is the `tasks' object.
-This time there are four instances available for the one template (again
-`default') that was defined.
-
-\subsubsection{Available Options}
-This section only lists the options that can be used when defining an instance
-of the `default' template. The following subsections will give some examples
-of their usage.
-
-\begin{beispiel}[code only]
- \DeclareTemplateInterface{tasks}{default}{3}
- {
- % option : type = default
- enumerate : boolean = true ,
- label : tokenlist ,
- indent : length = 2.5em ,
- counter-format : tokenlist = tsk[a]) ,
- label-format : tokenlist ,
- label-width : length = 1em ,
- label-offset : length = .3333em ,
- after-item-skip : skip = 1ex plus 1ex minus 1ex
- }
-\end{beispiel}
-
-\subsubsection{Predefined Instances}
-This is rather brief this time:
-\begin{beispiel}[code only]
- % ALPHABETIZE: a) b) c)
- \DeclareInstance{tasks}{alphabetize}{default}{}
- % available when `load-tasks=true':
- % ITEMIZE:
- \DeclareInstance{tasks}{itemize}{default}
- {
- enumerate = false ,
- label-width = 1.125em
- }
- % ENUMERATE:
- \DeclareInstance{tasks}{enumerate}{default}
- { counter-format = tsk. }
- % MULTIPLECHOICE:
- \DeclareInstance{tasks}{multiplechoice}{default}
- {
- enumerate = false ,
- label = \choicebox ,
- }
-\end{beispiel}
-\secidx*{The `tasks' Object}
-\secidx*{\Tasks}[tasks]
+\noindent\sinceversion{0.9a}The \Tasks package has got its own documentation --
+\url{tasks_en.pdf}. Please read that file for details on the package.
\part{The \translations package (\trnsltversion)}
\label{part:translations}\secidx{\translations}[translations]
\section{About the Documentation}
-\noindent\sinceversion{0.9a}The \translations package got its own documentation --
-\url{translations_en.pdf}. This effectively means that the following part won't be
-updated any more. Updates will go in the linked file instead.
-
-\section{Motivation}\secidx[Motivation]{\translations}[translations]
-I wrote this package when I was in need for an expandable version of
-\paket*{translator}'s \cmd{translate}. If you don't need that then there is no
-need whatsoever for this package as \paket*{translator} from the \paket{beamer}
-bundle provides all the functionality \translations does (except for:
-\paket{translator}'s \cmd{translate} isn't expandable, \cmd{GetTranslation} is.).
-
-\section{Requirements}\secidx[Requirements]{\translations}[translations]
-\translations requires the \paket{etoolbox} package.
-
-\section{Usage}\secidx[Usage]{\translations}[translations]
-These are the commands provided by \translations:
-\begin{beschreibung}
- \Befehl{DeclareLanguage}{<lang>}\newline
- Declare a language that can be used by \translations. If the language already
- exists it will be silently redefined. This command can only be used in the preamble.
- \Befehl{DeclareLanguageAlias}{<lang2>}\ma{<lang1>}\newline
- Declares \code{<lang2>} to be an alias of \code{<lang1>}. If \code{<lang1>}
- doesn't exist yet a warning will be raised and it will be defined. This command
- can only be used in the preamble.
- \Befehl{DeclareLanguageDialect}{<dialect>}\ma{<lang>}\newline
- Declares \code{<dialect>} to be a dialect of language \code{<lang>}. If a
- translation for \code{<dialect>} is provided it is used by the translation
- macros. If there is none the corresponding translation for \code{<lang>} is
- used instead.
- \Befehl{NewTranslation}{<lang>}\ma{<key>}\ma{<translation>}\newline
- Defines a translation of key \code{<key>} for the language \code{<lang>}.
- An error will be raised if a translation of \code{<key>} already exists.
- This command can only be used in the preamble.
- \Befehl{RenewTranslation}{<lang>}\ma{<key>}\ma{<translation>}\newline
- Redefines a translation of key \code{<key>} for the language \code{<lang>}.
- An error will be raised if no translation of \code{<key>} exists.
- This command can only be used in the preamble.
- \Befehl{DeclareTranslation}{<lang>}\ma{<key>}\ma{<translation>}\newline
- Defines a translation of key \code{<key>} for the language \code{<lang>}.
- No error will be raised if a translation of \code{<key>} already exists.
- This command can only be used in the preamble.
- \Befehl{DeclareTranslationFallback}{<key>}\ma{<fallback>}\newline
- Defines a fallback translation for key \code{<key>} that is used in case no
- translation of \code{<key>} for the currently active language has been provided.
- No error will be raised if a fallback for \code{<key>} already exists.
- This command can only be used in the preamble.
- \expandable\Befehl{GetTranslationFor}{<lang>}\ma{<key>}\newline
- Fetches and prints the translation of \code{<key>} for the language \code{<lang>}.
- This command is expandable.
- \expandable\Befehl{GetTranslation}{<key>}\newline
- Fetches and prints the translation of \code{<key>} for the currently active
- language (as for example set by \paket{babel}). This command is expandable.
- \Befehl{SaveTranslationFor}{<cmd>}\ma{<lang>}\ma{<key>}\newline
- Fetches and saves the translation of \code{<key>} for the language \code{<lang>}
- in the macro \code{<cmd>}.
- \Befehl{SaveTranslation}{<cmd>}\ma{<key>}\newline
- Fetches and saves the translation of \code{<key>} for the currently active
- language (as for example set by \paket{babel}) in the macro \code{<cmd>}.
- \Befehl{LoadDictionary}{<name>}\newline
- Loads a file named \code{<name>-<lang>.trsl} where \code{<lang>} corresponds
- to the lowercase name of the current language as defined with
- \cmd{DeclareLanguage}. This file should contain the translations for the
- specified language.
- \Befehl{LoadDictionaryFor}{<lang>}\ma{<name>}\newline
- Loads a file named \code{<name>-<lang>.trsl}.
-\Befehl{DeclareDictTranslation}{<key>}\ma{<translation>}\newline
- This command is to be used in a dictionary file and picks up the language
- of that file.
-\end{beschreibung}
-Quite a number of languages already are defined, either directly or via an alias.
-So, before you define a language you should take a look in \code{translations.sty}
-if the language doesn't already exist.
-
-Here is a small example of usage:
-\begin{beispiel}
- % in the preamble:
- % \DeclareTranslation{English}{Kueche}{kitchen}
- % \DeclareTranslation{German}{Kueche}{K\"uche}
- % \DeclareTranslation{Spanish}{Kueche}{cocina}
- % \DeclareTranslation{French}{Kueche}{cuisine}
-
- \GetTranslation{Kueche}
- \SaveTranslation\kitchen{Kueche}
- \SaveTranslationFor\cuisine{french}{Kueche}
-
- \selectlanguage{ngerman}
- \GetTranslation{Kueche} \kitchen\ \GetTranslationFor{spanish}{Kueche}
- \cuisine
-\end{beispiel}
-
-There is also preliminary support for dialects:
-\begin{beispiel}
- % in the preamble:
- % \DeclareTranslation{English}{foo}{foo}
- % \DeclareTranslation{British}{foo}{bar}
- \GetTranslationFor{English}{foo} \\
- \GetTranslationFor{British}{foo} \\
- \GetTranslationFor{American}{foo}
-\end{beispiel}
-
-
-A typical dictionary file should look as follows:
-\begin{beispiel}[code only]
- % this is file housing-german.trsl
- \ProvideDictionaryFor{German}{housing}[<version info>]
- \DeclareDictTranslation{kitchen (housing)}{K\"uche}
- \DeclareDictTranslation{bathroom (housing)}{Bad}
- \DeclareDictTranslation{living room (housing)}{Wohnzimmer}
- \DeclareDictTranslation{bedroom (housing)}{Schlafzimmer}
- ...
- \endinput
-\end{beispiel}
-\secidx*{\translations}[translations]
+\noindent\sinceversion{0.9a}The \translations package has got its own documentation --
+\url{translations_en.pdf}. Please read that file for details on the package.
\part{The \cntformats package (\cntfmtsversion)}
\label{part:cntformats}\secidx{\cntformats}[cntformats]
\section{About the Documentation}
-\noindent\sinceversion{0.5}The \cntformats{} package got its own documentation --
-\url{cntformats_en.pdf}. This effectively means that the following part won't be
-updated any more. Updates will go in the linked file instead.
-
-\section{Motivation}\secidx[Motivation]{\cntformats}[cntformats]
-\cntformats provides a way to format counters with what I will call patterns.
-This does not in any way effect the usual \LaTeXe\ way of treating counters and
-does not use \cmd*{the<counter>} nor is it affected by the redefinition of them.
-
-This package is aimed at package or class authors and probably not very useful
-for document authors.
-
-\section{Requirements}\secidx[Requirements]{\cntformats}[cntformats]
-\cntformats requires the \paket{etoolbox} package.
-
-\section{Example}\secidx[Example]{\cntformats}[cntformats]
-A use case typically looks as follows:
-\begin{beispiel}
- \ReadCounterPattern{se.sse}
-\end{beispiel}
-where the key \code{se} stands for the current value of the \code{section} counter
-and \code{sse} for \code{subsection}, respectively. \code{se.sse} is an example
-for what will be called \emph{pattern}. The keys for the counters can have optional
-arguments that specify the format:
-\begin{beispiel}
- \stepcounter{subsection}
- \ReadCounterPattern{se[R](sse[a])}
-\end{beispiel}
-\code{R} stands for \cmd{Roman} and \code{a} for \cmd{alph}. A complete list can
-be found in table~\ref{tab:predefined:formats} on page~\pageref{tab:predefined:formats}.
-As you can see you can insert arbitrary other tokens in a pattern that won't be
-changed.
-
-\section{Usage}\secidx[Usage]{\cntformats}[cntformats]
-In order to make counters known to \cntformats the following commands are used:
-\begin{beschreibung}
- \Befehl{AddCounterPattern}*[<module>]{<counter>}\ma{<pattern>}\newline
- This command will make the (existing) counter \code{<counter>} known to
- \cntformats and assign the pattern \code{<pattern>} to it.
- \Befehl{NewCounterPattern}*[<module>]{<counter>}\ma{<pattern>}\newline
- This command will create a new counter \code{<counter>}, make it known to
- \cntformats and assign the pattern \code{<pattern>} to it.
- \Befehl{ReadCounterFrom}[<module>]{<counter>}\ma{<internal cmd>}\newline
- If you use one of the commands above with the starred version the number for
- the pattern is not automatically fetched from the internal \cmd*{c@<counter>}.
- This can now be assigned with \cmd{ReadCounterFrom} where \code{<internal cmd>}
- is the macro that holds the number.
-\end{beschreibung}
-The commands above can only be used in the document preamble.
-
-After the creation of these pattern markers one wants to be able to use them.
-There are a number of macros that allow different aspects of usage.
-\begin{beschreibung}
- \Befehl{ReadCounterPattern}[<module>]{<pattern>}\newline
- Reads, interprets and prints a pattern.
- \expandable\Befehl{@cntfmts@parsed@pattern}\newline
- After \cmd{ReadCounterPattern} has been used the current pattern interpretation
- is stored in this macro. The \emph{interpretation} is \emph{not} what is printed.
- See the examples below for details.
- \Befehl{ReadCounterPatternFrom}[<module>]{<macro that holds pattern>}\newline
- Reads, interprets and prints a pattern that's stored in a macro.\\
- Otherwise the same as \cmd{ReadCounterPattern}.
- \Befehl{SaveCounterPattern}{<cmd a>}\ma{<cmd b>}\ma{<pattern>}\newline
- Saves the \code{<pattern>} in \code{<cmd a>} and the interpreted pattern in
- \code{<cmd b>}.
- \Befehl{eSaveCounterPattern}[<module>]{<cmd a>}\ma{<cmd b>}\ma{<pattern>}\newline
- Saves the \code{<pattern>} in \code{<cmd a>} and the expanded pattern in
- \code{<cmd b>}.
- \Befehl{SaveCounterPatternFrom}[<module>]{<cmd a>}\ma{<cmd b>}\ma{<macro that
- holds pattern>}\newline
- Like \cmd{SaveCounterPattern} but reads the pattern from a macro.
- \Befehl{eSaveCounterPatternFrom}[<module>]{<cmd a>}\ma{<cmd b>}\ma{<macro that
- holds pattern>}\newline
- Like \cmd{eSaveCounterPattern} but reads the pattern from a macro.
-\end{beschreibung}
-
-The optional argument \code{<module>} should be specific for a package, say, so
-that different patterns for the \code{section} for example don't interfer with
-each other. If you leave the argument the default module \code{cntfmts} is used.
-
-The \ExSheets packages uses the commands with the module \code{exsheets}.
-You can find the following lines in \ExSheets' code:
-\begin{beispiel}[code only]
- \AddCounterPattern*[exsheets]{section}{se}
- \ReadCounterFrom[exsheets]{section}
- \l__exsheets_counter_sec_int
-
- \NewCounterPattern*[exsheets]{question}{qu}
- \ReadCounterFrom[exsheets]{question}
- \l__exsheets_counter_qu_int
-\end{beispiel}
-
-Now let's see a short example that hopefully explains what the macros do:
-\begin{beispiel}
- % preamble
- % \NewCounterPattern{testa}{ta}
- \setcounter{testa}{11}
- \ReadCounterPattern{ta}
- \ReadCounterPattern{ta[a]} \\
- \ttfamily\makeatletter
- \meaning\@cntfmts@parsed@pattern
-
- \bigskip
- \SaveCounterPattern\tmpa\tmpb{ta[a]}
- \meaning\tmpa \\
- \meaning\tmpb
-
- \bigskip
- \eSaveCounterPattern\tmpa\tmpb{ta[a]}
- \meaning\tmpa \\
- \meaning\tmpb
-\end{beispiel}
-You can see that somehow additional (empty) groups and a \cmd*{relax} found their
-way into the interpreted and thus the expanded pattern. This is due to the fact
-that reading optional arguments expandably isn't easy and must have some safety
-net.
-
-\section{Predefined Patterns and Formats}\secidx[Predefined Patterns]{\cntformats}[cntformats]
-\cntformats predefines a number of pattern keys. These are listed in
-table~\ref{tab:predefined:patterns}.
-
-\begin{multicols}{2}
-\begin{center}
- \centering
- \captionof{table}{Predefined Patterns for the module \code{cntfmts}.}\label{tab:predefined:patterns}
- \begin{tabular}{>{\ttfamily}l>{\ttfamily}l}
- \toprule
- \normalfont\bfseries counter & \normalfont\bfseries pattern \\
- \midrule
- chapter & ch \\
- section & se \\
- subsection & sse \\
- subsubsection & ssse \\
- paragraph & pg \\
- \bottomrule
- \end{tabular}
-
- \captionof{table}{Predefined Formats}\label{tab:predefined:formats}
- \begin{tabular}{>{\ttfamily}ll}
- \toprule
- \normalfont\bfseries key & \normalfont\bfseries format \\
- \midrule
- 1 & \cmd{arabic} \\
- a & \cmd{alph} \\
- A & \cmd{Alph} \\
- r & \cmd{roman} \\
- R & \cmd{Roman} \\
- \bottomrule
- \end{tabular}
-\end{center}
-\end{multicols}
-
-Table~\ref{tab:predefined:formats} lists the predefined formats. If you want you
-can add own formats.
-\begin{beschreibung}
- \Befehl{NewPatternFormat}{<pattern>}\ma{<format>}\newline
- \code{<format>} is a number presentation command like \cmd{@alph}. This
- command can only be used in the preamble.
-\end{beschreibung}
-
-\begin{beispiel}
- % preamble
- % \usepackage{alphalph}
- % \NewPatternFormat{aa}{\alphalph}
- \ReadCounterPattern{se[aa]}
-\end{beispiel}
-\secidx*{\cntformats}[cntformats]
+\noindent\sinceversion{0.5}The \cntformats{} package has got its own documentation --
+\url{cntformats_en.pdf}. Please read that file for details on the package.
\appendix
\part{Appendix}
\addsec{A List of all Solutions used in this Manual}\label{sec:solutions:list}
-\SetupExSheets{headings=block,solutions-totoc}
+\SetupExSheets{headings=block-wp,solutions-totoc}
\printsolutions
\RaggedRight\printbibliography
@@ -2830,4 +2253,4 @@ can add own formats.
serif}, commands \code{\textbackslash\textcolor{code}{brown}}, options \textcolor
{key}{\code{yellow}} and modules \textcolor{module}{\code{blue}}.}
\printindex
-\end{document} \ No newline at end of file
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/exsheets/translations_en.pdf b/Master/texmf-dist/doc/latex/exsheets/translations_en.pdf
index 8252b58e4de..a22816860e0 100644
--- a/Master/texmf-dist/doc/latex/exsheets/translations_en.pdf
+++ b/Master/texmf-dist/doc/latex/exsheets/translations_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/exsheets/translations_en.tex b/Master/texmf-dist/doc/latex/exsheets/translations_en.tex
index 81dd771c158..5d7f0feaf46 100644
--- a/Master/texmf-dist/doc/latex/exsheets/translations_en.tex
+++ b/Master/texmf-dist/doc/latex/exsheets/translations_en.tex
@@ -131,8 +131,8 @@
\DeclareTranslation{German}{Kueche}{K\"uche}
\DeclareTranslation{Spanish}{Kueche}{cocina}
\DeclareTranslation{French}{Kueche}{cuisine}
-\DeclareTranslation{English}{foo}{foo}
-\DeclareTranslation{British}{foo}{bar}
+\DeclareTranslation{English}{farbe}{color}
+\DeclareTranslation{British}{farbe}{colour}
% ----------------------------------------------------------------------------
% custom commands
@@ -187,12 +187,17 @@
\begin{document}
\section{Motivation}\secidx{Motivation}
-I wrote this package when I was in need for an expandable version of
-\paket*{translator}'s \cmd{translate}. If you don't need that then there is
-very likely no need whatsoever for this package as \paket*{translator} from the
-\paket{beamer} bundle provides very similar functionality \translations does
-(except for: \paket{translator}'s \cmd{translate} isn't expandable,
-\cmd{GetTranslation} is.).
+This package provides means for package authors to have an easy interface for
+internationalization of their packages. The functionality of this package is
+in many parts also covered by the package \paket*{translator} (part of the
+\paket{beamer} bundle). Internationalization is also possible with
+\paket{babel} and it's \cmd*{addto}\cmd{captions<language>} mechanism or
+\KOMAScript's \cmd{providecaptionname}. However, I believe that \translations
+is more flexible than all of these. Unlike \paket*{translator} it detects the
+used (\paket{babel} or \paket{polyglossia}) language itself and provides
+expandable retrieving of the translated key. \translations also provides
+support for language dialects which means package authors can distinguish
+between British, Australian, Canadian and US English, say.
\secidx*{Motivation}
\section{License and Requirements}\label{sec:license}\secidx{Requirements}
@@ -261,11 +266,14 @@ means that the command is expandable, \unexpsign{} means that it isn't.
of that file, see section~\ref{sec:dictionaries} for an example.
\end{beschreibung}
Quite a number of languages already are defined, either directly or via an alias.
-So, before you define a language you should take a look in \code{translations.sty}
-if the language doesn't already exist.
+So, before you define a language you should take a look at
+section~\ref{sec:languages} if the language doesn't already exist.
\subsection{A Small Example}
-Here is a small example of usage:
+This section demonstrates with two short examples how the macros are used.
+The first example covers the basics: dlaring of translations and then
+retrieving and typesetting them.
+
\begin{beispiel}
% in the preamble:
% \DeclareTranslation{English}{Kueche}{kitchen}
@@ -282,18 +290,21 @@ Here is a small example of usage:
\cuisine
\end{beispiel}
-There is also support for dialects:
+The next example demonstrates the use of dialects and how they fall back to
+the translation for the main language if no extra translation was declared:
+
\begin{beispiel}
% in the preamble:
- % \DeclareTranslation{English}{foo}{foo}
- % \DeclareTranslation{British}{foo}{bar}
- \GetTranslationFor{English}{foo} \\
- \GetTranslationFor{British}{foo} \\
- \GetTranslationFor{American}{foo}
+ % \DeclareTranslation{English}{farbe}{color}
+ % \DeclareTranslation{British}{farbe}{colour}
+
+ \GetTranslationFor{English}{farbe} \\
+ \GetTranslationFor{British}{farbe} \\
+ \GetTranslationFor{American}{farbe}
\end{beispiel}
\subsection{Usage in Packages}
-In package a typical usage in a package would look as follows:
+A typical usage in a package would look as follows:
\begin{beispiel}[code only]
\RequirePackage{translations}
\DeclareTranslationFallback{mypackage-title}{Nice Title}
@@ -304,6 +315,11 @@ In package a typical usage in a package would look as follows:
\def\mypackage@title{\GetTranslation{mypackage-title}}
\end{beispiel}
+That is, a package defines some unique key for an expression and at least
+defines a fallback translation. Additionally translations for as many
+languages as the author wants are defined. A user then may add
+\cmd{DeclareTranslation}\ma{<language>}\ma{<translation>} if they find their
+translation missing.
\subsection{Dictionaries}\label{sec:dictionaries}
A typical dictionary file should look as follows:
@@ -318,9 +334,52 @@ A typical dictionary file should look as follows:
\endinput
\end{beispiel}
+The usage is similar to the one in a package: unique keys are given
+translations, this time for the language the dictionary file is declared for
+only.
+
\secidx*{Usage}
-\section{Implementation}
+\section{Defined Languages}\label{sec:languages}\secidx{Languages}
+\translations currently has these languages defined, ``fallback'' being a
+dummy language used for fallback translations:
+
+\begin{quote}
+ \makeatletter\raggedright
+ \def\comma{\gdef\comma{,\quad}}%
+ \def\do#1{\comma #1}%
+ \dolistloop\@trnslt@languages
+\end{quote}
+
+To every one of these languages at least one alias exists, the uppercase
+variant. This is due to the fact that it is common to write language names
+uppercased. The defined aliases are these (in parentheses the base language
+name is given):
+
+\begin{quote}
+ \makeatletter\raggedright
+ \def\comma{\gdef\comma{,\quad}}
+ \def\aliases#1#2{\comma #1 (#2)}
+ \def\do#1{\aliases#1}
+ \dolistloop\@trnslt@aliases@pair
+\end{quote}
+
+\translations also defines a few dialects. The language to which the dialect
+belongs to is given in paretheses:
+
+\begin{quote}
+ \makeatletter\raggedright
+ \def\comma{\gdef\comma{,\quad}}
+ \def\aliases#1#2{\comma #1 (#2)}
+ \def\do#1{\aliases#1}
+ \dolistloop\@trnslt@dialects@pair
+\end{quote}
+\secidx*{Languages}
+
+These languages should cover all languages which are currently covered by
+\paket{babel} and \paket{polyglossia}.
+
+\section{Implementation}\index{Implementation@\textbf{Implementation}}
In the following code the lines 1--30 have been omitted. They only repeat the
license statement which has already been mentioned in section~\ref{sec:license}.
@@ -332,4 +391,4 @@ license statement which has already been mentioned in section~\ref{sec:license}.
\printindex
-\end{document} \ No newline at end of file
+\end{document}
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty
index 32234196478..9d899f2d815 100644
--- a/Master/texmf-dist/tex/latex/exsheets/exsheets.sty
+++ b/Master/texmf-dist/tex/latex/exsheets/exsheets.sty
@@ -31,8 +31,8 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% ----------------------------------------------------------------------------
-\def\exsheets@date{2013/05/26}
-\def\exsheets@version{0.9f}
+\def\exsheets@date{2013/06/28}
+\def\exsheets@version{0.9h}
\RequirePackage { expl3 , xparse }
\ProvidesExplPackage
@@ -1015,7 +1015,7 @@
\bool_if:NT \l__exsheets_auto_label_bool
{
\exp_args:Nx \label { qu : \g__exsheets_questions_current_id_tl }
- \exp_args:Nx \SetQuestionProperties
+ \exsheets_set_question_properties:x
{
ref = \exp_not:N \ref { qu : \g__exsheets_questions_current_id_tl } ,
pageref = \exp_not:N \pageref { qu : \g__exsheets_questions_current_id_tl }
@@ -1024,7 +1024,7 @@
}
{
\exp_args:Nx \label { \l__exsheets_questions_label_tl }
- \exp_args:Nx \SetQuestionProperties
+ \exsheets_set_question_properties:x
{
ref = \exp_not:N \ref { \l__exsheets_questions_label_tl } ,
pageref = \exp_not:N \pageref { \l__exsheets_questions_label_tl }
@@ -1067,7 +1067,7 @@
\fp_set_eq:NN
\l__exsheets_question_points_fp
\l__exsheets_points_default_fp
- \exp_args:Nx \SetQuestionProperties
+ \exsheets_set_question_properties:x
{ points = \fp_to_tl:N \l__exsheets_points_default_fp }
}
}
@@ -1076,7 +1076,7 @@
\g__exsheets_this_question_points_fp
\l__exsheets_question_points_fp
\__exsheets_read_points:n { #2 }
- \SetQuestionProperties{points=#2}
+ \exsheets_set_question_properties:n { points = #2 }
}
\tl_if_blank:VT \l__exsheets_question_heading_instance_tl
{
@@ -1164,7 +1164,7 @@
{
\fp_compare:nT { \g__exsheets_this_question_points_fp > 0 }
{
- \exp_args:Nx \SetQuestionProperties
+ \exsheets_set_question_properties:x
{ points = \fp_to_tl:N \g__exsheets_this_question_points_fp }
}
}
@@ -1179,7 +1179,9 @@
\cs_new_protected:Npn \__exsheets_save_number_in_aux_x:Nnn #1#2#3
{
\prop_gput:Nfx #1 { #2 } { #3 }
- \iow_now:Nx \@auxout { \exsheets@save@number { #2 } { #3 } }
+ \if@filesw
+ \iow_now:Nx \@auxout { \exsheets@save@number { #2 } { #3 } }
+ \fi
}
\cs_new_protected:Npn \__exsheets_save_number_in:N #1
@@ -1335,6 +1337,7 @@
}
\@esphack
}
+\cs_generate_variant:Nn \exsheets_set_question_properties:n { x }
\NewDocumentCommand \SetQuestionProperties { m }
{ \exsheets_set_question_properties:n { #1 } }
@@ -1882,20 +1885,22 @@
\cs_new_protected:Npn \__exsheets_exlabel:n #1
{
\@bsphack
- \iow_now:Nx \@auxout
- {
- \token_to_str:N \newlabel { exse:#1 }
- { { \arabic { section } } { \thepage } }
- }
- \cs_if_exist:NT \thechapter
- {
- \iow_now:Nx \@auxout
- {
- \token_to_str:N \newlabel { exch:#1 }
- { { \arabic { chapter } } { \thepage } }
- }
- }
- \@esphack
+ \if@filesw
+ \iow_now:Nx \@auxout
+ {
+ \token_to_str:N \newlabel { exse:#1 }
+ { { \arabic { section } } { \thepage } }
+ }
+ \cs_if_exist:NT \thechapter
+ {
+ \iow_now:Nx \@auxout
+ {
+ \token_to_str:N \newlabel { exch:#1 }
+ { { \arabic { chapter } } { \thepage } }
+ }
+ }
+ \@esphack
+ \fi
}
% user command:
@@ -2547,13 +2552,15 @@
% save total points in .aux file to make it available for \allpoints anywhere
\AtEndDocument
{
- \iow_now:Nx \@auxout
- {
- \exp_not:N \exsheets@sum@of@points
- { \fp_eval:n { \g__exsheets_points_sum_fp } }^^J
- \exp_not:N \exsheets@sum@of@bonus
- { \fp_eval:n { \g__exsheets_bonus_sum_fp } }
- }
+ \if@filesw
+ \iow_now:Nx \@auxout
+ {
+ \exp_not:N \exsheets@sum@of@points
+ { \fp_eval:n { \g__exsheets_points_sum_fp } }^^J
+ \exp_not:N \exsheets@sum@of@bonus
+ { \fp_eval:n { \g__exsheets_bonus_sum_fp } }
+ }
+ \fi
}
% ----------------------------------------------------------------------------
@@ -2690,6 +2697,8 @@ HISTORY:
option is enabled and questions/solutions are at the
top of a new page because there wasn't enough place
left at the page before
+2013/05/30 v0.9g - obey \if@filesw
+2013/06/28 v0.9h - cleaner internal use of \exsheets_set_question_properties:n
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TODO:
diff --git a/Master/texmf-dist/tex/latex/exsheets/translations.sty b/Master/texmf-dist/tex/latex/exsheets/translations.sty
index 1f46c1ca8ce..9f751632426 100644
--- a/Master/texmf-dist/tex/latex/exsheets/translations.sty
+++ b/Master/texmf-dist/tex/latex/exsheets/translations.sty
@@ -28,8 +28,8 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-\def\@trnslt@date{2013/04/08}
-\def\@trnslt@version{v0.9a}
+\def\@trnslt@date{2013/06/28}
+\def\@trnslt@version{v0.10}
\ProvidesPackage{translations}[\@trnslt@date\space \@trnslt@version\space a simple translator]
\RequirePackage{etoolbox}
@@ -37,7 +37,7 @@
% --------------------------------------------------------------------------
% message handling
\def\@trnslt@error@message{%
- For details have a look at the `exsheets' manual.}
+ For details have a look at the `translations' manual.}
\def\@trnslt@create@message#1{%
\ifstrequal{#1}{Error}
@@ -80,6 +80,14 @@
{\long\def\bbl@afterfi#1\fi{\fi#1}}
}
+% book keeping: the following macros will be used as `etoolbox' lists that
+% keep record of defined languages, dialects and aliases
+\def\@trnslt@languages{}
+\def\@trnslt@aliases@pair{}
+\def\@trnslt@aliases@single{}
+\def\@trnslt@dialects@pair{}
+\def\@trnslt@dialects@single{}
+
% --------------------------------------------------------------------------
% \DeclareLanguage and \DeclareLanguageAlias
% #1: language
@@ -88,51 +96,102 @@
\@onlypreamble\DeclareLanguage
\def\@trnslt@declare@language#1{%
- \csdef{@trnslt@language@#1}{#1}}
+ \@trnslt@if@language{#1}
+ {}{%
+ \csdef{@trnslt@language@#1}{#1}%
+ \listeadd\@trnslt@languages{#1}%
+ }%
+}
-% #1: alias
+\def\@trnslt@language#1{%
+ \csuse{@trnslt@language@#1}}
+
+\def\@trnslt@if@language#1{%
+ \ifcsundef{@trnslt@language@#1}
+ {\expandafter\@secondoftwo}
+ {\expandafter\@firstoftwo}%
+}
+
+% #1: dialect
% #2: language
-\newrobustcmd*\DeclareLanguageAlias[2]{%
- \@trnslt@declare@languagealias{#1}{#2}}
-\@onlypreamble\DeclareLanguageAlias
+\newrobustcmd*\DeclareLanguageDialect[2]{%
+ \@trnslt@declare@languagedialect{#1}{#2}}
+\@onlypreamble\DeclareLanguageDialect
-\def\@trnslt@declare@languagealias#1#2{%
- \ifcsdef{@trnslt@language@#2}
+\def\@trnslt@declare@languagedialect#1#2{%
+ \@trnslt@if@language{#2}
{}{%
\@trnslt@warn@unknown@lang{#2}%
\@trnslt@declare@language{#2}%
}%
- \lowercase{\@trnslt@if@dialect{#2}}{#2}
- {%
- \csletcs
- {@trnslt@language@\@trnslt@language{#2}@dialect@#1}
- {@trnslt@language@\@trnslt@language{#2}@dialect@#2}%
+ \@trnslt@if@dialect{#1}
+ {% => ist schon als dialect definiert => irgendwelche weiteren checks?
}
- {}%
- \csletcs{@trnslt@language@#1}{@trnslt@language@#2}}
+ {%
+ \@trnslt@if@alias{#2}
+ {%
+ \csedef{@trnslt@dialect@#1}{{\@trnslt@alias{#2}}{#1}}%
+ \@trnslt@declare@language{#1}%
+ \listeadd\@trnslt@dialects@single{#1}%
+ \listeadd\@trnslt@dialects@pair{{#1}{\@trnslt@alias{#2}}}%
+ }
+ {%
+ \csdef{@trnslt@dialect@#1}{{#2}{#1}}%
+ \@trnslt@declare@language{#1}%
+ \listeadd\@trnslt@dialects@single{#1}%
+ \listeadd\@trnslt@dialects@pair{{#1}{#2}}%
+ }%
+ }%
+}
-% #1: dialect
+\def\@trnslt@dialect#1{%
+ \csuse{@trnslt@dialect@#1}}
+
+\def\@trnslt@dialect@of#1{%
+ \expandafter\expandafter\expandafter
+ \@trnslt@dialect@of@aux
+ \csname @trnslt@dialect@#1\endcsname\@empty
+}
+\def\@trnslt@dialect@of@aux#1#2{\ifx\relax#1\@empty\else#1\fi}
+
+\def\@trnslt@if@dialect#1{%
+ \ifcsundef{@trnslt@dialect@#1}
+ {\expandafter\@secondoftwo}
+ {\expandafter\@firstoftwo}%
+}
+
+% #1: alias
% #2: language
-\newrobustcmd*\DeclareLanguageDialect[2]{%
- \@trnslt@declare@languagedialect{#1}{#2}}
-\@onlypreamble\DeclareLanguageDialect
+\newrobustcmd*\DeclareLanguageAlias[2]{%
+ \@trnslt@declare@languagealias{#1}{#2}}
+\@onlypreamble\DeclareLanguageAlias
-\def\@trnslt@declare@languagedialect#1#2{%
- \ifcsdef{@trnslt@language@#2}
+\def\@trnslt@declare@languagealias#1#2{%
+ \@trnslt@if@language{#2}
{}{%
\@trnslt@warn@unknown@lang{#2}%
\@trnslt@declare@language{#2}%
}%
- \csdef{@trnslt@language@\@trnslt@language{#2}@dialect@#1}{}%
- \csletcs{@trnslt@language@#1}{@trnslt@language@#2}}
+ \csletcs{@trnslt@language@#1}{@trnslt@language@#2}%
+ \@trnslt@if@dialect{#2}
+ {\csletcs{@trnslt@dialect@#1}{@trnslt@dialect@#2}}
+ {}%
+ \ifinlist{#1}\@trnslt@aliases@single
+ {}{%
+ \csdef{@trnslt@alias@#1}{#2}%
+ \listeadd\@trnslt@aliases@pair{{#1}{#2}}%
+ \listeadd\@trnslt@aliases@single{#1}%
+ }%
+}
-\def\@trnslt@if@dialect#1#2{%
- \ifcsdef{@trnslt@language@\@trnslt@language{#2}@dialect@#1}
- {\expandafter\@firstoftwo}
- {\expandafter\@secondoftwo}}
+\def\@trnslt@alias#1{%
+ \csuse{@trnslt@alias@#1}}
-\def\@trnslt@language#1{%
- \csuse{@trnslt@language@#1}}
+\def\@trnslt@if@alias#1{%
+ \ifcsundef{@trnslt@alias@#1}
+ {\expandafter\@secondoftwo}
+ {\expandafter\@firstoftwo}%
+}
% dummy language: `fallback':
\DeclareLanguage{fallback}
@@ -151,37 +210,56 @@
\@trnslt@declare@translation{#1}{fallback}{#2}}
\@onlypreamble\DeclareTranslationFallback
+\newrobustcmd*\NewTranslation[3]{%
+ \@trnslt@new@translation{#2}{#1}{#3}}
+\@onlypreamble\NewTranslation
+
+\newrobustcmd*\RenewTranslation[3]{%
+ \@trnslt@renew@translation{#2}{#1}{#3}}
+\@onlypreamble\RenewTranslation
+
+% #1: word
+% #2: language
+% #3: replacement
\def\@trnslt@declare@translation#1#2#3{%
- \ifcsdef{@trnslt@language@#2}
+ \@trnslt@if@language{#2}
{%
+ % save the <word> as <word>:
\csdef{@trnslt@word@#1@literal}{#1}%
- \lowercase{\@trnslt@if@dialect{#2}}{#2}
- {\csdef{@trnslt@word@#1@#2}{#3}}
+ % check if the language is a dialect:
+ \@trnslt@if@dialect{#2}
+ {\csdef{@trnslt@word@#1@\@trnslt@dialect{#2}}{#3}}
{}%
- \ifcsdef{@trnslt@word@#1@\@trnslt@language{#2}}
+ % check if translation already exists:
+ \@trnslt@if@translation{#1}{#2}
{}
{\csdef{@trnslt@word@#1@\@trnslt@language{#2}}{#3}}%
}
- {\@trnslt@err@unknown@lang{#2}}}
+ {\@trnslt@err@unknown@lang{#2}}%
+}
\def\@trnslt@if@translation#1#2{%
- \ifcsdef{@trnslt@word@#1@\@trnslt@language{#2}}
- {\expandafter\@firstoftwo}
- {\expandafter\@secondoftwo}}
-
-\newrobustcmd*\NewTranslation[3]{%
- \@trnslt@new@translation{#2}{#1}{#3}}
-\@onlypreamble\NewTranslation
+ \ifcsundef{@trnslt@word@#1@\@trnslt@language{#2}}
+ {%
+ \@trnslt@if@dialect{#2}
+ {%
+ \ifboolexpe{
+ test {\ifcsundef{@trnslt@word@#1@\@trnslt@dialect{#2}}} or
+ test {\ifcsundef{@trnslt@word@#1@\@trnslt@dialect@of{#2}}}
+ }
+ {\expandafter\@firstoftwo}
+ {\expandafter\@secondoftwo}%
+ }
+ {\expandafter\@secondoftwo}%
+ }
+ {\expandafter\@firstoftwo}%
+}
\def\@trnslt@new@translation#1#2#3{%
\@trnslt@if@translation{#1}{#2}
{\@trnslt@err@already@defined{#1}{#2}}
{\@trnslt@declare@translation{#1}{#2}{#3}}}
-\newrobustcmd*\RenewTranslation[3]{%
- \@trnslt@renew@translation{#2}{#1}{#3}}
-\@onlypreamble\RenewTranslation
-
\def\@trnslt@renew@translation#1#2#3{%
\@trnslt@if@translation{#1}{#2}
{\@trnslt@declare@translation{#1}{#2}{#3}}
@@ -200,16 +278,18 @@
% #1: word #2: language
\def\@trnslt@get@translation@for#1#2{%
- \@trnslt@if@translation{#1}{#2}
+ \@trnslt@if@dialect{#2}
{%
- \@trnslt@if@dialect{#2}{#2}
- {%
- \ifcsdef{@trnslt@word@#1@#2}
- {\csuse{@trnslt@word@#1@#2}}
- {\csuse{@trnslt@word@#1@\@trnslt@language{#2}}}%
- }
- {\csuse{@trnslt@word@#1@\@trnslt@language{#2}}}%
+ \ifcsdef{@trnslt@word@#1@\@trnslt@dialect{#2}}
+ {\csuse{@trnslt@word@#1@\@trnslt@dialect{#2}}}
+ {\csuse{@trnslt@word@#1@\@trnslt@dialect@of{#2}}}%
}
+ {\csuse{@trnslt@word@#1@\@trnslt@language{#2}}}%
+}
+
+\def\@trnslt@getandcheck@translation@for#1#2{%
+ \@trnslt@if@translation{#1}{#2}
+ {\@trnslt@get@translation@for{#1}{#2}}
{%
\@trnslt@warning{Translation for `#1' in #2 unknown. You may try to use
\string\DeclareTranslation{#2}{#1}{ ... } in your preamble.}%
@@ -219,7 +299,8 @@
\csuse{@trnslt@word@#1@fallback}
}%
{\csuse{@trnslt@word@#1@literal}}%
- }}
+ }%
+}
% --------------------------------------------------------------------------
% \SaveTranslationFor and \SaveTranslation
@@ -329,8 +410,8 @@
\DeclareLanguageDialect{canadian}{english}
\DeclareLanguageAlias {Canadian}{canadian}
\DeclareLanguageAlias {English}{english}
-\DeclareLanguageDialect{UKenglish}{english}
-\DeclareLanguageDialect{USenglish}{english}
+\DeclareLanguageAlias {UKenglish}{british}
+\DeclareLanguageAlias {USenglish}{american}
\DeclareLanguageDialect{austrian}{german}
\DeclareLanguageAlias {Austrian}{austrian}
\DeclareLanguageAlias {German}{german}
@@ -365,6 +446,10 @@
\DeclareLanguageAlias {Slovenian}{slovenian}
\DeclareLanguageAlias {Spanish}{spanish}
\DeclareLanguageAlias {Swedish}{swedish}
+\DeclareLanguageDialect{swissgerman}{german}
+% this maybe should be a language of it's own:
+\DeclareLanguageAlias {Swiss}{swissgerman}
+\DeclareLanguageAlias {Swissgerman}{swissgerman}
\DeclareLanguageAlias {Turkish}{turkish}
\DeclareLanguageAlias {Ukrainian}{ukrainian}
@@ -381,3 +466,10 @@
2013/04/08 v0.9a - changed fallback warning into info
- synchronized version number with `exsheets' until now but
won't any more
+2013/06/22 v0.9b - added Swiss
+2013/06/28 v0.10 - declaring aliases of dialects now works as expected
+ - declarings dialects of an alias now correctly declares
+ the dialect to the correct base language
+ - corrected a few erroneous langugae declarations
+
+