summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/xsim/README4
-rw-r--r--Master/texmf-dist/doc/latex/xsim/xsim.history12
-rw-r--r--Master/texmf-dist/doc/latex/xsim/xsim.ideas1
-rw-r--r--Master/texmf-dist/doc/latex/xsim/xsim_manual.pdfbin1231162 -> 1231179 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xsim/xsim_manual.tex86
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim-manual.cls15
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex15
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.base.code.tex16
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.blanks.code.tex5
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.collections.code.tex8
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.definitions.code.tex32
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex80
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex72
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.goals.code.tex92
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex40
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex32
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex4
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.sty40
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex4
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsimverb.sty8
20 files changed, 404 insertions, 162 deletions
diff --git a/Master/texmf-dist/doc/latex/xsim/README b/Master/texmf-dist/doc/latex/xsim/README
index c96de8d2a35..43d9ae35361 100644
--- a/Master/texmf-dist/doc/latex/xsim/README
+++ b/Master/texmf-dist/doc/latex/xsim/README
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
-XSIM 2020/01/16 v0.16a
+XSIM 2020/01/21 v0.17
XSIMVERB 2019/12/29 v0.1a
eXercise Sheets IMproved
@@ -9,7 +9,7 @@ Clemens Niederberger
Web: https://github.com/cgnieder/xsim
E-Mail: contact@mychemistry.eu
--------------------------------------------------------------------------
-Copyright 2017--2019 Clemens Niederberger
+Copyright 2017--2020 Clemens Niederberger
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/Master/texmf-dist/doc/latex/xsim/xsim.history b/Master/texmf-dist/doc/latex/xsim/xsim.history
index b2bf16e4c04..7cb4ab4849f 100644
--- a/Master/texmf-dist/doc/latex/xsim/xsim.history
+++ b/Master/texmf-dist/doc/latex/xsim/xsim.history
@@ -113,7 +113,7 @@ HISTORY:
- \ProvideExerciseTagging
v0.12 2019/09/30 - add parameter versions for the plural forms of exercise
and solution names
- - bug fixes (issues 37, 39, 43, 47)
+ - 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'
@@ -133,6 +133,14 @@ HISTORY:
`use-aux'
v0.16 2019/11/10 - fix issue due to usage of own auxiliary file
- \XSIMatbegindocument and \XSIMatenddocument
- - \xprintexercise, \xprintsolution, \xsimprint, \xsimxprint
+ - \xprintexercise, \xprintsolution, \xsimprint, \xsimxprint
2019/12/29 - bugfix in `xsimverb'
v0.16a 2020/01/16 - adapt to renaming of string case changing functions
+ v0.17 2020/02/21 - prefer lazy boolean evaluation if possible
+ - remove spurious \par at the beginning of typeset
+ exercises
+ - add `blank' option, implements issue #31
+ - add `solution' property, implements issue #33
+ - fix issue #27
+ - implement issue #2
+ - don't allow package options to be set with \xsimsetup
diff --git a/Master/texmf-dist/doc/latex/xsim/xsim.ideas b/Master/texmf-dist/doc/latex/xsim/xsim.ideas
index 0882c705350..6ae5cd9a6a4 100644
--- a/Master/texmf-dist/doc/latex/xsim/xsim.ideas
+++ b/Master/texmf-dist/doc/latex/xsim/xsim.ideas
@@ -26,4 +26,3 @@ IDEAS:
- a document class `xsim-exam' for creating exams
- a mechanism for providing variants of an exam
-- some kind of `subexercise' mechanism
diff --git a/Master/texmf-dist/doc/latex/xsim/xsim_manual.pdf b/Master/texmf-dist/doc/latex/xsim/xsim_manual.pdf
index 9c3f5462048..9014b1c3689 100644
--- a/Master/texmf-dist/doc/latex/xsim/xsim_manual.pdf
+++ b/Master/texmf-dist/doc/latex/xsim/xsim_manual.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xsim/xsim_manual.tex b/Master/texmf-dist/doc/latex/xsim/xsim_manual.tex
index 46706662a11..e3328631df4 100644
--- a/Master/texmf-dist/doc/latex/xsim/xsim_manual.tex
+++ b/Master/texmf-dist/doc/latex/xsim/xsim_manual.tex
@@ -1,8 +1,8 @@
-% !arara: pdflatex: { action: nonstopmode }
+% !arara: pdflatex: { interaction: nonstopmode }
% !arara: biber
-% !arara: pdflatex: { action: nonstopmode }
-% arara: pdflatex: { action: nonstopmode }
-% arara: pdflatex: { action: nonstopmode }
+% arara: pdflatex: { interaction: nonstopmode }
+% arara: pdflatex: { interaction: nonstopmode }
+% arara: pdflatex: { interaction: nonstopmode }
% ----------------------------------------------------------------------------
% the XSIM package
%
@@ -32,8 +32,7 @@
% ----------------------------------------------------------------------------
\documentclass{xsim-manual}
-\usepackage{filecontents}
-\begin{filecontents*}{\jobname.bib}
+\begin{filecontents*}[overwrite]{\jobname.bib}
@online{texsx:romannumeral,
author = {Bruno Le Floch} ,
title = {Cunning (La)TeX tricks} ,
@@ -44,7 +43,7 @@
title = {Questions tagged `exsheets'} ,
author = {various} ,
url = {http://tex.stackexchange.com/questions/tagged/exsheets} ,
- urldate = {2017-05-15}
+ urldate = {2020-02-21}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
@@ -76,7 +75,7 @@ using an up to date \TeX\ distribution, anyway.
It has been quite a while since I first published
\pkg{exsheets}~\cite{pkg:exsheets} in June 2012. Since then it has gained a
user base and a little bit of popularity as the number of questions on tex.sx
-shows (119~at the time of writing)~\cite{texsx:tagged/exsheets}. User
+shows (143~at the time of writing)~\cite{texsx:tagged/exsheets}. User
questions, bug reports and feature requests improved it over the time. It
still has a version number starting with a zero, though, which in my
versioning system means I still consider it experimental.
@@ -138,21 +137,21 @@ meaning in this manual.
\sinceversion{0.15}With this option enabled \xsim\ will use the regular
auxiliary file \cs*{jobname}\code{.aux} instead of its own auxiliary file
\cs*{jobname}\code{.xsim}.
+ \opt{blank}
+ \sinceversion{0.17}With this option enabled \xsim\ will not define the
+ default environments \env{exercise} and \env{solution}.
\end{options}
-Those options are used the usual way as package option
+Those options are load-time options and are used the usual way as package
+options:
\begin{sourcecode}
\usepackage[verbose]{xsim}
\end{sourcecode}
-or as global option
-\begin{sourcecode}
- \documentclass[verbose]{article}
-\end{sourcecode}
-or via the setup\changedversion{0.13} command as options belonging to the
-\module{package}, see also section~\vref{sec:setting-options}:
-\begin{sourcecode}
- \xsimsetup{package/verbose}
-\end{sourcecode}
+\begin{bewareofthedog}
+ Although those options technically belong to the \module{package} module
+ (see also section~\vref{sec:setting-options}) it is \emph{not} possible to
+ set them via \cs{xsimsetup}.
+\end{bewareofthedog}
\subsection{Setting Options}\label{sec:setting-options}
Apart from the package options already described in
@@ -208,7 +207,8 @@ also means two additional commands exist:
\section{Exercises and Solutions}
The two predefined environments for exercises and solutions are the following
-ones:
+ones\footnote{When you load \xsim\ with the \option{blank} those environments
+ will \emph{not} be defined!}:
\begin{environments}
\environment{exercise}[\oarg{\acsp*{prop}}]
Input and typeset an exercise. See section~\vref{sec:exercise-properties}
@@ -334,15 +334,15 @@ package option:
A lot of the lines \xsim\ writes to the auxiliary file and reads in a
subsequent run look like this:
\begin{sourcecode}
- \XSIM{points}{exercise-2=={4}|exercise-10=={2.5}|problem-11=={5}}
+ \XSIM{points}{exercise-2=={4}||exercise-10=={2.5}||problem-11=={5}}
\end{sourcecode}
As you can see different entries of the various properties of exercises are
- separated with a \code{|}. This means that you cannot use this symbol
- inside properties. This is why \xsim\ provides an option to change this
- marker.
+ separated with \code{||}. This means that you cannot use this symbol
+ combination inside properties. For this reason \xsim\ provides an option to
+ change the marker.
\end{bewareofthedog}
\begin{options}
- \keyval{split-aux-lists}{string}\Default{\code{|}}
+ \keyval{split-aux-lists}{string}\Default{\code{||}}
Set\sinceversion{0.11} the string that is used to separate the property
entries in the auxiliary file.
\end{options}
@@ -515,30 +515,37 @@ Exercise like the \env{exercise} environment and possibly others defined with
True if an exercise has been used at least once. For an existing exercise
this is only false for exercises that have been collected
(\cf~section~\vref{sec:collecting-exercises}).
+ \propbool{solution}
+ \sinceversion{0.17}Holds the solution boolean of an exercise. If this is
+ true then a solution has the same text\slash environment body as the
+ corresponding exercise. (This might be useful for multiple choice
+ questions for example.)
\propval{tags}{csv list of tags}
Holds the list of tags the exercise should be associated with.
\propval{topics}{csv list of topics}
Holds the list of topics the exercise should be associated with.
\propval{page}{text}
- Holds the page counter value representation of an exercise (\ie, what you
- usually know as \cs*{thepage}).
+ Holds the page counter value representation of an exercise \\
+ (\ie, what you usually know as \cs*{thepage}).
\propval{page-value}{integer}
- Holds the page counter value of an exercise (\ie, what you usually know as
- \cs*{the}\cs*{value}\Marg{page}).
+ Holds the page counter value of an exercise \\
+ (\ie, what you usually know as \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}).
+ 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*{the}\cs*{value}\Marg{section}).
+ Holds the section counter value of an exercise \\
+ (\ie, what you usually know 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.}
+ 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*{the}\cs*{value}\Marg{chapter}). \emph{Only if a command \cs*{chapter}
- \emph{and} a counter \code{chapter} exist.}
+ Holds the chapter counter value of an exercise \\
+ (\ie, what you usually know 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
@@ -594,15 +601,12 @@ others can be set using the optional argument of the exercise environment.
This is better demonstrated with an example:
\begin{example}
- % \lipsum is provided by package `lipsum'
\begin{exercise}
- \lipsum[4]
\verb+\GetExerciseProperty{id}+: \GetExerciseProperty{id} \par
\verb+\GetExerciseAliasProperty{ID}+: \GetExerciseAliasProperty{ID} \par
\verb+\GetExerciseProperty{ID}+: \GetExerciseProperty{ID}
\end{exercise}
\begin{exercise}[ID=foo-bar]
- \lipsum[4]
\verb+\GetExerciseProperty{id}+: \GetExerciseProperty{id} \par
\verb+\GetExerciseAliasProperty{ID}+: \GetExerciseAliasProperty{ID} \par
\verb+\GetExerciseProperty{ID}+: \GetExerciseProperty{ID}
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls b/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
index 6e1359c0b14..3fa56cc833b 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
+++ b/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
@@ -522,6 +522,7 @@
\XSIMfilewritestart*{\jobname.tmp}%
}%
\endgroup
+
\def\xsimman@read@options@[#1]{\pgfqkeys{/cnltx}{#1}}
\RenewDocumentEnvironment{sourcecode}{}
@@ -565,6 +566,7 @@
}
{%
\XSIMfilewritestop
+ \catcode`\^^M=5
\ifbool{cnltx@sidebyside}
{%
\cnltxcode
@@ -865,6 +867,16 @@
% ----------------------------------------------------------------------------
% versions:
+\xsim@add@version{0.0} {2017-02-09}
+\xsim@add@version{0.1} {2017-03-19}
+\xsim@add@version{0.2} {2017-03-21}
+\xsim@add@version{0.4} {2017-03-24}
+\xsim@add@version{0.5} {2017-03-30}
+\xsim@add@version{0.5a} {2017-04-15}
+\xsim@add@version{0.5b} {2017-04-16}
+\xsim@add@version{0.6} {2017-04-27}
+\xsim@add@version{0.6a} {2017-04-28}
+\xsim@add@version{0.7} {2017-05-09}
\xsim@add@version{0.8} {2017-05-18}
\xsim@add@version{0.8a} {2017-05-19}
\xsim@add@version{0.8b} {2017-05-23}
@@ -875,8 +887,11 @@
\xsim@add@version{0.12} {2019-09-26}
\xsim@add@version{0.13} {2019-10-06}
\xsim@add@version{0.14} {2019-10-13}
+\xsim@add@version{0.14a} {2019-10-19}
\xsim@add@version{0.15} {2019-11-02}
\xsim@add@version{0.16} {2019-11-10}
+\xsim@add@version{0.16a} {2020-01-16}
+\xsim@add@version{0.17} {2020-02-21}
% ----------------------------------------------------------------------------
\newrobustcmd*\xsimauxfileinfo{%
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
index 69e5a9a6183..4fa95620a35 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
@@ -49,10 +49,10 @@
\cs_new_protected:Npn \XSIM #1 { \use:c {XSIMaux#1} }
-\cs_new_protected:Npn \xsim_new_aux_cs:cpn #1
+\cs_new_protected:Npn \xsim_new_aux_property:cpn #1
{ \cs_new_protected:cpn {XSIMaux#1} }
-\cs_new_protected:Npn \xsim_add_cs_to_aux:nn #1#2
+\cs_new_protected:Npn \xsim_add_property_to_aux:nn #1#2
{
\xsim_verbose:n { Writing~ command~ \XSIM {#1}~ to~ aux~ file }
\xsim_write_to_aux:x { \token_to_str:N \XSIM {#1} #2 }
@@ -83,8 +83,11 @@
}
}
-\xsim_new_aux_cs:cpn {readaux}
- { \file_input:n { \c_sys_jobname_str .xsim } }
+\xsim_new_aux_property:cpn {readaux}
+ {
+ \file_if_exist:nT { \c_sys_jobname_str .xsim }
+ { \file_input:n { \c_sys_jobname_str .xsim } }
+ }
% ----------------------------------------------------------------------------
% list for recording values that need to be written to the aux file and
@@ -105,7 +108,7 @@
\prop_new:c {g__xsim_list_#1_prop}
\seq_new:c {g__xsim_list_#1_seq}
\seq_new:c {g__xsim_list_recorded_#1_seq}
- \xsim_new_aux_cs:cpn {#1} ##1
+ \xsim_new_aux_property:cpn {#1} ##1
{
\prop_gclear:c {g__xsim_list_#1_prop}
\tl_if_blank:nF {##1}
@@ -193,7 +196,7 @@
{ \xsim_rerun: }
\bool_if:NF \l__xsim_empty_lists_bool
{
- \xsim_add_cs_to_aux:nn {#1}
+ \xsim_add_property_to_aux:nn {#1}
{ { \seq_use:cV {g__xsim_list_#1_seq} \l__xsim_split_aux_lists_str } }
}
}
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.base.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.base.code.tex
index 3eb336e3a3f..fbaf246c0f5 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.base.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.base.code.tex
@@ -124,14 +124,21 @@
\prg_new_conditional:Npnn \xsim_if_final: {p,T,F,TF}
{
- \bool_if:NTF \g_xsim_final_bool
+ \bool_if:NTF \g__xsim_final_bool
{ \prg_return_true: }
{ \prg_return_false: }
}
\prg_new_conditional:Npnn \xsim_if_verbose: {p,T,F,TF}
{
- \bool_if:NTF \g_xsim_verbose_bool
+ \bool_if:NTF \g__xsim_verbose_bool
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+\prg_new_conditional:Npnn \xsim_if_package_blank: {p,T,F,TF}
+ {
+ \bool_if:NTF \g__xsim_blank_bool
{ \prg_return_true: }
{ \prg_return_false: }
}
@@ -170,8 +177,9 @@
\prg_new_conditional:Npnn \xsim_if_chapter: {p,T,F,TF}
{
- \bool_if:nTF
- { \cs_if_exist_p:N \chapter && \cs_if_exist_p:N \c@chapter }
+ \bool_lazy_and:nnTF
+ { \cs_if_exist_p:N \chapter }
+ { \cs_if_exist_p:N \c@chapter }
{ \prg_return_true: }
{ \prg_return_false: }
}
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.blanks.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.blanks.code.tex
index 70c4440537f..e2cc6c584ce 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.blanks.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.blanks.code.tex
@@ -78,8 +78,9 @@
\mode_if_math:TF
{ \hbox_set:Nn \l__xsim_blank_box { $ \m@th \mathpalette{}{#1} $ } }
{ \hbox_set:Nn \l__xsim_blank_box {#1} }
- \bool_if:nTF
- { \xsim_if_inside_solution_p: || \l__xsim_fill_blank_bool }
+ \bool_lazy_or:nnTF
+ { \xsim_if_inside_solution_p: }
+ { \l__xsim_fill_blank_bool }
{ \xsim_write_cloze_filled:n {#1} }
{
\bool_if:NTF \l__xsim_blank_width_bool
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.collections.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.collections.code.tex
index eba9940e239..b85ffa2a156 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.collections.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.collections.code.tex
@@ -351,11 +351,9 @@
{
\prop_if_in:NnTF \g__xsim_collections_prop {#1}
{
- \bool_if:nTF
- {
- !\str_if_eq_p:en {#1} {all~ exercises} &&
- \prop_item:Nn \g__xsim_collections_prop {#1}
- }
+ \bool_lazy_and:nnTF
+ { !\str_if_eq_p:en {#1} {all~ exercises} }
+ { \prop_item:Nn \g__xsim_collections_prop {#1} }
{ \prg_return_true: }
{ \prg_return_false: }
}
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.definitions.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.definitions.code.tex
index c6fa9bd0113..5b87fb0f4f8 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.definitions.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.definitions.code.tex
@@ -59,6 +59,7 @@
\DeclareExerciseProperty * {use}
\DeclareExerciseProperty * {used}
\DeclareExerciseProperty *-{use!}
+\DeclareExerciseProperty * {solution}
\XSIMifchapterT{
\DeclareExerciseProperty {chapter-value}
\DeclareExerciseProperty {chapter}
@@ -165,18 +166,21 @@
% ----------------------------------------------------------------------------
-\DeclareExerciseType {exercise} {
- exercise-env = exercise ,
- solution-env = solution ,
- exercise-name = \XSIMtranslate {exercise} ,
- exercises-name = \XSIMtranslate {exercises} ,
- solution-name = \XSIMtranslate {solution} ,
- solutions-name = \XSIMtranslate {solutions} ,
- exercise-template = default ,
- solution-template = default ,
- exercise-heading = \subsection* ,
- solution-heading = \subsection*
-}
+\xsim_if_package_blank:F
+ {
+ \DeclareExerciseType {exercise} {
+ exercise-env = exercise ,
+ solution-env = solution ,
+ exercise-name = \XSIMtranslate {exercise} ,
+ exercises-name = \XSIMtranslate {exercises} ,
+ solution-name = \XSIMtranslate {solution} ,
+ solutions-name = \XSIMtranslate {solutions} ,
+ exercise-template = default ,
+ solution-template = default ,
+ exercise-heading = \subsection* ,
+ solution-heading = \subsection*
+ }
+ }
% ----------------------------------------------------------------------------
@@ -473,4 +477,6 @@
% ----------------------------------------------------------------------------
\file_input_stop:
-2019/02/17 fixed error in German translations (issue 39)
+2019/02/17 - fix issue #39 (error in German translations)
+2020/02/19 - implement issue #33 (solution property)
+2020/02/20 - implement issue #31 (blank package option)
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex
index 9c0c30111a0..37a3df68e99 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex
@@ -48,6 +48,7 @@
\tl_new:N \l__xsim_file_path_and_name_tl
\tl_new:N \l__xsim_file_name_tl
\tl_new:N \l__xsim_file_extension_tl
+\tl_new:N \l__xsim_solution_tl
\bool_new:N \l__xsim_options_given_bool
\bool_new:N \l__xsim_insert_mode_bool
@@ -276,33 +277,51 @@
% #3: exercise|solution
\cs_new_protected:Npn \xsim_typeset_environment:nnn #1#2#3
{
+ \xsim_if_exchange:nnnT {#1} {#2} {#3}
+ { \__xsim_set_file_signature:nnn {#1} {#2} {exercise} }
\xsim_verbose:n
{ Typesetting~ #3~ environment~ type~ `#1'~ id~ `#2' }
- \use:x
+ \xsim_use_hook:nnn {#1} {#3} {pre}
+ \xsim_use_template:nx
+ {begin}
+ { \xsim_get_parameter:nn {#1} {#3-template} }
+ \xsim_use_hook:nnn {#1} {#3} {begin}
+ \xsim_if_write_to_files:TF
{
- \exp_not:N \par
- \xsim_use_hook:nnn {#1} {#3} {pre}
- \xsim_use_template:nn
- {begin}
- { \xsim_get_parameter:nn {#1} {#3-template} }
- \xsim_use_hook:nnn {#1} {#3} {begin}
- \xsim_if_write_to_files:TF
+ \file_if_exist:nTF { \exp_not:V \l__xsim_file_path_and_name_tl }
+ { \file_input:n { \exp_not:V \l__xsim_file_path_and_name_tl } }
{
- \file_if_exist:nTF { \exp_not:V \l__xsim_file_path_and_name_tl }
- { \file_input:n { \exp_not:V \l__xsim_file_path_and_name_tl } }
- {
- \xsim_verbose:n
- { File~ `\l__xsim_file_path_and_name_tl'~ doesn't~ exist. }
- }
+ \xsim_verbose:n
+ { File~ `\l__xsim_file_path_and_name_tl'~ doesn't~ exist. }
}
+ }
+ {
+ \xsim_if_exchange:nnnTF {#1} {#2} {#3}
+ { \xsim_get_property:nnn {#1} {#2} {exercise-body} }
{ \xsim_get_property:nnn {#1} {#2} {#3-body} }
- \xsim_use_hook:nnn {#1} {#3} {end}
- \xsim_use_template:nn
- {end}
- { \xsim_get_parameter:nn {#1} {#3-template} }
- \xsim_use_hook:nnn {#1} {#3} {post}
- \exp_not:N \par
}
+ \xsim_synchronize_goals:nn {#1} {#2}
+ \str_if_eq:nnT {#3} {exercise}
+ { \xsim_update_goals:nn {#1} {#2} }
+ \xsim_use_hook:nnn {#1} {#3} {end}
+ \xsim_use_template:nx
+ {end}
+ { \xsim_get_parameter:nn {#1} {#3-template} }
+ \xsim_use_hook:nnn {#1} {#3} {post}
+ }
+
+% #1: type
+% #2: id
+% #3: exercise|solution
+\prg_new_conditional:Npnn \xsim_if_exchange:nnn #1#2#3 {T,F,TF}
+ {
+ \str_if_eq:nnTF {#3} {solution}
+ {
+ \xsim_if_boolean_property:nnnTF {#1} {#2} {solution}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ { \prg_return_false: }
}
% #1: type
@@ -334,7 +353,9 @@
% #4: exercise|solution
\cs_new_protected:Npn \xsim_insert:nnnn #1#2#3#4
{
- \xsim_if_exist:nnnTF {#1} {#2} {#4}
+ \xsim_if_exchange:nnnTF {#1} {#2} {#4}
+ { \xsim_if_exist:nnnTF {#1} {#2} {exercise} }
+ { \xsim_if_exist:nnnTF {#1} {#2} {#4} }
{
\xsim_verbose:n
{ Inserting~ #4~ type~ `#1'~ id~ `#2'. }
@@ -355,6 +376,8 @@
section-value = \the\value{section} ,
section = \thesection
}
+ \xsim_synchronize_goals:nn {#1} {#2}
+ \xsim_update_goals:nn {#1} {#2}
}
\xsim_if_property_exist:nT {chapter}
{
@@ -414,10 +437,16 @@
\group_begin:
\xsim_if_write_to_files:TF
{
- \__xsim_set_file_signature:nnn {#1} {#2} {#3}
+ \xsim_if_exchange:nnnTF {#1} {#2} {#3}
+ { \__xsim_set_file_signature:nnn {#1} {#2} {exercise} }
+ { \__xsim_set_file_signature:nnn {#1} {#2} {#3} }
\file_input:n { \l__xsim_file_path_and_name_tl }
}
- { \xsim_get_property:nnn {#1} {#2} {#3-body} }
+ {
+ \xsim_if_exchange:nnnTF {#1} {#2} {#3}
+ { \xsim_get_property:nnn {#1} {#2} {exercise-body} }
+ { \xsim_get_property:nnn {#1} {#2} {#3-body} }
+ }
\group_end:
}
\cs_generate_variant:Nn \xsim_input:nnn {oo}
@@ -492,3 +521,8 @@
2019/02/17 - fix issue #43
2019/10/03 - add possibility to save environment bodies to property list
+2020/02/15 - remove spurious \par at the beginning and end of typeset
+ exercises and solutions
+2020/02/19 - implement issue #33 (solution property)
+2020/02/20 - fix issue #27
+ - implement issue #2
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex
index 6f1503dbc41..2fc9e4d142b 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex
@@ -394,35 +394,82 @@
\int_gincr:N \g_xsim_id_int
\int_compare:nF { \g_xsim_max_id_int > \g_xsim_id_int }
{ \int_gset_eq:NN \g_xsim_max_id_int \g_xsim_id_int }
- \xsim_set_properties:nxx {#1} { \int_use:N \g_xsim_id_int }
+ \tl_gset:Nx \g_xsim_exercise_id_tl { \int_use:N \g_xsim_id_int }
+ % save the goal values from the auxiliary files:
+ \xsim_foreach_goal:n
{
+ \xsim_temporary_goal_new:nVn {#1} \g_xsim_exercise_id_tl {##1}
+ \xsim_if_property_set:nVnT {#1} \g_xsim_exercise_id_tl {##1}
+ {
+ \xsim_temporary_goal_set:nVnn
+ {#1}
+ \g_xsim_exercise_id_tl
+ {##1}
+ { \xsim_get_property:nVn {#1} \g_xsim_exercise_id_tl {##1} }
+ }
+ }
+ \xsim_set_properties:nVx {#1} \g_xsim_exercise_id_tl
+ {
+ % preset options so the user doesn't has to:
print = true ,
use = true ,
+ % options set by the user:
\exp_not:n {#2} ,
- id = \int_use:N \g_xsim_id_int ,
+ % options which need to have certain values:
+ id = \g_xsim_exercise_id_tl ,
section-value = \arabic{section} ,
section = \thesection ,
page-value = \arabic{page} ,
sectioning =
- { \cs_if_exist:NTF \chapter { \arabic{chapter} } {0} }
+ { \cs_if_exist:NTF \thechapter { \arabic {chapter} } {0} }
{ \arabic {section} }
{ \arabic {subsection} }
{ \arabic {subsubsection} }
{ \arabic {paragraph} } ,
page = \thepage ,
+ % this cannot yet be set (see below):
used = false
}
+ % temporary goal now: either 0 or equal the complete property
+ % property: equal to the given value
+ \xsim_foreach_goal:n
+ {
+ \fp_set:Nn \l__xsim_tmpa_fp
+ { \xsim_temporary_goal_get:nVn {#1} \g_xsim_exercise_id_tl {##1} }
+ % set temporary goal to given property:
+ \xsim_if_property_given:nTF {##1}
+ {
+ \xsim_temporary_goal_set:nVnn
+ {#1}
+ \g_xsim_exercise_id_tl
+ {##1}
+ { \xsim_get_property:nVn {#1} \g_xsim_exercise_id_tl {##1} }
+ }
+ {
+ \xsim_temporary_goal_set:nVnn
+ {#1}
+ \g_xsim_exercise_id_tl
+ {##1}
+ {0}
+ }
+ % update to property to complete value:
+ \xsim_if_property_set:nVnT {#1} \g_xsim_exercise_id_tl {##1}
+ {
+ \xsim_set_property:nVnx {#1} \g_xsim_exercise_id_tl {##1}
+ { \fp_to_decimal:N \l__xsim_tmpa_fp }
+ }
+ }
\xsim_if_property_exist:nT {chapter}
{
- \xsim_set_properties:nxx {#1} { \int_use:N \g_xsim_id_int }
+ \xsim_set_properties:nVx {#1} \g_xsim_exercise_id_tl
{
chapter-value = \arabic{chapter} ,
chapter = \thechapter
}
}
- \tl_gclear:N \g_xsim_exercise_id_tl
- \xsim_gsave_property:nxnN {#1} { \int_use:N \g_xsim_id_int } {id}
- \g_xsim_exercise_id_tl
+ % \tl_gclear:N \g_xsim_exercise_id_tl
+ % \xsim_gsave_property:nVnN {#1} \l__xsim_tmpa_tl {id}
+ % \g_xsim_exercise_id_tl
\tl_gset_eq:NN \ExerciseID \g_xsim_exercise_id_tl
\tl_gset:Nn \ExerciseType {#1}
\xsim_verbose:x
@@ -449,7 +496,6 @@
\xsim_set_property:nVnn {#1} \g_xsim_exercise_id_tl
{use}
{true}
- \xsim_update_goals:nV {#1} \g_xsim_exercise_id_tl
}
{
\xsim_set_properties:nVn {#1} \g_xsim_exercise_id_tl
@@ -524,7 +570,7 @@
% ----------------------------------------------------------------------------
-\xsim_new_aux_cs:cpn {total-number} #1
+\xsim_new_aux_property:cpn {total-number} #1
{ \int_gset:Nn \g_xsim_max_id_int {#1} }
\RequirePackage {etoolbox}
@@ -535,7 +581,7 @@
{
\tl_new:c { number of #1 s }
\tl_set:cn { number of #1 s } {0}
- \xsim_new_aux_cs:cpn {#1} ##1
+ \xsim_new_aux_property:cpn {#1} ##1
{ \tl_gset:cn { number of #1 s } {##1} }
}
}
@@ -556,10 +602,10 @@
\int_compare:nNnF { \g_xsim_max_id_int } = { \g_xsim_id_int }
{ \xsim_empty_lists: }
}
- \xsim_add_cs_to_aux:nn {total-number} { { \int_use:N \g_xsim_id_int } }
+ \xsim_add_property_to_aux:nn {total-number} { { \int_use:N \g_xsim_id_int } }
\xsim_foreach_exercise_type:n
{
- \xsim_add_cs_to_aux:nn {#1}
+ \xsim_add_property_to_aux:nn {#1}
{ { \arabic { \xsim_get_parameter:nn {#1} {number} } } }
}
\xsim_update_list:n {types}
@@ -567,3 +613,5 @@
% ----------------------------------------------------------------------------
\file_input_stop:
+
+2020/02/21 - implement issue #2
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.goals.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.goals.code.tex
index cf7975c4bd0..6b17d2bc3f5 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.goals.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.goals.code.tex
@@ -49,6 +49,7 @@
{#1}
\seq_put_right:Nn \l__xsim_goals_seq {#1}
\fp_gzero_new:c {g__xsim_goal_#1_fp}
+ \bool_new:c {l__xsim_goal_#1_given_bool}
\fp_gzero_new:c {l__xsim_current_goal_#1_fp}
\fp_if_exist:cF {g__xsim_total_goal_#1_fp}
{ \fp_new:c {g__xsim_total_goal_#1_fp} }
@@ -73,6 +74,16 @@
{ \prg_return_false: }
}
+\prg_new_conditional:Npnn \xsim_if_goal_given:n #1 {p,T,F,TF}
+ {
+ \bool_if:cTF {l__xsim_goal_#1_given_bool}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+\cs_new_protected:Npn \xsim_goal_given:n #1
+ { \bool_set_true:c {l__xsim_goal_#1_given_bool} }
+
% #1: exercise type
% #2: id
% #3: goal
@@ -99,6 +110,28 @@
\cs_new_protected:Npn \xsim_foreach_goal:n #1
{ \seq_map_inline:Nn \l__xsim_goals_seq {#1} }
+% #1: type
+% #2: id
+\cs_new_protected:Npn \xsim_synchronize_goals:nn #1#2
+ {
+ \xsim_foreach_goal:n
+ {
+ \xsim_if_property_set:nnnTF {#1} {#2} {##1}
+ {
+ \xsim_set_property:nnnx {#1} {#2} {##1}
+ { \xsim_temporary_goal_get:nnn {#1} {#2} {##1} }
+ }
+ {
+ \fp_compare:nNnT
+ { \xsim_temporary_goal_get:nnn {#1} {#2} {##1} } > {0}
+ {
+ \xsim_set_property:nnnx {#1} {#2} {##1}
+ { \xsim_temporary_goal_get:nnn {#1} {#2} {##1} }
+ }
+ }
+ }
+ }
+
% #1: exercise type
% #2: id
% #3: goal
@@ -108,9 +141,10 @@
\xsim_if_goal_exist:nT {#3}
{
\xsim_verbose:n { Adding~ `#4'~ to~ `#3'~ goal~ of~ #1~ #2 }
- \fp_gadd:cn {g__xsim_goal_#3_fp} {#4}
- \fp_gadd:cn {g__xsim_#1_goal_#3_fp} {#4}
- \fp_add:cn {l__xsim_current_goal_#3_fp} {#4}
+ % \fp_gadd:cn {g__xsim_goal_#3_fp} {#4}
+ % \fp_gadd:cn {g__xsim_#1_goal_#3_fp} {#4}
+ % \fp_add:cn {l__xsim_current_goal_#3_fp} {#4}
+ \xsim_temporary_goal_add:nnnn {#1} {#2} {#3} {#4}
}
}
\cs_generate_variant:Nn \xsim_addto_goal:nnnn {xx,nVnx}
@@ -129,6 +163,46 @@
\cs_generate_variant:Nn \xsim_if_goal_value:nnnnTF {xx}
% ----------------------------------------------------------------------------
+% we need some kind of temporary variable to be able to set goals both as
+% option to exercises and within the exercise body
+
+% #1: type
+% #2: id
+% #3: goal
+\cs_new_protected:Npn \xsim_temporary_goal_new:nnn #1#2#3
+ { \fp_new:c {g__xsim_goal_#3_#1_#2_fp} }
+\cs_generate_variant:Nn \xsim_temporary_goal_new:nnn {nV}
+
+% #1: type
+% #2: id
+% #3: goal
+% #4: value
+\cs_new_protected:Npn \xsim_temporary_goal_set:nnnn #1#2#3#4
+ { \fp_gset:cn {g__xsim_goal_#3_#1_#2_fp} {#4} }
+\cs_generate_variant:Nn \xsim_temporary_goal_set:nnnn {nV}
+
+% #1: type
+% #2: id
+% #3: goal
+% #4: value
+\cs_new_protected:Npn \xsim_temporary_goal_add:nnnn #1#2#3#4
+ { \fp_gadd:cn {g__xsim_goal_#3_#1_#2_fp} {#4} }
+\cs_generate_variant:Nn \xsim_temporary_goal_add:nnnn {nV}
+
+% #1: type
+% #2: id
+% #3: goal
+\cs_new:Npn \xsim_temporary_goal_get:nnn #1#2#3
+ { \fp_to_decimal:c {g__xsim_goal_#3_#1_#2_fp} }
+\cs_generate_variant:Nn \xsim_temporary_goal_get:nnn {nV}
+
+% #1: type
+% #2: id
+% #3: goal
+\cs_new_protected:Npn \__xsim_temporary_goal_show:nnn #1#2#3
+ { \fp_show:c {g__xsim_goal_#3_#1_#2_fp} }
+
+% ----------------------------------------------------------------------------
% a function which can be used to modify how the numbers of a goal are
% printed:
\cs_new_protected:Npn \__xsim_print_goal:n #1 {#1}
@@ -254,12 +328,12 @@
% #1: exercise type
% #2: goal
% #3: value
-\xsim_new_aux_cs:cpn {goal} #1#2#3
+\xsim_new_aux_property:cpn {goal} #1#2#3
{ \fp_gset:cn {g__xsim_total_#1_goal_#2_fp} {#3} }
% #1: goal
% #2: value
-\xsim_new_aux_cs:cpn {totalgoal} #1#2
+\xsim_new_aux_property:cpn {totalgoal} #1#2
{ \fp_gset:cn {g__xsim_total_goal_#1_fp} {#2} }
\xsim_at_begin_document:n
@@ -278,7 +352,7 @@
{
\xsim_foreach_exercise_type:n
{
- \xsim_add_cs_to_aux:nn {goal}
+ \xsim_add_property_to_aux:nn {goal}
{ {##1} {#1} { \fp_to_decimal:c {g__xsim_##1_goal_#1_fp} } }
}
\tl_set:Nx \l__xsim_tmpa_tl
@@ -286,7 +360,7 @@
\tl_set:Nx \l__xsim_tmpb_tl
{ \fp_to_decimal:c {g__xsim_total_goal_recorded_#1_fp} }
\tl_if_eq:NNF \l__xsim_tmpa_tl \l__xsim_tmpb_tl { \xsim_rerun: }
- \xsim_add_cs_to_aux:nn {totalgoal}
+ \xsim_add_property_to_aux:nn {totalgoal}
{ {#1} { \fp_to_decimal:c {g__xsim_goal_#1_fp} } }
}
}
@@ -306,4 +380,6 @@
% ----------------------------------------------------------------------------
\file_input_stop:
-2019/01/30 bug fix (cf. https://texwelt.de/wissen/fragen/24101/)
+2019/01/30 - bug fix (cf. https://texwelt.de/wissen/fragen/24101/)
+2020/02/20 - add temporary variables for the whole subpoint thing
+ (cf. issue #2)
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex
index add24310181..825b8f25176 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex
@@ -54,6 +54,7 @@
\seq_new:N \l__xsim_boolean_properties_seq
\seq_new:N \l__xsim_unique_properties_seq
\seq_new:N \l__xsim_noupdate_properties_seq
+\seq_new:N \l__xsim_given_properties_seq
\prop_new:N \g__xsim_properties_prop
% new property:
@@ -131,6 +132,15 @@
{ \prg_return_false: }
}
+% true if property #1 has been set in the /last/ call of
+% \xsim_set_properties:nnn
+\prg_new_conditional:Npnn \xsim_if_property_given:n #1 {p,T,F,TF}
+ {
+ \seq_if_in:NnTF \l__xsim_given_properties_seq {#1}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
% #1: property
% #2: value
\prg_new_conditional:Npnn \xsim_if_property_unique_value:nn #1#2 {p,T,F,TF}
@@ -178,8 +188,12 @@
}
{ \msg_error:nnn {xsim} {unknown-property} {#3} }
}
-\cs_generate_variant:Nn \xsim_set_property:nnnn {nnxx,nnnV,nV,nVnx,nnnx,xx,xxnx}
+\cs_generate_variant:Nn \xsim_set_property:nnnn {nnxx,nnnV,nV,nVnx,nnnx,xx,xxnx,nxnx}
+% #1: type
+% #2: id
+% #3: property
+% #4: value
\cs_new_protected:Npn \__xsim_set_boolean_property:nnnn #1#2#3#4
{
\str_case_e:nnTF { \str_lowercase:n {#4} }
@@ -191,6 +205,10 @@
{ \__xsim_set_property:nnnn {#1} {#2} {#3} {false} }
}
+% #1: type
+% #2: id
+% #3: property
+% #4: value
\cs_new_protected:Npn \__xsim_set_unique_property:nnnn #1#2#3#4
{
\__xsim_set_property:nnnn {#1} {#2} {#3} {#4}
@@ -309,6 +327,7 @@
% #3: csv list of properties
\cs_new_protected:Npn \xsim_set_properties:nnn #1#2#3
{
+ \seq_clear:N \l__xsim_given_properties_seq
\clist_map_inline:nn {#3}
{
\seq_set_split:Nnx \l__xsim_tmpa_seq {=} { \tl_trim_spaces:n {##1} }
@@ -317,6 +336,8 @@
{#2}
{ \seq_item:Nn \l__xsim_tmpa_seq {1} }
{ \seq_item:Nn \l__xsim_tmpa_seq {2} }
+ \seq_put_right:Nx \l__xsim_given_properties_seq
+ { \seq_item:Nn \l__xsim_tmpa_seq {1} }
}
\xsim_property_set_aliases:nn {#1} {#2}
}
@@ -326,16 +347,15 @@
% #1: type
% #2: id
% #3: property
-\prg_new_protected_conditional:Npnn \xsim_if_property_set:nnn #1#2#3 {T,F,TF}
+\prg_new_conditional:Npnn \xsim_if_property_set:nnn #1#2#3 {T,F,TF}
{
- \prop_if_in:NxTF \g__xsim_properties_prop
- { #2 ! #1 ! #3 }
+ \prop_if_in:NnTF \g__xsim_properties_prop {#2!#1!#3}
{ \prg_return_true: }
{ \prg_return_false: }
}
-\cs_generate_variant:Nn \xsim_if_property_set:nnnTF {nnx,xx,nV}
-\cs_generate_variant:Nn \xsim_if_property_set:nnnF {nx,nnx,xx}
-\cs_generate_variant:Nn \xsim_if_property_set:nnnT {nnx,xx}
+\prg_generate_conditional_variant:Nnn \xsim_if_property_set:nnn
+ {nx,nnx,xx,nV}
+ {T,F,TF}
% ----------------------------------------------------------------------------
@@ -414,7 +434,7 @@
% #3: property
\cs_new:Npn \xsim_get_property:nnn #1#2#3
{ \prop_item:Nn \g__xsim_properties_prop { #2 ! #1 ! #3 } }
-\cs_generate_variant:Nn \xsim_get_property:nnn {nx,xx,oo,no,nnf,nf,oof,nV}
+\cs_generate_variant:Nn \xsim_get_property:nnn {nx,ne,xx,oo,no,nnf,nf,oof,nV}
% #1: property
% #2: value
@@ -482,7 +502,7 @@
\cs_generate_variant:Nn \xsim_if_boolean_property:nnnF {nV}
\cs_new_protected:Npn \xsim_save_property:nnnN #1#2#3#4
- { \prop_get:NnN \g__xsim_properties_prop { #2 ! #1 ! #3 } #4 }
+ { \prop_get:NnN \g__xsim_properties_prop {#2!#1!#3} #4 }
\cs_generate_variant:Nn \xsim_save_property:nnnN {nx,xx}
\cs_new_protected:Npn \xsim_gsave_property:nnnN #1#2#3#4
@@ -490,7 +510,7 @@
\xsim_save_property:nnnN {#1} {#2} {#3} #4
\tl_gset:NV #4 #4
}
-\cs_generate_variant:Nn \xsim_gsave_property:nnnN {nx,xx}
+\cs_generate_variant:Nn \xsim_gsave_property:nnnN {nx,xx,nV}
% ----------------------------------------------------------------------------
\file_input_stop:
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex
index 2444ef17453..2087adf9de3 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex
@@ -52,7 +52,7 @@
% #1: random list id
% #2: csv list of integers
-\xsim_new_aux_cs:cpn {random} #1#2
+\xsim_new_aux_property:cpn {random} #1#2
{
\xsim_random_list_if_exist:nF {#1}
{ \xsim_new_random_list:n {#1} }
@@ -100,7 +100,7 @@
\xsim_random_list_if_empty:nT {#1}
{ \xsim_set_random_list_from_seq:nN {#1} #2 }
\xsim_verbose:n {Saving~ random~ list~ `#1'}
- \xsim_add_cs_to_aux:nn {random}
+ \xsim_add_property_to_aux:nn {random}
{ {#1} { \xsim_use_random_list:nn {#1} {,} } }
}
@@ -165,12 +165,9 @@
% #4: seq variable
\cs_new_protected:Npn \xsim_generate_random_list:nnnN #1#2#3#4
{
- \bool_if:nT
- {
- !\xsim_random_list_if_exist_p:n {#1}
- ||
- \xsim_random_list_if_empty_p:n {#1}
- }
+ \bool_lazy_or:nnT
+ { !\xsim_random_list_if_exist_p:n {#1} }
+ { \xsim_random_list_if_empty_p:n {#1} }
{
\xsim_verbose:n
{Generating~ random~ list~ `#1'~ with~ #3~ out~ of~ #2~ items}
@@ -199,12 +196,9 @@
% #2: random list id
\cs_new_protected:Npn \xsim_print_random_exercises:Nn #1#2
{
- \bool_if:nT
- {
- \xsim_random_list_if_exist_p:n {#2}
- &&
- !\xsim_random_list_if_empty_p:n {#2}
- }
+ \bool_lazy_and:nnT
+ { \xsim_random_list_if_exist_p:n {#2} }
+ { !\xsim_random_list_if_empty_p:n {#2} }
{
\xsim_verbose:x
{
@@ -220,12 +214,13 @@
{ \seq_item:Nn #1 {##1} }
\tl_set:Nx \l__xsim_tmpb_tl
{ \xsim_get_type_for_property:nV {id} \l__xsim_tmpa_tl }
- \bool_if:nT
+ \bool_lazy_or:nnT
{
\tl_if_eq_p:NN
\l__xsim_print_random_choice_tl
\c__xsim_print_random_both_tl
- ||
+ }
+ {
\tl_if_eq_p:NN
\l__xsim_print_random_choice_tl
\c__xsim_print_random_exercise_tl
@@ -242,12 +237,13 @@
{exercise}
}
}
- \bool_if:nT
+ \bool_lazy_or:nnT
{
\tl_if_eq_p:NN
\l__xsim_print_random_choice_tl
\c__xsim_print_random_both_tl
- ||
+ }
+ {
\tl_if_eq_p:NN
\l__xsim_print_random_choice_tl
\c__xsim_print_random_solution_tl
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex
index eddeaa911f8..902f377864f 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex
@@ -82,7 +82,9 @@
% #2: id
\prg_new_protected_conditional:Npnn \xsim_if_solution_exist:nn #1#2 {T,F,TF}
{
- \xsim_if_exist:nnnTF {#1} {#2} {solution}
+ \xsim_if_boolean_property:nnnTF {#1} {#2} {solution}
+ { \xsim_if_exist:nnnTF {#1} {#2} {exercise} }
+ { \xsim_if_exist:nnnTF {#1} {#2} {solution} }
{ \prg_return_true: }
{ \prg_return_false: }
}
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.sty b/Master/texmf-dist/tex/latex/xsim/xsim.sty
index a6a5538c67a..0939f4796a2 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.sty
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.sty
@@ -29,9 +29,9 @@
\ExplSyntaxOn
-\tl_const:Nn \c_xsim_date_tl {2020/01/16}
+\tl_const:Nn \c_xsim_date_tl {2020/02/21}
\tl_const:Nn \c_xsim_version_major_number_tl {0}
-\tl_const:Nn \c_xsim_version_minor_number_tl {16a}
+\tl_const:Nn \c_xsim_version_minor_number_tl {17}
\tl_const:Nn \c_xsim_version_subrelease_tl {}
\tl_const:Nx \c_xsim_version_number_tl
{
@@ -55,29 +55,49 @@
% options, information
-\bool_new:N \g_xsim_final_bool
-\bool_new:N \g_xsim_verbose_bool
+\bool_new:N \g__xsim_final_bool
+\bool_new:N \g__xsim_verbose_bool
\bool_new:N \g_xsim_clear_aux_bool
\bool_new:N \g__xsim_write_to_file_bool
\bool_new:N \g_xsim_use_aux_bool
\bool_new:N \g__xsim_rerun_bool
+\bool_new:N \g__xsim_blank_bool
\keys_define:nn {xsim/package}
{
- final .bool_gset:N = \g_xsim_final_bool ,
- verbose .bool_gset:N = \g_xsim_verbose_bool ,
+ final .bool_gset:N = \g__xsim_final_bool ,
+ verbose .bool_gset:N = \g__xsim_verbose_bool ,
clear-aux .bool_gset:N = \g_xsim_clear_aux_bool ,
no-files .bool_gset_inverse:N = \g__xsim_write_to_file_bool ,
no-files .initial:n = false ,
use-aux .bool_gset:N = \g_xsim_use_aux_bool ,
- use-aux .initial:n = false
+ use-aux .initial:n = false ,
+ blank .bool_gset:N = \g__xsim_blank_bool ,
+ blank .initial:n = false
}
\ProcessKeysPackageOptions {xsim/package}
+\keys_define:nn {xsim/package}
+ {
+ final .code:n = \msg_error:nnn {xsim} {load-time-option} {final} ,
+ verbose .code:n = \msg_error:nnn {xsim} {load-time-option} {verbose} ,
+ clear-aux .code:n = \msg_error:nnn {xsim} {load-time-option} {clear-aux} ,
+ no-files .code:n = \msg_error:nnn {xsim} {load-time-option} {no-files} ,
+ use-aux .code:n = \msg_error:nnn {xsim} {load-time-option} {use-aux} ,
+ blank .code:n = \msg_error:nnn {xsim} {load-time-option} {blank}
+ }
+
% --------------------------------------------------------------------------
% messages:
+\msg_new:nnn {xsim} {load-time-option}
+ {
+ `#1'~ is~ a~ load-time~ option! \\
+ You~ cannot~ set~ it~ with~ \token_to_str:N \xsimsetup ! \\
+ You~ need~ to~ use~ \token_to_str:N \usepackage [#1] {xsim} .
+ }
+
\msg_new:nnn {xsim} {rerun}
{
Exercise~ properties~ may~ have~ changed.~ Rerun~ to~ get~ them~
@@ -105,5 +125,9 @@
\xsim_do_rerun:
\xsim_close_aux:
}
-
+
+% --------------------------------------------------------------------------
\file_input_stop:
+
+2020/02/20 - implement issue #31 (blank package option)
+2020/02/21 - don't allow package options to be set with \xsimsetup
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex
index 5d87f7c750a..e43c30d34d7 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex
@@ -52,11 +52,11 @@
\file_if_exist:nTF {#2}
{ \xsim_if_final:F { \iow_open:Nn #1 {#2} } }
{
- % \g_xsim_final_bool is a global variable; however, if it is true and
+ % \g__xsim_final_bool is a global variable; however, if it is true and
% the exercise file doesn't exist, yet, we need to set it locally to
% false in order to ensure that the file is correctly written and the
% stream closed afterwards
- \bool_set_false:N \g_xsim_final_bool
+ \bool_set_false:N \g__xsim_final_bool
\iow_open:Nn #1 {#2}
}
}
diff --git a/Master/texmf-dist/tex/latex/xsim/xsimverb.sty b/Master/texmf-dist/tex/latex/xsim/xsimverb.sty
index a7cbd0706be..90373e9021d 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsimverb.sty
+++ b/Master/texmf-dist/tex/latex/xsim/xsimverb.sty
@@ -59,8 +59,8 @@
\cs_new_protected:Npn \xsimverb_bool_provide:N #1
{ \bool_if_exist:NF #1 { \bool_new:N #1 } }
-\xsimverb_bool_provide:N \g_xsim_final_bool
-\xsimverb_bool_provide:N \g_xsim_verbose_bool
+\xsimverb_bool_provide:N \g__xsim_final_bool
+\xsimverb_bool_provide:N \g__xsim_verbose_bool
\xsimverb_bool_provide:N \g_xsim_clear_aux_bool
\xsimverb_bool_provide:N \g__xsim_write_to_file_bool
\xsimverb_bool_provide:N \g_xsim_use_aux_bool
@@ -68,8 +68,8 @@
\keys_define:nn {xsimverb}
{
- final .bool_gset:N = \g_xsim_final_bool ,
- verbose .bool_gset:N = \g_xsim_verbose_bool ,
+ final .bool_gset:N = \g__xsim_final_bool ,
+ verbose .bool_gset:N = \g__xsim_verbose_bool ,
clear-aux .bool_gset:N = \g_xsim_clear_aux_bool ,
no-files .bool_gset_inverse:N = \g__xsim_write_to_file_bool ,
no-files .initial:n = false ,