texlive[53893] Master/texmf-dist: xsim (23feb20)

commits+karl at tug.org commits+karl at tug.org
Mon Feb 24 15:31:15 CET 2020


Revision: 53893
          http://tug.org/svn/texlive?view=revision&revision=53893
Author:   karl
Date:     2020-02-24 15:31:15 +0100 (Mon, 24 Feb 2020)
Log Message:
-----------
xsim (23feb20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/xsim/README
    trunk/Master/texmf-dist/doc/latex/xsim/xsim.history
    trunk/Master/texmf-dist/doc/latex/xsim/xsim.ideas
    trunk/Master/texmf-dist/doc/latex/xsim/xsim_manual.pdf
    trunk/Master/texmf-dist/doc/latex/xsim/xsim_manual.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex

Modified: trunk/Master/texmf-dist/doc/latex/xsim/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/README	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/doc/latex/xsim/README	2020-02-24 14:31:15 UTC (rev 53893)
@@ -1,5 +1,5 @@
 --------------------------------------------------------------------------
-XSIM     2020/01/21 v0.17
+XSIM     2020/02/23 v0.18
 XSIMVERB 2019/12/29 v0.1a
 
   eXercise Sheets IMproved

Modified: trunk/Master/texmf-dist/doc/latex/xsim/xsim.history
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/xsim.history	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/doc/latex/xsim/xsim.history	2020-02-24 14:31:15 UTC (rev 53893)
@@ -144,3 +144,7 @@
                    - fix issue #27
                    - implement issue #2
                    - don't allow package options to be set with \xsimsetup
+ v0.18  2020/02/23 - fix issue #56
+                   - change \printexercise and \printsolution to accept a
+                     clist of either ids or IDs (or mixed)
+                   - new templates in the `layouts' style

Modified: trunk/Master/texmf-dist/doc/latex/xsim/xsim.ideas
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/xsim.ideas	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/doc/latex/xsim/xsim.ideas	2020-02-24 14:31:15 UTC (rev 53893)
@@ -26,3 +26,4 @@
 
 - a document class `xsim-exam' for creating exams
 - a mechanism for providing variants of an exam
+

Modified: trunk/Master/texmf-dist/doc/latex/xsim/xsim_manual.pdf
===================================================================
(Binary files differ)

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

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls	2020-02-24 14:31:15 UTC (rev 53893)
@@ -29,7 +29,7 @@
 % please ignore the contents of this file -- it is not a good example for
 % coding...
 %
-\ProvidesClass{xsim-manual}[2019/12/29]
+\ProvidesClass{xsim-manual}[2020/02/23]
 
 \LoadClass[load-preamble,add-index]{cnltx-doc}
 \RequirePackage{imakeidx}
@@ -103,6 +103,7 @@
     ForEachUsedExerciseByID ,
     GetExerciseAliasProperty ,
     GetExerciseHeadingF ,
+    GetExerciseIdForProperty ,
     GetExerciseName ,
     GetExerciseParameter ,
     GetExerciseProperty ,
@@ -248,6 +249,7 @@
 
 
 \RequirePackage[en-US]{datetime2}
+\DTMlangsetup[en-US]{abbr}
 \newrobustcmd*\xsim at add@version[2]{\csdef{xsimversion#1}{\DTMdate{#2}}}
 \renewrobustcmd*\sinceversion[1]{%
   \cnltx at version@note{\GetTranslation{cnltx-introduced}~#1 (\csuse{xsimversion#1})}%
@@ -796,23 +798,24 @@
 
 \newcommand*\listlayouts{%
   \def\do##1{%
-    \begin{cnltxcode}[{title=Layout \enquote{\texttt{##1}}}]
+    \begin{cnltxcode}[{title=Layout \enquote{\texttt{##1}}\csuse{xsim at layout@description@##1}}]
       \ifcsdef{xsim at layout@extra@##1}
         {\csuse{xsim at layout@extra@##1}}
         {}%
       \xsimsetup{exercise/template={##1}}
       \let\marginpar\marginnote
-      \XSIMexpandcode{%
-        \printexercise{exercise}{\GetExerciseIdForProperty{ID}{showlayout}}
-      }%
+      \printexercise{exercise}{showlayout}%
     \end{cnltxcode}
   }%
   \dolistloop\xsim at layouts
 }
 
-\NewDocumentCommand\xsim at add@layout{mo}{%
+\NewDocumentCommand\xsim at add@layout{moo}{%
   \listadd\xsim at layouts{#1}%
   \IfNoValueF{#2}{\csdef{xsim at layout@extra@#1}{#2}}%
+  \IfNoValueTF{#3}
+    {\csdef{xsim at layout@description@#1}{}}
+    {\csdef{xsim at layout@description@#1}{ \footnotesize(#3)}}%
 }
 
 % ----------------------------------------------------------------------------
@@ -862,7 +865,10 @@
 \xsim at add@layout{default}
 \xsim at add@layout{runin}[\renewcommand*\theexercise{\arabic{exercise}.}]
 \xsim at add@layout{margin}[\renewcommand*\theexercise{\arabic{exercise}.}]
-\xsim at add@layout{minimal}[\renewcommand*\theexercise{\arabic{exercise}.}]
+\xsim at add@layout{inline}[\renewcommand*\theexercise{\arabic{exercise}.}]
+\xsim at add@layout{minimal}[\renewcommand*\theexercise{\arabic{exercise}.}][Like
+\enquote{\texttt{inline}} but as own paragraph.]
+\xsim at add@layout{centered}[\renewcommand*\theexercise{\arabic{exercise}.}]
 
 % ----------------------------------------------------------------------------
 % versions:
@@ -892,6 +898,7 @@
 \xsim at add@version{0.16}  {2019-11-10}
 \xsim at add@version{0.16a} {2020-01-16}
 \xsim at add@version{0.17}  {2020-02-21}
+\xsim at add@version{0.18}  {2020-02-23}
 
 % ----------------------------------------------------------------------------
 \newrobustcmd*\xsimauxfileinfo{%

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex	2020-02-24 14:31:15 UTC (rev 53893)
@@ -427,7 +427,7 @@
           }
       }
   }
-\cs_generate_variant:Nn \xsim_insert:nnnn {nV,VV,nnnV,xx}
+\cs_generate_variant:Nn \xsim_insert:nnnn {nV,VV,nnnV,xx,ne}
 
 % #1: type
 % #2: id

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex	2020-02-24 14:31:15 UTC (rev 53893)
@@ -513,10 +513,10 @@
   { \xsim_foreach_exercise_id_type:nn {print} {#1} }
 
 \NewDocumentCommand \ForEachUsedExerciseByType {+m}
-  { \xsim_foreach_exercise_type_id:nn {use} {#1} }
+  { \xsim_foreach_exercise_type_id:nn {used} {#1} }
 
 \NewDocumentCommand \ForEachUsedExerciseByID {+m}
-  { \xsim_foreach_exercise_id_type:nn {use} {#1} }
+  { \xsim_foreach_exercise_id_type:nn {used} {#1} }
 
 % ----------------------------------------------------------------------------
 
@@ -553,10 +553,10 @@
   {
     \group_begin:
       \keys_set:nn {xsim/random} {#1}
-      \xsim_print_random_list:VnV
+      \xsim_print_random_list:VnN
         \l_xsim_random_collection_tl
         {#2}
-        \l_xsim_random_exclude_list_tl
+        \l_xsim_random_exclude_list_clist
     \group_end:
   }
 
@@ -610,22 +610,34 @@
 % ----------------------------------------------------------------------------
 
 \NewDocumentCommand \XSIMprint {mO{}mm}
-  { \xsim_insert:nnnn {#3} {#4} {#2} {#1} }
+  { \xsim_insert:nenn {#3} { \xsim_normalize_id:n {#4} } {#2} {#1} }
 
 \NewDocumentCommand \XSIMxprint {mO{}mm}
-  { \xsim_insert:xxnn {#3} {#4} {#2} {#1} }
+  { \xsim_insert:xxnn {#3} { \xsim_normalize_id:e {#4} } {#2} {#1} }
 
 \NewDocumentCommand \printexercise {O{}mm}
-  { \xsim_insert:nnnn {#2} {#3} {#1} {exercise} }
+  {
+    \clist_map_inline:nn {#3}
+      { \xsim_insert:nenn {#2} { \xsim_normalize_id:n {##1} } {#1} {exercise} }
+  }
 
 \NewDocumentCommand \xprintexercise {O{}mm}
-  { \xsim_insert:xxnn {#2} {#3} {#1} {exercise} }
+  {
+    \clist_map_inline:nn {#3}
+      { \xsim_insert:xxnn {#2} { \xsim_normalize_id:e {##1} } {#1} {exercise} }
+  }
 
 \NewDocumentCommand \printsolution {O{}mm}
-  { \xsim_insert:nnnn {#2} {#3} {#1} {solution} }
+  {
+    \clist_map_inline:nn {#3}
+      { \xsim_insert:nenn {#2} { \xsim_normalize_id:n {##1} } {#1} {solution} }
+  }
   
 \NewDocumentCommand \xprintsolution {O{}mm}
-  { \xsim_insert:xxnn {#2} {#3} {#1} {solution} }
+  {
+    \clist_map_inline:nn {#3}
+      { \xsim_insert:xxnn {#2} { \xsim_normalize_id:e {##1} } {#1} {solution} }
+  }
   
 % ----------------------------------------------------------------------------
   

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.properties.code.tex	2020-02-24 14:31:15 UTC (rev 53893)
@@ -447,6 +447,16 @@
   { \prop_item:cn {g__xsim_property_#1_type_prop} {#2} }
 \cs_generate_variant:Nn \xsim_get_type_for_property:nn {nV}
 
+% #1: id or ID
+\cs_new:Npn \xsim_normalize_id:n #1
+  {
+    \tl_if_blank:eTF
+      { \xsim_get_id_for_property:nn {ID} {#1} }
+      {#1}
+      { \xsim_get_id_for_property:nn {ID} {#1} }
+  }
+\cs_generate_variant:Nn \xsim_normalize_id:n {e}
+
 \cs_new:Npn \__xsim_get_property_tmp:n #1 {}
 \cs_generate_variant:Nn \__xsim_get_property_tmp:n {V}
 

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.random.code.tex	2020-02-24 14:31:15 UTC (rev 53893)
@@ -40,7 +40,6 @@
 \xsim_load_modules:n {collections}
 
 \tl_new:N    \l_xsim_random_collection_tl
-\tl_new:N    \l_xsim_random_exclude_list_tl
 \tl_new:N    \l__xsim_print_random_choice_tl
 \tl_const:Nn \c__xsim_print_random_both_tl {both}
 \tl_const:Nn \c__xsim_print_random_exercise_tl {exercise}
@@ -49,6 +48,7 @@
 \seq_new:N   \l__xsim_allowed_exercise_ids_seq
 \int_new:N   \g__xsim_random_list_id_int
 \bool_new:N  \l__xsim_sort_random_bool
+\clist_new:N \l_xsim_random_exclude_list_clist
 
 % #1: random list id
 % #2: csv list of integers
@@ -106,8 +106,8 @@
 
 % #1: collection
 % #2: number of items
-% #3: csv list of excluded ids
-\cs_new_protected:Npn \xsim_print_random_list:nnn #1#2#3
+% #3: clist variable of excluded ids
+\cs_new_protected:Npn \xsim_print_random_list:nnN #1#2#3
   {
     \xsim_if_collection_exist:nTF {#1}
       {
@@ -122,7 +122,7 @@
                   { \xsim_get_type_for_property:nn {id} {##1} }
                 \xsim_if_in_collection:nVnT {#1} \l__xsim_tmpa_tl {##1}
                   {
-                    \clist_if_in:nnF {#3} {##1}
+                    \clist_if_in:NnF #3 {##1}
                       { \seq_put_right:Nn \l__xsim_allowed_exercise_ids_seq {##1} }
                   }
               }
@@ -157,7 +157,7 @@
       }
       { \msg_error:nnn {xsim} {unknown-collection} {#1} }
   }
-\cs_generate_variant:Nn \xsim_print_random_list:nnn {VnV}
+\cs_generate_variant:Nn \xsim_print_random_list:nnN {V}
 
 % #1: random list id
 % #2: max number to choose from
@@ -299,8 +299,9 @@
           }
       }
     \seq_remove_duplicates:N \l__xsim_tmpa_seq
-    \tl_set:Nx \l_xsim_random_exclude_list_tl
-      { \seq_use:Nn \l__xsim_tmpa_seq {,} }
+    \clist_set_from_seq:NN
+      \l_xsim_random_exclude_list_clist
+      \l__xsim_tmpa_seq
   }
 
 % use this in the exclude list:

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.solutions.code.tex	2020-02-24 14:31:15 UTC (rev 53893)
@@ -104,7 +104,8 @@
 
 % ----------------------------------------------------------------------------
 
-% #1: conditional base function (three n args)% #2: name
+% #1: conditional base function (three n args)
+% #2: name
 % #3: code (refer to type and id with `#1' and `#2'), #3 refers to the boolean
 %     properties use/print
 \cs_new_protected:Npn \xsim_new_solutions_condition:Nnn #1#2#3
@@ -270,7 +271,7 @@
             { \bool_set_true:N \l__xsim_tmpa_bool }
         }
         {
-          \xsim_if_solutions_do:nnn {#4} {use}
+          \xsim_if_solutions_do:nnn {#4} {used}
             { \bool_set_true:N \l__xsim_tmpa_bool }
         }
       \tl_set:Nn \ExerciseType {#4}
@@ -289,7 +290,7 @@
             { \__xsim_print_entry:nn {#4} {##2} }
         }
         {
-          \xsim_if_solutions_do:nnn {#4} {use}
+          \xsim_if_solutions_do:nnn {#4} {used}
             { \__xsim_print_entry:nn {#4} {##2} }
         }
       #3
@@ -341,9 +342,9 @@
             }
         }
         {
-          \xsim_foreach_exercise_id_type:nn {use}
+          \xsim_foreach_exercise_id_type:nn {used}
             {
-              \xsim_if_this_solution_do:nnnn {##1} {##2} {use}
+              \xsim_if_this_solution_do:nnnn {##1} {##2} {used}
                 { \xsim_insert:nnnn {##1} {##2} {} {solution} }
             }
         }
@@ -406,3 +407,5 @@
 % ----------------------------------------------------------------------------
   
 \file_input_stop:
+
+2020/02/23 - resolve bug #56

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty	2020-02-24 14:31:15 UTC (rev 53893)
@@ -29,9 +29,9 @@
 
 \ExplSyntaxOn
 
-\tl_const:Nn \c_xsim_date_tl                 {2020/02/21}
+\tl_const:Nn \c_xsim_date_tl                 {2020/02/23}
 \tl_const:Nn \c_xsim_version_major_number_tl {0}
-\tl_const:Nn \c_xsim_version_minor_number_tl {17}
+\tl_const:Nn \c_xsim_version_minor_number_tl {18}
 \tl_const:Nn \c_xsim_version_subrelease_tl   {}
 \tl_const:Nx \c_xsim_version_number_tl
   {

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex	2020-02-24 14:30:58 UTC (rev 53892)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex	2020-02-24 14:31:15 UTC (rev 53893)
@@ -73,7 +73,7 @@
   }
   {\endtrivlist}
 
-\DeclareExerciseEnvironmentTemplate{minimal}
+\DeclareExerciseEnvironmentTemplate{inline}
   {%
     \textbf{\GetExerciseProperty{counter}}%
     \IfInsideSolutionF{%
@@ -88,5 +88,34 @@
   }
   {}
 
+\DeclareExerciseEnvironmentTemplate{minimal}
+  {\par\UseExerciseTemplate{begin}{inline}}
+  {\UseExerciseTemplate{end}{inline}\par}
+
+\DeclareExerciseEnvironmentTemplate{centered}
+  {%
+    \par\vspace{\baselineskip}
+    \Needspace*{2\baselineskip}
+    \noindent
+    \hfil\textbf{\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}}%
+    \GetExercisePropertyT{subtitle}{ \textit{#1}}\hfil
+    \par\noindent
+    \IfInsideSolutionF{%
+      \GetExercisePropertyT{points}{%
+        \marginpar{%
+          \printgoal{\PropertyValue}%
+          \GetExercisePropertyT{bonus-points}{+\printgoal{\PropertyValue}}%
+          \,\IfExerciseGoalSingularTF{points}
+              {\XSIMtranslate{point}}
+              {\XSIMtranslate{points}}%
+        }%
+      }%
+    }%
+  }
+  {}
+
 % ----------------------------------------------------------------------------
 \endinput
+
+2020/02/23 - added: inline, centered
+           - adapt to removed \par from the generic environments



More information about the tex-live-commits mailing list.