diff options
author | Norbert Preining <norbert@preining.info> | 2021-07-25 03:00:49 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-07-25 03:00:49 +0000 |
commit | 70e05e80042e1e0b40202c65384883b446f03654 (patch) | |
tree | a245ddbfdcfbe4d7a24c5608e8399d759f72b3c7 /macros/latex | |
parent | 9c5706814f2f593a9f52c51ad02b61e9bacd9ee4 (diff) |
CTAN sync 202107250300
Diffstat (limited to 'macros/latex')
-rw-r--r-- | macros/latex/contrib/easybook/easybook.dtx | 80 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.pdf | bin | 599164 -> 602784 bytes | |||
-rw-r--r-- | macros/latex/contrib/mindflow/mindflow.dtx | 129 | ||||
-rw-r--r-- | macros/latex/contrib/mindflow/mindflow.pdf | bin | 193288 -> 207664 bytes | |||
-rw-r--r-- | macros/latex/contrib/semantex/semantex.pdf | bin | 385078 -> 385078 bytes | |||
-rw-r--r-- | macros/latex/contrib/semantex/semantex.sty | 579 | ||||
-rw-r--r-- | macros/latex/contrib/semantex/semantex.tex | 6 | ||||
-rw-r--r-- | macros/latex/contrib/semantex/stripsemantex.sty | 2 | ||||
-rw-r--r-- | macros/latex/contrib/spbmark/spbmark.dtx | 92 | ||||
-rw-r--r-- | macros/latex/contrib/spbmark/spbmark.pdf | bin | 68676 -> 70916 bytes |
10 files changed, 520 insertions, 368 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index accfe35b85..d018076e50 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/22\hskip 1em\relax v1.27N\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/07/24\hskip 1em\relax v1.27o\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.27N}{2021/07/12}{新增 \opt{cjkfont} 选项设置中文字体,原 \opt{font} 选项设置英文字体,中文字体使用 \CTeX 的字库。} +% \changes{v1.27o}{2021/07/12}{新增 \opt{cjkfont} 选项设置中文字体,原 \opt{font} 选项设置英文字体,中文字体使用 \CTeX 的字库。} % \end{function} % % 如果需要使用其它中文字体,可以在启用选项 \opt{cjkfont = none} 后,再使用 \pkg{xeCJK} 宏包的相关命令设置字体以及声明字体族: @@ -352,19 +352,30 @@ % \changes{v1.23}{2021/03/15}{增加控制编号连接符的选项。} % \end{function} % -% \subsubsection{上标和下标} +% \subsubsection{上下标全局设置} % \label{subsubsec:super-sub-script} -% \begin{function}[EXP,added = 2021-06-26]{super-vshift,super-hshift,sub-vshift,sub-hshift,supersubsep,supersubalign} +% \begin{function}[EXP,added = 2021-06-26,updated = 2021-07-24]{super-vshift,super-hshift,sub-vshift,sub-hshift,super-format,sub-format} % \begin{syntax} % super-vshift = <刚性长度|(0pt)> % super-hshift = <刚性长度|(0pt)> % sub-vshift = <刚性长度|(0pt)> % sub-hshift = <刚性长度|(0pt)> +% super-format = <上标格式> +% sub-format = <下标格式> +% \end{syntax} +% \ding{229} 以上选项路径为 \opt{style/...} \\ +% 可以使用 \tn{spbset} 命令设置上述选项,以上各个选项的参数对应 \tn{super} 或 \tn{sub} 上标下标命令的参数。其中 \meta{刚性长度} 为上标或下标的垂直和水平偏移量,\meta{上标格式} 和 \meta{下标格式} 为上标和下标的格式代码。 +% \end{function} +% +% \begin{function}[EXP,added = 2021-06-26,updated = 2021-07-24]{supersub-hshift,supersub-format,supersubsep,supersubalign} +% \begin{syntax} +% supersub-hshift = <刚性长度|(0pt)> +% supersub-format = \{<上标格式>,<下标格式>\} % supersubsep = <刚性长度|(0.3ex)> % supersubalign = <(l)|c|r> % \end{syntax} % \ding{229} 以上选项路径为 \opt{style/...} \\ -% 可以使用 \tn{spbset} 命令设置上述选项。各垂直和水平偏移的参数对应 \tn{super} 等上标下标命令的参数,并且具有优先性。\opt{supersubsep} 选项是 \tn{supersub} 命令中上标和下标的间距,\opt{supersubalign} 选项则是上标与下标的水平对齐方式,有左对齐、居中对齐和右对齐。 +% 可以使用 \tn{spbset} 命令设置上述选项,以上各个选项的参数对应 \tn{supersub} 上下标命令的参数。\opt{supersubsep} 选项是上下标的垂直间距,\opt{supersubalign} 选项则是上下标的水平对齐方式,有左对齐、居中对齐和右对齐三种。\opt{supersub-format} 选项分别设置上下标的格式,以英文逗号分隔为前后部分,也可以只有前部分,表示上标的格式。 % \end{function} % % \subsection{超链接} @@ -606,7 +617,7 @@ % \DeclareTheorem{定理环境名}{中文标题}[style = easy-theorem] % \declaretheorem[style = easy-theorem,name = 定理名]{定理环境名} % \end{ctexexam} -% \tn{declaretheorem} 定义的定理环境需要手动增加盒子边框,可以如下进行设置: +% \tn{declaretheorem} 定义的定理环境需要手动增加盒子边框: % \begin{ctexexam} % \tcolorboxenvironment{定理环境名}{tc-theorem} % \end{ctexexam} @@ -676,7 +687,7 @@ % sec-mark = \CTEXifname{\CTEXthesection——}{}#1 % } % \end{ctexexam} -% \opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个选项可以使用 \tn{hrule} \texttt{width} \meta{长度} \texttt{height} \meta{高度} 或下述 \tn{markrule} 命令来绘制横线,脚注线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。 +% \opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个选项可以使用 \tn{hrule} \opt{width} \meta{长度} \opt{height} \meta{高度} 或下述 \tn{markrule} 命令来绘制横线,脚注线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。 % % \begin{function}[added = 2021-01-13,updated = 2021-06-14]{\easyhead,\easyfoot,\markrule} % \begin{syntax} @@ -717,7 +728,7 @@ % \end{syntax} % \ding{229} 以上选项路径为 \opt{hdrset/...} \\ % \changes{v1.25}{2021/05/12}{增加脚注样式设置选项。} -% \changes{v1.27N}{2021/07/14}{增加脚注内容格式选项 \opt{fntext-form} 和脚注类型选项 \opt{footnotetype}。} +% \changes{v1.27o}{2021/07/14}{增加脚注内容格式选项 \opt{fntext-form} 和脚注类型选项 \opt{footnotetype}。} % \end{function} % % \begin{optdesc} @@ -798,8 +809,8 @@ % \end{function} % % \begin{optdesc} -% \item[lolskip] \opt{lolskip} 是代码目录中章之间的代码标题的距离,与 \CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认 0.8 pc,在 article 模式中此选项失效。 -% \item[belowoffset] \opt{belowoffset} 选项为主文档目录标题下方的间距补偿,一般为负值,用于抵消 \opt{format} 中额外的垂直间距。\opt{(level)} 中的 \opt{belowoffset} 与之意义类似,代表 figure、table 和 lstlisting 三个级别,也可以使用 \opt{list} 统一设置,一般为正值。 +% \item[lolskip] \opt{lolskip} 是代码目录中章之间的代码标题的距离,与 \CTeX 的表格目录和图片目录中章之间的标题距离选项 \opt{lotskip} 和 \opt{lofskip} 类似,它们的值均默认为 \opt{0.8pc},在 article 模式中此选项失效。 +% \item[belowoffset] \opt{belowoffset} 选项为主文档目录标题下方的间距补偿,一般为负值,用于抵消 \opt{format} 中额外的垂直间距。\opt{(level)} 中的 \opt{belowoffset} 与之意义类似,代表 \opt{figure}、\opt{table} 和 \opt{lstlisting} 三个级别,也可以使用 \opt{list} 统一设置,一般为正值。 % \item[tocline] 目录标签整体使用 \opt{tocline} 设置,在图表标签的参数中 \#1 代表编号,代码标签中则是 \tn{thelstlisting} 代表编号,标签中还可包含标签名称,默认标签名称与图、表和代码环境的标题名称一致。下面举个设置标签的例子: % \begin{ctexexam} % \tocset @@ -905,7 +916,7 @@ % \tn{end}\{hangparas\} % \end{syntax} % \tn{hangpara} 命令使其后的一个段落保持悬挂缩进,\env{hangparas} 环境使其中的段落均保持悬挂缩进。缩进将以 \meta{缩进长度} 从每个段落的 \meta{缩进开始行数} 开始。 -% \changes{v1.27N}{2021/07/11}{增加悬挂缩进段落命令 \tn{hangpara} 和环境 \env{hangparas}。} +% \changes{v1.27o}{2021/07/11}{增加悬挂缩进段落命令 \tn{hangpara} 和环境 \env{hangparas}。} % \end{function} % % \subsection{代码} @@ -1079,7 +1090,7 @@ % \tn{end}\{eqcomp\} % \end{syntax} % 一些公式之后可以使用基于列表环境的 \env{eqcomp} 进行符号对照。\tn{symb} 需要在环境内使用,带有星号的命令可单独在文本段落使用。对照列表第二个 \meta{键值列表} 与 \pkg{enumitem} 的选项相同,一般较少用到,可以用于设置垂直间距等。第一个 \meta{键值列表} 也可以使用 \tn{seteqcomp} 全局设置,选项如下: -% \changes{v1.27N}{2021/07/22}{增加公式符号对照环境 \env{eqcomp} 和命令 \tn{symb}。} +% \changes{v1.27o}{2021/07/22}{增加公式符号对照环境 \env{eqcomp} 和命令 \tn{symb}。} % \end{function} % % \begin{function}{width,delim,space,item-align,delim-align,intro,font,mode} @@ -1334,7 +1345,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/07/22}{1.27N} +\ProvidesExplClass{easybook}{2021/07/24}{1.27o} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -1565,6 +1576,8 @@ { pagestyle = empty, format = \color{ctex@frame}\sffamily\Huge, + nameformat = { }, + titleformat = { }, aftername = { \bool_if:NTF \l__eb_title_newline_bool @@ -1580,6 +1593,8 @@ \color{ctex@frame}\sffamily\LARGE \bool_if:NF \l__eb_title_newline_bool { \centering } }, + nameformat = { }, + titleformat = { }, aftername = { \bool_if:NTF \l__eb_title_newline_bool @@ -1628,7 +1643,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/07/22}{1.27N} +\ProvidesExplPackage{easybase}{2021/07/24}{1.27o} {Typeset Chinese theses or books} \cs_generate_variant:Nn \int_to_arabic:n { v } @@ -1690,13 +1705,30 @@ { \seq_set_split:Nnn \l_tmpa_seq { [ } {#1} \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl - \IfFileExists{\l_tmpa_tl.sty} + \seq_pop_right:NN \l_tmpa_seq \l_tmpb_tl + \eb_package_reload_check:nn { \l_tmpa_tl } { - \exp_last_unbraced:Nx \RequirePackage - { [\seq_use:Nn \l_tmpa_seq { , } }{\l_tmpa_tl} - }{} + \IfFileExists{\l_tmpa_tl.sty} + { + \exp_last_unbraced:Nx \RequirePackage + { [\l_tmpb_tl }{\l_tmpa_tl} + }{} + } + } + { + \eb_package_reload_check:nn {#1} + { \IfFileExists{#1.sty}{\RequirePackage{#1}}{} } } - { \IfFileExists{#1.sty}{\RequirePackage{#1}}{} } + } +\cs_new_protected:Npn \eb_package_reload_check:nn #1#2 + { + \@ifpackageloaded{#1} + {\msg_warning:nnn { easybase } { package-reload } {#1}}{#2} + } +\msg_new:nnn { easybase } { package-reload } + { + There~is~no~need~to~reload~the~#1~macro~package. \\ + Please~review~your~code. } \NewDocumentCommand{\LoadPackage}{O{}m} { @@ -3508,15 +3540,15 @@ { \eb_define_theme_color:n { \exp_not:n {#1} } } } -\cs_new:Npn \eb_allow_urlbreak: +\cs_new:Npn \eb_allow_url_break: { \eb_appto_cmd:Nn \UrlBreaks { \UrlOrds - \tl_map_function:NN \c__eb_urlbreak_points_tl \do + \tl_map_function:NN \c__eb_url_break_points_tl \do } } -\tl_const:Nn \c__eb_urlbreak_points_tl +\tl_const:Nn \c__eb_url_break_points_tl { ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz @@ -3526,7 +3558,7 @@ { \LoadPackage{hyperref} \urlstyle{same} - \eb_allow_urlbreak: + \eb_allow_url_break: \exp_args:NV \hypersetup \l__eb_hyperref_clist } @@ -3569,7 +3601,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/22}{1.27N} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/24}{1.27o} {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 d1fb4c495f..030fcea69d 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/mindflow/mindflow.dtx b/macros/latex/contrib/mindflow/mindflow.dtx index e7d2345dd0..0296e79a3a 100644 --- a/macros/latex/contrib/mindflow/mindflow.dtx +++ b/macros/latex/contrib/mindflow/mindflow.dtx @@ -18,7 +18,7 @@ %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{mindflow} %<*package> - [2021/05/27 mindflow environment] + [2021/07/24 mindflow environment] %</package> % %<*driver> @@ -34,10 +34,10 @@ \setlist{noitemsep} \usepackage{mathpazo,newpxtext} \useosf +\usepackage[symbol]{footmisc} \usepackage{microtype} \PassOptionsToPackage{mathlines}{lineno} \usepackage[linenumber,rightmarker]{mindflow} -\usepackage{blindtext} \usepackage{parskip} \usepackage{listings} \definecolor{maintheme}{RGB}{50,100,150} @@ -62,7 +62,9 @@ \lstset{moretexcs=% {linenumbers,nolinenumbers,mindflowLeft,mindflowRight,mindflowTextFont,mindflowNumFont,mindflowMarkerFont,mindflowLineHeight,setlength,colorlet,color, RequirePackage,SetupKeyvalOptions,DeclareBoolOption,ProcessKeyvalOptions,PassOptionsToPackage, - if@mindflow@twocolumn,@mindflow@incolumntrue,if@mindflow@linenumber,@mindflow@leftlinenumbertrue,if@mindflow@on,if@mindflow@off,@mindflow@offfalse,if@mindflow@incolumn,if@mindflow@leftlinenumber,if@mindflow@rightlinenumber,if@mindflow@leftmarker,if@mindflow@rightmarker, + PackageWarning,MessageBreak, + if@mindflow@twocolumn,@mindflow@incolumntrue,if@mindflow@linenumber,@mindflow@leftlinenumbertrue,if@mindflow@on,if@mindflow@off,@mindflow@offfalse,if@mindflow@incolumn,if@mindflow@leftlinenumber,if@mindflow@rightlinenumber,if@mindflow@leftmarker,if@mindflow@rightmarker,if@mindflow@nonbreakable, + mindflow@parindent,mindflow@parskip, ifLNturnsON,LNturnsONtrue,LNturnsONfalse,ifLineNumbers, mindflowset, mindflow,endmindflow,comment,endcomment, @@ -77,7 +79,7 @@ \lstnewenvironment{code*}% {\setkeys{lst}{columns=fullflexible,keepspaces=true}}{} \lstnewenvironment{code}% -{\setkeys{lst}{columns=fullflexible,keepspaces=true,numbers=left,numberstyle=\scriptsize, stepnumber=1, numbersep=5pt,lastline=209}}{} +{\setkeys{lst}{columns=fullflexible,keepspaces=true,numbers=left,numberstyle=\scriptsize, stepnumber=1, numbersep=5pt,lastline=252}}{} \EnableCrossrefs \CodelineIndex \RecordChanges @@ -92,7 +94,7 @@ % \GetFileInfo{mindflow.dtx} % % -% \title{{\normalfont\textsf{mindflow}}, write your ideas in a clear way} +% \title{{\normalfont\textsf{mindflow}} -- write your ideas in a clear way} % \author{\scshape Jinwen Xu} % \date{\filedate} % @@ -113,10 +115,11 @@ % \item the complete code. % \end{itemize} % \end{mindflow} +% This example only shows the default effect. You can customize it further according to the instructions in the next section. % -% \section{Usage} +% \section{The usage} % -% \subsection{Initialization} +% \subsection{How to load it\,?} % Simply load the package with % \iffalse %<*example> @@ -128,10 +131,6 @@ %</example> % \fi % -% \vspace{-.5\baselineskip} -% There are a few options available, which are listed in the next subsection. -% -% \subsection{Options} % By default, the environment has no line numbers or markers. You can use the % following options (they can be specified directly, like \verb|off|, or as a % boolean optional, like \verb|off=false|): @@ -146,45 +145,43 @@ % \verb|off|, \verb|on| & Turn the \verb|mindflow| environments \emph{off} or \emph{on} % \end{tabular} % +% Additionally, there is an option \verb|nonbreakble|, which enables the \textsf{tcolorbox} version, permits a background color, but is not breakable and doesn't support line numbering quite well. +% +% \subsection{How to use it\,?} % \DescribeEnv{\{mindflow\}} -% Then you can use the \verb|mindflow| environment as +% You can then use the \verb|mindflow| environment as % \iffalse %<*example> % \fi \begin{code*} \begin{mindflow} - (*\meta{text}*) + (*{\normalfont\meta{text}}*) \end{mindflow} \end{code*} % \iffalse %</example> % \fi % -% \subsection{The configuration} +% \subsection{Further configuration} % % \DescribeMacro{\mindflowset} % You can use \lstinline|\mindflowset{|\meta{configuration}\lstinline|}| to -% configure the \texttt{mindflow} environment. The following keys are provided: +% configure the \texttt{mindflow} environment. The available keys are listed at the top of the next page. % % \begin{center} -% \begin{tabular}{ll} -% \verb|left| & The left marker\\ -% \verb|right| & The right marker\\ -% \verb|textcolor| & Color of the text\\ -% \verb|numcolor| & Color of line numbers\\ -% \verb|markercolor| & Color of the markers\\ -% \verb|linecolor| & Color of the separation line \\ -% \end{tabular} -% -% \begin{tabular}{ll} -% \verb|textfont| & Font of the text\\ -% \verb|numfont| & Font of line numbers\\ -% \verb|markerfont| & Font of the marker\\ -% \verb|lineheight| & Height of the separation line\\ +% \begin{tabular}{ll|ll} +% \hline +% \verb|left| & The left marker & \verb|right| & The right marker\\ +% \verb|textcolor| & Color of the text & \verb|textfont| & Font of the text\\ +% \verb|numcolor| & Color of line numbers & \verb|numfont| & Font of line numbers\\ +% \verb|markercolor| & Color of the markers & \verb|markerfont| & Font of the marker\\ +% \verb|linecolor| & Color of the separation line & \verb|lineheight| & Height of the separation line\\ +% \hline % \end{tabular} %\end{center} % -% Additionally, all the options mentioned in the previous section can be set with \lstinline|\mindflowset|. +% Additionally, all the options mentioned in the previous section (except for \verb|nonbreakble|) can be set with \lstinline|\mindflowset|.% +% \footnote{If the package option \texttt{nonbreakble} is enabled, then there is also a key \texttt{backgroundcolor}, similar to \texttt{textcolor}, for configuring the background color of the \texttt{mindflow} environments.} % % \section{An example} % With the following settings: @@ -193,8 +190,7 @@ % \fi \begin{code*} \mindflowset{ - leftlinenumber, rightlinenumber, - leftmarker, rightmarker, + leftlinenumber, rightlinenumber, leftmarker, rightmarker, linecolor = green!50!black, textcolor = blue!50!cyan, numcolor = red!50!orange, @@ -228,7 +224,7 @@ % \renewcommand{\mindflowRight}{\(\prec\)\hspace{1em}} % \setlength{\mindflowLineHeight}{1pt} % \begin{mindflow} -% \blindtext +% Hello, here is some text without a meaning. This text should show what a printed text will look like at this place. If you read this text, you will get no information. Really? Is there no information? Is there a difference between this text and some nonsense like “Huardest gefburn”? Kjift – not at all! A blind text like this gives you information about the selected font, how the letters are written and an impression of the look. % \end{mindflow} % \endgroup % @@ -250,8 +246,8 @@ % % \nolinenumbers % -% The feature of line numbering is provided by the package \textsf{lineno}. You -% can read its documentation to learn more about it. Notice that, by default, +% The line numbering feature is provided by the package \textsf{lineno}. For +% more details, please refer to its documentation. Notice that, by default, % displayed equations are not numbered. You can add the following line before % \lstinline|\usepackage{mindflow}|: % \iffalse @@ -272,12 +268,18 @@ % (a + b)^3 &= a^3 + 3a^2b + 3ab^2 + b^3 % \end{align*} % \end{mindflow} +% \smallskip % % \clearpage +% \makebox[\linewidth]{\rule{4\paperwidth}{\mindflowLineHeight}}% % \centerline{\itshape ---~~Readers who are not interested in technical details can skip the rest~~---} % +% \vspace{-\baselineskip} +% \makebox[\linewidth]{\rule{4\paperwidth}{\mindflowLineHeight}}% +% % \section{Some \TeX{}nical details} % +% \subsection{Internal macro for text elements} % \DescribeMacro{\mindflowTextFont} % \DescribeMacro{\mindflowNumFont} % \DescribeMacro{\mindflowMarkerFont} @@ -308,6 +310,7 @@ % The height of the separation lines is a length macro named \lstinline|\mindflowLineHeight|, % with default value \verb|0.4pt|. You can change this with \lstinline|\setlength|. % +% \subsection{Internal name of the colors} % \DescribeMacro{mindflowLine} % \DescribeMacro{mindflowText} % \DescribeMacro{mindflowNum} @@ -317,7 +320,10 @@ % \verb|mindflowLine|, \verb|mindflowText|, \verb|mindflowNum| and % \verb|mindflowMarker|, respectively. By default, they have the same color as % the context, with opacity 40\% for the separation lines and text, 20\% for -% the markers, and 8\% for the line numbers. +% the markers, and 8\% for line numbers. +% +% \DescribeMacro{*mindflowBackground} +% If the package option \verb|nonbreakable| is enabled, then there is also the background color \verb|mindflowBackground|, which by default is white. % % \section{The same example} % With option \verb|leftlinenumber, rightlinenumber, leftmarker, rightmarker| @@ -343,8 +349,16 @@ % \vspace{-.5\baselineskip} % One will get the same result as in the previous example. % +% \section{Known issues} +% +% \begin{itemize} +% \item There is no absolute guarantee that the separation lines will not fall alone at the top or bottom of the page, though great effort has been made to reduce the occurrence of such situation. +% \item The \textsf{tcolorbox} version doesn't support line numbering quite well, especially for displayed equations. This is due to the usage of \verb|internallinenumbers|. +% \end{itemize} +% % \StopEventually{} % +% \clearpage % \section{Implementation} % Below is the complete source code of this package. % @@ -363,6 +377,7 @@ \DeclareBoolOption[false]{rightlinenumber} % Right line numbers \DeclareBoolOption[false]{twocolumn} % Two column \DeclareBoolOption[false]{incolumn} % Separation line fits in column +\DeclareBoolOption[false]{nonbreakable} % Use the tcolorbox version \ProcessKeyvalOptions*\relax @@ -469,6 +484,41 @@ \medskip% } +\colorlet{mindflowBackground}{white} + +\if@mindflow@nonbreakable +\PassOptionsToPackage{many}{tcolorbox} +\RequirePackage{tcolorbox} +\newlength{\mindflow@parindent} +\newlength{\mindflow@parskip} +\def\mindflowON{% + \LNturnsONfalse% + \ifLineNumbers\LNturnsONtrue\fi\nolinenumbers% + \setlength{\mindflow@parindent}{\parindent}% + \setlength{\mindflow@parskip}{\parskip}% + \begin{tcolorbox}[enhanced jigsaw, + colback=mindflowBackground,colframe=mindflowLine, + leftrule=0pt, rightrule=0pt, sharp corners, + toprule=\mindflowLineHeight, bottomrule=\mindflowLineHeight, + boxsep=0pt, top=.3\baselineskip, bottom=.3\baselineskip, + grow to left by=\linewidth,left=\linewidth, + grow to right by=\linewidth,right=\linewidth, + fontupper=\mindflowTextFont,extras={colupper={mindflowText}}, + before upper={ + \setlength{\parindent}{\mindflow@parindent}% + \setlength{\parskip}{\mindflow@parskip}% + }] + \begin{internallinenumbers}% + \let\makeLineNumber\mindflow@makeLineNumber% +} +\def\endmindflowON{% + \nowidow[3]% + \end{internallinenumbers}% + \end{tcolorbox}\par% + \ifLNturnsON\linenumbers\fi% +} +\fi + \if@mindflow@off \let\mindflow=\mindflowOFF \let\endmindflow=\endmindflowOFF @@ -511,6 +561,13 @@ \define@key{mindflow}{textcolor}{\colorlet{mindflowText}{#1}} \define@key{mindflow}{numcolor}{\colorlet{mindflowNum}{#1}} \define@key{mindflow}{markercolor}{\colorlet{mindflowMarker}{#1}} +\define@key{mindflow}{backgroundcolor}{ + \if@mindflow@nonbreakable + \colorlet{mindflowBackground}{#1} + \else + \PackageWarning{mindflow}{The key ``backgroundcolor'' is only available when the package option\MessageBreak ``nonbreakable'' is enabled.} + \fi +} \define@key{mindflow}{textfont}{\renewcommand{\mindflowTextFont}{#1}} \define@key{mindflow}{numfont}{\renewcommand{\mindflowNumFont}{#1}} \define@key{mindflow}{markerfont}{\renewcommand{\mindflowMarkerFont}{#1}} diff --git a/macros/latex/contrib/mindflow/mindflow.pdf b/macros/latex/contrib/mindflow/mindflow.pdf Binary files differindex cff0586010..14a26dd0ae 100644 --- a/macros/latex/contrib/mindflow/mindflow.pdf +++ b/macros/latex/contrib/mindflow/mindflow.pdf diff --git a/macros/latex/contrib/semantex/semantex.pdf b/macros/latex/contrib/semantex/semantex.pdf Binary files differindex 006182bf85..8b74a38e7a 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 cfc3941666..125979e55a 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/18}{0.508}{} +\ProvidesExplPackage{semantex}{2021/07/24}{0.510}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -156,15 +156,15 @@ { % the actual \#1 command \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } } - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##1 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } } } \exp_args:Nc\DeclareDocumentCommand{__semantex_make_object_of_\semantex_class_to_register:N #1_with_options:nnw}{mm} { %\semantex_add_to_existing_original_source_in_semtex_file:n { } % add nothing to file - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 } } @@ -209,16 +209,16 @@ \IfValueTF{##2} { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { ##2 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } } - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##1 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } } } } @@ -227,17 +227,17 @@ \IfValueTF{##3} { \semantex_add_to_existing_original_source_in_semtex_file:n { [##3] } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } } } { %\semantex_add_to_existing_original_source_in_semtex_file:n { } % write nothing to file - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 } } @@ -296,19 +296,19 @@ \IfValueTF { ##3 } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { ##3 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_set_arg:Nn #1 { ##3 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##3 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } } } } @@ -316,16 +316,16 @@ \IfValueTF { ##3 } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { ##3 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_arg:Nn #1 { ##3 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##3 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } } - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##1 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } } } } @@ -336,21 +336,21 @@ { \IfValueTF { ##4 }{ \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } } } } @@ -358,17 +358,17 @@ \IfValueTF { ##4 } { \semantex_add_to_existing_original_source_in_semtex_file:n { { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { % \semantex_add_to_existing_original_source_in_semtex_file:n { } % write nothing to file - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 } } @@ -462,22 +462,22 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { * } { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_use_bullet:N #1 - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_use_bullet:N #1 + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { * } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_use_bullet:N #1 + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_use_bullet:N #1 } } } @@ -488,22 +488,22 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { ** } { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_use_double_bullet:N #1 - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_use_double_bullet:N #1 + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { ** } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_use_double_bullet:N #1 + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_use_double_bullet:N #1 } } } @@ -512,22 +512,22 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { ##3 } { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_set_degree_default:Nn #1 { ##3 } - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { ##3 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_set_degree_default:Nn #1 { ##3 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##3 } } } } @@ -538,20 +538,20 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } } } } @@ -565,20 +565,20 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { * } { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_use_bullet:N #1 - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_use_bullet:N #1 + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { * } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_use_bullet:N #1 + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_use_bullet:N #1 } } } @@ -589,20 +589,20 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { ** } { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_use_double_bullet:N #1 - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_use_double_bullet:N #1 + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { ** } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_use_double_bullet:N #1 + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_use_double_bullet:N #1 } } } @@ -611,20 +611,20 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { ##3 } { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_degree_default:Nn #1 { ##3 } - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { ##3 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_degree_default:Nn #1 { ##3 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##3 } } } } @@ -635,17 +635,17 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } } - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##1 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } } } } @@ -663,24 +663,24 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { * } { ##5 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_use_bullet:N #1 - \semantex_class_set_arg:Nn #1 { ##5 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_use_bullet:N #1 + \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { * } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_use_bullet:N #1 + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_use_bullet:N #1 } } } @@ -691,24 +691,24 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { ** } { ##5 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_use_double_bullet:N #1 - \semantex_class_set_arg:Nn #1 { ##5 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_use_double_bullet:N #1 + \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { ** } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_use_double_bullet:N #1 + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_use_double_bullet:N #1 } } } @@ -717,24 +717,24 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { ##4 } { ##5 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_set_degree_default:Nn #1 { ##4 } - \semantex_class_set_arg:Nn #1 { ##5 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##4 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_set_degree_default:Nn #1 { ##4 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##4 } } } } @@ -745,22 +745,22 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { ##5 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_set_arg:Nn #1 { ##5 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } } } } @@ -774,22 +774,22 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { { * } { ##5 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_use_bullet:N #1 - \semantex_class_set_arg:Nn #1 { ##5 } + \semantex_object_associated_to_class_use_bullet:N #1 + \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { { * } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_use_bullet:N #1 + \semantex_object_associated_to_class_use_bullet:N #1 } } } @@ -800,22 +800,22 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { { ** } { ##5 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_use_double_bullet:N #1 - \semantex_class_set_arg:Nn #1 { ##5 } + \semantex_object_associated_to_class_use_double_bullet:N #1 + \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { { ** } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_use_double_bullet:N #1 + \semantex_object_associated_to_class_use_double_bullet:N #1 } } } @@ -824,22 +824,22 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { { ##4 } { ##5 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_degree_default:Nn #1 { ##4 } - \semantex_class_set_arg:Nn #1 { ##5 } + \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##4 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_degree_default:Nn #1 { ##4 } + \semantex_object_associated_to_class_set_degree_default:Nn #1 { ##4 } } } } @@ -850,17 +850,17 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { { ##5 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_arg:Nn #1 { ##5 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##5 } } } { % \semantex_add_to_existing_original_source_in_semtex_file:n { } % write nothing to file - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 } } @@ -1089,20 +1089,20 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] { ##3 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } - \semantex_class_set_arg:Nn #1 { ##3 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##3 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } [ ##2 ] } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_keys:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##2 } } } } @@ -1111,17 +1111,17 @@ { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } { ##3 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##1 } - \semantex_class_set_arg:Nn #1 { ##3 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##3 } } } { \semantex_write_original_source_to_semtex_file:n { #1 { ##1 } } - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##1 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##1 } } } } @@ -1135,41 +1135,41 @@ { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] { ##4 } } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { \semantex_add_to_existing_original_source_in_semtex_file:n { [ ##3 ] } - \semantex_render_class:Nn #1 { - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_keys:Nn #1 { ##3 } + \semantex_object_associated_to_class_set_keys:Nn #1 { ##3 } } } } { \IfValueTF { ##4 } { - \semantex_render_class:Nn #1 { + \semantex_render_object_associated_to_class:Nn #1 { \semantex_add_to_existing_original_source_in_semtex_file:n { { ##4 } } - \semantex_class_do_output:N #1 - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_object_associated_to_class_do_output:N #1 + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 - \semantex_class_set_arg:Nn #1 { ##4 } + \semantex_object_associated_to_class_set_arg:Nn #1 { ##4 } } } { % \semantex_add_to_existing_original_source_in_semtex_file:n { } % write nothing to file - \semantex_render_class:Nn #1 { - \semantex_class_set_symbol:Nn #1 { ##2 } + \semantex_render_object_associated_to_class:Nn #1 { + \semantex_object_associated_to_class_set_symbol:Nn #1 { ##2 } ##1 } } @@ -1253,6 +1253,12 @@ class_\cs_to_str:N #1 } +\cs_new:Npn\semantex_class_to_associated_object_register:N#1 +{ + % #1 = name of class + object_associated_to_class_\cs_to_str:N #1 +} + \cs_new:Npn\semantex_object_to_register:N#1 { % #1 = name of object @@ -1279,7 +1285,7 @@ { \use:c { __semantex_make_object_of_\semantex_class_to_register:N #1_with_options:nnw } { - \semantex_keys_set:nn { \semantex_class_to_register:N #1 } { #2 } + \semantex_keys_set:nn { \semantex_class_to_associated_object_register:N #1 } { #2 } } } { @@ -1344,6 +1350,9 @@ { \semantex_add_to_list_of_classes:N #1 \semantex_new_register:xn { \semantex_class_to_register:N #1 } { #2 } + \semantex_new_register:xn { \semantex_class_to_associated_object_register:N #1 } { + \semantex_object_associated_to_class_set_class:Nn #1 { #1 } + } } } @@ -1372,9 +1381,14 @@ % complicated, but I've decided to use them anyway to make it more % user-friendly to create your own class type. -\cs_new_protected:Npn\semantex_class_set_symbol:Nn#1#2 +\cs_new_protected:Npn\semantex_class_set_keys:Nn#1#2 +{ + \semantex_keys_set:nn { \semantex_class_to_register:N #1 } { #2 } +} + +\cs_new_protected:Npn\semantex_object_associated_to_class_set_symbol:Nn#1#2 { - \semantex_valuekey:nnn { \semantex_class_to_register:N #1 } { symbol } { #2 } + \semantex_valuekey:nnn { \semantex_class_to_associated_object_register:N #1 } { symbol } { #2 } } \cs_new_protected:Npn\semantex_object_set_symbol:Nn#1#2 @@ -1382,9 +1396,9 @@ \semantex_valuekey:nnn { \semantex_object_to_register:N #1 } { symbol } { #2 } } -\cs_new_protected:Npn\semantex_class_do_output:N#1 +\cs_new_protected:Npn\semantex_object_associated_to_class_do_output:N#1 { - \semantex_data_bool_set_true:nn { \semantex_class_to_register:N #1 } { output } + \semantex_data_bool_set_true:nn { \semantex_class_to_associated_object_register:N #1 } { output } } \cs_new_protected:Npn\semantex_object_do_output:N#1 @@ -1392,9 +1406,9 @@ \semantex_data_bool_set_true:nn { \semantex_object_to_register:N #1 } { output } } -\cs_new_protected:Npn\semantex_class_set_keys:Nn#1#2 +\cs_new_protected:Npn\semantex_object_associated_to_class_set_keys:Nn#1#2 { - \semantex_keys_set:nn { \semantex_class_to_register:N #1 } { #2 } + \semantex_keys_set:nn { \semantex_class_to_associated_object_register:N #1 } { #2 } } \cs_new_protected:Npn\semantex_object_set_keys:Nn#1#2 @@ -1402,9 +1416,9 @@ \semantex_keys_set:nn { \semantex_object_to_register:N #1 } { #2 } } -\cs_new_protected:Npn\semantex_class_set_arg:Nn#1#2 +\cs_new_protected:Npn\semantex_object_associated_to_class_set_arg:Nn#1#2 { - \semantex_valuekey:nnn { \semantex_class_to_register:N #1 } { arg } { #2 } + \semantex_valuekey:nnn { \semantex_class_to_associated_object_register:N #1 } { arg } { #2 } } \cs_new_protected:Npn\semantex_object_set_arg:Nn#1#2 @@ -1412,9 +1426,9 @@ \semantex_valuekey:nnn { \semantex_object_to_register:N #1 } { arg } { #2 } } -\cs_new_protected:Npn\semantex_class_set_degree_default:Nn#1#2 +\cs_new_protected:Npn\semantex_object_associated_to_class_set_degree_default:Nn#1#2 { - \semantex_valuekey:nnn { \semantex_class_to_register:N #1 } { degree~default } { #2 } + \semantex_valuekey:nnn { \semantex_class_to_associated_object_register:N #1 } { degree~default } { #2 } } \cs_new_protected:Npn\semantex_object_set_degree_default:Nn#1#2 @@ -1424,7 +1438,7 @@ \cs_new_protected:Npn\semantex_class_use_bullet:N#1 { - \semantex_singlekey:nn { \semantex_class_to_register:N #1 } { * } + \semantex_singlekey:nn { \semantex_class_to_associated_object_register:N #1 } { * } } \cs_new_protected:Npn\semantex_object_use_bullet:N#1 @@ -1434,7 +1448,7 @@ \cs_new_protected:Npn\semantex_class_use_double_bullet:N#1 { - \semantex_singlekey:nn { \semantex_class_to_register:N #1 } { * } + \semantex_singlekey:nn { \semantex_class_to_associated_object_register:N #1 } { * } } \cs_new_protected:Npn\semantex_object_use_double_bullet:N#1 @@ -1442,9 +1456,9 @@ \semantex_singlekey:nn { \semantex_object_to_register:N #1 } { * } } -\cs_new_protected:Npn\semantex_class_set_left_par:Nn#1#2 +\cs_new_protected:Npn\semantex_object_associated_to_class_set_left_par:Nn#1#2 { - \semantex_data_tl_set:nnn { \semantex_class_to_register:N #1 } { left~par } { #2 } + \semantex_data_tl_set:nnn { \semantex_class_to_associated_object_register:N #1 } { left~par } { #2 } } \cs_new_protected:Npn\semantex_object_set_left_par:Nn#1#2 @@ -1452,9 +1466,9 @@ \semantex_data_tl_set:nnn { \semantex_object_to_register:N #1 } { left~par } { #2 } } -\cs_new_protected:Npn\semantex_class_set_right_par:Nn#1#2 +\cs_new_protected:Npn\semantex_object_associated_to_class_set_right_par:Nn#1#2 { - \semantex_data_tl_set:nnn { \semantex_class_to_register:N #1 } { right~par } { #2 } + \semantex_data_tl_set:nnn { \semantex_class_to_associated_object_register:N #1 } { right~par } { #2 } } \cs_new_protected:Npn\semantex_object_set_right_par:Nn#1#2 @@ -1462,6 +1476,11 @@ \semantex_data_tl_set:nnn { \semantex_object_to_register:N #1 } { right~par } { #2 } } +\cs_new_protected:Npn\semantex_object_associated_to_class_set_class:Nn#1#2 +{ + \semantex_data_class_set:nn { \semantex_class_to_associated_object_register:N #1 } { #2 } +} + \cs_new_protected:Npn\semantex_object_set_class:Nn#1#2 { \semantex_data_class_set:nn { \semantex_object_to_register:N #1 } { #2 } @@ -1514,6 +1533,9 @@ { \semantex_inner_pre_return:n { #1 } \tl_set:Nx \l__semantex_render_output_class_temp_tl { \semantex_data_tl_get:nn { #1 } { output } } % The output class + \tl_set:Nx \l__semantex_render_object_associated_to_output_class_tempt_tl { + object_associated_to_\l__semantex_render_output_class_temp_tl + } \exp_args:NNx\cs_set:Nn\l__semantex_render_output_options_temp_cs:n { \semantex_data_tl_get_exp_not:nn { #1 } { output~options } } % \cs_set:Nx did not work here, as it changes ##1 to #1, which we don't want. @@ -1546,19 +1568,19 @@ % makes a one-time object of class ??? and allows us to % immediately pass options to it { - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { upper~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { upper } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { lower~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { lower } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { pre~upper } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~upper } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { post~upper } { \semantex_data_tl_get_exp_not:nn { #1 } { post~upper } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { pre~lower } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { post~lower } { \semantex_data_tl_get_exp_not:nn { #1 } { post~lower } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { math~class } { \semantex_data_tl_get_exp_not:nn { #1 } { math~class } } \exp_not:V \l__semantex_render_output_options_temp_tl % These are the options we pass to the output class so that it @@ -1581,23 +1603,23 @@ % makes a one-time object of class ??? and allows us to % immediately pass options to it { - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { upper~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { upper~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { lower~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { lower~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { pre~upper~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~upper~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { post~upper~left } { \semantex_data_tl_get_exp_not:nn { #1 } { post~upper~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { pre~lower~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { post~lower~left } { \semantex_data_tl_get_exp_not:nn { #1 } { post~lower~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { height~phantom } { \semantex_data_tl_get_exp_not:nn { #1 } { height~phantom } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { slanting~phantom } { \semantex_data_tl_get_exp_not:nn { #1 } { slanting~phantom } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { math~class } { \semantex_data_tl_get_exp_not:nn { #1 } { math~class } } \exp_not:V \l__semantex_render_output_options_temp_tl % These are the options we pass to the output class so that it @@ -1619,35 +1641,35 @@ % makes a one-time object of class ??? and allows us to % immediately pass options to it { - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { upper~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { upper } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { lower~put~left } { \semantex_data_tl_get_exp_not:nn { #1 } { lower } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { upper~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { upper~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { lower~left~put~right } { \semantex_data_tl_get_exp_not:nn { #1 } { lower~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { pre~upper } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~upper } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { post~upper } { \semantex_data_tl_get_exp_not:nn { #1 } { post~upper } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { pre~lower } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { post~lower } { \semantex_data_tl_get_exp_not:nn { #1 } { post~lower } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { pre~upper~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~upper~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { post~upper~left } { \semantex_data_tl_get_exp_not:nn { #1 } { post~upper~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { pre~lower~left } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { post~lower~left } { \semantex_data_tl_get_exp_not:nn { #1 } { post~lower~left } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { height~phantom } { \semantex_data_tl_get_exp_not:nn { #1 } { height~phantom } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { slanting~phantom } { \semantex_data_tl_get_exp_not:nn { #1 } { slanting~phantom } } - \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_output_class_temp_tl } + \exp_not:N\semantex_base_object_valuekey:nnn { \l__semantex_render_object_associated_to_output_class_tempt_tl } { math~class } { \semantex_data_tl_get_exp_not:nn { #1 } { math~class } } \exp_not:V \l__semantex_render_output_options_temp_tl % These are the options we pass to the output class so that it @@ -1690,9 +1712,9 @@ \cs_generate_variant:Nn \semantex_render_register:nn { xn } -\cs_new_protected:Npn\semantex_render_class:Nn#1#2 % a front-end command +\cs_new_protected:Npn\semantex_render_object_associated_to_class:Nn#1#2 % a front-end command { - \semantex_render_register:xn { \semantex_class_to_register:N #1 } { #2 } + \semantex_render_register:xn { \semantex_class_to_associated_object_register:N #1 } { #2 } } \cs_new_protected:Npn\semantex_render_object:Nn#1#2 @@ -2090,7 +2112,7 @@ \tl_put_right:Nx #2 { { \semantex_data_tl_get_exp_not:nn { #1 } { height~phantom } } - { \semantex_data_tl_get_exp_not:nn { #1 } { slanting~phantom} } + { \semantex_data_tl_get_exp_not:nn { #1 } { slanting~phantom } } { } { \semantex_data_tl_get_exp_not:nn { #1 } { pre~lower~left } @@ -7076,6 +7098,7 @@ \cs_new_protected:Npn\semantex_error_output_format:nN#1#2 { \tl_set:Nn \l__semantex_error_output_format_temp { #1 } + \tl_replace_all:Nnn \l__semantex_error_output_format_temp { object_associated_to_class_ } { object~of~class~\cs:w } \tl_replace_all:Nnn \l__semantex_error_output_format_temp { object_ } { object~\cs:w } \tl_replace_all:Nnn \l__semantex_error_output_format_temp { class_ } { class~\cs:w } \tl_put_right:Nn \l__semantex_error_output_format_temp { \cs_end: } diff --git a/macros/latex/contrib/semantex/semantex.tex b/macros/latex/contrib/semantex/semantex.tex index 124296a291..2e212609ea 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.508)} +\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.510)} \date{\today} \author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})} @@ -577,7 +577,7 @@ Primes are added via the key~\lstinline!prime! or the keys~\lstinline!'!,~\lstinline!''! and~\lstinline!'''!: \begin{LTXexample} $\vf['] = \vf[prime]$, -$\vf[''] = \vf[prime,prime]$ +$\vf[''] = \vf[prime,prime]$, $\vf['''] = \vf[prime,prime,prime]$ \end{LTXexample} @@ -1331,7 +1331,7 @@ Unfortunately, it only works in~\hologo{LuaTeX}. If you don't know what \hologo{LuaTeX} is, that means that you are not using \hologo{LuaTeX}, and you should note that switching is a rather drastic affair since your existing font settings might very well not work -with LuaTeX. Also, \semantex does not exactly make your document faster, +with \hologo{LuaTeX}. Also, \semantex does not exactly make your document faster, and \hologo{LuaTeX} makes it even slower, so think carefully before you make the switch just for this. In any case, with \pack{stricttex}, you will be able to make brackets \enquote{strict}, which means that any \lstinline![! will be replaced diff --git a/macros/latex/contrib/semantex/stripsemantex.sty b/macros/latex/contrib/semantex/stripsemantex.sty index 1723ee1f45..7d434805eb 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/18}{0.508}{} +\ProvidesExplPackage{stripsemantex}{2021/07/24}{0.510}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % diff --git a/macros/latex/contrib/spbmark/spbmark.dtx b/macros/latex/contrib/spbmark/spbmark.dtx index ba9cc49e69..b2666aab80 100644 --- a/macros/latex/contrib/spbmark/spbmark.dtx +++ b/macros/latex/contrib/spbmark/spbmark.dtx @@ -23,7 +23,7 @@ % % \title{\pkg{spbmark} -- Customize superscripts and subscripts} % \author{Qu Yi} -% \date{2021/07/22\hskip 1em\relax v1.03\thanks{\url{https://github.com/texl3/spbmark}}} +% \date{2021/07/23\hskip 1em\relax v1.04\thanks{\url{https://github.com/texl3/spbmark}}} % % \maketitle % \begin{abstract} @@ -53,7 +53,7 @@ % \tn{super} command is used to output superscripts, \tn{sub} command is used to output subscripts, \tn{supersub} command is used to output both superscripts and subscripts. % \end{function} % -% They match the corresponding pattern depending on whether they are currently in text mode or mathematical mode, or they can use an asterisk variant to force the mathematical pattern. The \meta{vshift} and \meta{hshift} represent respectively vertical and horizontal offsets of superscript or subscript, their default value is 0 pt, and the parameters of \meta{script align} are the same as the \texttt{supersubalign}. +% They match the corresponding pattern depending on whether they are currently in text mode or mathematical mode, or they can use an asterisk variant to force the mathematical pattern. The \meta{vshift} and \meta{hshift} represent respectively vertical and horizontal offsets of superscript or subscript, their default value is \texttt{0pt}, and the parameters of \meta{script align} are the same as the \texttt{supersubalign}. % % The second optional parameter generally does not need to be used. The \meta{height} and \meta{depth} are separated by commas. Only the front part indicates the height of the superscript or subscript, and only the back part indicates the depth. % @@ -66,22 +66,23 @@ % \end{function} % % \section{Global control interface} -% \begin{function}[added = 2021-06-26]{\spbset} +% \begin{function}[added = 2021-06-26,updated = 2021-07-23]{\spbset} % \begin{syntax} % \tn{spbset}\marg{key-value list} % \end{syntax} -% \pkg{spbmark} uses the \tn{spbset} command to control the global default format of superscripts and subscripts. The values set by it will be overwritten by the optional parameters of the superscript and other commands. The list of key values it has is as follows: +% \pkg{spbmark} uses the \tn{spbset} command to control the global default format of superscripts and subscripts. The values set by it will be overwritten by the optional parameters of the superscript and other commands. % \end{function} % -% \begin{function}{super-vshift,super-hshift,sub-vshift,sub-hshift,supersubsep,supersubalign} +% \begin{function}{super-vshift,super-hshift,sub-vshift,sub-hshift,super-format,sub-format} % \begin{syntax} % super-vshift = <fixed length> % super-hshift = <fixed length> % sub-vshift = <fixed length> % sub-hshift = <fixed length> -% supersubsep = <fixed length> -% supersubalign = <horizontal alignment> +% super-format = <format code> +% sub-format = <format code> % \end{syntax} +% These list of keys control the format of superscript or subscript. They are equivalent to the optional parameters of the \tn{super} or \tn{sub} commands. % \end{function} % % \noindent @@ -89,17 +90,35 @@ % \DescribeOption{super-hshift} Extra horizontal shift of the superscripts. \\ % \DescribeOption{sub-vshift} Extra vertical shift of the subscripts. \\ % \DescribeOption{sub-hshift} Extra horizontal shift of the subscripts. \\ -% \DescribeOption{supersubsep} The distance between superscript and subscript when using \tn{supersub}, its default value is 0.3 ex. \\ -% \DescribeOption{supersubalign} The alignment of superscript and subscript when using \tn{supersub}, which contains l, c, and r parameters respectively for left, center, and right alignment. \\ +% \DescribeOption{super-format} Control the format of superscripts, the last command in the code can take an argument, which is a superscript. \\ +% \DescribeOption{sub-format} Control the format of subscripts, the last command in the code can take an argument, which is a subscript. +% +% \begin{function}{supersub-hshift,supersub-format,supersubsep,supersubalign} +% \begin{syntax} +% supersub-hshift = <fixed length> +% supersub-format = \{<super code>,<sub code>\} +% supersubsep = <fixed length> +% supersubalign = <horizontal alignment> +% \end{syntax} +% These list of keys control the format of superscripts and subscripts. They are equivalent to the optional parameters of the \tn{supersub} command. +% \end{function} +% +% \noindent +% \DescribeOption{supersub-hshift} Extra vertical shift of the superscripts and the subscripts. \\ +% \DescribeOption{supersub-format} Control the format of superscripts or subscripts. The first part is in superscript format, and the latter part is in subscript format. The two are separated by commas, or only the first part exists. \\ +% \DescribeOption{supersubsep} The distance between superscripts and subscripts, its default value is \texttt{0.3ex}. \\ +% \DescribeOption{supersubalign} The alignment of superscripts and subscripts, which contains \texttt{l}, \texttt{c}, and \texttt{r} parameters respectively for left, center, and right alignment. % % \section{Examples of use} % Here is a list of the three commands, please pay attention to the delimiter and usage of optional parameters: % \begin{quotation} % \noindent -% |A\super[0.2ex](\color{red}){exam}[0.2em]B| \\ +% |\spbset{supersub-format = {\ttfamily,\color{blue}}}| \\ +% |A\super[0.2ex](\textcolor{red}){exam}[0.2em]B| \\ % |$A\sub(\mathsf){exam}B$| \\ % |A\supersub[0.3ex][c]{examsuper}{sub}B| \\ -% A\super[0.2ex](\color{red}){exam}[0.2em]B \\ +% \spbset{supersub-format = {\ttfamily,\color{blue}}} +% A\super[0.2ex](\textcolor{red}){exam}[0.2em]B \\ % $A\sub(\mathsf){exam}B$ \\ % A\supersub[0.3ex][c]{examsuper}{sub}B % \end{quotation} @@ -136,7 +155,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2018/12/31] \RequirePackage{xparse,l3keys2e} -\ProvidesExplPackage{spbmark}{2021/07/22}{1.03} +\ProvidesExplPackage{spbmark}{2021/07/23}{1.04} {Customize superscripts and subscripts} \cs_new_protected:Npn \spb_define:n { \keys_define:nn { spbmark } } @@ -155,20 +174,27 @@ \ProcessKeysOptions{spbmark/option} +\tl_new:N \l__spb_super_script_formatii_tl +\tl_new:N \l__spb_sub_script_formatii_tl \spb_define:n { - super-vshift .dim_set:N = \l__spb_super_script_vshift_dim, - super-vshift .initial:n = 0pt, - super-hshift .dim_set:N = \l__spb_super_script_hshift_dim, - super-hshift .initial:n = 0pt, - sub-vshift .dim_set:N = \l__spb_sub_script_vshift_dim, - sub-vshift .initial:n = 0pt, - sub-hshift .dim_set:N = \l__spb_sub_script_hshift_dim, - sub-hshift .initial:n = 0pt, - supersubsep .dim_set:N = \l__spb_supersub_script_sep_dim, - supersubsep .initial:n = 0.3ex, - supersubalign .tl_set:N = \l__spb_supersub_script_align_tl, - supersubalign .initial:n = l + super-vshift .dim_set:N = \l__spb_super_script_vshift_dim, + super-vshift .initial:n = 0pt, + super-hshift .dim_set:N = \l__spb_super_script_hshift_dim, + super-hshift .initial:n = 0pt, + sub-vshift .dim_set:N = \l__spb_sub_script_vshift_dim, + sub-vshift .initial:n = 0pt, + sub-hshift .dim_set:N = \l__spb_sub_script_hshift_dim, + sub-hshift .initial:n = 0pt, + supersub-hshift .dim_set:N = \l__spb_supersub_script_hshift_dim, + supersub-hshift .initial:n = 0pt, + super-format .tl_set:N = \l__spb_super_script_formati_tl, + sub-format .tl_set:N = \l__spb_sub_script_formati_tl, + supersub-format .code:n = \spb_both_format_assign:n {#1}, + supersubsep .dim_set:N = \l__spb_supersub_script_sep_dim, + supersubsep .initial:n = 0.3ex, + supersubalign .tl_set:N = \l__spb_supersub_script_align_tl, + supersubalign .initial:n = l } \tl_set:Nn \l__spb_boxa_wd_tl { \box_wd:N \l_tmpa_box } @@ -229,6 +255,16 @@ \tl_if_empty:nF {#1} { \box_set_ht:Nn \l_tmpb_box {#1} } \tl_if_novalue:nF {#2} { \box_set_dp:Nn \l_tmpb_box {#2} } } +\NewDocumentCommand{\spb_both_format_assign:n} + {>{\SplitArgument{1}{,}}m} + {\spb_supersub_script_both_format:nn #1} +\cs_new_protected:Npn \spb_supersub_script_both_format:nn #1#2 + { + \tl_set:Nn \l__spb_super_script_formatii_tl {#1} + \tl_if_novalue:nTF {#2} + { \tl_clear:N \l__spb_sub_script_formatii_tl } + { \tl_set:Nn \l__spb_sub_script_formatii_tl {#2} } + } \clist_map_inline:nn { super,sub } @@ -236,7 +272,8 @@ \exp_args:Nc \NewDocumentCommand {#1} { sO{\dim_use:c { l__spb_#1_script_vshift_dim }} - >{\SplitArgument{1}{,}}O{}D(){} + >{\SplitArgument{1}{,}}O{} + D(){\tl_use:c { l__spb_#1_script_formati_tl }} mO{\dim_use:c { l__spb_#1_script_hshift_dim }} } { @@ -256,7 +293,10 @@ \NewDocumentCommand{\supersub} { sO{\l__spb_supersub_script_sep_dim} - O{\l__spb_supersub_script_align_tl}D(){}mmO{0pt}D(){} + O{\l__spb_supersub_script_align_tl} + D(){\l__spb_super_script_formatii_tl}mm + O{\l__spb_supersub_script_hshift_dim} + D(){\l__spb_sub_script_formatii_tl} } { \IfBooleanTF{#1} diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf Binary files differindex 1c3f271fe9..c7c7689c8d 100644 --- a/macros/latex/contrib/spbmark/spbmark.pdf +++ b/macros/latex/contrib/spbmark/spbmark.pdf |