diff options
author | Norbert Preining <norbert@preining.info> | 2019-11-11 03:00:42 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-11-11 03:00:42 +0000 |
commit | 0e71c26d9aa79c6e92c3095d6c71f28a566e6054 (patch) | |
tree | b7657bd03108b5ca35e61578ab27b67bd098bf4e /macros/latex/contrib/xsim/code | |
parent | 838842fa4625160270947ca654e7492e3c7afc44 (diff) |
CTAN sync 201911110300
Diffstat (limited to 'macros/latex/contrib/xsim/code')
10 files changed, 65 insertions, 30 deletions
diff --git a/macros/latex/contrib/xsim/code/xsim.auxfile.code.tex b/macros/latex/contrib/xsim/code/xsim.auxfile.code.tex index 8018694616..d308a9ccc3 100644 --- a/macros/latex/contrib/xsim/code/xsim.auxfile.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.auxfile.code.tex @@ -58,7 +58,7 @@ \xsim_write_to_aux:x { \token_to_str:N \XSIM {#1} #2 } } -\AtBeginDocument +\xsim_at_begin_document:n { \iow_now:Nx \@auxout { \token_to_str:N \providecommand \token_to_str:N \XSIM [1] {} } @@ -69,7 +69,7 @@ \xsim_if_use_aux:F { \iow_new:N \l__xsim_aux_file_iow - \AtBeginDocument + \xsim_at_begin_document:n { \iow_open:Nn \l__xsim_aux_file_iow { \c_sys_jobname_str .xsim } } } @@ -117,7 +117,7 @@ { \prop_gput:cnn {g__xsim_list_#1_prop} {####1} {} } } } - \AtBeginDocument + \xsim_at_begin_document:n { \seq_gclear:c {g__xsim_list_recorded_#1_seq} \seq_set_eq:Nc \l__xsim_tmpa_seq {g__xsim_list_#1_seq} @@ -178,7 +178,7 @@ \cs_new_protected:Npn \xsim_empty_lists: { \bool_set_true:N \l__xsim_empty_lists_bool } -% update list -- should be used inside \AtEndDocument: +% update list (should be used inside \xsim_at_end_document:n): % #1: name \cs_new_protected:Npn \xsim_update_list:n #1 { diff --git a/macros/latex/contrib/xsim/code/xsim.base.code.tex b/macros/latex/contrib/xsim/code/xsim.base.code.tex index df767976b6..b1fa20bff7 100644 --- a/macros/latex/contrib/xsim/code/xsim.base.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.base.code.tex @@ -27,6 +27,20 @@ % ---------------------------------------------------------------------------- \XSIMmodule{base}{basic functionality of the package} +\tl_new:N \g_xsim_end_document_hook_tl +\tl_new:N \g_xsim_begin_document_hook_tl + +\AtBeginDocument { \tl_use:N \g_xsim_begin_document_hook_tl } +\AtEndDocument { \tl_use:N \g_xsim_end_document_hook_tl } + +\cs_new_protected:Npn \xsim_at_begin_document:n #1 + { \tl_gput_right:Nn \g_xsim_begin_document_hook_tl {#1} } + +\cs_new_protected:Npn \xsim_at_end_document:n #1 + { \tl_gput_right:Nn \g_xsim_end_document_hook_tl {#1} } + +% ---------------------------------------------------------------------------- + \xsim_load_modules:n {auxfile} % ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/xsim/code/xsim.collections.code.tex b/macros/latex/contrib/xsim/code/xsim.collections.code.tex index 3f5d2a1b86..3097981b74 100644 --- a/macros/latex/contrib/xsim/code/xsim.collections.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.collections.code.tex @@ -380,13 +380,13 @@ % ---------------------------------------------------------------------------- -\AtBeginDocument +\xsim_at_begin_document:n { \xsim_get_collections: \xsim_activate_collection:n {all~ exercises} } -\AtEndDocument +\xsim_at_end_document:n { \xsim_deactivate_collection:n {all~ exercises} \xsim_foreach_collection:n { \xsim_update_list:n {collection:#1} } diff --git a/macros/latex/contrib/xsim/code/xsim.environments.code.tex b/macros/latex/contrib/xsim/code/xsim.environments.code.tex index daaae03211..2f9c870b71 100644 --- a/macros/latex/contrib/xsim/code/xsim.environments.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.environments.code.tex @@ -404,7 +404,7 @@ } } } -\cs_generate_variant:Nn \xsim_insert:nnnn {nV,VV,nnnV} +\cs_generate_variant:Nn \xsim_insert:nnnn {nV,VV,nnnV,xx} % #1: type % #2: id diff --git a/macros/latex/contrib/xsim/code/xsim.exercises.code.tex b/macros/latex/contrib/xsim/code/xsim.exercises.code.tex index 9eb469fee4..f9cb706410 100644 --- a/macros/latex/contrib/xsim/code/xsim.exercises.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.exercises.code.tex @@ -540,7 +540,7 @@ } } -\AtBeginDocument +\xsim_at_begin_document:n { \xsim_foreach_exercise_type:n { @@ -549,7 +549,7 @@ } } -\AtEndDocument +\xsim_at_end_document:n { \xsim_if_clear_aux:T { diff --git a/macros/latex/contrib/xsim/code/xsim.goals.code.tex b/macros/latex/contrib/xsim/code/xsim.goals.code.tex index c03fe14483..6e482737b5 100644 --- a/macros/latex/contrib/xsim/code/xsim.goals.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.goals.code.tex @@ -54,7 +54,7 @@ { \fp_new:c {g__xsim_total_goal_#1_fp} } \fp_if_exist:cF {g__xsim_total_goal_recorded_#1_fp} { \fp_new:c {g__xsim_total_goal_recorded_#1_fp} } - \AtBeginDocument + \xsim_at_begin_document:n { \xsim_foreach_exercise_type:n { @@ -262,7 +262,7 @@ \xsim_new_aux_cs:cpn {totalgoal} #1#2 { \fp_gset:cn {g__xsim_total_goal_#1_fp} {#2} } -\AtBeginDocument +\xsim_at_begin_document:n { \seq_map_inline:Nn \l__xsim_goals_seq { @@ -272,7 +272,7 @@ } } -\AtEndDocument +\xsim_at_end_document:n { \seq_map_inline:Nn \l__xsim_goals_seq { diff --git a/macros/latex/contrib/xsim/code/xsim.interface.code.tex b/macros/latex/contrib/xsim/code/xsim.interface.code.tex index 0c1251d113..ba409d9758 100644 --- a/macros/latex/contrib/xsim/code/xsim.interface.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.interface.code.tex @@ -498,6 +498,14 @@ % ---------------------------------------------------------------------------- +\NewDocumentCommand \XSIMatbegindocument {+m} + { \xsim_at_begin_document:n {#1} } + +\NewDocumentCommand \XSIMatenddocument {+m} + { \xsim_at_end_document:n {#1} } + +% ---------------------------------------------------------------------------- + \NewDocumentCommand \ForEachPrintedExerciseByType {+m} { \xsim_foreach_exercise_type_id:nn {print} {#1} } @@ -601,11 +609,23 @@ % ---------------------------------------------------------------------------- -\NewDocumentCommand \printsolution {O{}mm} - { \xsim_insert:nnnn {#2} {#3} {#1} {solution} } +\NewDocumentCommand \XSIMprint {mO{}mm} + { \xsim_insert:nnnn {#3} {#4} {#2} {#1} } + +\NewDocumentCommand \XSIMxprint {mO{}mm} + { \xsim_insert:xxnn {#3} {#4} {#2} {#1} } \NewDocumentCommand \printexercise {O{}mm} { \xsim_insert:nnnn {#2} {#3} {#1} {exercise} } + +\NewDocumentCommand \xprintexercise {O{}mm} + { \xsim_insert:xxnn {#2} {#3} {#1} {exercise} } + +\NewDocumentCommand \printsolution {O{}mm} + { \xsim_insert:nnnn {#2} {#3} {#1} {solution} } + +\NewDocumentCommand \xprintsolution {O{}mm} + { \xsim_insert:xxnn {#2} {#3} {#1} {solution} } % ---------------------------------------------------------------------------- diff --git a/macros/latex/contrib/xsim/code/xsim.properties.code.tex b/macros/latex/contrib/xsim/code/xsim.properties.code.tex index 1222a61b2e..5dd0d1baee 100644 --- a/macros/latex/contrib/xsim/code/xsim.properties.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.properties.code.tex @@ -94,8 +94,8 @@ } \bool_if:nF {#3} { - \AtEndDocument { \xsim_update_list:n {#4} } - \AtBeginDocument { \__xsim_set_property_from_list:n {#4} } + \xsim_at_end_document:n { \xsim_update_list:n {#4} } + \xsim_at_begin_document:n { \__xsim_set_property_from_list:n {#4} } } } } diff --git a/macros/latex/contrib/xsim/code/xsim.sty b/macros/latex/contrib/xsim/code/xsim.sty index a56fa8ecf5..f5efe12408 100644 --- a/macros/latex/contrib/xsim/code/xsim.sty +++ b/macros/latex/contrib/xsim/code/xsim.sty @@ -29,9 +29,9 @@ \ExplSyntaxOn -\tl_const:Nn \c_xsim_date_tl {2019/11/02} +\tl_const:Nn \c_xsim_date_tl {2019/11/10} \tl_const:Nn \c_xsim_version_major_number_tl {0} -\tl_const:Nn \c_xsim_version_minor_number_tl {15} +\tl_const:Nn \c_xsim_version_minor_number_tl {16} \tl_const:Nn \c_xsim_version_subrelease_tl {} \tl_const:Nx \c_xsim_version_number_tl { diff --git a/macros/latex/contrib/xsim/code/xsim.translations.code.tex b/macros/latex/contrib/xsim/code/xsim.translations.code.tex index 978413f6e6..f818c8d5ff 100644 --- a/macros/latex/contrib/xsim/code/xsim.translations.code.tex +++ b/macros/latex/contrib/xsim/code/xsim.translations.code.tex @@ -65,18 +65,19 @@ } } -\AtBeginDocument{ - \bool_if:NTF \l__xsim_language_auto_bool - { - \tl_set:Nx \l_xsim_language_tl - { \@trnslt@language{\@trnslt@current@language} } - } - { - \tl_set_eq:NN - \l_xsim_language_tl - \l__xsim_current_language_tl - } -} +\xsim_at_begin_document:n + { + \bool_if:NTF \l__xsim_language_auto_bool + { + \tl_set:Nx \l_xsim_language_tl + { \@trnslt@language{\@trnslt@current@language} } + } + { + \tl_set_eq:NN + \l_xsim_language_tl + \l__xsim_current_language_tl + } + } % ---------------------------------------------------------------------------- % #1: keyword |