diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx b/Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx index d0cb09aa137..93d265542c7 100644 --- a/Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx +++ b/Master/texmf-dist/source/latex/knowledge/knowledge-utils.dtx @@ -102,6 +102,28 @@ {} {\tl_set_eq:Nc\c_sys_jobname_str{c_job_name_tl}} % \end{macrocode} +% Some useful adding (newset). +% \begin{macrocode} +\cs_new:Nn\tl_new:Nn + {\tl_new:N#1 + \tl_gset:Nn#1{#2}} +\cs_new:Nn\tl_new_eq:NN + {\tl_new:N#1 + \tl_gset_eq:NN#1#2} +\cs_new:Nn\bool_new_true:N + {\bool_new:N#1 + \bool_gset_true:N#1} +\cs_new:Nn\bool_new_false:N + {\bool_new:N#1 + \bool_gset_false:N#1} +\cs_new:Nn\bool_set_text:Nn + {\use:c{bool_set_#2:N}#1} +\cs_generate_variant:Nn\tl_new:Nn{Nx,cn,cx} +\cs_generate_variant:Nn\tl_new_eq:NN{Nc,cN,cc} +\cs_generate_variant:Nn\bool_new_true:N{c} +\cs_generate_variant:Nn\bool_new_false:N{c} +\cs_generate_variant:Nn\bool_set_text:Nn{cn} +% \end{macrocode} % Some new \kl{latex3} commands: % \cs{cs_new_with_variants:Nnn}, % \cs{if_mode_preamble:TF}, @@ -125,8 +147,10 @@ % % Now comes a command for simultaneously testing existence and non emptiness. % \begin{macrocode} -\cs_new:Nn\tl_if_exist_ne:NTF - {\tl_if_exist:NTF#1{\tl_if_empty:NTF#1{#3}{#2}}{#3}} +\cs_new:Npn\tl_if_exist_ne:NTF#1 + {\tl_if_exist:NTF#1{\tl_if_empty:NTF#1\use_ii:nn\use_i:nn}\use_ii:nn} +\cs_new:Npn\tl_if_exist_ne:NT#1 + {\tl_if_exist:NTF#1{\tl_if_empty:NTF#1\use_none:n\use:n}\use_none:n} \cs_generate_variant:Nn\tl_if_empty:nTF{xTF} % \end{macrocode} % @@ -308,8 +332,11 @@ {\tl_put_right:Nn\kaux_inittreatment_tl{#1}} % \end{macrocode} % \begin{macrocode} +\tl_new:N\kaux_pretreatment_tl \tl_gset:Nn\kaux_pretreatment_tl{} +\tl_new:N\kaux_posttreatment_tl \tl_gset:Nn\kaux_posttreatment_tl{} +\tl_new:N\kaux_inittreatment_tl \tl_gset:Nn\kaux_inittreatment_tl{} % \end{macrocode} % @@ -345,6 +372,7 @@ { \ProvideDocumentCommand#1{#2}{} \KAuxInit {\KAuxWrite*{\KAuxCommand#1{#2}{#3}}} + \tl_new:c{kaux_\cs_to_str:N#1-args_tl} \tl_gset:cn{kaux_\cs_to_str:N#1-args_tl}{#2} \tl_gput_right:Nn\kaux_command_list_tl{#1} } @@ -365,7 +393,7 @@ % \end{macrocode} % \begin{macrocode} \cs_new:Nn\kaux_activate_command_phase:Nn -{ \tl_gclear:c{kaux_\cs_to_str:N#1-active_tl} +{ \tl_clear_new:c{kaux_\cs_to_str:N#1-active_tl} % \kaux_code_set:Nn\tmpa_code{} \clist_map_inline:nn{#2} @@ -451,6 +479,7 @@ {\tl_set:Nn\kauxCurrentFile{#1} \tl_set:Nn\kauxCurrentLine{#2}} +\cs_new:Nn\kaux_current_location:{\kauxCurrentFile :\kauxCurrentLine :} \tl_new:N\kauxCurrentFile \tl_new:N\kauxCurrentLine % \end{macrocode} |