From 26a628e95dc1e057a362c5612aeb3352ac8dd449 Mon Sep 17 00:00:00 2001 From: Clemens Niederberger Date: Wed, 5 Jan 2022 12:30:08 +0100 Subject: [PATCH] fix issue #90 --- HISTORY | 6 ++++-- IDEAS | 2 +- README | 4 ++-- code/xsim.base.code.tex | 2 +- code/xsim.environments.code.tex | 7 +++++-- code/xsim.properties.code.tex | 6 ++++++ code/xsim.start.code.tex | 10 +++++----- code/xsim.sty | 25 +++++++++++++++++-------- code/xsim.style.layouts.code.tex | 2 +- code/xsimverb.start.code.tex | 2 +- code/xsimverb.sty | 2 +- 11 files changed, 44 insertions(+), 24 deletions(-) diff --git a/HISTORY b/HISTORY index 090a264..9441092 100644 --- a/HISTORY +++ b/HISTORY @@ -7,7 +7,7 @@ Clemens Niederberger Web: https://github.com/cgnieder/xsim E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2017--2021 Clemens Niederberger +Copyright 2017--2022 Clemens Niederberger This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c @@ -181,7 +181,7 @@ HISTORY: v0.20b 2021/02/02 - fix issue #78 v0.20c 2021/02/03 - fix issue #80 - add missing test in \xsim_if_exist:nnnTF - v0.21 2021/??/?? - make \__xsim_set_file_signature:nnn public + v0.21 2022/01/05 - make \__xsim_set_file_signature:nnn public - make \l__xsim_file_path_and_name_tl, \l__xsim_file_name_tl and \l__xsim_file_path_tl public - introduce XSIMsetfilebeginX and XSIMsetfileendX @@ -191,3 +191,5 @@ HISTORY: - document option `blank/fill' - add counter foreach type and collection that holds the number of exercises of a type in a collection + - fix issue #90 + - correct file hooks diff --git a/IDEAS b/IDEAS index 205b69d..97be852 100644 --- a/IDEAS +++ b/IDEAS @@ -7,7 +7,7 @@ Clemens Niederberger Web: https://github.com/cgnieder/xsim E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2017--2021 Clemens Niederberger +Copyright 2017--2022 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/README b/README index 7399405..97d639b 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -XSIM 2021/02/03 v0.20c +XSIM 2022/01/05 v0.21 XSIMVERB 2021/01/31 v0.3 eXercise Sheets IMproved @@ -9,7 +9,7 @@ Clemens Niederberger Web: https://github.com/cgnieder/xsim E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2017--2021 Clemens Niederberger +Copyright 2017--2022 Clemens Niederberger This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c diff --git a/code/xsim.base.code.tex b/code/xsim.base.code.tex index 7b48e13..dedda45 100644 --- a/code/xsim.base.code.tex +++ b/code/xsim.base.code.tex @@ -224,7 +224,7 @@ { \msg_expandable_error:nnn {xsim} {attribute-not-set} {#1::#2} } } } - + % #1: attribute % #2: item \prg_new_conditional:Npnn \xsim_attribute_if_set:nn #1#2 {p,T,F,TF} diff --git a/code/xsim.environments.code.tex b/code/xsim.environments.code.tex index a63af65..b0bc36a 100644 --- a/code/xsim.environments.code.tex +++ b/code/xsim.environments.code.tex @@ -172,8 +172,11 @@ { \xsim_verbose:n { Saving~ #3~ environment~ type~ `#1'~ id~ `#2' } \xsim_set_property:nnnn {#1} {#2} {#3-body} {#4} - \xsim_if_exchange:nnnF {#1} {#2} {#3} - { \xsim_set_property:nnnn {#1} {#2} {solution-body} {#4} } + \xsim_if_exchange:nnnT {#1} {#2} {#3} + { + \tl_if_eq:nnT {#3} {exercise} + { \xsim_set_property:nnnn {#1} {#2} {solution-body} {#4} } + } } \cs_new:Npn \__xsim_save_environment_body_end: { } diff --git a/code/xsim.properties.code.tex b/code/xsim.properties.code.tex index 396436d..92ec670 100644 --- a/code/xsim.properties.code.tex +++ b/code/xsim.properties.code.tex @@ -423,6 +423,12 @@ { \xsim_attribute_get:nn {#1!#2} {#3} } \cs_generate_variant:Nn \xsim_get_property:nnn {nx,ne,xx,oo,no,nnf,nf,oof,nV} +% #1: type +% #2: id +% #3: property +\cs_new:Npn \xsim_show_property:nnn #1#2#3 + { \xsim_attribute_show:nn {#1!#2} {#3} } + % #1: property % #2: value \cs_new:Npn \xsim_get_id_for_property:nn #1#2 diff --git a/code/xsim.start.code.tex b/code/xsim.start.code.tex index 19618d3..78521d0 100644 --- a/code/xsim.start.code.tex +++ b/code/xsim.start.code.tex @@ -8,7 +8,7 @@ % Web: https://github.com/cgnieder/xsim % E-Mail: contact@mychemistry.eu % ---------------------------------------------------------------------------- -% Copyright 2017--2021 Clemens Niederberger +% Copyright 2017--2022 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c @@ -29,10 +29,10 @@ \ExplSyntaxOn -\tl_const:Nn \c_xsim_date_tl {2021/02/03} +\tl_const:Nn \c_xsim_date_tl {2022/01/05} \tl_const:Nn \c_xsim_version_major_number_tl {0} -\tl_const:Nn \c_xsim_version_minor_number_tl {20} -\tl_const:Nn \c_xsim_version_subrelease_tl {c} +\tl_const:Nn \c_xsim_version_minor_number_tl {21} +\tl_const:Nn \c_xsim_version_subrelease_tl {} \tl_const:Nx \c_xsim_version_number_tl { \c_xsim_version_major_number_tl . @@ -248,7 +248,7 @@ \tl_if_exist:NF \c_xsim_version_tl { \tl_set:Nx \l__xsim_module_version_tl {\c_xsimverb_version_tl} } -\hook_gput_code:nnn {package/after/xsim} {xsim} +\hook_gput_code:nnn {package/xsim/after} {xsim} { \tl_set:NV \l__xsim_module_date_tl \c_xsim_date_tl \tl_set:NV \l__xsim_module_version_tl \c_xsim_version_tl diff --git a/code/xsim.sty b/code/xsim.sty index bdb0e0e..3697019 100644 --- a/code/xsim.sty +++ b/code/xsim.sty @@ -8,7 +8,7 @@ % Web: https://github.com/cgnieder/xsim % E-Mail: contact@mychemistry.eu % ---------------------------------------------------------------------------- -% Copyright 2017--2021 Clemens Niederberger +% Copyright 2017--2022 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c @@ -29,10 +29,10 @@ \ExplSyntaxOn -\tl_const:Nn \c_xsim_date_tl {2021/02/03} +\tl_const:Nn \c_xsim_date_tl {2022/01/05} \tl_const:Nn \c_xsim_version_major_number_tl {0} -\tl_const:Nn \c_xsim_version_minor_number_tl {20} -\tl_const:Nn \c_xsim_version_subrelease_tl {c} +\tl_const:Nn \c_xsim_version_minor_number_tl {21} +\tl_const:Nn \c_xsim_version_subrelease_tl {} \tl_const:Nx \c_xsim_version_number_tl { \c_xsim_version_major_number_tl . @@ -248,7 +248,7 @@ \tl_if_exist:NF \c_xsim_version_tl { \tl_set:Nx \l__xsim_module_version_tl {\c_xsimverb_version_tl} } -\hook_gput_code:nnn {package/after/xsim} {xsim} +\hook_gput_code:nnn {package/xsim/after} {xsim} { \tl_set:NV \l__xsim_module_date_tl \c_xsim_date_tl \tl_set:NV \l__xsim_module_version_tl \c_xsim_version_tl @@ -554,7 +554,7 @@ { \msg_expandable_error:nnn {xsim} {attribute-not-set} {#1::#2} } } } - + % #1: attribute % #2: item \prg_new_conditional:Npnn \xsim_attribute_if_set:nn #1#2 {p,T,F,TF} @@ -1215,6 +1215,12 @@ { \xsim_attribute_get:nn {#1!#2} {#3} } \cs_generate_variant:Nn \xsim_get_property:nnn {nx,ne,xx,oo,no,nnf,nf,oof,nV} +% #1: type +% #2: id +% #3: property +\cs_new:Npn \xsim_show_property:nnn #1#2#3 + { \xsim_attribute_show:nn {#1!#2} {#3} } + % #1: property % #2: value \cs_new:Npn \xsim_get_id_for_property:nn #1#2 @@ -1495,8 +1501,11 @@ { \xsim_verbose:n { Saving~ #3~ environment~ type~ `#1'~ id~ `#2' } \xsim_set_property:nnnn {#1} {#2} {#3-body} {#4} - \xsim_if_exchange:nnnF {#1} {#2} {#3} - { \xsim_set_property:nnnn {#1} {#2} {solution-body} {#4} } + \xsim_if_exchange:nnnT {#1} {#2} {#3} + { + \tl_if_eq:nnT {#3} {exercise} + { \xsim_set_property:nnnn {#1} {#2} {solution-body} {#4} } + } } \cs_new:Npn \__xsim_save_environment_body_end: { } diff --git a/code/xsim.style.layouts.code.tex b/code/xsim.style.layouts.code.tex index 120df82..143f04a 100644 --- a/code/xsim.style.layouts.code.tex +++ b/code/xsim.style.layouts.code.tex @@ -8,7 +8,7 @@ % Web: https://github.com/cgnieder/xsim % E-Mail: contact@mychemistry.eu % ---------------------------------------------------------------------------- -% Copyright 2017--2021 Clemens Niederberger +% Copyright 2017--2022 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c diff --git a/code/xsimverb.start.code.tex b/code/xsimverb.start.code.tex index ce1fefb..cc575ff 100644 --- a/code/xsimverb.start.code.tex +++ b/code/xsimverb.start.code.tex @@ -8,7 +8,7 @@ % Web: https://github.com/cgnieder/xsim % E-Mail: contact@mychemistry.eu % ---------------------------------------------------------------------------- -% Copyright 2017--2021 Clemens Niederberger +% Copyright 2017--2022 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c diff --git a/code/xsimverb.sty b/code/xsimverb.sty index 019df69..1f5c292 100644 --- a/code/xsimverb.sty +++ b/code/xsimverb.sty @@ -8,7 +8,7 @@ % Web: https://github.com/cgnieder/xsim % E-Mail: contact@mychemistry.eu % ---------------------------------------------------------------------------- -% Copyright 2017--2021 Clemens Niederberger +% Copyright 2017--2022 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c