summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xsim
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-10-14 03:00:58 +0000
committerNorbert Preining <norbert@preining.info>2019-10-14 03:00:58 +0000
commit370853b6ba0be6e880b2f320268d4fefbd6aeef6 (patch)
tree6d5fc61b99808ac12a520651d0b2f9c59d2b0a94 /macros/latex/contrib/xsim
parent3afcae17b4a1a6dffbaa749a6fd0b6406c4d34a9 (diff)
CTAN sync 201910140300
Diffstat (limited to 'macros/latex/contrib/xsim')
-rw-r--r--macros/latex/contrib/xsim/README3
-rw-r--r--macros/latex/contrib/xsim/code/xsim.definitions.code.tex35
-rw-r--r--macros/latex/contrib/xsim/code/xsim.environments.code.tex6
-rw-r--r--macros/latex/contrib/xsim/code/xsim.exercises.code.tex6
-rw-r--r--macros/latex/contrib/xsim/code/xsim.interface.code.tex17
-rw-r--r--macros/latex/contrib/xsim/code/xsim.modules.code.tex12
-rw-r--r--macros/latex/contrib/xsim/code/xsim.sty4
-rw-r--r--macros/latex/contrib/xsim/code/xsim.style.layouts.code.tex17
-rw-r--r--macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.pdfbin0 -> 46008 bytes
-rw-r--r--macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.tex66
-rw-r--r--macros/latex/contrib/xsim/doc/xsim-manual.cls64
-rw-r--r--macros/latex/contrib/xsim/doc/xsim.history12
-rw-r--r--macros/latex/contrib/xsim/doc/xsim.ideas3
-rw-r--r--macros/latex/contrib/xsim/doc/xsim_manual.pdfbin1220136 -> 1229192 bytes
-rw-r--r--macros/latex/contrib/xsim/doc/xsim_manual.tex111
15 files changed, 283 insertions, 73 deletions
diff --git a/macros/latex/contrib/xsim/README b/macros/latex/contrib/xsim/README
index 5c33f5ca6c..5cdaaaffdb 100644
--- a/macros/latex/contrib/xsim/README
+++ b/macros/latex/contrib/xsim/README
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
-XSIM 2019/10/06 v0.13
+XSIM 2019/10/13 v0.14
eXercise Sheets IMproved
@@ -85,6 +85,7 @@ The xsim package consists of the example files:
xsim.texsx-395273.tex, xsim.texsx-395273.pdf
xsim.texwelt-6698.tex, xsim.texwelt-6698.pdf
xsim.texwelt-15093.tex, xsim.texwelt-15093.pdf
+ xsim.texwelt-23968.tex, xsim.texwelt-23968.pdf
xsim.golatex-16824.tex, xsim.golatex-16824.pdf
xsim.golatex-18844.tex, xsim.golatex-18844.pdf
--------------------------------------------------------------------------
diff --git a/macros/latex/contrib/xsim/code/xsim.definitions.code.tex b/macros/latex/contrib/xsim/code/xsim.definitions.code.tex
index 02fb1444f7..2a7add33de 100644
--- a/macros/latex/contrib/xsim/code/xsim.definitions.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.definitions.code.tex
@@ -42,6 +42,11 @@
\DeclareExerciseParameter* {solution-counter}
\DeclareExerciseParameter* {number}
+% these are additional - but are used in the `default' environment
+% template:
+\DeclareExerciseParameter {exercise-heading}
+\DeclareExerciseParameter {solution-heading}
+
% ----------------------------------------------------------------------------
% not exactly a user choice, must be present at various places:
@@ -63,7 +68,9 @@
\DeclareExerciseProperty {sectioning}
% those are additional and wouldn't *need* to be present except for
-% pre-defined templates which make use of them:
+% pre-defined templates which make use of them (the page and page-value
+% property actually needs to be defined for xsim to be able to save the
+% corresponding values):
\DeclareExerciseProperty {subtitle}
\DeclareExerciseProperty {points}
\DeclareExerciseProperty {bonus-points}
@@ -166,23 +173,25 @@
solution-name = \XSIMtranslate {solution} ,
solutions-name = \XSIMtranslate {solutions} ,
exercise-template = default ,
- solution-template = default
+ solution-template = default ,
+ exercise-heading = \subsection* ,
+ solution-heading = \subsection*
}
% ----------------------------------------------------------------------------
\DeclareExerciseEnvironmentTemplate {default}
{
- \subsection*
- {
- \XSIMmixedcase { \GetExerciseName } \nobreakspace
- \GetExerciseProperty {counter}
- \IfInsideSolutionF
- {
- \IfExercisePropertySetT {subtitle}
- { ~ { \normalfont \itshape \GetExerciseProperty {subtitle} } }
- }
- }
+ \GetExerciseHeadingF { \subsection* }
+ {
+ \XSIMmixedcase { \GetExerciseName } \nobreakspace
+ \GetExerciseProperty {counter}
+ \IfInsideSolutionF
+ {
+ \IfExercisePropertySetT {subtitle}
+ { ~ { \normalfont \itshape \GetExerciseProperty {subtitle} } }
+ }
+ }
\GetExercisePropertyT {points}
{
\marginpar
@@ -195,7 +204,7 @@
}
}
}
- {}
+ { \par }
% ----------------------------------------------------------------------------
diff --git a/macros/latex/contrib/xsim/code/xsim.environments.code.tex b/macros/latex/contrib/xsim/code/xsim.environments.code.tex
index b9235ba555..2aacf63f51 100644
--- a/macros/latex/contrib/xsim/code/xsim.environments.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.environments.code.tex
@@ -350,9 +350,9 @@
\xsim_step_exercise_counter:nn {#1} {#2}
\xsim_set_properties:nnx {#1} {#2}
{
- page-value = \arabic{page} ,
+ page-value = \the\value{page} ,
page = \thepage ,
- section-value = \arabic{section} ,
+ section-value = \the\value{section} ,
section = \thesection
}
}
@@ -360,7 +360,7 @@
{
\xsim_set_properties:nnx {#1} {#2}
{
- chapter-value = \arabic{chapter} ,
+ chapter-value = \the\value{chapter} ,
chapter = \thechapter
}
}
diff --git a/macros/latex/contrib/xsim/code/xsim.exercises.code.tex b/macros/latex/contrib/xsim/code/xsim.exercises.code.tex
index 98cebe3eb3..0de63e0460 100644
--- a/macros/latex/contrib/xsim/code/xsim.exercises.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.exercises.code.tex
@@ -364,7 +364,11 @@
\xsim_get_parameter:nn {#1} {exercise-env} / name
.code:n = \xsim_set_parameter:nnn {#1} {exercise-name} {####1} ,
\xsim_get_parameter:nn {#1} {solution-env} / name
- .code:n = \xsim_set_parameter:nnn {#1} {solution-name} {####1}
+ .code:n = \xsim_set_parameter:nnn {#1} {solution-name} {####1} ,
+ \xsim_get_parameter:nn {#1} {exercise-env} / heading
+ .code:n = \xsim_set_parameter:nnn {#1} {exercise-heading} {####1} ,
+ \xsim_get_parameter:nn {#1} {solution-env} / heading
+ .code:n = \xsim_set_parameter:nnn {#1} {solution-heading} {####1}
}
\xsim_new_environment:nn {#1} {exercise}
\xsim_new_environment:nn {#1} {solution}
diff --git a/macros/latex/contrib/xsim/code/xsim.interface.code.tex b/macros/latex/contrib/xsim/code/xsim.interface.code.tex
index b8798e9c47..3331f6278a 100644
--- a/macros/latex/contrib/xsim/code/xsim.interface.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.interface.code.tex
@@ -256,6 +256,21 @@
{ \GetExerciseParameter {exercise-name} }
}
+\NewExpandableDocumentCommand \GetExerciseHeadingF {m}
+ {
+ \IfInsideSolutionTF
+ {
+ \IfExerciseParameterSetTF {solution-heading}
+ { \GetExerciseParameter {solution-heading} }
+ {#1}
+ }
+ {
+ \IfExerciseParameterSetTF {exercise-heading}
+ { \GetExerciseParameter {exercise-heading} }
+ {#1}
+ }
+ }
+
\NewDocumentCommand \GetExerciseBody {m}
{ \xsim_input:oon { \ExerciseType } { \ExerciseID } {#1} }
@@ -632,7 +647,7 @@
% ----------------------------------------------------------------------------
-\NewDocumentCommand \xsimsetup {m}
+\NewDocumentCommand \xsimsetup {+m}
{ \xsim_setup:n {#1} }
% ----------------------------------------------------------------------------
diff --git a/macros/latex/contrib/xsim/code/xsim.modules.code.tex b/macros/latex/contrib/xsim/code/xsim.modules.code.tex
index 3d94ca4b61..3b874dbad0 100644
--- a/macros/latex/contrib/xsim/code/xsim.modules.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.modules.code.tex
@@ -204,11 +204,17 @@
\IfBooleanT {#1} { \ExplSyntaxOn }
}
-\cs_new_protected:Npn \xsim_style_options:nn #1#2
- { \keys_define:nn {xsim/#1} {#2} }
+% \cs_new_protected:Npn \xsim_style_options:nn #1#2
+% { \keys_define:nn {xsim/#1} {#2} }
-\NewDocumentCommand \loadxsimstyle {m}
+\cs_new_protected:Npn \xsim_load_style:n #1
{ \clist_map_inline:nn {#1} { \xsim_load_module:n {style.##1} } }
+\keys_define:nn {xsim}
+ { load-style .code:n = \xsim_load_style:n {#1} }
+
+\NewDocumentCommand \loadxsimstyle {m}
+ { \xsim_load_style:n {#1} }
+
% --------------------------------------------------------------------------
\file_input_stop:
diff --git a/macros/latex/contrib/xsim/code/xsim.sty b/macros/latex/contrib/xsim/code/xsim.sty
index 01dcbd96b3..59992c37d8 100644
--- a/macros/latex/contrib/xsim/code/xsim.sty
+++ b/macros/latex/contrib/xsim/code/xsim.sty
@@ -29,9 +29,9 @@
\ExplSyntaxOn
-\tl_const:Nn \c_xsim_date_tl {2019/10/06}
+\tl_const:Nn \c_xsim_date_tl {2019/10/13}
\tl_const:Nn \c_xsim_version_major_number_tl {0}
-\tl_const:Nn \c_xsim_version_minor_number_tl {13}
+\tl_const:Nn \c_xsim_version_minor_number_tl {14}
\tl_const:Nn \c_xsim_version_subrelease_tl {}
\tl_const:Nx \c_xsim_version_number_tl
{
diff --git a/macros/latex/contrib/xsim/code/xsim.style.layouts.code.tex b/macros/latex/contrib/xsim/code/xsim.style.layouts.code.tex
index 304316eed0..756a61e838 100644
--- a/macros/latex/contrib/xsim/code/xsim.style.layouts.code.tex
+++ b/macros/latex/contrib/xsim/code/xsim.style.layouts.code.tex
@@ -25,7 +25,7 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% ----------------------------------------------------------------------------
-\xsimstyle{layouts}[2017/09/14]
+\xsimstyle{layouts}[2019/10/12]
\RequirePackage{needspace}
@@ -73,5 +73,20 @@
}
{\endtrivlist}
+\DeclareExerciseEnvironmentTemplate{minimal}
+ {%
+ \textbf{\GetExerciseProperty{counter}}%
+ \IfInsideSolutionF{%
+ \GetExercisePropertyT{points}{ % <<< notice the space
+ (\printgoal{\PropertyValue}%
+ \GetExercisePropertyT{bonus-points}{+\printgoal{\PropertyValue}}%
+ \,\IfExerciseGoalSingularTF{points}
+ {\XSIMtranslate{point}}
+ {\XSIMtranslate{points}})%
+ }%
+ } % <<< notice the space
+ }
+ {}
+
% ----------------------------------------------------------------------------
\endinput
diff --git a/macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.pdf b/macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.pdf
new file mode 100644
index 0000000000..726cbcddb4
--- /dev/null
+++ b/macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.pdf
Binary files differ
diff --git a/macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.tex b/macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.tex
new file mode 100644
index 0000000000..e967f7f826
--- /dev/null
+++ b/macros/latex/contrib/xsim/doc/examples/xsim.texwelt-23968.tex
@@ -0,0 +1,66 @@
+% http://texwelt.de/wissen/fragen/23968/
+\documentclass{article}
+\usepackage{xsim}
+
+% new property:
+\DeclareExerciseProperty{shortsolution}
+
+% new environment:
+\NewDocumentEnvironment{shortsolution}{+b}
+ {\SetExerciseProperty{shortsolution}{#1}}
+ {}
+
+% we'll use a description list for the list of short solutions:
+\newcommand\printshortsolutions{%
+ \begin{description}
+ \ForEachUsedExerciseByType{%
+ \def\ExerciseType{##1}%
+ \def\ExerciseID{##2}%
+ \GetExercisePropertyT{shortsolution}
+ {%
+ \item[Short Solution ##3]
+ ####1%
+ }%
+ }%
+ \end{description}
+}
+
+\begin{document}
+
+\section{Problems}
+% set shortsolution through option:
+\begin{exercise}[subtitle=Pythagoras]
+ This is the first problem.
+\end{exercise}
+\begin{shortsolution}
+ This is a shortsolution to the first problem.
+\end{shortsolution}
+\begin{solution}
+ This is the solution to the first problem.
+\end{solution}
+
+\begin{exercise}[subtitle=Another Problem]
+ This is the second problem.
+\end{exercise}
+\begin{solution}
+ This is the solution to the second problem.
+\end{solution}
+
+% set shortsolution with custom command:
+\begin{exercise}[subtitle=Yet Another Problem]
+ This is the third problem.
+\end{exercise}
+\begin{shortsolution}
+ This is a shortsolution to the third problem.
+\end{shortsolution}
+\begin{solution}
+ This is the solution to the third problem.
+\end{solution}
+
+\section{Shortsolutions}
+\printshortsolutions
+
+\section{Solutions}
+\printsolutions[headings=false]
+
+\end{document}
diff --git a/macros/latex/contrib/xsim/doc/xsim-manual.cls b/macros/latex/contrib/xsim/doc/xsim-manual.cls
index 8d28945262..a36d869869 100644
--- a/macros/latex/contrib/xsim/doc/xsim-manual.cls
+++ b/macros/latex/contrib/xsim/doc/xsim-manual.cls
@@ -80,6 +80,9 @@
ExerciseGoalValuePrint ,
ExerciseID ,
ExerciseParameterGet ,
+ ExerciseParameterIfSetF ,
+ ExerciseParameterIfSetT ,
+ ExerciseParameterIfSetTF ,
ExercisePropertyGet ,
ExercisePropertyGetAlias ,
ExercisePropertyGlobalSave ,
@@ -87,6 +90,8 @@
ExercisePropertyIfSetT ,
ExercisePropertyIfSetTF ,
ExercisePropertySave ,
+ ExerciseSetExpandedProperty ,
+ ExerciseSetProperty ,
ExerciseTableType ,
ExerciseTableCode ,
ExerciseType ,
@@ -97,6 +102,7 @@
ForEachUsedExerciseByType ,
ForEachUsedExerciseByID ,
GetExerciseAliasProperty ,
+ GetExerciseHeadingF ,
GetExerciseName ,
GetExerciseParameter ,
GetExerciseProperty ,
@@ -153,6 +159,8 @@
SaveExerciseProperty ,
SetExerciseParameter ,
SetExerciseParameters ,
+ SetExerciseProperty ,
+ SetExpandedExerciseProperty ,
theexercise ,
TotalExerciseGoal ,
TotalExerciseGoals ,
@@ -693,7 +701,7 @@
\cs_new_protected:Npn \xsim@example@links #1 {
\href { \xsim@example@texfile@path {#1} } { \color{white} [\TeX] } ~
- \href { \xsim@example@pdffile@path {#1} } { \color{white} [PDF] }
+ \href { \xsim@example@pdffile@path.#1.pdf } { \color{white} [PDF] }
\tl_if_in:nnT {#1} {texsx}
{
\tl_set:Nx \l_tmpa_tl { \__xsim_get_texsx_number:w #1 \q_stop: }
@@ -765,6 +773,32 @@
\dolistloop\xsim@examplefiles
}
+% ----------------------------------------------------------------------------
+
+\newcommand*\listlayouts{%
+ \def\do##1{%
+ \begin{cnltxcode}[{title=Layout \enquote{\texttt{##1}}}]
+ \ifcsdef{xsim@layout@extra@##1}
+ {\csuse{xsim@layout@extra@##1}}
+ {}%
+ \xsimsetup{exercise/template={##1}}
+ \let\marginpar\marginnote
+ \XSIMexpandcode{%
+ \printexercise{exercise}{\GetExerciseIdForProperty{ID}{showlayout}}
+ }%
+ \end{cnltxcode}
+ }%
+ \dolistloop\xsim@layouts
+}
+
+\NewDocumentCommand\xsim@add@layout{mo}{%
+ \listadd\xsim@layouts{#1}%
+ \IfNoValueF{#2}{\csdef{xsim@layout@extra@#1}{#2}}%
+}
+
+% ----------------------------------------------------------------------------
+% examples:
+
\xsim@add@example{blanks}{Create blank lines}
\xsim@add@example{boxed-headings}{Put headings in a box}
\xsim@add@example{code-and-output}{Create code examples}
@@ -798,35 +832,20 @@
\xsim@add@example{texsx-395273}{Different aspects of exercises. Highlighted solutions}
\xsim@add@example{texwelt-6698}{Custom list of exercises}
\xsim@add@example{texwelt-15093}{Indicate difficulty level}
+\xsim@add@example{texwelt-23968}{Long and short solutions}
\xsim@add@example{golatex-80640}{Different versions for students and teachers}
\xsim@add@example{golatex-91339}{Another custom layout with rules}
% ----------------------------------------------------------------------------
-
-\newcommand*\listlayouts{%
- \def\do##1{%
- \begin{cnltxcode}[{title=Layout \enquote{\texttt{##1}}}]
- \ifcsdef{xsim@layout@extra@##1}
- {\csuse{xsim@layout@extra@##1}}
- {}%
- \xsimsetup{exercise/template={##1}}
- \let\marginpar\marginnote
- \XSIMexpandcode{%
- \printexercise{exercise}{\GetExerciseIdForProperty{ID}{showlayout}}
- }%
- \end{cnltxcode}
- }%
- \dolistloop\xsim@layouts
-}
-
-\NewDocumentCommand\xsim@add@layout{mo}{%
- \listadd\xsim@layouts{#1}%
- \IfNoValueF{#2}{\csdef{xsim@layout@extra@#1}{#2}}%
-}
+% layouts:
\xsim@add@layout{default}
\xsim@add@layout{runin}[\renewcommand*\theexercise{\arabic{exercise}.}]
\xsim@add@layout{margin}[\renewcommand*\theexercise{\arabic{exercise}.}]
+\xsim@add@layout{minimal}[\renewcommand*\theexercise{\arabic{exercise}.}]
+
+% ----------------------------------------------------------------------------
+% versions:
\xsim@add@version{0.8} {2017-05-18}
\xsim@add@version{0.8a} {2017-05-19}
@@ -837,6 +856,7 @@
\xsim@add@version{0.11} {2018-02-12}
\xsim@add@version{0.12} {2019-09-26}
\xsim@add@version{0.13} {2019-10-06}
+\xsim@add@version{0.14} {2019-10-13}
% ----------------------------------------------------------------------------
\endinput
diff --git a/macros/latex/contrib/xsim/doc/xsim.history b/macros/latex/contrib/xsim/doc/xsim.history
index c16a4ef7ec..8be4a79e36 100644
--- a/macros/latex/contrib/xsim/doc/xsim.history
+++ b/macros/latex/contrib/xsim/doc/xsim.history
@@ -115,3 +115,15 @@ HISTORY:
and solution names
- bug fixes (issues 37, 39, 43, 47)
v0.13 2019/10/06 - experimental package option `no-files'
+ v0.14 2019/10/13 - new exercise parameters `exercise-heading' and
+ `solution-heading'
+ - new options `exercise/heading' and `solution/heading' as
+ interface for setting the new parameters
+ - new command \GetExerciseHeadingF for using the new
+ parameters in environment templates
+ - change the environment template `default' to use the new
+ \GetExerciseHeadingF and output a \par at the end
+ - make argument of \xsimsetup long
+ - new template `minimal'
+ - new option `load-style'
+ - new example `texwelt-23968' (long and short solutions)
diff --git a/macros/latex/contrib/xsim/doc/xsim.ideas b/macros/latex/contrib/xsim/doc/xsim.ideas
index 7a7810f84d..cdc4b7d2ba 100644
--- a/macros/latex/contrib/xsim/doc/xsim.ideas
+++ b/macros/latex/contrib/xsim/doc/xsim.ideas
@@ -26,7 +26,4 @@ IDEAS:
- a document class `xsim-exam' for creating exams
- a mechanism for providing variants of an exam
-- provide a switch: either write the environments to an external file
- or save it to an auxiliary file ? (not really sure about this one --
- probably not)
- some kind of `subexercise' mechanism
diff --git a/macros/latex/contrib/xsim/doc/xsim_manual.pdf b/macros/latex/contrib/xsim/doc/xsim_manual.pdf
index b6fb1d329c..96ec4408f9 100644
--- a/macros/latex/contrib/xsim/doc/xsim_manual.pdf
+++ b/macros/latex/contrib/xsim/doc/xsim_manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/xsim/doc/xsim_manual.tex b/macros/latex/contrib/xsim/doc/xsim_manual.tex
index 9bf643e1ca..33ec88e4a7 100644
--- a/macros/latex/contrib/xsim/doc/xsim_manual.tex
+++ b/macros/latex/contrib/xsim/doc/xsim_manual.tex
@@ -144,14 +144,15 @@ or as global option
\begin{sourcecode}
\documentclass[verbose]{article}
\end{sourcecode}
-or via the setup command:
+or via the setup\changedversion{0.13} command as options belonging to the
+\module{package}:
\begin{commands}
\command{xsimsetup}[\marg{options}]
Set up \xsim's package options and all other options described at
other places in the manual.
\end{commands}
-\subsection{Setting Options}
+\subsection{Setting Options}\label{sec:setting-options}
Apart from the package options already described in
section~\vref{sec:package-options} \xsim\ has further options. Those can be
\enquote{toplevel} options or options belonging to a module.
@@ -373,7 +374,8 @@ Declaring a new exercise type will also define a new command:
There are \numberofexercises~exercises and \numberofproblems~problem in this
manual.
\end{example}
-\xsim's pre-defined environment pair has been defined as follows:
+\xsim's pre-defined environment pair\changedversion{0.14} has been defined as
+follows:
\begin{sourcecode}
\DeclareExerciseType{exercise}{
exercise-env = exercise ,
@@ -383,7 +385,9 @@ Declaring a new exercise type will also define a new command:
solution-name = \XSIMtranslate{solution} ,
solutions-name = \XSIMtranslate{solutions} ,
exercise-template = default ,
- solution-template = default
+ solution-template = default ,
+ exercise-heading = \subsection* ,
+ solution-heading = \subsection*
}
\end{sourcecode}
@@ -439,13 +443,26 @@ must) be set. Here is the complete list:
An internal parameter that is used to keep track of the number of
exercises of a type. This parameter cannot be set or changed by the
user.
+ \paraval{exercise-heading}{exercise heading command}
+ The\sinceversion{0.14} command used for typesetting of the heading of
+ exercises of type \meta{type} -- used for typesetting with the command
+ \cs{GetExerciseHeadingF}.
+ \paraval{solution-heading}{solution heading command}
+ The\sinceversion{0.14} command used for typesetting of the heading of
+ solutions of type \meta{type} -- used for typesetting with the command
+ \cs{GetExerciseHeadingF}.
\end{parameters}
It is possible to change some of the parameters after an exercise type has
been defined. Those include \parameter{exercise-name},
\parameter{solution-name}, \parameter{exercise-template}, and
-\parameter{solution-template}:
+\parameter{solution-template}. It is also possible to define new parameters.
\begin{commands}
+ \command{DeclareExerciseParameter}[\sarg\marg{parameter}]
+ Declares the new parameter \meta{parameter}. The optional star declares a
+ fixed parameter which cannot be changed once it is set. \emph{You
+ probably will never need this command. Most tasks can be solved using
+ properties (see section~\vref{sec:exercise-properties}) instead.}
\command{SetExerciseParameter}[\marg{type}\marg{parameter}\marg{value}]
Usable to set a single parameter to a new value.
\command{SetExerciseParameters}[\marg{type}\marg{parameters}]
@@ -483,7 +500,7 @@ Exercise like the \env{exercise} environment and possibly others defined with
user}.
\propval{counter-value}{integer}
Holds the counter value of an exercise (\ie, what you usually know as
- \cs*{arabic}\marg{counter}). \emph{Cannot be set by the user}.
+ \cs*{the}\cs*{value}\marg{counter}). \emph{Cannot be set by the user}.
\propval{subtitle}{text}
Holds the subtitle of an exercise.
\propval{points}{number}
@@ -513,25 +530,32 @@ Exercise like the \env{exercise} environment and possibly others defined with
usually know as \cs*{thepage}).
\propval{page-value}{integer}
Holds the page counter value of an exercise (\ie, what you usually know as
- \cs*{arabic}\Marg{page}).
+ \cs*{the}\cs*{value}\Marg{page}).
\propval{section}{text}
Holds the section counter value representation of an exercise (\ie, what
you usually know as \cs*{thesection}).
\propval{section-value}{integer}
Holds the section counter value of an exercise (\ie, what you usually know
- as \cs*{arabic}\Marg{section}).
+ as \cs*{the}\cs*{value}\Marg{section}).
\propval{chapter}{text}
Holds the chapter counter value representation of an exercise (\ie, what
you usually know as \cs*{thechapter}). \emph{Only if a command
\cs*{chapter} \emph{and} a counter \code{chapter} exist.}
\propval{chapter-value}{integer}
Holds the chapter counter value of an exercise (\ie, what you usually know
- as \cs*{arabic}\Marg{chapter}). \emph{Only if a command \cs*{chapter}
+ as \cs*{the}\cs*{value}\Marg{chapter}). \emph{Only if a command \cs*{chapter}
\emph{and} a counter \code{chapter} exist.}
\propval{sectioning}{section numbers}
Holds five brace groups which in turn hold the section numbers (integers)
of the exercise in the order
\marg{chapter}\marg{section}\marg{subsection}\marg{subsubsection}\marg{paragraph}.
+ \propval{exercise-body}{\TeX code}
+ When\sinceversion{0.13} the package option \option{no-files} is set this
+ property is defined and holds the environment body of an exercise.
+ \propval{solution-body}{\TeX code}
+ When\sinceversion{0.13} the package option \option{no-files} is set this
+ property is defined and holds the environment body of the corresponding
+ solution.
\end{properties}
Some of these \acsp*{prop} are fixed and cannot be set by the user. Those
@@ -851,6 +875,12 @@ the environments' names are the module names for the options (here using the
\keyval{name}{name}\Module{solution}
An interface for \cs{SetExerciseParameter}\Marg{exercise}%
\Marg{solution-name}\marg{name}.
+ \keyval{heading}{heading command}\Module{exercise}
+ An\sinceversion{0.14} interface for \cs{SetExerciseParameter}%
+ \Marg{exercise}\Marg{exercise-heading}\marg{heading command}.
+ \keyval{heading}{heading command}\Module{solution}
+ An\sinceversion{0.14} interface for \cs{SetExerciseParameter}%
+ \Marg{exercise}\Marg{solution-heading}\marg{heading command}.
\keyval{pre-hook}{code}\Module{exercise}\Default
The code for the \emph{pre exercise hook} for exercises of the type
\enquote{exercise}.
@@ -1258,6 +1288,10 @@ yourself in order to achieve certain layouts\footnote{I plan to incorporate
\pkg{exsheets}, see section~\ref{sec:margin-template}. Available through
the style file \code{layouts} (see section~\vref{sec:style-files} for more
information on style files\index{style file}).
+ \item[\code{minimal}] A\sinceversion{0.13a} minimalistic layout, see
+ section~\ref{sec:minimal-template}. Available through the style file
+ \code{layouts} (see section~\vref{sec:style-files} for more information on
+ style files\index{style file}).
\end{description}
\collectexercises{layouts}
@@ -1388,6 +1422,11 @@ yourself in order to achieve certain layouts\footnote{I plan to incorporate
Retrieves the value of the parameter \parameter{exercise-name} for the
current exercise or of the parameter \parameter{solution-name} for the
current solution.
+ \expandable\command{GetExerciseHeadingF}[\marg{false}]
+ \sinceversion{0.14}Retrieves the value of the parameter
+ \parameter{exercise-heading} for the current exercise or of the parameter
+ \parameter{solution-heading} for the current solution. Inserts
+ \meta{false} if the corresponding parameter has not been set.
\expandable\command{ExerciseParameterGet}[\marg{type}\marg{parameter}]
Retrieves the value of the parameter \meta{parameter} for the exercise of type
\meta{type} with id \meta{id}.
@@ -1585,21 +1624,21 @@ section~\vref{sec:example-files}.
\subsubsection{The \code{default} Exercise Template}\label{sec:exercise-templ-default}
-Below the definition of the \code{default} exercise template provided by
-\xsim\ is shown:
+Below the definition\changedversion{0.14} of the \code{default} exercise
+template provided by \xsim\ is shown:
\begin{sourcecode}
\DeclareExerciseEnvironmentTemplate{default}{%
- \subsection*
- {%
- \XSIMmixedcase{\GetExerciseName}\nobreakspace
- \GetExerciseProperty{counter}%
- \IfInsideSolutionF
- {%
- \GetExercisePropertyT{subtitle}
- { {\normalfont\itshape\PropertyValue}}%
- }%
- }
+ \GetExerciseHeadingF{\subsection*}%
+ {%
+ \XSIMmixedcase{\GetExerciseName}\nobreakspace
+ \GetExerciseProperty{counter}%
+ \IfInsideSolutionF
+ {%
+ \GetExercisePropertyT{subtitle}
+ { {\normalfont\itshape\PropertyValue}}%
+ }%
+ }
\GetExercisePropertyT{points}
{%
\marginpar
@@ -1611,7 +1650,7 @@ Below the definition of the \code{default} exercise template provided by
}%
}%
}
- {}
+ {\par}
\end{sourcecode}
\subsubsection{A New Exercise Type Using \pkg*{tcolorbox}}
@@ -1731,6 +1770,26 @@ The following example shows how you could mimick \pkg*{exsheets}'
{\endtrivlist}
\end{sourcecode}
+\subsubsection{A \code{minimal} Template}
+\label{sec:minimal-template}
+
+This shows the implementation of the \code{minimal} template:
+\begin{sourcecode}
+ \DeclareExerciseEnvironmentTemplate{minimal}
+ {%
+ \textbf{\GetExerciseProperty{counter}}%
+ \IfInsideSolutionF{%
+ \GetExercisePropertyT{points}{%
+ \GetExercisePropertyT{bonus-points}{+\printgoal{\PropertyValue}}%
+ \,\IfExerciseGoalSingularTF{points}
+ {\XSIMtranslate{point}}
+ {\XSIMtranslate{points}}%
+ }%
+ }%
+ }
+ {}
+\end{sourcecode}
+
\subsubsection{The Headings Templates}\label{sec:headings-templates}
\xsim\ defines four heading templates which only differ by which text they
output:
@@ -2134,7 +2193,8 @@ called:
\end{center}
The first command in the file should be \cs{xsimstyle}\Marg{math-exam}. This
file can now be loaded into your document using
-\cs{loadxsimstyle}\Marg{math-exam}:
+\cs{loadxsimstyle}\Marg{math-exam} or by using
+\cs{xsimsetup}\Marg{load-style=math-exam}:
\begin{sourcecode}
\documentclass[DIV=18,parskip=half]{scrartcl}
\usepackage[T1]{fontenc}
@@ -2168,6 +2228,11 @@ The formal description of the commands:
\command{loadxsimstyle}[\marg{csv list of style names}]
Load one or more styles into the document.
\end{commands}
+\begin{options}
+ \keyval{load-style}{csv list of style names}
+ Another\sinceversion{0.14} interface for \cs{loadxsimstyle}\marg{csv list
+ of style names}.
+\end{options}
\begin{bewareofthedog}
At the moment this mechanism offers no advantages over creating a custom