diff options
Diffstat (limited to 'macros/latex/contrib/schule/latex/schule.mod.Aufgabenpool.code.tex')
-rw-r--r-- | macros/latex/contrib/schule/latex/schule.mod.Aufgabenpool.code.tex | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/macros/latex/contrib/schule/latex/schule.mod.Aufgabenpool.code.tex b/macros/latex/contrib/schule/latex/schule.mod.Aufgabenpool.code.tex index 76e66d9795..33579f61b4 100644 --- a/macros/latex/contrib/schule/latex/schule.mod.Aufgabenpool.code.tex +++ b/macros/latex/contrib/schule/latex/schule.mod.Aufgabenpool.code.tex @@ -5,15 +5,15 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \clist_new:N \g__schule_aufgabenoptionen_clist -\DeclareDocumentCommand{\ifAufgabenpoolOptionTF}{m m m}{ +\DeclareDocumentCommand{\ifAufgabenpoolOptionTF}{m +m +m}{ \clist_if_in:NnTF \g__schule_aufgabenoptionen_clist {#1} {#2} {#3} } -\DeclareDocumentCommand{\ifAufgabenpoolOptionT}{m m}{ +\DeclareDocumentCommand{\ifAufgabenpoolOptionT}{m +m}{ \clist_if_in:NnT \g__schule_aufgabenoptionen_clist {#1} {#2} } -\DeclareDocumentCommand{\ifAufgabenpoolOptionF}{m m}{ +\DeclareDocumentCommand{\ifAufgabenpoolOptionF}{m +m}{ \clist_if_in:NnF \g__schule_aufgabenoptionen_clist {#1} {#2} } @@ -46,21 +46,21 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Aufgabenhinweise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\bool_new:N \g__schule_aufgabenhinweis_bool -\bool_gset_true:N \g__schule_aufgabenhinweis_bool +\bool_new:N \g__schule_inAufgabenInput_bool +\bool_gset_false:N \g__schule_inAufgabenInput_bool \NewDocumentEnvironment{aufgabenpoolHinweis}{+b}{ - \bool_if:NT \g__schule_aufgabenhinweis_bool {#1} + \bool_if:NF \g__schule_inAufgabenInput_bool {#1} }{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Aufgabeneinbindung %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \DeclareDocumentCommand{\aufgabeninput}{o m m}{ - \bool_gset_false:N \g__schule_aufgabenhinweis_bool + \bool_gset_true:N \g__schule_inAufgabenInput_bool \str_gset:Nn \g__schule_basedir_string {#2} \clist_set:Nn \g__schule_aufgabenoptionen_clist {#1} \input{#2/#3} - \bool_gset_true:N \g__schule_aufgabenhinweis_bool + \bool_gset_false:N \g__schule_inAufgabenInput_bool } \xsimsetup{ @@ -72,6 +72,9 @@ % InputOnce %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \clist_new:N \g__schule_inputonce_clist +\clist_new:N \g__schule_inputonceAppendix_clist +\prop_new:N \g__schule_appendix_prop +\prop_new:N \g__schule_appendixBasedir_prop \DeclareDocumentCommand{\inputOnce}{m}{ \clist_if_in:NnF \g__schule_inputonce_clist {#1} { @@ -80,4 +83,29 @@ } } +\DeclareDocumentCommand{\inputOnceAppendix}{m}{ + \exp_args:Nnf \clist_if_in:NnF {\g__schule_inputonceAppendix_clist} {\getBasedir/#1} { + \exp_args:Nnf \clist_gput_right:Nx {\g__schule_inputonceAppendix_clist} {\getBasedir/#1} + \bool_if:NF \g__schule_inAufgabenInput_bool {\input{\getBasedir/#1}} + } +} + +\DeclareDocumentCommand{\showIncludeAppendix}{}{ + \clist_map_inline:Nn \g__schule_inputonceAppendix_clist { + \input{##1} + } + \prop_map_inline:Nn \g__schule_appendix_prop { + \exp_args:Nnf \str_gset:Nn \g__schule_basedir_string {\prop_item:Nn \g__schule_appendixBasedir_prop {##1}} + ##2 + } +} + +\NewDocumentEnvironment{onceAppendix}{m +b}{ + \prop_gput:Nnn \g__schule_appendix_prop {#1} {#2} + \exp_args:Nnnf \prop_gput:Nnn {\g__schule_appendixBasedir_prop} {#1} {\getBasedir} + \bool_if:NF \g__schule_inAufgabenInput_bool { + #2 + } +}{} + \ExplSyntaxOff |