summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xsim
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-11-02 21:13:40 +0000
committerKarl Berry <karl@freefriends.org>2019-11-02 21:13:40 +0000
commit80cf66b257169421dfed4e16730749e8e84d27d0 (patch)
treecf2df5fc45cf46fccdbbabbf88de830ac8375a96 /Master/texmf-dist/tex/latex/xsim
parent2ba06c139c46208f03d24e06963bbdc3db72f4b1 (diff)
xsim (2nov19)
git-svn-id: svn://tug.org/texlive/trunk@52620 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xsim')
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim-manual.cls25
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex52
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.sty26
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex14
4 files changed, 89 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls b/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
index a36d869869f..7e8fec1b670 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
+++ b/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
@@ -464,9 +464,9 @@
tables.}
}
-\newcommand*\environ{\@ifstar\environ@star\environ@nostar}
-\newcommand*\environ@star[1]{\beginenv*\Marg{\env*{#1}}}
-\newcommand*\environ@nostar[1]{\beginenv*\Marg{\env{#1}}}
+\providecommand*\environ{\@ifstar\environ@star\environ@nostar}
+\providecommand*\environ@star[1]{\beginenv*\Marg{\env*{#1}}}
+\providecommand*\environ@nostar[1]{\beginenv*\Marg{\env{#1}}}
\RequirePackage{tcolorbox}
\tcbuselibrary{skins,breakable}
@@ -857,6 +857,25 @@
\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.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
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 39a4306f593..80186946168 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.auxfile.code.tex
@@ -25,31 +25,67 @@
% 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}
% --------------------------------------------------------------------------
\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
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.sty b/Master/texmf-dist/tex/latex/xsim/xsim.sty
index a11fe99adaa..a56fa8ecf54 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.sty
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.sty
@@ -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:
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 4738dc77868..bc9b2ce0967 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.verbwrite.code.tex
@@ -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:
}