diff options
author | Norbert Preining <norbert@preining.info> | 2021-04-09 03:02:31 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-04-09 03:02:31 +0000 |
commit | 8ccafc1be8d24ff0c4126d40847afbedab7fc7fb (patch) | |
tree | 06fbb0b4fc6fa3865d719139f6a1f04aaa03c963 /macros/latex/contrib | |
parent | 31d38d879db092b485e49e1b7c79f96c312fd1fb (diff) |
CTAN sync 202104090302
Diffstat (limited to 'macros/latex/contrib')
17 files changed, 2406 insertions, 894 deletions
diff --git a/macros/latex/contrib/apa7/apa7.dtx b/macros/latex/contrib/apa7/apa7.dtx index 20bc61a2c7..10da0cabda 100644 --- a/macros/latex/contrib/apa7/apa7.dtx +++ b/macros/latex/contrib/apa7/apa7.dtx @@ -4,11 +4,11 @@ % % % CHANGE THESE VALUES WITH EACH NEW RELEASE: % % % -%<class>\ProvidesClass{apa7}[2021/04/05 v2.11 APA formatting (7th edition)] +%<class>\ProvidesClass{apa7}[2021/04/08 v2.12 APA formatting (7th edition)] % % %<*internal> % -\def\apaSevenVersionDate{2021/04/05} -\def\apaSevenVersionNumber{2.11} +\def\apaSevenVersionDate{2021/04/08} +\def\apaSevenVersionNumber{2.12} % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -271,6 +271,8 @@ and the derived files apa7.ins, % % \changes{v2.11}{2021/04/05}{Updated linebreaks in caption separators to prevent warning. } % +% \changes{v2.12}{2021/04/08}{Reset equation counter for every appendix (like for figures and tables). Thanks mmrabe. } +% % \begin{abstract} % The \textit{Publication Manual} of the American Psychological % Association is widely used in the social sciences. The most @@ -2248,6 +2250,8 @@ and the derived files apa7.ins, \def\apaSevenapptab{% \renewcommand\thetable{\theappendix\@arabic\c@table}% \ifapamodeman{\renewcommand\theposttbl{\theappendix\arabic{posttbl}}}{}} +\def\apaSevenappeq{% + \renewcommand\theequation{\theappendix\@arabic\c@equation}} \newif\ifoneappendix \oneappendixtrue % one appendix by default \newif\ifappendix @@ -2260,6 +2264,7 @@ and the derived files apa7.ins, \appendixtrue \apaSevenappfig \apaSevenapptab + \apaSevenappeq % \ifapamodejou{}{\clearpage} %% commented out -- thp 2005/07/23 \let\old@apaSeven@section=\section % This will not work right with five levels in appendix. % Should go into \section, not \leveltwo but would also require @@ -2290,6 +2295,7 @@ and the derived files apa7.ins, }% \setcounter{figure}{0}% \setcounter{table}{0}% + \setcounter{equation}{0}% \vskip2.5ex% % \addtocounter{appendix}{1}% \refstepcounter{appendix}% 2002/07/20 this takes care of references too @@ -3874,4 +3880,4 @@ The detailed results are shown in Table~\ref{tab:DeckedTable}. \lipsum[22] %\end{macro} % % -%\Finale
\ No newline at end of file +%\Finale diff --git a/macros/latex/contrib/apa7/apa7.pdf b/macros/latex/contrib/apa7/apa7.pdf Binary files differindex aa32a866a6..710740e416 100644 --- a/macros/latex/contrib/apa7/apa7.pdf +++ b/macros/latex/contrib/apa7/apa7.pdf diff --git a/macros/latex/contrib/apa7/samples/longsample.pdf b/macros/latex/contrib/apa7/samples/longsample.pdf Binary files differindex 0a0b7b6545..1fe1ad8736 100644 --- a/macros/latex/contrib/apa7/samples/longsample.pdf +++ b/macros/latex/contrib/apa7/samples/longsample.pdf diff --git a/macros/latex/contrib/apa7/samples/shortsample.pdf b/macros/latex/contrib/apa7/samples/shortsample.pdf Binary files differindex 83984dbc31..10623740d3 100644 --- a/macros/latex/contrib/apa7/samples/shortsample.pdf +++ b/macros/latex/contrib/apa7/samples/shortsample.pdf diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.pdf b/macros/latex/contrib/easybook/doc/easybook-demo.pdf Binary files differindex 16ed695502..b2b27f68bb 100644 --- a/macros/latex/contrib/easybook/doc/easybook-demo.pdf +++ b/macros/latex/contrib/easybook/doc/easybook-demo.pdf diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.tex b/macros/latex/contrib/easybook/doc/easybook-demo.tex index e23317741f..0308056ec0 100644 --- a/macros/latex/contrib/easybook/doc/easybook-demo.tex +++ b/macros/latex/contrib/easybook/doc/easybook-demo.tex @@ -91,7 +91,7 @@ % tocdepth = 2 } -\usepackage{zhlipsum,bicaption,tcolorbox} +\usepackage{zhlipsum,bicaption,tasks,tcolorbox,imakeidx} \begin{document} \title{\sffamily easybook书籍文档类} @@ -101,7 +101,7 @@ \url{https://latexstudio.net} \\ \url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。} } -\date{2021/04/07\hskip\ccwd\relax v1.24g} +\date{2021/04/08\hskip\ccwd\relax v1.24h} \frontmatter[roman] \maketitle diff --git a/macros/latex/contrib/easybook/doc/easybook.pdf b/macros/latex/contrib/easybook/doc/easybook.pdf Binary files differindex ab902542d5..0d13de0e90 100644 --- a/macros/latex/contrib/easybook/doc/easybook.pdf +++ b/macros/latex/contrib/easybook/doc/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 9fba915442..5ca915335b 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -55,7 +55,7 @@ The latest version of this license is in % % \title{\sffamily easybook书籍文档类} % \author{瞿毅} -% \date{2021/04/07\hskip\ccwd\relax v1.24g\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/04/08\hskip\ccwd\relax v1.24h\thanks{\url{https://gitee.com/texl3/easybook}}} % \maketitle % \begin{abstract} % \cls{easybook} 是基于 \cls{ctexbook} 书籍文档类创建以极简为风格的模板,可以看作对 \cls{ctexbook} 的进一步包装。虽然\CTeX 文档类提供了较好的中文支持,但想实现个性化功能一般需要在其基础上载入更多宏包来定制。\cls{easybook} 考虑了一些细节并载入一些常用宏包实现一般的排版需求,它适用于排版中英文书籍或笔记,甚至可稍加调整成为学位论文模板。 @@ -64,7 +64,7 @@ The latest version of this license is in % % \begin{documentation} % \section{编译方式} -% 文档类含有一个使用示例文件 \opt{easybook-demo.tex},编译前建议满足以下的条件 +% 编译文档类的一个使用示例文件 \opt{easybook-demo.tex} 前建议满足以下的条件 % \begin{itemize} % \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式。 % \item 由于用到了一些宏包较新的功能,建议安装最新的\TeX 发行版,例如 \TeX Live 2021或 \hologo{MiKTeX} 21.2之后的版本。 @@ -114,14 +114,14 @@ The latest version of this license is in % \begin{function}[rEXP,added = 2021-01-05]{entitle} % 部分标题编号由中文数字变为大写罗马数字,章标题编号由中文数字变为阿拉伯数字。比如\textbf{第一部分}变为\textbf{第I部分},\textbf{第一章}变为\textbf{第1章}。 % \end{function} -% \begin{function}[rEXP,added = 2021-01-05,updated = 2021-04-07]{scheme} +% \begin{function}[rEXP,added = 2021-01-05,updated = 2021-04-08]{scheme} % \begin{syntax} % scheme = <(chinese)|plain> % \end{syntax} % \opt{scheme} 代表文档的主题,扩展了此选项在\CTeX 文档类中原有的作用范围,\opt{plain} 选项可使各类标题变为英文形式。包括章节标题、图表标题和定理标题等。如\textbf{第一章}变为\textbf{Chapter 1},\textbf{图1.1} 变为 \textbf{Table 1.1}。 % \end{function} % \begin{function}[rEXP,added = 2021-01-05]{enstyle} -% 同时开启 \opt{newline}、\opt{entitle} 和 \opt{english} 三个选项以符合英文原生风格。 +% 同时开启 \opt{newline}、\opt{entitle} 和 \opt{scheme = plain} 三个选项以符合英文原生风格。 % \end{function} % % \begin{function}[rEXP,added = 2021-01-05,updated = 2021-02-02]{font} @@ -171,7 +171,7 @@ The latest version of this license is in % \end{syntax} % \opt{multoc} 与 \opt{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否双栏排版。已经预置了中英文的目录标题,可以使用 \opt{title} 选项更改目录标题的名称。\opt{book} 选项使目录标题按照 \opt{chapter} 级别输出,\opt{article} 选项使目录标题按照 \opt{article} 级别输出,默认为 \opt{chapter} 级别。 % \changes{v1.23}{2021/03/15}{为几个目录增加键值列表的选项,可设置标题输出级别以及是否加入主目录。} -% \changes{v1.24g}{2021/04/04}{目录命令的可选参数增加标题键值。} +% \changes{v1.24h}{2021/04/04}{目录命令的可选参数增加标题键值。} % \end{function} % % \section{接口选项} @@ -187,7 +187,7 @@ The latest version of this license is in % \hyperref[subsec:style]{风格} & \hyperref[subsec:hyperlinks]{超链接} & \hyperref[subsec:other font]{其它字体} & \hyperref[subsec:spacing]{行距} & \hyperref[subsec:reference]{参考文献} \\ % style & link & elsefont & spread & bibset \\ % \midrule -% \hyperref[subsec:theorem of style]{定理样式} & \hyperref[subsec:page margins]{页面边距} & \hyperref[subsec:header and footer]{页眉页脚} & \hyperref[subsec:catalog style]{目录样式} & \\ +% \hyperref[subsec:theorem of style]{定理样式} & \hyperref[subsec:page margins]{页面尺寸} & \hyperref[subsec:header and footer]{页眉页脚} & \hyperref[subsec:catalog style]{目录样式} & \\ % thmset & geoset & hdrset & tocset & \\ % \bottomrule % \end{tabular} @@ -259,7 +259,7 @@ The latest version of this license is in % \ding{229} 以上选项路径为 \opt{link/...} \\ % \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。 % \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。} -% \changes{v1.24g}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} +% \changes{v1.24h}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} % \end{function} % % \begin{optdesc} @@ -286,13 +286,13 @@ The latest version of this license is in % footnote = <(1)> % \end{syntax} % \ding{229} 以上选项路径为 \opt{spread/...} \\ -% 行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。\tn{ctexset} 原有的行距选项 \opt{linespread} 失效。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为 +% 行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为 % \changes{v1.21}{2021/01/12}{增加脚注线间的距离选项。} % \changes{v1.23}{2021/02/09}{取消使用 \pkg{zhlineskip} 宏包设置数学间距。} % \end{function} % % \begin{optdesc} -% \item[line] 正文行距。 +% \item[line] 正文行距,\tn{ctexset} 原有的行距选项 \opt{linespread} 失效。 % \item[table] 表格行距。 % \item[math] 数学环境行距,包括 \pkg{amsmath} 和 \pkg{mathtools} 宏包附带的环境,但并未加载 \pkg{mathtools} 宏包。 % \item[caption] 图表代码标题行距。 @@ -424,7 +424,7 @@ The latest version of this license is in % \declaretheoremstyle[bodyfont = \rmfamily,spacepost = 0.5\ccwd]{定理样式名} % \end{ctexexam} % -% \subsection{页面边距} +% \subsection{页面尺寸} % \label{subsec:page margins} % \begin{function}[EXP,added = 2021-01-13,updated = 2021-03-21]{footnotemargin,footparskip,footparindent,list-labelsep,left,top,hmargin,textwidth,includehead} % \begin{syntax} @@ -439,7 +439,7 @@ The latest version of this license is in % includehead = <true|(false)> % \end{syntax} % \ding{229} 以上选项路径为 \opt{geoset/...} \\ -% 预置的页面边距与 \cls{Word} 的默认值接近,\opt{geoset} 会将前4个选项以外的其它选项交给 \pkg{geometry} 宏包接口命令 \tn{geometry} 处理,并且选项的键值列表与之相同,上面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \opt{paper} 选项的设置。 +% 预置的页面尺寸与 \cls{Word} 的默认值接近,\opt{geoset} 会将前4个选项以外的其它选项交给 \pkg{geometry} 宏包接口命令 \tn{geometry} 处理,并且选项的键值列表与之相同,上面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \opt{paper} 选项的设置。 % \begin{ctexexam} % \geoset % { @@ -450,7 +450,7 @@ The latest version of this license is in % list-labelsep = \hspace{0.5\ccwd} % } % \end{ctexexam} -% \changes{v1.21}{2021/01/13}{增加配置页面边距的选项。} +% \changes{v1.21}{2021/01/13}{增加配置页面尺寸的选项。} % \end{function} % % \subsection{页眉页脚} @@ -529,8 +529,8 @@ The latest version of this license is in % \end{ctexexam} % % \opt{belowoffset} 选项为主目录标题 \tn{contentsname} 后的间距补偿,一般为负值,用于抵消 \opt{format} 中设置的垂直间距。\opt{lists} 中的 \opt{belowoffset} 与之意义类似,但是一般为正值,可以在 \opt{article} 模式中使用。建议 \opt{lists/lolskip(0.8pc) + lists/format/addvspace(0.2pc) + lists/belowoffset(0pc) = belowoffset(-1pc)}。\opt{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。 -% \changes{v1.24g}{2021/04/05}{可以设置图、表和代码目录的标签。} -% \changes{v1.24g}{2021/04/06}{增加目录引导线右边对齐方式。} +% \changes{v1.24h}{2021/04/05}{可以设置图、表和代码目录的标签。} +% \changes{v1.24h}{2021/04/06}{增加目录引导线右边对齐方式。} % \end{function} % % \begin{function}[added = 2021-01-13,updated = 2021-04-06]{\tocrule} @@ -564,19 +564,19 @@ The latest version of this license is in % \end{function} % % \subsection{列表} -% \begin{function}[added = 2021-01-05,updated = 2021-04-07]{enumerate,itemize,description} +% \begin{function}[added = 2021-01-05,updated = 2021-04-08]{enumerate,itemize,description} % \begin{syntax} % \tn{begin}\marg{环境名}\oarg{键值列表} % \ \tn{item} <列表内容> % \tn{end}\marg{环境名} % \end{syntax} -% \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式。已为三种列表预置了三个级别的格式,可相互嵌套,若自定义标签可例如 +% \pkg{enumitem} 宏包为系统预置的列表环境 \env{enumerate}、\env{itemize}和 \env{description} 提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式。已为三种列表预置了三个级别的格式可相互嵌套,默认标签与 \cls{book} 文档类相同,若自定义标签可例如 % \begin{ctexexam} % \begin{enumerate}[label = \arabic*(a),leftmargin = 1cm,resume] % \begin{itemize}[label = \textbullet] % \begin{description}[font = \sffamily\bfseries,style = nextline] % \end{ctexexam} -% \changes{v1.24g}{2021/04/07}{重新优化列表环境的配置。} +% \changes{v1.24h}{2021/04/08}{重新优化列表环境的配置。} % \end{function} % % \subsubsection{排序列表} @@ -630,7 +630,7 @@ The latest version of this license is in % \ \tn{item} <习题内容> % \tn{end}\marg{exercise} % \end{syntax} -% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号环境时不进行编号。三个可选参数中颜色为自定义或 \pkg{xcolor} 包含的颜色名称,正文编号格式与小节 \ref{subsec:sort list} 排序列表相同,标题名默认为摘要。注意,环境具有相同定界符的可选参数只能\textbf{从右往左}省略,省略的参数使用默认值。 +% 习题环境 \env{exercise} 的标题紧接上一节编号并加入目录与页眉,当使用星号环境时不进行编号。三个可选参数中颜色为自定义或 \pkg{xcolor} 包含的颜色名称,已载入了 \opt{svgnames} 颜色库。正文编号格式与小节 \ref{subsec:sort list} 排序列表相同,标题名默认为摘要。注意,环境具有相同定界符的可选参数只能\textbf{从右往左}省略,省略的参数使用默认值。 % \begin{ctexexam} % \begin{exercise}[LightYellow][1.](习题) % \item 习题内容 @@ -768,7 +768,7 @@ The latest version of this license is in % \begin{syntax} % \tn{bicaption}\oarg{目录标题1}\marg{标题2}\oarg{目录标题1}\marg{标题2} % \tn{bicaptionbox}\oarg{目录标题1}\marg{标题2}\oarg{目录标题1}\marg{标题2} -% \oarg{宽度}\oarg{内部位置}\marg{内容} +% \ \oarg{宽度}\oarg{内部位置}\marg{内容} % \end{syntax} % 可以实现中英文双语标题,使用此功能需要在导言区载入 \pkg{bicaption} 宏包,具体用法见说明文档。 % \end{function} @@ -800,15 +800,47 @@ The latest version of this license is in % \end{syntax} % \pkg{ulem} 宏包提供了多种下划线命令,下划线的粗细由命令 \tn{ULthickness} 控制,重新定义它需要使用 \tn{renewcommand} 命令。下划线的深度由 \tn{ULdepth} 控制,默认值 \tn{maxdimen} 是一个允许深度根据当前字体变化的特殊标志,当然也可以使用 \tn{setlength} 设定特定深度。 % \end{function} +% +% \section{载入的宏包} +% 以下为 \cls{easybook} 直接调用的关键宏包,带有 \ding{75} 符号的宏包并未载入它们,仅做了预配置和兼容性处理,可根据需要在导言区手动载入以实现相关的功能。 +% \begin{description} +% \item[ctexbook] 提供中文排版的通用框架。 +% \item[xcolor] 提供多种颜色、阴影、色调和任意颜色的混合。 +% \item[footmisc] 更改脚注排版的方法的集合。 +% \item[amsmath] 提供\LaTeX 中的数学功能。 +% \item[thmtools] 用于通常需要的排版定理支持。 +% \item[marginnote] 增强了边注输出的功能。 +% \item[setspace] 提供对文档中行间距的支持。 +% \item[chemformula] 提供了对化学式进行排版的命令。 +% \item[siunitx] 全面的国际标准单位支持。 +% \item[ulem] 提供可断行多样式的下划线命令。 +% \item[geometry] 灵活完整的页面尺寸设置。 +% \item[pdfpages] 在\LaTeX 中插入 pdf 文档。 +% \item[graphicx] 增强了对图形插入的支持。 +% \item[fancyhdr] 广泛控制页面的页眉和页脚。 +% \item[titletoc] 设置目录中的标题格式。 +% \item[caption-light] 在浮动环境中自定义题注。 +% \item[tabularx] 带有可调整宽度的列的表格。 +% \item[multirow] 创建跨越多行的表格单元格。 +% \item[booktabs] 为表格提供三线表式的命令。 +% \item[enumitem] 提供列表环境的布局控制。 +% \item[listings] 可以在\LaTeX 中排版程序/编程代码。 +% \item[\ding{75} tcolorbox] 为带有标题线的彩色和带框文本框提供了一个环境。 +% \item[\ding{75} tasks] 将练习题组织成水平而不是垂直计数的列。 +% \item[\ding{75} imakeidx] 可以让文档同时生成和排版一个或多个索引。 +% \item[\ding{75} bicaption] 提供图表的双语题注。 +% \item[\ding{75} mathtools] 增强 \pkg{amsmath} 的数学功能。 +% \item[\ding{75} unicode-math] 处理使用 unicode 编码的数学字体。 +% \end{description} % \end{documentation} % % \StopEventually{} %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/04/07}{1.24g}{beta} +\ProvidesExplClass{easybook}{2021/04/08}{1.24h}{beta} -\cs_generate_variant:Nn \keys_define:nn {nx} +\cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} \cs_generate_variant:Nn \dim_add:Nn {NV} \cs_generate_variant:Nn \__eb_put_hyperref:n {x} @@ -961,8 +993,8 @@ The latest version of this license is in fancyhdr,titletoc, caption-light,subcaption, tabularx,multirow,booktabs, - tasks,enumitem, - listings,imakeidx + enumitem, + listings } \ctex_at_end_preamble:n { @@ -1369,7 +1401,7 @@ The latest version of this license is in {\text_uppercase:n {#1}} {\text_titlecase_first:n {#1}} } -\cs_new_protected:Npn \__eb_markboth:n #1 +\cs_new_protected:Npn \eb@markboth#1 { \bool_if:NTF \l__eb_page_twoside_bool { @@ -1400,14 +1432,14 @@ The latest version of this license is in \section*{\phantomsection#1} \CTEX@addtocline{section}{#1} } - \__eb_markboth:n {#1} + \eb@markboth{#1} } -\cs_new_protected:Npn \__eb_title_mark:n #1 +\cs_new_protected:Npn \__eb_title_mark_notoc:n #1 { \tl_if_eq:NnTF \l__eb_toc_type_tl{book} {\chapter*{\phantomsection#1}} {\section*{\phantomsection#1}} - \__eb_markboth:n {#1} + \eb@markboth{#1} } \cs_new_protected:Npn \__eb_ifmultoc_pre_set: { @@ -1436,7 +1468,7 @@ The latest version of this license is in \cs_new_protected:Npn \__eb_title_ifintoc_set:n #1 { \IfBooleanTF{#1} - {\__eb_title_mark:n {\eb@toc@title}} + {\__eb_title_mark_notoc:n {\eb@toc@title}} {\__eb_title_mark_intoc:n {\eb@toc@title}} } \RenewDocumentCommand{\tableofcontents}{o} @@ -1445,7 +1477,7 @@ The latest version of this license is in \tl_set_eq:NN \eb@toc@title\contentsname \IfValueT{#1}{\keys_set:nn {listoc}{#1}} \__eb_ifmultoc_pre_set: - \__eb_title_mark:n {\eb@toc@title} + \__eb_title_mark_notoc:n {\eb@toc@title} \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{toc} \__eb_ifmultoc_post_set: @@ -1491,22 +1523,25 @@ The latest version of this license is in \group_end: } -\makeindex[ - intoc, - options = -M~texindy~-C~utf8, - program = truexindy, - columns = 2, - columnsep = 2\ccwd - ] -\indexsetup - { - level = \bool_if:NTF \l__eb_class_book_bool{\chapter*}{\section*}, - toclevel = \bool_if:NTF \l__eb_class_book_bool{chapter}{section}, - firstpagestyle = \bool_if:NTF \l__eb_class_book_bool{plain}{fancy} - } -\__eb_patch_cmd:Nnn \imki@indexheaders - {\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}} - {\__eb_markboth:n {\indexname}} +\ctex_at_end_package:nn {imakeidx} + { + \makeindex[ + intoc, + options = -M~texindy~-C~utf8, + program = truexindy, + columns = 2, + columnsep = 2\ccwd + ] + \indexsetup + { + level = \bool_if:NTF \l__eb_class_book_bool{\chapter*}{\section*}, + toclevel = \bool_if:NTF \l__eb_class_book_bool{chapter}{section}, + firstpagestyle = \bool_if:NTF \l__eb_class_book_bool{plain}{fancy} + } + \ctex_patch_cmd:Nnn \imki@indexheaders + {\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}} + {\eb@markboth{\indexname}} + } \tl_new:N \l__eb_font_table_tl \tl_new:N \l__eb_font_figure_tl @@ -1688,7 +1723,7 @@ The latest version of this license is in \cs_new_protected:Npn \__eb_thmname_set:nn #1#2 {\tl_const:cn {c__eb_name_#1_tl}{#2}} -\tl_if_eq:VnTF \l__ctex_scheme_tl{chinese} +\tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} { \clist_map_inline:nn { @@ -1794,13 +1829,16 @@ The latest version of this license is in ]{proof} } -\settasks +\ctex_at_end_package:nn {tasks} { - label = (\Alph*), - after-item-skip = 0ex plus .1ex, - column-sep = .5\ccwd, - item-indent = 2\ccwd, - label-width = 1.5\ccwd + \settasks + { + label = (\Alph*), + after-item-skip = 0ex plus .1ex, + column-sep = .5\ccwd, + item-indent = 2\ccwd, + label-width = 1.5\ccwd + } } \setchemformula { @@ -2025,12 +2063,12 @@ The latest version of this license is in { \tl_if_empty:NTF \l__eb_bib_otherstyle_tl { - \tl_if_eq:VnT \l__eb_bib_style_tl{numerical} + \tl_if_eq:NnT \l__eb_bib_style_tl{numerical} { \bibliographystyle{gbt7714-numerical} \setcitestyle{comma,square,super} } - \tl_if_eq:VnT \l__eb_bib_style_tl{authoryear} + \tl_if_eq:NnT \l__eb_bib_style_tl{authoryear} {\bibliographystyle{gbt7714-author-year}} \cs_set_eq:NN \cite\citep }{\exp_args:NV \bibliographystyle\l__eb_bib_otherstyle_tl} @@ -2055,9 +2093,9 @@ The latest version of this license is in { \tl_if_empty:NTF \l__eb_bib_otherstyle_tl { - \tl_if_eq:VnT \l__eb_bib_style_tl{numerical} + \tl_if_eq:NnT \l__eb_bib_style_tl{numerical} {\__eb_put_biblatex:n {style = gb7714-2015}} - \tl_if_eq:VnT \l__eb_bib_style_tl{authoryear} + \tl_if_eq:NnT \l__eb_bib_style_tl{authoryear} {\__eb_put_biblatex:n {style = gb7714-2015ay}} }{\__eb_put_biblatex:n {style = \l__eb_bib_otherstyle_tl}} \tl_if_empty:NF \l__eb_bib_citestyle_tl @@ -2088,7 +2126,8 @@ The latest version of this license is in { \group_begin: \footnotesize - \exp_args:Nx \linespread{\fp_use:N \l__eb_spread_footnote_fp}\selectfont + \exp_args:Nx + \linespread{\fp_use:N \l__eb_spread_footnote_fp}\selectfont \skip_gset:Nn \footnotesep{\ht\strutbox} \group_end: \bool_if:NT \l__eb_chap_withpart_bool @@ -2106,14 +2145,20 @@ The latest version of this license is in } \__eb_patch_cmd:Nnn \@footnotetext {\reset@font} - {\def\baselinestretch{\fp_use:N \l__eb_spread_footnote_fp}\l__eb_font_footnote_tl} + { + \def\baselinestretch{\fp_use:N \l__eb_spread_footnote_fp} + \l__eb_font_footnote_tl + } \__eb_patch_cmd:Nnn \@mpfootnotetext {\reset@font} - {\def\baselinestretch{\fp_use:N \l__eb_spread_footnote_fp}\l__eb_font_footnote_tl} + { + \def\baselinestretch{\fp_use:N \l__eb_spread_footnote_fp} + \l__eb_font_footnote_tl + } \__eb_patch_cmd:Nnn \@makefnmark {\normalfont}{\l__eb_font_footnote_tl} -\lstdefinestyle{mystyle} +\lstdefinestyle{easy-lst-sty} { language = [LaTeX]TeX, texcsstyle = @@ -2158,7 +2203,7 @@ The latest version of this license is in } \lstset { - style = mystyle, + style = easy-lst-sty, breaklines = true, resetmargins = true, % numbers = left, @@ -2215,9 +2260,13 @@ The latest version of this license is in \UrlBreaks{\UrlOrds\__eb_add_urlbreak_points:} } \tl_const:Nn \c__eb_urlbreak_points_tl - {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789} + { + ABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyz + 0123456789 + } -\keys_define:nx {ctex/link} +\__ctex_define:nx {link} { hyperlink .choice:, hyperlink/edge .code:n = {}, @@ -2252,7 +2301,7 @@ The latest version of this license is in } } } -\keys_define:nx {ctex/style} +\__ctex_define:nx {style} { color .choice:, color .value_required:n = true, @@ -2274,7 +2323,7 @@ The latest version of this license is in \__eb_allow_urlbreak: \ctex_hypersetup:n {pdfstartview = FitH} \exp_args:NV \hypersetup\l__eb_hyperref_clist - \tl_if_eq:VnTF \l__ctex_scheme_tl{chinese} + \tl_if_eq:NnTF \l__ctex_scheme_tl{chinese} { \keys_set_known:nn {ctex} { diff --git a/macros/latex/contrib/lwarp/README.txt b/macros/latex/contrib/lwarp/README.txt index f77e4ae669..bf13a2f01a 100644 --- a/macros/latex/contrib/lwarp/README.txt +++ b/macros/latex/contrib/lwarp/README.txt @@ -1,5 +1,5 @@ -LaTeX lwarp package v0.895 README.txt +LaTeX lwarp package v0.896 README.txt Files included are: diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx index 51892df0c1..bcd587f552 100644 --- a/macros/latex/contrib/lwarp/lwarp.dtx +++ b/macros/latex/contrib/lwarp/lwarp.dtx @@ -16,7 +16,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{lwarp} -%<package> [2021/02/18 v0.895 Allows LaTeX to directly produce HTML5 output.] +%<package> [2021/04/08 v0.896 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -309,11 +309,11 @@ Keywords={LaTeX, HTML, conversion}% \newcommand{\spkg}[1]{\textcolor[Hsb]{120,1,.4}{\pkg{#1}}}% package supported as-is \newcommand{\mpkg}[1]{\textcolor[Hsb]{240,1,.4}{\pkg{#1}}}% package modified for HTML \newcommand{\epkg}[1]{\textcolor[Hsb]{300,1,.5}{\pkg{#1}}}% package emulated for HTML -\newcommand{\ipkg}[1]{\textcolor[Hsb]{0,0,.5}{\pkg{#1}}}% package ignored +\newcommand{\ipkg}[1]{\textcolor[Hsb]{0,0,.4}{\pkg{#1}}}% package ignored \newcommand{\wpkg}[1]{\textcolor[Hsb]{0,1,.5}{\pkg{#1}}}% package warning special case \newcommand{\sjax}{\textsuperscript{\textcolor[Hsb]{120,1,.4}{MJ}}} \newcommand{\ejax}{\textsuperscript{\textcolor[Hsb]{300,1,.5}{MJ}}} -\newcommand{\ijax}{\textsuperscript{\textcolor[Hsb]{0,0,.5}{MJ}}} +\newcommand{\ijax}{\textsuperscript{\textcolor[Hsb]{0,0,.4}{MJ}}} % green/cyan/blue/magenta % \newcommand{\spkg}[1]{\textcolor[Hsb]{120,1,.4}{\pkg{#1}}}% package supported as-is @@ -322,7 +322,7 @@ Keywords={LaTeX, HTML, conversion}% % \newcommand{\ipkg}[1]{\textcolor[Hsb]{300,1,.5}{\pkg{#1}}}% package ignored % \newcommand{\wpkg}[1]{\textcolor[Hsb]{0,1,.5}{\pkg{#1}}}% package warning special case - +\newcommand{\ARIA}{\acro{ARIA}} \newcommand{\pdflatexonly}{ \textred{Only pre-loaded if \prog{pdflatex} is being used.} @@ -871,6 +871,7 @@ the link will be empty. Index entries also use \cs{nameref} and have the same limitation. \trouble{index>empty link} \trouble{reference>empty link} +\trouble{link>empty} } \newcommand{\limitspfnote}{ @@ -908,16 +909,19 @@ due to the limited number of symbols which are available. \limitsperpage -If using \brand{MathJax}, after each math expression with a \cs{footnotemark}, -\watchout[MathJax, \cs{footnotemark}] -adjust the \ctr{footnote} counter by the number of \cs{footnotemark}s: -\begin{sourcedisplay} -\cs{[} (math expression with \textgreen{two} instances of \cs{footnotemark}) \cs{]} \\ -\textred{\cs{warpHTMLonly}\{}\cs{addtocounter}\{footnote\}\{\textgreen{2}\}\textred{\}} -\end{sourcedisplay} -Similarly for \pkg{endnotes}, but \emph{not} \pkg{sidenotes}. +% No longer true: +% If using \brand{MathJax}, \cs{footnote} and \cs{endnote} work, +% \watchout[MathJax, \cs{footnotemark}] +% but for \cs{footnotemark}, after each math expression with a \cs{footnotemark} +% adjust the \ctr{footnote} counter by the number of \cs{footnotemark}s: +% \begin{sourcedisplay} +% \cs{[} (math expression with \textgreen{two} instances of \cs{footnotemark}) \cs{]} \\ +% \textred{\cs{warpHTMLonly}\{}\cs{addtocounter}\{footnote\}\{\textgreen{2}\}\textred{\}} +% \end{sourcedisplay} +% Similarly for \pkg{endnotes}, but \emph{not} \pkg{sidenotes}. Also for \brand{MathJax}, \cs{footnotename} is used for a \cs{footnotemark} +\margintag{\brand{MathJax}} if the actual footnote number is not known. To redefine it, provide it before loading \pkg{lwarp}: \begin{sourcedisplay} @@ -1643,34 +1647,38 @@ While using \brand{Mathjax}, \cs{displaymathother} may also be used for other forms of display and inline math which contain \pkg{chemformula} expressions. } -\newcommand{\limitsntheorem}{% -This conversion is not total. -\trouble[Font control]{ntheorem=\pkg{ntheorem}>font} -Font control is via \CSS, and the custom \LaTeX\ font settings -are ignored. - +\newcommand{\limitstheorems}{% If the print version does not use \pkg{cleveref}, -\trouble[cref reference format undefined]{ntheorem=\pkg{ntheorem}>cref reference format} -\trouble{cref reference format} -\trouble{cleveref=\pkg{cleveref}>cref reference format} +\trouble[cref reference format undefined]{ntheorem=\pkg{ntheorem}>cref reference format undefined} +\trouble{cref reference format undefined} +\trouble{cleveref=\pkg{cleveref}>cref reference format undefined} +\trouble{theorem>cref reference format undefined} place all \cs{theoremstyle} and \cs{newtheorem} -declarations in the preamble inside \cs{AtBeginDocument}.\footnote{% +declarations in the preamble inside \cs{AtEndPreamble}.\footnote{% \pkg{lwarp} uses \pkg{cleveref} for the \HTML\ conversion, - and loads \pkg{cleveref} \cs{AtEndPreamble}, just before \cs{AtBeginDocument}.% + and loads \pkg{cleveref} \cs{AtEndPreamble}, just before \cs{AtBeginDocument}. + This is also before the \filenm{.aux} file is read. } -For some theorems, it may also be required to add inside \cs{AtBeginDocument} +For some theorems, it may also be required to add inside \cs{AtEndPreamble} something such as: \begin{sourcedisplay} -\cs{AtBeginDocument}\{ \% if not using cleveref package \\ +\cs{usepackage}\{etoolbox\} \% for \cs{ifdef}, \cs{AtEndPreamble} \\ +\cs{AtEndPreamble}\{ \% if not using cleveref package \\ \fquad \cs{theoremstyle}\{definition\} \\ \fquad \cs{newtheorem}\{dtheorem\}\{Definition\} \\ \fquad \dots \\ - \fquad \cs{usepackage}\{etoolbox\} \% for \cs{ifdef} \\ \fquad \cs{ifdef}\{\cs{cref}\}\{ \\ \fqquad \cs{crefname}\{Proof\}\{Proof\}\{Proofs\} \\ \fquad \}\{\} \\ \} \end{sourcedisplay} +} + +\newcommand{\limitsntheorem}{% +This conversion is not total. +\trouble[Font control]{ntheorem=\pkg{ntheorem}>font} +Font control is via \CSS, and the custom \LaTeX\ font settings +are ignored. \limitsntheoremnumbering } @@ -2911,8 +2919,8 @@ changes do not affect the \HTML\ output. } \newcommand{\limitspolyglossia}{% -\trouble{Undefined control sequence \dots begindocument>polyglossia=\pkg{polyglossia}} -\trouble{polyglossia=\pkg{polyglossia}>Undefined control sequence \dots begindocument} +\trouble{Undefined control seq \dots\ begindocument>polyglossia=\pkg{polyglossia}} +\trouble{polyglossia=\pkg{polyglossia}>Undefined control seq \dots\ begindocument} \pkg{lwarp} uses \pkg{cleveref}, which has some limitations when using \pkg{polyglossia}, possibly resulting in the error \begin{sourcedisplay} @@ -3053,7 +3061,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{53146} +% \CheckSum{54091} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -3190,6 +3198,7 @@ This boolean may be tested by the user for later use. % \changes{v0.893}{2020/11/26}{\ 2020/11/26} % \changes{v0.894}{2020/12/24}{\ 2020/12/24} % \changes{v0.895}{2021/02/18}{\ 2021/02/18} +% \changes{v0.896}{2021/04/08}{\ 2021/04/08} @@ -3413,6 +3422,41 @@ This boolean may be tested by the user for later use. % % \begin{description} % \needspace{2\baselineskip} +% \item[v0.896:] Back references, accessibility. +% \begin{itemize} +% \item \textred{Due to changes in cross referencing, \watchout +% execute \cmds{lwarpmk clean} before recompiling.} +% \item Increased sectioning nesting stack depth. Error if overflow stack. +% \item Fixed footnotes at the end of the document, +% or inside a \env{description} label. +% \item Added an error if using braces inside \cs{usepackage} options. +% \item Fixed footnotes in bracket display math with \brand{MathJax}. +% \margintag{\brand{MathJax}} +% \item \LaTeX\ theorems, \pkg{amsthm}, \pkg{ntheorem}, \pkg{theorem}: +% \margintag{theorems} +% Print theorem footnotes following theorems. +% \item Added \HTML\ \element{main} element to each page. +% \margintag{accessibility} +% \item Added \ARIA\ |math| role to \SVG\ math images, and |note| role to +% margin notes, footnotes, etc. +% \item Improved citation backreferences for various packages. +% \margintag{packages} +% \item \pkg{chemfig}: Updated to v1.6a. +% \item \pkg{bigdelim}: Updated to v2.8. +% \item \pkg{xetexko}: Updated to v3.1. +% \item \pkg{hyperxmp}: Fix: Accept and discard additional keys. +% \item \pkg{hyperef}: Fix: Added \cs{*autorefname} macros. +% \item \pkg{biblatex}: Fix: Back references. +% \item \pkg{tocloft}: Fix: \cs{cftpagenumbersoff}, \cs{cftpagenumberson}. +% \item \pkg{threeparttablex}: Fix: \cs{TPTL@tnotex}. +% \item \pkg{amsthm}: Fix: Footnotes inside environment optional argument. +% \item \pkg{listings}: Fixed labels. Accepts but ignores escapes w/o error. +% \item \pkg{pdflscape}: Fix: Added \env{landscape} environment. +% \item Added \pkg{ccicons}, \pkg{classicthesis}, \pkg{orcidlink}. +% \item Added \pkg{enotez}. +% \item Verified support for \pkg{doi}, \pkg{doipubmed}. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.895:] Vector packages, greatly improved \brand{MathJax} for \pkg{siunitx}. % \begin{itemize} % \item Fixed quotes in \HTML\ tags while using old font packages with @@ -4544,33 +4588,33 @@ This boolean may be tested by the user for later use. % \item \pkg{endfloat}: Updated for v2.6. % \item \pkg{url}: Fixes for active characters. % \end{itemize} -% \needspace{2\baselineskip} -% \item[v0.51:] Improved \SVG\ math, added numerous chemistry packages. -% \begin{itemize} -% \item Docs: Added \nameref{sec:thingstoavoid}. -% \margintag{documentation} -% \item Docs: Added to \nameref{sec:convertexisting}. -% \item Docs: Multiple authors and affiliations with custom classes. -% See \cref{sec:authorsaffils}. -% \item Docs: \pkg{tikz} with matrices. See \cref{sec:limitstikz}. -% \item Improved \SVG\ math baseline.\margintag{SVG math} -% \item Improved \SVG\ math font and color. -% \item Faster \SVG\ math rendering. -% \item Improved support for display math containing complicated math objects, -% such as \pkg{tikz-cd}. See \cref{sec:displaymathother}. -% \item Fix: \cs{addcontentsline} inside \SVG\ math. -% \item Fix: \SVG\ math containing an embedded \env{lateximage}. -% \item \brand{MathJax} now handles \cs{ensuremath} in expressions.\margintag{MathJax} -% \item Fix: Added \env{alignat} environment. \margintag{misc. fixes} -% \item Fix: \pkg{afterpackage} no longer required, which conflicted with \pkg{scrlfile}. -% \item Fix: \pkg{titling} \cs{thanks} mark. -% \item Fix: \pkg{fancybox} improvements. -% \item Fix: \pkg{tikz} \cs{tikz} macro. (Previously only the \env{tikzpicture} environment worked.) -% \item Fix: \pkg{tikz} with optional argument. -% \item Added \pkg{mhchem}, \margintag{packages} -% \pkg{chemfig}, \pkg{chemformula}, \pkg{chemmacros}, \pkg{chemnum}, \pkg{chemgreek}, -% \pkg{epstopdf-base}, \pkg{grid}, \pkg{ltxgrid}. -% \end{itemize} +% ^^A % \needspace{2\baselineskip} +% ^^A % \item[v0.51:] Improved \SVG\ math, added numerous chemistry packages. +% ^^A % \begin{itemize} +% ^^A % \item Docs: Added \nameref{sec:thingstoavoid}. +% ^^A % \margintag{documentation} +% ^^A % \item Docs: Added to \nameref{sec:convertexisting}. +% ^^A % \item Docs: Multiple authors and affiliations with custom classes. +% ^^A % See \cref{sec:authorsaffils}. +% ^^A % \item Docs: \pkg{tikz} with matrices. See \cref{sec:limitstikz}. +% ^^A % \item Improved \SVG\ math baseline.\margintag{SVG math} +% ^^A % \item Improved \SVG\ math font and color. +% ^^A % \item Faster \SVG\ math rendering. +% ^^A % \item Improved support for display math containing complicated math objects, +% ^^A % such as \pkg{tikz-cd}. See \cref{sec:displaymathother}. +% ^^A % \item Fix: \cs{addcontentsline} inside \SVG\ math. +% ^^A % \item Fix: \SVG\ math containing an embedded \env{lateximage}. +% ^^A % \item \brand{MathJax} now handles \cs{ensuremath} in expressions.\margintag{MathJax} +% ^^A % \item Fix: Added \env{alignat} environment. \margintag{misc. fixes} +% ^^A % \item Fix: \pkg{afterpackage} no longer required, which conflicted with \pkg{scrlfile}. +% ^^A % \item Fix: \pkg{titling} \cs{thanks} mark. +% ^^A % \item Fix: \pkg{fancybox} improvements. +% ^^A % \item Fix: \pkg{tikz} \cs{tikz} macro. (Previously only the \env{tikzpicture} environment worked.) +% ^^A % \item Fix: \pkg{tikz} with optional argument. +% ^^A % \item Added \pkg{mhchem}, \margintag{packages} +% ^^A % \pkg{chemfig}, \pkg{chemformula}, \pkg{chemmacros}, \pkg{chemnum}, \pkg{chemgreek}, +% ^^A % \pkg{epstopdf-base}, \pkg{grid}, \pkg{ltxgrid}. +% ^^A % \end{itemize} % ^^A \needspace{2\baselineskip} % ^^A \item[v0.50:] Improved \SVG\ math. % ^^A \begin{itemize} @@ -5545,10 +5589,11 @@ This boolean may be tested by the user for later use. % \ipkg{fullminipage}, \ipkg{fullpage}, % \ipkg{fwlw}, \ipkg{geometry}, \ipkg{gmeometric}, % \ipkg{grid}, \mpkg{grid-system}, \ipkg{gridset}, -% \ipkg{layaureo}, \ipkg{layout}, \ipkg{layouts}, \ipkg{leading}, +% \ipkg{layaureo}, \ipkg{layout}, \ipkg{layouts}, \ipkg{leading}, \ipkg{lscape}, % \ipkg{ltxgrid}, \ipkg{nccfancyhdr}, \ipkg{notespages}, \ipkg{nowidow}, % \ipkg{pagegrid}, \ipkg{pagesel}, \epkg{parallel}, \epkg{parcolumns}, -% \ipkg{pdfcolparallel}, \ipkg{pdfcolparcolumns}, \ipkg{pdfcrypt}, \ipkg{pdfprivacy}, +% \ipkg{pdfcolparallel}, \ipkg{pdfcolparcolumns}, \ipkg{pdfcrypt}, +% \ipkg{pdflscape}, \ipkg{pdfprivacy}, % \ipkg{preview}, \epkg{ragged2e}, \ipkg{returntogrid}, \ipkg{rmpage}, % \epkg{scrlayer-scrpage}, \epkg{scrpage2}, \epkg{setspace}, \ipkg{selectp}, % \ipkg{textarea}, \ipkg{threadcol}, @@ -5616,7 +5661,7 @@ This boolean may be tested by the user for later use. % Footnotes: & Adds \progcode{FootnoteDepth} to print footnotes at section breaks. % \brand{MathJax} emulation for \cs{footnote}, and also as marked in the following: % \epkg{bigfoot}, \ipkg{dblfnote}, -% \ipkg{endheads}, \mpkg{endnotes}\ejax, \spkg{fixfoot}, +% \ipkg{endheads}, \mpkg{endnotes}\ejax, \mpkg{enotez}\ejax, \spkg{fixfoot}, % \ipkg{fnbreak}, \ipkg{fnpara}, \ipkg{fnpos}, % \epkg{footmisc}, \mpkg{footnote}, \ipkg{footnotebackref}, % \mpkg{footnoterange}, \ipkg{footnpag}, \epkg{manyfoot}, @@ -5733,8 +5778,8 @@ This boolean may be tested by the user for later use. % \midrule % % \mpkg{xcolor}: & \textcolor{DarkGreen}{Full package color names}, any color models, -% and \textcolor{Goldenrod}{mixing}. -% \textcolor{Maroon}{\cs{textcolor}}, +% and \textcolor{red!70!black}{mixing}. +% \textcolor{blue}{\cs{textcolor}}, % \colorbox{LightSteelBlue}{\cs{colorbox}}, % \fcolorbox{red}{NavajoWhite}{\cs{fcolorbox}}. % Enhanced for \HTML\ compatibility. \\ @@ -5821,7 +5866,7 @@ This boolean may be tested by the user for later use. % Also see the math section for math and \brand{MathJax} support for math font packages. \\ % % Symbols: & Native \LaTeX\ diacriticals, \mpkg{academicons}, \spkg{amssymb}\sjax, -% \mpkg{bbding}, +% \mpkg{bbding}, \mpkg{ccicons}, % \mpkg{chemgreek}, \mpkg{dingbat}, \spkg{euro}, \mpkg{eurosym}, % \mpkg{fontawesome}, \mpkg{fontawesome5}, \spkg{gensymb}\ejax, \spkg{latexsym}\sjax, % \mpkg{marvosym}, @@ -5872,7 +5917,8 @@ This boolean may be tested by the user for later use. % % \midrule % -% Calendars: & \mpkg{termcal} \\ +% Academic: & \mpkg{academicons}, \epkg{classicthesis}, \spkg{doi}, +% \spkg{doipubmed}, \mpkg{orcidlink}\ijax, \mpkg{termcal} \\ % % \midrule % @@ -6620,7 +6666,7 @@ This boolean may be tested by the user for later use. % own auxiliary files. In this way, both \PDF\ and \HTML\ % documents may co-exist side-by-side. % -% \item [Auxiliary files:] The usual \LaTeX\ files |.aux|, |.log|, |.out|, |.toc|, |.lof|, |.idx|. +% \item [Auxiliary files:] The usual \LaTeX\ files |.aux|, |.log|, |.out|, \filenm{.toc}, \filenm{.lof}, |.idx|. % When an \HTML\ version of the document is created, |_html| versions % of the auxiliary files will also be generated. % @@ -7012,7 +7058,7 @@ This boolean may be tested by the user for later use. % % \subsection{Cleaning auxiliary files} % -% To remove the auxiliary files |.aux|, |.toc|, |.lof|, |.lot|, |.idx|, |.ind|, |.log|, +% To remove the auxiliary files |.aux|, \filenm{.toc}, \filenm{.lof}, \filenm{.lot}, |.idx|, |.ind|, |.log|, % and |.gl*|, and a few others: % \userentry{lwarpmk clean} % @@ -7277,14 +7323,20 @@ This boolean may be tested by the user for later use. % \gindex{link>title=\attribute{title} text} % \gindex{hyperref=\pkg{hyperref}>title=\attribute{title} text} % \gindex{settings>accessibility} +% \gindex{ARIA=\acro{ARIA}} +% \gindex{roles>ARIA=\acro{ARIO}} % % \pkg{lwarp} provides several methods for improving access to % the document using tools such as text-only browsers, copy \Slash paste, % text-to-speech readers, or Braille readers. -% \HTML\ provides the \attribute{alt} text attribute for images, -% which is used by \pkg{lwarp} as describe below. -% \HTML\ also provides the \attribute{title} attribute, which usually +% \pkg{lwarp} can use the \HTML\ \attribute{alt} text attribute for images, +% as describe below. +% \pkg{lwarp} can also use the \HTML\ \attribute{title} attribute, which usually % generates a pop-up text. \pkg{lwarp} can add this to a reference or hyperlink. +% \pkg{lwarp} also uses standard \HTML5 elements which are pre-assigned +% \ARIA\ roles for increased accessibility, and \pkg{lwarp} assigns the |math| +% role for \SVG\ math images, and the |note| role for footnotes, end notes, +% margin paragraphs and notes, etc. % \brand{MathJax} also has provisions for improved accessibility % as well. See \cref{tab:accessibility}. % @@ -9613,7 +9665,7 @@ This boolean may be tested by the user for later use. % \cs{usepackage}[ \\ % \fqquad \textred{makeindex,} \\ % \fqquad \textred{makeindexStyle=gindex.ist,} \\ -% \fqquad \dots or \dots \\ +% \fqquad \dots\ or \dots \\ % \fqquad \textred{makeindexStyle=gindexh.ist,} \\ % \fqquad \textgreen{latexmk} \hfill \textrm{<optional>}\\ % ]\{\textblue{lwarp}\} @@ -10141,7 +10193,7 @@ This boolean may be tested by the user for later use. % \DescribeOption{makeindexStyle} % \begin{sourcedisplay} % \cs{usepackage}[ \\ -% \fquad \dots other options \dots \\ +% \fquad \dots\ other options \dots \\ % \fquad \textred{makeindex}, \\ % \fquad \textred{makeindexStyle=projectname.ist}, \\ % ]\{lwarp\} @@ -10200,7 +10252,7 @@ This boolean may be tested by the user for later use. % \DescribeOption{xindyStyle} % \begin{sourcedisplay} % \cs{usepackage}[ \\ -% \fquad \dots other options \dots \\ +% \fquad \dots\ other options \dots \\ % \fquad \textred{xindy}, \\ % \fquad \textred{xindyStyle=projectname.xdy}, \\ % ]\{lwarp\} @@ -10237,7 +10289,7 @@ This boolean may be tested by the user for later use. % \DescribeOption{xindexConfig} % \begin{sourcedisplay} % \cs{usepackage}[ \\ -% \fquad \dots other options \dots \\ +% \fquad \dots\ other options \dots \\ % \fquad \textred{xindex}, \\ % \fquad \textred{xindexConfig=projectname}, \quad \% \textgreen{(without xindex- or .lua)} \\ % ]\{lwarp\} @@ -10341,6 +10393,10 @@ This boolean may be tested by the user for later use. % \limitsmathdisplay % % +% \subsubsection{Theorems} +% \limitstheorems +% \changes{v0.896}{2021/03/25}{Docs: Theorem references.} +% % \subsubsection{\pkg{ntheorem} package} % % \DescribePackage{ntheorem} @@ -10890,8 +10946,8 @@ This boolean may be tested by the user for later use. % No attempt has yet been made to make \pkg{pythontex} robust with \HTML\ output. % Some math objects must be surrounded by % \trouble[``impure'' math]{pythontex=\pkg{pythontex}} -% \cs{displaymathother} \dots \cs{displaymathnormal}, -% or \cs{inlinemathother} \dots \cs{inlinemathnormal}. +% \cs{displaymathother} \dots\ \cs{displaymathnormal}, +% or \cs{inlinemathother} \dots\ \cs{inlinemathnormal}. % Displays of code may have to be % enclosed inside a \env{lateximage} environment % \watchout[HTML look-alike] @@ -11949,7 +12005,7 @@ This boolean may be tested by the user for later use. % \item [``Temporary page! LaTeX was unable to guess the total % number of pages \dots'':] \ % Harmless. Recompile the document one more time. -% \trouble{Temporary page \dots unable to guess \dots} +% \trouble{Temporary page \dots\ unable to guess \dots} % \trouble{LaTeX was unable to guess the total\dots} % % \item [``Leaders not followed by proper glue'':] ~ \\ @@ -12051,8 +12107,8 @@ This boolean may be tested by the user for later use. % \trouble{alt tags} % can also cause problems with \attribute{alt} tags, resulting in % very slow compilation, large \attribute{alt} tags, and possible -% crashes. Use \cs{inlinemathother} \dots \cs{inlinemathnormal} or -% \cs{displaymathother} \dots \cs{displaymathnormal} around the +% crashes. Use \cs{inlinemathother} \dots\ \cs{inlinemathnormal} or +% \cs{displaymathother} \dots\ \cs{displaymathnormal} around the % math expression. % \end{description} % @@ -12896,6 +12952,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{bussproofs} \LWR@loadafter{bxpapersize} \LWR@loadafter{bytefield} +\LWR@loadafter{ccicons} \LWR@loadafter{cancel} \LWR@loadafter{canoniclayout} \LWR@loadafter{caption} @@ -12920,6 +12977,7 @@ This boolean may be tested by the user for later use. \LWR@notmemoirloadafter{chngpage} \LWR@loadafter{cite} \LWR@loadafter{citeref} +\LWR@loadafter{classicthesis} \LWR@loadafter{cleveref} % cmbright may be preloaded \LWR@loadafter{cmdtrack} @@ -12957,6 +13015,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{endheads} \LWR@loadafter{endnotes} \LWR@loadafter{engtlc} +\LWR@loadafter{enotez} \LWR@notmemoirloadafter{enumerate} \LWR@loadafter{enumitem} \LWR@notmemoirloadafter{epigraph} @@ -13171,6 +13230,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{nowidow} \LWR@loadafter{ntheorem} \LWR@loadafter{octave} +\LWR@loadafter{orcidlink} \LWR@loadafter{overpic} \LWR@loadafter{pagegrid} \LWR@notmemoirloadafter{pagenote} @@ -13381,7 +13441,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{xcolor} \LWR@loadafter{xechangebar} \LWR@loadafter{xellipsis} -% xetexko-vertical must be loaded before lwarp +% xetexko must be loaded before lwarp \LWR@loadafter{xevlna} \LWR@loadafter{xfakebold} \LWR@loadafter{xfrac} @@ -13739,25 +13799,29 @@ This boolean may be tested by the user for later use. % % \subsection{Argument selection} % -% \begin{macro}{\LWR@firstoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} +% \begin{macro}{\LWR@firstoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} % \changes{v0.63}{2019/01/25}{Added.} -% \begin{macro}{\LWR@secondoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} -% \begin{macro}{\LWR@thirdoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} -% \begin{macro}{\LWR@fourthoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} +% \changes{v0.896}{2021/04/05}{Changed to firstoffive instead of four.} +% \begin{macro}{\LWR@secondoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} +% \begin{macro}{\LWR@thirdoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} +% \begin{macro}{\LWR@fourthoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} +% \begin{macro}{\LWR@fifthoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} % -% Expands to the nth of the four arguments. +% Expands to the nth of the five arguments. % Used for extra cross referencing. % % \begin{macrocode} -\long\def\LWR@firstoffour#1#2#3#4{#1} -\long\def\LWR@secondoffour#1#2#3#4{#2} -\long\def\LWR@thirdoffour#1#2#3#4{#3} -\long\def\LWR@fourthoffour#1#2#3#4{#4} +\long\def\LWR@firstoffive#1#2#3#4#5{#1} +\long\def\LWR@secondoffive#1#2#3#4#5{#2} +\long\def\LWR@thirdoffive#1#2#3#4#5{#3} +\long\def\LWR@fourthoffive#1#2#3#4#5{#4} +\long\def\LWR@fifthoffive#1#2#3#4#5{#5} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % % \subsection{Inside boxes} @@ -15676,6 +15740,7 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \RenewDocumentCommand{\RequirePackage}{o m o}{% % \end{macrocode} +% % Redirect up to twenty names:\footnote{This was originally nine names, but % then I came across a package which used twelve...} % \changes{v0.61}{2018/10/02}{Support up to 20 packages.} @@ -15703,6 +15768,31 @@ This boolean may be tested by the user for later use. \LWR@lookforpackagename{19}% \LWR@lookforpackagename{20}% % \end{macrocode} +% +% Error if braces are used in optional argument. +% This can cause an error, so tell how to avoid. +% \changes{v0.896}{2021/03/14}{Warn if package option has braces.} +% \begin{macrocode} +\IfSubStr{\detokenize\expandafter{#1}}{\LWRleftbrace}% + {% + \PackageError{lwarp}{% + You used:\MessageBreak + \protect\requirepackage[#1]{#2}\MessageBreak + Braces in the package options will fail with Lwarp.\MessageBreak + Instead, use:\MessageBreak + \protect\PassOptionsToPackage{#1}{#2}\MessageBreak + \protect\requirepackage{#2}\MessageBreak + near the line number given below.\MessageBreak + Enter 'h' for more info% + }% + {% + See the Lwarp manual troubleshooting index entry for\MessageBreak + ``package, options with braces''% + }% + }% + {}% no brace +% \end{macrocode} +% % \cs{RequirePackage} depending on the options and version: % \begin{macrocode} \IfValueTF{#1}% @@ -15967,7 +16057,7 @@ This boolean may be tested by the user for later use. % \begin{macro}{\LWR@copyfile} \marg{source filename} \marg{destination filename} % -% Used to copy the |.toc| file to |.sidetoc| to re-print the \TOC\ in +% Used to copy the \filenm{.toc} file to |.sidetoc| to re-print the \TOC\ in % the side\TOC\ navigation pane. % \begin{macrocode} \newwrite\LWR@copyoutfile % open the file to write to @@ -17389,6 +17479,7 @@ This boolean may be tested by the user for later use. % \changes{v0.88}{2020/07/14}{\filenm{lwarp.css}: Added \optn{indexheading} for \pkg{gindex}.} % \changes{v0.893}{2020/10/18}{\filenm{lwarp.css}: Added \pkg{keystroke}.} % \changes{v0.894}{2020/12/15}{\filenm{lwarp.css}: \TeX\ logos no longer below baseline.} +% \changes{v0.896}{2021/03/04}{\filenm{lwarp.css}: Added \element{main}, adjusted \element{sidetoccontainer} margin.} % % ^^A *lwarp.css % @@ -17888,12 +17979,12 @@ div.marginblock br , div.marginparblock br { margin-bottom: 2ex ; } -div.bodycontainer { +main.bodycontainer { float: left ; width: 80% ; } -div.bodywithoutsidetoc div.bodycontainer { +div.bodywithoutsidetoc main.bodycontainer { float: none ; width: 100% ; } @@ -18735,15 +18826,12 @@ img.lateximage{ } -/* The -1px right margin compensates for the 1px right border. */ -/* Without this -1px margin, the body container appears below instead */ -/* of floating to the side. */ div.sidetoccontainer { font-family: "DejaVu Serif", "Bitstream Vera Serif", "Lucida Bright", Georgia, serif; float: left ; - width: 20%; - margin: 0pt -1px 3ex 0pt ; + width: 19%; /* room for border-right next to 80% main */ + margin: 0pt 0em 3ex 0pt ; border-right: 1px solid silver; border-bottom: 1px solid silver; background: #FAF7F4 ; @@ -19097,7 +19185,7 @@ span.sidetocthetitle { display: none } span.sidetocthetitle { display: inline } nav.topnavigation { display:block } nav.botnavigation { display:block } - div.bodycontainer { width: 100% } + main.bodycontainer { width: 100% } .marginpar { max-width: 100%; float: none; @@ -19116,21 +19204,21 @@ span.sidetocthetitle { display: none } div.sidetoccontainer { display:none; } nav.topnavigation { display: none; } nav.botnavigation { display: none; } - div.bodycontainer { width: 100% } + main.bodycontainer { width: 100% } } @media handheld { div.sidetoccontainer { display:none; } nav.topnavigation { display:block } nav.botnavigation { display:block } - div.bodycontainer { width: 100% } + main.bodycontainer { width: 100% } } @media projection { div.sidetoccontainer { display:none; } nav.topnavigation { display:block } nav.botnavigation { display:block } - div.bodycontainer { width: 100% } + main.bodycontainer { width: 100% } } \end{filecontents*} % \end{Verbatim}% for syntax highlighting @@ -20192,7 +20280,7 @@ MathJax = { -- Copyright 2016-2021 Brian Dunn -printversion = "v0.895" +printversion = "v0.896" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -21169,9 +21257,7 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} % \end{macrocode} - - - +% % Stacks are used to remember how to close sections and list items. % Before a new section is started, previously nested sections and items must % be closed out (un-nested) in proper order. @@ -21224,6 +21310,7 @@ end -- not --version % A stack to record the action to take to close each nesting level: % Add more levels of stack if necessary for a very deeply nested document, % adding to \cs{pushclose} and \cs{popclose} as well. +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \newcommand*{\LWR@closeone}{}% top of the stack \newcommand*{\LWR@closetwo}{} @@ -21237,6 +21324,13 @@ end -- not --version \newcommand*{\LWR@closeten}{} \newcommand*{\LWR@closeeleven}{} \newcommand*{\LWR@closetwelve}{} +\newcommand*{\LWR@closethirteen}{} +\newcommand*{\LWR@closefourteen}{} +\newcommand*{\LWR@closefifteen}{} +\newcommand*{\LWR@closesixteen}{} +\newcommand*{\LWR@closeseventeen}{} +\newcommand*{\LWR@closeeighteen}{} +\newcommand*{\LWR@closenineteen}{} % \end{macrocode} % \subsection{Closing depths} @@ -21258,7 +21352,8 @@ end -- not --version % \end{Verbatim} % \vspace{-\baselineskip} % \end{docsidebar} - +% +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \newcommand*{\LWR@closedepthone}{\LWR@depthnone}% top of the stack \newcommand*{\LWR@closedepthtwo}{\LWR@depthnone} @@ -21272,6 +21367,13 @@ end -- not --version \newcommand*{\LWR@closedepthten}{\LWR@depthnone} \newcommand*{\LWR@closedeptheleven}{\LWR@depthnone} \newcommand*{\LWR@closedepthtwelve}{\LWR@depthnone} +\newcommand*{\LWR@closedepththirteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthfourteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthfifteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthsixteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthseventeen}{\LWR@depthnone} +\newcommand*{\LWR@closedeptheighteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthnineteen}{\LWR@depthnone} % \end{macrocode} % \subsection{Pushing and popping the stack} @@ -21280,9 +21382,17 @@ end -- not --version % Pushes one return action and its \LaTeX\ depth onto the stacks. % \changes{v0.46}{2018/01/18}{Fix: Stack unnesting.} +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \NewDocumentCommand{\LWR@pushclose}{m} {% +\global\let\LWR@closenineteen\LWR@closeeighteen% +\global\let\LWR@closeeighteen\LWR@closeseventeen% +\global\let\LWR@closeseventeen\LWR@closesixteen% +\global\let\LWR@closesixteen\LWR@closefifteen% +\global\let\LWR@closefifteen\LWR@closefourteen% +\global\let\LWR@closefourteen\LWR@closethirteen% +\global\let\LWR@closethirteen\LWR@closetwelve% \global\let\LWR@closetwelve\LWR@closeeleven% \global\let\LWR@closeeleven\LWR@closeten% \global\let\LWR@closeten\LWR@closenine% @@ -21295,6 +21405,13 @@ end -- not --version \global\let\LWR@closethree\LWR@closetwo% \global\let\LWR@closetwo\LWR@closeone% \global\csletcs{LWR@closeone}{LWR@printclose#1}% +\global\let\LWR@closedepthnineteen\LWR@closedeptheighteen% +\global\let\LWR@closedeptheighteen\LWR@closedepthseventeen% +\global\let\LWR@closedepthseventeen\LWR@closedepthsixteen% +\global\let\LWR@closedepthsixteen\LWR@closedepthfifteen% +\global\let\LWR@closedepthfifteen\LWR@closedepthfourteen% +\global\let\LWR@closedepthfourteen\LWR@closedepththirteen% +\global\let\LWR@closedepththirteen\LWR@closedepthtwelve% \global\let\LWR@closedepthtwelve\LWR@closedeptheleven% \global\let\LWR@closedeptheleven\LWR@closedepthten% \global\let\LWR@closedepthten\LWR@closedepthnine% @@ -21307,6 +21424,20 @@ end -- not --version \global\let\LWR@closedepththree\LWR@closedepthtwo% \global\let\LWR@closedepthtwo\LWR@closedepthone% \global\csletcs{LWR@closedepthone}{LWR@depth#1}% +% \end{macrocode} +% +% Error if the deepest depth is no longer \cs{LWR@depthnone}, +% which means that it somehow has been nested too deeply, +% or things are not being unnested correctly. +% \changes{v0.896}{2021/03/15}{Error if stack overflow.} +% \begin{macrocode} +\ifdefstring{\LWR@closedepthnineteen}{\LWR@depthnone}% + {}% + {% + \PackageError{lwarp}% + {The document is nested too deeply for Lwarp}% + {PLEASE inform the Lwarp maintainer!}% + }% } % \end{macrocode} % \end{macro} @@ -21316,6 +21447,7 @@ end -- not --version % Pops one action and its depth off the stacks. % \changes{v0.46}{2018/01/18}{Fix: Stack unnesting.} +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \newcommand*{\LWR@popclose} {% @@ -21330,6 +21462,13 @@ end -- not --version \global\let\LWR@closenine\LWR@closeten% \global\let\LWR@closeten\LWR@closeeleven% \global\let\LWR@closeeleven\LWR@closetwelve% +\global\let\LWR@closetwelve\LWR@closethirteen% +\global\let\LWR@closethirteen\LWR@closefourteen% +\global\let\LWR@closefourteen\LWR@closefifteen% +\global\let\LWR@closefifteen\LWR@closesixteen% +\global\let\LWR@closesixteen\LWR@closeseventeen% +\global\let\LWR@closeseventeen\LWR@closeeighteen% +\global\let\LWR@closeeighteen\LWR@closenineteen% \global\let\LWR@closedepthone\LWR@closedepthtwo% \global\let\LWR@closedepthtwo\LWR@closedepththree% \global\let\LWR@closedepththree\LWR@closedepthfour% @@ -21341,6 +21480,13 @@ end -- not --version \global\let\LWR@closedepthnine\LWR@closedepthten% \global\let\LWR@closedepthten\LWR@closedeptheleven% \global\let\LWR@closedeptheleven\LWR@closedepthtwelve% +\global\let\LWR@closedepthtwelve\LWR@closedepththirteen% +\global\let\LWR@closedepththirteen\LWR@closedepthfourteen% +\global\let\LWR@closedepthfourteen\LWR@closedepthfifteen% +\global\let\LWR@closedepthfifteen\LWR@closedepthsixteen% +\global\let\LWR@closedepthsixteen\LWR@closedepthseventeen% +\global\let\LWR@closedepthseventeen\LWR@closedeptheighteen% +\global\let\LWR@closedeptheighteen\LWR@closedepthnineteen% } % \end{macrocode} % \end{macro} @@ -21524,7 +21670,7 @@ end -- not --version \boolfalse{LWR@dynamicmath} % \end{macrocode} % -% \begin{macro}{\inlinemathother} Place before using |$| \dots\ |$| or \cs{(} \dots \cs{)} +% \begin{macro}{\inlinemathother} Place before using |$| \dots\ |$| or \cs{(} \dots\ \cs{)} % if the contents of the math are not static, depending on counters or dynamic macros. % \changes{v0.57}{2018/05/23}{Added.} % \changes{v0.61}{2018/09/20}{Changed name from \cs{StartDynamicMath} to \cs{inlinemathother}.} @@ -21536,7 +21682,7 @@ end -- not --version % \end{macrocode} % \end{macro} % -% \begin{macro}{\inlinemathnormal} Place after using |$| \dots\ |$| or \cs{(} \dots \cs{)} +% \begin{macro}{\inlinemathnormal} Place after using |$| \dots\ |$| or \cs{(} \dots\ \cs{)} % with dynamic contents. % \changes{v0.61}{2018/09/20}{Changed name from \cs{StopDynamicMath} to \cs{inlinemathnormal}.} % \begin{macrocode} @@ -22069,12 +22215,16 @@ end -- not --version % \begin{macro}{\LWRPrintStack} Prints the closedepth stack. % \changes{v0.46}{2018/01/15}{Name changed from \cs{PrintStack}.} +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \newcommand*{\LWR@subprintstack}{ \LWR@closedepthone\ \LWR@closedepthtwo\ \LWR@closedepththree\ \LWR@closedepthfour\ \LWR@closedepthfive\ \LWR@closedepthsix\ \LWR@closedepthseven\ \LWR@closedeptheight\ \LWR@closedepthnine\ \LWR@closedepthten\ \LWR@closedeptheleven\ \LWR@closedepthtwelve\ +\LWR@closedepththirteen\ \LWR@closedepthfourteen\ \LWR@closedepthfifteen\ +\LWR@closedepthsixteen\ \LWR@closedepthseventeen\ \LWR@closedeptheighteen\ +\LWR@closedepthnineteen\ } \newcommand*{\LWRPrintStack}{ @@ -22490,6 +22640,7 @@ end -- not --version % \changes{v0.73}{2019/06/23}{Fix: \env{quote}, \env{quotation} inside a span.} % \changes{v0.84}{2020/04/22}{Nullified \env{minipage}, \cs{parbox} inside a span.} % \changes{v0.84}{2020/04/22}{Issue warnings inside a span.} +% \changes{v0.896}{2021/03/05}{Issue \env{BlockClassWP} warning inside a span.} % % \begin{macrocode} \newcommand*{\LWR@nestspanitem}{% @@ -22518,6 +22669,9 @@ end -- not --version \RenewDocumentEnvironment{BlockClass}{o m}% {\LWR@spanwarnformat{multi-paragraph object}}% {}% + \RenewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}% + {\LWR@spanwarnformat{multi-paragraph object}}% + {}% \renewcommand{\BlockClassSingle}[2]{% {\LWR@spanwarnformat{multi-paragraph object}}% ##2% @@ -22566,20 +22720,23 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@htmlspanclass} \oarg{style} \marg{class} \marg{text} +% \begin{macro}{\LWR@htmlspanclass} +% \oarg{style} \parg{\ARIA\ role} \marg{class} \marg{text} % % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} -% +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} -\NewDocumentCommand{\LWR@htmlspanclass}{o m +m}{% -\LWR@traceinfo{LWR@htmlspanclass |#1|#2|}% -\LWR@ensuredoingapar% -\LWR@subhtmlelementclass{span}[#1]{#2}% -\begin{LWR@nestspan}% -#3% -\LWR@htmltagc{/span}% -\LWR@traceinfo{LWR@htmlspanclass done}% -\end{LWR@nestspan}% +\NewDocumentCommand{\LWR@htmlspanclass}{o D(){} m +m}{% + \LWR@traceinfo{LWR@htmlspanclass |#1|#2|#3|}% + \LWR@ensuredoingapar% + \ifblank{#2}% + {\LWR@subhtmlelementclass{span}[#1]{#3}}% + {\LWR@subhtmlelementclass{span}[#1](#2){#3}}% + \begin{LWR@nestspan}% + #4% + \LWR@htmltagc{/span}% + \LWR@traceinfo{LWR@htmlspanclass done}% + \end{LWR@nestspan}% } % \end{macrocode} % \end{macro} @@ -22676,7 +22833,8 @@ end -- not --version % \subsection{Div class and element class} -% \begin{macro}{\LWR@subhtmlelementclass} \marg{element} \oarg{style} \marg{class} +% \begin{macro}{\LWR@subhtmlelementclass} +% \marg{element} \oarg{style} \parg{\ARIA\ role} \marg{class} % % Factored and reused in several places. % @@ -22690,21 +22848,24 @@ end -- not --version % \changes{v0.63}{2018/11/24}{Fix for \pkg{xeCJK}.} % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \changes{v0.892}{2020/10/03}{Ignore empty class.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \begin{macrocode} -\NewDocumentCommand{\LWR@subhtmlelementclass}{m O{} m}{% -\LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!}% +\NewDocumentCommand{\LWR@subhtmlelementclass}{m O{} D(){} m}{% +\LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!#4!}% \ifblank{#2}% {% empty style \LWR@htmltag{% #1% - \ifblank{#3}{}{ class=\textquotedbl#3\textquotedbl\ }% spaces + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% spaces + \ifblank{#4}{}{ class=\textquotedbl#4\textquotedbl}% spaces }% }% {% non-empty style \LWR@htmltag{% #1\LWR@indentHTML% - \ifblank{#3}{}{class=\textquotedbl#3\textquotedbl\LWR@indentHTML}% + \ifblank{#3}{}{role=\textquotedbl#3\textquotedbl\LWR@indentHTML}% + \ifblank{#4}{}{class=\textquotedbl#4\textquotedbl\LWR@indentHTML}% style=\textquotedbl#2\textquotedbl\LWR@orignewline% }% }% @@ -22714,17 +22875,20 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@htmlelementclass} \marg{element} \marg{class} \oarg{style} +% \begin{macro}{\LWR@htmlelementclass} \marg{element} \oarg{style} \marg{class} % % \changes{v0.20}{2017/01/17}{Added optional style.} % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % \changes{v0.73}{2019/06/26}{Vertical space.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} -\NewDocumentCommand{\LWR@htmlelementclass}{m o m}{% -\LWR@stoppars% -\LWR@forceemptyline% -\LWR@subhtmlelementclass{#1}[#2]{#3}% -\LWR@startpars% +\NewDocumentCommand{\LWR@htmlelementclass}{m o D(){} m}{% + \LWR@stoppars% + \LWR@forceemptyline% + \ifblank{#3}% + {\LWR@subhtmlelementclass{#1}[#2]{#4}}% + {\LWR@subhtmlelementclass{#1}[#2](#3){#4}}% + \LWR@startpars% } % \end{macrocode} % \end{macro} @@ -22733,24 +22897,27 @@ end -- not --version % \begin{macro}{\LWR@htmlelementclassend} \marg{element} \marg{class} % \begin{macrocode} \newcommand*{\LWR@htmlelementclassend}[2]{% -\LWR@stoppars% -\LWR@htmltag{/#1}% -\ifbool{HTMLDebugComments}{% - \LWR@htmlcomment{End of #1 ``#2''}% -}{}% -\LWR@startpars% + \LWR@stoppars% + \LWR@htmltag{/#1}% + \ifbool{HTMLDebugComments}{% + \LWR@htmlcomment{End of #1 ``#2''}% + }{}% + \LWR@startpars% } % \end{macrocode} % \end{macro} -% \begin{macro}{\LWR@htmldivclass} \oarg{style} \marg{class} +% \begin{macro}{\LWR@htmldivclass} \oarg{style} \parg{\ARIA\ role} \marg{class} % % \changes{v0.20}{2017/01/17}{Added optional style.} % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \begin{macrocode} -\NewDocumentCommand{\LWR@htmldivclass}{o m}{% -\LWR@htmlelementclass{div}[#1]{#2}% +\NewDocumentCommand{\LWR@htmldivclass}{o D(){} m}{% + \ifblank{#2} + {\LWR@htmlelementclass{div}[#1]{#3}}% + {\LWR@htmlelementclass{div}[#1](#2){#3}}% } % \end{macrocode} % \end{macro} @@ -22758,7 +22925,7 @@ end -- not --version % \begin{macro}{\LWR@htmldivclassend} \marg{class} % \begin{macrocode} \newcommand*{\LWR@htmldivclassend}[1]{% -\LWR@htmlelementclassend{div}{#1}% + \LWR@htmlelementclassend{div}{#1}% } % \end{macrocode} % \end{macro} @@ -22825,7 +22992,7 @@ end -- not --version % For other direct-formatting commands, see \cref{sec:directformatting}. % % -% \begin{environment}{BlockClass} \oarg{style} \marg{class} \quad +% \begin{environment}{BlockClass} \oarg{style} \parg{\ARIA\ role} \marg{class} \quad % High-level interface for \element{div} classes. % % \qquad Ex: |\begin{BlockClass}{class}| text |\end{BlockClass}| @@ -22834,11 +23001,12 @@ end -- not --version % \changes{v0.20}{2017/01/17}{Added optional style.} % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \codeprint % \begin{macrocode} \begin{warpprint} -\NewDocumentEnvironment{BlockClass}{o m}{}{}% +\NewDocumentEnvironment{BlockClass}{o D(){} m}{}{} \end{warpprint} % \end{macrocode} % \end{environment} @@ -22847,11 +23015,11 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{LWR@print@BlockClass}{o m}{}{}% +\NewDocumentEnvironment{LWR@print@BlockClass}{o D(){} m}{}{}% -\NewDocumentEnvironment{LWR@HTML@BlockClass}{o m}% - {\LWR@htmldivclass[#1]{#2}} - {\LWR@htmldivclassend{#2}} +\NewDocumentEnvironment{LWR@HTML@BlockClass}{o D(){} m}% + {\LWR@htmldivclass[#1](#2){#3}}% + {\LWR@htmldivclassend{#3}} \LWR@formattedenv{BlockClass} \end{warpHTML} @@ -22914,11 +23082,15 @@ end -- not --version \NewDocumentCommand{\LWR@print@InlineClass}{D{(}{)}{} o m +m}{#4}% \NewDocumentCommand{\LWR@HTML@InlineClass}{D{(}{)}{} o m +m}{% +\LWR@traceinfo{LWR@HTML@InlineClass #3}% \ifbool{FormatWP}{% + \LWR@traceinfo{LWR@HTML@InlineClass: FormatWP}% \LWR@htmlspanclass[#1]{#3}{#4}% }{% + \LWR@traceinfo{LWR@HTML@InlineClass: not FormatWP}% \LWR@htmlspanclass[#2]{#3}{#4}% }% +\LWR@traceinfo{LWR@HTML@InlineClass: done}% } \LWR@formatted{InlineClass} @@ -22926,7 +23098,8 @@ end -- not --version % \end{macrocode} -% \begin{environment}{LWR@BlockClassWP} \marg{WPstyle} \marg{HTMLstyle} \marg{class} \quad +% \begin{environment}{LWR@BlockClassWP} +% \marg{WPstyle} \marg{HTMLstyle} \parg{\ARIA\ role} \marg{class} \quad % Low-level interface for \element{div} classes with an automatic float ID. % These are often used when |\ifbool{FormatWP}|. % @@ -22937,11 +23110,12 @@ end -- not --version % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} % \changes{v0.63}{2018/11/24}{Fix for \pkg{xeCJK}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \codeprint % \begin{macrocode} \begin{warpprint} -\NewDocumentEnvironment{LWR@BlockClassWP}{m m m}{}{}% +\NewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}{}{} \end{warpprint} % \end{macrocode} % \end{environment} @@ -22949,8 +23123,9 @@ end -- not --version % \codehtml % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{LWR@print@LWR@BlockClassWP}{m m m}{}{}% -\NewDocumentEnvironment{LWR@HTML@LWR@BlockClassWP}{m m m}% +\NewDocumentEnvironment{LWR@print@LWR@BlockClassWP}{m m D(){} m}{}{}% + +\NewDocumentEnvironment{LWR@HTML@LWR@BlockClassWP}{m m D(){} m}% {% \LWR@stoppars% \ifbool{FormatWP}% @@ -22960,22 +23135,24 @@ end -- not --version % \changes{v0.65}{2018/12/21}{Fix space between class and id.} % \begin{macrocode} \LWR@htmltag{% - div class=\textquotedbl#3\textquotedbl\ % space + div class=\textquotedbl#4\textquotedbl\ % space id=\textquotedbl% \LWR@print@mbox{autoidWP-\arabic{LWR@thisautoidWP}}% \textquotedbl% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% \ifblank{#1}{}{ style=\textquotedbl#1\textquotedbl}% }% }% FormatWP {% not FormatWP \LWR@htmltag{% - div class=\textquotedbl#3\textquotedbl% + div class=\textquotedbl#4\textquotedbl% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% \ifblank{#2}{}{ style=\textquotedbl#2\textquotedbl}% }% }% not FormatWP \LWR@startpars% } -{\LWR@htmldivclassend{#3}} +{\LWR@htmldivclassend{#4}} \LWR@formattedenv{LWR@BlockClassWP} \end{warpHTML} @@ -23866,14 +24043,30 @@ end -- not --version % \changes{v0.36}{2017/08/15}{Extra \protect\HTML\ source space after paragraphs.} % \changes{v0.36}{2017/08/16}{Force \protect\HTML\ superscripts.} % \changes{v0.68}{2019/03/04}{Factored for multiple foot boxes.} +% \changes{v0.896}{2021/04/04}{Fix: \ctr{autopage} references in footnotes.} % % \begin{macrocode} \long\def\LWR@@footnotetext#1#2{% \LWR@traceinfo{LWR@footnotetext}% -\global\setbox\csname #2\endcsname=\vbox{% % \end{macrocode} -% Add to any current footnotes: +% +% Perhaps generate an autopage in the text to link a citation backreference +% closer to its usage. +% \begin{macrocode} +\LWR@newautopagelabel{page}% +% \end{macrocode} +% +% Locally disable auto page labels inside the footnote text. +% Footnotes are accumulated in the current page before finally being placed +% in a potentially later page, so the aotopages would be incorrect. +% \begin{macrocode} +\begingroup% +\let\LWR@newautopagelabel\LWR@null@newautopagelabel% +% \end{macrocode} +% +% Take the existing footnote box and add the new content: % \begin{macrocode} +\global\setbox\csname #2\endcsname=\vbox{% \unvbox\csname #2\endcsname% % \end{macrocode} % Remember the footnote number for \cs{ref}: @@ -23929,6 +24122,7 @@ end -- not --version % \begin{macrocode} \color@endgroup% }% vbox +\endgroup% % \end{macrocode} % Paragraph handling: % \changes{v0.52}{2018/03/28}{Fix: Paragraph handling.} @@ -23940,7 +24134,7 @@ end -- not --version % \begin{macro}{\LWR@footnotetext} \marg{text} % \begin{macrocode} -\long\def\LWR@footnotetext#1{\LWR@@footnotetext{#1}{LWR@footnotebox}} +\long\def\LWR@footnotetext#1{\LWR@@footnotetext{#1}{LWR@footnotebox}}% % \end{macrocode} % \end{macro} % @@ -24034,11 +24228,20 @@ end -- not --version % % % \begin{macro}{\LWR@@printpendingfootnotes} \marg{footnote counter name} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} +% \changes{v0.896}{2021/03/26}{Fix: Backref to footnote.} % \begin{macrocode} \newcommand*{\LWR@@printpendingfootnotes}[1]{% \expandafter\ifvoid\csname LWR@#1box\endcsname\else \LWR@forcenewpage - \begin{BlockClass}{footnotes} + \begin{BlockClass}(note){footnotes}% +% \end{macrocode} +% +% Create a new autopage in case citation back references occur inside the footnotes: +% \begin{macrocode} + \LWR@newautopagelabel{page}% +% \end{macrocode} +% \begin{macrocode} \null \unvbox\csuse{LWR@#1box} \setbox\csuse{LWR@#1box}=\vbox{} @@ -24085,11 +24288,12 @@ end -- not --version % \begin{macro}{\LWR@printpendingmpfootnotes} % Enclose the minipage footnotes in a class, print, then clear. % \changes{v0.45}{2018/01/10}{Added.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \newcommand*{\LWR@printpendingmpfootnotes}{% \ifvoid\LWR@mpfootnotes\else \LWR@forcenewpage - \begin{BlockClass}{footnotes} + \begin{BlockClass}(note){footnotes}% \null \unvbox\LWR@mpfootnotes \setbox\LWR@mpfootnotes=\vbox{} @@ -24122,17 +24326,17 @@ end -- not --version % % \changes{v0.21}{2017/02/11}{Fixed source listing.} % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} emulate a wrapfig.} -% +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \renewcommand{\marginpar}[2][]{% \ifbool{FormatWP}% {% -\begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}{marginblock} +\begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}(note){marginblock}% #2 -\end{LWR@BlockClassWP} +\end{LWR@BlockClassWP}% }% {% - \LWR@htmlspanclass{marginpar}{#2}% + \LWR@htmlspanclass(note){marginpar}{#2}% }% } % \end{macrocode} @@ -24149,17 +24353,17 @@ end -- not --version % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} emulate a wrapfig.} % \changes{v0.44}{2017/11/10}{Added.} % \changes{v0.73}{2019/06/25}{Fix: Paragraph tags.} -% +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \newcommand{\marginparBlock}[2][]{% \LWR@stoppars% \ifbool{FormatWP}% {% - \begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}{marginblock} + \begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}(note){marginblock}% #2 \end{LWR@BlockClassWP} }{% - \begin{BlockClass}[width:2in; float:right; margin:10pt]{marginparblock} + \begin{BlockClass}[width:2in; float:right; margin:10pt](note){marginparblock}% #2 \end{BlockClass} }% @@ -24213,6 +24417,122 @@ end -- not --version +% \section{Tracking internal cross references} +% +% Cross references are generated using the \PDF\ file's page number during +% \LaTeX\ compilation. +% Internal labels are generated which include these page numbers in the label. +% +% +% \DescribeFile{*_html.aux} +% A new entry in the \filenm{*_html.aux} file is used to help +% cross-references: +% \begin{sourceverb} +% \newlabel{autopage-<nnn>}{{<x>}{<y>}} +% \end{sourceverb} +% +% +% \DescribeCounter{LWR@currentautosecpage} Records the page number when the section +% was created. (If a math expression is included in the section name, +% and \SVG\ math is used, the corresponding \env{lateximage} will cause the +% page number to change by the time the following autosec label is created, +% thus the initial page number is recorded here.) +% \ctr{LWR@currentautosecfloatpage} is updated +% more often than \ctr{LWR@currentautosecpage}. +% \changes{v0.43}{2017/11/01}{\ctr{LWR@currentautosecpage}: Added.} +% \changes{v0.66}{2019/01/28}{\ctr{LWR@currentautosecpage}: Fix for \LOF, \LOT float in home page.} +% \begin{macrocode} +\newcounter{LWR@currentautosecpage} +\setcounter{LWR@currentautosecpage}{1} +% \end{macrocode} +% +% +% \DescribeCounter{LWR@currentautosecfloatpage} +% The \HTML\ output's \PDF\ page number at the start of a new \HTML\ file, section, +% or float. +% Updated more often than \ctr{LWR@currentautosecpage}, such as when a new float occurs. +% Used only for table of contents, list of figures, list of tables, +% but not for general cross references such as \cs{label}, citation backlinks, etc. +% +% \cs{LWRsetnextfloat} is written with this and the |autoid| +% by the modified \cs{addcontentsline} just before each float's entry. +% \begin{macrocode} +\newcounter{LWR@currentautosecfloatpage} +\setcounter{LWR@currentautosecfloatpage}{1} +% \end{macrocode} +% +% +% \DescribeCounter{LWR@previousautopagelabel} Remembers which autopage label +% was most recently generated. Used to avoid duplicates. +% \begin{macrocode} +\newcounter{LWR@previousautopagelabel} +\setcounter{LWR@previousautopagelabel}{-1} +% \end{macrocode} +% +% +% \begin{macro}{\LWR@newautopagelabel} \marg{pagenumber counter} +% \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} +% \changes{v0.72}{2019/06/05}{Fix: References for \pkg{xr}, \pkg{xr-hyper}.} +% \changes{v0.896}{2021/03/26}{Fix: Refs if page changed.} +% +% \cs{BaseJobname} is added to the label in case \pkg{xr} or \pkg{xr-hyper} are used. +% \begin{macrocode} +\newcommand*{\LWR@newautopagelabel}[1]{% +% \end{macrocode} +% +% No action if this autopage label has already been defined: +% \begin{macrocode} +\ifnumequal{\value{LWR@previousautopagelabel}}{\value{page}}% + {}% +% \end{macrocode} +% +% If the \PDF\ page has changed, create a label using the desired counter. +% +% If the counter is \ctr{LWR@currentautosecpage}, that was the page number +% when the section generation began, +% but the current \PDF\ page may be different by now +% if the section name had an \SVG\ image, such as \SVG\ math. +% To allow the cross-reference to point just after the section heading, the +% label must be made after the section heading is complete, which may have +% generated a new \PDF\ page. +% Thus, the label is made with the given counter, which may be the \PDF\ page +% number where the section heading began, +% then if the \PDF\ page number has changed, +% another label is made for the current page number. +% \begin{macrocode} + {% + \label{\BaseJobname-autopage-\csuse{the#1}}% +% \end{macrocode} +% +% If there are intervening pages, such as an \SVG\ image, +% define another label for the new page: +% \begin{macrocode} + \ifnumequal{\value{#1}}{\value{page}}% + {}% + {\label{\BaseJobname-autopage-\csuse{thepage}}}% +% \end{macrocode} +% +% Remember the latest autopage label: +% \begin{macrocode} + \setcounter{LWR@previousautopagelabel}{\value{page}}% + }% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@null@newautopagelabel} \marg{pagenumber counter} +% \changes{v0.896}{2021/04/04}{Fix: Refs in footnotes.} +% +% Inside a footnote, the page numbers will be incorrect, +% so this is nullified. +% \begin{macrocode} +\newcommand*{\LWR@null@newautopagelabel}[1]{} +% \end{macrocode} +% \end{macro} + + + + % \section{Splitting \HTML\ files} % % \begin{itemize} @@ -24559,40 +24879,6 @@ end -- not --version % \end{macro} -% \DescribeCounter{LWR@previousautopagelabel} Remembers which autopage label -% was most recently generated. Used to avoid duplicates. -% \begin{macrocode} -\newcounter{LWR@previousautopagelabel} -\setcounter{LWR@previousautopagelabel}{-1} -% \end{macrocode} - - -% \DescribeFile{*_html.aux} -% A new entry in the \filenm{*_html.aux} file is used to help -% cross-references: -% \begin{sourceverb} -% \newlabel{autopage-<nnn>}{{<x>}{<y>}} -% \end{sourceverb} -% -% \begin{macro}{\LWR@newautopagelabel} \marg{pagenumber counter} -% \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} -% \changes{v0.72}{2019/06/05}{Fix: References for \pkg{xr}, \pkg{xr-hyper}.} -% -% \cs{BaseJobname} is added to the label in case \pkg{xr} or \pkg{xr-hyper} are used. -% \begin{macrocode} -\newcommand*{\LWR@newautopagelabel}[1]{% -\ifnumequal{\value{LWR@previousautopagelabel}}{\value{page}}% -{}% no action if this autopage label has already been defined -{% - \label{\BaseJobname-autopage-\arabic{#1}}% - \setcounter{LWR@previousautopagelabel}{\value{page}} -}% -} -% \end{macrocode} -% \end{macro} - - - % \subsection{Sanitizing expressions for \HTML} % Math expressions are converted to |lateximage|s, @@ -25119,9 +25405,10 @@ end -- not --version % At the bottom of the ending file: % % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} +% \changes{v0.896}{2021/03/04}{Added \element{main}.} % \begin{macrocode} \LWR@htmlelementclassend{section}{textbody} -\LWR@htmlelementclassend{div}{bodycontainer} +\LWR@htmlelementclassend{main}{bodycontainer} \LWR@htmlelementclassend{div}{bodyandsidetoc} \LWR@printpendingfootnotes @@ -25250,11 +25537,12 @@ end -- not --version % \end{macrocode} % -% Track the \PDF\ page numbers of the \HTML\ output: +% Track the \PDF\ page numbers of the \HTML\ output. +% This is updated more frequently than \ctr{LWR@currentautosecpage}. % \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} % \begin{macrocode} -\setcounter{LWR@latestautopage}{\value{page}}% -\LWR@newautopagelabel{LWR@latestautopage}% +\setcounter{LWR@currentautosecfloatpage}{\value{page}}% +\LWR@newautopagelabel{LWR@currentautosecfloatpage}% % \end{macrocode} % % @@ -25305,8 +25593,9 @@ end -- not --version % Start of the \element{textbody}: % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} % \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \changes{v0.896}{2021/03/04}{Added \element{main}.} % \begin{macrocode} -\LWR@htmlelementclass{div}{bodycontainer} +\LWR@htmlelementclass{main}{bodycontainer} \LWR@htmlelementclass{section}{textbody} % \end{macrocode} % @@ -25664,20 +25953,6 @@ end -- not --version % \end{macro} % % -% \DescribeCounter{LWR@currentautosec} Records the page number when the section -% was created. (If a math expression is included in the section name, -% and \SVG\ math is used, the corresponding \env{lateximage} will cause the -% page number to change by the time the following autosec label is created, -% thus the initial page number is recorded here.) -% \changes{v0.43}{2017/11/01}{\ctr{LWR@currentautosec}: Added.} -% \changes{v0.66}{2019/01/28}{\ctr{LWR@currentautosec}: Fix for \LOF, \LOT float in home page.} -% \begin{macrocode} -\newcounter{LWR@currentautosec} -\setcounter{LWR@currentautosec}{1} -% \end{macrocode} -% -% -% % \begin{macro}{\LWR@section} * \oarg{TOC name} \marg{name} \marg{sectiontype} % % \changes{v0.20}{2017/01/09}{Combined higher-level sections together into files.} @@ -25819,7 +26094,7 @@ end -- not --version % \end{macrocode} % \changes{v0.43}{2017/11/01}{Fix: Math in section name.} % \begin{macrocode} -\setcounter{LWR@currentautosec}{\value{page}}% +\setcounter{LWR@currentautosecpage}{\value{page}}% % \end{macrocode} % % Check if starred: @@ -25960,6 +26235,12 @@ end -- not --version % Generate a \LaTeX{} label. % % Track the \PDF\ page numbers of the \HTML\ output. +% A new autopage label may be generated for \ctr{LWR@currentautosecpage} +% for the start of the section, +% and also for the current page if it is different due to an \SVG\ image +% in the section name. +% Also, the final page after the section has been created is updated +% in \ctr{LWR@currentautosecfloatpage}. % % \changes{v0.43}{2017/11/01}{Fix: Math in section name.} % \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} @@ -25967,8 +26248,8 @@ end -- not --version % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \begin{macrocode} \LWR@traceinfo{LWR@section: about to create the LaTeX label}% -\setcounter{LWR@latestautopage}{\value{page}}% -\LWR@newautopagelabel{LWR@currentautosec}\LWR@orignewline% +\setcounter{LWR@currentautosecfloatpage}{\value{page}}% +\LWR@newautopagelabel{LWR@currentautosecpage}\LWR@orignewline% % \end{macrocode} % % If this is the first section found in this file, @@ -26665,9 +26946,10 @@ end -- not --version }% % \end{macrocode} % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} +% \changes{v0.896}{2021/03/04}{Added \element{main}.} % \begin{macrocode} \LWR@htmlelementclass{div}{bodywithoutsidetoc} -\LWR@htmlelementclass{div}{bodycontainer} +\LWR@htmlelementclass{main}{bodycontainer} \LWR@traceinfo{LWR@lwarpStart: Generating textbody.} \LWR@htmlelementclass{section}{textbody} % \end{macrocode} @@ -26732,11 +27014,17 @@ end -- not --version % ^^A % \end{macrocode} % % -% First autopage label in case a figure occurs early. +% First autopage label in case a figure occurs early before the first section: +% A new autopage label may be generated for \ctr{LWR@currentautosecpage} +% for the start of the section, +% and also for the current page if it is different due to an \SVG\ image +% in the section name. +% Also, the final page after the section has been created is updated +% in \ctr{LWR@currentautosecfloatpage}. % \changes{v0.66}{2019/01/28}{Fix: \TOC, \LOF, \LOT\ links.} % \begin{macrocode} -\setcounter{LWR@latestautopage}{\value{page}}% -\LWR@newautopagelabel{LWR@currentautosec}% +\setcounter{LWR@currentautosecfloatpage}{\value{page}}% +\LWR@newautopagelabel{LWR@currentautosecpage}% % \end{macrocode} % % \begin{macrocode} @@ -26790,20 +27078,23 @@ end -- not --version \LWR@closeprevious{finished} % \end{macrocode} % At the bottom of the ending file: - +% +% Print any pending footnotes: +% \changes{v0.896}{2021/03/14}{Fix: Footnotes at end of document.} +% \begin{macrocode} +\LWR@printpendingfootnotes +% \end{macrocode} +% % Close the textbody: % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} % \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \changes{v0.896}{2021/03/04}{Added \element{main}.} % \begin{macrocode} \label{\BaseJobname-autofile-last} \LWR@htmlelementclassend{section}{textbody} -\LWR@htmlelementclassend{div}{bodycontainer} +\LWR@htmlelementclassend{main}{bodycontainer} \LWR@htmlelementclassend{div}{bodyandsidetoc} % \end{macrocode} -% Print any pending footnotes: -% \begin{macrocode} -\LWR@printpendingfootnotes -% \end{macrocode} % % Create the footer if not \EPUB\: % \changes{v0.84}{2020/04/24}{Fix: No footer for \EPUB} @@ -27360,7 +27651,9 @@ end -- not --version % % \begin{macrocode} \LWR@setfootnoteseries% -\def\@makefnmark{\textsuperscript{\thefootnote}} +\def\@makefnmark{% + \textsuperscript{\thefootnote}% +} % \end{macrocode} % % \begin{center} @@ -28107,6 +28400,12 @@ end -- not --version % \begin{macrocode} \renewcommand{\@begintheorem}[2]{% \LWR@forcenewpage +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \BlockClass{theoremcontents} \trivlist \item[\InlineClass{theoremlabel}{#1\ #2\ }]\itshape @@ -28137,6 +28436,12 @@ end -- not --version % \begin{macrocode} \renewcommand*{\@endtheorem}{% \endtrivlist +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \endBlockClass% theoremcontents } % \end{macrocode} @@ -28260,7 +28565,7 @@ end -- not --version % \changes{v0.48}{2018/02/02}{Honors \cs{makelabel}.} % \begin{macrocode} \def\LWR@HTML@item[#1]{% -\LWR@traceinfo{@item} +\LWR@traceinfo{@item}% \if@noparitem \@donoparitem \else @@ -28517,12 +28822,55 @@ end -- not --version % \end{macro} % \begin{environment}{description} \oarg{options} +% +% Footnotes are modified to correctly parse optional arguments. +% \changes{v0.896}{2021/03/14}{Fix: Footnotes inside \env{description} label.} % \begin{macrocode} \newcommand*{\LWR@descriptionstart}{% -\renewcommand*{\LWR@printcloselist}{\LWR@printclosedescription} -\renewcommand*{\LWR@printopenlist}{dl} -\let\item\LWR@descitem% -\LWR@nulllistfills% + \renewcommand*{\LWR@printcloselist}{\LWR@printclosedescription} + \renewcommand*{\LWR@printopenlist}{dl} + \let\item\LWR@descitem% + \LWR@nulllistfills% +% \end{macrocode} +% +% Footnotes are redefined to process optional arguments inside the \env{description} +% label. +% A \cs{footnote} is dropped, as it is in print mode. +% Using the optional arguments does not work in print mode, +% but for some reason they must be accepted as done here to work correctly +% even without the optional arguments. +% \begin{macrocode} + \renewcommand{\footnote}[2][]{% + \ifblank{##1}% + {% + \stepcounter\@mpfn + \protected@xdef\@thefnmark{\thempfn}% + \@footnotemark%\@footnotetext + }% + {% + \begingroup + \csname c@\@mpfn\endcsname ##1\relax + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup + \@footnotemark%\@footnotetext + }% + }% + % + \renewcommand{\footnotemark}[1][]{% + \ifblank{##1}% + {% + \stepcounter{footnote}% + \protected@xdef\@thefnmark{\thefootnote}% + \@footnotemark% + }% + {% + \begingroup% + \c@footnote ##1\relax% + \unrestored@protected@xdef\@thefnmark{\thefootnote}% + \endgroup% + \@footnotemark% + }% + }% } % \end{macrocode} % \end{environment} @@ -29416,7 +29764,8 @@ end -- not --version \LWR@setexparray{LWR@colatspec}% {\arabic{LWR@tabletotalLaTeXcols}}% {\expandafter\@firstofone\LWR@colparameter}% - \LWR@traceinfo{at \arabic{LWR@tabletotalLaTeXcols}: % + \LWR@traceinfo{at \arabic{LWR@tabletotalLaTeXcols}% + : % space \LWR@getexparray{LWR@colatspec}{\arabic{LWR@tabletotalLaTeXcols}}}% }% \let\LWR@colparameter\relax% @@ -32690,7 +33039,8 @@ end -- not --version % \item [\cs{newlabel}:] Unchanged. When the |.aux| file is read, sets \cs{r@<label>@lwarp}. % \item [\cs{r@<label>@lwarp}:] Set to |{{section_name}{file_name}{depth}{number}}|: % \begin{description} -% \item [\cs{LWR@nameref}:] The section name for this label. +% \item [\cs{LWR@nameref}:] The section or object name for this label. +% \item [\cs{LWR@currentautosecpageref}:] The \ctr{LWR@currentautosecpage} for this label. % \item [\cs{LWR@htmlfileref}:] The filenumber or name for this label. % \item [\cs{LWR@lateximagedepthref}:] The |lateximagedepth| for this label. % \item [\cs{LWR@lateximagenumberref}:] The |lateximagenumber| for this label. @@ -32830,7 +33180,18 @@ end -- not --version % \changes{v0.66}{2019/01/27}{No longer use \pkg{zref}.} % \begin{macrocode} \newcommand*{\LWR@nameref}[1]{% - \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@firstoffour{#1}% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@firstoffive{#1}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@currentautosecpageref} \marg{label} +% Returns the \ctr{LWR@currentautosecpage} for this label: +% \changes{v0.896}{2021/04/05}{Added.} +% \begin{macrocode} +\newcommand*{\LWR@currentautosecpageref}[1]{% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@secondoffive{#1}% } % \end{macrocode} % \end{macro} @@ -32842,7 +33203,7 @@ end -- not --version % \changes{v0.66}{2019/01/27}{No longer use \pkg{zref}.} % \begin{macrocode} \newcommand*{\LWR@htmlfileref}[1]{% - \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@secondoffour{#1}% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@thirdoffive{#1}% } % \end{macrocode} % \end{macro} @@ -32853,7 +33214,7 @@ end -- not --version % \changes{v0.66}{2019/01/27}{No longer use \pkg{zref}.} % \begin{macrocode} \newcommand*{\LWR@lateximagedepthref}[1]{% - \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@thirdoffour{#1}% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@fourthoffive{#1}% } % \end{macrocode} % \end{macro} @@ -32865,7 +33226,7 @@ end -- not --version % \changes{v0.66}{2019/01/27}{No longer use \pkg{zref}.} % \begin{macrocode} \newcommand*{\LWR@lateximagenumberref}[1]{% - \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@fourthoffour{#1}% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@fifthoffive{#1}% } % \end{macrocode} % \end{macro} @@ -32874,6 +33235,7 @@ end -- not --version % \begin{macro}{\LWR@write@lwarplabel} \marg{label} % Sanitize the name and then creates the label: % \changes{v0.66}{2019/01/27}{No longer use \pkg{zref}.} +% \changes{v0.896}{2021/04/05}{Added \cs{LWR@currentautosecpage}.} % \begin{macrocode} \newcommand*{\LWR@write@lwarplabel}[1]{% \LWR@traceinfo{LWR@write@lwarplabel !#1!}% @@ -32883,6 +33245,7 @@ end -- not --version {% \string\newlabel{#1@lwarp}{% {\@currentlabelname}% + {\theLWR@currentautosecpage}% {% \ifbool{FileSectionNames}% {\LWR@thisfilename}% @@ -33017,8 +33380,9 @@ end -- not --version % and also patches \pkg{memoir}. % % \changes{v0.84}{2020/04/05}{Removed optional args.} +% \changes{v0.896}{2021/04/08}{Revert to a simple \cs{newcommand*}.} % \begin{macrocode} -\NewDocumentCommand{\LWR@new@label}{m}{% +\newcommand*{\LWR@new@label}[1]{% \LWR@traceinfo{LWR@new@label: starting}% \LWR@traceinfo{LWR@new@label: !#1!}% % \@bsphack% @@ -33027,7 +33391,7 @@ end -- not --version % \begin{macrocode} \LWR@orig@label{#1}% % \end{macrocode} -% Create a special label which holds the section number, +% Create a special label which holds the section number, section name, % |LWR@htmlfilenumber|, |LWR@lateximagedepth|, and |LWR@lateximagenumber|: % \begin{macrocode} \LWR@traceinfo{% @@ -33190,6 +33554,24 @@ end -- not --version \LWR@formatted{ref} % \end{macrocode} % +% +% \begin{macro}{\LWR@refwithsection} +% \changes{v0.896}{2021/04/21}{Added.} +% \begin{macrocode} +\NewDocumentCommand{\LWR@refwithsection}{s m}{% + \LWR@traceinfo{LWR@refwithsection !#2!}% + \IfBooleanTF{#1}% + {\LWR@print@ref{\BaseJobname-autopage-\LWR@currentautosecpageref{#2}}}% + {% + \LWR@startref{#2}% + \LWR@print@ref{\BaseJobname-autopage-\LWR@currentautosecpageref{#2}}% + \LWR@htmltag{/a}% + }% +} +% \end{macrocode} +% \end{macro} +% +% % For \brand{MathJax}: % \changes{v0.88}{2020/07/05}{Added \brand{MathJax}.} % \begin{macrocode} @@ -33280,9 +33662,10 @@ end -- not --version % \begin{macro}{\@currentHref} Added to support \pkg{backref}. % \changes{v0.45}{2018/01/14}{Added.} % \changes{v0.84}{2020/04/07}{\pkg{backref}: Fixed from \pkg{lwarp} v0.72 changes.} +% \changes{v0.896}{2021/04/05}{\pkg{backref}: Improved back refs.} % \begin{macrocode} \AtBeginDocument{ - \def\@currentHref{\BaseJobname-autopage-\theLWR@currentautosec} + \def\@currentHref{\BaseJobname-autopage-\theLWR@previousautopagelabel}% } % \end{macrocode} % \end{macro} @@ -33471,8 +33854,8 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@subinlineimage} \marg{\element{alt} tag} \marg{class} -% \marg{filename} \marg{extension} \marg{CSS style} +% \begin{macro}{\LWR@subinlineimage} \marg{1: \element{alt} tag} \marg{2: class} +% \marg{3: filename} \marg{4: extension} \marg{5: \CSS\ style} \marg{6: \ARIA\ role} % % Factored from \env{lateximage}. % @@ -33480,13 +33863,18 @@ end -- not --version % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} % \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} -\newcommand*{\LWR@subinlineimage}[5]{% +\newcommand*{\LWR@subinlineimage}[6]{% + \ifblank{#6}% + {\renewcommand*{\LWR@tempone}{}} + {\renewcommand*{\LWR@tempone}{role="#6"\LWR@indentHTML}} \ifblank{#1}% {% \LWR@htmltag{img \LWR@indentHTML src=\textquotedbl#3.#4\textquotedbl \LWR@indentHTML alt=\textquotedbl#3\textquotedbl \LWR@indentHTML + \LWR@tempone style=\textquotedbl#5\textquotedbl \LWR@indentHTML class=\textquotedbl#2\textquotedbl \LWR@orignewline }% @@ -33495,6 +33883,7 @@ end -- not --version \LWR@htmltag{img \LWR@indentHTML src=\textquotedbl#3.#4\textquotedbl \LWR@indentHTML alt=\textquotedbl#1\textquotedbl \LWR@indentHTML + \LWR@tempone style=\textquotedbl#5\textquotedbl \LWR@indentHTML class=\textquotedbl#2\textquotedbl \LWR@orignewline }% @@ -33899,20 +34288,20 @@ end -- not --version % When a new \HTML\ file is marked in the \LaTeX\ \PDF\ file, % or at the start of a new section, -% the \LaTeX\ page number at that point is stored in |LWR@latestautopage|, +% the \LaTeX\ \PDF\ page number at that point is stored in \ctr{LWR@currentautosecfloatpage}, % (and the associated filename is remembered by the special \LaTeX\ labels). % This page number is used to generate an |autopage| \HTML\ \element{id} % in the \HTML\ output at the start of the new \HTML\ file or section. % Meanwhile, there is a float counter used to generate an \HTML\ |autoid| % \element{id} at the start of the float itself in the \HTML\ file. % The |autopage| and |autoid| values to use for each float are written to the -% |.lof|, etc. files just before each float's entry. These values are used +% \filenm{.lof}, etc. files just before each float's entry. These values are used % by \cs{l@figure}, etc. to create the \HTML\ links in the List of Figures, etc. % % \DescribeCounter{LWR@nextautoid} Tracks |autoid| for floats. % \DescribeCounter{LWR@nextautopage} Tracks |autopage| for floats. % -% These are updated per float as the |.lof|, |.lot| file is read. +% These are updated per float as the \filenm{.lof}, \filenm{.lot} file is read. % \begin{macrocode} \newcounter{LWR@nextautoid} \newcounter{LWR@nextautopage} @@ -33938,16 +34327,6 @@ end -- not --version % \end{macro} -% \DescribeCounter{LWR@latestautopage} -% The \HTML\ output's \PDF\ page number at the start of a new \HTML\ file or section. -% -% \cs{LWRsetnextfloat} is written with this and the |autoid| -% by the modified \cs{addcontentsline} just before each float's entry. -% \begin{macrocode} -\newcounter{LWR@latestautopage} -\setcounter{LWR@latestautopage}{1} -% \end{macrocode} - % \begin{environment}{LWR@figcaption} % @@ -33963,7 +34342,6 @@ end -- not --version {% \ifbool{FormatWP}{% \BlockClass[font-style:italic]{figurecaption}% -% \LWR@print@vspace*{\baselineskip} }{% \BlockClass{figurecaption}% }% @@ -34087,7 +34465,7 @@ end -- not --version % \begin{macro}{\addcontentsline} % Patched to write the |autopage| and |autoid| before each float's entry. -% No changes if writing |.toc| +% No changes if writing \filenm{.toc} % For a theorem, automatically defines \cs{ext@<type>} as needed, to % mimic and reuse the float mechanism. % @@ -34113,7 +34491,7 @@ end -- not --version % \begin{macrocode} \addtocontents{\@nameuse{ext@#2}}{% \protect\LWRsetnextfloat% - {\arabic{LWR@latestautopage}}% + {\arabic{LWR@currentautosecfloatpage}}% {\arabic{LWR@thisautoid}}% }% }% not TOC @@ -34156,7 +34534,7 @@ end -- not --version % % This section controls the generation of the \TOC, \LOF, and \LOT. % -% The |.toc|, |.lof|, and |.lot| files are named by the source code \cs{jobname}. +% The \filenm{.toc}, \filenm{.lof}, and \filenm{.lot} files are named by the source code \cs{jobname}. % % In \HTML, the printed tables are placed inside a \element{div} % of class \attribute{toc}, \attribute{lof}, or \attribute{lot}. @@ -34308,8 +34686,8 @@ end -- not --version } { % \end{macrocode} -% Copy the |.toc| file to |.sidetoc| for printing the side\TOC. -% The original |.toc| file is renewed when \cs{tableofcontents} is finished. +% Copy the \filenm{.toc} file to |.sidetoc| for printing the side\TOC. +% The original \filenm{.toc} file is renewed when \cs{tableofcontents} is finished. % \begin{macrocode} \ifbool{LWR@copiedsidetoc}{}{% \LWR@copyfile{\jobname.toc}{\jobname.sidetoc}% @@ -34498,7 +34876,7 @@ end -- not --version % \begin{macro}{\numberline} \marg{number} % -% (Called from each line in the |.aux|, |.lof| files.) +% (Called from each line in the |.aux|, \filenm{.lof} files.) % % Record this section number for further use: % @@ -34906,7 +35284,7 @@ end -- not --version % \begin{macro}{\@wrglossary} \marg{term} \qquad -% Redefined to write the |LWR@latestautopage| counter instead of |page|. +% Redefined to write the |LWR@autoglossary| counter instead of |page|. % \begin{macrocode} \def\@wrglossary#1{% \addtocounter{LWR@autoglossary}{1}% @@ -35704,9 +36082,11 @@ end -- not --version % \begin{macrocode} \RenewDocumentCommand{\hspace}{s m}{}% % \end{macrocode} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} +% \changes{v0.896}{2021/03/15}{Added groups.} % \begin{macrocode} - \RenewDocumentCommand{\LWR@htmlspanclass}{o m +m}{##3}% - \DeclareExpandableDocumentCommand{\InlineClass}{D{(}{)}{} o m +m}{##4}% + \RenewDocumentCommand{\LWR@htmlspanclass}{o D(){} m +m}{{##4}}% + \DeclareExpandableDocumentCommand{\InlineClass}{D{(}{)}{} o m +m}{{##4}}% % \end{macrocode} % Nullify math macros. % \changes{v0.55}{2018/04/24}{Removed extraneous space which appeared in file links.} @@ -36113,7 +36493,7 @@ end -- not --version % Temporarily disable formatting while measuring the image parameters: % \begin{macrocode} \LWR@restoreorigformatting% - \RenewDocumentEnvironment{lateximage}{s o s o o}{}{}% inside group + \RenewDocumentEnvironment{lateximage}{s o s o o d()}{}{}% inside group \LWR@print@normalsize% % \end{macrocode} % Temporarily set font for the \HTML\ \PDF\ output: @@ -36297,6 +36677,7 @@ end -- not --version % \changes{v0.50}{2018/02/22}{MD5 hash avoids duplicate \SVG\ math.} % \changes{v0.57}{2018/05/23}{Fix: Dynamic inline math expressions.} % \changes{v0.74}{2019/08/20}{Adds star argument for \env{lateximage}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \ifbool{LWR@dynamicmath}{% \LWR@traceinfo{subsingledollar: dynamic}% @@ -36304,6 +36685,7 @@ end -- not --version [\MathImageAltText]% alt tag []% no add'l hashing [\LWR@singledollarstyle \LWR@singledollardepthstyle]% CSS + (math)% ARIA }{% not dynamic math \LWR@traceinfo{subsingledollar: static}% \IfValueTF{#1}{% #1 True @@ -36330,11 +36712,13 @@ end -- not --version FB\LWR@tempone% xfakebold ]% [\LWR@singledollarstyle \LWR@singledollardepthstyle]% CSS + (math)% ARIA }{% #1 False \begin{lateximage}% no hashing [#2]% alt []% no add'l hashing [\LWR@singledollarstyle \LWR@singledollardepthstyle]% CSS + (math)% ARIA }% }% not dynamic math % \end{macrocode} @@ -36498,7 +36882,7 @@ end -- not --version \LetLtxMacro\LWR@origopenbracket\[ \LetLtxMacro\LWR@origclosebracket\] % \end{macrocode} - +% % \DescribeObject{\$} % \DescribeObject{\$\$} % Redefine the dollar sign to place math inside a \env{lateximage}, @@ -36532,12 +36916,31 @@ end -- not --version % For \brand{MathJax}, print the math between |\[| and |\]|: % \changes{v0.42}{2017/10/16}{Improved line spacing with mathjax.} % \changes{v0.89}{2020/08/01}{TT font for \brand{MathJax}.} +% \changes{v0.896}{2021/04/07}{Fix: Displaymath notes with \brand{MathJax}.} % \begin{macrocode} { - \textbackslash[% - {\LWR@print@ttfamily\LWR@HTMLsanitize{#1}}% - \textbackslash] + \IfSubStr{\detokenize\expandafter{#1}}{\detokenize{note}}{% +% \end{macrocode} +% +% The equation is printed to the \PDF\ output inside \HTML\ comment tags. +% This allows labels and footnotes to be accepted and processed. +% The \env{math} environment is selected here, and \cs{LWR@hidelatexequation} +% will use the original print-mode meaning of \env{math}. +% \begin{macrocode} + \LWR@hidelatexequation{math}{#1}% +% \end{macrocode} +% \begin{macrocode} + \InlineClass{hidden}{\LWR@syncnotenumbers}% + \textbackslash[% + {\LWR@print@ttfamily\LWR@HTMLsanitize{#1}}% + \textbackslash] + \InlineClass{hidden}{\LWR@syncnotenames}% + }{% + \textbackslash[% + {\LWR@print@ttfamily\LWR@HTMLsanitize{#1}}% + \textbackslash] + }% }% mathjax % \end{macrocode} @@ -36546,6 +36949,7 @@ end -- not --version % \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} % \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \changes{v0.51}{2018/03/11}{Fix: \cs{addcontentsline} inside \SVG\ math. Provides an autoid anchor.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} {% not mathjax \begin{BlockClass}{displaymath}% @@ -36558,6 +36962,7 @@ end -- not --version \textbackslash{]}% ]% *% do not add open/closing braces + (math)% ARIA % \end{macrocode} % Support for \pkg{xfakebold}: % \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} @@ -36697,11 +37102,13 @@ end -- not --version % \begin{macrocode} \let\LWR@orig@math\math \let\LWR@orig@endmath\endmath + \let\LWR@orig@displaymath\displaymath \let\LWR@orig@enddisplaymath\enddisplaymath \let\math\relax \let\endmath\relax + \let\displaymath\relax \let\enddisplaymath\relax % \end{macrocode} @@ -36740,14 +37147,14 @@ end -- not --version % but does not supply \brand{MathJax} or \HTML\ \attribute{alt} tags. % \changes{v0.51}{2018/03/21}{Processing for complicated display math.} % \changes{v0.74}{2019/08/07}{Uses \cs{MathImageAltText}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \newenvironment{LWR@displaymathother} {% \begin{BlockClass}{displaymath}% \LWR@newautoidanchor% \booltrue{LWR@indisplaymathimage}% - \begin{lateximage}% - [\MathImageAltText]% + \begin{lateximage}[\MathImageAltText](math)% [alt](ARIA) \LWR@origdollar\LWR@origdollar% } {% @@ -36764,17 +37171,18 @@ end -- not --version % but does not supply \brand{MathJax} or \HTML\ \attribute{alt} tags. % \changes{v0.51}{2018/03/21}{Processing for complicated display math.} % \changes{v0.74}{2019/08/07}{Uses \cs{MathImageAltText}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \newenvironment{LWR@equationother} {% \begin{BlockClass}{displaymathnumbered}% \LWR@newautoidanchor% \booltrue{LWR@indisplaymathimage}% - \begin{lateximage}[\MathImageAltText]% - \LWR@origequation% + \begin{lateximage}[\MathImageAltText](math)% [alt](ARIA) + \LWR@orig@equation% } {% - \LWR@origendequation% + \LWR@orig@endequation% \end{lateximage}% \end{BlockClass}% } @@ -36895,7 +37303,7 @@ end -- not --version % Start the \LaTeX\ math environment inside the \HTML\ comment: % \begin{macrocode} \begingroup - \@nameuse{LWR@orig#1} + \@nameuse{LWR@orig@#1} % \end{macrocode} % While in the math environment, % restore various commands to their \LaTeX\ meanings. @@ -36914,7 +37322,7 @@ end -- not --version % \end{macrocode} % End the \LaTeX{} math environment inside the \HTML\ comment: % \begin{macrocode} - \@nameuse{LWR@origend#1} + \@nameuse{LWR@orig@end#1} \endgroup % \end{macrocode} @@ -36965,10 +37373,10 @@ end -- not --version % after redefined by \pkg{amsmath}, if loaded. % \begin{macrocode} \AtBeginDocument{ - \let\LWR@origequation\equation - \let\LWR@origendequation\endequation - \csletcs{LWR@origequation*}{equation*} - \csletcs{LWR@origendequation*}{endequation*} + \let\LWR@orig@equation\equation + \let\LWR@orig@endequation\endequation + \csletcs{LWR@orig@equation*}{equation*} + \csletcs{LWR@orig@endequation*}{endequation*} } % \end{macrocode} % @@ -37023,6 +37431,7 @@ end -- not --version % \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \changes{v0.51}{2018/03/11}{Fix: \cs{addcontentsline} inside \SVG\ math. Provides an autoid anchor.} % \changes{v0.52}{2018/03/31}{Fix: \env{equation*} now based on \env{equation} instead of \env{displaymath}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \ifstrequal{#2}{equation*}{% \begin{BlockClass}{displaymath}% @@ -37044,7 +37453,7 @@ end -- not --version \textbackslash{begin\{#2\}} % extra space \LWR@HTMLsanitizeexpand{\detokenize\expandafter{#1}} % extra space \textbackslash{end\{#2\}}% - ]*% alt tag + ]*(math)% alt tag, ARIA % \end{macrocode} % Support for \pkg{xfakebold}: % \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} @@ -37054,9 +37463,9 @@ end -- not --version % Create the actual \LaTeX-formatted equation inside % the |lateximage| using the contents of the environment. % \begin{macrocode} - \@nameuse{LWR@orig#2}% + \@nameuse{LWR@orig@#2}% #1% contents collected by \collect@body - \@nameuse{LWR@origend#2}% + \@nameuse{LWR@orig@end#2}% \end{lateximage}% \end{BlockClass}% }% not mathjax @@ -37124,10 +37533,11 @@ end -- not --version % \begin{macro}{\LWR@synconenotename} \marg{\brand{MathJax} variable} \marg{text} +% \changes{v0.896}{2021/04/07}{Fix: \brand{MathJax}: Footnote names.} % \begin{macrocode} \newcommand*{\LWR@synconenotename}[2]{% \textbackslash( - \textbackslash{}def\textbackslash{}#1\{#2\} + \textbackslash{}def\textbackslash{}#1name\{#2\} \textbackslash) } % \end{macrocode} @@ -37417,7 +37827,7 @@ end -- not --version \LWR@newautoidanchor% \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[(\LWR@startingequationtag\textendash\LWR@equationtag)% - \LWR@addmathjax{eqnarray}{\BODY}]*% + \LWR@addmathjax{eqnarray}{\BODY}]*(math)% % \end{macrocode} % Support for \pkg{xfakebold}: % \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} @@ -37441,7 +37851,7 @@ end -- not --version \begin{BlockClass}{displaymath}% \LWR@newautoidanchor% \booltrue{LWR@indisplaymathimage}% - \begin{lateximage}[\LWR@addmathjax{eqnarray*}{\BODY}]*% + \begin{lateximage}[\LWR@addmathjax{eqnarray*}{\BODY}]*(math)% % \end{macrocode} % Support for \pkg{xfakebold}: % \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} @@ -37755,19 +38165,21 @@ end -- not --version % \begin{macro}{\LWR@lateximage@oneimageb} \marg{1: alt text} \marg{2: filename} -% \marg{3: CSS style} +% \marg{3: \CSS\ style} +% \marg{4: \ARIA\ role} % Creates the image for the \env{lateximage}. % % \changes{v0.74}{2019/08/26}{Factored from \env{lateximage}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} -\newcommand{\LWR@lateximage@oneimageb}[3]{% +\newcommand{\LWR@lateximage@oneimageb}[4]{% \LWR@subinlineimage{#1}{lateximage}% {% \LWR@print@mbox{% \LWR@ImagesDirectory\OSPathSymbol% #2% }% - }{svg}{#3}% + }{svg}{#3}{#4}% } % \end{macrocode} % \end{macro} @@ -37775,25 +38187,27 @@ end -- not --version % \begin{macro}{\LWR@lateximage@oneimage} \marg{1: alt text} \marg{2: filename} % \marg{3: \CSS\ style} \marg{4: delimit?} +% \marg{5: \ARIA\ role} % % Creates an image for the \env{lateximage}, % whose \attribute{alt} text depends on the circumstances. % % \changes{v0.74}{2019/08/26}{Factored from \env{lateximage}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} -\newcommand{\LWR@lateximage@oneimage}[4]{% +\newcommand{\LWR@lateximage@oneimage}[5]{% \ifdefvoid{\LWR@ThisAltText}{% \IfBooleanTF{#4}{% - \LWR@lateximage@oneimageb{#1}{#2}{#3}% + \LWR@lateximage@oneimageb{#1}{#2}{#3}{#5}% }{% \LWR@lateximage@oneimageb% {\AltTextOpen#1\AltTextClose}% - {#2}{#3}% + {#2}{#3}{#5}% }% }{% \LWR@lateximage@oneimageb% {\AltTextOpen\LWR@ThisAltText\AltTextClose}% - {#2}{#3}% + {#2}{#3}{#5}% }% } % \end{macrocode} @@ -37802,6 +38216,7 @@ end -- not --version % \begin{environment}{lateximage} * \oarg{2: \element{alt} tag} * % \oarg{4: add'l hashing} \oarg{5: \CSS\ style} +% \parg{6: \ARIA\ role} % % Typesets the contents and then renders the result as an \SVG\ file. % Star \#1 causes the image to be hashed for reuse. @@ -37843,11 +38258,12 @@ end -- not --version % \changes{v0.51}{2018/03/07}{Added additional hashing option.} % \changes{v0.66}{2019/01/27}{Added \cs{BaseJobname} for multiple projects.} % \changes{v0.74}{2019/08/20}{Added second starred argument.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \begin{macrocode} \catcode`\$=\active% -\NewDocumentEnvironment{lateximage}{s O{\ImageAltText} s O{} O{}} +\NewDocumentEnvironment{lateximage}{s O{\ImageAltText} s O{} O{} D(){}}% {% \LWR@traceinfo{lateximage: starting on \jobname.pdf page \arabic{page}}% \LWR@traceinfo{lateximage: entering depth is \arabic{LWR@lateximagedepth}}% @@ -38040,10 +38456,10 @@ end -- not --version \ifbool{LWR@indisplaymathimage}{}{% not in display math \LetLtxMacro\[\LWR@origopenbracket% \LetLtxMacro\]\LWR@origclosebracket% - \let\equation\LWR@origequation% - \let\endequation\LWR@origendequation% - \csletcs{equation*}{LWR@origequation*}% - \csletcs{endequation*}{LWR@origendequation*}% + \let\equation\LWR@orig@equation% + \let\endequation\LWR@orig@endequation% + \csletcs{equation*}{LWR@orig@equation*}% + \csletcs{endequation*}{LWR@orig@endequation*}% }% not in display math % \end{macrocode} % @@ -38106,13 +38522,14 @@ end -- not --version % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.50}{2018/02/22}{MD5 hash avoids duplicate \SVG\ math.} % \changes{v0.74}{2019/08/20}{New syntax for \cs{LWR@subinlineimage}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \IfBooleanTF{#1}% starred {% hash - \LWR@lateximage@oneimage{#2}{\LWR@hashedname}{#5}{#3}% + \LWR@lateximage@oneimage{#2}{\LWR@hashedname}{#5}{#3}{#6}% }% hash {% no hash - \LWR@lateximage@oneimage{#2}{\LWR@ImagesName\theLWR@externalfilecnt}{#5}{#3}% + \LWR@lateximage@oneimage{#2}{\LWR@ImagesName\theLWR@externalfilecnt}{#5}{#3}{#6}% }% no hash % \end{macrocode} % @@ -38161,7 +38578,7 @@ end -- not --version % \changes{v0.48}{2018/02/02}{Print mode boxed to natural width.} % \changes{v0.74}{2019/08/20}{Added second starred argument.} % \begin{macrocode} -\NewDocumentEnvironment{lateximage}{s o s o o} +\NewDocumentEnvironment{lateximage}{s o s o o d()} {\begin{varwidth}[b]{\linewidth}} {\end{varwidth}} % \end{macrocode} @@ -38182,17 +38599,20 @@ end -- not --version % \end{macrocode} % \begin{environment}{center} -% Replace \env{center} functionality with \CSS\ tags: +% Replace \env{center} functionality with \CSS\ tags. +% In a \element{span}, these macros are nullified, but extra \% are used +% to remove spurrious spaces here as well. % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} use explicit \attribute{text-align}.} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.84}{2020/04/14}{Added print mode.} +% \changes{v0.896}{2021/04/07}{Spurrious space in a \element{span}.} % \begin{macrocode} \newenvironment*{LWR@HTML@center} -{ - \LWR@forcenewpage - \ifbool{FormatWP} - {\BlockClass[\LWR@print@mbox{text-align:center}]{center}} - {\BlockClass{center}} +{% + \LWR@forcenewpage% + \ifbool{FormatWP}% + {\BlockClass[\LWR@print@mbox{text-align:center}]{center}}% + {\BlockClass{center}}% } {\endBlockClass} @@ -38204,13 +38624,14 @@ end -- not --version % \begin{environment}{flushright} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.84}{2020/04/14}{Added print mode.} +% \changes{v0.896}{2021/04/07}{Spurrious space in a \element{span}.} % \begin{macrocode} \newenvironment*{LWR@HTML@flushright} -{ - \LWR@forcenewpage - \ifbool{FormatWP} - {\BlockClass[\LWR@print@mbox{text-align:right}]{flushright}} - {\BlockClass{flushright}} +{% + \LWR@forcenewpage% + \ifbool{FormatWP}% + {\BlockClass[\LWR@print@mbox{text-align:right}]{flushright}}% + {\BlockClass{flushright}}% } {\endBlockClass} @@ -38221,13 +38642,14 @@ end -- not --version % \begin{environment}{flushleft} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.84}{2020/04/14}{Added print mode.} +% \changes{v0.896}{2021/04/07}{Spurrious space in a \element{span}.} % \begin{macrocode} \newenvironment*{LWR@HTML@flushleft} -{ - \LWR@forcenewpage - \ifbool{FormatWP} - {\BlockClass[\LWR@print@mbox{text-align:left}]{flushleft}} - {\BlockClass{flushleft}} +{% + \LWR@forcenewpage% + \ifbool{FormatWP}% + {\BlockClass[\LWR@print@mbox{text-align:left}]{flushleft}}% + {\BlockClass{flushleft}}% } {\endBlockClass} @@ -38400,9 +38822,8 @@ end -- not --version \LWR@PreloadedPackage{ulem} % \end{macrocode} -% \pkg{xetexko-vertical} may be preloaded by \pkg{xetexko}. % \begin{macrocode} -\LWR@PreloadedPackage{xetexko-vertical} +\LWR@PreloadedPackage{xetexko} % \end{macrocode} % \pkg{geometry} is preloaded by \pkg{lwarp}, and perhaps by various classes. @@ -39157,6 +39578,11 @@ end -- not --version \LWR@print@raggedright% % \end{macrocode} % +% \changes{v0.896}{2021/04/06}{Improved back refs.} +% \begin{macrocode} + \LWR@newautopagelabel{page}% +% \end{macrocode} +% % Set minipage footnotes: % \begin{macrocode} \def\@mpfn{mpfootnote}% @@ -39252,8 +39678,9 @@ end -- not --version % \qquad Nullified for \HTML. % \changes{v0.48}{2018/02/04}{Nullified for \HTML.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} +% \changes{v0.896}{2021/03/15}{Added a group.} % \begin{macrocode} -\newcommand*{\LWR@HTML@mbox}[1]{#1} +\newcommand*{\LWR@HTML@mbox}[1]{{#1}} \LWR@formatted{mbox} % \end{macrocode} @@ -39401,6 +39828,7 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@fboxstyle}{% \LWR@findcurrenttextcolor% +\LWR@traceinfo{LWR@fboxstyle B}% border:\LWR@printlength{\LWR@atleastonept} solid \LWR@origpound\LWR@tempcolor ; % padding:\LWR@printlength{\fboxsep} ; % color:\LWR@origpound\LWR@tempcolor% @@ -39422,10 +39850,12 @@ color:\LWR@origpound\LWR@tempcolor% \newcommand{\LWR@HTML@fbox}[1]{% \LWR@traceinfo{HTML fbox}% \LWR@forceminwidth{\fboxrule}% +\LWR@traceinfo{HTML fbox B}% \InlineClass[% \LWR@print@mbox{display:inline-block} ; % \LWR@fboxstyle% ]{fbox}{#1}% +\LWR@traceinfo{HTML fbox: done}% } % \end{macrocode} % \pkg{xcolor} \cs{let}s things to \cs{fbox} when it is loaded, @@ -40318,7 +40748,7 @@ color:\LWR@origpound\LWR@tempcolor% % \changes{v0.66}{2019/02/04}{Fix: Color if \pkg{xcolor} not loaded.} % \begin{macrocode} \newcommand*{\LWR@findcurrenttextcolor}{% -\renewcommand{\LWR@tempcolor}{000000}% + \renewcommand{\LWR@tempcolor}{000000}% } % \end{macrocode} % \end{macro} @@ -43612,7 +44042,7 @@ color:\LWR@origpound\LWR@tempcolor% \edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#2}}% }% lwarp }% - \@tempa + \@tempa% } % \end{macrocode} @@ -43649,20 +44079,24 @@ color:\LWR@origpound\LWR@tempcolor% % \begin{macrocode} \GetTitleString{#3}% lwarp \let\@currentlabelname\GetTitleStringResult% lwarp + \item[% +% \end{macrocode} +% \changes{v0.896}{2021/04/05}{\pkg{amsthm}: Improved back refs.} +% \begin{macrocode} + \LWR@newautopagelabel{page}% % \end{macrocode} % \begin{macrocode} - \item[ % \deferred@thm@head{ % \the\thm@headfont \thm@indent \@ifempty{#1}{\let\thmname\@gobble}{\LWR@haveamsthmname}% lwarp \@ifempty{#2}{\let\thmnumber\@gobble}{\LWR@haveamsthmnumber}% lwarp \@ifempty{#3}{\let\thmnote\@gobble}{\LWR@haveamsthmnote}% lwarp \thm@swap\swappedhead\thmhead{#1}{#2}{#3}% - \the\thm@headpunct~ + \the\thm@headpunct % space \thmheadnl % possibly a newline. \hskip\thm@headsep % }% - ] + ]% \ignorespaces} % \end{macrocode} % @@ -43673,7 +44107,51 @@ color:\LWR@origpound\LWR@tempcolor% \ifhmode\unskip\unskip\par\fi \normalfont \LWR@forcenewpage% lwarp +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{amsthm}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \BlockClass{amsthmbody\LWR@thisthmstyle}% lwarp +% \end{macrocode} +% +% Footnotes are redefined to work correctly inside the option brackets +% for a theorem environment. +% \changes{v0.896}{2021/03/14}{\pkg{amsthm}: Fix: Footnotes in opt arg..} +% \begin{macrocode} + \renewcommand{\footnote}[1][]{% + \ifblank{##1}% + {% + \stepcounter\@mpfn + \protected@xdef\@thefnmark{\thempfn}% + \@footnotemark\@footnotetext + }% + {% + \begingroup + \csname c@\@mpfn\endcsname ##1\relax + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup + \@footnotemark\@footnotetext + }% + }% +% + \renewcommand{\footnotemark}[1][]{% + \ifblank{##1}% + {% + \stepcounter{footnote}% + \protected@xdef\@thefnmark{\thefootnote}% + \@footnotemark% + }% + {% + \begingroup% + \c@footnote ##1\relax% + \unrestored@protected@xdef\@thefnmark{\thefootnote}% + \endgroup% + \@footnotemark% + }% + }% +% \trivlist \let\thmheadnl\relax \let\thm@swap\@gobble @@ -43690,9 +44168,10 @@ color:\LWR@origpound\LWR@tempcolor% \refstepcounter{#2}% \def\@tempa{\@oparg{\@begintheorem{#3}{\csname the#2\endcsname}}[]}% \fi - \@tempa + \@tempa% } % \end{macrocode} +% % \pkg{cleveref} patches \cs{@thm} to do \cs{cref@thmoptarg} if an optional % argument is given. \pkg{lwarp} then patches \cs{cref@thmoptarg} % \cs{AtBeginDocument}. @@ -43702,6 +44181,12 @@ color:\LWR@origpound\LWR@tempcolor% \ifhmode\unskip\unskip\par\fi% \normalfont% \LWR@forcenewpage% lwarp +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{amsthm}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \BlockClass{amsthmbody\LWR@thisthmstyle}% lwarp \trivlist% \let\thmheadnl\relax% @@ -43723,7 +44208,17 @@ color:\LWR@origpound\LWR@tempcolor% }% }% AtBeginDocument -\def\@endtheorem{\endtrivlist\endBlockClass\@endpefalse } +\def\@endtheorem{% + \endtrivlist% +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{amsthm}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} + \endBlockClass% + \@endpefalse% +} % \end{macrocode} % % @@ -43752,10 +44247,18 @@ color:\LWR@origpound\LWR@tempcolor% % \end{macrocode} % % Patched for \CSS: +% \changes{v0.896}{2021/04/05}{\pkg{amsthm}: Improved back refs.} % \begin{macrocode} \renewenvironment{proof}[1][\proofname]{\par -\LWR@forcenewpage% lwarp + \LWR@forcenewpage% lwarp +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{amsthm}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \BlockClass{amsthmproof}% lwarp + \LWR@newautopagelabel{page}% \pushQED{\qed}% \normalfont \topsep6\p@\@plus6\p@\relax \trivlist @@ -43763,6 +44266,12 @@ color:\LWR@origpound\LWR@tempcolor% \InlineClass{amsthmproofname}{#1\@addpunct{.}}]\ignorespaces% changes }{% \InlineClass{theoremendmark}{\popQED}\endtrivlist% +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{amsthm}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \endBlockClass% lwarp \@endpefalse } @@ -45068,6 +45577,7 @@ color:\LWR@origpound\LWR@tempcolor% % % \changes{v0.45}{2018/01/14}{\pkg{backref}: Added.} % \changes{v0.84}{2020/04/07}{\pkg{backref}: Fixed from \pkg{lwarp} v0.72 changes.} +% \changes{v0.896}{2021/04/05}{\pkg{backref}: Improved backrefs.} % % \codehtml % @@ -45080,7 +45590,7 @@ color:\LWR@origpound\LWR@tempcolor% \def\backref{} \long\def\hyper@section@backref#1#2#3{% - \ref{#3}% + \LWR@refwithsection{#3}% } \let\backrefxxx\hyper@section@backref @@ -45512,10 +46022,39 @@ color:\LWR@origpound\LWR@tempcolor% \let\blx@imc@ifhyperref\@firstoftwo % \end{macrocode} % +% Ensure that an autopage reference is current where each \cs{cite} is used, +% although this is nullified inside footnotes since they now use a \LaTeX\ box. +% \changes{v0.896}{2021/03/25}{\pkg{biblatex}: Fix: Citation references.} +% \begin{macrocode} +\xpretocmd{\blx@citecmdinit} + {\LWR@newautopagelabel{page}}% + {} + {\LWR@patcherror{biblatex}{blx@citecmdinit}} +% \end{macrocode} +% +% Ensure that an autopage reference is current for each backref. +% If the citation is in a footnote, the backref will point to whatever +% preceeded the footnotes. +% \changes{v0.896}{2021/03/25}{\pkg{biblatex}: Fix: Back references.} +% \begin{macrocode} +\xpatchcmd{\blx@addbackref@i} + {\thepage} + {\theLWR@previousautopagelabel}% ref to the most recent object + {} + {\LWR@patcherror{biblatex}{blx@addbackref@i A}} + +\xpatchcmd{\blx@addbackref@i} + {\c@page} + {\c@LWR@previousautopagelabel}% refto the most recent object + {} + {\LWR@patcherror{biblatex}{blx@addbackref@i B}} +% \end{macrocode} +% % % The following patches are for back page references. % % \changes{v0.891}{2020/09/05}{\pkg{biblatex}: Fixed: Back page references.} +% \changes{v0.896}{2021/04/05}{\pkg{biblatex}: Improved refs: \cs{ref} to \cs{LWR@refwithsection}.} % \begin{macrocode} \DeclareListFormat{pageref}{% \ifnumless{\abx@pagerefstyle}{0} @@ -45523,7 +46062,7 @@ color:\LWR@origpound\LWR@tempcolor% \ifhyperref {% % \hyperlink{page.#1}{#1}% - \ref{\BaseJobname-autopage-#1}% lwarp + \LWR@refwithsection{\BaseJobname-autopage-#1}% lwarp } {#1}} {\ifnumequal{\value{listcount}}{1} @@ -45561,7 +46100,7 @@ color:\LWR@origpound\LWR@tempcolor% {}% \ifhyperref % {\hyperlink{page.#1}{#1}} - {\ref{\BaseJobname-autopage-#1}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-#1}}% lwarp {#1}}% \edef\abx@range@prev{\abx@range@num}} {\usebibmacro{pageref:dump}% @@ -45570,7 +46109,7 @@ color:\LWR@origpound\LWR@tempcolor% {}% \ifhyperref % {\hyperlink{page.#1}{#1}} - {\ref{\BaseJobname-autopage-#1}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-#1}}% lwarp {#1}% \def\abx@range@prev{-1}}% \edef\abx@range@last{\abx@range@this}} @@ -45581,7 +46120,7 @@ color:\LWR@origpound\LWR@tempcolor% \bibrangedash \ifhyperref % {\hyperlink{page.\abx@range@hold}{\abx@range@hold}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\abx@range@hold}% \or % three \ifnumless{\abx@range@diff}{2} @@ -45589,49 +46128,49 @@ color:\LWR@origpound\LWR@tempcolor% {\bibrangedash}% \ifhyperref % {\hyperlink{page.\abx@range@hold}{\abx@range@hold}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\abx@range@hold}% \or % two+ \ifnumless{\abx@range@diff}{2} {\sqspace \ifhyperref % {\hyperlink{page.\abx@range@hold}{\bibstring{sequens}}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\bibstring{sequens}}} {\bibrangedash \ifhyperref % {\hyperlink{page.\abx@range@hold}{\abx@range@hold}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\abx@range@hold}}% \or % three+ \ifnumless{\abx@range@diff}{2} {\sqspace \ifhyperref % {\hyperlink{page.\abx@range@hold}{\bibstring{sequens}}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\bibstring{sequens}}} {\ifnumless{\abx@range@diff}{3} {\sqspace \ifhyperref % {\hyperlink{page.\abx@range@hold}{\bibstring{sequentes}}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\bibstring{sequentes}}} {\bibrangedash \ifhyperref % {\hyperlink{page.\abx@range@hold}{\abx@range@hold}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\abx@range@hold}}}% \else % all+ \ifnumless{\abx@range@diff}{2} {\sqspace \ifhyperref % {\hyperlink{page.\abx@range@hold}{\bibstring{sequens}}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\bibstring{sequens}}} {\sqspace \ifhyperref % {\hyperlink{page.\abx@range@hold}{\bibstring{sequentes}}} - {\ref{\BaseJobname-autopage-\abx@range@hold}}% lwarp + {\LWR@refwithsection{\BaseJobname-autopage-\abx@range@hold}}% lwarp {\bibstring{sequentes}}}% \fi \def\abx@range@diff{0}} @@ -45705,6 +46244,7 @@ color:\LWR@origpound\LWR@tempcolor% % \changes{v0.39}{2017/08/31}{\pkg{bigdelim}: Added.} % \changes{v0.40}{2017/09/09}{\pkg{bigdelim}: Improved documentation.} % \changes{v0.57}{2018/06/01}{\pkg{bigdelim}: Improved print/\HTML\ output selection.} +% \changes{v0.896}{2021/03/16}{\pkg{bigdelim}: Updated to v2.8.} % % \codehtml % @@ -45717,23 +46257,23 @@ color:\LWR@origpound\LWR@tempcolor% % % Next, load the package's new definitions: % \begin{macrocode} -\LWR@ProvidesPackagePass{bigdelim}[2018/08/03] +\LWR@ProvidesPackagePass{bigdelim}[2021/03/15] % \end{macrocode} % % -% \marg{1:delimiter} \marg{2:\#rows} \marg{3:width} \oarg{4:text} +% \marg{1:delimiter} \marg{2:\#rows} \oarg{3: vmove} \marg{4:width} \oarg{5:text} % \marginpar{\hfill\cs{ldelim}}\marginpar{\hfill\cs{rdelim}} % \begin{macrocode} -\NewDocumentCommand{\LWR@HTML@ldelim}{m m m O{}}{% +\NewDocumentCommand{\LWR@HTML@ldelim}{m m o m O{}}{% \renewcommand{\LWR@multirowborder}{right}% -\multirow{#2}{#3}{#4 \InlineClass{ldelim}{#1}}% +\multirow{#2}{#4}{#5 \InlineClass{ldelim}{#1}}% } \LWR@formatted{ldelim} -\NewDocumentCommand{\LWR@HTML@rdelim}{m m m O{}}{% +\NewDocumentCommand{\LWR@HTML@rdelim}{m m o m O{}}{% \renewcommand{\LWR@multirowborder}{left}% -\multirow{#2}{#3}{\InlineClass{rdelim}{#1} #4}% +\multirow{#2}{#4}{\InlineClass{rdelim}{#1} #5}% } \LWR@formatted{rdelim} @@ -45744,12 +46284,14 @@ color:\LWR@origpound\LWR@tempcolor% % \changes{v0.79}{2020/01/20}{\pkg{bigdelim}: Added \brand{MathJax} emulation.} % \begin{macrocode} \begin{warpMathJax} -% \ldelim ( [n]{width}[text] -\CustomizeMathJax{\newcommand{\LWRldelim}[1][]{\text{#1}~\LWRbigdelim}} -\CustomizeMathJax{\def\ldelim#1#2#3{\def\LWRbigdelim{#1}\LWRldelim}} -% \rdelim ) [n]{width}[text] -\CustomizeMathJax{\newcommand{\LWRrdelim}[1][]{\LWRbigdelim~\text{#1}}} -\CustomizeMathJax{\def\rdelim#1#2#3{\def\LWRbigdelim{#1}\LWRrdelim}} +% \ldelim ( {n}{width}[text] +\CustomizeMathJax{\newcommand{\LWRldelimtwo}[1][]{\text{#1}~\LWRbigdelim}} +\CustomizeMathJax{\newcommand{\LWRldelimone}[2][]{\LWRldelimtwo}} +\CustomizeMathJax{\def\ldelim#1#2{\def\LWRbigdelim{#1}\LWRldelimone}} +% \rdelim ) {n}{width}[text] +\CustomizeMathJax{\newcommand{\LWRrdelimtwo}[1][]{\LWRbigdelim~\text{#1}}} +\CustomizeMathJax{\newcommand{\LWRrdelimone}[2][]{\LWRrdelimtwo}} +\CustomizeMathJax{\def\rdelim#1#2{\def\LWRbigdelim{#1}\LWRrdelimone}} \end{warpMathJax} % \end{macrocode} % @@ -47199,6 +47741,55 @@ s% % % % +% +% \iffalse +%<*ccicons> +% \fi +% +% \part{lwarp-ccicons.sty} +% +% \section{ccicons} +% +% \credits{Michael Ummels} +% +% \DescribePackage{ccicons} \pkg{ccicons} is used as \SVG\ images for \HTML. +% +% \changes{v0.896}{2021/03/15}{\pkg{ccicons}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-ccicons}: +% \begin{macrocode} +\LWR@ProvidesPackagePass{ccicons}[2017/10/30] +% \end{macrocode} +% +% \begin{macrocode} +\newcommand{\LWR@ccicons}[2]{% + {\begin{lateximage}*[#1]\ccicons@font\char#2\end{lateximage}} +} +\renewcommand{\ccicons@logo}{\LWR@ccicons{ccLogo}{0}} +\renewcommand{\ccicons@by}{\LWR@ccicons{ccAttribution}{1}} +\renewcommand{\ccicons@sa}{\LWR@ccicons{ccShareAlike}{2}} +\renewcommand{\ccicons@nd}{\LWR@ccicons{ccNoDerivatives}{3}} +\renewcommand{\ccicons@nc}{\LWR@ccicons{ccNonCommercial}{4}} +\renewcommand{\ccicons@nceu}{\LWR@ccicons{ccNonCommercialEU}{5}} +\renewcommand{\ccicons@ncjp}{\LWR@ccicons{ccNonCommercialJP}{6}} +\renewcommand{\ccicons@pd}{\LWR@ccicons{ccPublicDomain}{7}} +\renewcommand{\ccicons@zero}{\LWR@ccicons{ccZero}{8}} +\renewcommand{\ccicons@sampling}{\LWR@ccicons{ccSampling}{9}} +\renewcommand{\ccicons@share}{\LWR@ccicons{ccShare}{10}} +\renewcommand{\ccicons@remix}{\LWR@ccicons{ccRemix}{11}} +\renewcommand{\ccicons@copy}{\LWR@ccicons{ccCopy}{12}} +\renewcommand{\ccicons@pdalt}{\LWR@ccicons{ccPublicDomainAlt}{13}} +% \end{macrocode} +% +% \iffalse +%</ccicons> +% \fi +% +% +% +% % \iffalse %<*centernot> % \fi @@ -47772,15 +48363,15 @@ test {\ifnumgreater{\csuse{Changes@In########1}}{0}}% % \changes{v0.51}{2018/03/04}{\pkg{chemfig}: Added.} % \changes{v0.71}{2019/04/25}{\pkg{chemfig}: Updated to v1.4.} % \changes{v0.82}{2020/03/12}{\pkg{chemfig}: Updated to v1.5.} +% \changes{v0.896}{2021/03/04}{\pkg{chemfig}: Updated to v1.6a.} % % \codehtml % % \begin{macrocode} -\LWR@ProvidesPackagePass{chemfig}[2020/03/05] +\LWR@ProvidesPackagePass{chemfig}[2021/02/28] % \end{macrocode} % \begin{macrocode} - \catcode`\_=11 \@ifpackagelater{chemfig}{2020/03/05} @@ -47795,15 +48386,17 @@ test {\ifnumgreater{\csuse{Changes@In########1}}{0}}% \@ifpackagelater{chemfig}{2019/04/18}% {% 2019/04/18 or newer +% \end{macrocode} +% \changes{v0.896}{2021/03/04}{\pkg{chemfig}: Updated to v1.6a.} +% \begin{macrocode} + \xpretocmd{\CF_chemfiga} + {\begin{lateximage}[-chemfig-~\PackageDiagramAltText]} + {}{\LWR@patcherror{chemfig}{CF_chemfiga}} - - \LetLtxMacro\LWR@chemfig@origchemfig\chemfig - - \renewcommand*{\chemfig}[2][]{% - \begin{lateximage}[-chemfig-~\PackageDiagramAltText]% - \LWR@chemfig@origchemfig[#1]{#2}% - \end{lateximage}% - } + \xpatchcmd{\CF_chemfigb} + {\let\CF_flipstate\CF_zero} + {\end{lateximage}\let\CF_flipstate\CF_zero} + {}{\LWR@patcherror{chemfig}{CF_chemfigb}} \GlobalLetLtxMacro\LWR@chemfig@origCF_lewisc\CF_lewisc \gdef\CF_lewisc#1,#2\_nil{% @@ -49520,6 +50113,7 @@ name = \chemmacros_translate:n {scheme-name} % \pkg{citeref} is patched for use by \pkg{lwarp}. % % \changes{v0.87}{2020/05/16}{\pkg{citeref}: Added.} +% \changes{v0.896}{2021/04/05}{\pkg{citeref}: Improved refs: \cs{ref} to \cs{LWR@refwithsection}.} % % \codehtml % @@ -49528,7 +50122,9 @@ name = \chemmacros_translate:n {scheme-name} % \end{macrocode} % % \begin{macrocode} -\def\@cprwrite#1={\write\@auxout{\string\citepageref{#1}{\theLWR@currentautosec}}} +\def\@cprwrite#1={% + \write\@auxout{\string\citepageref{#1}{\theLWR@previousautopagelabel}}% +} \def\citepageref#1#2{% \xdef\cpr@testa{\@nameuse{cpr@last@#1}}%letzte Zitatstelle @@ -49538,8 +50134,11 @@ name = \chemmacros_translate:n {scheme-name} \else% \@namexdef{cpr@last@#1}{#2}% \@ifundefined{cpr@#1}% - {\@namexdef{cpr@#1}{\ref{\BaseJobname-autopage-#2}}}% lwarp - {\@namexdef{cpr@#1}{\@nameuse{cpr@#1}, \ref{\BaseJobname-autopage-#2}}}% lwarp + {\@namexdef{cpr@#1}{\LWR@refwithsection{\BaseJobname-autopage-#2}}}% lwarp + {% lwarp + \@namexdef{cpr@#1}{\@nameuse{cpr@#1}, % space + \LWR@refwithsection{\BaseJobname-autopage-#2}}% + }% \fi } % \end{macrocode} @@ -49607,6 +50206,54 @@ name = \chemmacros_translate:n {scheme-name} % % % +% \iffalse +%<*classicthesis> +% \fi +% +% \part{lwarp-classicthesis.sty} +% +% \section{classicthesis} +% +% \credits{André Miede and Ivo Pletikosić} +% +% \DescribePackage{classicthesis} \pkg{classicthesis} is emulated. +% +% \changes{v0.896}{2021/03/15}{\pkg{classicthesis}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-classicthesis}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{classicthesis}[2018/06/03] +% \end{macrocode} +% +% \begin{macrocode} +\RequirePackage{scrlayer-scrpage} % provides headers and footers (KOMA Script) +\RequirePackage{scrtime} % time access +\PassOptionsToPackage{titles}{tocloft} +\RequirePackage{textcase} % for \MakeTextUppercase +\RequirePackage[newparttoc]{titlesec} % newparttoc to write \part to .toc with \numberline +\RequirePackage{tocloft} +\PassOptionsToPackage{headinclude,footinclude}{typearea} % for classes other than KOMA +\RequirePackage{typearea} +\PassOptionsToPackage{marginal}{footmisc}% marginal flushmargin +\RequirePackage{footmisc}% +\RequirePackage{prelim2e} +\RequirePackage{remreset}% + +\DeclareRobustCommand{\spacedallcaps}[1]{\textsc{\MakeTextUppercase{#1}}} +\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textsc{\MakeTextLowercase{#1}}} +\newcommand{\ctparttext}[1]{} +\newcommand{\tocEntry}[1]{} +\DeclareRobustCommand*{\deactivateaddvspace}{}% +\newlength{\beforebibskip} +% \end{macrocode} +% +% \iffalse +%</classicthesis> +% \fi +% +% % % \iffalse %<*cleveref> @@ -49814,6 +50461,30 @@ name = \chemmacros_translate:n {scheme-name} % \end{macrocode} % % +% \changes{v0.896}{2021/04/07}{\pkg{cleveref}: Undo \pkg{memoir} changes.} +% \begin{macrocode} +\@ifclassloaded{memoir}{ +\AtBeginDocument{ +\def\sf@memsub@label(#1)#2{% + \protected@edef\mem@currentlabelname{#1}% + \sf@@memsub@label{#2}} +} +}{} +% \end{macrocode} +% +% \changes{v0.896}{2021/04/07}{\pkg{cleveref}: Undo \pkg{subfig} changes.} +% \begin{macrocode} +\@ifpackageloaded{subfig}{ +\def\sf@sub@label(#1)#2{% + \ifhyperrefloaded + \protected@edef\@currentlabelname{% + \expandafter\strip@period #1\relax.\relax\@@@}% + \fi + \sf@@sub@label{#2}} +}{} +% \end{macrocode} +% +% % ^^A % For \brand{MathJax} and \pkg{cleveref}, % ^^A % but not \pkg{varioref} since \pkg{varioref} macros would only % ^^A % be useful in math inside a \cs{text} macro, where they do not @@ -52069,6 +52740,156 @@ name = \chemmacros_translate:n {scheme-name} % % % +% \iffalse +%<*enotez> +% \fi +% +% \part{lwarp-enotez.sty} +% +% \section{enotez} +% +% \credits{Clemens Niederberger} +% +% \DescribePackage{enotez} +% \pkg{enotez} is patched for use by \pkg{lwarp}. +% +% \changes{v0.896}{2021/04/07}{\pkg{enotez}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{enotez}[2020/12/13] +% \end{macrocode} +% +% Hyperref is emulated by \pkg{lwarp}, so it is forced on for \pkg{enotez}: +% \begin{macrocode} +\ExplSyntaxOn +\AtBeginDocument{ + \bool_set_true:N \l__enotez_hyperref_bool + \bool_set_true:N \l__enotez_hyperfootnotes_bool +} +% \end{macrocode} +% +% Do not move or \cs{hbox} the \cs{hypertarget}: +% \begin{macrocode} +% typeset the actual mark: +% #1: id +% #2: mark +\cs_gset_protected:Npn \enotez_write_mark:nn #1#2 + { + \bool_if:NTF \l__enotez_hyperfootnotes_bool + { + \enotezwritemark { \hyperlink {enz.#1} { \enmarkstyle #2 } } + \bool_if:NT \l__enotez_hyperbackref_bool + { +% \box_move_up:nn {1em} { +% \hbox:n { + \hypertarget {enz.#1.backref} { } +% } +% } + } + } + { \enotezwritemark { \enmarkstyle #2 } } + } +\cs_generate_variant:Nn \enotez_write_mark:nn {x} +% \end{macrocode} +% +% Do not move or \cs{hbox} the \cs{hypertarget}: +% \begin{macrocode} +\cs_gset_protected:Npn \enotez_write_list_number:n #1 + { + \bool_if:NT \l__enotez_hyperfootnotes_bool + { +% \box_move_up:nn {1em} { \hbox:n { + \hypertarget {enz.#1} { } +% } } + } + \tl_use:N \l__enotez_list_number_format_tl + \tl_if_eq:nxTF {a} { \prop_item:Nn \g__enotez_endnote_man_prop {#1} } + { + \bool_if:nTF + { \l__enotez_hyperfootnotes_bool && \l__enotez_hyperbackref_bool } + { + \exp_args:Nnx + \hyperlink {enz.#1.backref} + { \exp_not:V \l__enotez_endnote_mark_tl } + } + { \prop_item:Nn \g__enotez_endnote_mark_prop {#1} } + } + { + \bool_if:nTF + { \l__enotez_hyperfootnotes_bool && \l__enotez_hyperbackref_bool } + { + \exp_args:Nnx + \hyperlink {enz.#1.backref} + { \exp_not:V \l__enotez_endnote_mark_tl } + } + { \tl_use:N \l__enotez_endnote_mark_tl } + } + } +% \end{macrocode} +% +% Do not move the label to the left: +% \begin{macrocode} +\DeclareTemplateCode {enotez-list} {paragraph} {1} + { + heading = \enotez_list_heading:n , + format = \l__enotez_list_format_tl , + number = \enotez_list_number:n , + number-format = \l__enotez_list_number_format_tl , + notes-sep = \l__enotez_list_notes_sep_dim + } + { + \AssignTemplateKeys + \enotez_set_totoc: + \enotez_list_heading:n { \l__enotez_list_name_tl } + \enotez_list_preamble: + \enotez_build_print_list:nnnn {#1} + {} + { + \par\noindent + \group_begin: + \tl_use:N \l__enotez_list_format_tl +% \hbox_overlap_left:n +% { + \enotez_list_number:n + { \enotez_write_list_number:n {##1} } + \tl_use:N \c_space_tl +% } + % \cs_set:cpn {@currentlabel} + % { \p@endnote \l__enotez_endnote_mark_tl } + \tl_use:N \g__enotez_endnote_text_tl + \par + \dim_compare:nT { \l__enotez_list_notes_sep_dim != 0pt } + { \addvspace { \l__enotez_list_notes_sep_dim } } + \group_end: + } + {} + \enotez_list_postamble: + } + +\ExplSyntaxOff +% \end{macrocode} +% +% For \brand{MathJax}: +% \begin{macrocode} +\begin{warpMathJax} +\def\endnotename{endnote} +\appto\LWR@syncnotenumbers{\LWR@synconenotenumber{LWRendnote}{\theendnote}} +\appto\LWR@syncnotenames{\LWR@synconenotename{LWRendnote}{\endnotename}} +\CustomizeMathJax{\def\LWRendnote{1}} +\CustomizeMathJax{\newcommand{\endnote}[2][\LWRendnote]{{}^{\mathrm{#1}}}} +\CustomizeMathJax{\newcommand{\endnotemark}[1][\LWRendnote]{{}^{\mathrm{#1}}}} +\end{warpMathJax} +% \end{macrocode} + +% +% \iffalse +%</enotez> +% \fi +% +% +% % % \iffalse %<*enumerate> @@ -52204,17 +53025,18 @@ name = \chemmacros_translate:n {scheme-name} % \end{macrocode} % \changes{v0.47}{2018/01/26}{\pkg{epigraph}: Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.896}{2021/03/05}\pkg{epigraph}: {Added \ARIA\ role.} % \begin{macrocode} \DeclareDocumentCommand{\LWR@HTML@epigraph}{m m} {% - \begin{LWR@BlockClassWP}{\LWR@print@mbox{text-align:right}}{}{epigraph}% + \begin{LWR@BlockClassWP}{\LWR@print@mbox{text-align:right}}{}(note){epigraph}% \qitem{#1}{#2}% \end{LWR@BlockClassWP}% } \LWR@formatted{epigraph} \DeclareDocumentEnvironment{LWR@HTML@epigraphs}{} - {\LWR@BlockClassWP{\LWR@print@mbox{text-align:right}}{}{epigraph}} + {\LWR@BlockClassWP{\LWR@print@mbox{text-align:right}}{}(note){epigraph}}% {\endLWR@BlockClassWP} \LWR@formattedenv{epigraphs} % \end{macrocode} @@ -53131,9 +53953,20 @@ name = \chemmacros_translate:n {scheme-name} % \begin{noindmacro}{\V@@footnotetext} % Patches in a subset of \pkg{lwarp}'s \cs{LWR@footnotetext} to the % \pkg{fancyvrb} version of \cs{V@@footnotetext}. +% \changes{v0.896}{2021/04/04}{Fix: \ctr{autopage} references in footnotes.} % \begin{macrocode} \def\V@@footnotetext{% \LWR@traceinfo{V@footnotetext}% +% \end{macrocode} +% +% Place an autopage marker so that back references to citations inside +% a footnote will link closer to the footnote text, if possible. +% \begin{macrocode} +\LWR@newautopagelabel{page}% +% \end{macrocode} +% +% Take the current footnote box, then append: +% \begin{macrocode} \global\setbox\LWR@footnotebox=\vbox\bgroup% % \end{macrocode} % Add to any current footnotes: @@ -53168,6 +54001,14 @@ name = \chemmacros_translate:n {scheme-name} % \begin{macrocode} \bgroup% \aftergroup{\V@@@footnotetext}% +% \end{macrocode} +% +% Do not generate autopages inside the footnotes, since they are +% accumulated at the moment before finally being used perhaps on a later page. +% \begin{macrocode} + \let\LWR@newautopagelabel\LWR@null@newautopagelabel% +% \end{macrocode} +% \begin{macrocode} \ignorespaces% }% % \end{macrocode} @@ -53581,9 +54422,20 @@ name = \chemmacros_translate:n {scheme-name} % \begin{noindmacro}{\V@@footnotetext} % Patches in a subset of \pkg{lwarp}'s \cs{LWR@footnotetext} to the % \pkg{fancyvrb} version of \cs{V@@footnotetext}. +% \changes{v0.896}{2021/04/04}{Fix: \ctr{autopage} references in footnotes.} % \begin{macrocode} \def\V@@footnotetext{% \LWR@traceinfo{V@footnotetext}% +% \end{macrocode} +% +% Place an autopage marker so that back references to citations inside +% a footnote will link closer to the footnote text, if possible. +% \begin{macrocode} +\LWR@newautopagelabel{page}% +% \end{macrocode} +% +% Take the current footnote box, then append: +% \begin{macrocode} \global\setbox\LWR@footnotebox=\vbox\bgroup% % \end{macrocode} % Add to any current footnotes: @@ -53618,6 +54470,14 @@ name = \chemmacros_translate:n {scheme-name} % \begin{macrocode} \bgroup% \aftergroup{\V@@@footnotetext}% +% \end{macrocode} +% +% Do not generate autopages inside the footnotes, since they are +% accumulated at the moment before finally being used perhaps on a later page. +% \begin{macrocode} + \let\LWR@newautopagelabel\LWR@null@newautopagelabel% +% \end{macrocode} +% \begin{macrocode} \ignorespaces% }% % \end{macrocode} @@ -54366,7 +55226,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \renewcommand{\l@fixme}[2]{% \hypertocfloat{1}{fixme}{lox}% - {\LWR@nameref{\BaseJobname-autopage-\arabic{LWR@nextautopage}} --- #1} + {\LWR@nameref{\BaseJobname-autopage-\arabic{LWR@nextautopage}} --- #1}% {#2} } % \end{macrocode} @@ -54682,6 +55542,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % Borrowed from the \pkg{lwarp} version of \pkg{keyfloat}: % \changes{v0.42}{2017/10/26}{\pkg{floatflt}: Added width.} % \changes{v0.79}{2020/01/08}{\pkg{floatflt}: Improved width control.} +% \changes{v0.896}{2021/03/05}{\pkg{floatflt}: Added \ARIA\ role.} % \begin{macrocode} \NewDocumentEnvironment{KFLTfloatflt@marginfloat}{O{-1.2ex} m m} {% @@ -54692,6 +55553,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space width: 1.5in; % reasonable dummy width for word processor margin:10pt% }{}% + (note)% {marginblock}% }{% \setlength{\LWR@templengthone}{#3}% @@ -54702,6 +55564,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space }{% width:\LWR@printlength{\LWR@templengthone}% }% + (note)% {marginblock}% }% \renewcommand*{\@captype}{#2}% @@ -59061,9 +59924,12 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \changes{v0.52}{2018/03/26}{\pkg{hyperref}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \URL.} % \changes{v0.54}{2018/04/19}{\pkg{hyperref}: Fix: \cs{ref} in \cs{hyperref} and \cs{hyperlink} caused nested link.} % \changes{v0.54}{2018/04/19}{\pkg{hyperref}: Fix: \cs{hyperref} and \cs{hyperlink} with special chars in text.} +% \changes{v0.896}{2021/04/07}{\pkg{hyperref}: Fix: No \cs{hyperlink} in \HTML\ comment.} % \begin{macrocode} \DeclareDocumentCommand{\LWR@hyperlinkb}{m}{% - \LWR@hyperrefcb[LWR-ht-#1]% + \ifbool{LWR@insidemathcomment}% + {\endgroup}% + {\LWR@hyperrefcb[LWR-ht-#1]}% } \DeclareDocumentCommand{\hyperlink}{}{% @@ -59099,6 +59965,27 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \end{macrocode} % \end{noindmacro} +% Default names: +% \changes{v0.896}{2021/03/13}{\pkg{hyperref}: Fix: Added \cs{*autorefname} macros.} +% \begin{macrocode} +\def\equationautorefname{Equation}% +\def\footnoteautorefname{footnote}% +\def\itemautorefname{item}% +\def\figureautorefname{Figure}% +\def\tableautorefname{Table}% +\def\partautorefname{Part}% +\def\appendixautorefname{Appendix}% +\def\chapterautorefname{chapter}% +\def\sectionautorefname{section}% +\def\subsectionautorefname{subsection}% +\def\subsubsectionautorefname{subsubsection}% +\def\paragraphautorefname{paragraph}% +\def\subparagraphautorefname{subparagraph}% +\def\FancyVerbLineautorefname{line}% +\def\theoremautorefname{Theorem}% +\def\pageautorefname{page}% +% \end{macrocode} + % \begin{noindmacro}{\pdfstringdef} \marg{macroname} \marg{\TeX{}string} @@ -59321,12 +60208,59 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \DescribePackage{hyperxmp} \pkg{hyperxmp} is ignored. % % \changes{v0.34}{2017/08/03}{\pkg{hyperxmp}: Added.} +% \changes{v0.896}{2021/03/13}{\pkg{hyperxmp}: Added keys.} % % \codehtml % % Discard all options for \pkg{lwarp-hyperxmp}: % \begin{macrocode} \LWR@ProvidesPackageDrop{hyperxmp}[2018/11/27] + +\define@key{LWR@hyperref}{pdfdate}[]{} +\define@key{LWR@hyperref}{pdfmetadate}[]{} +\define@key{LWR@hyperref}{pdfcopyright}[]{} +\define@key{LWR@hyperref}{pdftype}[]{} +\define@key{LWR@hyperref}{pdflicenseurl}[]{} +\define@key{LWR@hyperref}{pdfauthortitle}[]{} +\define@key{LWR@hyperref}{pdfcaptionwriter}[]{} +\define@key{LWR@hyperref}{pdfmetalang}[]{} +\define@key{LWR@hyperref}{pdfapart}[]{} +\define@key{LWR@hyperref}{pdfaconformance}[]{} +\define@key{LWR@hyperref}{pdfuapart}[]{} +\define@key{LWR@hyperref}{pdfxstandard}[]{} +\define@key{LWR@hyperref}{pdfsource}[]{} +\define@key{LWR@hyperref}{pdfdocumentid}[]{} +\define@key{LWR@hyperref}{pdfinstanceid}[]{} +\define@key{LWR@hyperref}{pdfversionid}[]{} +\define@key{LWR@hyperref}{pdfrendition}[]{} +\define@key{LWR@hyperref}{pdfpublication}[]{} +\define@key{LWR@hyperref}{pdfpubtype}[]{} +\define@key{LWR@hyperref}{pdfbytes}[]{} +\define@key{LWR@hyperref}{pdfnumpages}[]{} +\define@key{LWR@hyperref}{pdfissn}[]{} +\define@key{LWR@hyperref}{pdfeissn}[]{} +\define@key{LWR@hyperref}{pdfisbn}[]{} +\define@key{LWR@hyperref}{pdfbookedition}[]{} +\define@key{LWR@hyperref}{pdfpublisher}[]{} +\define@key{LWR@hyperref}{pdfvolumenum}[]{} +\define@key{LWR@hyperref}{pdfissuenum}[]{} +\define@key{LWR@hyperref}{pdfpagerange}[]{} +\define@key{LWR@hyperref}{pdfdoi}[]{} +\define@key{LWR@hyperref}{pdfurl}[]{} +\define@key{LWR@hyperref}{pdfidentifier}[]{} +\define@key{LWR@hyperref}{pdfsubtitle}[]{} +\define@key{LWR@hyperref}{pdfpubstatus}[]{} +\define@key{LWR@hyperref}{pdfcontactaddress}[]{} +\define@key{LWR@hyperref}{pdfcontactcity}[]{} +\define@key{LWR@hyperref}{pdfcontactregion}[]{} +\define@key{LWR@hyperref}{pdfcontactpostcode}[]{} +\define@key{LWR@hyperref}{pdfcontactcountry}[]{} +\define@key{LWR@hyperref}{pdfcontactphone}[]{} +\define@key{LWR@hyperref}{pdfcontactemail}[]{} +\define@key{LWR@hyperref}{pdfcontacturl}[]{} +\define@key{LWR@hyperref}{keeppdfinfo}[]{} +\define@key{LWR@hyperref}{pdfauthor}[]{} +\define@key{LWR@hyperref}{pdfkeywords}[]{} % \end{macrocode} % % @@ -60674,6 +61608,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \begin{noindenvironment}{KFLT@marginfloat} \oarg{offset} \marg{type} % \changes{v0.42}{2017/10/26}{\pkg{keyfloat}: If \progcode{FormatWP} add explicit \HTML\ style.} +% \changes{v0.896}{2021/03/05}{\pkg{keyfloat}: Added \ARIA\ role.} % \begin{macrocode} \DeclareDocumentEnvironment{KFLT@marginfloat}{O{-1.2ex} m} {% @@ -60681,6 +61616,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \LWR@BlockClassWP% {float:right; width:2in; margin:10pt}% {}% + (note)% {marginblock}% \renewcommand*{\@captype}{#2}% \minipage{\LWR@usersmarginparwidth}% @@ -60706,7 +61642,8 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \begin{noindenvironment}{keywrap} \marg{width} \marg{keyfloat} -% \changes{v0.79}{2020/01/10}{Factored to \cs{LWR@setvirtualpage}.} +% \changes{v0.79}{2020/01/10}{\pkg{keyfloat}: Factored to \cs{LWR@setvirtualpage}.} +% \changes{v0.896}{2021/03/05}{\pkg{keyfloat}: Added \ARIA\ role.} % ^^A % Modified to vertically align minipage for \HTML\ output: % \begin{macrocode} \DeclareDocumentEnvironment{keywrap}{m +m} @@ -60719,6 +61656,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} margin:10pt% }% {}% + (note)% {marginblock}% \setlength{\linewidth}{.95\LWR@templengthone}% \booltrue{KFLT@keywrap}% @@ -62016,7 +62954,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % \DescribePackage{listings} % \pkg{listings} is supported with some limitations. -% Text formatting is not yet supported. +% Text formatting and escape characters are not yet supported. % % \changes{v0.20}{2017/01/01}{\pkg{listings}: Added.} % @@ -62084,7 +63022,6 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \end{macrocode} % \end{noindmacro} % -% % \begin{noindmacro}{\lst@Init} \marg{backslash-processing} \quad % Done at the start of a listing. % \begin{macrocode} @@ -62102,29 +63039,113 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % with paragraph handling and conditionals. % \changes{v0.891}{2020/09/16}{\pkg{listings}: Fix for \brand{MathJax}: Moved \cs{LWR@forcenewpage} to start.} % \begin{macrocode} -\lst@ifdisplaystyle% - \LWR@forcenewpage% -\fi% -\renewcommand*{\@captype}{lstlisting}% -\let\lst@aboveskip\z@\let\lst@belowskip\z@% -\gdef\lst@boxpos{t}% -\let\lst@frame\@empty - \let\lst@frametshape\@empty - \let\lst@framershape\@empty - \let\lst@framebshape\@empty - \let\lst@framelshape\@empty -\lstframe@\lst@frameround ffff\relax% -\lst@multicols\@empty% -\LWR@origlst@Init{#1}\relax% +\lst@ifdisplaystyle% lwarp + \LWR@forcenewpage% lwarp +\fi% lwarp +% \end{macrocode} +% +% Escapes do not work yet, and are disabled: +% \changes{v0.896}{2021/03/14}{\pkg{listings}: Escapes accepted but disabled.} +% \begin{macrocode} +\let\lst@ifmathescape\iffalse% lwarp +\let\lst@DefEsc\relax% lwarp +\def\lst@escapebegin{}% lwarp +\def\lst@escapeend{}% lwarp +% \end{macrocode} +% \begin{macrocode} +\renewcommand*{\@captype}{lstlisting}% lwarp + \let\lst@aboveskip\z@\let\lst@belowskip\z@% lwarp + \gdef\lst@boxpos{t}% lwarp + \let\lst@frame\@empty% lwarp + \let\lst@frametshape\@empty% lwarp + \let\lst@framershape\@empty% lwarp + \let\lst@framebshape\@empty% lwarp + \let\lst@framelshape\@empty% lwarp + \lstframe@\lst@frameround ffff\relax% lwarp + \lst@multicols\@empty% lwarp + \begingroup% + \ifx\lst@float\relax\else% + \edef\@tempa{\noexpand\lst@beginfloat{lstlisting}[\lst@float]}% + \expandafter\@tempa% + \fi% + \ifx\lst@multicols\@empty\else% + \edef\lst@next{\noexpand\multicols{\lst@multicols}}% + \expandafter\lst@next% + \fi% + \ifhmode\ifinner \lst@boxtrue \fi\fi% + \lst@ifbox% + \lsthk@BoxUnsafe% + \hbox to\z@\bgroup% + $\if t\lst@boxpos \vtop% + \else \if b\lst@boxpos \vbox% + \else \vcenter \fi\fi% + \bgroup \par\noindent% + \else% + \lst@ifdisplaystyle% + \lst@EveryDisplay% + \par\penalty-50\relax% + \vspace\lst@aboveskip% + \fi% + \fi% + \normalbaselines% + \abovecaptionskip\lst@abovecaption\relax% + \belowcaptionskip\lst@belowcaption\relax% + \lst@MakeCaption t% +% \end{macrocode} +% +% Use the overall listing label instead of the line number label: +% \changes{v0.896}{2021/03/14}{\pkg{listings}: Fix: Labels.} +% \begin{macrocode} +\LWR@traceinfo{lst@Init: defining current label !\@currentlabel!}% + \let\LWR@listings@currentlabel\@currentlabel% lwarp +\LWR@traceinfo{lst@Init: defining current label !\cref@currentlabel!}% + \let\LWR@listings@cref@currentlabel\cref@currentlabel% lwarp +% \end{macrocode} +% \begin{macrocode} +\LWR@traceinfo{lst@Init: preinit and init}% + \lsthk@PreInit \lsthk@Init% +% \end{macrocode} +% \begin{macrocode} + \let\@currentlabel\LWR@listings@currentlabel% lwarp + \let\cref@currentlabel\LWR@listings@cref@currentlabel% lwarp +% \end{macrocode} +% +% \begin{macrocode} +\LWR@traceinfo{lst@Init: M}% + \lst@ifdisplaystyle + \global\let\lst@ltxlabel\@empty + \if@inlabel + \lst@ifresetmargins + \leavevmode + \else + \xdef\lst@ltxlabel{\the\everypar}% + \lst@AddTo\lst@ltxlabel{% + \global\let\lst@ltxlabel\@empty + \everypar{\lsthk@EveryLine\lsthk@EveryPar}}% + \fi + \fi + \everypar\expandafter{\lst@ltxlabel + \lsthk@EveryLine\lsthk@EveryPar}% + \else + \everypar{} + \let\lst@NewLine\@empty + \fi +\LWR@traceinfo{lst@Init: P}% + \lsthk@InitVars \lsthk@InitVarsBOL + \lst@Let{13}\lst@MProcessListing + \let\lst@Backslash#1% + \lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}% + \lst@InitFinalize% +\LWR@traceinfo{lst@Init: S}% % \end{macrocode} % Avoids extra horizontal space: % \changes{v0.60}{2018/09/12}{\pkg{listings}: Fix if inside a list.} % \begin{macrocode} -\def\lst@framelr{}% +\def\lst@framelr{}% lwarp % \end{macrocode} % \begin{macrocode} -\LWR@traceinfo{finished origlst@Init}% -\lst@ifdisplaystyle% +\LWR@traceinfo{lst@Init: finished origlst@Init}% +\lst@ifdisplaystyle% lwarp % \end{macrocode} % Creating a display. % @@ -62132,26 +63153,25 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % produce the \element{pre}, then % reenable line numbers. % \begin{macrocode} - \LWR@traceinfo{About to create verbatim.}% - \let\lsthk@EveryPar\relax% + \LWR@traceinfo{lst@Init: About to create verbatim.}% lwarp + \let\lsthk@EveryPar\relax% lwarp % \end{macrocode} % \changes{v0.891}{2020/09/16}{\pkg{listings}: Fix for \brand{MathJax}: Moved \cs{LWR@forcenewpage} to start.} % \begin{macrocode} - \LWR@atbeginverbatim{programlisting}% + \LWR@atbeginverbatim{programlisting}% lwarp - \let\lsthk@EveryPar\LWR@origlsthkEveryPar% -\else% + \let\lsthk@EveryPar\LWR@origlsthkEveryPar% lwarp +\else% lwarp % \end{macrocode} % Inline, so open a \element{span}: % \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} - \ifbool{LWR@verbtags}{\LWR@htmltag{% - span class=\textquotedbl{}inlineprogramlisting\textquotedbl% - }}{}% -\fi% -\LWR@traceinfo{lst@Init done}% + \ifbool{LWR@verbtags}{\LWR@htmltag{% lwarp + span class=\textquotedbl{}inlineprogramlisting\textquotedbl% lwarp + }}{}% lwarp +\fi% lwarp +\LWR@traceinfo{lst@Init: done}% } - % \end{macrocode} % \end{noindmacro} % @@ -62159,27 +63179,57 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \begin{noindmacro}{\lst@DeInit} \quad Done at the end of a listing. % \begin{macrocode} \renewcommand*{\lst@DeInit}{% +\LWR@traceinfo{lst@DeInit}% \lst@ifdisplaystyle% % \end{macrocode} +% % Creating a display. % -% Disable line numbers, -% produce the \element{/pre}, then -% reenable line numbers: +% Disable line numbers, produce the \element{/pre}, then reenable line numbers: % \begin{macrocode} \let\lsthk@EveryPar\relax% \LWR@afterendverbatim% \let\lsthk@EveryPar\LWR@origlsthkEveryPar% \else% % \end{macrocode} +% % Inline, so create the closing \element{/span}: % \begin{macrocode} \ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/span}}{}% \fi% % \end{macrocode} +% % Final \pkg{listings} deinit: % \begin{macrocode} -\LWR@origlst@DeInit% + \lst@XPrintToken \lst@EOLUpdate + \global\advance\lst@newlines\m@ne + \lst@ifshowlines + \lst@DoNewLines + \else + \setbox\@tempboxa\vbox{\lst@DoNewLines}% + \fi + \lst@ifdisplaystyle \par\removelastskip \fi + \lsthk@ExitVars\everypar{}\lsthk@DeInit\normalbaselines\normalcolor + \lst@MakeCaption b% + \lst@ifbox + \egroup $\hss \egroup + \vrule\@width\lst@maxwidth\@height\z@\@depth\z@ + \else + \lst@ifdisplaystyle + \par\penalty-50\vspace\lst@belowskip + \fi + \fi + \ifx\lst@multicols\@empty\else + \def\lst@next{\global\let\@checkend\@gobble + \endmulticols + \global\let\@checkend\lst@@checkend} + \expandafter\lst@next + \fi + \ifx\lst@float\relax\else + \expandafter\lst@endfloat + \fi + \endgroup +\LWR@traceinfo{lst@DeInit done}% } % \end{macrocode} % \end{noindmacro} @@ -62192,19 +63242,18 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % Patched for \pkg{lwarp}. % \begin{macrocode} - \def\lst@MakeCaption#1{% -\LWR@traceinfo{MAKING CAPTION at #1}% +\LWR@traceinfo{lst@MakeCaption at #1}% \lst@ifdisplaystyle -\LWR@traceinfo{making a listings display caption}% +\LWR@traceinfo{lst@MakeCaption: making a listings display caption}% \ifx #1t% \ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else \expandafter\refstepcounter \fi {lstlisting}% -\LWR@traceinfo{About to assign label: !\lst@label!}% +% \LWR@traceinfo{About to assign label: !\lst@label!}% % \ifx\lst@label\@empty\else % \label{\lst@label}\fi -\LWR@traceinfo{Finished assigning the label.}% +% \LWR@traceinfo{Finished assigning the label.}% \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl \global\let\lst@name\lst@arg \global\let\lstname\lst@name \lst@ifnolol\else @@ -62218,7 +63267,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % This code places a contents entry for a non-float. % This would have to be modified for \pkg{lwarp}: % \begin{macrocode} -\LWR@traceinfo{addcontents lst@name: -\lst@name-}% +\LWR@traceinfo{lst@MakeCaption: addcontents lst@name: -\lst@name-}% % \addcontentsline{lol}{lstlisting}{\lst@name} \fi \fi @@ -62227,7 +63276,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \end{macrocode} % This would have to be modified for \pkg{lwarp}: % \begin{macrocode} -\LWR@traceinfo{addcontents lst@@caption: -\lst@@caption-}% +\LWR@traceinfo{lst@MakeCaption: addcontents lst@@caption: -\lst@@caption-}% \addcontentsline{lol}{lstlisting}% {\protect\numberline{\thelstlisting}% {\protect\ignorespaces \LWR@isolate{\lst@@caption} \protect\relax}}% @@ -62235,10 +63284,10 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \fi \fi \ifx\lst@caption\@empty\else -\LWR@traceinfo{lst@caption not empty-}% +\LWR@traceinfo{lst@MakeCaption: lst@caption not empty-}% \lst@IfSubstring #1\lst@captionpos {\begingroup -\LWR@traceinfo{at the selected position}% +\LWR@traceinfo{lst@MakeCaption: at the selected position}% % \end{macrocode} % These space and box commands are not needed for \HTML\ output: % \begin{macrocode} @@ -62252,37 +63301,37 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % New \pkg{lwarp} code to create a caption: % \changes{v0.73}{2019/06/25}{\pkg{listings}: Fix: Paragraph tags.} % \begin{macrocode} - \LWR@stoppars% + \LWR@stoppars% lwarp \lst@makecaption\fnum@lstlisting{\ignorespaces \lst@caption} \else % \end{macrocode} % New \pkg{lwarp} code to create a title: % \begin{macrocode} % \lst@maketitle\lst@title % (AS) -\LWR@traceinfo{Making title: \lst@title}% +\LWR@traceinfo{lst@MakeCaption: Making title: \lst@title}% \begin{BlockClass}{lstlistingtitle}% lwarp \lst@maketitle\lst@title% lwarp \end{BlockClass}% lwarp - \fi -\LWR@traceinfo{About to assign label: !\lst@label!}% - \ifx\lst@label\@empty\else + \fi% +\LWR@traceinfo{lst@MakeCaption: About to assign label: !\lst@label!}% + \ifx\lst@label\@empty\else% \leavevmode% gets rid of bad space factor error \GetTitleStringExpand{\lst@caption}% \edef\LWR@lntemp{\GetTitleStringResult}% \edef\@currentlabelname{\detokenize\expandafter{\LWR@lntemp}}% -\label{\lst@label}\fi -\LWR@traceinfo{Finished assigning the label.}% +\label{\lst@label}\fi% +\LWR@traceinfo{lst@MakeCaption: Finished assigning the label.}% % \end{macrocode} % Not needed for \pkg{lwarp}: % \begin{macrocode} % \ifx #1b\allowbreak \fi \endgroup}{}% \fi -\LWR@traceinfo{end of making a listings display caption}% +\LWR@traceinfo{lst@MakeCaption: end of making a listings display caption}% \else -\LWR@traceinfo{INLINE}% +\LWR@traceinfo{lst@MakeCaption: INLINE}% \fi -\LWR@traceinfo{DONE WITH CAPTION at #1}% +\LWR@traceinfo{lst@MakeCaption: done at #1}% } \renewcommand{\lst@maketitle}[1]{% @@ -62293,6 +63342,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \end{noindmacro} % % +% % Patched to keep left line numbers outside of the left margin, and % \margintag{line numbers} % place right line numbers in a field \cs{VerbatimHTMLWidth} wide. @@ -62525,25 +63575,26 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \newcommand*{\LWR@longtable@headerror}{% \PackageError{lwarp-longtable} {For longtable:\MessageBreak - 1: Keep either one of an \protect\endhead\space or - \protect\endfirsthead\space\MessageBreak - \space phrase as-is, to be used by both print and HTML.\MessageBreak + 1: Keep either one of an \protect\endhead\space or\MessageBreak + \space\protect\endfirsthead\space phrase as-is,\MessageBreak + \space to be used by both print and HTML.\MessageBreak 2: Place any other \protect\end... phrases inside a\MessageBreak \space\protect\warpprintonly\space macro, to be ignored by HTML.\MessageBreak - 3: Add a final footer for HTML at the end of the table\MessageBreak + 3: At the end of the table,\MessageBreak + \space add a final footer for HTML\MessageBreak \space inside a \protect\warpHTMLonly\space macro. This can be\MessageBreak \space a copy of an \protect\endfoot\space or - \protect\endfirstfoot\space phrase,\MessageBreak - \space but without the actual \protect\endfoot\space - or \protect\endfirstfoot\MessageBreak - \space macros. If using threeparttablex, add\MessageBreak + \protect\endfirstfoot\MessageBreak + \space phrase, but without the actual \protect\endfoot\MessageBreak + \space or \protect\endfirstfoot\space macros.\MessageBreak + \space If using threeparttablex, add\MessageBreak \space \protect\insertTableNotes\space here, optionally with\MessageBreak \space \protect\UseMinipageWidths\space in front.\MessageBreak - See the Lwarp documentation regarding longtables\MessageBreak - and threeparttablex} + See the Lwarp documentation regarding\MessageBreak + longtables and threeparttablex} {See the Lwarp documentation regading longtables and threeparttablex.} } % \end{macrocode} @@ -67855,7 +68906,16 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak \LWRNB@patchnatbibopenclose% } % \end{macrocode} - +% +% Syncronize the autopage labels: +% \changes{v0.896}{2021/03/26}{\pkg{natbib}: Fix: Citation references..} +% \begin{macrocode} +\xpretocmd{\NAT@reset@parser} + {\LWR@newautopagelabel{page}}% + {} + {\LWR@patcherror{natbib}{NAT@reset@parser}} +% \end{macrocode} +% % \iffalse %</natbib> % \fi @@ -69475,6 +70535,12 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak \refstepcounter[#1]{#2}% <<< cleveref modification \theorem@prework \LWR@forcenewpage% lwarp +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{ntheorem}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \BlockClass{theorembody#1}%\LWR@thisthmstyle% lwarp \trivlist % latex's \trivlist, calling latex's \@trivlist unchanged \ifuse@newframeskips % cf. latex.ltx for topsepadd: \@trivlist @@ -69511,6 +70577,12 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak \refstepcounter{#2}% \theorem@prework \LWR@forcenewpage% lwarp +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{ntheorem}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \BlockClass{theorembody#1}%\LWR@thisthmstyle% lwarp \trivlist % latex's \trivlist, calling latex's \@trivlist unchanged \ifuse@newframeskips % cf. latex.ltx for topsepadd: \@trivlist @@ -69964,6 +71036,12 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak }{}% \LWR@origendtheorem% also does \@endtrivlist \ifbool{LWR@ntheoremmarks}{\global\setendmarktrue}{}% +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{ntheorem}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \endBlockClass% } % \end{macrocode} @@ -70139,6 +71217,60 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak % \fi % % +% \iffalse +%<*orcidlink> +% \fi +% +% \part{lwarp-orcidlink.sty} +% +% \section{orcidlink} +% +% \credits{Leo C. Stein} +% +% \DescribePackage{orcidlink} +% \pkg{orcidlink} is patched for use by \pkg{lwarp}. +% +% \changes{v0.896}{2021/03/19}{\pkg{orcidlink}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\RequirePackage{lwarp-scalerel} + +\LWR@ProvidesPackagePass{orcidlink}[2020/11/21] +% \end{macrocode} +% +% \begin{macrocode} +\renewcommand\orcidlink[1]{% + \texorpdfstring% + {% + \href% + {https://orcid.org/#1}% + {% + \begin{lateximage}[orcid #1]% lwarp + \mbox{% + \scalerel*{% + \begin{tikzpicture}[yscale=-1,transform shape] + \pic{orcidlogo}; + \end{tikzpicture} + }{|}% + }% + \end{lateximage}% lwarp + }% + }% + {}% +} + +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\orcidlink}[1]{}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +%</orcidlink> +% \fi +% +% % % % \iffalse @@ -70614,6 +71746,7 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak % \pkg{parnotes} is supported with some patches. % % \changes{v0.56}{2018/05/08}{\pkg{parnotes}: Added.} +% \changes{v0.896}{2021/03/05}{\pkg{parnotes}: Added \ARIA\ role.} % % \codehtml % @@ -70647,10 +71780,10 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak \unless\ifvmode\par\fi % Avoid page breaks between a paragraph and its parnotes \nopagebreak\addvspace{\parnotevskip}% - \LWR@forcenewpage% lwarp - \begin{BlockClass}{footnotes}% lwarp + \LWR@forcenewpage% lwarp + \begin{BlockClass}(note){footnotes}% lwarp {\parnotefmt{\PN@text}\par}% - \end{BlockClass}% lwarp + \end{BlockClass}% lwarp \global\def\PN@text{}% \addvspace{\parnotevskip}% % @@ -71048,12 +72181,20 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak % \DescribePackage{pdflscape} \pkg{pdflscape} is ignored. % % \changes{v0.34}{2017/08/03}{\pkg{pdflscape}: Added.} +% \changes{v0.896}{2021/03/14}{\pkg{pdflscape}: Fix: Added \env{landscape}.} % % \codehtml % % Discard all options for \pkg{lwarp-pdflscape}: % \begin{macrocode} -\LWR@ProvidesPackageDrop{pdflscape}[2016/05/14] +\LWR@ProvidesPackageDrop{pdflscape}[2019/12/05] +% \end{macrocode} +% +% \begin{macrocode} +\let\landscape\relax +\let\endlandscape\relax + +\newenvironment*{landscape}{}{} % \end{macrocode} % % \iffalse @@ -71775,12 +72916,13 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \end{macrocode} % % The \env{window} is floated by a \env{BlockClass} style. +% \changes{v0.896}{2021/03/05}{\pkg{picinpar}: Added \ARIA\ role.} % \begin{macrocode} \long\def\LWR@HTML@window[#1,#2,#3,#4] {% \if #2r% - \begin{BlockClass}[float:right]{marginblock}% + \begin{BlockClass}[float:right](note){marginblock}% \else% - \begin{BlockClass}[float:left]{marginblock}% + \begin{BlockClass}[float:left](note){marginblock}% \fi% #3\par% #4% @@ -74372,7 +75514,22 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \NewDocumentCommand{\ofoot}{s o m}{} \NewDocumentCommand{\cfoot}{s o m}{} \NewDocumentCommand{\ifoot}{s o m}{} +% \end{macrocode} +% \changes{v0.896}{2021/03/13}{\pkg{scrlayer-scrpage}: Added \cs{automark}, \cs{manualmark}.} +% \begin{macrocode} +\NewDocumentCommand{\automark}{som}{} +\newcommand*{\manualmark}{} +% \end{macrocode} +% \begin{macrocode} \DeclareDocumentCommand{\MakeMarkcase}{m}{#1} +% \end{macrocode} +% \changes{v0.896}{2021/03/13}{\pkg{scrlayer-scrpage}: Added \cs{headmeark}, \cs{pagemark}.} +% \begin{macrocode} +\let\headmark\leftmark +\providecommand{\pnumfont}{\normalfont}% +\DeclareRobustCommand\pagemark{{\pnumfont{\thepage}}}% +% \end{macrocode} +% \begin{macrocode} \newcommand*{\defpairofpagestyles}[3][]{} \newcommand*{\newpairofpagestyles}[3][]{} \newcommand*{\renewpairofpagestyles}[3][]{} @@ -75267,7 +76424,10 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \end{macrocode} % % -% The following patch \pkg{sidenotes} for use with \pkg{lwarp}: +% The following patch \pkg{sidenotes} for use with \pkg{lwarp}. +% +% An \ARIA\ |note| role is not assigned since the caption is an +% important part of the figure. % % \begin{noindmacro}{\sidecaption} * \oarg{entry} \oarg{offset} \marg{text} % \changes{v0.47}{2018/01/30}{\pkg{sidenotes}: Fix for \SVG\ math in captions.} @@ -75280,7 +76440,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \captionsetup{style=sidecaption}% \IfBooleanTF{#1} { % starred - \begin{BlockClass}[border:none ; box-shadow:none]{marginblock} + \begin{BlockClass}[border:none ; box-shadow:none]{marginblock}% \caption*{#4}% \end{BlockClass} } @@ -75288,7 +76448,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \IfNoValueOrEmptyTF{#2} {\def\@sidenotes@sidecaption@tof{#4}} {\def\@sidenotes@sidecaption@tof{#2}} - \begin{BlockClass}[border:none ; box-shadow:none]{marginblock} + \begin{BlockClass}[border:none ; box-shadow:none]{marginblock}% \caption[\@sidenotes@sidecaption@tof]{#4} \end{BlockClass} } @@ -77821,7 +78981,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', }{}% \begingroup% lwarp \LWR@restoreorigformatting% lwarp - \RenewDocumentEnvironment{lateximage}{s o s o o}{}{}% lwarp: inside group + \RenewDocumentEnvironment{lateximage}{s o s o o d()}{}{}% lwarp: inside group \expandafter\LWR@gsavebox\csname\sv@name content\endcsname{#2}% \expandafter\gdef\expandafter#1\expandafter{% \expandafter\begin\expandafter{lateximage\expandafter}% lwarp @@ -79041,21 +80201,17 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \end{noindmacro} - % \begin{noindmacro}{\subfloat@label} % Patches for \cs{sf@sub@label}: % \begin{macrocode} -\def\subfloat@label{% -\LWR@ensuredoingapar% lwarp - \@ifnextchar(% %) match left parenthesis - {\sf@sub@label} - {\sf@sub@label(Sub\@captype\space - \@ifundefined{thechapter}{}{\@nameuse{thechapter}\space}% - \@nameuse{p@sub\@captype}% - \@nameuse{thesub\@captype}.)}} +\xpretocmd{\subfloat@label} + {\LWR@ensuredoingapar} + {} + {\LWR@patcherror{subfig}{subfloat@label}} % \end{macrocode} % \end{noindmacro} + % Patches for \cs{subref}. % % \begin{noindmacro}{\sf@subref} \marg{label} @@ -81010,6 +82166,12 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \begin{macrocode} \gdef\@thm#1#2{\refstepcounter{#1}% \LWR@forcenewpage% lwarp +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{theorem}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \BlockClass{theorembody\LWR@thisthmstyle}% lwarp \trivlist \@topsep \theorempreskipamount % used by first \item @@ -81020,6 +82182,12 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \gdef\@endtheorem{% \endtrivlist +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{\pkg{theorem}: Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \endBlockClass } % \end{macrocode} @@ -81435,8 +82603,12 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', }% }% } +% \end{macrocode} -\renewcommand\TPTL@tnotex[2]{\tnote{\nameref{#2}}} +% \changes{v0.896}{2021/03/13}{\pkg{threeparttablex}: Fix: \cs{TPTL@tnotex} if not referrable.} +% \begin{macrocode} +\providecommand{\TPTL@tnotex}{} +\renewcommand{\TPTL@tnotex}[2]{\tnote{\nameref{#2}}} % \end{macrocode} % % \iffalse @@ -83147,9 +84319,11 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \DeclareDocumentCommand{\cftsetindents}{m m m}{} % \end{macrocode} +% \changes{v0.893}{2021/03/13}{\pkg{tocloft}: Fix: \cs{cftpagenumbersoff}, \cs{cftpagenumberson}.} +% \changes{v0.896}{2021/04/05}{\pkg{tocloft}: Fix: \cs{cftpagenumbersoff}, \cs{cftpagenumberson} with \pkg{memoir}.} % \begin{macrocode} -\newcommand{\pagenumbersoff}[1]{} -\newcommand{\pagenumberson}[1]{} +\providecommand{\cftpagenumbersoff}[1]{} +\providecommand{\cftpagenumberson}[1]{} % \end{macrocode} @@ -83699,13 +84873,13 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \watchout % \pkg{algorithmicx} uses |.loa|. % \pkg{trivfloat} by default starts with |.loa| and goes up for additional floats, -% skipping |.lof| and |.lot|. +% skipping \filenm{.lof} and \filenm{.lot}. % % When using \cs{newfloat}, % \watchout % be sure to manually assign higher letters to the \cs{newfloat} % files to avoid |.loa| used by \pkg{algorithmicx}, and any files used by \pkg{trivfloat}. -% Also avoid using |.lof| and |.lot|. +% Also avoid using \filenm{.lof} and \filenm{.lot}. % % When using \cs{trivfloat}, you may force it to avoid conflicting with % \watchout @@ -85584,6 +86758,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \changes{v0.42}{2017/10/26}{\pkg{wrapfig}: If \progcode{FormatWP} % add explicit \HTML\ style.} % \changes{v0.75}{2019/09/22}{\pkg{wrapfig}: Fix for width.} +% \changes{v0.896}{2021/03/05}{\pkg{wrapfig}: Added \ARIA\ role.} % \begin{macrocode} \newcommand*{\LWR@wrapposition}{} @@ -85603,6 +86778,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', {% width:\LWR@printlength{\LWR@templengthone}; \LWR@wrapposition; % }% +(note)% {marginblock}% % \end{macrocode} % \changes{v0.75}{2019/09/17}{\pkg{wrapfig}: Fix for \cs{linewidth}.} @@ -85881,8 +87057,11 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % Sets \cs{LWR@tempcolor} to the current color. % \begin{macrocode} \renewcommand*{\LWR@findcurrenttextcolor}{% +\LWR@traceinfo{LWR@findcurrenttextcolor}% \protect\colorlet{LWR@current@color}{.}% +\LWR@traceinfo{LWR@findcurrenttextcolor B}% \protect\convertcolorspec{named}{LWR@current@color}{HTML}\LWR@tempcolor% +\LWR@traceinfo{LWR@findcurrenttextcolor: done}% } % \end{macrocode} % \end{noindmacro} @@ -86487,26 +87666,26 @@ height:\LWR@printlength{\LWR@tempheight}% % % % \iffalse -%<*xetexko-vertical> +%<*xetexko> % \fi % -% \part{lwarp-xetexko-vertical.sty} +% \part{lwarp-xetexko.sty} % -% \section{xetexko-vertical} +% \section{xetexko} % % \credits{Dohyun Kim} % -% \DescribePackage{xetexko-vertical} -% \pkg{xetexko-vertical} is patched for use by \pkg{lwarp}. +% \DescribePackage{xetexko} +% \pkg{xetexko} is patched for use by \pkg{lwarp}. % -% \changes{v0.20}{2017/01/11}{\pkg{xetexko-vertical}: Added.} +% \changes{v0.20}{2017/01/11}{\pkg{xetexko}: Added.} % % \codehtml % % \begin{macrocode} -\LWR@loadbefore{xetexko-vertical} +\LWR@loadbefore{xetexko} -\LWR@ProvidesPackagePass{xetexko-vertical}[2018/04/06] +\LWR@ProvidesPackagePass{xetexko}[2021/03/22] % \end{macrocode} % % \begin{macrocode} @@ -86517,7 +87696,7 @@ height:\LWR@printlength{\LWR@tempheight}% % \end{macrocode} % % \iffalse -%</xetexko-vertical> +%</xetexko> % \fi % % @@ -87816,37 +88995,40 @@ height:\LWR@printlength{\LWR@tempheight}% % % \begin{itemize} % \item \cs{@mem@old@label} is the \LaTeX\ definition of \cs{label}. -% \item \cs{LWR@orig@label} adds the \pkg{memoir} definition. +% \item \cs{LWR@orig@label} becomes the \pkg{memoir} definition. % \item \pkg{lwarp}'s \cs{LWR@new@label} uses \cs{LWR@orig@label}. % \item Want \pkg{memoir}'s \cs{label} to use \pkg{lwarp}'s \cs{label}, % which then would use \LaTeX's \cs{label}. % \item So: % \begin{itemize} -% \item \cs{@mem@old@label} becomes \cs{LWR@new@label}. -% \item \cs{LWR@orig@label} becomes \cs{@mem@old@label}. +% \item \cs{@mem@old@label} is set to \cs{LWR@new@label}. +% \item \cs{LWR@orig@label} is set to \cs{@mem@old@label}. % \end{itemize} -% \item \pkg{cleveref} then encapsulates all the above. -% \item For a subcaption, \pkg{cleveref} modifies \pkg{memoir}'s \cs{sf@memsub@label}. +% \item \pkg{cleveref} then encapsulates all the above with \cs{cref@old@label}. +% \item For a subcaption, \pkg{cleveref} modifies \pkg{memoir}'s \cs{sf@memsub@label}, +% but that change is undone by \pkg{lwarp}. % \end{itemize} % \changes{v0.84}{2020/04/05}{\pkg{lwarp-patch-memoir}: Fix: \cs{label}.} % \begin{macrocode} -\let\LWR@orig@label\@mem@old@label -\let\@mem@old@label\LWR@new@label +\LetLtxMacro\LWR@orig@label\@mem@old@label +\LetLtxMacro\@mem@old@label\LWR@new@label % \end{macrocode} % -% Patches for subfloats to support additional \pkg{lwarp} labels: +% Patches for subfloats to support additional \pkg{lwarp} labels. +% This is the non-\pkg{hyperref} version from \pkg{memoir}. % \begin{macrocode} \AtBeginDocument{ \renewcommand*{\sf@@memsub@label}[1]{% \@bsphack \sf@@memsub@label@hook{#1}% - \@memoldlabel{#1}% - \LWR@label@createtag{sub@#1}% +% \@memoldlabel{#1}% + \cref@label{#1}% lwarp + \LWR@label@createtag{sub@#1}% lwarp \protected@write\@auxout{}{% \string\newlabel{sub@#1}% {{\@nameuse{@@thesub\@captype}}% {\thepage}}}% - \LWR@write@lwarplabel{sub@#1}% + \LWR@write@lwarplabel{sub@#1}% lwarp \@esphack } } @@ -88709,10 +89891,11 @@ height:\LWR@printlength{\LWR@tempheight}% % \end{macrocode} % % Borrowed from the \pkg{lwarp} version of \pkg{keyfloat}: +% \changes{v0.896}{2021/03/05}{\pkg{lwarp-patch-memoir}: Added \ARIA\ role.} % \begin{macrocode} \NewDocumentEnvironment{KFLTmemoir@marginfloat}{O{-1.2ex} m} {% start - \LWR@BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}% + \LWR@BlockClassWP{float:right; width:2in; margin:10pt}{}(note){marginblock}% \renewcommand*{\@captype}{#2}% } {% diff --git a/macros/latex/contrib/lwarp/lwarp.ins b/macros/latex/contrib/lwarp/lwarp.ins index 97c0deaed8..0ce71e74ae 100644 --- a/macros/latex/contrib/lwarp/lwarp.ins +++ b/macros/latex/contrib/lwarp/lwarp.ins @@ -97,6 +97,7 @@ version 2005/12/01 or later. \file{lwarp-bussproofs.sty}{\from{lwarp.dtx}{bussproofs}} \file{lwarp-bxpapersize.sty}{\from{lwarp.dtx}{bxpapersize}} \file{lwarp-bytefield.sty}{\from{lwarp.dtx}{bytefield}} +\file{lwarp-ccicons.sty}{\from{lwarp.dtx}{ccicons}} \file{lwarp-cancel.sty}{\from{lwarp.dtx}{cancel}} \file{lwarp-canoniclayout.sty}{\from{lwarp.dtx}{canoniclayout}} \file{lwarp-caption.sty}{\from{lwarp.dtx}{caption}} @@ -120,6 +121,7 @@ version 2005/12/01 or later. \file{lwarp-citeref.sty}{\from{lwarp.dtx}{citeref}} \file{lwarp-CJK.sty}{\from{lwarp.dtx}{CJK}} \file{lwarp-CJKutf8.sty}{\from{lwarp.dtx}{CJKutf8}} +\file{lwarp-classicthesis.sty}{\from{lwarp.dtx}{classicthesis}} \file{lwarp-cleveref.sty}{\from{lwarp.dtx}{cleveref}} \file{lwarp-clrdblpg.sty}{\from{lwarp.dtx}{clrdblpg}} \file{lwarp-cmbright.sty}{\from{lwarp.dtx}{cmbright}} @@ -157,6 +159,7 @@ version 2005/12/01 or later. \file{lwarp-endheads.sty}{\from{lwarp.dtx}{endheads}} \file{lwarp-endnotes.sty}{\from{lwarp.dtx}{endnotes}} \file{lwarp-engtlc.sty}{\from{lwarp.dtx}{engtlc}} +\file{lwarp-enotez.sty}{\from{lwarp.dtx}{enotez}} \file{lwarp-enumerate.sty}{\from{lwarp.dtx}{enumerate}} \file{lwarp-enumitem.sty}{\from{lwarp.dtx}{enumitem}} \file{lwarp-epigraph.sty}{\from{lwarp.dtx}{epigraph}} @@ -368,6 +371,7 @@ version 2005/12/01 or later. \file{lwarp-nowidow.sty}{\from{lwarp.dtx}{nowidow}} \file{lwarp-ntheorem.sty}{\from{lwarp.dtx}{ntheorem}} \file{lwarp-octave.sty}{\from{lwarp.dtx}{octave}} +\file{lwarp-orcidlink.sty}{\from{lwarp.dtx}{orcidlink}} \file{lwarp-overpic.sty}{\from{lwarp.dtx}{overpic}} \file{lwarp-pagegrid.sty}{\from{lwarp.dtx}{pagegrid}} \file{lwarp-pagenote.sty}{\from{lwarp.dtx}{pagenote}} @@ -576,7 +580,7 @@ version 2005/12/01 or later. \file{lwarp-xcolor.sty}{\from{lwarp.dtx}{xcolor}} \file{lwarp-xechangebar.sty}{\from{lwarp.dtx}{xechangebar}} \file{lwarp-xellipsis.sty}{\from{lwarp.dtx}{xellipsis}} -\file{lwarp-xetexko-vertical.sty}{\from{lwarp.dtx}{xetexko-vertical}} +\file{lwarp-xetexko.sty}{\from{lwarp.dtx}{xetexko}} \file{lwarp-xevlna.sty}{\from{lwarp.dtx}{xevlna}} \file{lwarp-xfakebold.sty}{\from{lwarp.dtx}{xfakebold}} \file{lwarp-xfrac.sty}{\from{lwarp.dtx}{xfrac}} diff --git a/macros/latex/contrib/lwarp/lwarp.pdf b/macros/latex/contrib/lwarp/lwarp.pdf Binary files differindex e49cbc84fb..d280510a29 100644 --- a/macros/latex/contrib/lwarp/lwarp.pdf +++ b/macros/latex/contrib/lwarp/lwarp.pdf diff --git a/macros/latex/contrib/lwarp/lwarpmk.lua b/macros/latex/contrib/lwarp/lwarpmk.lua index 95c5d37a13..7357f24b90 100755 --- a/macros/latex/contrib/lwarp/lwarpmk.lua +++ b/macros/latex/contrib/lwarp/lwarpmk.lua @@ -2,7 +2,7 @@ -- Copyright 2016-2021 Brian Dunn -printversion = "v0.895" +printversion = "v0.896" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf Binary files differindex f9d2004bed..98af2c5843 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index 8656d61f09..d92e274140 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -58,7 +58,7 @@ \NewDocumentCommand {\cls} {m} {\textsf{#1}} \setlength{\parindent}{0pt} - +\skip \footins = 2 \bigskipamount \begin{document} @@ -143,7 +143,9 @@ L'idée de \pkg{nicematrix} est de créer des nœuds \textsc{pgf} derrière les tableaux créés par \pkg{array} et de les utiliser pour développer de nouvelles fonctionnalités. Comme toujours avec \textsc{pgf}, les coordonnées de ces nœuds sont écrites dans le fichier |.aux| pour être utilisées à la compilation suivante. C'est pourquoi l'utilisation de \pkg{nicematrix} nécessite \textbf{plusieurs compilations - successives}. + successives}.\footnote{Si vous utilisez Overleaf, Overleaf effectue + automatiquement le nombre de + compilations nécessaire.} \bigskip La plupart des fonctionnalités de \pkg{nicematrix} sont accessibles sans avoir à utiliser explicitement @@ -189,20 +191,25 @@ environnements correspondants de l'\pkg{amsmath} (qui est chargée par \pkg{nicematrix}) : |{matrix}|, |{pmatrix}|, etc. \medskip +\textbf{On conseille d'utiliser prioritairement les environnements classiques et de +n'utiliser les environnements de \pkg{nicematrix} que lorsqu'on utilise les +fonctionnalités supplémentaires offertes par ces environnements (cela permet +d'économiser la mémoire).} + +\medskip Tous les environnements de l'extension \pkg{nicematrix} acceptent, entre crochets, une liste optionnelle de paires de la forme \textsl{clé=valeur}. {\bfseries Il doit n'y avoir aucun espace devant le crochet ouvrant (|[|) de cette liste d'options.} \bigskip -\textbf{Important} +\textbf{Important}\par\nobreak Avant la version 5.0, il fallait, pour des raisons techniques, utiliser les lettres |L|, |C| et |R| au lieu de |l|, |c| et |r| dans les préambules des -environnements de \pkg{nicematrix}. - -Pour pouvoir continuer à utiliser ces lettres |L|, |C| et |R|, \pkg{nicematrix} -doit être chargé avec l'option |define-L-C-R|. +environnements de \pkg{nicematrix}. Pour pouvoir continuer à utiliser ces +lettres |L|, |C| et |R|, \pkg{nicematrix} doit être chargé avec l'option +|define-L-C-R|. \begin{Verbatim} \usepackage[define-L-C-R]{nicematrix} \end{Verbatim} @@ -516,14 +523,16 @@ tableau) ; trace également le cadre avec cette couleur. \item la clé |line-width| fixe la largeur des filets servant pour le cadre (n'a d'intérêt que si |draw| est utilisée) ; -\item \colorbox{yellow!50}{\textbf{Nouveau 5.12}}\enskip la clé -|rounded-corners| impose des coins arrondis (pour le cadre dessiné par |draw| et -le fond dessiné par |fill|) avec un rayon égal à la valeur de cette clé (la -valeur par défaut est 4~pt\footnote{Cette valeur par défaut est la valeur - initiale des \emph{rounded corners} de Tikz.}). -\item \colorbox{yellow!50}{\textbf{Nouveau 5.13}}\enskip la clé |borders| permet -de ne tracer que certaines des bordures du bloc : cette clé prend comme valeur -une liste d'éléments parmi les suivants : |left|, |right|, |top| et |bottom|. +\item la clé |rounded-corners| impose des coins arrondis (pour le cadre dessiné +par |draw| et le fond dessiné par |fill|) avec un rayon égal à la valeur de +cette clé (la valeur par défaut est 4~pt\footnote{Cette valeur par défaut est la + valeur initiale des \emph{rounded corners} de Tikz.}) ; +\item la clé |borders| permet de ne tracer que certaines des bordures du bloc : +cette clé prend comme valeur une liste d'éléments parmi les suivants : |left|, +|right|, |top| et |bottom| ; +\item \colorbox{yellow!50}{\bfseries Nouveau 5.14}\enskip les clés |t| et |b| +réglent la ligne de base qui sera donnée au bloc quand celui-ci est constitué de +plusieurs lignes (séparées par la commande |\\|). \end{itemize} @@ -641,6 +650,8 @@ la consigne générale donnée dans le préambule pour cette colonne. |rounded-corners|.\footnote{Pour colorier simplement le fond d'une case, il n'y a pas besoin d'utiliser un bloc mono-case : on peut utiliser la commande |\cellcolor| si la clé |colortbl-like| est utilisée : voir p.~\pageref{colortbl-like}.} + +\item On peut tracer ou plusieurs bordures de la case avec la clé |borders|. \end{itemize} \medskip @@ -752,7 +763,8 @@ Marie & Pauline \\ \hline \bigskip En revanche, les filets verticaux ne sont pas tracés à l'intérieur des blocs -(créés par |\Block|: cf.~p.~\pageref{Block}). +(créés par |\Block|: cf.~p.~\pageref{Block}) ni dans les coins (dont la création +est demandée par la clé |corners|: cf.~p.~\pageref{corners}). \bigskip @@ -903,30 +915,48 @@ p.~\pageref{OnlyMainNiceMatrix}. \bigskip -\subsection{La commande \textbackslash Hline} +\subsection{Les outils de nicematrix pour tracer des filets} -On a dit que les traits verticaux spécifiés par un symbole «\verb+|+» dans le -préambule (pour les environnements à préambule, bien entendu) n'étaient pas -tracés dans les blocs.\footnote{Ces blocs sont ceux créés par les commandes - \verb|\Block| et \verb|\multicolumn| mais aussi ceux délimités implicitement - par des lignes en pointillés continues (créées par \verb|\Cdots|, etc.).} +Les outils proposés par \pkg{nicematrix} pour tracer des filets sont les +suivants : +\begin{itemize} +\item les clés |hlines|, |vlines| et |hvlines| ; +\item le spécificateur «\verb+|+» dans le préambule (pour les environnements à +préambule) ; +\item la commande |\Hline|. +\end{itemize} -\smallskip -\colorbox{yellow!50}{\textbf{Nouveau 5.13}}\enskip Pour proposer des filets horizontaux -ayant le même comportement, l'extension \pkg{nicematrix} fournit la commande -|\Hline|. +\bigskip +\textbf{Ces outils ont en commun de ne pas tracer les filets dans les blocs ni + dans les coins vides (quand la clé |corners| est utilisée).} +\begin{itemize} +\item Les blocs en question sont : +\begin{itemize} +\item ceux créés par la commande |\Block|\footnote{Et aussi la commande \verb|\multicolumn| même s'il + est recommandé d'utiliser plutôt \verb|\Block| quand on utilise l'extension + \pkg{nicematrix}.} de \pkg{nicematrix} présentée +p.~\pageref{Block}; +\item ceux délimités implicitement par des lignes en pointillés continues, créées +par |\Cdots|, |\Vdots|, etc. : cf.~p.~\pageref{Cdots}. +\end{itemize} +\item Les coins sont créés par la clé |corners| détaillée un peu plus loin : cf. +p.~\pageref{corners}. +\end{itemize} +En particulier, cette remarque explique la différence entre la commande standard +|\hline| et la commande |\Hline| proposée par \pkg{nicematrix}. \bigskip -\subsection{Les clés hlines et vlines} +\subsubsection{Les clés hlines et vlines} -La clé |hlines| demande un tracé de tous les filets horizontaux et la clé -|vlines| demande un tracé de tous les filets verticaux (sauf dans les blocs, -créés par |\Block| et dans les blocs virtuels déterminés par des lignes en -pointillés : |\Cdots|, |\Vdots|, etc.). En fait, dans les environnements avec -délimiteurs (comme |{pNiceMatrix}| ou |{bNiceArray}|), les filets extérieurs ne -sont pas tracés (ce qui est le comportement certainement attendu). +\medskip +Les clés |hlines| et |vlines| (qui, bien sûr, tracent des filets horizontaux et +verticaux) prennent comme valeur une liste de numéros qui sont les numéros des +filets à tracer. Si aucune valeur n'est donnée, tous les filets sont tracés. +En fait, pour les environnements avec délimiteurs (comme |{pNiceMatrix}| ou +|{bNiceArray}|), la clé |vlines| ne trace pas les filets extérieurs (ce qui est +le comportement certainement attendu). \medskip \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -942,25 +972,19 @@ $\begin{pNiceMatrix}[vlines,rules/width=0.2pt] 1 & 2 & 3 & 4 & 5 & 6 \end{pNiceMatrix}$ -\medskip -\colorbox{yellow!50}{\textbf{Nouveau 5.13}}\enskip Il est possible de donner à -la clé |vlines| une liste de numéros qui seront les numéros des filets verticaux -qui seront tracés. Il en est de même pour |hlines|. -\subsection{La clé hvlines} +\subsubsection{La clé hvlines} \label{hvlines} -La clé |hvlines| demande le tracé de tous les filets horizontaux et verticaux -(sauf dans les blocs et dans les blocs virtuels déterminés par des -lignes en pointillés et sauf les filets correspondants à des clés |draw| de -commandes |\Block|, filets qui sont tracés avec leurs caractéristiques). +La clé |hvlines|, qui ne prend pas de valeur, est la conjonction des clés +|hlines| et |vlines|. -\medskip +\smallskip \begin{Verbatim} \begin{NiceTabular}{cccc}[~emphase#hvlines@,rules/color=blue,rules/width=1pt] rose & tulipe & marguerite & dahlia \\ -violette & \Block[~emphase#draw=red@]{2-2}{\LARGE fleurs} & & souci \\ +violette & \Block[draw=red]{2-2}{\LARGE fleurs} & & souci \\ pervenche & & & lys \\ arum & iris & jacinthe & muguet \end{NiceTabular} @@ -975,78 +999,116 @@ arum & iris & jacinthe & muguet \end{NiceTabular} \end{center} +\bigskip +\subsubsection{Les coins (vides)} +\label{corners} -\subsection{La clé hvlines-except-corners} +Les quatre coins d'un tableau seront notés |NW|, |SW|, |NE| et |SE| (\emph{north west}, \emph{south west}, \emph{north + east} et \emph{south east} en anglais). -\label{except-corners} +\smallskip +Pour chacun de ces coins, on appellera \emph{coin vide} (ou tout simplement +\emph{coin}) la réunion de toutes les cases vides situées dans au moins un +rectangle entièrement constitué de cases vides partant de ce coin.\footnote{Pour + être complet, on doit préciser que toute case située dans un bloc (même si + elle vide) n'est pas prise en compte pour la détermination des coins. Ce + comportement est naturel.} -La clé |hvlines-except-corners| demande le tracé de tous les filets horizontaux -et verticaux sauf dans les blocs (y compris dans les blocs virtuels déterminés par des -lignes en pointillés) et sauf dans les coins vides. +\smallskip +On peut néanmoins imposer à une case sans contenu d'être considérée +comme non vide par \pkg{nicematrix} avec la commande |\NotEmpty|. -\medskip -\begin{Verbatim} -\begin{NiceTabular}{*{6}{c}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt] +\bigskip +\begin{minipage}{9cm} +Dans l'exemple ci-contre (où B est au centre d'un bloc de taille $2\times 2$), +on a colorié en bleu clair les quatre coins (vides) du tableau. +\end{minipage}\hspace{2cm}% +\begin{NiceTabular}{*{6}{c}}[cell-space-top-limit=3pt] +\CodeBefore + \rectanglecolor{blue!10}{1-1}{4-2} + \rectanglecolor{blue!10}{1-1}{1-4} + \rectanglecolor{blue!10}{1-6}{3-6} + \rectanglecolor{blue!10}{7-1}{9-1} + \rectanglecolor{blue!10}{7-5}{9-6} +\Body & & & & A \\ & & A & A & A \\ & & & A \\ & & A & A & A & A \\ A & A & A & A & A & A \\ A & A & A & A & A & A \\ + & A & A & A \\ & \Block{2-2}{B} & & A \\ & & & A \\ - & A & A & A \\ \end{NiceTabular} -\end{Verbatim} -% -\begin{center} -\begin{NiceTabular}{*{6}{c}}[hvlines-except-corners,cell-space-top-limit=3pt] + + +\bigskip +\colorbox{yellow!50}{\textbf{Nouveau 5.14}}\enskip Quand la clé |corners| est +utilisée, \pkg{nicematrix} calcule les coins vides et ces coins sont alors pris +en compte par les outils de tracés de filets (les filets ne seront pas tracés +dans ces coins vides). \emph{Remarque} : Dans les versions précédentes de +\pkg{nicematrix}, il n'y avait qu'une clé |hvlines-except-corners| (maintenant +considérée comme obsolète). + +\bigskip +\begin{BVerbatim}[boxwidth=11cm,baseline=c] +\NiceMatrixOptions{cell-space-top-limit=3pt} +\begin{NiceTabular}{*{6}{c}}[~emphase#corners@,hvlines] & & & & A \\ & & A & A & A \\ & & & A \\ & & A & A & A & A \\ A & A & A & A & A & A \\ A & A & A & A & A & A \\ + & A & A & A \\ & \Block{2-2}{B} & & A \\ & & & A \\ +\end{NiceTabular} +\end{BVerbatim} +\begin{NiceTabular}{*{6}{c}}[corners,hvlines,cell-space-top-limit=3pt] + & & & & A \\ + & & A & A & A \\ + & & & A \\ + & & A & A & A & A \\ +A & A & A & A & A & A \\ +A & A & A & A & A & A \\ & A & A & A \\ + & \Block{2-2}{B} & & A \\ + & & & A \\ \end{NiceTabular} -\end{center} - -Comme on le voit, un «coin vide» est constitué de la réunion de tous les -rectangles vides partant de la case située exactement dans le coin. -\bigskip -On peut passer en argument de |\hvlines-except-corners| une liste de coins à -prendre en considération, les coins étant désignés par |NW|, |SW|, |NE| et |SE| -(\emph{north west}, \emph{south west}, \emph{north east} et \emph{south east}). +\vspace{1cm} +On peut aussi donner comme valeur à la clé |corners| une liste de coins à +prendre en considération (les coins sont notés |NW|, |SW|, |NE| et |SE| et +doivent être séparés par des virgules). \medskip \begin{BVerbatim}[boxwidth=11cm,baseline=c] -\begin{NiceTabular}{*{6}{c}}% - [~emphase#hvlines-except-corners=NE@,cell-space-top-limit=3pt] +\NiceMatrixOptions{cell-space-top-limit=3pt} +\begin{NiceTabular}{*{6}{c}}[~emphase#corners=NE@,hvlines] 1\\ 1&1\\ 1&2&1\\ 1&3&3&1\\ 1&4&6&4&1\\ -1&5&10&10&5&1 + & & & & &1 \end{NiceTabular} \end{BVerbatim} \begin{NiceTabular}{*{6}{c}}% - [c,hvlines-except-corners=NE,cell-space-top-limit=3pt] + [c,corners=NE,hvlines,cell-space-top-limit=3pt] 1\\ 1&1\\ 1&2&1\\ 1&3&3&1\\ 1&4&6&4&1\\ -1&5&10&10&5&1 + & & & & &1 \end{NiceTabular} -\medskip +\bigskip $\triangleright$ Le concept de coins est aussi utilisé par la commande |\arraycolor| dans le |\CodeBefore| qui accepte en option une clé -|except-corners| : cf.~p.~\pageref{arraycolor}. +|except-corners|: cf.~p.~\pageref{arraycolor}. \subsection{La commande \textbackslash diagbox} @@ -1202,9 +1264,9 @@ L'extension \pkg{nicematrix} fournit une clé |code-before| pour du code qui ser exécuté avant le tracé du tableau. \smallskip -\colorbox{yellow!50}{\textbf{Nouveau 5.12}}\enskip Une syntaxe alternative est -proposée : on peut placer le contenu de ce |code-before| entre les mots-clés -|\CodeBefore| et |\Body| juste au début de l'environnement. +Une syntaxe alternative est proposée : on peut placer le contenu de ce +|code-before| entre les mots-clés |\CodeBefore| et |\Body| juste au début de +l'environnement. \begin{Verbatim} \begin{pNiceArray}{~textsl#preamble@} @@ -1216,7 +1278,7 @@ proposée : on peut placer le contenu de ce |code-before| entre les mots-clés \end{Verbatim} \smallskip -De nouvelles commandes sont disponibles dans ce |\CodeBefore| : +De nouvelles commandes sont disponibles dans ce |\CodeBefore|: |\cellcolor|, |\rectanglecolor|, |\rowcolor|, |\columncolor|, |\rowcolors| |\chessboardcolors| et |\arraycolor|.\footnote{On pourra remarquer que, dans le \verb|\CodeBefore|, des nœuds PGF/Tikz de la forme \verb+(i-|j)+ correspondant @@ -1369,12 +1431,12 @@ correspond à l'espace colorimétrique). Les clés disponibles sont |cols|, \begin{itemize} \item La clé |cols| décrit un ensemble de colonnes sur lesquelles portera l'effet de |\rowcolors|. Cet ensemble de colonnes est une liste d'intervalles de -la forme $i$|-|$j$. +la forme $i$|-|$j$ (où $i$ et $j$ peuvent être remplacés par |*|). \item Avec la clé |restart|, chacun des intervalles de rangées spécifié par le premier argument de |\rowcolors| recommence avec la même couleur.\footnote{Autrement, la couleur d'une rangée ne dépend que de la parité - de son numéro.} + de son numéro absolu.} \item Avec la clé |respect-blocks|, qui est de type booléen, les «rangées» @@ -1488,13 +1550,12 @@ $\begin{pNiceMatrix}[baseline=1, r, margin] On a utilisé la clé |r| qui impose que toutes les colonnes soient alignées à droite (cf. p.~\pageref{key-R}). -\item \colorbox{yellow!50}{\textbf{Nouveau 5.13}}\enskip La commande -|\arraycolor| prend en argument obligatoire une couleur et colorie tout le -tableau (sauf les éventuelles rangées et colonnes extérieures: cf.~p.~\pageref{exterior}) avec cette -couleur. Elle est surtout intéressante du fait de la clé |except-corners| -qu'elle accepte entre crochets en troisième argument (optionnel). La définition -des coins a été donnée p.~\pageref{except-corners} quand on a présenté la clé -|hvlines-except-corners|. +\item La commande |\arraycolor| prend en argument obligatoire une couleur et +colorie tout le tableau (sauf les éventuelles rangées et colonnes extérieures: +cf.~p.~\pageref{exterior}) avec cette couleur. Elle est surtout intéressante du +fait de la clé |except-corners| qu'elle accepte entre crochets en troisième +argument (optionnel). La définition des coins a été donnée p.~\pageref{corners} +quand on a présenté la clé~|corners|. \label{arraycolor} @@ -2406,10 +2467,10 @@ b & a & b & \Ddots & & \Vdots \\ Les lignes pointillées délimitent des blocs virtuels qui ont le même comportement vis à vis des filets que les blocs créés par |\Block| (les filets -spécifiés par le spécificateur \verb+|+ dans le préambule et par les clés -|vlines|, |hlines|, |hvlines| et |hvlines-except-corners| ne sont pas tracés -dans les blocs). - +spécifiés par le spécificateur \verb+|+ dans le préambule, la commande |\Hline| +et par les clés |vlines|, |hlines| et |hvlines| ne sont pas tracés dans les +blocs).\footnote{En revanche, la commande \verb|\line| dans le \verb|\CodeAfter| + (cf.~p.~\pageref{line-in-code-after}) ne crée pas de bloc.} \medskip \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -2433,7 +2494,7 @@ $\begin{bNiceMatrix}[margin,hvlines] \label{code-after} On a présenté p.~\pageref{code-before} la clé |code-before|. Il existe en fait une clé similaire |code-after| qui peut être utilisée pour indiquer du code qui -sera exécuté après la construction du tableau. +sera exécuté \emph{après} la construction du tableau. \medskip Pour améliorer la lisibilité du code, une syntaxe alternative est proposée : on @@ -2454,12 +2515,17 @@ Par ailleurs, deux commandes spéciales sont disponibles dans le |\CodeAfter| : \subsection{La commande \textbackslash line dans le \textbackslash CodeAfter} +\label{line-in-code-after} La commande |\line| permet de tracer directement des lignes en pointillés entre les cases. Elle prend deux arguments correspondant aux deux cases à relier, chacun de la forme $i$-$j$ où $i$ est le numéro de ligne et $j$ est le numéro de -colonne. Elle peut par exemple être utilisée pour tracer une ligne entre deux -cases adjacentes comme dans l'exemple suivant. -\label{line-in-code-after} +colonne. Les options disponibles pour personnaliser les lignes pointillées créées par +|\Cdots|, |\Vdots|, etc. peuvent aussi être passées à cette commande (cf. +p.~\pageref{customization}). + +\medskip +Cette commande peut par exemple être utilisée pour tracer une ligne entre deux +cases adjacentes. \medskip \begin{BVerbatim}[baseline=c,boxwidth=11cm] @@ -2483,10 +2549,29 @@ I & 0 & \Cdots &0 \\ \end{pNiceMatrix}$ \end{scope} +\bigskip +Elle peut aussi être utilisée pour tracer une ligne diagonale non parallèle aux +autres lignes diagonales (par défaut, les lignes tracées par |\Ddots| sont +«parallélisées» : cf~p.~\pageref{parallelization}). + \medskip -Les options disponibles pour personnaliser les lignes pointillées créées par -|\Cdots|, |\Vdots|, etc. peuvent aussi être passées à cette commande (cf. -p.~\pageref{customization}). +\begin{BVerbatim} +\begin{bNiceMatrix} +1 & \Cdots & & 1 & 2 & \Cdots & 2 \\ +0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\ +\Vdots & \Ddots & & & & & \\ +0 & \Cdots & 0 & 1 & 2 & \Cdots & 2 +~emphase#\CodeAfter \line[shorten=6pt]{1-5}{4-7}@ +\end{bNiceMatrix} +\end{BVerbatim} +\[\begin{bNiceMatrix} +1 & \Cdots & & 1 & 2 & \Cdots & 2 \\ +0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\ +\Vdots & \Ddots & & & & & \\ +0 & \Cdots & 0 & 1 & 2 & \Cdots & 2 +\CodeAfter \line[shorten=6pt]{1-5}{4-7} +\end{bNiceMatrix}\] + \subsection{La commande \textbackslash SubMatrix dans le \textbackslash CodeAfter} @@ -3314,7 +3399,8 @@ lignes en pointillés entre les cases du tableau. \smallskip Néanmoins, on peut forcer la création d'un nœud avec la commande |\NotEmpty|.\footnote{Il faut toutefois remarquer qu'avec cette commande, la case est considérée comme non vide, ce qui a des conséquences sur le tracé des -lignes pointillées (cf.~p.~\pageref{Cdots}).} +lignes pointillées (cf.~p.~\pageref{Cdots}) et la déterminations des «coins» +(cf. p.~\pageref{corners}).} \bigskip Tous les nœuds du document doivent avoir des noms deux à deux distincts et le @@ -3632,25 +3718,28 @@ noix & noisette & brugnon \label{noeuds-i} -\colorbox{yellow!30}{Nouveau 5.11}\enskip L'extension \pkg{nicematrix} -crée un nœud PGF-Tikz nommé simplement $i$ (précédé du préfixe habituel) à -l'intersection du filet horizontal de numéro $i$ et du filet vertical de -numéro~$j$ (ou plutôt la position potentielle de ces filets car ils ne sont -peut-être pas tracés). Ces nœuds sont accessibles dans le |\CodeAfter| mais -aussi dans le |code-before|. +L'extension \pkg{nicematrix} crée un nœud PGF-Tikz nommé simplement $i$ (précédé +du préfixe habituel) à l'intersection du filet horizontal de numéro $i$ et du +filet vertical de numéro~$i$ (ou plutôt la position potentielle de ces filets +car ils ne sont peut-être pas tracés). Le dernier nœud a aussi un alias nommé +simplement |last|. + +\smallskip +\colorbox{yellow!50}{\textbf{Nouveau 5.14}}\enskip Il existe aussi un nœud nommé +$i$|.5| à mi-chemin entre le nœud $i$ et le nœud $i+1$. +Ces nœuds sont accessibles dans le +|\CodeAfter| mais aussi dans le |\CodeBefore|. -\colorbox{yellow!50}{Nouveau 5.13}\enskip Le dernier nœud a aussi un alias nommé -|last|. \begin{center} \begin{NiceTabular}{ccc}[hvlines,rules={width=1pt,color=gray}] -rose & tulipe & lys \\ -arum & iris & violette \\ -muguet & dahlia & souci + & tulipe & lys \\ +arum & & violette mauve \\ +muguet & dahlia \CodeAfter \tiny \begin{tikzpicture} -\foreach \i in {1,2,3,4} +\foreach \i in {1,1.5,2,2.5,3,3.5,4} { \fill [red] (\i) circle (0.5mm) ; \node [red,above right] at (\i) {\i} ; @@ -3663,7 +3752,7 @@ muguet & dahlia & souci \bigskip Si on utilise Tikz (on rappelle que \pkg{nicematrix} ne charge pas Tikz mais uniquement \textsc{pgf} qui est une sous-couche de Tikz), on peut donc accéder -(dans le |\CodeAfter| mais aussi dans le |code-before|) à l'intersection du filet +(dans le |\CodeAfter| mais aussi dans le |\CodeBefore|) à l'intersection du filet horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|. @@ -3700,8 +3789,30 @@ horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|. 1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1 \end{NiceMatrix}\] +\bigskip +Les nœuds de la forme $i$|.5| peuvent être utilisés par exemple pour barrer une +ligne (si on a chargé Tikz). + +\smallskip +\begin{BVerbatim}[boxwidth=11cm,baseline=c] +$\begin{pNiceArray}{ccc|c} +2 & 1 & 3 & 0 \\ +3 & 3 & 1 & 0 \\ +3 & 3 & 1 & 0 +\CodeAfter + \tikz \draw [red] (~emphase#3.5@-|1) -- (~emphase#3.5@-|last) ; +\end{pNiceArray}$ +\end{BVerbatim} +$\begin{pNiceArray}{ccc|c} +2 & 1 & 3 & 0 \\ +3 & 3 & 1 & 0 \\ +3 & 3 & 1 & 0 +\CodeAfter + \tikz \draw [red] (3.5-|1) -- (3.5-|last) ; +\end{pNiceArray}$ -\subsection{Les nœuds correspondant aux commandes \textbackslash SubMatrix} + +\subsection{Les nœuds correspondants aux commandes \textbackslash SubMatrix} \label{node-sub-matrix} @@ -3880,6 +3991,8 @@ est sans effet. \subsection{Lignes diagonales} +\label{parallelization} + Par défaut, toutes les lignes diagonales\footnote{On parle des lignes créées par |\Ddots| et non des lignes créées par une commande |\line| dans le |\CodeAfter|.} d'un même tableau sont «parallélisées». Cela signifie que la @@ -4382,9 +4495,8 @@ précédentes. C'est que les parenthèses, en LaTeX, n'ont pas toutes la même largeur suivant leur taille. \medskip -\colorbox{yellow!50}{\textbf{Nouveau 5.12}}\enskip Pour résoudre ce problème, on -peut demander que les délimiteurs soient composés avec leur largeur maximale -grâce à la clé booléenne |delimiters/max-width|. +Pour résoudre ce problème, on peut demander que les délimiteurs soient composés +avec leur largeur maximale grâce à la clé booléenne |delimiters/max-width|. \begin{Verbatim}[formatcom=\small\color{gray}] ~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@ diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index 38269b145c..fb4ebed732 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{5.13} -\def\myfiledate{2021/03/23} +\def\myfileversion{5.14} +\def\myfiledate{2021/04/08} % % %<*batchfile> @@ -70,6 +70,7 @@ version 2005/12/01 or later. \usepackage{varwidth} \def\LetterAt{@} \parindent 0pt +\skip \footins = 2 \bigskipamount \EnableCrossrefs \makeatletter @@ -190,7 +191,8 @@ version 2005/12/01 or later. % use these nodes to develop new features. As usual with \textsc{pgf}, the % coordinates of these nodes are written in the |.aux| to be used on the next % compilation and that's why \pkg{nicematrix} may need \textbf{several -% compilations}. +% compilations}.\footnote{If you use Overleaf, Overleaf will do automatically +% the right number of compilations.} % % \bigskip % Most features of \pkg{nicematrix} may be used without explicit use of @@ -239,13 +241,18 @@ version 2005/12/01 or later. % corresponding environments of \pkg{amsmath} (which is loaded by % \pkg{nicematrix}): |{matrix}|, |{pmatrix}|, etc. % +% \medskip +% \textbf{It's recommended to use primarily the classical environments and to use the +% environments of \pkg{nicematrix} only when some feature provided by these +% environments is used (this will save memory).} +% % \medskip % All the environments of the package \pkg{nicematrix} accept, between square % brackets, an optional list of \textsl{key=value} pairs. \textbf{There must be % no space before the opening bracket (|[|) of this list of options.} % %\bigskip -% \textbf{Important} +% \textbf{Important}\par\nobreak % % Before the version 5.0, it was mandatory to use, for technical reasons, the % letters |L|, |C| et |R| instead of |l|, |c| et |r| in the preambles of the @@ -561,15 +568,16 @@ version 2005/12/01 or later. % content of the block but draws also the frame of the block with that color; % \item the key |line-width| is the width (thickness) of the frame (this key % should be used only when the key |draw| is in force); -% \item \colorbox{yellow!50}{\textbf{New 5.12}}\enskip the key |rounded-corners| -% requires rounded corners (for the frame drawn by |draw| and the shape drawn by -% |fill|) with a radius equal to the value of that key (the default value is -% 4~pt\footnote{This value is the initial value of the \emph{rounded corners} of -% Tikz.}). -% \item \colorbox{yellow!50}{\textbf{New 5.13}}\enskip the key |borders| provides -% the ability to draw only some borders of the blocks; the value of that key is -% a (comma-separated) list of elements covered by |left|, |right|, |top| and -% |bottom|. +% \item the key |rounded-corners| requires rounded corners (for the frame drawn +% by |draw| and the shape drawn by |fill|) with a radius equal to the value of +% that key (the default value is 4~pt\footnote{This value is the initial value +% of the \emph{rounded corners} of Tikz.}); +% \item the key |borders| provides the ability to draw only some borders of the +% blocks; the value of that key is a (comma-separated) list of elements covered +% by |left|, |right|, |top| and |bottom|; +% \item \colorbox{yellow!50}{\bfseries New 5.14}\enskip the keys |t| and |b| fix +% the base line that will be given to the block when it has a multi-line content +% (the lines are separated by |\\|). % \end{itemize} % % \interitem @@ -679,6 +687,8 @@ version 2005/12/01 or later. % background of a unique celle, there is no point using the command |\Block|: % it's possible to use the command |\cellcolor| (when the key |colortbl-like| is % used).} +% +% \item It's possible to draw one or several borders of the cell with the key |borders|. % \end{itemize} % % \bigskip @@ -785,7 +795,8 @@ version 2005/12/01 or later. % % \bigskip % However, the vertical rules are not drawn in the blocks (created by |\Block|: -% cf.~p.~\pageref{Block}). +% cf.~p.~\pageref{Block}) nor in the corners (created by the key |corner|: +% cf.~p.~\pageref{corners}). % % \bigskip % If you use \pkg{booktabs} (which provides |\toprule|, |\midrule|, @@ -926,26 +937,45 @@ version 2005/12/01 or later. % page~\pageref{OnlyMainNiceMatrix}. % % -% \subsection{The command \textbackslash Hline} +% \subsection{The tools of nicematrix for the rules} % -% We have said that the vertical rules specified by a symbol ``\verb+|+'' in the -% preamble (for the environments with preamble, of course) are not drawn in the -% blocks.\footnote{Those blocks are those created by the commands \verb|\Block| -% and |\multicolumn| but also those implicitely determined by the continuous -% dotted lines (created by \verb|\Cdots|, etc.).} +% Here are the tools provided by \pkg{nicematrix} for the rules. +% \begin{itemize} +% \item the keys |hlines|, |vlines| and |hvlines|; +% \item the specifier ``\verb+|+'' in the preamble (for the environments with +% preamble); +% \item the command |\Hline|. +% \end{itemize} +% +% \medskip +% \textbf{All these tools don't draw the rules in the blocks nor in the +% empty corners (when the key |corners| is used).} +% \begin{itemize} +% \item These blocks are: +% \begin{itemize} +% \item the blocks created by the command |\Block|\footnote{And also the command \verb|\multicolumn| also +% it's recommended to use instead |\Block| in the environments of +% \pkg{nicematrix}.} presented +% p.~\pageref{Block}; +% \item the blocks implicitely delimited by the continuous dotted lines created +% by |\Cdots|, |Vdots|, etc. (cf.~p.~\pageref{Cdots}). +% \end{itemize} +% \item The corners are created by the key |corners| explained below (see p.~\pageref{corners}). +% \end{itemize} % -% \smallskip -% \colorbox{yellow!50}{\textbf{New 5.13}}\enskip In order to have horizontal -% rules with the same behaviour, \pkg{nicematrix} provides the command |\Hline|. +% In particular, this remark explains the difference between the standard +% command |\hline| and the command |\Hline| provided by \pkg{nicematrix}. % % -% \subsection{The keys hlines and vlines} +% \subsubsection{The keys hlines and vlines} % -% The key |hlines| draws all the horizontal rules and the key |vlines| draws all -% the vertical rules excepted in the blocks, created by |\Block| and the virtual -% blocks determined by dotted lines: |\Cdots|, |\Vdots|, etc.. In fact, in the -% environments with delimiters (as |{pNiceMatrix}| or |{bNiceArray}|) the -% exterior rules are not drawn (as expected). +% The keys |hlines| and |vlines| (which draw, of course, horizontal and vertical +% rules) take in as value a list of numbers which are the numbers of the rules +% to draw. +% +% In fact, for the environments with delimiters (such as |{pNiceMatrix}| or +% |{bNiceArray}|), the key |vlines| don't draw the exterior rules (this is +% certainly the expected behaviour). % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -962,21 +992,13 @@ version 2005/12/01 or later. % \end{pNiceMatrix}$ % % -% \bigskip -% \colorbox{yellow!50}{\textbf{New 5.13}}\enskip It's possible to provide to the -% key |vlines| a (comma-separated) list of numbers, which are the numbers of the -% vertical rules to draw. The key |hlines| has a similar behaviour. % -% -% \subsection{The key hvlines} +% \subsubsection{The key hvlines} % \label{hvlines} % -% The key |hvlines| draws all the vertical and horizontal rules (excepted -% in the blocks and the virtual blocks determined by dotted lines and excepted -% the rules corresponding of the frame of the blocks using the key |draw| which -% are drawn with their own characteristics). +% The key |hvlines| (no value) is the conjonction of the keys |hlines| and |vlines|. % -% \medskip +% \smallskip % \begin{Verbatim} % \setlength{\arrayrulewidth}{1pt} % \begin{NiceTabular}{cccc}[~emphase#hvlines@,rules/color=blue] @@ -998,71 +1020,104 @@ version 2005/12/01 or later. % \end{center} % % -% \subsection{The key hvlines-except-corners} +% \subsubsection{The (empty) corners} % -% \label{except-corners} +% \label{corners} % -% The key |hvlines-except-corners| draws all the horizontal and vertical rules, -% excepted in the blocks (and the virtual blocks determined by dotted lines) and -% excepted in the empty corners. +% The four |corners| of an array will be designed by |NW|, |SW|, |NE| and |SE| +% (\emph{north west}, \emph{south west}, \emph{north east} and \emph{south east}). % -% \medskip -% \begin{Verbatim} -% \begin{NiceTabular}{*{6}{c}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt] +% For each of these corners, we will call \emph{empty corner} (or simply +% \emph{corner}) the reunion of all the empty rectangles starting from the cell +% actually in the corner of the array.\footnote{For sake of completeness, we +% should also say that a cell contained in a block (even an empty cell) is not +% taken into account for the determination of the corners. That behaviour is natural.} +% +% However, it's possible, for a cell without content, to require \pkg{nicemarix} +% to consider that cell as not empty with the key |\NotEmpty|. +% +%\bigskip +% \begin{minipage}{9cm} +% In the example on the right (where B is in the center of a block of size +% $2\times2$), we have colored in blue the four (empty) corners of the array. +% \end{minipage}\hspace{2cm}% +% \begin{NiceTabular}{*{6}{c}}[cell-space-top-limit=3pt] +% \CodeBefore +% \rectanglecolor{blue!10}{1-1}{4-2} +% \rectanglecolor{blue!10}{1-1}{1-4} +% \rectanglecolor{blue!10}{1-6}{3-6} +% \rectanglecolor{blue!10}{7-1}{9-1} +% \rectanglecolor{blue!10}{7-5}{9-6} +% \Body % & & & & A \\ % & & A & A & A \\ % & & & A \\ % & & A & A & A & A \\ % A & A & A & A & A & A \\ % A & A & A & A & A & A \\ +% & A & A & A \\ % & \Block{2-2}{B} & & A \\ % & & & A \\ -% & A & A & A \\ % \end{NiceTabular} -% \end{Verbatim} -% % -% \begin{center} -% \begin{NiceTabular}{*{6}{c}}[hvlines-except-corners,cell-space-top-limit=3pt] +% +% \bigskip +% \colorbox{yellow!50}{\textbf{New 5.14}}\enskip When the key |corners| is used, +% \pkg{nicematrix} computes the (empty) corners and these corners will be taken +% into account by the tools for drawing the rules (the rules won't be drawn in +% the corners). \emph{Remark}: In the previous versions of \pkg{nicematrix}, +% there was only a key |hvlines-except-corners| (now considered as obsolete). +% +% \bigskip +% \begin{BVerbatim}[boxwidth=11cm,baseline=c] +% \NiceMatrixOptions{cell-space-top-limit=3pt} +% \begin{NiceTabular}{*{6}{c}}[~emphase#corners@,hvlines] % & & & & A \\ % & & A & A & A \\ % & & & A \\ % & & A & A & A & A \\ % A & A & A & A & A & A \\ % A & A & A & A & A & A \\ +% & A & A & A \\ % & \Block{2-2}{B} & & A \\ % & & & A \\ +% \end{NiceTabular} +% \end{BVerbatim} +% \begin{NiceTabular}{*{6}{c}}[corners,hvlines,cell-space-top-limit=3pt] +% & & & & A \\ +% & & A & A & A \\ +% & & & A \\ +% & & A & A & A & A \\ +% A & A & A & A & A & A \\ +% A & A & A & A & A & A \\ % & A & A & A \\ +% & \Block{2-2}{B} & & A \\ +% & & & A \\ % \end{NiceTabular} -% \end{center} % -% As we can see, an ``empty corner'' is composed by the reunion of all the empty -% rectangles starting from the cell actually in the corner of the array. % % \bigskip -% It's possible to give as value to the key |\hvlines-except-corners| a list of -% the corners to take into consideration. The corners are designed by |NW|, -% |SW|, |NE| and |SE| (\emph{north west}, \emph{south west}, \emph{north east} -% and \emph{south east}). +% It's also possible to provide to the key |corners| a (comma-separated) list of +% corners (designed by |NW|, |SW|, |NE| and |SE|). % -% \bigskip +% \medskip % \begin{BVerbatim}[boxwidth=11cm,baseline=c] -% \begin{NiceTabular}{*{6}{c}}% -% [~emphase#hvlines-except-corners=NE@,cell-space-top-limit=3pt] +% \NiceMatrixOptions{cell-space-top-limit=3pt} +% \begin{NiceTabular}{*{6}{c}}[~emphase#corners=NE@,hvlines] % 1\\ % 1&1\\ % 1&2&1\\ % 1&3&3&1\\ % 1&4&6&4&1\\ -% 1&5&10&10&5&1 +% & & & & &1 % \end{NiceTabular} % \end{BVerbatim} -% \begin{NiceTabular}{*{6}{c}}[c,hvlines-except-corners=NE,cell-space-top-limit=3pt] +% \begin{NiceTabular}{*{6}{c}}[c,corners=NE,hvlines,cell-space-top-limit=3pt] % 1\\ % 1&1\\ % 1&2&1\\ % 1&3&3&1\\ % 1&4&6&4&1\\ -% 1&5&10&10&5&1 +% & & & & &1 % \end{NiceTabular} % % \bigskip @@ -1213,10 +1268,10 @@ version 2005/12/01 or later. % The extension \pkg{nicematrix} provides a key |code-before| for some code that % will be executed before the drawing of the tabular. % -% \medskip -% \colorbox{yellow!50}{\textbf{New 5.12}}\enskip An alternative syntax is -% provided: it's possible to put the content of that |code-before| between the -% keywords |\CodeBefore| and |\Body| at the beginning of the environment. +% \medskip +% An alternative syntax is provided: it's possible to put the content of that +% |code-before| between the keywords |\CodeBefore| and |\Body| at the beginning +% of the environment. % % \begin{Verbatim} % \begin{pNiceArray}{~textsl#preamble@} @@ -1379,10 +1434,10 @@ version 2005/12/01 or later. % \begin{itemize} % \item The key |cols| describes a set of columns. The command |\rowcolors| will % color only the cells of these columns. The value is a comma-separated list of -% intervals of the form $i$-$j$. +% intervals of the form $i$-$j$ (where $i$ or $j$ may be replaced by |*|). % \item With the key |restart|, each interval of rows (specified by the first % mandatory argument) begins with the same color.\footnote{Otherwise, the color -% of a given row relies only upon the parity of its number.} +% of a given row relies only upon the parity of its absolute number.} % \item With the key |respect-blocks| the ``rows'' alternately colored may extend over % several rows if they have to incorporate blocks (created with the command % |\Block|: cf.~p.~\pageref{Block}). @@ -1489,14 +1544,12 @@ version 2005/12/01 or later. % p.~\pageref{key-R}). % % -% \item \colorbox{yellow!50}{\textbf{New 5.13}}\enskip -% The command |\arraycolor| takes in as mandatory argument a color and color -% the whole tabular with that color (excepted the potential exterior rows and -% columns: cf.~p.~\pageref{exterior}). This command is useful thanks to its key -% |except-corners| (in the third argument, which is a optional argument between -% square brackets). The definition of these ``corners'' has been given -% p.~\pageref{except-corners} when we have presented the key -% |hvlines-except-corners|. +% \item The command |\arraycolor| takes in as mandatory argument a color and +% color the whole tabular with that color (excepted the potential exterior rows +% and columns: cf.~p.~\pageref{exterior}). This command is useful thanks to its +% key |except-corners| (in the third argument, which is a optional argument +% between square brackets). The definition of these ``corners'' has been given +% p.~\pageref{corners} when we have presented the key |corners|. % % \label{arraycolor} % @@ -2387,8 +2440,10 @@ version 2005/12/01 or later. % % The dotted lines determine virtual blocks which have the same behaviour % regarding the rules (the rules specified by the specifier \verb+|+ in the -% preamble and by the keys |hlines|, |vlines|, |hvlines| and -% |hvlines-except-corners| are not drawn within the blocks). +% preamble, by the command |\Hline| and by the keys |hlines|, |vlines| and +% |hvlines| are not drawn within the blocks).\footnote{On the other side, the +% command \verb|\line| in the \verb|\CodeAfter| +% (cf.~p.~\pageref{line-in-code-after}) does \emph{not} create block.} % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=10.6cm] @@ -2412,19 +2467,19 @@ version 2005/12/01 or later. % % \label{code-after} % The option |code-after| may be used to give some code that will be executed -% after the construction of the matrix.\footnote{There is also a key +% \emph{after} the construction of the matrix.\footnote{There is also a key % |code-before| described p.~\pageref{code-before}.} % % \medskip % For the legibility of the code, an alternative syntax is provided: it's -% possible to give the instructions of the |\code-after| at the end of the +% possible to give the instructions of the |code-after| at the end of the % environment, after the keyword |\CodeAfter|. Although |\CodeAfter| is a % keyword, it takes in an optional argument (between square brackets). The keys % accepted form a subset of the keys of the command |\WithArrowsOptions|. % % % \medskip -% The experienced users may use, for instance, the PGF/Tikz nodes created by +% The experienced users may, for instance, use the PGF/Tikz nodes created by % \pkg{nicematrix} in the |\CodeAfter|. These nodes are described further % beginning on p.~\pageref{PGF-nodes}. % @@ -2434,11 +2489,16 @@ version 2005/12/01 or later. % % \subsection{The command \textbackslash line in the \textbackslash CodeAfter} % +% \label{line-in-code-after} % The command |\line| draws directly dotted lines between nodes. It takes in two % arguments for the two cells to link, both of the form $i$-$j$ where is the -% number of the row and $j$ is the number of the column. It may be used, for -% example, to draw a dotted line between two adjacent -% cells. \label{line-in-code-after} +% number of the row and $j$ is the number of the column. The options available +% for the customisation of the dotted lines created by |\Cdots|, |\Vdots|, etc. +% are also available for this command (cf. p.~\pageref{customisation}). +% +% \bigskip +% This command may be used, for example, to draw a dotted line between two +% adjacent cells. % % \medskip % \begin{BVerbatim}[baseline=c,boxwidth=11cm] @@ -2462,10 +2522,29 @@ version 2005/12/01 or later. % \end{pNiceMatrix}$ % \end{scope} % +% \bigskip +% It can also be used to draw a diagonal line not parallel to the other diagonal +% lines (by default, the dotted lines drawn by |\Ddots| are ``parallelized'': +% cf.~p.~\pageref{parallelization}). +% % \medskip -% The options available for the customisation of the dotted lines created by -% |\Cdots|, |\Vdots|, etc. are also available for this command (cf. -% p.~\pageref{customisation}). +% \begin{BVerbatim} +% \begin{bNiceMatrix} +% 1 & \Cdots & & 1 & 2 & \Cdots & 2 \\ +% 0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\ +% \Vdots & \Ddots & & & & & \\ +% 0 & \Cdots & 0 & 1 & 2 & \Cdots & 2 +% ~emphase#\CodeAfter \line[shorten=6pt]{1-5}{4-7}@ +% \end{bNiceMatrix} +% \end{BVerbatim} +% \[\begin{bNiceMatrix} +% 1 & \Cdots & & 1 & 2 & \Cdots & 2 \\ +% 0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\ +% \Vdots & \Ddots & & & & & \\ +% 0 & \Cdots & 0 & 1 & 2 & \Cdots & 2 +% \CodeAfter \line[shorten=6pt]{1-5}{4-7} +% \end{bNiceMatrix}\] +% % % % \subsection{The command \textbackslash SubMatrix in the \textbackslash CodeAfter} @@ -3277,10 +3356,11 @@ version 2005/12/01 or later. % \textbf{Caution} : By default, no node is created in a empty cell. % % \smallskip -% However, it's possible to impose the creation of a node with the command |\NotEmpty|. -% \footnote{One should note that, with that command, the cell is considered as -% non-empty, which has consequencies for the continuous dotted lines (cf. -% p.~\pageref{Cdots}).} +% However, it's possible to impose the creation of a node with the command +% |\NotEmpty|. \footnote{One should note that, with that command, the cell is +% considered as non-empty, which has consequencies for the continuous dotted +% lines (cf. p.~\pageref{Cdots}) and the computation of the ``corners'' +% (cf.~p.~\pageref{corners}).} % % \medskip % The nodes of a document must have distinct names. That's why the names of the @@ -3589,24 +3669,26 @@ version 2005/12/01 or later. % \subsection{The nodes which indicate the position of the rules} % % \label{nodes-i} -% \colorbox{yellow!30}{New 5.11}\enskip The package \pkg{nicematrix} -% creates a PGF/Tikz node merely called $i$ (with the classical prefix) at the -% intersection of the horizontal rule of number~$i$ and the vertical rule of -% number~$j$ (more specifically the potential position of those rules because -% maybe there are not actually drawn). These nodes are available in the -% |code-before| and the |\CodeAfter|. -% -% \colorbox{yellow!50}{\textbf{New 5.13}}\enskip The last node has also an alias called -% |last|. +% The package \pkg{nicematrix} creates a PGF/Tikz node merely called $i$ (with +% the classical prefix) at the intersection of the horizontal rule of number~$i$ +% and the vertical rule of number~$i$ (more specifically the potential position +% of those rules because maybe there are not actually drawn). The last node has +% also an alias called |last|. +% +% \colorbox{yellow!50}{\textbf{New 5.14}}\enskip There is also a node called +% $i$|.5| midway between the node $i$ and the node $i+1$. +% +% These nodes are available in the |\CodeBefore| and the |\CodeAfter|. +% % \begin{center} % \begin{NiceTabular}{ccc}[hvlines,rules/width=1pt,rules/color=gray] -% rose & tulipe & lys \\ -% arum & iris & violette \\ -% muguet & dahlia & souci +% & tulipe & lys \\ +% arum & & violette mauve \\ +% muguet & dahlia % \CodeAfter % \tiny % \begin{tikzpicture} -% \foreach \i in {1,2,3,4} +% \foreach \i in {1,1.5,2,2.5,3,3.5,4} % { % \fill [red] (\i) circle (0.5mm) ; % \node [red,above right] at (\i) {\i} ; @@ -3618,7 +3700,7 @@ version 2005/12/01 or later. % \bigskip % If we use Tikz (we remind that \pkg{nicematrix} does not load Tikz by default, % by only \textsc{pgf}, which is a sub-layer of Tikz), we can access, in the -% |\CodeAfter| but also in the |code-before|, to the intersection of the +% |\CodeAfter| but also in the |\CodeBefore|, to the intersection of the % (potential) horizontal rule~$i$ and the (potential) vertical rule~$j$ with the % syntax |(|$i$\verb+-|+$j$|)|. % @@ -3655,6 +3737,29 @@ version 2005/12/01 or later. % 1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1 % \end{NiceMatrix}\] % +% +% \bigskip +% The nodes of the form $i$|.5| may be used, for example to cross a row of a +% matrix (if Tikz is loaded). +% +% \smallskip +% \begin{BVerbatim}[boxwidth=11cm,baseline=c] +% $\begin{pNiceArray}{ccc|c} +% 2 & 1 & 3 & 0 \\ +% 3 & 3 & 1 & 0 \\ +% 3 & 3 & 1 & 0 +% \CodeAfter +% \tikz \draw [red] (~emphase#3.5@-|1) -- (~emphase#3.5@-|last) ; +% \end{pNiceArray}$ +% \end{BVerbatim} +% $\begin{pNiceArray}{ccc|c} +% 2 & 1 & 3 & 0 \\ +% 3 & 3 & 1 & 0 \\ +% 3 & 3 & 1 & 0 +% \CodeAfter +% \tikz \draw [red] (3.5-|1) -- (3.5-|last) ; +% \end{pNiceArray}$ +% % \subsection{The nodes corresponding to the command \textbackslash SubMatrix} % % \label{node-sub-matrix} @@ -3829,6 +3934,7 @@ version 2005/12/01 or later. % % \subsection{Diagonal lines} % +% \label{parallelization} % By default, all the diagonal lines\footnote{We speak of the lines created by % |\Ddots| and not the lines created by a command |\line| in |code-after|.} of a % same array are ``parallelized''. That means that the first diagonal line is @@ -4319,9 +4425,9 @@ version 2005/12/01 or later. % (smaller parenthesis are a bit slimer). % % \medskip -% \colorbox{yellow!50}{\textbf{New 5.12}}\enskip In order the solve that -% problem, it's possible to require the delimiters to be composed with the -% maximal width, thanks to the boolean key |delimiters/max-width|. +% In order the solve that problem, it's possible to require the delimiters to be +% composed with the maximal width, thanks to the boolean key +% |delimiters/max-width|. % % \begin{Verbatim}[formatcom=\small\color{gray}] % ~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@ @@ -4689,7 +4795,7 @@ version 2005/12/01 or later. % \end{pNiceArray}\] % % -% \subsection{Utilisation of \textbackslash SubMatrix in the code-before} +% \subsection{Utilisation of \textbackslash SubMatrix in the \textbackslash CodeBefore} % % In the following example, we illustrate the mathematical product of two % matrices. @@ -5658,7 +5764,7 @@ version 2005/12/01 or later. % % \medskip % We are able to determine the number of columns specified in the preamble (for -% the environments with explicit preamble, of course and without the potential +% the environments with explicit preamble of course and without the potential % exterior columns). % \begin{macrocode} \int_new:N \g_@@_static_num_of_col_int @@ -5693,10 +5799,15 @@ version 2005/12/01 or later. % \end{macrocode} % % \medskip -% The parameter of position of the label of a block (|c|, |r| or |l|). +% The parameters of position of the label of a block. For the horizontal +% position, the possible values are |c|, |r| and |l|. For the vertical position, +% the possible values are |c|, |t| and |b|. Of course, it would be intesting to +% program a key |T| and a key |B|. % \begin{macrocode} -\tl_new:N \l_@@_pos_of_block_tl -\tl_set:Nn \l_@@_pos_of_block_tl { c } +\tl_new:N \l_@@_hpos_of_block_tl +\tl_set:Nn \l_@@_hpos_of_block_tl { c } +\tl_new:N \l_@@_vpos_of_block_tl +\tl_set:Nn \l_@@_vpos_of_block_tl { c } % \end{macrocode} % % \medskip @@ -6186,12 +6297,9 @@ version 2005/12/01 or later. % % % \bigskip -% The flag |\l_@@_except_corners_bool| will be raised when the key -% |except-corners| will be used. In that case, the corners will be computed -% before we draw rules and the rules won't be drawn in the corners. As expected, -% the key |hvlines-except-corners| raises the key |except-corners|. +% The following parameter correspond to the key |corners|. % \begin{macrocode} -\clist_new:N \l_@@_except_corners_clist +\clist_new:N \l_@@_corners_clist % \end{macrocode} % % \begin{macrocode} @@ -6435,15 +6543,18 @@ version 2005/12/01 or later. \keys_define:nn { NiceMatrix / Env } { delimiters/max-width .bool_set:N = \l_@@_delimiters_max_width_bool , - except-corners .clist_set:N = \l_@@_except_corners_clist , - except-corners .default:n = { NW , SW , NE , SE } , +% \end{macrocode} +% The key |hvlines-except-corners| is now deprecated. +% \begin{macrocode} hvlines-except-corners .code:n = { - \clist_set:Nn \l_@@_except_corners_clist { #1 } + \clist_set:Nn \l_@@_corners_clist { #1 } \clist_set:Nn \l_@@_vlines_clist { all } \clist_set:Nn \l_@@_hlines_clist { all } } , hvlines-except-corners .default:n = { NW , SW , NE , SE } , + corners .clist_set:N = \l_@@_corners_clist , + corners .default:n = { NW , SW , NE , SE } , code-before .code:n = { \tl_if_empty:nF { #1 } @@ -6828,7 +6939,6 @@ version 2005/12/01 or later. % \begin{macrocode} \int_compare:nNnT \c@jCol = 1 { \int_compare:nNnT \l_@@_first_col_int = 1 \@@_begin_of_row: } - \int_gset:Nn \g_@@_col_total_int { \int_max:nn \g_@@_col_total_int \c@jCol } % \end{macrocode} % The content of the cell is composed in the box |\l_@@_cell_box| because we want % to compute some dimensions of the box. The |\hbox_set_end:| corresponding to @@ -7023,6 +7133,7 @@ version 2005/12/01 or later. \@@_node_for_the_cell: { \box_use_drop:N \l_@@_cell_box } } + \int_gset:Nn \g_@@_col_total_int { \int_max:nn \g_@@_col_total_int \c@jCol } \bool_gset_false:N \g_@@_empty_cell_bool \bool_gset_false:N \g_@@_not_empty_cell_bool } @@ -8136,7 +8247,7 @@ version 2005/12/01 or later. % \end{macrocode} % % First, we have to store our preamble in the token register |\@temptokena| -% (those ``token registers'' are not supported by \pkg{expl3}). +% (those ``token registers'' are \emph{not} supported by \pkg{expl3}). % \begin{macrocode} \exp_args:NV \@temptokena \g_@@_preamble_tl % \end{macrocode} @@ -9862,6 +9973,22 @@ version 2005/12/01 or later. } % \end{macrocode} % +% \bigskip +% We define a new \textsc{pgf} shape for the diag nodes because we want to +% provide a anchor called |.5| for those nodes. +% \begin{macrocode} +\pgfdeclareshape { @@_diag_node } + { + \savedanchor { \five } + { + \dim_gset_eq:NN \pgf@x \l_tmpa_dim + \dim_gset_eq:NN \pgf@y \l_tmpb_dim + } + \anchor { 5 } { \five } + \anchor { center } { \pgfpointorigin } + } +% \end{macrocode} +% % % \bigskip % The following command creates the diagonal nodes (in fact, if the matrix is @@ -9871,13 +9998,35 @@ version 2005/12/01 or later. { \pgfpicture \pgfrememberpicturepositiononpagetrue - \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol + 1 } + \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol } { - \@@_qpoint:n { row - \int_min:nn { ##1 } { \c@iRow + 1 } } - \dim_set_eq:NN \l_tmpa_dim \pgf@y \@@_qpoint:n { col - \int_min:nn { ##1 } { \c@jCol + 1 } } - \pgfcoordinate { \@@_env: - ##1 } { \pgfpoint \pgf@x \l_tmpa_dim } + \dim_set_eq:NN \l_tmpa_dim \pgf@x + \@@_qpoint:n { row - \int_min:nn { ##1 } { \c@iRow + 1 } } + \dim_set_eq:NN \l_tmpb_dim \pgf@y + \@@_qpoint:n { col - \int_min:nn { ##1 + 1 } { \c@jCol + 1 } } + \dim_set_eq:NN \l_tmpc_dim \pgf@x + \@@_qpoint:n { row - \int_min:nn { ##1 + 1 } { \c@iRow + 1 } } + \dim_set_eq:NN \l_tmpd_dim \pgf@y + \pgftransformshift { \pgfpoint \l_tmpa_dim \l_tmpb_dim } +% \end{macrocode} +% Now, |\l_tmpa_dim| and |\l_tmpb_dim| become the width and the height of the +% node (of shape |@à_diag_node|) that we will construct. +% \begin{macrocode} + \dim_set:Nn \l_tmpa_dim { ( \l_tmpc_dim - \l_tmpa_dim ) / 2 } + \dim_set:Nn \l_tmpb_dim { ( \l_tmpd_dim - \l_tmpb_dim ) / 2 } + \pgfnode { @@_diag_node } { center } { } { \@@_env: - ##1 } { } } +% \end{macrocode} +% Now, the last node. Of course, that is only a |coordinate| because there is +% not |.5| anchor for that node. +% \begin{macrocode} + \int_set:Nn \l_tmpa_int { \int_max:nn \c@iRow \c@jCol + 1 } + \@@_qpoint:n { row - \int_min:nn { \l_tmpa_int } { \c@iRow + 1 } } + \dim_set_eq:NN \l_tmpa_dim \pgf@y + \@@_qpoint:n { col - \int_min:nn { \l_tmpa_int } { \c@jCol + 1 } } + \pgfcoordinate + { \@@_env: - \int_use:N \l_tmpa_int } { \pgfpoint \pgf@x \l_tmpa_dim } \pgfnodealias { \@@_env: - last } { \@@_env: - \int_eval:n { \int_max:nn \c@iRow \c@jCol + 1 } } @@ -9885,35 +10034,6 @@ version 2005/12/01 or later. } % \end{macrocode} % -% \bigskip -% As for now, the ½ nodes are not documented and they are created only in the -% native \textsc{utf8} engines, that is to say XeLaTeX and LuaLaTeX. -% \begin{macrocode} -\bool_if:nT - { \sys_if_engine_xetex_p: || \sys_if_engine_luatex_p: } - { \tl_put_right:Nn \@@_create_diag_nodes: \@@_create_half_nodes: } -% \end{macrocode} -% -% \begin{macrocode} -\cs_new_protected:Npn \@@_create_half_nodes: - { - \int_step_inline:nn { \int_max:nn \c@iRow \c@jCol } - { - \pgfpicture - \pgfrememberpicturepositiononpagetrue - \pgfcoordinate { \@@_env: - ##1 ½ } - { - \pgfpointscale { 0.5 } - { - \pgfpointadd - { \@@_qpoint:n { ##1 } } - { \@@_qpoint:n { \int_eval:n { ##1 + 1 } } } - } - } - \endpgfpicture - } - } -% \end{macrocode} % % \bigskip % \subsection*{We draw the dotted lines} @@ -10754,21 +10874,13 @@ version 2005/12/01 or later. { \bool_if:NTF \l_@@_initial_open_bool { - % \@@_qpoint:n { row - \int_use:N \l_@@_initial_i_int } - % \dim_set_eq:NN \l_@@_y_initial_dim \pgf@y \@@_open_y_initial_dim: - % \@@_qpoint:n { col - \@@_succ:n \l_@@_initial_j_int } - % \dim_set_eq:NN \l_@@_x_initial_dim \pgf@x \@@_open_x_initial_dim: } { \@@_set_initial_coords_from_anchor:n { south~west } } \bool_if:NTF \l_@@_final_open_bool { - % \@@_qpoint:n { row - \@@_succ:n \l_@@_final_i_int } - % \dim_set_eq:NN \l_@@_y_final_dim \pgf@y \@@_open_y_final_dim: - % \@@_qpoint:n { col - \int_use:N \l_@@_final_j_int } - % \dim_set_eq:NN \l_@@_x_final_dim \pgf@x \@@_open_x_final_dim: } { \@@_set_final_coords_from_anchor:n { north~east } } @@ -11247,10 +11359,6 @@ version 2005/12/01 or later. \exp_args:NNe \@@_old_multicolumn { #1 } -% \end{macrocode} -% We will have to replace |\tl_lower_case:n| in the future since it seems to be -% deprecated. -% \begin{macrocode} { \exp_args:Ne \str_case:nn { \str_foldcase:n { #2 } } { @@ -11925,7 +12033,7 @@ version 2005/12/01 or later. % \end{macrocode} % First, we compute the corners. % \begin{macrocode} - \clist_set:Nn \l_@@_except_corners_clist { #3 } + \clist_set:Nn \l_@@_corners_clist { #3 } \@@_compute_corners: % \end{macrocode} % Now, for each cell of the array (excepted the potential exterior rows and @@ -12151,8 +12259,13 @@ version 2005/12/01 or later. \tl_if_in:NnTF \l_tmpa_tl { - } { \@@_cut_on_hyphen:w ##1 \q_stop } { \@@_cut_on_hyphen:w ##1 - ##1 \q_stop } - \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } } - \tl_if_empty:NT \l_tmpb_tl + \bool_lazy_or:nnT + { \tl_if_blank_p:V \l_tmpa_tl } + { \str_if_eq_p:Vn \l_tmpa_tl { * } } + { \tl_set:Nn \l_tmpa_tl { 1 } } + \bool_lazy_or:nnT + { \tl_if_blank_p:V \l_tmpb_tl } + { \str_if_eq_p:Vn \l_tmpb_tl { * } } { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } \int_compare:nNnT \l_tmpb_tl > \c@jCol { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } @@ -12220,7 +12333,7 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip -% When the user uses the key |colortbll-like|, the following command will +% When the user uses the key |colortbl-like|, the following command will % be linked to |\rowcolor| in the tabular. % \begin{macrocode} \NewDocumentCommand \@@_rowcolor_tabular { O { } m } @@ -12234,15 +12347,23 @@ version 2005/12/01 or later. } % \end{macrocode} % +% % \bigskip % \begin{macrocode} \NewDocumentCommand \@@_columncolor_preamble { O { } m } { - \int_compare:nNnT \c@iRow = 1 +% \end{macrocode} +% With the following line, we test whether the cell is the first one we +% encounter in its column (don't forget that some rows may be incomplete). +% \begin{macrocode} + \int_compare:nNnT \c@jCol > \g_@@_col_total_int { % \end{macrocode} % You use |gput_left| because we want the specification of colors for the % columns drawn before the specifications of color for the rows (and the cells). +% Be careful: maybe this is not effective since we have an analyze of the +% instructions in the |\CodeBefore| in order to fill color by color (to avoid +% the thin white lines). % \begin{macrocode} \tl_gput_left:Nx \g_nicematrix_code_before_tl { @@ -12360,7 +12481,7 @@ version 2005/12/01 or later. { \@@_test_vline_in_block:nnnn ##1 } \seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq { \@@_test_vline_in_stroken_block:nnnn ##1 } - \clist_if_empty:NF \l_@@_except_corners_clist + \clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_v: \bool_if:NTF \g_tmpa_bool { @@ -12474,7 +12595,7 @@ version 2005/12/01 or later. % The following command draws a complete vertical rule in the column |#1| (|#2| % is the number of consecutive rules specified by the number of \verb+|+ in the % preamble). This command will be used if there is no block in the array (and -% the key |except-corners| is not used). +% the key |corners| is not used). % \begin{macrocode} \cs_new_protected:Npn \@@_vline_i_complete:nn #1 #2 { \@@_vline_ii:nnnn { #1 } { #2 } 1 { \int_use:N \c@iRow } } @@ -12483,7 +12604,7 @@ version 2005/12/01 or later. % \bigskip % The command |\@@_draw_hlines:| draws all the vertical rules excepted in the % blocks, in the virtual blocks (determined by a command such as |\Cdots|) and in -% the corners (if the key |except-corners| is used). +% the corners (if the key |corners| is used). % \begin{macrocode} \cs_new_protected:Npn \@@_draw_vlines: { @@ -12541,7 +12662,7 @@ version 2005/12/01 or later. { \@@_test_hline_in_block:nnnn ##1 } \seq_map_inline:Nn \g_@@_pos_of_stroken_blocks_seq { \@@_test_hline_in_stroken_block:nnnn ##1 } - \clist_if_empty:NF \l_@@_except_corners_clist \@@_test_in_corner_h: + \clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_h: \bool_if:NTF \g_tmpa_bool { \tl_if_empty:NT \l_tmpc_tl @@ -12657,7 +12778,7 @@ version 2005/12/01 or later. % \bigskip % The command |\@@_draw_hlines:| draws all the horizontal rules excepted in the % blocks (even the virtual drawn determined by commands such as |\Cdots| and in -% the corners (if the key |except-corners| is used). +% the corners (if the key |corners| is used). % \begin{macrocode} \cs_new_protected:Npn \@@_draw_hlines: { @@ -12775,9 +12896,9 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip -% \subsubsection*{The key except-corners} +% \subsubsection*{The key corners} % -% When the key |except-corners| is raised, the rules are not drawn in the +% When the key |corners| is raised, the rules are not drawn in the % corners. Of course, we have to compute the corners before we begin to draw the % rules. % @@ -12789,7 +12910,7 @@ version 2005/12/01 or later. % empty cells (and not in a block) considered in the corners of the array. % \begin{macrocode} \seq_clear_new:N \l_@@_empty_corner_cells_seq - \clist_map_inline:Nn \l_@@_except_corners_clist + \clist_map_inline:Nn \l_@@_corners_clist { \str_case:nnF { ##1 } { @@ -13611,12 +13732,16 @@ version 2005/12/01 or later. % \begin{macrocode} \keys_define:nn { NiceMatrix / Block / FirstPass } { - l .code:n = \tl_set:Nn \l_@@_pos_of_block_tl l , + l .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl l , l .value_forbidden:n = true , - r .code:n = \tl_set:Nn \l_@@_pos_of_block_tl r , + r .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl r , r .value_forbidden:n = true , - c .code:n = \tl_set:Nn \l_@@_pos_of_block_tl c , + c .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl c , c .value_forbidden:n = true , + t .code:n = \tl_set:Nn \l_@@_vpos_of_block_tl t , + t .value_forbidden:n = true , + b .code:n = \tl_set:Nn \l_@@_vpos_of_block_tl b , + b .value_forbidden:n = true , color .tl_set:N = \l_@@_color_tl , color .value_required:n = true , } @@ -13680,15 +13805,19 @@ version 2005/12/01 or later. { \int_set:Nn \l_tmpb_int { #2 } } % \end{macrocode} % +% \medskip +% If the block is mono-column. % \begin{macrocode} \int_compare:nNnTF \l_tmpb_int = 1 { \tl_if_empty:NTF \l_@@_cell_type_tl - { \tl_set:Nn \l_@@_pos_of_block_tl c } - { \tl_set_eq:NN \l_@@_pos_of_block_tl \l_@@_cell_type_tl } + { \tl_set:Nn \l_@@_hpos_of_block_tl c } + { \tl_set_eq:NN \l_@@_hpos_of_block_tl \l_@@_cell_type_tl } } - { \tl_set:Nn \l_@@_pos_of_block_tl c } + { \tl_set:Nn \l_@@_hpos_of_block_tl c } % \end{macrocode} +% The value of |\l_@@_hpos_of_block_tl| may be modified by the keys of the +% command |\Block| that we will analyze now. % % \medskip % \begin{macrocode} @@ -13775,18 +13904,24 @@ version 2005/12/01 or later. % the tabular is the same as the external alignment of the tabular (that is to % say the position of the block in its zone of merged cells). % \begin{macrocode} - \bool_if:NT \g_@@_rotate_bool { \tl_set:Nn \l_@@_pos_of_block_tl c } + \bool_if:NT \g_@@_rotate_bool { \tl_set:Nn \l_@@_hpos_of_block_tl c } \bool_if:NTF \l_@@_NiceTabular_bool { - \exp_args:Nnx \begin { tabular } - { @ { } \l_@@_pos_of_block_tl @ { } } + \use:x + { + \exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_tl ] + { @ { } \l_@@_hpos_of_block_tl @ { } } + } #5 \end { tabular } } { \c_math_toggle_token - \exp_args:Nnx \begin { array } - { @ { } \l_@@_pos_of_block_tl @ { } } + \use:x + { + \exp_not:N \begin { array } [ \l_@@_vpos_of_block_tl ] + { @ { } \l_@@_hpos_of_block_tl @ { } } + } #5 \end { array } \c_math_toggle_token @@ -13847,11 +13982,11 @@ version 2005/12/01 or later. % \end{macrocode} % In the list of options |#3|, maybe there is a key for the horizontal alignment % (|l|, |r| or |c|). In that case, that key has been read and stored in -% |\l_@@_pos_of_block_tl|. However, maybe there were no key of the horizontal +% |\l_@@_hpos_of_block_tl|. However, maybe there were no key of the horizontal % alignement and that's why we put a key corresponding to the value of -% |\l_@@_pos_of_block_tl|, which is fixed by the type of current column. +% |\l_@@_hpos_of_block_tl|, which is fixed by the type of current column. % \begin{macrocode} - { \exp_not:n { #3 } , \l_@@_pos_of_block_tl } + { \exp_not:n { #3 } , \l_@@_hpos_of_block_tl } { \box_use_drop:c { g_@@_ block _ box _ \int_use:N \g_@@_block_box_int _ box } @@ -13890,9 +14025,12 @@ version 2005/12/01 or later. % say the position of the block in its zone of merged cells). % \begin{macrocode} \bool_if:NT \g_@@_rotate_bool - { \tl_set:Nn \l_@@_pos_of_block_tl c } - \exp_args:Nnx \begin { tabular } - { @ { } \l_@@_pos_of_block_tl @ { } } + { \tl_set:Nn \l_@@_hpos_of_block_tl c } + \use:x + { + \exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_tl ] + { @ { } \l_@@_hpos_of_block_tl @ { } } + } #5 \end { tabular } \group_end: @@ -13903,10 +14041,15 @@ version 2005/12/01 or later. \dim_set_eq:NN \extrarowheight \c_zero_dim #4 \bool_if:NT \g_@@_rotate_bool - { \tl_set:Nn \l_@@_pos_of_block_tl c } + { \tl_set:Nn \l_@@_hpos_of_block_tl c } \c_math_toggle_token - \exp_args:Nnx \begin { array } - { @ { } \l_@@_pos_of_block_tl @ { } } #5 \end { array } + \use:x + { + \exp_not:N \begin { array } [ \l_@@_vpos_of_block_tl ] + { @ { } \l_@@_hpos_of_block_tl @ { } } + } + #5 + \end { array } \c_math_toggle_token \group_end: } @@ -13937,12 +14080,16 @@ version 2005/12/01 or later. borders .value_required:n = true , line-width .dim_set:N = \l_@@_line_width_dim , line-width .value_required:n = true , - l .code:n = \tl_set:Nn \l_@@_pos_of_block_tl l , + l .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl l , l .value_forbidden:n = true , - r .code:n = \tl_set:Nn \l_@@_pos_of_block_tl r , + r .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl r , r .value_forbidden:n = true , - c .code:n = \tl_set:Nn \l_@@_pos_of_block_tl c , + c .code:n = \tl_set:Nn \l_@@_hpos_of_block_tl c , c .value_forbidden:n = true , + t .code:n = \tl_set:Nn \l_@@_vpos_of_block_tl t , + t .value_forbidden:n = true , + b .code:n = \tl_set:Nn \l_@@_vpos_of_block_tl b , + b .value_forbidden:n = true , unknown .code:n = \@@_error:n { Unknown~key~for~Block } } % \end{macrocode} @@ -14266,7 +14413,7 @@ version 2005/12/01 or later. \pgfpointanchor { \@@_env: - #1 - #2 - block - short } { - \str_case:Vn \l_@@_pos_of_block_tl + \str_case:Vn \l_@@_hpos_of_block_tl { c { center } l { west } @@ -14281,7 +14428,7 @@ version 2005/12/01 or later. \pgfnode { rectangle } { - \str_case:Vn \l_@@_pos_of_block_tl + \str_case:Vn \l_@@_hpos_of_block_tl { c { base } l { base~west } @@ -14302,18 +14449,18 @@ version 2005/12/01 or later. % If we are in the first column, we must put the block as if it was with the key~|r|. % \begin{macrocode} \int_compare:nNnT { #2 } = 0 - { \tl_set:Nn \l_@@_pos_of_block_tl r } + { \tl_set:Nn \l_@@_hpos_of_block_tl r } \bool_if:nT \g_@@_last_col_found_bool { \int_compare:nNnT { #2 } = \g_@@_col_total_int - { \tl_set:Nn \l_@@_pos_of_block_tl l } + { \tl_set:Nn \l_@@_hpos_of_block_tl l } } \pgftransformshift { \pgfpointanchor { \@@_env: - #1 - #2 - block - short } { - \str_case:Vn \l_@@_pos_of_block_tl + \str_case:Vn \l_@@_hpos_of_block_tl { c { center } l { west } @@ -14325,7 +14472,7 @@ version 2005/12/01 or later. \pgfnode { rectangle } { - \str_case:Vn \l_@@_pos_of_block_tl + \str_case:Vn \l_@@_hpos_of_block_tl { c { center } l { west } @@ -14659,7 +14806,7 @@ version 2005/12/01 or later. % \end{macrocode} % We put the cell with |\diagbox| in the sequence |\g_@@_pos_of_blocks_seq| % because a cell with |\diagbox| must be considered as non empty by the key -% |except-corners|. +% |corners|. % \begin{macrocode} \seq_gput_right:Nx \g_@@_pos_of_blocks_seq { @@ -15857,7 +16004,7 @@ version 2005/12/01 or later. \@@_msg_new:nn { bad~corner } { #1~is~an~incorrect~specification~for~a~corner~(in~the~keys~ - 'except-corners'~and~'hvlines-except-corners').~The~available~ + 'corners'~and~'except-corners').~The~available~ values~are:~NW,~SW,~NE~and~SE.\\ If~you~go~on,~this~specification~of~corner~will~be~ignored. } @@ -16093,6 +16240,7 @@ version 2005/12/01 or later. code-for-first-row,~ code-for-last-col,~ code-for-last-row,~ + corners,~ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ @@ -16102,7 +16250,6 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ - hvlines-except-corners,~ last-col,~ last-row,~ left-margin,~ @@ -16144,6 +16291,7 @@ version 2005/12/01 or later. code-for-last-row,~ colortbl-like,~ columns-width,~ + corners,~ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ @@ -16154,7 +16302,6 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ - hvlines-except-corners,~ last-col,~ last-row,~ left-margin,~ @@ -16168,6 +16315,7 @@ version 2005/12/01 or later. rules~(with~the~subkeys~'color'~and~'width'),~ small,~ t,~ + tabularnote,~ vlines,~ xdots/color,~ xdots/shorten~and~ @@ -16202,6 +16350,7 @@ version 2005/12/01 or later. code-for-last-row,~ colortbl-like,~ columns-width,~ + corners,~ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ @@ -16212,7 +16361,6 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ - hvlines-except-corners,~ l,~ last-col,~ last-row,~ @@ -16256,6 +16404,7 @@ version 2005/12/01 or later. code-for-last-row,~ colortbl-like,~ columns-width,~ + corners,~ create-extra-nodes,~ create-medium-nodes,~ create-large-nodes,~ @@ -16265,7 +16414,6 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ - hvlines-except-corners,~ last-col,~ last-row,~ left-margin,~ @@ -16278,6 +16426,7 @@ version 2005/12/01 or later. right-margin,~ rules~(with~the~subkeys~'color'~and~'width'),~ t,~ + tabularnote,~ vlines,~ xdots/color,~ xdots/shorten~and~ @@ -16766,6 +16915,15 @@ version 2005/12/01 or later. % The keys |vlines| and |hlines| takes in as value a (comma-separated) list of % numbers (for the rules to draw). % +% +% \subsection*{Changes between versions 5.13 and 5.14} +% +% Nodes of the forme |(1.5)|, |(2.5)|, |(3.5)|, etc. +% +% Keys |t| and |b| for the command |\Block|. +% +% Key |corners|. +% % \PrintIndex % % \tableofcontents diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf Binary files differindex 00cce2d6b7..c228e67e67 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix.pdf |