diff options
Diffstat (limited to 'macros/latex')
-rw-r--r-- | macros/latex/contrib/easybook/easybook.dtx | 16 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.pdf | bin | 591248 -> 591338 bytes | |||
-rw-r--r-- | macros/latex/contrib/semantex/semantex.pdf | bin | 384087 -> 385078 bytes | |||
-rw-r--r-- | macros/latex/contrib/semantex/semantex.sty | 327 | ||||
-rw-r--r-- | macros/latex/contrib/semantex/semantex.tex | 24 | ||||
-rw-r--r-- | macros/latex/contrib/semantex/stripsemantex.sty | 2 |
6 files changed, 315 insertions, 54 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 80b435a4e2..90a255b903 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -28,7 +28,7 @@ % % \title{\sffamily easybook 文档类手册} % \author{瞿毅} -% \date{2021/07/16\hskip\ccwd\relax v1.27h\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/07/18\hskip\ccwd\relax v1.27j\thanks{\url{https://gitee.com/texl3/easybook}}} % % \maketitle % \begin{abstract} @@ -148,7 +148,7 @@ % cjkfont = <adobe|fandol|founder|mac|macnew|macold|ubuntu|windows|none> % \end{syntax} % 中文字体采用 \CTeX 宏集包含的字库并与其一致,具体配置方案可以查看 \CTeX 使用手册。它与 \opt{fontset} 选项是等效的,如果没有指定 \opt{cjkfont} 的值,将会自动检测用户的操作系统并选择相应的字体。 -% \changes{v1.27h}{2021/07/12}{新增 \opt{cjkfont} 选项设置中文字体,原 \opt{font} 选项设置英文字体,中文字体使用 \CTeX 的字库。} +% \changes{v1.27j}{2021/07/12}{新增 \opt{cjkfont} 选项设置中文字体,原 \opt{font} 选项设置英文字体,中文字体使用 \CTeX 的字库。} % \end{function} % % 如果需要使用其它中文字体,可以在启用选项 \opt{cjkfont = none} 后,再使用 \pkg{xeCJK} 宏包的相关命令设置字体以及声明字体族: @@ -676,7 +676,7 @@ % sec-mark = \CTEXifname{\CTEXthesection——}{}#1 % } % \end{ctexexam} -% \opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个选项可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 或下述 \tn{markrule} 命令来绘制横线,脚注线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。 +% \opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个选项可以使用 \tn{hrule} \texttt{width} \meta{长度} \texttt{height} \meta{高度} 或下述 \tn{markrule} 命令来绘制横线,脚注线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。 % % \begin{function}[added = 2021-01-13,updated = 2021-06-14]{\easyhead,\easyfoot,\markrule} % \begin{syntax} @@ -717,7 +717,7 @@ % \end{syntax} % \ding{229} 以上选项路径为 \opt{hdrset/...} \\ % \changes{v1.25}{2021/05/12}{增加脚注样式设置选项。} -% \changes{v1.27h}{2021/07/14}{增加脚注内容格式选项 \opt{fntext-form} 和脚注类型选项 \opt{footnotetype}。} +% \changes{v1.27j}{2021/07/14}{增加脚注内容格式选项 \opt{fntext-form} 和脚注类型选项 \opt{footnotetype}。} % \end{function} % % \begin{optdesc} @@ -905,7 +905,7 @@ % \tn{end}\{hangparas\} % \end{syntax} % \tn{hangpara} 命令使其后的一个段落保持悬挂缩进,\env{hangparas} 环境使其中的段落均保持悬挂缩进。缩进将以 \meta{缩进长度} 从每个段落的 \meta{缩进开始行数} 开始。 -% \changes{v1.27h}{2021/07/11}{增加悬挂缩进段落命令 \tn{hangpara} 和环境 \env{hangparas}。} +% \changes{v1.27j}{2021/07/11}{增加悬挂缩进段落命令 \tn{hangpara} 和环境 \env{hangparas}。} % \end{function} % % \subsection{代码} @@ -1290,7 +1290,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/07/16}{1.27h} +\ProvidesExplClass{easybook}{2021/07/18}{1.27j} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -1584,7 +1584,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/07/16}{1.27h} +\ProvidesExplPackage{easybase}{2021/07/18}{1.27j} {Typeset Chinese theses or books} \cs_generate_variant:Nn \int_to_arabic:n { v } @@ -3457,7 +3457,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/16}{1.27h} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/18}{1.27j} {Customization of tcolorbox for easybook} \cs_new_protected:Npn \eb_tcb_theorem_set:n #1 diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf Binary files differindex 788290ec5e..df728b8a93 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/semantex/semantex.pdf b/macros/latex/contrib/semantex/semantex.pdf Binary files differindex 71b9241a80..006182bf85 100644 --- a/macros/latex/contrib/semantex/semantex.pdf +++ b/macros/latex/contrib/semantex/semantex.pdf diff --git a/macros/latex/contrib/semantex/semantex.sty b/macros/latex/contrib/semantex/semantex.sty index b026a84023..cfc3941666 100644 --- a/macros/latex/contrib/semantex/semantex.sty +++ b/macros/latex/contrib/semantex/semantex.sty @@ -1,5 +1,5 @@ \RequirePackage{xparse,l3keys2e,leftindex,semtex} -\ProvidesExplPackage{semantex}{2021/07/04}{0.507}{} +\ProvidesExplPackage{semantex}{2021/07/18}{0.508}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -12,11 +12,15 @@ \cs_set_eq:NN \semantex_keyval_parse:NNn \keyval_parse:NNn +\cs_set:Npn \semantex_singlekey_parse:Nn#1#2 { \clist_map_function:nN { #2 } #1 } + \keys_define:nn { semantex } { keyval~parser .code:n = \cs_set_eq:NN \semantex_keyval_parse:NNn #1, keyval~parser .value_required:n = true, + single~key~parser .code:n = \cs_set_eq:NN \semantex_singlekey_parse:Nn #1, + single~key~parser .value_required:n = true, semtex~file .choice:, semtex~file / true .code:n = \semantex_turn_semtex_file_on:, semtex~file / false .code:n = \semantex_turn_semtex_file_off:, @@ -2879,6 +2883,7 @@ \cs_new_protected:Npn \semantex_keys_set_x:nn#1#2 { + % This key should no longer be used. \cs_set_eq:NN\l__semantex_keys_set_old_this_temp_cs:\semantex_this: \cs_set:Nn\semantex_this:{#1} % The central command for doing expanded keyval setup @@ -2904,6 +2909,7 @@ \cs_new_protected:Npn \semantex_arg_keys_set_x:nn#1#2 { + % This key should no longer be used. % The central command for doing expanded keyval setup for the argument % #1 = object % #2 = keys @@ -2913,14 +2919,22 @@ { #2 } } -\cs_generate_variant:Nn \clist_map_function:nN { nc } +\cs_generate_variant:Nn \semantex_singlekey_parse:Nn { cn } \cs_new_protected:Npn \semantex_arg_singlekeys_set:nn#1#2 { % This command is necessary because you sometimes want to only allow singlekeys % and not valuekeys in arguments (for instance, if you allow valuekeys, anything % containing an equality sign will die horribly in the argument of any object) - \clist_map_function:nc {#2} { __semantex_data_cs_#1_arg_singlekey:n } + \semantex_singlekey_parse:cn { __semantex_data_cs_#1_arg_singlekey:n } { #2 } +} + +\cs_new_protected:Npn \semantex_arg_singlekeys_set_x:nn#1#2 +{ + % This command is necessary because you sometimes want to only allow singlekeys + % and not valuekeys in arguments (for instance, if you allow valuekeys, anything + % containing an equality sign will die horribly in the argument of any object) + \semantex_singlekey_parse:cn { __semantex_data_cs_#1_arg_singlekey_x:n } {#2} } \DeclareDocumentCommand\SetupClass{mm}{ % a user-level command for setting up the object @@ -3692,7 +3706,7 @@ \semantex_preprocess_arg_keys_x:nN { #3 } #4 } { arg~keys~set~x }{ - \semantex_preprocess_arg_keys_x:nN { #3 } #4\textbf{} + \semantex_preprocess_arg_keys_x:nN { #3 } #4 } { set~arg~single~keys }{ \semantex_preprocess_arg_singlekeys:nN { #3 } #4 @@ -4851,6 +4865,7 @@ \cs_new_protected:Npn \semantex_clear_singlekey:nn#1#2 { + % Note that this is strictly different from undefining the key. \cs_set_protected:cpo { __semantex_data_cs_custom_singlekey_#1_\tl_trim_spaces:n{#2}:n } ##1 { % do nothing @@ -5718,7 +5733,7 @@ { \__semantex_preprocess_arg_singlekey:nnN { ####1 } { ##1 } #2 } - \clist_map_function:nN { #1 } \l__semantex_preprocess_arg_singlekey_temp_cs:n + \semantex_singlekey_parse:Nn \l__semantex_preprocess_arg_singlekey_temp_cs:n { #1 } } @@ -5810,7 +5825,7 @@ { \__semantex_preprocess_arg_singlekey_x:nnN { ####1 } { ##1 } #2 } - \clist_map_function:nN { #1 } \l__semantex_preprocess_arg_singlekey_x_temp_cs:n + \semantex_singlekey_parse:Nn \l__semantex_preprocess_arg_singlekey_x_temp_cs:n { #1 } } @@ -6809,18 +6824,78 @@ \cs_new:Npn\SemantexDataGet#1{\semantex_data_tl_get:nn{\semantex_this:}{\tl_trim_spaces:n{#1}}} \cs_new:Npn\SemantexDataGetExpNot#1{\semantex_data_tl_get_exp_not:nn{\semantex_this:}{\tl_trim_spaces:n{#1}}} \cs_new_protected:Npn\SemantexDataClear#1{\semantex_data_tl_clear:nn{\semantex_this:}{\tl_trim_spaces:n{#1}}} -\cs_new_protected:Npn\SemantexSetKeys#1{\semantex_keys_set:on{\semantex_this:}{#1}} -\cs_new_protected:Npn\SemantexKeysSet#1{\semantex_keys_set:on{\semantex_this:}{#1}} -\cs_new_protected:Npn\SemantexSetKeysx#1{\semantex_keys_set_x:on{\semantex_this:}{#1}} -\cs_new_protected:Npn\SemantexKeysSetx#1{\semantex_keys_set_x:on{\semantex_this:}{#1}} -\cs_new_protected:Npn\SemantexSetArgKeys#1{\semantex_arg_keys_set:nn { \semantex_this: } { #1 }} -\cs_new_protected:Npn\SemantexArgKeysSet#1{\semantex_arg_keys_set:nn { \semantex_this: } { #1 }} -\cs_new_protected:Npn\SemantexSetArgKeysx#1{\semantex_arg_keys_set_x:nn { \semantex_this: } { #1 }} -\cs_new_protected:Npn\SemantexArgKeysSetx#1{\semantex_arg_keys_set_x:nn { \semantex_this: } { #1 }} -\cs_new_protected:Npn\SemantexSetArgSingleKeys#1{\semantex_arg_singlekeys_set:nn { \semantex_this: } { #1 } } -\cs_new_protected:Npn\SemantexArgSingleKeysSet#1{\semantex_arg_singlekeys_set:nn { \semantex_this: } { #1 } } -\cs_new_protected:Npn\SemantexSetArgSingleKeysx#1{\semantex_arg_singlekeys_set_x:nn { \semantex_this: } { #1 } } -\cs_new_protected:Npn\SemantexArgSingleKeysSetx#1{\semantex_arg_singlekeys_set_x:nn { \semantex_this: } { #1 } } +\cs_new_protected:Npn\SemantexSetKeys#1{ + \tl_set:Nn\l__semantex_keys_set_temp_tl{} + \semantex_preprocess_keys:nN { #1 } \l__semantex_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_temp_cs:n{\l__semantex_keys_set_temp_tl} + \l__semantex_keys_set_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexKeysSet#1{ + \tl_set:Nn\l__semantex_keys_set_temp_tl{} + \semantex_preprocess_keys:nN { #1 } \l__semantex_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_temp_cs:n{\l__semantex_keys_set_temp_tl} + \l__semantex_keys_set_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexSetKeysx#1{ + \tl_set:Nn\l__semantex_keys_set_x_temp_tl{} + \semantex_preprocess_keys_x:nN { #1 } \l__semantex_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_x_temp_cs:n{\l__semantex_keys_set_x_temp_tl} + \l__semantex_keys_set_x_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexKeysSetx#1{ + \tl_set:Nn\l__semantex_keys_set_x_temp_tl{} + \semantex_preprocess_keys_x:nN { #1 } \l__semantex_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_x_temp_cs:n{\l__semantex_keys_set_x_temp_tl} + \l__semantex_keys_set_x_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexSetArgKeys#1{ + \tl_set:Nn\l__semantex_arg_keys_set_temp_tl{} + \semantex_preprocess_arg_keys:nN { #1 } \l__semantex_arg_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_temp_cs:n{\l__semantex_arg_keys_set_temp_tl} + \l__semantex_arg_keys_set_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexArgKeysSet#1{ + \tl_set:Nn\l__semantex_arg_keys_set_temp_tl{} + \semantex_preprocess_arg_keys:nN { #1 } \l__semantex_arg_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_temp_cs:n{\l__semantex_arg_keys_set_temp_tl} + \l__semantex_arg_keys_set_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexSetArgKeysx#1{ + \tl_set:Nn\l__semantex_arg_keys_set_x_temp_tl{} + \semantex_preprocess_arg_keys_x:nN { #1 } \l__semantex_arg_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_x_temp_cs:n{\l__semantex_arg_keys_set_x_temp_tl} + \l__semantex_arg_keys_set_x_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexArgKeysSetx#1{ + \tl_set:Nn\l__semantex_arg_keys_set_x_temp_tl{} + \semantex_preprocess_arg_keys_x:nN { #1 } \l__semantex_arg_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_x_temp_cs:n{\l__semantex_arg_keys_set_x_temp_tl} + \l__semantex_arg_keys_set_x_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexSetArgSingleKeys#1{ + \tl_set:Nn\l__semantex_arg_singlekeys_set_temp_tl{} + \semantex_preprocess_arg_singlekeys:nN { #1 } \l__semantex_arg_singlekeys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_temp_cs:n{\l__semantex_arg_singlekeys_set_temp_tl} + \l__semantex_arg_singlekeys_set_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexArgSingleKeysSet#1{ + \tl_set:Nn\l__semantex_arg_singlekeys_set_temp_tl{} + \semantex_preprocess_arg_singlekeys:nN { #1 } \l__semantex_arg_singlekeys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_temp_cs:n{\l__semantex_arg_singlekeys_set_temp_tl} + \l__semantex_arg_singlekeys_set_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexSetArgSingleKeysx#1{ + \tl_set:Nn\l__semantex_arg_singlekeys_set_x_temp_tl{} + \semantex_preprocess_arg_singlekeys_x:nN { #1 } \l__semantex_arg_singlekeys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_x_temp_cs:n{\l__semantex_arg_singlekeys_set_x_temp_tl} + \l__semantex_arg_singlekeys_set_x_temp_cs:n { \semantex_this: } +} +\cs_new_protected:Npn\SemantexArgSingleKeysSetx#1{ + \tl_set:Nn\l__semantex_arg_singlekeys_set_x_temp_tl{} + \semantex_preprocess_arg_singlekeys_x:nN { #1 } \l__semantex_arg_singlekeys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_x_temp_cs:n{\l__semantex_arg_singlekeys_set_x_temp_tl} + \l__semantex_arg_singlekeys_set_x_temp_cs:n { \semantex_this: } +} \cs_new_protected:Npn\SemantexSetOneArgSingleKey#1{\semantex_arg_singlekey:nn { \semantex_this: } { #1 } } \cs_new_protected:Npn\SemantexOneSingleArgKeySet#1{\semantex_arg_singlekey:nn { \semantex_this: } { #1 } } \cs_new_protected:Npn\SemantexSetOneArgSingleKeyx#1{\semantex_arg_singlekey_x:nn { \semantex_this: } { #1 } } @@ -7251,10 +7326,38 @@ {data~clear}{ execute={ \semantex_data_tl_clear:nn { ##1 } { \tl_trim_spaces:n { #1 } } }, }, - {keys~set}{ execute={ \semantex_keys_set:nn { ##1 } { #1 } } }, - {set~keys}{ execute={ \semantex_keys_set:nn { ##1 } { #1 } } }, - {keys~set~x}{ execute={ \semantex_keys_set_x:nn { ##1 } { #1 } } }, - {set~keys~x}{ execute={ \semantex_keys_set_x:nn { ##1 } { #1 } } }, + {keys~set}{ + execute={ + \tl_set:Nn\l__semantex_keys_set_temp_tl{} + \semantex_preprocess_keys:nN { #1 } \l__semantex_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_temp_cs:n{\l__semantex_keys_set_temp_tl} + \l__semantex_keys_set_temp_cs:n { ##1 } + }, + }, + {set~keys}{ + execute={ + \tl_set:Nn\l__semantex_keys_set_temp_tl{} + \semantex_preprocess_keys:nN { #1 } \l__semantex_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_temp_cs:n{\l__semantex_keys_set_temp_tl} + \l__semantex_keys_set_temp_cs:n { ##1 } + }, + }, + {keys~set~x}{ + execute={ + \tl_set:Nn\l__semantex_keys_set_x_temp_tl{} + \semantex_preprocess_keys_x:nN { #1 } \l__semantex_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_x_temp_cs:n{\l__semantex_keys_set_x_temp_tl} + \l__semantex_keys_set_x_temp_cs:n { ##1 } + }, + }, + {set~keys~x}{ + execute={ + \tl_set:Nn\l__semantex_keys_set_x_temp_tl{} + \semantex_preprocess_keys_x:nN { #1 } \l__semantex_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_x_temp_cs:n{\l__semantex_keys_set_x_temp_tl} + \l__semantex_keys_set_x_temp_cs:n { ##1 } + }, + }, {bool~provide}{ execute={ \semantex_data_bool_provide:nn { ##1 } { \tl_trim_spaces:n { #1 } } @@ -7632,14 +7735,70 @@ {clear~post~arg}{ execute={ \semantex_data_tl_clear:nn { ##1 } { post~arg } } }, }, define~keys[1]={ - {set~arg~keys}{ execute={ \semantex_arg_keys_set:nn { ##1 } { #1 } } }, - {arg~keys~set}{ execute={ \semantex_arg_keys_set:nn { ##1 } { #1 } } }, - {set~arg~keys~x}{ execute={ \semantex_arg_keys_set_x:nn { ##1 } { #1 } } }, - {arg~keys~set~x}{ execute={ \semantex_arg_keys_set_x:nn { ##1 } { #1 } } }, - {set~arg~single~keys}{ execute={ \semantex_arg_singlekeys_set:nn { ##1 } { #1 } } }, - {arg~single~keys~set}{ execute={ \semantex_arg_singlekeys_set:nn { ##1 } { #1 } } }, - {set~arg~single~keys~x}{ execute={ \semantex_arg_singlekeys_set_x:nn { ##1 } { #1 } } }, - {arg~single~keys~set~x}{ execute={ \semantex_arg_singlekeys_set_x:nn { ##1 } { #1 } } }, + {set~arg~keys}{ + execute={ + \tl_set:Nn\l__semantex_arg_keys_set_temp_tl{} + \semantex_preprocess_arg_keys:nN { #1 } \l__semantex_arg_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_temp_cs:n{\l__semantex_arg_keys_set_temp_tl} + \l__semantex_arg_keys_set_temp_cs:n { ##1 } + }, + }, + {arg~keys~set}{ + execute={ + \tl_set:Nn\l__semantex_arg_keys_set_temp_tl{} + \semantex_preprocess_arg_keys:nN { #1 } \l__semantex_arg_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_temp_cs:n{\l__semantex_arg_keys_set_temp_tl} + \l__semantex_arg_keys_set_temp_cs:n { ##1 } + }, + }, + {set~arg~keys~x}{ + execute={ + \tl_set:Nn\l__semantex_arg_keys_set_x_temp_tl{} + \semantex_preprocess_arg_keys_x:nN { #1 } \l__semantex_arg_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_x_temp_cs:n{\l__semantex_arg_keys_set_x_temp_tl} + \l__semantex_arg_keys_set_x_temp_cs:n { ##1 } + }, + }, + {arg~keys~set~x}{ + execute={ + \tl_set:Nn\l__semantex_arg_keys_set_x_temp_tl{} + \semantex_preprocess_arg_keys_x:nN { #1 } \l__semantex_arg_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_x_temp_cs:n{\l__semantex_arg_keys_set_x_temp_tl} + \l__semantex_arg_keys_set_x_temp_cs:n { ##1 } + }, + }, + {set~arg~single~keys}{ + execute={ + \tl_set:Nn\l__semantex_arg_singlekeys_set_temp_tl{} + \semantex_preprocess_arg_singlekeys:nN { #1 } \l__semantex_arg_singlekeys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_temp_cs:n{\l__semantex_arg_singlekeys_set_temp_tl} + \l__semantex_arg_singlekeys_set_temp_cs:n { ##1 } + }, + }, + {arg~single~keys~set}{ + execute={ + \tl_set:Nn\l__semantex_arg_singlekeys_set_temp_tl{} + \semantex_preprocess_arg_singlekeys:nN { #1 } \l__semantex_arg_singlekeys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_temp_cs:n{\l__semantex_arg_singlekeys_set_temp_tl} + \l__semantex_arg_singlekeys_set_temp_cs:n { ##1 } + }, + }, + {set~arg~single~keys~x}{ + execute={ + \tl_set:Nn\l__semantex_arg_singlekeys_set_x_temp_tl{} + \semantex_preprocess_arg_singlekeys_x:nN { #1 } \l__semantex_arg_singlekeys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_x_temp_cs:n{\l__semantex_arg_singlekeys_set_x_temp_tl} + \l__semantex_arg_singlekeys_set_x_temp_cs:n { ##1 } + }, + }, + {arg~single~keys~set~x}{ + execute={ + \tl_set:Nn\l__semantex_arg_singlekeys_set_x_temp_tl{} + \semantex_preprocess_arg_singlekeys_x:nN { #1 } \l__semantex_arg_singlekeys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_x_temp_cs:n{\l__semantex_arg_singlekeys_set_x_temp_tl} + \l__semantex_arg_singlekeys_set_x_temp_cs:n { ##1 } + }, + }, {set~one~arg~single~key}{ execute={ \semantex_arg_singlekey:nn { ##1 } { #1 } } }, {one~arg~single~key~set}{ execute={ \semantex_arg_singlekey:nn { ##1 } { #1 } } }, {set~one~arg~single~key~x}{ execute={ \semantex_arg_singlekey_x:nn { ##1 } { #1 } } }, @@ -9009,18 +9168,102 @@ % Argument keyval interface define~arg~keys[1]={ {execute}{execute={#1}}, - {set~keys}{ execute={ \semantex_keys_set:nn { ##1 } { #1 } } }, - {keys~set}{ execute={ \semantex_keys_set:nn { ##1 } { #1 } } }, - {set~keys~x}{ execute={ \semantex_keys_set_x:nn { ##1 } { #1 } } }, - {keys~set~x}{ execute={ \semantex_keys_set_x:nn { ##1 } { #1 } } }, - {set~arg~keys}{ execute={ \semantex_arg_keys_set:nn { ##1 } { #1 } } }, - {arg~keys~set}{ execute={ \semantex_arg_keys_set:nn { ##1 } { #1 } } }, - {set~arg~keys~x}{ execute={ \semantex_arg_keys_set_x:nn { ##1 } { #1 } } }, - {arg~keys~set~x}{ execute={ \semantex_arg_keys_set_x:nn { ##1 } { #1 } } }, - {set~arg~single~keys}{ execute={ \semantex_arg_singlekeys_set:nn { ##1 } { #1 } } }, - {arg~single~keys~set}{ execute={ \semantex_arg_singlekeys_set:nn { ##1 } { #1 } } }, - {set~arg~single~keys~x}{ execute={ \semantex_arg_singlekeys_set_x:nn { ##1 } { #1 } } }, - {arg~single~keys~set~x}{ execute={ \semantex_arg_singlekeys_set_x:nn { ##1 } { #1 } } }, + {keys~set}{ + execute={ + \tl_set:Nn\l__semantex_keys_set_temp_tl{} + \semantex_preprocess_keys:nN { #1 } \l__semantex_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_temp_cs:n{\l__semantex_keys_set_temp_tl} + \l__semantex_keys_set_temp_cs:n { ##1 } + }, + }, + {set~keys}{ + execute={ + \tl_set:Nn\l__semantex_keys_set_temp_tl{} + \semantex_preprocess_keys:nN { #1 } \l__semantex_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_temp_cs:n{\l__semantex_keys_set_temp_tl} + \l__semantex_keys_set_temp_cs:n { ##1 } + }, + }, + {keys~set~x}{ + execute={ + \tl_set:Nn\l__semantex_keys_set_x_temp_tl{} + \semantex_preprocess_keys_x:nN { #1 } \l__semantex_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_x_temp_cs:n{\l__semantex_keys_set_x_temp_tl} + \l__semantex_keys_set_x_temp_cs:n { ##1 } + }, + }, + {set~keys~x}{ + execute={ + \tl_set:Nn\l__semantex_keys_set_x_temp_tl{} + \semantex_preprocess_keys_x:nN { #1 } \l__semantex_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_keys_set_x_temp_cs:n{\l__semantex_keys_set_x_temp_tl} + \l__semantex_keys_set_x_temp_cs:n { ##1 } + }, + }, + {set~arg~keys}{ + execute={ + \tl_set:Nn\l__semantex_arg_keys_set_temp_tl{} + \semantex_preprocess_arg_keys:nN { #1 } \l__semantex_arg_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_temp_cs:n{\l__semantex_arg_keys_set_temp_tl} + \l__semantex_arg_keys_set_temp_cs:n { ##1 } + }, + }, + {arg~keys~set}{ + execute={ + \tl_set:Nn\l__semantex_arg_keys_set_temp_tl{} + \semantex_preprocess_arg_keys:nN { #1 } \l__semantex_arg_keys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_temp_cs:n{\l__semantex_arg_keys_set_temp_tl} + \l__semantex_arg_keys_set_temp_cs:n { ##1 } + }, + }, + {set~arg~keys~x}{ + execute={ + \tl_set:Nn\l__semantex_arg_keys_set_x_temp_tl{} + \semantex_preprocess_arg_keys_x:nN { #1 } \l__semantex_arg_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_x_temp_cs:n{\l__semantex_arg_keys_set_x_temp_tl} + \l__semantex_arg_keys_set_x_temp_cs:n { ##1 } + }, + }, + {arg~keys~set~x}{ + execute={ + \tl_set:Nn\l__semantex_arg_keys_set_x_temp_tl{} + \semantex_preprocess_arg_keys_x:nN { #1 } \l__semantex_arg_keys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_keys_set_x_temp_cs:n{\l__semantex_arg_keys_set_x_temp_tl} + \l__semantex_arg_keys_set_x_temp_cs:n { ##1 } + }, + }, + {set~arg~single~keys}{ + execute={ + \tl_set:Nn\l__semantex_arg_singlekeys_set_temp_tl{} + \semantex_preprocess_arg_singlekeys:nN { #1 } \l__semantex_arg_singlekeys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_temp_cs:n{\l__semantex_arg_singlekeys_set_temp_tl} + \l__semantex_arg_singlekeys_set_temp_cs:n { ##1 } + }, + }, + {arg~single~keys~set}{ + execute={ + \tl_set:Nn\l__semantex_arg_singlekeys_set_temp_tl{} + \semantex_preprocess_arg_singlekeys:nN { #1 } \l__semantex_arg_singlekeys_set_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_temp_cs:n{\l__semantex_arg_singlekeys_set_temp_tl} + \l__semantex_arg_singlekeys_set_temp_cs:n { ##1 } + }, + }, + {set~arg~single~keys~x}{ + execute={ + \tl_set:Nn\l__semantex_arg_singlekeys_set_x_temp_tl{} + \semantex_preprocess_arg_singlekeys_x:nN { #1 } \l__semantex_arg_singlekeys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_x_temp_cs:n{\l__semantex_arg_singlekeys_set_x_temp_tl} + \l__semantex_arg_singlekeys_set_x_temp_cs:n { ##1 } + }, + }, + {arg~single~keys~set~x}{ + execute={ + \tl_set:Nn\l__semantex_arg_singlekeys_set_x_temp_tl{} + \semantex_preprocess_arg_singlekeys_x:nN { #1 } \l__semantex_arg_singlekeys_set_x_temp_tl + \exp_args:NNo\cs_set:Nn\l__semantex_arg_singlekeys_set_x_temp_cs:n{\l__semantex_arg_singlekeys_set_x_temp_tl} + \l__semantex_arg_singlekeys_set_x_temp_cs:n { ##1 } + }, + }, {set~one~arg~single~key}{ execute={ \semantex_arg_singlekey:nn { ##1 } { #1 } } }, {one~arg~single~key~set}{ execute={ \semantex_arg_singlekey:nn { ##1 } { #1 } } }, {set~one~arg~single~key~x}{ execute={ \semantex_arg_singlekey_x:nn { ##1 } { #1 } } }, diff --git a/macros/latex/contrib/semantex/semantex.tex b/macros/latex/contrib/semantex/semantex.tex index 2d8e6457ae..124296a291 100644 --- a/macros/latex/contrib/semantex/semantex.tex +++ b/macros/latex/contrib/semantex/semantex.tex @@ -42,7 +42,7 @@ \usepackage[nameinlink]{cleveref} -\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.507)} +\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.508)} \date{\today} \author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})} @@ -3120,6 +3120,17 @@ the keys that can be used inside the command~\lstinline!\SemantexSetup! are: Another interesting possibility is the command~\lstinline!\ekvparse! from the package~\lstinline!expkv!. This choice will only affect keys for objects and classes, \emph{not} keys for use inside~\lstinline!\SemantexSetup!. + \item \mylst!single key parser={$\<command\>$}! + + Sets the single key parser function to~\<command\>. + The single key parser is the command that parses the content of the argument + when you have applied the setting \mylst!arg keyval=single keys!. + The \<command\> must take two arguments: + \mylst!$\<command\>\<function\>${$\<comma list\>$}!. + The \<function\> must take one argument and will be applied + to each entry in the \<comma list\>. + By default, this key has been set to the \LaTeX3 command~\mylst!\clist_map_function:nN! (but with the arguments in reverse order). + \item \mylst!semtex file={$\values\<true|\default{false}\>$}! When turned on, a \lstinline!.semtex! file will be created while processing the document. @@ -3540,12 +3551,19 @@ In the following sections, we include the full list. \item \mylst!parse options={$\<keys\>$}! - Adds the \<keys\> to the parse options. + Adds the \<keys\> to the parse options, i.e.~adds it to the key \mylst!parse code!. \item \mylst!parse! - Invokes the parse routine. + Invokes the parse routine, i.e.~runs the key \mylst!parse code! and then empties + the contents of that key. + + \item + \mylst!parse code! + + The key where the parse options are stored. It is emptied when the parse + routine is invoked. \item \mylst!math class={$\<command\>$}! diff --git a/macros/latex/contrib/semantex/stripsemantex.sty b/macros/latex/contrib/semantex/stripsemantex.sty index 1d66144b50..1723ee1f45 100644 --- a/macros/latex/contrib/semantex/stripsemantex.sty +++ b/macros/latex/contrib/semantex/stripsemantex.sty @@ -1,5 +1,5 @@ \RequirePackage{xparse} -\ProvidesExplPackage{stripsemantex}{2021/07/04}{0.507}{} +\ProvidesExplPackage{stripsemantex}{2021/07/18}{0.508}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % |