texlive[52371] Master/texmf-dist: xsim (13oct19)

commits+karl at tug.org commits+karl at tug.org
Sun Oct 13 23:43:03 CEST 2019


Revision: 52371
          http://tug.org/svn/texlive?view=revision&revision=52371
Author:   karl
Date:     2019-10-13 23:43:03 +0200 (Sun, 13 Oct 2019)
Log Message:
-----------
xsim (13oct19)

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.definitions.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.modules.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf
    trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex

Modified: trunk/Master/texmf-dist/doc/latex/xsim/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/README	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/doc/latex/xsim/README	2019-10-13 21:43:03 UTC (rev 52371)
@@ -1,5 +1,5 @@
 --------------------------------------------------------------------------
-XSIM 2019/10/06 v0.13
+XSIM 2019/10/13 v0.14
 
   eXercise Sheets IMproved
 
@@ -85,6 +85,7 @@
    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
 --------------------------------------------------------------------------

Added: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf	2019-10-13 21:43:03 UTC (rev 52371)

Property changes on: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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}


Property changes on: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texwelt-23968.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/xsim/xsim.history
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/xsim.history	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/doc/latex/xsim/xsim.history	2019-10-13 21:43:03 UTC (rev 52371)
@@ -115,3 +115,15 @@
                      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)

Modified: trunk/Master/texmf-dist/doc/latex/xsim/xsim.ideas
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/xsim.ideas	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/doc/latex/xsim/xsim.ideas	2019-10-13 21:43:03 UTC (rev 52371)
@@ -26,7 +26,4 @@
 
 - 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

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	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/doc/latex/xsim/xsim_manual.tex	2019-10-13 21:43:03 UTC (rev 52371)
@@ -144,7 +144,8 @@
 \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
@@ -151,7 +152,7 @@
     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 @@
   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 @@
     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 @@
     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 @@
       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,13 +530,13 @@
     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
@@ -526,12 +543,19 @@
       \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 @@
   \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 @@
     \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 @@
     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 @@
 
 \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 @@
           }%
       }%
   }
-  {}
+  {\par}
 \end{sourcecode}
 
 \subsubsection{A New Exercise Type Using \pkg*{tcolorbox}}
@@ -1731,6 +1770,26 @@
     {\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 @@
 \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 @@
   \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

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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 at example@links #1 {
   \href { \xsim at example@texfile at path {#1} } { \color{white} [\TeX] } ~
-  \href { \xsim at example@pdffile at path {#1} } { \color{white} [PDF] }
+  \href { \xsim at example@pdffile at 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 at examplefiles
 }
 
+% ----------------------------------------------------------------------------
+
+\newcommand*\listlayouts{%
+  \def\do##1{%
+    \begin{cnltxcode}[{title=Layout \enquote{\texttt{##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}}
+      }%
+    \end{cnltxcode}
+  }%
+  \dolistloop\xsim at layouts
+}
+
+\NewDocumentCommand\xsim at add@layout{mo}{%
+  \listadd\xsim at layouts{#1}%
+  \IfNoValueF{#2}{\csdef{xsim at layout@extra@#1}{#2}}%
+}
+
+% ----------------------------------------------------------------------------
+% examples:
+
 \xsim at add@example{blanks}{Create blank lines}
 \xsim at add@example{boxed-headings}{Put headings in a box}
 \xsim at add@example{code-and-output}{Create code examples}
@@ -798,36 +832,21 @@
 \xsim at add@example{texsx-395273}{Different aspects of exercises. Highlighted solutions}
 \xsim at add@example{texwelt-6698}{Custom list of exercises}
 \xsim at add@example{texwelt-15093}{Indicate difficulty level}
+\xsim at add@example{texwelt-23968}{Long and short solutions}
 \xsim at add@example{golatex-80640}{Different versions for students and teachers}
 \xsim at add@example{golatex-91339}{Another custom layout with rules}
 
 % ----------------------------------------------------------------------------
+% layouts:
 
-\newcommand*\listlayouts{%
-  \def\do##1{%
-    \begin{cnltxcode}[{title=Layout \enquote{\texttt{##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}}
-      }%
-    \end{cnltxcode}
-  }%
-  \dolistloop\xsim at layouts
-}
-
-\NewDocumentCommand\xsim at add@layout{mo}{%
-  \listadd\xsim at layouts{#1}%
-  \IfNoValueF{#2}{\csdef{xsim at layout@extra@#1}{#2}}%
-}
-
 \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}.}]
 
+% ----------------------------------------------------------------------------
+% versions:
+
 \xsim at add@version{0.8}   {2017-05-18}
 \xsim at add@version{0.8a}  {2017-05-19}
 \xsim at add@version{0.8b}  {2017-05-23}
@@ -837,6 +856,7 @@
 \xsim at add@version{0.11}  {2018-02-12}
 \xsim at add@version{0.12}  {2019-09-26}
 \xsim at add@version{0.13}  {2019-10-06}
+\xsim at add@version{0.14}  {2019-10-13}
 
 % ----------------------------------------------------------------------------
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.definitions.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.definitions.code.tex	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.definitions.code.tex	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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,7 +173,9 @@
   solution-name     = \XSIMtranslate {solution} ,
   solutions-name    = \XSIMtranslate {solutions} ,
   exercise-template = default ,
-  solution-template = default
+  solution-template = default ,
+  exercise-heading  = \subsection* ,
+  solution-heading  = \subsection*
 }
 
 % ----------------------------------------------------------------------------
@@ -173,16 +182,16 @@
 
 \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 }
 
 % ----------------------------------------------------------------------------
 

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.environments.code.tex	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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
                     }
                 }

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.exercises.code.tex	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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}

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.interface.code.tex	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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} }
 
 % ----------------------------------------------------------------------------

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.modules.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.modules.code.tex	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.modules.code.tex	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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:

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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
   {

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	2019-10-13 21:41:34 UTC (rev 52370)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex	2019-10-13 21:43:03 UTC (rev 52371)
@@ -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



More information about the tex-live-commits mailing list