texlive[52620] Master/texmf-dist: xsim (2nov19)

commits+karl at tug.org commits+karl at tug.org
Sat Nov 2 22:13:41 CET 2019


Revision: 52620
          http://tug.org/svn/texlive?view=revision&revision=52620
Author:   karl
Date:     2019-11-02 22:13:40 +0100 (Sat, 02 Nov 2019)
Log Message:
-----------
xsim (2nov19)

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_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.auxfile.code.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex

Modified: trunk/Master/texmf-dist/doc/latex/xsim/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/README	2019-11-02 21:08:17 UTC (rev 52619)
+++ trunk/Master/texmf-dist/doc/latex/xsim/README	2019-11-02 21:13:40 UTC (rev 52620)
@@ -1,5 +1,5 @@
 --------------------------------------------------------------------------
-XSIM 2019/10/19 v0.14a
+XSIM 2019/11/02 v0.15
 
   eXercise Sheets IMproved
 

Modified: trunk/Master/texmf-dist/doc/latex/xsim/xsim.history
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/xsim.history	2019-11-02 21:08:17 UTC (rev 52619)
+++ trunk/Master/texmf-dist/doc/latex/xsim/xsim.history	2019-11-02 21:13:40 UTC (rev 52620)
@@ -129,3 +129,5 @@
                    - new example `texwelt-23968' (long and short solutions)
  v0.14a 2019/10/19 - fix \xsim_if_exercise_exist:nnTF to obey the `no-files'
                      option
+ v0.15  2019/11/02 - use own auxiliary file per default and add option
+                     `use-aux'

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-11-02 21:08:17 UTC (rev 52619)
+++ trunk/Master/texmf-dist/doc/latex/xsim/xsim_manual.tex	2019-11-02 21:13:40 UTC (rev 52620)
@@ -121,9 +121,9 @@
     environment body files.
   \opt{clear-aux}
     If used every time the  total number of exercise changes \xsim\ will write
-    \emph{less} information to the auxfile on the next run and only if the
-    number of exercises stays stable between compilations the needed
-    information will be written to the auxfile. \emph{This needs more
+    \emph{less} information to the auxiliary file on the next run and only if
+    the number of exercises stays stable between compilations the needed
+    information will be written to the auxiliary file. \emph{This needs more
       compilations until everything stabilizes but should reduce the
       probability of possibly faulty exercises after changes to the document.}
     The \option{final} option automatically disables this option.  See also
@@ -134,6 +134,10 @@
     ``clean'' but will also prevent using verbatim material in exercises and
     solutions and will possibly slow processing further down.  \emph{This
       option is considered experimental.  Feedback is very welcome.}
+  \opt{use-aux}
+    \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}.
 \end{options}
 
 Those options are used the usual way as package option
@@ -145,17 +149,21 @@
   \documentclass[verbose]{article}
 \end{sourcecode}
 or via the setup\changedversion{0.13} command as options belonging to the
-\module{package}:
+\module{package}, see also section~\vref{sec:setting-options}:
+\begin{sourcecode}
+  \xsimsetup{package/verbose}
+\end{sourcecode}
+
+\subsection{Setting Options}\label{sec:setting-options}
+Apart from the package options already described in
+section~\vref{sec:package-options} \xsim\ has further options.  All those
+options are set using the following command:
 \begin{commands}
   \command{xsimsetup}[\marg{options}]
     Set up \xsim's package options and all other options described at
     other places in the manual.
 \end{commands}
-
-\subsection{Setting Options}\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.
+Options can be \enquote{toplevel} options or options belonging to a module:
 \begin{options}
   \keyval*{toplevel}{value}
     A toplevel option.
@@ -162,7 +170,7 @@
   \keyval*{sublevel}{value}\Module*{module}
     A sublevel option belonging to the module \module*{module}
 \end{options}
-Both kinds of options are set with \cs{xsimsetup}:
+Both kinds of options are set with the setup command:
 \begin{sourcecode}
   \xsimsetup{
     toplevel = {value} ,
@@ -197,7 +205,6 @@
     no \meta{true} argument.
 \end{commands}
 
-
 \section{Exercises and Solutions}
 
 The two predefined environments for exercises and solutions are the following
@@ -291,7 +298,7 @@
     document uses \keyis{path}{exercises}.
   \keyval{file-extension}{string}\Default{\code{tex}}
     \sinceversion{0.10}This option let's you choose the extension of the
-    auxiliary files.
+    external files.
 \end{options}
 
 \begin{bewareofthedog}
@@ -312,35 +319,22 @@
 package option:
 \begin{options}
   \opt{no-files}
-    This option prevents \xsim\ from writing the exercises and solutions to
-    external files.  This will keep your working folder ``clean'' but will
-    also prevent using verbatim material in exercises and solutions and will
-    possibly slow processing further down.  \emph{This option is considered
-      experimental.  Feedback is very welcome.}
+    This package option prevents \xsim\ from writing the exercises and
+    solutions to external files.  This will keep your working folder ``clean''
+    but will also prevent using verbatim material in exercises and solutions
+    and will possibly slow processing further down.  \emph{This option is
+      considered experimental.  Feedback is very welcome.}
 \end{options}
 
 \begin{bewareofthedog}
-  \xsim\ writes a lot of stuff to the auxfile for re-using information on
-  subsequent compilations.  If you add exercises, change properties \etc\ it
-  might happen that wrong information is staying in the auxfile and is wrongly
-  used by \xsim.  In such cases deleting the auxfile and doing a few fresh
-  compilations may resolve your problems.
-
-  Sometimes the \emph{existence of exercise or solution files from earlier
-    compilations} may lead to wrong lists of exercises or solutions.  In such
-  cases it can be useful to delete all those files and doing a fresh
-  compilation.  It may be helpful to use a subfolder for those exernal files
-  which will make deleting them a little bit easier. (Don't forget to both
-  create the subfolder and set \option{path} accordingly then.)
-
-  Using the \option{clear-aux} option might help to reduce erroneous exercises.
+  \xsimauxfileinfo
 \end{bewareofthedog}
 
 \begin{bewareofthedog}
-  A lot of the lines \xsim\ writes to the auxfile and reads in a subsequent
-  run look like this:
+  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
@@ -350,7 +344,7 @@
 \begin{options}
   \keyval{split-aux-lists}{string}\Default{\code{|}}
     Set\sinceversion{0.11} the string that is used to separate the property
-    entries in the auxfile.
+    entries in the auxiliary file.
 \end{options}
 
 \section{New Exercise Types}\label{sec:new-exercise-types}
@@ -2101,25 +2095,12 @@
 
 \subsection{\dots Resolve Getting Repeatedly Wrong Exercise Properties or
   Wrong Exercise Lists?}\label{sec:resolve-getting}
-\xsim\ writes a lot of stuff to the auxfile for re-using information on
-subsequent compilations.  If you add exercises, change properties \etc\ it
-might happen that wrong information is staying in the auxfile and is wrongly
-used by \xsim.  In such cases deleting the auxfile and doing a few fresh
-compilations may resolve your problems.
+\xsimauxfileinfo
 
-Sometimes the \emph{existence of exercise or solution files from earlier
-  compilations} may lead to wrong lists of exercises or solutions.  In such
-cases it can be useful to delete all those files and doing a fresh
-compilation.  It may be helpful to use a subfolder for those exernal files
-which will make deleting them a little bit easier. (Don't forget to both
-create the subfolder and set \option{path} accordingly then.)
-
-Using the \option{clear-aux} option might help to reduce erroneous exercises.
-
 \subsection{\dots Resolve Strange Errors After Updating?}
-\xsim\ writes a lot of stuff to the auxfile.  An update may well change how
-this is done so deleting the auxfile and doing a few fresh compilations may
-resolve your problems.
+\xsim\ writes a lot of stuff to the auxiliary file.  An update may well change
+how this is done so deleting the auxiliary file and doing a few fresh
+compilations may resolve your problems.
 
 \subsection{\code{! TeX capacity exceeded, sorry [text input levels=15].}
   Why?}

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls	2019-11-02 21:08:17 UTC (rev 52619)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls	2019-11-02 21:13:40 UTC (rev 52620)
@@ -464,9 +464,9 @@
     tables.}
 }
 
-\newcommand*\environ{\@ifstar\environ at star\environ at nostar}
-\newcommand*\environ at star[1]{\beginenv*\Marg{\env*{#1}}}
-\newcommand*\environ at nostar[1]{\beginenv*\Marg{\env{#1}}}
+\providecommand*\environ{\@ifstar\environ at star\environ at nostar}
+\providecommand*\environ at star[1]{\beginenv*\Marg{\env*{#1}}}
+\providecommand*\environ at nostar[1]{\beginenv*\Marg{\env{#1}}}
 
 \RequirePackage{tcolorbox}
 \tcbuselibrary{skins,breakable}
@@ -857,6 +857,25 @@
 \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}
+\xsim at add@version{0.15}  {2019-11-02}
 
 % ----------------------------------------------------------------------------
+\newrobustcmd*\xsimauxfileinfo{%
+  \xsim\ writes a lot of stuff to an auxiliary file called
+  \cs*{jobname}\code{.xsim} (or the common \cs*{jobname}\code{.aux} if you use
+  option \option{use-aux}) for re-using information on subsequent
+  compilations.  If you add exercises, change properties \etc\ it might happen
+  that wrong information is staying in the auxiliary file and is wrongly used
+  by \xsim.  In such cases deleting the auxiliary file and doing a few fresh
+  compilations may resolve your problems.
+
+  Sometimes the \emph{existence of exercise or solution files from earlier
+    compilations} may lead to wrong lists of exercises or solutions.  In such
+  cases it can be useful to delete all those files and doing a fresh
+  compilation.  It may be helpful to use a subfolder for those exernal files
+  which will make deleting them a little bit easier. (Don't forget to both
+  create the subfolder and set \option{path} accordingly then.)
+
+  Using the \option{clear-aux} option might help to reduce erroneous exercises.%
+}
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex	2019-11-02 21:08:17 UTC (rev 52619)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex	2019-11-02 21:13:40 UTC (rev 52620)
@@ -25,10 +25,24 @@
 % If you have any ideas, questions, suggestions or bugs to report, please
 % feel free to contact me.
 % ----------------------------------------------------------------------------
-\XSIMmodule{auxfile}{writing stuff to the aux file}
+\XSIMmodule{auxfile}{writing stuff to an auxiliary file}
 
+\prg_new_conditional:Npnn \xsim_if_use_aux: {p,T,F,TF}
+  {
+    \bool_if:NTF \g_xsim_use_aux_bool
+      { \prg_return_true: }
+      { \prg_return_false: }
+  }
+
 \cs_new_protected:Npn \xsim_write_to_aux:n #1
-  { \iow_now:Nn \@auxout {#1} }
+  {
+    \legacy_if:nT {@filesw}
+      {
+        \xsim_if_use_aux:TF
+          { \iow_now:Nn \@auxout {#1} }
+          { \iow_now:Nn \l__xsim_aux_file_iow {#1} }
+      }
+  }
 \cs_generate_variant:Nn \xsim_write_to_aux:n {x}
 
 % --------------------------------------------------------------------------
@@ -35,21 +49,43 @@
 
 \cs_new_protected:Npn \XSIM #1 { \use:c {XSIMaux#1} }
 
+\cs_new_protected:Npn \xsim_new_aux_cs:cpn #1
+  { \cs_new_protected:cpn {XSIMaux#1} }
+
+\cs_new_protected:Npn \xsim_add_cs_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 }
+  }
+
 \AtBeginDocument
   {
-    \xsim_write_to_aux:x
+    \iow_now:Nx \@auxout
       { \token_to_str:N \providecommand \token_to_str:N \XSIM [1] {} }
   }
 
-\cs_new_protected:Npn \xsim_new_aux_cs:cpn #1
-  { \cs_new_protected:cpn {XSIMaux#1} }
+% ----------------------------------------------------------------------------
 
-\cs_new_protected:Npn \xsim_add_cs_to_aux:nn #1#2
+\xsim_if_use_aux:F
   {
-    \xsim_verbose:n { Writing~ command~ \XSIM {#1}~ to~ aux~ file }
-    \xsim_write_to_aux:x { \XSIM {#1} #2 }
+    \iow_new:N \l__xsim_aux_file_iow
+    \AtBeginDocument
+      { \iow_open:Nn \l__xsim_aux_file_iow { \c_sys_jobname_str .xsim } }
   }
 
+\cs_new_protected:Npn \xsim_close_aux:
+  {
+    \xsim_if_use_aux:F
+      {
+        \iow_close:N \l__xsim_aux_file_iow
+        \legacy_if:nT {@filesw}
+          { \iow_now:Nx \@auxout { \token_to_str:N \XSIM {readaux} } }
+      }
+  }
+
+\xsim_new_aux_cs:cpn {readaux}
+  { \file_input:n { \c_sys_jobname_str .xsim } }
+
 % ----------------------------------------------------------------------------
 % list for recording values that need to be written to the aux file and
 % updated at begin document

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty	2019-11-02 21:08:17 UTC (rev 52619)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty	2019-11-02 21:13:40 UTC (rev 52620)
@@ -29,10 +29,10 @@
 
 \ExplSyntaxOn
 
-\tl_const:Nn \c_xsim_date_tl                 {2019/10/19}
+\tl_const:Nn \c_xsim_date_tl                 {2019/11/02}
 \tl_const:Nn \c_xsim_version_major_number_tl {0}
-\tl_const:Nn \c_xsim_version_minor_number_tl {14}
-\tl_const:Nn \c_xsim_version_subrelease_tl   {a}
+\tl_const:Nn \c_xsim_version_minor_number_tl {15}
+\tl_const:Nn \c_xsim_version_subrelease_tl   {}
 \tl_const:Nx \c_xsim_version_number_tl
   {
     \c_xsim_version_major_number_tl .
@@ -58,7 +58,9 @@
 \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 \l__xsim_write_to_file_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
 
 \keys_define:nn {xsim/package}
   {
@@ -66,7 +68,9 @@
     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
+    no-files  .initial:n           = false ,
+    use-aux   .bool_gset:N         = \g_xsim_use_aux_bool ,
+    use-aux   .initial:n           = false
   }
 
 \ProcessKeysPackageOptions {xsim/package}
@@ -87,12 +91,10 @@
     synchronized.
   }
 
-\msg_new:nnn {xsim} {verbose} { #1 ~(\msg_line_context:) }
+\msg_new:nnn {xsim} {verbose} { #1 ~( \msg_line_context: ) }
 
 % --------------------------------------------------------------------------
 
-\bool_new:N \g__xsim_rerun_bool
-
 \cs_new_protected:Npn \xsim_do_rerun:
   { \xsim_if_rerun:T { \msg_warning:nn {xsim} {rerun} } }
 
@@ -105,6 +107,10 @@
 % --------------------------------------------------------------------------
 \xsim_load_modules:n {definitions}
 
-\AtEndDocument { \xsim_do_rerun: }
-
+\AtEndDocument
+  {
+    \xsim_do_rerun:
+    \xsim_close_aux:
+  }
+  
 \file_input_stop:

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex	2019-11-02 21:08:17 UTC (rev 52619)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex	2019-11-02 21:13:40 UTC (rev 52620)
@@ -29,7 +29,7 @@
 
 \xsim_load_modules:n {base}
 
-\iow_new:N  \l__file_contents_iow
+\iow_new:N  \l__xsim_file_contents_iow
 \tl_new:N   \l_xsim_file_begin_tl
 \tl_new:N   \l_xsim_file_end_tl
 \int_new:N  \l_xsim_line_gobble_int
@@ -129,12 +129,12 @@
     \xsim_if_final:TF %
       { \xsim_verbose:x { Not~ (re-)writing~ file~ `#1'. } } %
       { \xsim_verbose:x { (Re-)writing~ file~ `#1'. } } %
-    \__xsim_open_stream:Nn \l__file_contents_iow {#1} %
+    \__xsim_open_stream:Nn \l__xsim_file_contents_iow {#1} %
     \tl_if_blank:VF \l_xsim_file_begin_tl %
       { %
         \xsim_if_final:F %
           { %
-            \iow_now:Nx \l__file_contents_iow  %
+            \iow_now:Nx \l__xsim_file_contents_iow  %
               { \l_xsim_file_begin_tl } %
           } %
       } %
@@ -150,13 +150,13 @@
       } %
         { %
           \tl_if_blank:nTF {##3} %
-            { \__xsim_write_to_stream:Nn \l__file_contents_iow {##1} } %
+            { \__xsim_write_to_stream:Nn \l__xsim_file_contents_iow {##1} } %
             { %
               \cs_set:Npx \__xsim_M:w { \exp_not:N \end {\@currenvir} } %
               \char_set_active_eq:nN {13} \__xsim_M:w %
               % the last line is `##1 \end{\@currenvir} ##2':
               \tl_if_blank:nF {##1} %
-                { \__xsim_write_to_stream:Nn \l__file_contents_iow {##1} }%
+                { \__xsim_write_to_stream:Nn \l__xsim_file_contents_iow {##1} }%
               \tl_if_blank:nF {##2} %
                 {} %
             } %
@@ -184,11 +184,11 @@
       {
         \xsim_if_final:F
           {
-            \iow_now:Nx \l__file_contents_iow
+            \iow_now:Nx \l__xsim_file_contents_iow
               { \l_xsim_file_end_tl }
           }
       }
-    \__xsim_close_stream:N \l__file_contents_iow
+    \__xsim_close_stream:N \l__xsim_file_contents_iow
     \group_end:
   }
 



More information about the tex-live-commits mailing list