summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-07 03:01:25 +0000
committerNorbert Preining <norbert@preining.info>2021-05-07 03:01:25 +0000
commitc92d9953347e3bdebc5243c67cf012a2f7a60fb6 (patch)
tree808a0ad402713257a48445f97e662786d95207ee /macros/latex
parent25f20b6d8ccd4edcdfec23c1a3c908516076ee06 (diff)
CTAN sync 202105070301
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md117
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdfbin1911308 -> 1915138 bytes
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex19
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx57
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx46
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx154
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx10
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx2
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx10
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx2
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx107
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin479006 -> 479631 bytes
-rw-r--r--macros/latex/contrib/froufrou/LICENSE2
-rw-r--r--macros/latex/contrib/froufrou/README.md2
-rw-r--r--macros/latex/contrib/froufrou/froufrou.dtx56
-rw-r--r--macros/latex/contrib/froufrou/froufrou.ins4
-rw-r--r--macros/latex/contrib/froufrou/froufrou.pdfbin42957 -> 66866 bytes
-rw-r--r--macros/latex/contrib/hvfloat/Changes2
-rw-r--r--macros/latex/contrib/hvfloat/doc/examples/README.exa3
-rw-r--r--macros/latex/contrib/hvfloat/doc/examples/capPos.ltx34
-rw-r--r--macros/latex/contrib/hvfloat/doc/examples/capPos.pdfbin0 -> 77925 bytes
-rw-r--r--macros/latex/contrib/hvfloat/doc/examples/capPos.tex129
-rw-r--r--macros/latex/contrib/hvfloat/doc/hvfloat.pdfbin18366111 -> 18373761 bytes
-rw-r--r--macros/latex/contrib/hvfloat/doc/hvfloat.tex117
-rw-r--r--macros/latex/contrib/hvfloat/doc/images/missing.txt3
-rw-r--r--macros/latex/contrib/hvfloat/latex/hvfloat.sty240
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin462451 -> 462481 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex24
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx764
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin1235344 -> 1248363 bytes
-rw-r--r--macros/latex/contrib/pbalance/LICENSE4
-rw-r--r--macros/latex/contrib/pbalance/README.md4
-rw-r--r--macros/latex/contrib/pbalance/pbalance.dtx180
-rw-r--r--macros/latex/contrib/pbalance/pbalance.ins8
-rw-r--r--macros/latex/contrib/pbalance/pbalance.pdfbin240071 -> 242707 bytes
36 files changed, 1460 insertions, 642 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md
index 38080851ab..94f53b41ca 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md
@@ -1,4 +1,4 @@
-<b>Date of last change: 2021-04-03 to version v1.0x</b>
+<b>Date of last change: 2021-05-06 to version v1.0y</b>
# biblatex-gb7714-2015: a biblatex style package
@@ -55,7 +55,7 @@ biblatex-gb7714-2015 宏包是中文参考文献著录/标注标准 `GB/T 7714-2
* [LZUthesis(兰州大学本科毕业论文LaTeX模板)](https://github.com/szsdk/LZUthesis)
* [neuthesis(东北大学博士学位论文Latex模板)](https://github.com/mervin0502/neuthesis)
* [NJU-thesis-esz(南京大学学位论文-微调整后适用于人文社科)](https://github.com/EdwardSaidZhou/NJU-thesis-esz)
-* [NKThesis(南开大学硕士毕业论文(博士论文)Latex模板)](https://github.com/procuteboy/NKThesis)
+* NKThesis(南开大学硕/博模板)[Template1](https://github.com/procuteboy/NKThesis) [Template2](https://github.com/NewFuture/NKThesis)
* [NKUBachelorThesis(南开大学本科生毕业论文(毕业设计)LaTeX模板)](https://github.com/NKcqx/NKUBachelorThesis)
* [nputhesis(NPU 博士、硕士学位论文 \LaTeX 模板)](https://github.com/NPUSCG/nputhesis)
* [nuaa-thesis(南京航空航天大学本科、硕士和博士学位论文的样式模板)](https://github.com/nuaa803/nuaa-thesis)
@@ -73,6 +73,7 @@ biblatex-gb7714-2015 宏包是中文参考文献著录/标注标准 `GB/T 7714-2
* [UCASthesis(ucasthesis 国科大学位论文 LaTeX 模板 [最新样式])](https://github.com/mohuangrui/ucasthesis)
* [ustcthesis(中国科学技术大学学位论文 LaTeX 模板)](https://github.com/ustctug/ustcthesis)
* [WUTthesis(武汉理工大学研究生学位论文的 LaTeX 模板)](https://github.com/Jiayin-Gu/WUTthesis)
+* [whu-thesis(武汉大学毕业论文 LaTeX 模板)](https://github.com/whutug/whu-thesis)
* [Yet anoter BUPT Thesis LaTeX class (北邮研究生学位设计的LaTeX文档类)](https://github.com/qcts33/BUPTthesis-ctex)
* [Zhejiang University thesis(浙江大学毕业设计/论文模板)](https://github.com/TheNetAdmin/zjuthesis)
* [《经济研究》杂志 LaTeX 论文模板)](https://github.com/EthanDeng/Chinese-ERJ)
@@ -103,27 +104,19 @@ biblatex-gb7714-2015 宏包是中文参考文献著录/标注标准 `GB/T 7714-2
<h3 id="jumptopkgload">0. pacakge usage/宏包加载方式</h3>
样式包配合biblatex使用,即在biblatex调用时加载样式包:
-* 使用顺序编码制:
+* 顺序编码制样式(gb7714-2015):
```
\usepackage[backend=biber,style=gb7714-2015]{biblatex}
```
-* 使用著者-出版年制:
+* 著者-出版年制样式(gb7714-2015ay):
```
\usepackage[backend=biber,style=gb7714-2015ay]{biblatex}
```
-* 使用宏包提供的选项:
-
-```
- %设置gbalign选项以改变文献表序号标签对齐方式,
- %设置gbpub=false取消缺省出版项自填补信息,比如:
- \usepackage[backend=biber,style=gb7714-2015,gbalign=gb7714-2015,gbpub=false]{biblatex}
-```
-
-* 使用同一文献表中不同语言区分著录格式的样式(gb7714-2015ms):
+* 同一文献表中不同语言区分不同著录格式的样式(gb7714-2015ms):
```
%设置gbstyle=false,中文文献使用GB/T 7714-2015著录格式,而其它语言文献使用biblatex标准样式
@@ -139,6 +132,25 @@ biblatex-gb7714-2015 宏包是中文参考文献著录/标注标准 `GB/T 7714-2
\setaystylesection{2}
```
+* 标注(引用)样式和著录样式区分使用:
+```
+\usepackage[backend=biber,citestyle=gb7714-2015,bibstyle=gb7714-2015ay]{biblatex}
+```
+或(类似的方式均可)
+```
+\usepackage[backend=biber,citestyle=gb7714-2015ay,bibstyle=gb7714-2015]{biblatex}
+```
+
+* 宏包选项的使用:
+
+```
+ %设置gbalign选项以改变文献表序号标签对齐方式,
+ %设置gbpub=false取消缺省出版项自填补信息,比如:
+ \usepackage[backend=biber,style=gb7714-2015,gbalign=gb7714-2015,gbpub=false]{biblatex}
+```
+
+
+
更多宏包选项的说明见:[biblatex-gb7714-2015.pdf](biblatex-gb7714-2015.pdf)
宏包加载的完整文档示例见:[tex文档一般结构](#jumptotexsrcf)
@@ -151,7 +163,7 @@ biblatex-gb7714-2015 宏包是中文参考文献著录/标注标准 `GB/T 7714-2
\usepackage{ctex}%加载ctex宏包,中文支持
-\usepackage[left=20mm,right=20mm,top=25mm, bottom=15mm]{geometry}%加载geometry宏包,定义版面
+\usepackage{geometry}%加载geometry宏包,定义版面
\usepackage[colorlinks=true,pdfstartview=FitH,%
linkcolor=blue,anchorcolor=violet,citecolor=magenta]{hyperref}%加载hyperref宏包,使用超链接
@@ -194,7 +206,8 @@ citestyle=gb7714-2015%,backref=true%%其中后端backend使用biber
见文献\supercite{Peebles2001-100-100}
2. 不带页码的引用(顺序编码制非上标,方括号包围;作者年制行内,括号包围):\\
- 见文献\parencite{Peebles2001-100-100}
+ 见文献\parencite{Peebles2001-100-100}\\
+ 见文献\citep{Peebles2001-100-100}
3. 带页码的引用(标准命令,默认样式; 增加命令,GB/T 7714-2015样式):\\
见文献\cite[见][49页]{蔡敏2006--}\\
@@ -203,9 +216,10 @@ citestyle=gb7714-2015%,backref=true%%其中后端backend使用biber
见文献\pagescite[201-301]{Peebles2001-100-100}
4. 顺序编码制中同时输出作者和顺序编码标签,比如:\\
- 见\citeauthor{蔡敏2006--}\cite{蔡敏2006--}\\
+ 见\citet{蔡敏2006--}(顺序编码标签上标)\\
见\authornumcite{蔡敏2006--}\\
见\textcite{蔡敏2006--} (顺序编码标签不上标)
+ 见\citeauthor{蔡敏2006--}\cite{蔡敏2006--}\\
5. 作者年制文中已有作者还需要年份和页码(顺序编码制与pagescite作用相同,作者年制年份行内页码上标):\\
见蔡敏\yearpagescite[][205]{蔡敏2006--}和Peebles\yearpagescite[][15]{Peebles2001-100-100}
@@ -216,7 +230,11 @@ citestyle=gb7714-2015%,backref=true%%其中后端backend使用biber
见赵耀东(\citeyear{蔡敏2006--})
7. 作者年制中由标注命令给出作者年份信息,作者以主语方式作为正文内容:\\
- 见\textcite{蔡敏2006--}
+ 见\cite{蔡敏2006--}\\
+ 见\parencite{蔡敏2006--}\\
+ 见\textcite{蔡敏2006--}\\
+ 见\citet{蔡敏2006--}\\
+ 见\citep{蔡敏2006--}\\
8. 在页脚中引用和打印文献表:\\
见文献\footnote{在脚注中引用\footcite{蔡敏2006--}}\\
@@ -489,7 +507,30 @@ gbyntd 以语言、年份、作者、标题、降序排列
```\usepackage[backend=biber,citestyle=gb7714-2015ay,bibstyle=gb7714-2015]{biblatex}```
-参见:[issue:参考文献的顺序](https://github.com/sjtug/SJTUThesis/issues/300)
+但这种情况下,文献表中的年份信息是在出版项里面的,如果要提前到作者后面,可以使用如下方式:
+
+```\usepackage[backend=biber,style=gb7714-2015ay,gbgalign=right]{biblatex}```
+
+如果要让年份信息既出现在作者后面又出现在出版项里面,那么还可以增加mergedate选项进行控制:
+
+```\usepackage[backend=biber,style=gb7714-2015ay,gbgalign=right,mergedate=false]{biblatex}```
+
+这种情况下,直接用gb7714-2015ay下的gbgalign选项来生成数字标签的文献表,而且可以使用right/left/center/gb7714-2015等不同的选项值来实现不同对齐形式的标签。
+
+反过来如果要在文中引用是数字标签,而文献表是无数字标签的样式,那么也可以使用下面两种方式:
+
+```\usepackage[backend=biber,style=gb7714-2015,gbalign=gb7714-2015ay]{biblatex}```
+
+这种情况下,文献表中的年份信息是在出版项里面的,如果要提前到作者后面,则使用:
+
+```\usepackage[backend=biber,citestyle=gb7714-2015,bibstyle=gb7714-2015ay]{biblatex}```
+
+类似的也可以使用mergedate选项来控制年份的显示情况:
+
+```\usepackage[backend=biber,citestyle=gb7714-2015,bibstyle=gb7714-2015ay,mergedate=false]{biblatex}```
+
+参见:[issue:参考文献的顺序](https://github.com/sjtug/SJTUThesis/issues/300) ,
+[issue90](https://github.com/hushidong/biblatex-gb7714-2015/issues/90)
@@ -770,7 +811,7 @@ biblatex的参考文献表的换行是由tex的断行机制决定的,处理行
`{\MakeLowercase i}FogSim title contents`
-(2)修改titlecase域格式,即将如下命令放到导言区中,放biblatex后面
+(2)修改titlecase域格式,即将如下命令放到导言区中,放在biblatex宏包加载命令后面
```
\DeclareFieldFormat{titlecase}{\iftoggle{bbx:titlelink}{%
@@ -822,6 +863,17 @@ biblatex-gb7714-2015设计了两种多语言对照参考文献的实现方式,
具体示例见:[biblatex中如何修改参考文献中日期的著录格式](https://blog.csdn.net/xenonhu/article/details/86933525)
+* <b>我希望将文献表中期刊文献的卷和期使用加粗格式,请问该如何处理?</b>
+
+调整其域格式输出即可,比如:
+
+```
+\DeclareFieldFormat[article,periodical]{volume}{\textbf{#1}}
+\DeclareFieldFormat[article,periodical]{number}{\textbf{#1}}
+```
+
+见:[issue](https://github.com/sjtug/SJTUThesis/issues/580)
+
#### 4.3 Citation format/正文引用的标注格式
@@ -966,6 +1018,31 @@ biblatex中处理顺序数字编码压缩的代码默认从3个连续编码开
反之,从两个开始压缩改成3个连续压缩,方法是类似的,就是将中的0改回1。
+* <b>在顺序编码制标签中,希望修改编码压缩之间的符号,比如[1-2]变为[1~2],该怎么处理?</b>
+
+使用最新版本的biblatex (v3.15以后)可以直接定义如下标点:
+```
+\renewcommand{\multiciterangedelim}{$\sim$}
+```
+
+对于老版本可以修改宏,注意其中的注释
+```
+\renewbibmacro*{cite:dump}{
+ \ifnumgreater{\value{cbx@tempcnta}}{0}
+ {\ifnumgreater{\value{cbx@tempcnta}}{1}%1改为0,可以将压缩起始3个编号改为2个编号
+ {$\sim$}%压缩的链接标点修改\bibrangedash
+ {\multicitedelim}%
+ \bibhyperref[\cbx@lastkey]{%
+ \ifdef\cbx@lastprefix
+ {\printtext[labelprefix]{\cbx@lastprefix}}
+ {}%
+ \printtext[labelnumber]{\cbx@lastnumber}}}
+ {}%
+ \setcounter{cbx@tempcnta}{0}%
+ \global\undef\cbx@lastprefix}
+```
+
+
* <b>在正文中的某一部分,希望取消顺序编码标签中的压缩,而其他部分保持这种压缩,该怎么处理?</b>
@@ -1200,6 +1277,7 @@ biblatex中处理顺序数字编码压缩的代码默认从3个连续编码开
- ![teststyleerj.tex](example\teststyleerj.tex) 测试chinese-erj样式
- ![test-translator-in-other-lan.tex](example\test-translator-in-other-lan.tex) 测试译著的其它语言的译者格式
- ![test-space-after-citelabel-inCJKline.tex](example\test-space-after-citelabel-inCJKline.tex) 测试删除标注后因为xeCJK加入的空格
+ - ![test-special-chars-in-fields.tex](test-special-chars-in-fields.tex) 测试不同域中存在的特殊字符处理
---------------------------------------------------------
@@ -1428,6 +1506,7 @@ please see the file 'biblatex-gb7714-2015.pdf' for further information!
* 2020/07/21 v1.0v,ctan
* 2021/01/19 v1.0w,ctan
* 2021/04/03 v1.0x,ctan
+* 2021/05/06 v1.0y,ctan
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf
index a60f9e6783..43553a6da0 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf
Binary files differ
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex
index b817eb6b52..df72492e10 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex
@@ -382,16 +382,17 @@ perl gb7714texttobib.pl in=textfilename out=bibfilename
\begin{description}
\pdfbookmark[4]{gbalign}{gbalign}
- \item[gbalign]=\textbf{right},left,center,gb7714-2015. \hfill default is right
+ \item[gbalign]=\textbf{right},left,center,gb7714-2015,\textbf{gb7714-2015ay}. \hfill default: right for numeric style and gb7714-2015ay for author-year style
- 为顺序编码制增加的选项,用于选择参考文献表序号标签的对齐方式。
+ 为控制文献表数字序号标签增加的选项,用于选择是否生成序号标签及其对齐方式。
\begin{itemize}
- \item gbalign=right,默认的list环境中的标签右对齐;
- \item gbalign=left,是list环境中的标签左对齐;
- \item gbalign=center,是list环境中的等宽标签,数字在[]内居中;
- \item gbalign=gb7714-2015,是项对齐方式,即段落环境中标签使用原始宽度,标签与条目内容等间距。
+ \item gbalign=right,数字序号标签,是list环境中的标签右对齐,是gb7714-2015样式的默认选项;
+ \item gbalign=left,数字序号标签,是list环境中的标签左对齐;
+ \item gbalign=center,数字序号标签,是list环境中的等宽标签,数字在[]内居中;
+ \item gbalign=gb7714-2015,数字序号标签,是项对齐方式,即段落环境中标签使用原始宽度,标签与条目内容等间距。
+ \item gbalign=gb7714-2015ay,无数字序号标签,是author-year风格的文献表,是gb7714-2015ay样式的默认选项。
\end{itemize}
- 该选项对著者年份制无效。顺序编码制序号标签对齐方式测试,
+ 该选项对\textbf{著者年份制、顺序编码制均有效}。使用序号标签对齐方式的测试,
数字在标签内居中见:
\href{run:./example/opt-gbalign-center.tex}{opt-gbalign-center.tex},
标签左对齐见:
@@ -1305,6 +1306,8 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt]
二是采用正常段落环境的文献表,即设置gbalign=gb7714-2015时(即项对齐情况,就是各条文献是自身对齐的情况),在重定义的命令中通过调整lengthid尺寸来设置\emph{每条参考文献第二行开始的缩进距离}。
调整方法见例\ref{eg:biblist:hspace}。
+除了使用这种段落形式的文献表外,也有需求是要把文献表放到一个表格里面这样的需求,要求每一条文献占据表格的一行,这也是能实现的,但本宏包就不去实现了,具体有需求的用户可以在github 的biblatex下搜索tabular或者在tex.stackexchange上搜索biblatex tabular,已经有具体的实现了,这里不再赘述。
+
\begin{example}{文献表水平缩进控制}{eg:biblist:hspace}
\begin{texlist}
% 著者-出版年制文献表缩进控制
@@ -2012,7 +2015,7 @@ bib文件中的参考文献信息是以条目形式组织,一篇文献创建
各个数据域的录入应符合bib文件规范。需要注意:
-\bc{1. 有时直接从网络获取的参考文献信息中可能带有一些特殊字符比如\%,\&等,这些字符在 tex 中通常需要做转义处理,本样式中对像title,journal等常见域中出现的特殊字符已经做了转义,但是一些不常见的域比如 abstract 等没有考虑,所以用户需要手动处理,例如把\%改为\textbackslash \%,否则可能导致出错}
+\bc{1. 有时直接从网络获取的参考文献信息中可能带有一些特殊字符比如\%,\&等,这些字符在 tex 中通常需要做转义处理,本样式中对像title,journal,abstract,howpublished等常见域中出现的特殊字符已经做了转义,但也存在一些域没有考虑,所以当出现错误时,用户需要手动处理,例如把\%改为\textbackslash \%。}
\bc{2. 由于目前biber使用\href{https://github.com/ambs/Text-BibTeX/tree/master/btparse}
{btparse}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx
index 40065b5686..2ebf228c61 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -213,6 +213,22 @@
% 设置宏包选项
%=====================================================================
%
+ % 增加一个控制是否调整日期输出位置的选项mergedate
+ % 为兼容性考虑,但实际不产生作用了,因为如果要使用ay样式可以直接从bibstyle进入
+ % 因为使用string所以只适用于biblatex3.3以上版本
+ % 20210415,v1.0y,hzz
+ \DeclareBibliographyOption[string]{mergedate}[none]{%
+ \ifcsdef{bbx@opt@mergedate@#1}
+ {\csuse{bbx@opt@mergedate@#1}}
+ {}}
+ \ExecuteBibliographyOptions{mergedate}
+
+ \def\bbx@opt@mergedate@none{}%none就是正常的顺序编码样式
+ \def\bbx@opt@mergedate@true{}%none就是正常的顺序编码样式
+ \def\bbx@opt@mergedate@false{}%none就是正常的顺序编码样式
+
+
+ %
% 增加一个控制是否输出恢复传统crossref作用的选项
% 20210216,v1.0w,hzz
\newtoggle{bbx:citexref}
@@ -750,6 +766,7 @@
\ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}}{}
\ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}}{}
\ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{}
+ \ifstrequal{#1}{gb7714-2015ay}{\setaligngbstyleay}{}
}
}
{% 针对biblatex<3.3版本的选项设置
@@ -793,6 +810,7 @@
\ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}}{}
\ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}}{}
\ifstrequal{#1}{gb7714-2015}{}{}
+ \ifstrequal{#1}{gb7714-2015ay}{\setaligngbstyleay}{}
}
}
@@ -1356,6 +1374,24 @@
\step[fieldset=langid,fieldvalue={english}]
\step[fieldset=lansortorder,fieldvalue=\lankrorder]
}
+ \map[overwrite]{%bib中abstract和howpublished常出现特殊字符这里做一下预处理。
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
+ }
+ \map[overwrite]{%&符号处理
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
+ }
+ \map[overwrite]{%&符号处理
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
+ }
}
}
@@ -1505,7 +1541,7 @@
\map[overwrite]{
\step[fieldsource={location}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
}
- \map[overwrite]{
+ \map[overwrite]{%&符号处理
\step[fieldsource={institution}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
}
\map[overwrite]{
@@ -2111,6 +2147,23 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{\endgroup}
{\itemcmd}}
+%
+% 增加一个作者年制文献表格式的文献表输出环境。
+% 20210411,hzz,v1.0x
+\def\setaligngbstyleay{%
+\setlength{\bibhang}{1em}
+\setlength{\bibitemindent}{-\bibhang}
+\setlength{\bibitemsep}{4.5pt}
+\defbibenvironment{bibliography}
+ {\list
+ {}
+ {\setlength{\leftmargin}{\bibhang}%
+ \setlength{\itemindent}{\bibitemindent}%
+ \setlength{\itemsep}{\bibitemsep}%
+ \setlength{\parsep}{\bibparsep}}}
+ {\endlist}
+ {\item}
+}
%=====================================================================
% 设置单元或块等的标点
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
index 9ce600b2bf..a407be98e0 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015.cbx}[\versionofgbtstyle biblatex citation style]
%
@@ -38,6 +38,7 @@
%
% 修订使可用选项gblabelref来控制是否将标准标签中的作者加上超链接
% 20210121,v1.0w,hzz
+%
\iftoggle{iftlatest}%
{\renewbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
@@ -88,6 +89,25 @@
\setcounter{cbx@tempcnta}{0}%
\global\undef\cbx@lastprefix}
+%biblatex v3.15 增加了一堆标点命令如\multiciterangedelim
+%为方便用户定义,在新的版本中使用新的{cite:dump},尽管前面的定义也没有问题
+%前面的定义是适用于biblatex v2.8以后的版本的,从16年到20年都没动过
+%而且也适用于最新的版本,biblatex本身兼容性做的也还是不错的。
+\@ifpackagelater{biblatex}{2020/08/15}{%v3.15 2020-08-16
+ \renewbibmacro*{cite:dump}{%
+ \usebibmacro{cite:dump:inset}%
+ % dump labelnumber (+labelprefix)
+ \ifnumgreater{\value{cbx@tempcnta}}{0}
+ {\ifnumgreater{\value{cbx@tempcnta}}{0}%1改为0,可以将压缩起始3个编号改为2个编号
+ {\setunit{\multiciterangedelim}}
+ {\setunit{\multicitedelim}}%
+ \usebibmacro{cite:print:last:labelnumber}%
+ \global\undef\cbx@lastprefix}
+ {}%
+ \setcounter{cbx@tempcnta}{0}%
+ }%
+}{}
+
%
% 定义一个上标方括号wrapper
%
@@ -109,6 +129,14 @@
\mkbibbrackets{##1}}%
#1\endgroup}\kern\z@}
+\newrobustcmd{\mkbibsuperscriptusp}[1]{%
+ \unspace\allowhyphens\textsuperscript{%
+ \begingroup
+ \protected\long\def\mkbibsuperscriptusp##1{%
+ \blx@warning{Nested superscript}%
+ \mkbibbrackets{##1}}%
+ #1\endgroup}}
+
%
% 重定义cite命令
%
@@ -154,7 +182,7 @@
{}
{%[
\usebibmacro{cite:dump}]%
- \mkbibsuperscript{\printfield{postnote}}}
+ \mkbibsuperscriptusp{\printfield{postnote}}}
%
% 新定义pagescite命令,以满足标签带页码的国标要求
@@ -243,9 +271,11 @@
%
% 重定义citet,因为前面与\authornumcite同定义的命令无法正确处理多个bibtexkey同时给出的压缩情况
-% 20200721,v1.0v,hzz
+% 20200721,v1.0v,hzz
% 方法:利用textcite命令进行定义
% 基本利用textcite命令来写citet,仅利用bool{cbx:incitet}做判断,进而处理不同的上标和页码形式
+% 20210416,v1.0y,hzz:将namelabeldelim标点注释掉了,因为中文环境下不需要,
+% 若有需要可以用context sensitive的形式做定义
\newbool{cbx:incitet}
\global\booltrue{cbx:incitet}
@@ -263,7 +293,7 @@
\ifnameundef{labelname}
{\printfield[citetitle]{labeltitle}}
{\printnames{labelname}}%
- \setunit*{\printdelim{namelabeldelim}}%
+ %\setunit*{\printdelim{namelabeldelim}}%
\mkbibsuperscript{\printtext{\bibopenbracket}\global\booltrue{cbx:parens}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}%
@@ -378,7 +408,7 @@
\newbibmacro*{citec:dump}{%
\ifnumgreater{\value{cbx@tempcnta}}{0}
- {\ifnumgreater{\value{cbx@tempcnta}}{1}
+ {\ifnumgreater{\value{cbx@tempcnta}}{0}%从1改成0就是从3个开始压缩改成2个开始压缩
{\bibrangedash}
{\multicitedelim}%
\bibhyperref[\cbx@lastkey]{%
@@ -409,7 +439,8 @@
{}
{\usebibmacro{citec:dump}%
\usebibmacro{cite:init}%
- \setunit{\multicitedelim}}}
+ \setunit{\multicitedelim}%
+ }}
{\usebibmacro{citec:dump}%
\usebibmacro{cite:init}%
\setunit{\multicitedelim}%
@@ -420,7 +451,8 @@
{\ifboolexpr{ test {\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}}
or not test {\iffieldundef{postnote}}}
{\usebibmacro{citec:dump}%
- \usebibmacro{postnote}}
+ \printfield{postnote}%
+ }
{}}
\DeclareMultiCiteCommand{\citecs}[\mkbibsuperscript]{\citec}{}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
index 098e4b9462..2ecd604b01 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
@@ -10,7 +10,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015ay.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -591,6 +591,17 @@
%为姓名格式选择增加的计数器
\newcounter{gbnamefmtcase}
\def\thegbnamefmtcase{\the\c@gbnamefmtcase}
+ %为数字标签格式选择增加的计数器/命令
+ \newcommand{\mkgbnumlabel}[1]{\mkbibbrackets{#1}}
+ \def\gbbiblabelopt@bracket{\renewcommand{\mkgbnumlabel}[1]{\mkbibbrackets{##1}}}
+ \def\gbbiblabelopt@parens{\renewcommand{\mkgbnumlabel}[1]{\mkbibparens{##1}}}
+ \def\gbbiblabelopt@dot{\renewcommand{\mkgbnumlabel}[1]{##1\adddot}}
+ \def\gbbiblabelopt@plain{\renewcommand{\mkgbnumlabel}[1]{##1}}
+ \def\gbbiblabelopt@box{\renewcommand{\mkgbnumlabel}[1]{\framebox{##1}}}
+ \def\gbbiblabelopt@circle{\renewcommand{\mkgbnumlabel}[1]{\textcircled{##1}}}
+ %为文献表中数字标签对齐方式选择增加的计数器/命令
+ \newcounter{gbalignlabel}
+ \def\thegbalignlabel{\the\c@gbalignlabel}
%为引用标签标注/文献表中本地化字符串中英文选择增加的计数器/命令
\newcounter{gbcitelocalcase}
\newcounter{gbbiblocalcase}
@@ -666,7 +677,10 @@
% 增加序号标签格式处理选项,作者年制不做处理,给出只为兼容选项考虑
% v1.0l,20180623,hzz
%
- \DeclareBibliographyOption[string]{gbbiblabel}[bracket]{}
+ \DeclareBibliographyOption[string]{gbbiblabel}[bracket]{%
+ \csuse{gbbiblabelopt@#1}
+ }
+ \ExecuteBibliographyOptions{gbbiblabel}
%
% 增加姓名大小写格式处理选项
@@ -686,7 +700,13 @@
% 增加标签对齐选项
%
%因为在作者年制中,不需要使用,这里也增加,为了与顺序编码制的兼容性考虑。
- \DeclareBibliographyOption[string]{gbalign}[right]{}%
+ \DeclareBibliographyOption[string]{gbalign}[gb7714-2015ay]{
+ \ifstrequal{#1}{right}{\setcounter{gbalignlabel}{0}\setaligngbnumeric}{}
+ \ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}\setaligngbnumeric}{}
+ \ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}\setaligngbnumeric}{}
+ \ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{}
+ \ifstrequal{#1}{gb7714-2015ay}{}{}%默认就是ay样式的
+ }%
@@ -704,7 +724,10 @@
% 增加序号标签格式处理选项,作者年制不做处理,给出只为兼容选项考虑
% v1.0l,20180623,hzz
%
- \DeclareBibliographyOption{gbbiblabel}[bracket]{}
+ \DeclareBibliographyOption{gbbiblabel}[bracket]{%
+ \csuse{gbbiblabelopt@#1}
+ }
+ \ExecuteBibliographyOptions{gbbiblabel}
%
% 增加姓名大小写格式处理选项
@@ -724,7 +747,13 @@
% 增加标签对齐选项
%
%因为在作者年制中,不需要使用,这里也增加,为了与顺序年制的兼容性考虑。
- \DeclareBibliographyOption{gbalign}[right]{}%
+ \DeclareBibliographyOption{gbalign}[gb7714-2015ay]{%
+ \ifstrequal{#1}{right}{\setcounter{gbalignlabel}{0}\setaligngbnumeric}{}
+ \ifstrequal{#1}{left}{\setcounter{gbalignlabel}{1}\setaligngbnumeric}{}
+ \ifstrequal{#1}{center}{\setcounter{gbalignlabel}{2}\setaligngbnumeric}{}
+ \ifstrequal{#1}{gb7714-2015}{\setaligngbstyle}{}
+ \ifstrequal{#1}{gb7714-2015ay}{}{}
+ }%
}
@@ -1452,6 +1481,24 @@
% address,location,institution,organization}]{
% \step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
% }
+ \map[overwrite]{%bib中abstract和howpublished常出现特殊字符这里做一下预处理。
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
+ }
+ \map[overwrite]{
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
+ }
+ \map[overwrite]{%&符号处理
+ \step[fieldsource={abstract}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
+ }
+ \map[overwrite]{%&符号处理
+ \step[fieldsource={howpublished}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
+ }
}
}
@@ -1849,8 +1896,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
%
% 增加一个\bibitemindent尺寸用于控制list环境的itemindent
% v1.0l,20180615,hzz
-\setlength{\bibhang}{1em}
\newlength{\bibitemindent}
+\setlength{\bibhang}{1em}
\setlength{\bibitemindent}{-\bibhang}
\setlength{\bibitemsep}{4.5pt}
\defbibenvironment{bibliography}
@@ -1863,19 +1910,43 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{\endlist}
{\item}
%
-% 增加一个numerical环境用于自动显示数字
-% v1.0w,20210311,hzz
-\newcounter{refnumerical}
+% 增加一个numeric环境用于自动显示数字
+% v1.0w,20210311,hzz
+% v1.0x,20210411,hzz,整合到gbalign选项中。
+\newcounter{refnumeric}
\newlength{\biblabelextend}
-\defbibenvironment{numerical}
+\def\setaligngbnumeric{%
+\defbibenvironment{bibliography}
+ {\setlength{\bibhang}{\biblabelsep}%
+ \setlength{\labelnumberwidth}{2em}%
+ \setlength{\bibitemindent}{0pt}%
+ \setlength{\biblabelextend}{0pt}%
+ \setlength{\biblabelextend}{0pt}%
+ \list
+ {\printtext[labelnumberwidth]{\arabic{refnumeric}}}
+ {\usecounter{refnumeric}%
+ \addtolength{\labelnumberwidth}{\biblabelextend}%
+ \setlength{\labelwidth}{\labelnumberwidth}%
+ \setlength{\labelsep}{\biblabelsep}%
+ \setlength{\leftmargin}{\bibhang}%
+ \addtolength{\leftmargin}{\labelnumberwidth}%
+ \setlength{\itemindent}{\bibitemindent}%
+ \setlength{\itemsep}{\bibitemsep}%
+ \setlength{\parsep}{\bibparsep}}%
+ \renewcommand*{\makelabel}[1]{\hss####1}}
+ {\endlist}
+ {\item}
+}
+
+\defbibenvironment{numerical}%作者年制中数字标签的文献表环境
{\setlength{\bibhang}{\biblabelsep}%
\setlength{\labelnumberwidth}{2em}%
\setlength{\bibitemindent}{0pt}%
\setlength{\biblabelextend}{0pt}%
\setlength{\biblabelextend}{0pt}%
\list
- {\printtext[labelnumberwidth]{[\arabic{refnumerical}]}}
- {\usecounter{refnumerical}%
+ {\printtext[labelnumberwidth]{\arabic{refnumeric}}}
+ {\usecounter{refnumeric}%
\addtolength{\labelnumberwidth}{\biblabelextend}%
\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\labelsep}{\biblabelsep}%
@@ -1888,6 +1959,65 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
{\endlist}
{\item}
+\DeclareFieldFormat{labelnumberwidth}{%
+\ifcase\value{gbalignlabel}%右对齐,整个标签为右对齐
+ \mkgbnumlabel{#1}%
+\or%左对齐,整个标签为左对齐
+ \mkgbnumlabel{#1}\hfill%
+\or%中间对齐,比如:序号数字居于[]中间
+ \hfil\mkgbnumlabel{\hfill#1\hfill}\hfil%
+\fi}
+
+%
+% 修改序号标签格式为以各条参文献为基础进行对齐的方式,即序号与条目内容间隔相等的方式。
+\def\setaligngbstyle{%
+\def\blx@bibitem##1{%
+ \blx@ifdata{##1}
+ {\begingroup
+ \blx@getdata{##1}%
+ \blx@bibcheck
+ \iftoggle{blx@skipentry}{}{%
+ \blx@setdefaultrefcontext{##1}%
+ \global\let\blx@noitem\@empty
+ \blx@setoptions@type\abx@field@entrytype
+ \blx@setoptions@entry
+ \blx@thelabelnumber
+ \addtocounter{instcount}\@ne
+ \blx@initsep
+ \blx@namesep
+ \csuse{blx@item@\blx@theenv}\relax
+% \blx@initsep %移动到上面去,恢复bibnamesep等的作用机制
+% \blx@namesep
+ \csuse{blx@hook@bibitem}%
+ \blx@execute
+ \blx@initunit
+ \blx@anchor
+ \blx@beglangbib
+ \bibsentence
+ \blx@pagetracker
+ \blx@driver\abx@field@entrytype
+ \blx@postpunct
+ \blx@endlangbib}%
+ \par\endgroup}%这里增加了一个\par
+ {}}
+\newlength{\lengthid}
+\newlength{\lengthlw}
+\newcommand{\itemcmd}{%
+\settowidth{\lengthid}{\mkgbnumlabel{\arabic{refnumeric}}}
+\addtolength{\lengthid}{\biblabelsep}
+\setlength{\lengthlw}{\textwidth}
+\addtolength{\lengthlw}{-\lengthid}
+\addvspace{\bibitemsep}%恢复\bibitemsep的作用
+%\parshape 2 0em \textwidth \lengthid \lengthlw
+\hangindent\lengthid
+\mkgbnumlabel{\arabic{refnumeric}}%
+\hspace{\biblabelsep}}
+%
+% 简单的段落环境
+\defbibenvironment{bibliography}
+{\begingroup\setcounter{refnumeric}{0}\setlength{\parindent}{0em}}
+{\endgroup}
+{\stepcounter{refnumeric}\itemcmd}}
%=====================================================================
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx
index b5c3a34dd8..e965dc84f8 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015ay.cbx}[\versionofgbtstyle biblatex citation style]
%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
index 635eeed2a8..f325830019 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015ms.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -1159,14 +1159,16 @@
\step[fieldset=keywords, fieldvalue={,}, append]
\step[fieldset=keywords, origfieldval, append]
}
- \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{
+ \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
}
- \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{
+ \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
}
\map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
- address,location,institution,organization}]{
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
}
}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx
index f46151d4ed..b718fde050 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015ms.cbx}[\versionofgbtstyle biblatex citation style]
%
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx
index 99b6847fde..49a4f328c6 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015mx.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -1253,14 +1253,16 @@
\step[fieldset=keywords, fieldvalue={,}, append]
\step[fieldset=keywords, origfieldval, append]
}
- \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{
+ \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\#}, replace=\regexp{$1\\\#}]
}
- \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,address,location,institution,organization}]{
+ \map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\%}, replace=\regexp{$1\\\%}]
}
\map[overwrite, foreach={title,booktitle,journaltitle,journal,publisher,%
- address,location,institution,organization}]{
+ address,location,institution,organization,abstract,howpublished}]{
\step[fieldsource=\regexp{$MAPLOOP}, match=\regexp{([^\\])\x26}, replace=\regexp{$1\\\x26}]
}
}
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx
index c33d610756..4ab0cd5427 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015mx.cbx}[\versionofgbtstyle biblatex citation style]
%
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 2247ca0125..6917c83e8b 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -24,11 +24,11 @@
% \changes{v1.20}{2021/01/09}{修改和完善用户文档。}
% \changes{v1.20}{2021/01/09}{模板更改为使用 CC-BY 许可协议。}
% \changes{v1.23}{2021/03/19}{修复在 \pkg{ctex} v2.5.6 更新后 \cls{easybook} 与 \pkg{hyperref} 冲突问题。}
-% \changes{v1.25b}{2021/05/03}{取消附带的示例文件,可查看历史版本及其它来源的使用样例。}
+% \changes{v1.25c}{2021/05/03}{取消附带的示例文件,可查看历史版本及其它来源的使用样例。}
%
% \title{\sffamily easybook 文档类手册}
% \author{瞿毅}
-% \date{2021/05/05\hskip\ccwd\relax v1.25b\thanks{\url{https://gitee.com/texl3/easybook}}}
+% \date{2021/05/06\hskip\ccwd\relax v1.25c\thanks{\url{https://gitee.com/texl3/easybook}}}
%
% \maketitle
% \begin{abstract}
@@ -118,7 +118,7 @@
% \end{syntax}
% 传递给 \cls{ctexbook} 设置字体,最好不要使用原有的 \opt{fontset} 选项,默认情况下使用自定义字体而不开启这个选项,可根据安装的字体及电脑系统选取。\opt{noto} 与 \opt{none} 选项的相关描述见小节 \ref{subsec:font settings},\opt{overleaf} 是一个各系统通用选项,会检测系统环境选取对应字体。
% \changes{v1.21}{2021/01/12}{默认字体与 \CTeX 一致,不再是自定义字体。}
-% \changes{v1.25b}{2021/05/04}{修复使用 \pkg{xeCJK} 与 \pkg{fontspec} 宏包的字体设置命令在 \hologo{LuaLaTeX} 下失效的问题。}
+% \changes{v1.25c}{2021/05/04}{修复使用 \pkg{xeCJK} 与 \pkg{fontspec} 宏包的字体设置命令在 \hologo{LuaLaTeX} 下失效的问题。}
% \end{function}
%
% \begin{function}[rEXP,added = 2021-01-05,updated = 2021-01-13]{paper}
@@ -169,7 +169,7 @@
% \tn{listoflistings*+}\oarg{键值列表}
% \end{syntax}
% \tn{listoffigures} 命令输出图片目录,\tn{listoftables} 输出表格目录,\tn{listoflistings} 输出代码目录。带有星号的目录命令不将标题添加进主文档目录,带有+号的目录命令可以使当前标题编号。\tn{tableofcontents+} 与其它命令不同是用于输出双语目录,需要与双语目录标题命令 \tn{bichapter} 等或设置图片、表格和代码等英文目录的标题配合使用,附加代码是中文与英文目录之间的代码,可以插入文本和换页命令等。目录的键值列表选项如下
-% \changes{v1.25b}{2021/05/05}{命令 \tn{tableofcontents} 可以输出双语目录。}
+% \changes{v1.25c}{2021/05/05}{命令 \tn{tableofcontents} 可以输出双语目录。}
% \end{function}
%
% \begin{function}{multoc,title,book,article}
@@ -183,19 +183,19 @@
% \end{function}
%
% \subsubsection{标题命令}
-% \begin{function}[added = 2021-05-05]{\bichapter,\bisection,\bisubsection,\bichapter*,\bisection*,\bisubsection*}
+% \begin{function}[added = 2021-05-05]{\bichapter,\bichapter*,\bisection,\bisection*,\bisubsection,\bisubsection*}
% \begin{syntax}
% \tn{bichapter}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
-% \tn{bisection}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
-% \tn{bisubsection}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
% \tn{bichapter*}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
+% \tn{bisection}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
% \tn{bisection*}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
+% \tn{bisubsection}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
% \tn{bisubsection*}\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}
% \end{syntax}
-% 双语目录的标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录,这个功能是为国内一些大学的学位论文模板的要求设计,当然在英文模式下不需要使用。
+% 双语目录的标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录,这个功能是为国内一些大学的学位论文模板的要求设计,在一般情况和英文模式下不需要使用。
%
-% 它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一点与 \tn{chapter*} 等命令的行为不太一样。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。双语目录的格式是一致的,共享使用 \tn{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下
-% \changes{v1.25b}{2021/05/05}{增加与双语目录配合的标题命令。}
+% 它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \tn{chapter*} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。双语目录的格式是一致的,共享使用 \tn{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下
+% \changes{v1.25c}{2021/05/05}{增加与双语目录配合的标题命令。}
% \end{function}
%
% \begin{function}{biname,binmuber}
@@ -224,7 +224,7 @@
% \begin{tabular}{*{5}{c}}
% \toprule
% \hyperref[subsec:style]{风格} & \hyperref[subsec:hyperlinks]{超链接} & \hyperref[subsec:other font]{其它字体} & \hyperref[subsec:spacing]{行距} & \hyperref[subsec:reference]{参考文献} \\
-% style & link & elsefont & spread & bibset \\
+% style & refset & elsefont & spread & bibset \\
% \midrule
% \hyperref[subsec:theorem of style]{定理样式} & \hyperref[subsec:page margins]{页面尺寸} & \hyperref[subsec:header and footer]{页眉页脚} & \hyperref[subsec:catalog style]{目录样式} & \\
% thmset & geoset & hdrset & tocset & \\
@@ -283,17 +283,18 @@
%
% \subsection{超链接}
% \label{subsec:hyperlinks}
-% \begin{function}[EXP,added = 2021-01-05,updated = 2021-04-18]{hyperlink,linkcolor,linkcol-all,linktoc}
+% \begin{function}[EXP,added = 2021-01-05,updated = 2021-05-06]{hyperlink,linkcolor,linkcol-all,linktoc}
% \begin{syntax}
% hyperlink = <(edge)|various|none>
% linkcolor = <fresh|cutepink|(navyblue)|crimson>
% linkcol-all = <HTML颜色代码>
% linktoc = <none|section|page|(all)>
% \end{syntax}
-% \ding{229} 以上选项路径为 \opt{link/...} \\
-% \opt{link} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。
+% \ding{229} 以上选项路径为 \opt{refset/...} \\
+% \opt{refset} 将超链接选项(包括以上选项)交给 \pkg{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \tn{hypersetup} 支持的多数选项可用。
% \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。}
% \changes{v1.24}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。}
+% \changes{v1.25c}{2021/05/06}{模块名 \opt{link} 改为 \opt{refset},\opt{link} 作为兼容性保留。}
% \end{function}
%
% \begin{optdesc}
@@ -361,13 +362,13 @@
%
% \subsection{参考文献}
% \label{subsec:reference}
-% \begin{function}[EXP,added = 2021-01-11,updated = 2021-04-09]{bib-loadpkg,backend,bib-style,cite-style,bibfile}
+% \begin{function}[EXP,added = 2021-01-11,updated = 2021-04-09]{loadpkg,backend,bib-style,cite-style,datafile}
% \begin{syntax}
-% bib-loadpkg = <(true)|false>
+% loadpkg = <(true)|false>
% backend = <(bibtex)|biblatex>
% bib-style = <(numerical)|authoryear|其它格式>
% cite-style = <标注风格>
-% bibfile = <refs.bib>
+% datafile = <refs.bib>
% \end{syntax}
% \ding{229} 以上选项路径为 \opt{bibset/...}
% \changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。}
@@ -376,18 +377,18 @@
% \end{function}
%
% \begin{optdesc}
-% \item[bib-loadpkg] 是否载入 \pkg{natbib} 或 \pkg{biblatex} 宏包,关闭此选项后需要在导言区手动载入参考文献宏包,之后可使用相关配置命令(见下文)或完全自行设置参考文献。
+% \item[loadpkg] 是否载入 \pkg{natbib} 或 \pkg{biblatex} 宏包,关闭此选项后需要在导言区手动载入参考文献宏包,之后可使用相关配置命令(见下文)或完全自行设置参考文献。
% \item[backend] 参考文献处理后端,默认用传统的 \hologo{BibTeX} 处理参考文献。
% \item[bib-style] 参考文献格式为中国的参考文献推荐标准GB/T 7714-2015,有顺序编码制和著者-出版年制两种风格,理工科类一般使用顺序编码制,文科类一般使用著者-出版年制。若使用其它格式,使用 \hologo{BibTeX} 处理时需确保正确的 \opt{bst} 文件,使用 \hologo{biber} 处理可使用 \pkg{biblatex} 宏包支持的参考文献风格名称。
% \item[cite-style] 标注参考文献的风格,\opt{backend = bibtex} 选项下可使用 \opt{super}(数字上标标注,默认)或 \opt{numbers}(数字标注)等 \pkg{natbib} 宏包带有的标注风格,\opt{backend = biblatex} 选项下可使用 \pkg{biblatex} 宏包支持的标注风格名称。
-% \item[bibfile] 参考文献数据库的文件名,使用 \hologo{biber} 处理时要带有 \opt{bib} 后缀,若不在当前文件夹名称需要包含路径,默认是一个在当前文件夹以 \opt{refs.bib} 命名的文件。
+% \item[datafile] 参考文献数据库的文件名,使用 \hologo{biber} 处理时要带有 \opt{bib} 后缀,若不在当前文件夹名称需要包含路径,默认是一个在当前文件夹以 \opt{refs.bib} 命名的文件。
% \end{optdesc}
%
% \begin{function}[added = 2021-01-11,updated = 2021-04-09]{\printbibliography,\EbBibtexSet,\EbBiblatexPreset,\EbBiblatexPostset}
% \begin{syntax}
% \tn{printbibliography}\oarg{键值列表}
% \end{syntax}
-% 关闭 \opt{bib-loadpkg} 选项时 \opt{bibset} 中的选项会失效,但是后三个命令保存了 \opt{bibset} 模块预置的参考文献选项与配置,与对应宏包配合使用它们时 \opt{bibset} 中的选项仍然有效,也可以不使用它们完全自行设置参考文献方案。开启 \opt{bib-loadpkg} 选项对它们重新定义也可以达到重新设置参考文献的效果。
+% 关闭 \opt{loadpkg} 选项时 \opt{bibset} 中的选项会失效,但是后三个命令保存了 \opt{bibset} 模块预置的参考文献选项与配置,与对应宏包配合使用它们时 \opt{bibset} 中的选项仍然有效,也可以不使用它们完全自行设置参考文献方案。开启 \opt{loadpkg} 选项对它们重新定义也可以达到重新设置参考文献的效果。
% \end{function}
%
% \begin{optdesc}
@@ -647,7 +648,7 @@
% \end{function}
%
% \subsection{列表}
-% \begin{function}[added = 2021-01-05,updated = 2021-04-08]{enumerate,itemize,description,enumerate*,itemize*,description*}
+% \begin{function}[added = 2021-01-05,updated = 2021-04-08]{enumerate,enumerate*,itemize,itemize*,description,description*}
% \begin{syntax}
% \tn{begin}\marg{环境名}\oarg{键值列表}
% \ \tn{item} <列表内容>
@@ -945,7 +946,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplClass{easybook}{2021/05/05}{1.25b}{beta}
+\ProvidesExplClass{easybook}{2021/05/06}{1.25c}{beta}
\cs_generate_variant:Nn \eb_ctex_define:nn { nx }
\cs_generate_variant:Nn \int_to_arabic:n { v }
@@ -1058,8 +1059,8 @@
\seq_const_from_clist:Nn \c__eb_options_path_seq
{
- style,link,elsefont,
- spread,bibset,thmset,
+ style,elsefont,spread,
+ refset,bibset,thmset,
geoset,hdrset,tocset
}
\seq_map_inline:Nn \c__eb_options_path_seq
@@ -1067,8 +1068,10 @@
\ctex_define:n { #1 .meta:nn = { ctex/#1 } {##1} }
\cs_new:cpn {#1} ##1 { \keys_set:nn {ctex/#1} {##1} }
}
+\keys_define:nn { } { ctex/link .inherit:n = ctex/refset }
\ctex_define:n
{
+ link .meta:nn = { ctex/link } {#1},
lstlistlistingname .tl_set:N = \lstlistlistingname,
lstlistingname .tl_set:N = \lstlistingname
}
@@ -1167,8 +1170,8 @@
}
\cs_new_protected:Npn \eb_font_double_engine_set:n #1
{
- \exp_args:Nc \RenewDocumentCommand {set #1 font}{O{}mO{}}
- {\use:c { eb_set #1 font:nn }{##2}{##1,##3}}
+ \exp_args:Nc \RenewDocumentCommand {set#1font}{O{}mO{}}
+ {\use:c { eb_set#1font:nn }{##2}{##1,##3}}
}
\seq_const_from_clist:Nn \c__eb_font_reset_family_seq
{ main,sans,mono,CJKmain,CJKsans,CJKmono }
@@ -1643,7 +1646,7 @@
{ chapter,section,subsection }
\seq_map_inline:Nn \c__eb_bitoc_title_level_seq
{
- \exp_args:Nc \NewDocumentCommand {bi #1}{sO{##3}mm}
+ \exp_args:Nc \NewDocumentCommand {bi#1}{sO{##3}mm}
{
\IfBooleanTF{##1}
{
@@ -1689,10 +1692,10 @@
multoc .initial:n = false,
title .code:n = \eb_assign_toc_title:n {#1}
}
-\NewDocumentCommand \eb_assign_toc_title:n
+\NewDocumentCommand{\eb_assign_toc_title:n}
{>{\SplitArgument{1}{,}}m}
- {\eb_assign_toc_title:nn #1}
-\cs_new_protected:Npn \eb_assign_toc_title:nn #1#2
+ {\eb_assign_toc_title_judge:nn #1}
+\cs_new_protected:Npn \eb_assign_toc_title_judge:nn #1#2
{
\tl_set:Nn \eb@toc@title {#1}
\tl_if_novalue:nTF {#2}
@@ -1796,10 +1799,10 @@
\eb_multoc_pre_bool:
\eb_title_mark_notoc:n { \eb@toc@title }
\vspace*{\dim_use:N \l__eb_toc_offset_dim}
- \@starttoc{toc}
+ \@starttoc{toc}#3
\IfBooleanT{#1}
{
- #3\eb_title_mark_notoc:n { \eb@bitoc@title }
+ \eb_title_mark_notoc:n { \eb@bitoc@title }
\vspace*{\dim_use:N \l__eb_toc_offset_dim}
\@starttoc{tec}
}
@@ -1970,7 +1973,7 @@
\captionsetup[table][bi-second]{name = Table}
}
-\cs_new:Npn \eb_arabic:n #1 { \int_to_arabic:v { c@ #1 } }
+\cs_new:Npn \eb_arabic:n #1 { \int_to_arabic:v { c@#1 } }
\cs_gset:cpn { thesection }
{
\int_compare:nNnT { \c@chapter } > { 0 } { \thechapter. }
@@ -1980,7 +1983,7 @@
{ figure,table,lstlisting,equation }
\seq_map_inline:Nn \c__eb_serial_number_counter_seq
{
- \cs_set:cpn { the #1 }
+ \cs_set:cpn { the#1 }
{
\int_compare:nNnT { \c@chapter } > { 0 }
{
@@ -2167,7 +2170,7 @@
\eb_at_end_preamble:n
{
\exp_last_unbraced:No
- \declaretheoremstyle\c__eb_thmtools_keyval_tl{easy-theorem}
+ \declaretheoremstyle{\c__eb_thmtools_keyval_tl}{easy-theorem}
\eb_thmname_set:nnn { exercise } { Exercise } { 练习 }
\cs_undefine:N \proof
\clist_map_inline:nn
@@ -2203,16 +2206,16 @@
}
\sisetup
{
+ detect-shape,
detect-family,
detect-weight,
- detect-shape,
+ table-parse-only,
+ detect-display-math,
detect-inline-family = math,
detect-inline-weight = math,
- detect-display-math,
- table-parse-only,
- range-phrase = \ensuremath{\sim},
- range-units = single,
- group-digits = false
+ range-phrase = \ensuremath{\sim},
+ range-units = single,
+ group-digits = false
}
\allowdisplaybreaks[4]
\tl_gset:Nn \ULthickness { 0.75pt }
@@ -2334,7 +2337,7 @@
}{
\group_begin:
\keys_set:nn { ctex/section } { format += \centering }
- \IfValueT{#6}{\keys_set:nn { ctex/section } {#6}}
+ \IfValueT{#6}{\ctex_set:nn { section } {#6}}
\IfBooleanTF{#1}{\section*{#5}}{\section{#5}}
\group_end:
}#7
@@ -2426,12 +2429,12 @@
cite-style .code:n =
{ \tl_set:Nn \l__eb_bib_citestyle_tl {#1} },
- bibfile .tl_set:N = \l__eb_bib_file_tl,
- bibfile .initial:n = refs.bib,
+ datafile .tl_set:N = \l__eb_bib_file_tl,
+ datafile .initial:n = refs.bib,
- bib-loadpkg .bool_set:N = \l__eb_bib_loadpkg_bool,
- bib-loadpkg .default:n = true,
- bib-loadpkg .initial:n = true,
+ loadpkg .bool_set:N = \l__eb_bib_loadpkg_bool,
+ loadpkg .default:n = true,
+ loadpkg .initial:n = true,
bitoc-title .tl_set:N = \l__eb_bib_bitoc_title,
bitoc-title .initial:n = Reference
@@ -2646,7 +2649,7 @@
}
\bool_set_false:N \l__eb_toc_number_color_bool
-\eb_ctex_define:nn { link }
+\eb_ctex_define:nn { refset }
{
hyperlink .choice:,
hyperlink/edge .code:n = { },
@@ -2683,7 +2686,7 @@
}
}
}
-\eb_ctex_define:nx { link }
+\eb_ctex_define:nx { refset }
{
linkcolor .choice:,
\clist_map_function:nN
@@ -2720,9 +2723,9 @@
\cs_new:Npn \eb_allow_urlbreak:
{
\cs_new:Npn \eb_add_urlbreak_points:
- { \tl_map_function:NN \c__eb_urlbreak_points_tl\do }
- \eb_appto_cmd:Nn
- \UrlBreaks{\UrlOrds\eb_add_urlbreak_points:}
+ { \tl_map_function:NN \c__eb_urlbreak_points_tl \do }
+ \eb_appto_cmd:Nn \UrlBreaks
+ { \UrlOrds\eb_add_urlbreak_points: }
}
\tl_const:Nn \c__eb_urlbreak_points_tl
{
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 64d2cf8aee..d273043128 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/froufrou/LICENSE b/macros/latex/contrib/froufrou/LICENSE
index efd0bb0166..a953e0b709 100644
--- a/macros/latex/contrib/froufrou/LICENSE
+++ b/macros/latex/contrib/froufrou/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2020 Nelson Lago <lago@ime.usp.br>
+Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License, either version 1.3c of this license or (at
diff --git a/macros/latex/contrib/froufrou/README.md b/macros/latex/contrib/froufrou/README.md
index 3f5fa67343..66d015391a 100644
--- a/macros/latex/contrib/froufrou/README.md
+++ b/macros/latex/contrib/froufrou/README.md
@@ -6,7 +6,7 @@ a new chapter or section.
Code etc: <https://gitlab.com/lago/froufrou>
-Copyright 2020 Nelson Lago <lago@ime.usp.br>
+Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License, either version 1.3c of this license or (at
diff --git a/macros/latex/contrib/froufrou/froufrou.dtx b/macros/latex/contrib/froufrou/froufrou.dtx
index ba136ed6e3..4c027d8acf 100644
--- a/macros/latex/contrib/froufrou/froufrou.dtx
+++ b/macros/latex/contrib/froufrou/froufrou.dtx
@@ -1,5 +1,5 @@
% \iffalse meta-comment
-% Copyright 2020 Nelson Lago <lago@ime.usp.br>
+% Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License, either version 1.3c of this license or (at
@@ -15,7 +15,7 @@
% \iffalse
%
%<package>\NeedsTeXFormat{LaTeX2e}[2015/01/01]
-%<package>\ProvidesPackage{froufrou}[2021/04/22 1.3.0 Visual section separator]
+%<package>\ProvidesPackage{froufrou}[2021/05/06 1.4.0 Visual section separator]
%
%<*driver>
@@ -35,6 +35,7 @@
}
\usepackage{froufrou}
+\usepackage{pgfornament}
\usepackage{libertinus}
\usepackage[scale=.85]{sourcecodepro}
@@ -61,6 +62,9 @@
% \changes{v1.3.0}{2021/04/22}{More related packages}
% \changes{v1.3.0}{2021/04/22}{Small doc improvements}
% \changes{v1.3.0}{2021/04/22}{Add ``closing'' ornament}
+% \changes{v1.4.0}{2021/05/06}{Add related package}
+% \changes{v1.4.0}{2021/05/06}{Add \texttt{pgfornament} example}
+% \changes{v1.4.0}{2021/05/06}{Make nested optional arguments work by using xparse}
%
% \GetFileInfo{froufrou.sty}
%
@@ -143,7 +147,19 @@
% Beyond the predefined ornaments, you may also use
% \verb|\setfroufrou{SOMETHING}| or \verb|\froufrou[SOMETHING]|
% to make \verb|SOMETHING| be the separator. However, please note
-% that \verb|\usepackage[SOMETHING]{froufrou}| does \emph{not} work!
+% that \verb|\usepackage[SOMETHING]{froufrou}| does \emph{not}
+% work! An example using the \mbox{\verb|pgfornament|} package:
+%
+% \bgroup\footnotesize\vspace{\baselineskip}
+% \noindent
+% \verb|\froufrou[\pgfornament[height=.1cm]{87}\hspace{-2pt}\pgfornament[width=.5cm,|\\
+% \verb|ydelta=-10pt]{9}\hspace{-2pt}\pgfornament[symmetry=v,height=.1cm]{87}]|\par
+% \vspace{\baselineskip}\egroup
+%
+% \noindent which produces
+%
+% \froufrou[\pgfornament[height=.1cm]{87}\hspace{-2pt}\pgfornament[width=.5cm,
+% ydelta=-10pt]{9}\hspace{-2pt}\pgfornament[symmetry=v,height=.1cm]{87}]
%
% \section{See also}
%
@@ -151,15 +167,14 @@
% \item \url{http://tug.org/TUGboat/tb32-2/tb101glister.pdf} ;
%
% \item The \verb|pgfornament|, \verb|adforn|, \verb|fourier-orns|,
-% \verb|marvosym|, \verb|typicons|, \verb|adfsymbols|,
-% \verb|pifont|, and \verb|fontawesome| packages, which
-% may aid in creating separators;
+% \verb|marvosym|, \verb|typicons|, \verb|decorule|,
+% \mbox{\verb|pifont|}, \verb|adfsymbols|, \verb|fontawesome|,
+% and \verb|fontawesome5| packages, which may aid in creating
+% separators;
%
-% \item The \verb|novel| class, which offers the somewhat similar
-% \verb|\ChapterDeco| command;
-%
-% \item The \verb|memoir| class, which offers the somewhat similar
-% \verb|\fancybreak| command;
+% \item The \verb|novel| and \verb|memoir| classes, which offer
+% the somewhat similar commands \verb|\ChapterDeco| and
+% \verb|\fancybreak| respectively;
%
% \item The \verb|sectionbreak| package, similar to this one.
% \end{itemize}
@@ -172,6 +187,7 @@
\RequirePackage{etoolbox}
\RequirePackage{expl3}
+\RequirePackage{xparse}
\RequirePackage{tikz}
% .1\textwidth works well for one and two-column text.
@@ -311,17 +327,12 @@
% The starred form means "indent the first line of the next paragraph"
% (\if@afterindent is read by \@afterheading)
-\newcommand{\froufrou}{%
- \@ifstar{\@afterindenttrue\@realfroufrou}{\@afterindentfalse\@realfroufrou}%
-}
-
-% For compatibility with older versions of this package
-\newcommand\frufru{\froufrou}
-
-\newcommand{\@realfroufrou}[1][]{%
+\NewDocumentCommand{\froufrou}{s O{}}{%
% Make sure we left horizontal mode.
\nopagebreak[4]\par
+ \IfBooleanTF{#1}{\@afterindenttrue}{\@afterindentfalse}
+
\nopagebreak[4]\@froufrouspacebefore\nopagebreak[4]
% Start a new group to (1) reset \doublespacing, \parskip, and
@@ -331,7 +342,7 @@
% for the ornament because font size changes in it should not
% affect spacing either.
\bgroup
- \setfroufrou{#1}%
+ \setfroufrou{#2}%
\normalsize
\ifdefvoid{\setstretch}{}{\setstretch{\setspace@singlespace}}% normally 1
\setlength{\parskip}{0pt}
@@ -355,6 +366,11 @@
\@afterheading
}
+% For compatibility with older versions of this package.
+\NewDocumentCommand{\frufru}{s O{}}{%
+ \IfBooleanTF{#1}{\froufrou*[#2]}{\froufrou[#2]}%
+}
+
\newcommand\@froufrouFixSpacingAfter{
% The next \par will add \parskip and \baselineskip. We want to
% (1) eliminate \parskip so that spacing does not change if it
diff --git a/macros/latex/contrib/froufrou/froufrou.ins b/macros/latex/contrib/froufrou/froufrou.ins
index 8d5b250ad6..d366f1e5f6 100644
--- a/macros/latex/contrib/froufrou/froufrou.ins
+++ b/macros/latex/contrib/froufrou/froufrou.ins
@@ -1,4 +1,4 @@
-%% Copyright 2020 Nelson Lago <lago@ime.usp.br>
+%% Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3c of this license or (at
@@ -16,7 +16,7 @@
\usedir{tex/latex/froufrou}
\preamble
-Copyright 2020 Nelson Lago <lago@ime.usp.br>
+Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License, either version 1.3c of this license or (at
diff --git a/macros/latex/contrib/froufrou/froufrou.pdf b/macros/latex/contrib/froufrou/froufrou.pdf
index c3c107acc5..f941844dea 100644
--- a/macros/latex/contrib/froufrou/froufrou.pdf
+++ b/macros/latex/contrib/froufrou/froufrou.pdf
Binary files differ
diff --git a/macros/latex/contrib/hvfloat/Changes b/macros/latex/contrib/hvfloat/Changes
index 1b9013caae..c2e191ac47 100644
--- a/macros/latex/contrib/hvfloat/Changes
+++ b/macros/latex/contrib/hvfloat/Changes
@@ -1,4 +1,6 @@
hvfloat.sty:
+2.22 2021-05-06 - fix for default placement and vertical space for
+ full page images
2.21 2021-05-04 - fix for several bugs (onlyText, spaces,...)
2.20 2021-04-29 - use better macronames for setting the defaults
and defining an own style
diff --git a/macros/latex/contrib/hvfloat/doc/examples/README.exa b/macros/latex/contrib/hvfloat/doc/examples/README.exa
index f5c52e2e98..e6a3dff255 100644
--- a/macros/latex/contrib/hvfloat/doc/examples/README.exa
+++ b/macros/latex/contrib/hvfloat/doc/examples/README.exa
@@ -23,3 +23,6 @@ a.s.o.
runEXA.sh <base>
runs a group of examples, e.g. "./runEXA.sh inner" runs _all_ examples
started with "inner".
+
+** single files **
+lualatex capPos.ltx \ No newline at end of file
diff --git a/macros/latex/contrib/hvfloat/doc/examples/capPos.ltx b/macros/latex/contrib/hvfloat/doc/examples/capPos.ltx
new file mode 100644
index 0000000000..9fcd593abb
--- /dev/null
+++ b/macros/latex/contrib/hvfloat/doc/examples/capPos.ltx
@@ -0,0 +1,34 @@
+\documentclass[twoside,DIV=11]{scrartcl}
+%% $Id: capPos.ltx 72 2021-05-02 11:40:10Z herbert $
+
+\input{preamble.ltx}
+\usepackage{multicol}
+\usepackage[all=!htb]{hvfloat-fps}
+
+\setlength\columnseprule{0.4pt}
+\def\capShortText{A short caption}
+\def\capLongText{Here comes a caption to show the justification of the text relative to the object. It refers to
+the optional argument \texttt{capPos}.}
+
+\let\OrigBlindtext\blindtext
+\def\blindtext{\TeX\ is a typesetting language. Instead of visually formatting your text, you enter y
+our manuscript text intertwined with \TeX\ commands in a plain text file. You then run \TeX\ to
+produce formatted output, such as a PDF file. %Thus, in contrast to standard word processors,
+%your document is a separate file that does not pretend to be a representation of the final
+%typeset output, and so can be easily edited and manipulated.
+}
+
+
+
+\begin{document}
+\part{Examples for \texttt{capPos} and onecolumn mode}\clearpage
+\let\NewColumn\clearpage
+\input{capPos}
+
+\twocolumn[\part{Examples for \texttt{capPos} and twocolumn mode}]
+\def\blindtext{\OrigBlindtext}
+\let\NewColumn\columnbreak
+\input{capPos}
+
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/hvfloat/doc/examples/capPos.pdf b/macros/latex/contrib/hvfloat/doc/examples/capPos.pdf
new file mode 100644
index 0000000000..834f4949c7
--- /dev/null
+++ b/macros/latex/contrib/hvfloat/doc/examples/capPos.pdf
Binary files differ
diff --git a/macros/latex/contrib/hvfloat/doc/examples/capPos.tex b/macros/latex/contrib/hvfloat/doc/examples/capPos.tex
new file mode 100644
index 0000000000..db2e889f6e
--- /dev/null
+++ b/macros/latex/contrib/hvfloat/doc/examples/capPos.tex
@@ -0,0 +1,129 @@
+
+\section{\texttt{default}}
+\blindtext
+
+\begin{lstlisting}
+\hvFloat{figure}{\includegraphics{frose}}{\capShortText}{}
+\end{lstlisting}
+
+\hvFloat{figure}{\includegraphics{frose}}{\capShortText}{}
+
+\blindtext
+
+\begin{lstlisting}
+\hvFloat{figure}{\includegraphics{frose}}{\capLongText}{}
+\end{lstlisting}
+
+\hvFloat{figure}{\includegraphics{frose}}{\capLongText}{}
+
+\blindtext
+
+\NewColumn
+
+
+
+%----------------------top-----------------------------------
+\section{\texttt{capPos=top}}
+
+\begin{lstlisting}
+\hvFloat[capPos=top]{figure}{\includegraphics{frose}}{\capShortText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=top]{figure}{\includegraphics{frose}}{\capShortText}{}
+
+\blindtext
+
+\begin{lstlisting}
+\hvFloat[capPos=top]{figure}{\includegraphics{frose}}{\capLongText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=top]{figure}{\includegraphics{frose}}{\capLongText}{}
+
+\blindtext
+
+\NewColumn
+
+%----------------------before-----------------------------------
+\section{\texttt{capPos=before}, same as \texttt{capPos=left}}
+
+\begin{lstlisting}
+\hvFloat[capPos=before]{figure}{\includegraphics{frose}}{\capShortText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=before]{figure}{\includegraphics{frose}}{\capShortText}{}
+
+\blindtext
+
+\begin{lstlisting}
+\hvFloat[capPos=before]{figure}{\includegraphics{frose}}{\capLongText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=before]{figure}{\includegraphics{frose}}{\capLongText}{}
+
+\blindtext
+\NewColumn
+
+%----------------------after-----------------------------------
+\section{\texttt{capPos=after}, same as \texttt{capPos=right}}
+
+\begin{lstlisting}
+\hvFloat[capPos=after]{figure}{\includegraphics{frose}}{\capShortText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=after]{figure}{\includegraphics{frose}}{\capShortText}{}
+
+\blindtext
+
+\begin{lstlisting}
+\hvFloat[capPos=after]{figure}{\includegraphics{frose}}{\capLongText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=after]{figure}{\includegraphics{frose}}{\capLongText}{}
+
+\blindtext
+
+\NewColumn
+
+%----------------------inner-----------------------------------
+\section{\texttt{capPos=inner}}
+
+\begin{lstlisting}
+\hvFloat[capPos=inner]{figure}{\includegraphics{frose}}{\capShortText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=inner]{figure}{\includegraphics{frose}}{\capShortText}{}
+
+\blindtext
+
+\begin{lstlisting}
+\hvFloat[capPos=inner]{figure}{\includegraphics{frose}}{\capLongText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=inner]{figure}{\includegraphics{frose}}{\capLongText}{}
+
+\blindtext
+
+\NewColumn
+
+
+%----------------------outer-----------------------------------
+\section{\texttt{capPos=outer}}
+
+\begin{lstlisting}
+\hvFloat[capPos=outer]{figure}{\includegraphics{frose}}{\capShortText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=outer]{figure}{\includegraphics{frose}}{\capShortText}{}
+
+\blindtext
+
+\begin{lstlisting}
+\hvFloat[capPos=outer]{figure}{\includegraphics{frose}}{\capLongText}{}
+\end{lstlisting}
+
+\hvFloat[capPos=outer]{figure}{\includegraphics{frose}}{\capLongText}{}
+
+\blindtext
+
+\NewColumn
+
diff --git a/macros/latex/contrib/hvfloat/doc/hvfloat.pdf b/macros/latex/contrib/hvfloat/doc/hvfloat.pdf
index b174232b47..2c642cae21 100644
--- a/macros/latex/contrib/hvfloat/doc/hvfloat.pdf
+++ b/macros/latex/contrib/hvfloat/doc/hvfloat.pdf
Binary files differ
diff --git a/macros/latex/contrib/hvfloat/doc/hvfloat.tex b/macros/latex/contrib/hvfloat/doc/hvfloat.tex
index 18c0898a59..1082bb1334 100644
--- a/macros/latex/contrib/hvfloat/doc/hvfloat.tex
+++ b/macros/latex/contrib/hvfloat/doc/hvfloat.tex
@@ -1,4 +1,4 @@
-%% $Id: hvfloat.tex 73 2021-05-03 07:38:13Z herbert $
+%% $Id: hvfloat.tex 75 2021-05-04 19:52:22Z herbert $
\listfiles
\errorcontextlines=100
\documentclass[twoside,paper=a4,]{scrartcl}
@@ -56,6 +56,9 @@
\usepackage{hvindex}
\usepackage[all=!htb]{hvfloat-fps}
\usepackage[fbox,hyperref]{hvfloat}
+\hvFloatSet{floatRef=caption}
+
+
\captionsetup{format=plain,font=sf,labelfont={sf,bf}}
\captionsetup[sub]{format=plain,font=sf,labelfont={sf,bf}}
@@ -161,7 +164,7 @@
\begin{document}
\title{Package \texttt{hvfloat}\\Rotating and scaling of objects and captions\\ver \hvFloatFileVersion}
-\author{Herbert Voß\thanks{\protect\url{hvoss@tug.org}}}
+\author{Herbert Voß\thanks{\protect\url{hvoss@tug.org}\newline Thanks to Frank Mittelbach, Rolf Niepraschk}}
\date{\today}
\maketitle
@@ -306,7 +309,7 @@ There are the following keywords:
\bottomrule
\endlastfoot
\Lkeyword{floatPos} & \texttt{tbp} & This is the same default placement setting like the one from standard \LaTeX, but maybe not always
-the best setting.\\
+the best setting. \\
\Lkeyword{rotAngle} & 0& The value for the angle if both, the object and the caption should be rotated in the same way.\\
\Lkeyword{capWidth} & n& The width of the caption. Can be »\texttt{n}« like a natural width,
@@ -2487,12 +2490,11 @@ even page and following text will be placed \emph{before} the object.
\hvFloat[doubleFULLPAGE,capPos=right,capAngle=90]%
{figure}%
{\includegraphics[angle=90,width=2\paperwidth]{images/r+j}}%
- [Eine doppelseitige Abbildung mit Caption auf der Abbildung]%
- {Eine Beschriftung einer doppelseitigen Abbildung, die ÜBER den rechten
- Teil der Abbildung platziert wird. Die Abbildung beginnt am linken
- Papierrand. Auf den Seiten wird kein weiterer Text
- platziert. Für das LOF wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doubleFULLPAGE}}%
+ [A doublepage image with a caption on the image.]%
+ {A caption for a double-sided image that will be placed below the right-hand
+ part of the illustration. The illustration begins on the left edge of the paper.
+ No further text is placed on the pages. A short form is used for the LOF.
+ The parameter is \texttt{doubleFULLPAGE}}%
{fig:doubleFULLPAGE0}
\Blindtext
@@ -2503,12 +2505,11 @@ even page and following text will be placed \emph{before} the object.
\hvFloat[doubleFULLPAGE,capPos=right,capAngle=90]%
{figure}%
{\includegraphics[height=2\paperwidth,angle=90]{images/r+j}}%
- [Eine doppelseitige Abbildung mit Caption auf der Abbildung]%
- {Eine Beschriftung einer doppelseitigen Abbildung, die ÜBER den rechten
- Teil der Abbildung platziert wird. Die Abbildung beginnt am linken
- Papierrand. Auf den Seiten wird kein weiterer Text
- platziert. Für das LOF wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doubleFULLPAGE}}%
+ [A doublepage image with a caption on the image.]%
+ {A caption for a double-sided image that will be placed on the right-hand
+ part of the illustration. The illustration begins on the left edge of the paper.
+ No further text is placed on the pages. A short form is used for the LOF.
+ The parameter is \texttt{doubleFULLPAGE}}%
{fig:doubleFULLPAGE0}
\Blindtext
@@ -2522,11 +2523,10 @@ even page and following text will be placed \emph{before} the object.
\hvFloat[doubleFULLPAGE,capPos=right]%
{figure}%
{\includegraphics[height=\paperheight]{images/rheinsberg}}%
- {Eine Beschriftung einer doppelseitigen Abbildung, die ÜBER den rechten
- Teil der Abbildung platziert wird. Die Abbildung beginnt am linken
- Papierrand. Auf den Seiten wird kein weiterer Text
- platziert. Für das LOF wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doubleFULLPAGE}}%
+ {A caption for a double-sided image that will be placed on the right-hand
+ part of the illustration. The illustration begins on the left edge of the paper.
+ No further text is placed on the pages. A short form is used for the LOF.
+ The parameter is \texttt{doubleFULLPAGE}}%
{fig:doubleFULLPAGE1}
\Blindtext \Blindtext
@@ -2537,11 +2537,10 @@ even page and following text will be placed \emph{before} the object.
\hvFloat[doubleFULLPAGE,capPos=right]%
{figure}%
{\includegraphics[height=\paperheight]{images/rheinsberg}}%
- {Eine Beschriftung einer doppelseitigen Abbildung, die ÜBER den rechten
- Teil der Abbildung platziert wird. Die Abbildung beginnt am linken
- Papierrand. Auf den Seiten wird kein weiterer Text
- platziert. Für das LOF wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doubleFULLPAGE}}%
+ {A caption for a double-sided image that will be placed on the right-hand
+ part of the illustration. The illustration begins on the left edge of the paper.
+ No further text is placed on the pages. A short form is used for the LOF.
+ The parameter is \texttt{doubleFULLPAGE}}%
{fig:doubleFULLPAGE1}
\Blindtext \Blindtext
@@ -2558,12 +2557,11 @@ There will be pagenumbers and a caption can be rotated on the right of the objec
\hvFloat[doublePAGE]%
{figure}%
{\includegraphics[width=2\paperwidth]{images/seiser}}%
- [Eine doppelseitige Abbildung mit Caption unterhalb der rechten Abbildung]%
- {Eine Beschriftung einer doppelseitigen Abbildung, die unterhalb der rechten
- Teils der Abbildung platziert wird. Die Abbildung beginnt am linken
- Papierrand. Auf den Seiten wird kein weiterer Text
- platziert. Für das LOF wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doublePAGE}}%
+ [A doublepage image with a caption below the right part.]%
+ {A caption for a double-sided image that will be placed below the right-hand
+ part of the illustration. The illustration begins on the left edge of the paper.
+ No further text is placed on the pages. A short form is used for the LOF.
+ The parameter is \texttt{doublePAGE}}%
{fig:doublePAGE0}
\Blindtext
@@ -2575,12 +2573,11 @@ There will be pagenumbers and a caption can be rotated on the right of the objec
\hvFloat[doublePAGE]%
{figure}%
{\includegraphics[width=2\paperwidth]{images/seiser}}%
- [Eine doppelseitige Abbildung mit Caption unterhalb der rechten Abbildung]%
- {Eine Beschriftung einer doppelseitigen Abbildung, die unterhalb der rechten
- Teils der Abbildung platziert wird. Die Abbildung beginnt am linken
- Papierrand. Auf den Seiten wird kein weiterer Text
- platziert. Für das LOF wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doublePAGE}}%
+ [A doublepage image with a caption below the right part.]%
+ {A caption for a double-sided image that will be placed below the right-hand
+ part of the illustration. The illustration begins on the left edge of the paper.
+ No further text is placed on the pages. A short form is used for the LOF.
+ The parameter is \texttt{doublePAGE}}%
{fig:doublePAGE0}
\Blindtext
@@ -2597,12 +2594,11 @@ and the rest of the text area is filled with text.
\hvFloat[doublePage,capWidth=n,capPos=right]%
{figure}%
{\includegraphics[width=2\textwidth]{images/sonne-meer}}%
- [Eine doppelseitige Abbildung mit rechtsseitiger Caption unterhalb]%
- {Eine Beschriftung einer doppelseitigen Abbildung, die unterhalb des rechten
- Teils der Abbildung platziert wird. Die Abbildung beginnt am linken
- Textrand. Auf den Seiten wird ansonsten weiterer Text
- platziert. Für das LOF wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doublePage}}%
+ [A doublepage image with a caption on the right side of the right part.]%
+ {A caption for a double-sided image that will be placed on the right side of the
+ right-hand part of the illustration. The illustration begins on the left edge of
+ the paper. A short form is used for the LOF.
+ The parameter is \texttt{doublePage}}%
{fig:doublePage0}
\Blindtext
@@ -2614,12 +2610,11 @@ and the rest of the text area is filled with text.
\hvFloat[doublePage,capWidth=n,capPos=right]%
{figure}%
{\includegraphics[width=2\textwidth]{images/sonne-meer}}%
- [Eine doppelseitige Abbildung mit rechtsseitiger Caption unterhalb]%
- {Eine Beschriftung einer doppelseitigen Abbildung, die unterhalb des rechten
- Teils der Abbildung platziert wird. Die Abbildung beginnt am linken
- Textrand. Auf den Seiten wird ansonsten weiterer Text
- platziert. Für das LOF wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doublePage}}%
+ [A doublepage image with a caption on the right side of the right part.]%
+ {A caption for a double-sided image that will be placed on the right side of the
+ right-hand part of the illustration. The illustration begins on the left edge of
+ the paper. A short form is used for the LOF.
+ The parameter is \texttt{doublePage}}%
{fig:doublePage0}
\Blindtext
@@ -2667,12 +2662,11 @@ Artikel gesamt & 2 & 6 & 13 & 8 & 4 & 3 & 5 & 4 & 0 & 6 & 3 & 5 &23 &10 & 8 & 15
\hvFloat[doublePage,capWidth=n,capPos=right]%
{table}%
{\usebox\hvOBox}%%%%%%%%%%%%%%
- [Eine doppelseitige Tabelle mit rechtsseitiger Caption unterhalb]%
- {Eine Beschriftung einer doppelseitigen Tabelle, die unterhalb des rechten
- Teils der Abbildung platziert wird. Die Tabelle beginnt am linken
- Textrand. Auf den Seiten wird ansonsten weiterer Text
- platziert. Für das LOT wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doublePage}}%
+ [A doublepage tabular with a caption on the right side of the right part.]%
+ {A caption for a double-sided tabular that will be placed on the right side of the
+ right-hand part of the illustration. The illustration begins on the left edge of
+ the paper. A short form is used for the LOF.
+ The parameter is \texttt{doublePage}}%
{tab:doublePage3}
\Blindtext
@@ -2711,12 +2705,11 @@ Artikel gesamt & 2 & 6 & 13 & 8 & 4 & 3 & 5 & 4 & 0 & 6 & 3 & 5 &23 &10 & 8 & 15
\hvFloat[doublePage,capWidth=n,capPos=right]%
{table}%
{\usebox\hvOBox}%%%%%%%%%%%%%%
- [Eine doppelseitige Tabelle mit rechtsseitiger Caption unterhalb]%
- {Eine Beschriftung einer doppelseitigen Tabelle, die unterhalb des rechten
- Teils der Abbildung platziert wird. Die Tabelle beginnt am linken
- Textrand. Auf den Seiten wird ansonsten weiterer Text
- platziert. Für das LOT wird dabei eine Kurzform berücksichtigt. Parameter
- ist \texttt{doublePage}}%
+ [A doublepage tabular with a caption on the right side of the right part.]%
+ {A caption for a double-sided tabular that will be placed on the right side of the
+ right-hand part of the illustration. The illustration begins on the left edge of
+ the paper. A short form is used for the LOF.
+ The parameter is \texttt{doublePage}}%
{tab:doublePage3}
\Blindtext
@@ -2832,7 +2825,7 @@ optional package options to set the global placement:
\Blindtext
-\hvFloatSetDefaults
+%\hvFloatSetDefaults
\hvFloat[FULLPAGE]{figure}%
{\includegraphics[FULLPAGE]{tiger}}%
[A float which needs the complete paper width and height.]%
diff --git a/macros/latex/contrib/hvfloat/doc/images/missing.txt b/macros/latex/contrib/hvfloat/doc/images/missing.txt
index 5a0917558c..4d557d45b4 100644
--- a/macros/latex/contrib/hvfloat/doc/images/missing.txt
+++ b/macros/latex/contrib/hvfloat/doc/images/missing.txt
@@ -1,3 +1,4 @@
-Not all imaging of the documentation are listed here, because
+Not all images of the documentation are listed here, because
some are not for public use. You can use any other imgae if you
want to run the documentation by yourselve.
+
diff --git a/macros/latex/contrib/hvfloat/latex/hvfloat.sty b/macros/latex/contrib/hvfloat/latex/hvfloat.sty
index dd27d7af47..61222e4aca 100644
--- a/macros/latex/contrib/hvfloat/latex/hvfloat.sty
+++ b/macros/latex/contrib/hvfloat/latex/hvfloat.sty
@@ -1,4 +1,4 @@
-%% $Id: hvfloat.sty 73 2021-05-03 07:38:13Z herbert $
+%% $Id: hvfloat.sty 75 2021-05-04 19:52:22Z herbert $
%%
%%
%% IMPORTANT NOTICE:
@@ -15,8 +15,8 @@
%% `hvfloat' offers rotating of captions and objects for floats
%%
\NeedsTeXFormat{LaTeX2e}
-\def\fileversion{2.21}
-\def\filedate{2021/05/04}
+\def\fileversion{2.22}
+\def\filedate{2021/05/06}
\message{`hvfloat' v\fileversion, \filedate\space (Herbert Voss)}
\ProvidesPackage{hvfloat}[\filedate\ rotating of floating objects]
\let\hvFloatFileVersion\fileversion
@@ -128,7 +128,7 @@
}
\newif\ifhv@floatRefToObject
-\define@choicekey*+{hvSet}{floatRef}[\val\nr]{caption,object}[object]{% where the LOF entry should point to
+\define@choicekey*+{hvSet}{floatRef}[\val\nr]{caption,object}[object]{% where the LOF entry should point to (inactive)
\ifcase\nr\relax
\hv@floatRefToObjectfalse
\else
@@ -151,7 +151,9 @@
\define@boolkey{hvSet}[hv@]{nonFloat}[true]{}% Do not use float environment
\define@boolkey{hvSet}[hv@]{onlyText}[true]{}% Write the caption only as text
\define@boolkey{hvSet}[hv@]{wide}[true]{}% Write the caption only as text
+\define@boolkey{hvSet}[hv@]{debug}[true]{}% give more infos in the terminal
+\newcommand\hv@typeout[1]{\ifhv@debug\typeout{#1}\fi}
\newif\ifhv@fullpage
\newif\ifhv@FULLPAGE
@@ -190,7 +192,7 @@
%
\newcommand{\setDefaults}{%
\hv@set{%
- floatPos=htbp, rotAngle=0, capWidth=n, capAngle=0,
+ floatPos=, rotAngle=0, capWidth=n, capAngle=0,
capPos=bottom, capVPos=center, objectPos=center, objectAngle=0,
floatCapSep=5pt, useOBox=false, nonFloat=false,
onlyText=false, wide=false, fullpage=false, FULLPAGE=false,
@@ -232,10 +234,11 @@
\setlength\belowcaptionskip{\hvBelowCaptionSkip}%
}
%
-\newcommand\figcaption[2][]{\def\@captype{figure}%
+\newcommand\figcaption[2][]{%
+ \def\@captype{figure}%
\begingroup
\ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi
- \ifx\relax#1\relax \caption{#2}\else\caption[#1]{#2}\fi
+ \if$#1$ \caption{#2}\else\caption[#1]{#2}\fi
\endgroup}
\newcommand\tabcaption[2][]{\def\@captype{table}%
\begingroup
@@ -404,29 +407,17 @@
\newcount\hv@cnta
\newcount\hv@cntb
-\def\hvFloat@ii[#1]#2{% #1: key/value, #2: floattype
- \@ifnextchar[{\hvFloat@iii[#1]{#2}}{\hvFloat@iii[#1]{#2}[]}%
-}
-
-\def\hvFloat@iii[#1]#2[#3]#4{% #1: key/value, #2: floattype, #3: ListOfExt, #4: object
+\def\hvFloat@ii[#1]#2#3{% #1: key/value, #2: floattype, #3: object
\hv@maxImageWidth=\textwidth
\ifx\relax#1\relax\else\setkeys{hvSet}{#1}\fi
\gdef\hv@floatType{#2}%
- \ifx\relax#3\relax
- \ifx\hv@floatType\hv@figure
- \gdef\hv@floatListOfExt{lof}%
- \else
- \gdef\hv@floatListOfExt{lot}%
- \fi
- \else
- \gdef\hv@floatListOfExt{#3}%
- \fi
+ \xdef\hv@floatListOfExt{\@nameuse{ext@\hv@floatType}}%
\ifx\relax#2\relax \setkeys{hvSet}{nonFloat=true}\fi
- \gdef\hv@floatObject{#4}%
+ \gdef\hv@floatObject{#3}%
\@ifnextchar[{\do@@hvFloat}{\do@@hvFloat[]}%
}
-\def\do@@hvFloat[#1]#2#3{%
+\def\do@@hvFloat[#1]#2#3{% #1: listof caption, #2. long caption #3: label
\gdef\hv@shortCap{#1}%
\gdef\hv@longCap{#2}%
\gdef\hv@label{#3}%
@@ -458,7 +449,7 @@
% \global\hv@capbesidefalse
}
%
-\def\do@@@hvFloat{% no special float page
+\def\do@@@hvFloat{% no special float page, caption and image on top of each other or side by side
\def\@tempa{90}%
\ifx\hvSet@rotAngle\@tempa
\setlength\hvMaxCapWidth{\textheight}%
@@ -551,21 +542,12 @@
\hv@longCap
\else
\let\@captype\hv@floatType
- \ifhv@floatRefToObject
- \expandafter\ifx\expandafter\relax\hv@shortCap\relax
- \caption[]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \addcontentsline{\hv@floatListOfExt}{\hv@floatType}{\protect\numberline{\csname the\hv@floatType\endcsname}{\ignorespaces\hv@longCap}}%
- \else
- \caption[]{\hv@shortCap\expandafter\label\expandafter{\hv@label}}%
- \addcontentsline{\hv@floatListOfExt}{\hv@floatType}{\protect\numberline{\csname the\hv@floatType\endcsname}{\ignorespaces\hv@shortCap}}%
- \fi
- \else
\expandafter\ifx\expandafter\relax\hv@shortCap\relax
\caption{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
\else
\caption[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
\fi
- \fi
+% \fi
\fi
\fi
% \expandafter\label\expandafter{\hv@label}% 2.17 put label into the caption argument
@@ -591,20 +573,9 @@
\hv@longCap
\else
\let\@captype\hv@floatType
- \ifhv@floatRefToObject
- \expandafter\ifx\expandafter\relax\hv@shortCap\relax
- \caption[]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \addcontentsline{\hv@floatListOfExt}{\hv@floatType}{\protect\numberline{\csname the\hv@floatType\endcsname}{\ignorespaces\hv@longCap}}%
- \else
- \caption[]{\hv@shortCap\expandafter\label\expandafter{\hv@label}}%
- \addcontentsline{\hv@floatListOfExt}{\hv@floatType}{\protect\numberline{\csname the\hv@floatType\endcsname}{\ignorespaces\hv@shortCap}}%
- \fi
- \else
\expandafter\ifx\expandafter\relax\hv@shortCap\relax
\caption{\hv@longCap}\else\caption[\hv@shortCap]{\hv@longCap}%
- \fi
\fi
-% \expandafter\ifx\expandafter\relax\hv@shortCap\relax \caption{\hv@longCap}\else\caption[\hv@shortCap]{\hv@longCap}\fi
\fi
\fi
\label{\hv@label}%
@@ -617,7 +588,11 @@
% rotated angles saved in different boxes
%%
\restoreCaptionSkip% save old values
- \def\fps@figure{\hvSet@floatPos}%
+% \def\fps@figure{\hvSet@floatPos}%
+ \ifx\hvSet@floatPos\@empty % use type default
+ \else
+ \@namedef{fps@\hv@floatType}{\hvSet@floatPos}%
+ \fi
\ifhv@nonFloat
\begingroup% Start the nonfloat part
\else
@@ -953,13 +928,27 @@
\medskip
\ifdim\dp\hvObjectBox > \z@
\rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
\else
\rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
\fi
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
\fi
}%
}%
@@ -982,13 +971,27 @@
\medskip
\ifdim\dp\hvObjectBox > \z@
\rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
\else
\rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
\fi
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
\fi
}}}%
\fi
@@ -997,6 +1000,7 @@
\def\do@hvFloat@doublePAGE#1{% image on left and right page with caption on the right ----------------------------------
% #1-> 0/1 caption under/right
+ \hv@typeout{>>>>do@hvFloat@doublePAGE}%
\checkoddpage
\ifoddpage
\afterpage{%
@@ -1012,13 +1016,27 @@
\medskip
\ifdim\dp\hvObjectBox > \z@
\rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
\else
\rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
\fi
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
\fi
\newpage
}%
@@ -1037,13 +1055,27 @@
\medskip
\ifdim\dp\hvObjectBox > \z@
\rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
\else
\rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
\fi
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
\fi
\newpage
}}%
@@ -1053,66 +1085,114 @@
%
\def\do@hvFloat@doubleFULLPAGE#1{% image on left and right page with caption on the right ----------------------------------
% #1-> 0/1 caption under/right
+ \hv@typeout{>>>>do@hvFloat@doubleFULLPAGE}%
\checkoddpage
\global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
\ifoddpage
+ \hv@typeout{>>>>>doubleFULLPAGE->oddpage}%
\afterpage{%
\global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip}% +0.5\paperheight-0.5\ht\hvObjectBox
+ \begingroup
+ \nointerlineskip
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% no interlineskip
\hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}%
+ \endgroup
\AtBeginShipoutNext{\thispagestyle{empty}}%
\clipbox*{0 0 \paperwidth{} \height}{\usebox\hvObjectBox}%
\newpage
\AtBeginShipoutNext{\thispagestyle{empty}}%
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\normalbaselineskip}% -0.5\paperheight+0.5\ht\hvObjectBox
+ \begingroup
+ \nointerlineskip
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% -0.5\paperheight+0.5\ht\hvObjectBox
\hspace*{\the\dimexpr-\oddsidemargin-\parindent-1in}%
+ \endgroup
\clipbox*{\paperwidth{} 0 \wd\hvObjectBox{} \paperheight{}}{\usebox\hvObjectBox}%
\savebox\hvCaptionBox{\parbox{0.9\ht\hvObjectBox}{%
- \captionof*{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \captionof*{\hv@floatType}{\hv@longCap}}}%
+% \captionof*{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
\ifnum#1>0
\ifdim\dimexpr\ht\hvCaptionBox+\wd\hvObjectBox\relax < 2\paperwidth
- \rotatebox{90}{\qquad\parbox{0.9\ht\hvObjectBox}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \hv@typeout{>>>>>doubleFULLPAGE->oddpage->floatRefToObject=false}%
+ \rotatebox{90}{\qquad\parbox{0.9\ht\hvObjectBox}{%
+ \if$\hv@shortCap$
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }}%
+% \fi
\else
\put(-\ht\hvCaptionBox,0.5\ht\hvObjectBox){\makebox(0,0){\rotatebox{90}{\minipage{\textwidth}\centering
- \parbox{0.8\textwidth}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}\endminipage
- }}}%
+ \parbox{0.8\textwidth}{%
+ \hv@typeout{>>>>>doubleFULLPAGE->oddpage->#1<0->floatRefToObject=false}%
+ \ifx\relax\hv@shortCap\relax
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }%
+ \endminipage}}}%
\fi
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \ifx\relax\hv@shortCap\relax
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
\fi
\newpage
}%
\else
+ \hv@typeout{>>>>>doubleFULLPAGE->evenpage}%
\afterpage{%
\AddToHookNext{shipout/before}{%
\newpage
\AddToHook{begin/page}{\thispagestyle{empty}}
\global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip}% +0.5\paperheight-0.5\ht\hvObjectBox
+ \begingroup
+ \nointerlineskip
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% no interlineskip
\hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}%
+ \endgroup
\AtBeginShipoutNext{\thispagestyle{empty}}%
\clipbox*{0 0 \paperwidth{} \paperheight}{\usebox\hvObjectBox}%
\newpage
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\normalbaselineskip}% -0.5\paperheight+0.5\ht\hvObjectBox
+ \begingroup
+ \nointerlineskip
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% no interlineskip
\hspace*{\the\dimexpr-\oddsidemargin-\parindent-1in}%
+ \endgroup
\clipbox*{\paperwidth{} 0 \wd\hvObjectBox{} \paperheight{}}{\usebox\hvObjectBox}%
\AtBeginShipoutNext{\thispagestyle{empty}}%
- \savebox\hvCaptionBox{\parbox{0.9\ht\hvObjectBox}{%
- \captionof*{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
+ \savebox\hvCaptionBox{\parbox{0.9\ht\hvObjectBox}{\captionof*{\hv@floatType}[\hv@shortCap]{\hv@longCap}}}%
+% \captionof*{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
\ifnum#1>0
\ifdim\dimexpr\ht\hvCaptionBox+\wd\hvObjectBox\relax < 2\paperwidth
- \rotatebox{90}{\minipage{\the\ht\hvObjectBox}\centering\parbox{0.75\textwidth}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}%
- \endminipage}%
+ \rotatebox{90}{\minipage{\the\ht\hvObjectBox}\centering\parbox{0.75\textwidth}{%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }%
+ \endminipage}%
\else% no space on the right, put it over the imag
\put(-\ht\hvCaptionBox,0.5\ht\hvObjectBox){\makebox(0,0){\rotatebox{90}{\minipage{\the\dimexpr\ht\hvObjectBox}%
- \centering\parbox{0.8\textwidth}{%
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}\endminipage}}}%
+ \centering\parbox{0.8\textwidth}{%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
+ }%
+ \endminipage}}}%
\fi
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \fi
\fi
\newpage
}%
@@ -1136,7 +1216,7 @@
\begin{\hv@floatType}[p]%
\fi
\ifhv@FULLPAGE
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep}%-0.5\baselineskip}%
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep}%-0.5\baselineskip%
\checkoddpage
\if@twoside
\ifoddpage
@@ -1278,9 +1358,9 @@
\setlength\abovecaptionskip{0pt}%
\edef\@captype{\hv@floatType}%
\expandafter\ifx\expandafter\relax\hv@shortCap\relax
- \caption{\hv@longCap}%
+ \caption{\hv@longCap}%
\else
- \caption[\hv@shortCap]{\hv@longCap}%
+ \caption[\hv@shortCap]{\hv@longCap}%
\fi
\expandafter\ifx\expandafter\relax\hv@label\relax\else\label{\hv@label-cap}\fi
\endminipage}%
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index f5af6a6a75..972985be67 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex
index 9d33132192..b9f2c80453 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -4207,6 +4207,10 @@ L'extension \pkg{nicematrix} n'est pas compatible avec la classe \cls{aastex63}.
Si vous souhaitez utiliser \pkg{nicematrix} with \cls{aastex63}, envoyez-moi un
courrier électronique et j'essaierai de résoudre les incompatibilités.
+\bigskip
+L'extension \pkg{nicematrix} n'est pas compatible avec la classe \cls{ieeeaccess}
+(car cette classe n'est pas compatible avec PGF/Tikz).
+
\section{Exemples}
\subsection{Notes dans les tableaux}
@@ -4937,11 +4941,22 @@ source de ce document.
%
%
%
+\tikzset{highlight/.style={rectangle,
+ fill=red!15,
+ rounded corners = 0.5 mm,
+ inner sep=1pt,
+ fit=#1}}%
+%
+%
\[\begin{NiceArray}{*{6}{c}@{\hspace{6mm}}*{5}{c}}[nullify-dots]
-\CodeBefore
+\CodeBefore [create-cell-nodes]
\SubMatrix({2-7}{6-11})
\SubMatrix({7-2}{11-6})
\SubMatrix({7-7}{11-11})
+ \begin{tikzpicture}
+ \node [highlight = (9-2) (9-6)] { } ;
+ \node [highlight = (2-9) (6-9)] { } ;
+ \end{tikzpicture}
\Body
& & & & & & & & \color{blue}\scriptstyle C_j \\
& & & & & & b_{11} & \Cdots & b_{1j} & \Cdots & b_{1n} \\
@@ -4956,15 +4971,12 @@ source de ce document.
& \Vdots & & & & \Vdots \\
& a_{n1} & \Cdots & & & a_{nn} \\
\CodeAfter
-\begin{tikzpicture}
-\node [highlight = (9-2) (9-6)] { } ;
-\node [highlight = (2-9) (6-9)] { } ;
-\draw [gray,shorten > = 1mm, shorten < = 1mm] (9-4.north) to [bend left] (4-9.west) ;
-\end{tikzpicture}
+\tikz \draw [gray,shorten > = 1mm, shorten < = 1mm] (9-4.north) to [bend left] (4-9.west) ;
\end{NiceArray}\]
+
\section*{Autre documentation}
Le document |nicematrix.pdf| (fourni avec l'extension \pkg{nicematrix}) contient
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 1b475cebad..0718d3cae5 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{5.15}
-\def\myfiledate{2021/04/25}
+\def\myfileversion{5.15a}
+\def\myfiledate{2021/05/06}
%
%
%<*batchfile>
@@ -26,6 +26,8 @@
\usedir{tex/latex/nicematrix}
\preamble
+
+
Copyright (C) 2018-2021 by F. Pantigny
-----------------------------------
@@ -4136,6 +4138,11 @@ version 2005/12/01 or later.
% \cls{aastex63}. If you want to use \pkg{nicematrix} with \cls{aastex63}, send
% me an email and I will try to solve the incompatibilies.
%
+%
+% \bigskip
+% the package \pkg{nicematrix} is not compatible with the class \cls{ieeeaccess}
+% (because that class is not compatible with PGF/Tikz).
+%
% \section{Examples}
%
% \subsection{Notes in the tabulars}
@@ -4855,12 +4862,20 @@ version 2005/12/01 or later.
%
% You will find the LaTeX code of that figure in the source file of this
% document.
-%
+% \tikzset{highlight/.style={rectangle,
+% fill=red!15,
+% rounded corners = 0.5 mm,
+% inner sep=1pt,
+% fit=#1}}%
% \[\begin{NiceArray}{*{6}{c}@{\hspace{6mm}}*{5}{c}}[nullify-dots]
-% \CodeBefore
+% \CodeBefore [create-cell-nodes]
% \SubMatrix({2-7}{6-11})
% \SubMatrix({7-2}{11-6})
% \SubMatrix({7-7}{11-11})
+% \begin{tikzpicture}
+% \node [highlight = (9-2) (9-6)] { } ;
+% \node [highlight = (2-9) (6-9)] { } ;
+% \end{tikzpicture}
% \Body
% & & & & & & & & \color{blue}\scriptstyle C_j \\
% & & & & & & b_{11} & \Cdots & b_{1j} & \Cdots & b_{1n} \\
@@ -4875,12 +4890,9 @@ version 2005/12/01 or later.
% & \Vdots & & & & \Vdots \\
% & a_{n1} & \Cdots & & & a_{nn} \\
% \CodeAfter
-% \begin{tikzpicture}
-% \node [highlight = (9-2) (9-6)] { } ;
-% \node [highlight = (2-9) (6-9)] { } ;
-% \draw [gray,shorten > = 1mm, shorten < = 1mm] (9-4.north) to [bend left] (4-9.west) ;
-% \end{tikzpicture}
+% \tikz \draw [gray,shorten > = 1mm, shorten < = 1mm] (9-4.north) to [bend left] (4-9.west) ;
% \end{NiceArray}\]
+%
%
%\section{Implementation}
%
@@ -5477,6 +5489,14 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
+% The following counters will be used to count the numbers of rows and columns
+% of the array.
+% \begin{macrocode}
+\int_new:N \g_@@_row_total_int
+\int_new:N \g_@@_col_total_int
+% \end{macrocode}
+%
+% \bigskip
% The following token list will contain the type of the current cell (|l|, |c|
% or |r|). It will be used by the blocks.
% \begin{macrocode}
@@ -5519,9 +5539,9 @@ version 2005/12/01 or later.
%
% \bigskip
% If the user uses |{NiceArray}| or |{NiceTabular}| the flag
-% |\g_@@_NiceArray_bool| will be raised.
+% |\l_@@_NiceArray_bool| will be raised.
% \begin{macrocode}
-\bool_new:N \g_@@_NiceArray_bool
+\bool_new:N \l_@@_NiceArray_bool
% \end{macrocode}
% In fact, if there is delimiters in the preamble of |{NiceArray}| (eg:
% |[cccc]|), this boolean will be set to false.
@@ -6121,7 +6141,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\NewDocumentCommand \tabularnote { m }
{
- \bool_if:nTF { ! \g_@@_NiceArray_bool && \l_@@_in_env_bool }
+ \bool_if:nTF { ! \l_@@_NiceArray_bool && \l_@@_in_env_bool }
{ \@@_error:n { tabularnote~forbidden } }
{
% \end{macrocode}
@@ -6190,7 +6210,6 @@ version 2005/12/01 or later.
%
%
% \subsection*{Command for creation of rectangle nodes}
-%
%
% The following command should be used in a |{pgfpicture}|. It creates a
% rectangle (empty but with a name).
@@ -6257,7 +6276,7 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-%
+%
% \bigskip
% \subsection*{The options}
%
@@ -6398,7 +6417,13 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_new:N \l_@@_auto_columns_width_bool
% \end{macrocode}
-%
+%
+% \bigskip
+% The following boolean corresponds to the key |create-cell-nodes| of the
+% keyword |\CodeBefore|.
+% \begin{macrocode}
+\bool_new:N \g_@@_recreate_cell_nodes_bool
+% \end{macrocode}
%
% \bigskip
% The string |\l_@@_name_str| will contain the optional name of the
@@ -6531,6 +6556,9 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / Global }
{
+ delimiters .code:n =
+ \keys_set:nn { NiceMatrix / delimiters } { #1 } ,
+ delimiters .value_required:n = true ,
rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
rules .value_required:n = true ,
standard-cline .bool_set:N = \l_@@_standard_cline_bool ,
@@ -6613,7 +6641,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / Env }
{
- delimiters/max-width .bool_set:N = \l_@@_delimiters_max_width_bool ,
+
% \end{macrocode}
% The key |hvlines-except-corners| is now deprecated.
% \begin{macrocode}
@@ -6727,7 +6755,17 @@ version 2005/12/01 or later.
unknown .code:n = \@@_error:n { Unknown~key~for~notes }
}
% \end{macrocode}
-%
+%
+% \begin{macrocode}
+\keys_define:nn { NiceMatrix / delimiters }
+ {
+ max-width .bool_set:N = \l_@@_delimiters_max_width_bool ,
+ max-width .default:n = true ,
+ color .tl_set:N = \l_@@_delimiters_color_tl ,
+ color .value_required:n = true ,
+ }
+% \end{macrocode}
+%
% \bigskip
% We begin the construction of the major sets of keys (used by the different
% user commands and environments).
@@ -6739,6 +6777,7 @@ version 2005/12/01 or later.
NiceMatrixOptions / xdots .inherit:n = NiceMatrix / xdots ,
NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules ,
NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes ,
+ NiceMatrixOptions / delimiters .inherit:n = NiceMatrix / delimiters ,
NiceMatrixOptions / sub-matrix .inherit:n = NiceMatrix / sub-matrix ,
SubMatrix / rules .inherit:n = NiceMatrix / rules ,
CodeAfter / xdots .inherit:n = NiceMatrix / xdots ,
@@ -6749,6 +6788,7 @@ version 2005/12/01 or later.
} ,
NiceMatrix / xdots .inherit:n = NiceMatrix / xdots ,
NiceMatrix / rules .inherit:n = NiceMatrix / rules ,
+ NiceMatrix / delimiters .inherit:n = NiceMatrix / delimiters ,
NiceTabular .inherit:n =
{
NiceMatrix / Global ,
@@ -6756,6 +6796,7 @@ version 2005/12/01 or later.
} ,
NiceTabular / xdots .inherit:n = NiceMatrix / xdots ,
NiceTabular / rules .inherit:n = NiceMatrix / rules ,
+ NiceTabular / delimiters .inherit:n = NiceMatrix / delimiters ,
NiceArray .inherit:n =
{
NiceMatrix / Global ,
@@ -6763,6 +6804,7 @@ version 2005/12/01 or later.
} ,
NiceArray / xdots .inherit:n = NiceMatrix / xdots ,
NiceArray / rules .inherit:n = NiceMatrix / rules ,
+ NiceArray / delimiters .inherit:n = NiceMatrix / delimiters ,
pNiceArray .inherit:n =
{
NiceMatrix / Global ,
@@ -6770,6 +6812,7 @@ version 2005/12/01 or later.
} ,
pNiceArray / xdots .inherit:n = NiceMatrix / xdots ,
pNiceArray / rules .inherit:n = NiceMatrix / rules ,
+ pNiceArray / delimiters .inherit:n = NiceMatrix / delimiters ,
}
% \end{macrocode}
%
@@ -6781,13 +6824,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / NiceMatrixOptions }
{
- delimiters / max-width .bool_set:N = \l_@@_delimiters_max_width_bool ,
- delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
- delimiters / color .value_required:n = true ,
- delimiters-color .code:n =
- \tl_set:Nn \l_@@_delimiters_color_tl { #1 }
- \@@_error:n { delimiters-color deleted } ,
- delimiters-color .value_required:n = true ,
last-col .code:n = \tl_if_empty:nF { #1 }
{ \@@_error:n { last-col~non~empty~for~NiceMatrixOptions } }
\int_zero:N \l_@@_last_col_int ,
@@ -6900,12 +6936,6 @@ version 2005/12/01 or later.
r .code:n = \tl_set:Nn \l_@@_type_of_col_tl r ,
small .bool_set:N = \l_@@_small_bool ,
small .value_forbidden:n = true ,
- delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
- delimiters / color .value_required:n = true ,
- delimiters-color .code:n =
- \tl_set:Nn \l_@@_delimiters_color_tl { #1 }
- \@@_error:n { delimiters-color deleted } ,
- delimiters-color .value_required:n = true ,
unknown .code:n = \@@_error:n { Unknown~option~for~NiceMatrix }
}
% \end{macrocode}
@@ -6936,11 +6966,6 @@ version 2005/12/01 or later.
notes / bottomrule .default:n = true ,
tabularnote .tl_set:N = \l_@@_tabularnote_tl ,
tabularnote .value_required:n = true ,
- delimiters-color .code:n =
- \tl_set:Nn \l_@@_delimiters_color_tl { #1 }
- \@@_error:n { delimiters-color deleted } ,
- delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
- delimiters / color .value_required:n = true ,
r .code:n = \@@_error:n { r~or~l~with~preamble } ,
l .code:n = \@@_error:n { r~or~l~with~preamble } ,
unknown .code:n = \@@_error:n { Unknown~option~for~NiceArray }
@@ -7206,7 +7231,7 @@ version 2005/12/01 or later.
\bool_lazy_or:nnTF
\g_@@_not_empty_cell_bool
{ \dim_compare_p:nNn { \box_wd:N \l_@@_cell_box } > \c_zero_dim }
- \@@_node_for_the_cell:
+ \@@_node_for_cell:
{ \box_use_drop:N \l_@@_cell_box }
}
\int_gset:Nn \g_@@_col_total_int { \int_max:nn \g_@@_col_total_int \c@jCol }
@@ -7214,12 +7239,12 @@ version 2005/12/01 or later.
\bool_gset_false:N \g_@@_not_empty_cell_bool
}
% \end{macrocode}
-%
+%
% \medskip
% The following command creates the \textsc{pgf} name of the node with, of
% course, |\l_@@_cell_box| as the content.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_node_for_the_cell:
+\cs_new_protected:Npn \@@_node_for_cell:
{
\pgfpicture
\pgfsetbaseline \c_zero_dim
@@ -7244,6 +7269,53 @@ version 2005/12/01 or later.
\endpgfpicture
}
% \end{macrocode}
+%
+% \medskip
+% As its name says, the following command is a patch for the command
+% |\@@_node_for_cell:|. This patch will be appended on the left of
+% |\@@_noce_for_the_cell:| when the construction of the cell nodes (of the forme
+% |(i-j)|) in the |\CodeBefore| is required.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_node_for_cell:n #1
+ {
+ \cs_new_protected:Npn \@@_patch_node_for_cell:
+ {
+ \hbox_set:Nn \l_@@_cell_box
+ {
+ \box_move_up:nn { \box_ht:N \l_@@_cell_box}
+ \hbox_overlap_left:n
+ {
+ \pgfsys@markposition
+ { \@@_env: - \int_use:N \c@iRow - \int_use:N \c@jCol - NW }
+% \end{macrocode}
+% I don't know why the following adjustement is needed when the compilation is
+% done with XeLaTeX or with the classical way |latex|, |divps|, |ps2pdf| (or
+% Adobe Distiller). However, it seems to work.
+% \begin{macrocode}
+ #1
+ }
+ \box_use:N \l_@@_cell_box
+ \box_move_down:nn { \box_dp:N \l_@@_cell_box }
+ \hbox_overlap_left:n
+ {
+ \pgfsys@markposition
+ { \@@_env: - \int_use:N \c@iRow - \int_use:N \c@jCol - SE }
+ #1
+ }
+ }
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\bool_lazy_or:nnTF \sys_if_engine_xetex_p: \sys_if_output_dvi_p:
+ {
+ \@@_patch_node_for_cell:n
+ { \skip_horizontal:n { 0.5 \box_wd:N \l_@@_cell_box } }
+ }
+ { \@@_patch_node_for_cell:n { } }
+% \end{macrocode}
+%
%
% \interitem
% The second argument of the following command |\@@_instruction_of_type:nnn|
@@ -7450,7 +7522,7 @@ version 2005/12/01 or later.
\peek_meaning:NTF [
{ \newcol@ #1 }
{ \newcol@ #1 [ 0 ] }
- }
+ }
% \end{macrocode}
%
%
@@ -7679,138 +7751,13 @@ version 2005/12/01 or later.
% \end{macrocode}
% This is the end of |\@@_pre_array_ii:|.
%
+%
% \bigskip
-% If the key |code-before| is used, we have to create the |col| nodes and the
-% |row| nodes before the creation of the array. First, we have to test whether
-% the size of the array has been written in the |aux| file in a previous run. In
-% this case, a command |\@@_size_|{\slshape\ttfamily nb_of_env}|:| has been
-% created.
% \begin{macrocode}
\cs_new_protected:Npn \@@_pre_array:
{
\seq_gclear:N \g_@@_submatrix_seq
- \bool_if:NT \l_@@_code_before_bool
- {
-% \end{macrocode}
-% The list of the cells which are in the (empty) corners is stored in the |aux|
-% file because we have to know it before the execution of the |\CodeBefore| (the
-% commands which color the cells, row and columns won't color the cells which
-% are in the corners).
-% \begin{macrocode}
- \seq_if_exist:cT
- { c_@@_corners_cells_ \int_use:N \g_@@_env_int _ seq }
- {
- \seq_set_eq:Nc \l_@@_corners_cells_seq
- { c_@@_corners_cells_ \int_use:N \g_@@_env_int _ seq }
- }
-% \end{macrocode}
-% Now, we have to reconstruct the |row| nodes and the |col| nodes.
-% \begin{macrocode}
- \seq_if_exist:cT { @@_size_ \int_use:N \g_@@_env_int _ seq }
- {
-% \end{macrocode}
-% First, we give values to the LaTeX counters |iRow| and |jCol|. We remind that,
-% in the |code-before| (and in the |\CodeAfter|) they represent the numbers of
-% rows and columns of the array (without the potential last row and last column).
-% \begin{macrocode}
- \int_zero_new:N \c@iRow
- \int_set:Nn \c@iRow
- { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 2 }
- \int_zero_new:N \c@jCol
- \int_set:Nn \c@jCol
- { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 4 }
-% \end{macrocode}
-% We have to adjust the values of |\c@iRow| and |\c@jCol| to take into account
-% the potential last row and last column. A value of $-2$ for
-% |\l_@@_last_row_int| means that there is no last row. Idem for the columns.
-% \begin{macrocode}
- \int_compare:nNnF \l_@@_last_row_int = { -2 }
- { \int_decr:N \c@iRow }
- \int_compare:nNnF \l_@@_last_col_int = { -2 }
- { \int_decr:N \c@jCol }
-% \end{macrocode}
-%
-% Now, we will create all the |col| nodes and |row| nodes with the informations
-% written in the |aux| file. You use the technique described in the page~1229 of
-% |pgfmanual.pdf|, version~3.1.4b.
-% \begin{macrocode}
- \pgfsys@markposition { \@@_env: - position }
- \pgfsys@getposition { \@@_env: - position } \@@_picture_position:
- \pgfpicture
-% \end{macrocode}
-% First, the creation of the |row| nodes.
-% \begin{macrocode}
- \int_step_inline:nnn
- { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 1 }
- { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 2 + 1 }
- {
- \pgfsys@getposition { \@@_env: - row - ##1 } \@@_node_position:
- \pgfcoordinate { \@@_env: - row - ##1 }
- { \pgfpointdiff \@@_picture_position: \@@_node_position: }
- }
-% \end{macrocode}
-% Now, the creation of the |col| nodes.
-% \begin{macrocode}
- \int_step_inline:nnn
- { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 3 }
- { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 4 + 1 }
- {
- \pgfsys@getposition { \@@_env: - col - ##1 } \@@_node_position:
- \pgfcoordinate { \@@_env: - col - ##1 }
- { \pgfpointdiff \@@_picture_position: \@@_node_position: }
- }
- \endpgfpicture
-% \end{macrocode}
-% Now, you create the diagonal nodes by using the |row| nodes and the |col|
-% nodes. If the engine is |xetex| or |luatex| we also create the ``½ nodes''.
-% \begin{macrocode}
- \@@_create_diag_nodes:
-% \end{macrocode}
-%
-% \medskip
-% Now, yet other settings before the execution of the |code-before|.
-% \begin{macrocode}
- \group_begin:
- \bool_if:NT \c_@@_tikz_loaded_bool
- {
- \tikzset
- {
- every~picture / .style =
- { overlay , name~prefix = \@@_env: - }
- }
- }
- \cs_set_eq:NN \cellcolor \@@_cellcolor
- \cs_set_eq:NN \rectanglecolor \@@_rectanglecolor
- \cs_set_eq:NN \roundedrectanglecolor \@@_roundedrectanglecolor
- \cs_set_eq:NN \rowcolor \@@_rowcolor
- \cs_set_eq:NN \rowcolors \@@_rowcolors
- \cs_set_eq:NN \arraycolor \@@_arraycolor
- \cs_set_eq:NN \columncolor \@@_columncolor
- \cs_set_eq:NN \chessboardcolors \@@_chessboardcolors
- \cs_set_eq:NN \SubMatrix \@@_SubMatrix_in_code_before
-% \end{macrocode}
-% We compose the |code-before| in math mode in order to nullify the spaces put
-% by the user between instructions in the |code-before|.
-% \begin{macrocode}
- \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
- \seq_gclear_new:N \g_@@_colors_seq
-% \end{macrocode}
-% Here is the |\CodeBefore|. As of now, the keys that may be provided to the
-% keyword |\CodeBefore| are the same as keys that may be provided to
-% |\CodeAfter|, hence the |\@@_CodeAfter_keys:|.
-% \begin{macrocode}
- \exp_last_unbraced:NV \@@_CodeAfter_keys: \l_@@_code_before_tl
-% \end{macrocode}
-% Now, all the cells which are specified to be colored by instructions in the
-% |\CodeBefore| will actually be colored. It's a two-stages mechanism because we
-% want to draw all the cells with the same color at the same time to absolutely
-% avoid thin white lines in some \textsc{pdf} viewers.
-% \begin{macrocode}
- \@@_actually_color:
- \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
- \group_end:
- }
- }
+ \bool_if:NT \l_@@_code_before_bool \@@_exec_code_before:
% \end{macrocode}
%
% A value of $-1$ for the counter |\l_@@_last_row_int| means that the user has
@@ -7854,7 +7801,6 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-%
% A value of $-1$ for the counter |\l_@@_last_col_int| means that the user has
% used the option |last-col| without value, that is to say without specifying
% the number of that last column. In this case, we try to read that value from
@@ -7885,7 +7831,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\@@_pre_array_ii:
% \end{macrocode}
-%
%
% \medskip
% The array will be composed in a box (named |\l_@@_the_array_box|) because we
@@ -7908,7 +7853,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\@@_construct_preamble:
% \end{macrocode}
-%
% Now, the preamble is constructed in |\g_@@_preamble_tl|
%
% \medskip
@@ -7918,7 +7862,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\dim_zero_new:N \l_@@_left_delim_dim
\dim_zero_new:N \l_@@_right_delim_dim
- \bool_if:NTF \g_@@_NiceArray_bool
+ \bool_if:NTF \l_@@_NiceArray_bool
{
\dim_gset:Nn \l_@@_left_delim_dim { 2 \arraycolsep }
\dim_gset:Nn \l_@@_right_delim_dim { 2 \arraycolsep }
@@ -7933,8 +7877,6 @@ version 2005/12/01 or later.
\dim_set:Nn \l_@@_right_delim_dim { \box_wd:N \l_tmpa_box }
}
% \end{macrocode}
-%
-%
%
% \bigskip
% Here is the beginning of the box which will contain the array. The
@@ -7972,6 +7914,226 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+%
+% \bigskip
+% \subsection*{The \textbackslash CodeBefore}
+%
+% The following command will be executed if the |\CodeBefore| has to be actually executed.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_pre_code_before:
+ {
+% \end{macrocode}
+% First, we give values to the LaTeX counters |iRow| and |jCol|. We remind that,
+% in the |code-before| (and in the |\CodeAfter|) they represent the numbers of
+% rows and columns of the array (without the potential last row and last column).
+% \begin{macrocode}
+ \int_zero_new:N \c@iRow
+ \int_set:Nn \c@iRow
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 2 }
+ \int_zero_new:N \c@jCol
+ \int_set:Nn \c@jCol
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 4 }
+% \end{macrocode}
+% We have to adjust the values of |\c@iRow| and |\c@jCol| to take into account
+% the potential last row and last column. A value of $-2$ for
+% |\l_@@_last_row_int| means that there is no last row. Idem for the columns.
+% \begin{macrocode}
+ \int_compare:nNnF \l_@@_last_row_int = { -2 }
+ { \int_decr:N \c@iRow }
+ \int_compare:nNnF \l_@@_last_col_int = { -2 }
+ { \int_decr:N \c@jCol }
+% \end{macrocode}
+%
+% Now, we will create all the |col| nodes and |row| nodes with the informations
+% written in the |aux| file. You use the technique described in the page~1229 of
+% |pgfmanual.pdf|, version~3.1.4b.
+% \begin{macrocode}
+ \pgfsys@markposition { \@@_env: - position }
+ \pgfsys@getposition { \@@_env: - position } \@@_picture_position:
+ \pgfpicture
+ \pgf@relevantforpicturesizefalse
+% \end{macrocode}
+% First, the recreation of the |row| nodes.
+% \begin{macrocode}
+ \int_step_inline:nnn
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 1 }
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 2 + 1 }
+ {
+ \pgfsys@getposition { \@@_env: - row - ##1 } \@@_node_position:
+ \pgfcoordinate { \@@_env: - row - ##1 }
+ { \pgfpointdiff \@@_picture_position: \@@_node_position: }
+ }
+% \end{macrocode}
+% Now, the recreation of the |col| nodes.
+% \begin{macrocode}
+ \int_step_inline:nnn
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 3 }
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 4 + 1 }
+ {
+ \pgfsys@getposition { \@@_env: - col - ##1 } \@@_node_position:
+ \pgfcoordinate { \@@_env: - col - ##1 }
+ { \pgfpointdiff \@@_picture_position: \@@_node_position: }
+ }
+% \end{macrocode}
+% Now, you recreate the diagonal nodes by using the |row| nodes and the |col|
+% nodes.
+% \begin{macrocode}
+ \@@_create_diag_nodes:
+% \end{macrocode}
+%
+% \medskip
+% Now, the creation of the cell nodes |(i-j)|.
+% \begin{macrocode}
+ \bool_if:NT \g_@@_recreate_cell_nodes_bool \@@_recreate_cell_nodes:
+ \endpgfpicture
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \bool_if:NT \c_@@_tikz_loaded_bool
+ {
+ \tikzset
+ {
+ every~picture / .style =
+ { overlay , name~prefix = \@@_env: - }
+ }
+ }
+ \cs_set_eq:NN \cellcolor \@@_cellcolor
+ \cs_set_eq:NN \rectanglecolor \@@_rectanglecolor
+ \cs_set_eq:NN \roundedrectanglecolor \@@_roundedrectanglecolor
+ \cs_set_eq:NN \rowcolor \@@_rowcolor
+ \cs_set_eq:NN \rowcolors \@@_rowcolors
+ \cs_set_eq:NN \arraycolor \@@_arraycolor
+ \cs_set_eq:NN \columncolor \@@_columncolor
+ \cs_set_eq:NN \chessboardcolors \@@_chessboardcolors
+ \cs_set_eq:NN \SubMatrix \@@_SubMatrix_in_code_before
+% \end{macrocode}
+% The list of the cells which are in the (empty) corners is stored in the |aux|
+% file because we have to know it before the execution of the |\CodeBefore| (the
+% commands which color the cells, rows and columns won't color the cells which
+% are in the corners).
+% \begin{macrocode}
+ \seq_if_exist:cT
+ { c_@@_corners_cells_ \int_use:N \g_@@_env_int _ seq }
+ {
+ \seq_set_eq:Nc \l_@@_corners_cells_seq
+ { c_@@_corners_cells_ \int_use:N \g_@@_env_int _ seq }
+ }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_exec_code_before:
+ {
+ \seq_gclear_new:N \g_@@_colors_seq
+ \bool_gset_false:N \g_@@_recreate_cell_nodes_bool
+ \group_begin:
+% \end{macrocode}
+%
+% We compose the |code-before| in math mode in order to nullify the spaces put
+% by the user between instructions in the |code-before|.
+% \begin{macrocode}
+ \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
+% \end{macrocode}
+%
+% Here is the |\CodeBefore|. The construction is a bit complicated because
+% |\l_@@_code_before_tl| may begin with keys between square brackets. Moreover,
+% after the analyze of those keys, we sometimes have to decide to do \emph{not}
+% execute the rest of |\l_@@_code_before_tl| (when it is asked for the creation
+% of cell nodes in the |\CodeBefore|). That's why we begin with a |\q_stop|: it
+% will be used to discard the rest of |\l_@@_code_before_tl|.
+% \begin{macrocode}
+ \exp_last_unbraced:NV \@@_CodeBefore_keys: \l_@@_code_before_tl \q_stop
+% \end{macrocode}
+% Now, all the cells which are specified to be colored by instructions in the
+% |\CodeBefore| will actually be colored. It's a two-stages mechanism because we
+% want to draw all the cells with the same color at the same time to absolutely
+% avoid thin white lines in some \textsc{pdf} viewers.
+% \begin{macrocode}
+ \@@_actually_color:
+ \bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
+ \group_end:
+ \bool_if:NT \g_@@_recreate_cell_nodes_bool
+ { \tl_put_left:Nn \@@_node_for_cell: \@@_patch_node_for_cell: }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\keys_define:nn { NiceMatrix / CodeBefore }
+ {
+ create-cell-nodes .bool_gset:N = \g_@@_recreate_cell_nodes_bool ,
+ create-cell-nodes .default:n = true ,
+ sub-matrix .code:n = \keys_set:nn { NiceMatrix / sub-matrix } { #1 } ,
+ sub-matrix .value_required:n = true ,
+ delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
+ unknown .code:n = \@@_error:n { Unknown~key~for~CodeAfter }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand \@@_CodeBefore_keys: { O { } }
+ {
+ \keys_set:nn { NiceMatrix / CodeBefore } { #1 }
+ \@@_CodeBefore:w
+ }
+% \end{macrocode}
+%
+% We have extracted the options of the keyword |\CodeBefore| in order to see
+% whether the key |create-cell-nodes| has been used. Now, you can execute the
+% rest of the |\CodeAfter|, excepted, of course, if we are in the first
+% compilation.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_CodeBefore:w #1 \q_stop
+ {
+ \seq_if_exist:cT { @@_size_ \int_use:N \g_@@_env_int _ seq }
+ {
+ \@@_pre_code_before:
+ #1
+ }
+ }
+% \end{macrocode}
+%
+% \bigskip
+%
+%
+% \bigskip
+% By default, if the user uses the |\CodeBefore|, only the |col| nodes, |row|
+% nodes and |diag| nodes are available in that |\CodeBefore|. With the key
+% |create-cell-nodes|, the cell nodes, that is to say the nodes of the form
+% |(i-j)| (but not the extra nodes) are also available because those nodes also
+% are recreated and that recreation is done by the following command.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_recreate_cell_nodes:
+ {
+ \int_step_inline:nnn
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 1 }
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 2 }
+ {
+ \int_step_inline:nnn
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 3 }
+ { \seq_item:cn { @@_size_ \int_use:N \g_@@_env_int _ seq } 4 }
+ {
+ \cs_if_exist:cT
+ { pgf @ sys @ pdf @ mark @ pos @ \@@_env: - ##1 - ####1 - NW }
+ {
+ \pgfsys@getposition
+ { \@@_env: - ##1 - ####1 - NW }
+ \@@_node_position:
+ \pgfsys@getposition
+ { \@@_env: - ##1 - ####1 - SE }
+ \@@_node_position_i:
+ \@@_pgf_rect_node:nnn
+ { \@@_env: - ##1 - ####1 }
+ { \pgfpointdiff \@@_picture_position: \@@_node_position: }
+ { \pgfpointdiff \@@_picture_position: \@@_node_position_i: }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+%
%
% \bigskip
% \subsection*{The environment \{NiceArrayWithDelims\}}
@@ -8076,7 +8238,7 @@ version 2005/12/01 or later.
% of |{NiceArray}| (|{pNiceArray}|, |{bNiceArray}|, etc.) because, for
% |{NiceArray}|, we have the options |t|, |c|, |b| and |baseline|.
% \begin{macrocode}
- \bool_if:NTF \g_@@_NiceArray_bool
+ \bool_if:NTF \l_@@_NiceArray_bool
{ \keys_set:nn { NiceMatrix / NiceArray } }
{ \keys_set:nn { NiceMatrix / pNiceArray } }
{ #3 , #5 }
@@ -8167,14 +8329,14 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% The construction of the real box is different when |\g_@@_NiceArray_bool| is
+% The construction of the real box is different when |\l_@@_NiceArray_bool| is
% true (|{NiceArray}| or |{NiceTabular}|) and in the other environments because,
% in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put (but we have
% tabular notes to put). We begin with this case.
%
% Remark that, in all cases, |@@_use_arraybox_with_notes_c:| is used.
% \begin{macrocode}
- \bool_if:NTF \g_@@_NiceArray_bool
+ \bool_if:NTF \l_@@_NiceArray_bool
{
\str_case:VnF \l_@@_baseline_tl
{
@@ -8338,9 +8500,9 @@ version 2005/12/01 or later.
% the end).
% \begin{macrocode}
\bool_if:NF \l_@@_Matrix_bool
- {
- \@@_newcolumntype w [ 2 ] { \@@_w: { ##1 } { ##2 } }
- \@@_newcolumntype W [ 2 ] { \@@_W: { ##1 } { ##2 } }
+ {
+ \@@_newcolumntype w [ 2 ] { \@@_w: { ##1 } { ##2 } }
+ \@@_newcolumntype W [ 2 ] { \@@_W: { ##1 } { ##2 } }
% \end{macrocode}
%
% First, we have to store our preamble in the token register |\@temptokena|
@@ -8394,18 +8556,10 @@ version 2005/12/01 or later.
% \begin{macrocode}
\int_zero:N \l_tmpa_int
% \end{macrocode}
-% We will raise |\l_tmpa_bool| if we are in |{NiceArray}| and that the first
-% letter of the preamble is a opening delimiter (|[|, |(| of |\{|). In that
-% case, the environment |{NiceArray}| will be transformed to an environment of
-% the form |{xNiceArray}| after the construction of the preamble.
-% \begin{macrocode}
- \bool_set_false:N \l_tmpa_bool
-% \end{macrocode}
% Now, we actually patch the preamble (and it is constructed in
% |\g_@@_preamble_tl|).
% \begin{macrocode}
\exp_after:wN \@@_patch_preamble:n \the \@temptokena \q_stop
- \bool_if:NT \l_tmpa_bool { \bool_gset_false:N \g_@@_NiceArray_bool }
\int_gset_eq:NN \g_@@_static_num_of_col_int \c@jCol
}
% \end{macrocode}
@@ -8421,6 +8575,23 @@ version 2005/12/01 or later.
\g_@@_preamble_tl
}
% \end{macrocode}
+%
+% \medskip
+% Now, we can close the TeX group which was opened for the redefinition of
+% the columns of type |w| and |W|.
+% \begin{macrocode}
+ \group_end:
+% \end{macrocode}
+%
+% \medskip
+% If there was delimiters at the beginning or at the end of the preamble, the
+% environment |{NiceArray}| is transformed into an environment |{xNiceMatrix}|.
+% \begin{macrocode}
+ \bool_lazy_or:nnT
+ { ! \str_if_eq_p:Vn \g_@@_left_delim_tl { . } }
+ { ! \str_if_eq_p:Vn \g_@@_right_delim_tl { . } }
+ { \bool_set_false:N \l_@@_NiceArray_bool }
+% \end{macrocode}
%
% \bigskip
% We complete the preamble with the potential ``exterior columns''.
@@ -8430,7 +8601,7 @@ version 2005/12/01 or later.
{
\bool_lazy_all:nT
{
- \g_@@_NiceArray_bool
+ \l_@@_NiceArray_bool
{ \bool_not_p:n \l_@@_NiceTabular_bool }
{ \tl_if_empty_p:N \l_@@_vlines_clist }
{ \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
@@ -8442,7 +8613,7 @@ version 2005/12/01 or later.
{
\bool_lazy_all:nT
{
- \g_@@_NiceArray_bool
+ \l_@@_NiceArray_bool
{ \bool_not_p:n \l_@@_NiceTabular_bool }
{ \tl_if_empty_p:N \l_@@_vlines_clist }
{ \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
@@ -8459,13 +8630,6 @@ version 2005/12/01 or later.
\tl_gput_right:Nn \g_@@_preamble_tl
{ > { \@@_error_too_much_cols: } l }
}
-% \end{macrocode}
-%
-% \medskip
-% Now, we have to close the TeX group which was opened for the redefinition of
-% the columns of type |w| and |W|.
-% \begin{macrocode}
- \group_end:
}
% \end{macrocode}
%
@@ -8488,9 +8652,9 @@ version 2005/12/01 or later.
\@@_w: { \@@_patch_preamble_v:nnnn { } #1 }
\@@_W: { \@@_patch_preamble_v:nnnn { \cs_set_eq:NN \hss \hfil } #1 }
\@@_true_c: { \@@_patch_preamble_vi:n #1 }
- ( { \@@_patch_preamble_vii:n #1 }
- [ { \@@_patch_preamble_vii:n #1 }
- \{ { \@@_patch_preamble_vii:n #1 }
+ ( { \@@_patch_preamble_vii:nn #1 }
+ [ { \@@_patch_preamble_vii:nn #1 }
+ \{ { \@@_patch_preamble_vii:nn #1 }
) { \@@_patch_preamble_viii:nn #1 }
] { \@@_patch_preamble_viii:nn #1 }
\} { \@@_patch_preamble_viii:nn #1 }
@@ -8677,17 +8841,16 @@ version 2005/12/01 or later.
% \medskip
% For |(|, |[| and |\{|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_vii:n #1
+\cs_new_protected:Npn \@@_patch_preamble_vii:nn #1 #2
{
- \bool_if:NT \l_@@_small_bool
- { \@@_fatal:n { Delimiter~with~small } }
+ \bool_if:NT \l_@@_small_bool { \@@_fatal:n { Delimiter~with~small } }
% \end{macrocode}
% If we are before the column 1 and not in |{NiceArray}|, we reserve space for
% the left delimiter.
% \begin{macrocode}
\int_compare:nNnTF \c@jCol = \c_zero_int
{
- \bool_if:NTF \g_@@_NiceArray_bool
+ \str_if_eq:VnTF \g_@@_left_delim_tl { . }
{
% \end{macrocode}
% In that case, in fact, the firt letter of the preamble must be considered as
@@ -8695,67 +8858,52 @@ version 2005/12/01 or later.
% \begin{macrocode}
\tl_gset:Nn \g_@@_left_delim_tl { #1 }
\tl_gset:Nn \g_@@_right_delim_tl { . }
-% \end{macrocode}
-% We raise the boolean |\l_tmpa_bool|, which means that the environment
-% |{NiceArray}| will be transformed to |{xNiceArray}|.
-% \begin{macrocode}
- \bool_set_true:N \l_tmpa_bool
- \@@_patch_preamble:n
+ \@@_patch_preamble:n #2
}
{
\tl_gput_right:Nn \g_@@_preamble_tl { ! { \enskip } }
\tl_gput_right:Nx \g_@@_internal_code_after_tl
{ \@@_delimiter:nnn #1 { \@@_succ:n \c@jCol } \c_true_bool }
- \@@_patch_preamble_vii_i:n
+ \tl_if_in:nnTF { ( [ \{ ) ] \} } { #2 }
+ {
+ \@@_error:nn { delimiter~after~opening } { #2 }
+ \@@_patch_preamble:n
+ }
+ { \@@_patch_preamble:n #2 }
}
}
{
\tl_gput_right:Nx \g_@@_internal_code_after_tl
{ \@@_delimiter:nnn #1 { \@@_succ:n \c@jCol } \c_true_bool }
- \@@_patch_preamble_vii_i:n
+ \tl_if_in:nnTF { ( [ \{ ) ] \} } { #2 }
+ {
+ \@@_error:nn { delimiter~after~opening } { #2 }
+ \@@_patch_preamble:n
+ }
+ { \@@_patch_preamble:n #2 }
}
}
% \end{macrocode}
%
-% \bigskip
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_patch_preamble_vii_i:n #1
- {
- \tl_if_in:nnTF { ( [ \{ ) ] \} } { #1 }
- {
- \@@_error:nn { delimiter~after~opening } { #1 }
- \@@_patch_preamble:n
- }
- { \@@_patch_preamble:n #1 }
- }
-% \end{macrocode}
%
% \bigskip
% For |)|, |]| and |\}|. We have two arguments for the following command because
% we directly read the following letter in the preamble (we have to see whether
% we have a opening delimiter following and we also have to see whether we are
% at the end of the preamble because, in that case, our letter must be
-% considered as the right delimiter of the environment).
+% considered as the right delimiter of the environment if the environment is
+% |{NiceArray}|).
% \begin{macrocode}
\cs_new_protected:Npn \@@_patch_preamble_viii:nn #1 #2
{
- \bool_if:NT \l_@@_small_bool
- { \@@_fatal:n { Delimiter~with~small } }
+ \bool_if:NT \l_@@_small_bool { \@@_fatal:n { Delimiter~with~small } }
\tl_if_in:nnTF { ) ] \} } { #2 }
- {
- \tl_gput_right:Nx \g_@@_internal_code_after_tl
- { \@@_delimiter:nnn #1 { \int_use:N \c@jCol } \c_false_bool }
- \@@_error:nn { double~closing~delimiter } { #2 }
- \@@_patch_preamble:n
- }
+ { \@@_patch_preamble_viii_i:nnn #1 #2 }
{
\tl_if_eq:nnTF { \q_stop } { #2 }
{
- \bool_if:NTF \g_@@_NiceArray_bool
- {
- \tl_gset:Nn \g_@@_right_delim_tl { #1 }
- \bool_set_true:N \l_tmpa_bool
- }
+ \str_if_eq:VnTF \g_@@_right_delim_tl { . }
+ { \tl_gset:Nn \g_@@_right_delim_tl { #1 } }
{
\tl_gput_right:Nn \g_@@_preamble_tl { ! { \enskip } }
\tl_gput_right:Nx \g_@@_internal_code_after_tl
@@ -8774,7 +8922,34 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_viii_i:nnn #1 #2 #3
+ {
+ \tl_if_eq:nnTF { \q_stop } { #3 }
+ {
+ \str_if_eq:VnTF \g_@@_right_delim_tl { . }
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl { ! { \enskip } }
+ \tl_gput_right:Nx \g_@@_internal_code_after_tl
+ { \@@_delimiter:nnn #1 { \int_use:N \c@jCol } \c_false_bool }
+ \tl_gset:Nn \g_@@_right_delim_tl { #2 }
+ }
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl { ! { \enskip } }
+ \tl_gput_right:Nx \g_@@_internal_code_after_tl
+ { \@@_delimiter:nnn #1 { \int_use:N \c@jCol } \c_false_bool }
+ \@@_error:nn { double~closing~delimiter } { #2 }
+ }
+ }
+ {
+ \tl_gput_right:Nx \g_@@_internal_code_after_tl
+ { \@@_delimiter:nnn #1 { \int_use:N \c@jCol } \c_false_bool }
+ \@@_error:nn { double~closing~delimiter } { #2 }
+ \@@_patch_preamble:n #3
+ }
+ }
+% \end{macrocode}
+%
% \begin{macrocode}
\cs_new_protected:Npn \@@_patch_preamble_xi:n #1
{
@@ -9510,7 +9685,7 @@ version 2005/12/01 or later.
\hbox_overlap_left:n
{
\dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim
- \@@_node_for_the_cell:
+ \@@_node_for_cell:
{ \box_use_drop:N \l_@@_cell_box }
\skip_horizontal:N \l_@@_left_delim_dim
\skip_horizontal:N \l_@@_left_margin_dim
@@ -9591,7 +9766,7 @@ version 2005/12/01 or later.
\skip_horizontal:N \l_@@_right_delim_dim
\skip_horizontal:N \l_@@_right_margin_dim
\skip_horizontal:N \l_@@_extra_right_margin_dim
- \@@_node_for_the_cell:
+ \@@_node_for_cell:
}
}
\bool_gset_false:N \g_@@_empty_cell_bool
@@ -9602,19 +9777,19 @@ version 2005/12/01 or later.
%
% \interitem
% The environment |{NiceArray}| is constructed upon the environment
-% |{NiceArrayWithDelims}| but, in fact, there is a flag |\g_@@_NiceArray_bool|.
+% |{NiceArrayWithDelims}| but, in fact, there is a flag |\l_@@_NiceArray_bool|.
% In |{NiceArrayWithDelims}|, some special code will be executed if this flag is
% raised.
% \begin{macrocode}
\NewDocumentEnvironment { NiceArray } { }
{
- \bool_gset_true:N \g_@@_NiceArray_bool
+ \bool_set_true:N \l_@@_NiceArray_bool
\str_if_empty:NT \g_@@_name_env_str
{ \str_gset:Nn \g_@@_name_env_str { NiceArray } }
% \end{macrocode}
% We put . and . for the delimiters but, in fact, that doesn't matter because
% these arguments won't be used in |{NiceArrayWithDelims}| (because the flag
-% |\g_@@_NiceArray_bool| is raised).
+% |\l_@@_NiceArray_bool| is raised).
% \begin{macrocode}
\NiceArrayWithDelims . .
}
@@ -9803,7 +9978,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% If the key |code-before| is used, we have to write on the |aux| file the actual
-% size of the array.
+% size of the array and other informations.
% \begin{macrocode}
\bool_if:NT \l_@@_code_before_bool
{
@@ -9837,12 +10012,13 @@ version 2005/12/01 or later.
{ c_@@_pos_of_blocks_ \int_use:N \g_@@_env_int _ seq }
{ \seq_use:Nnnn \g_@@_pos_of_blocks_seq , , , }
}
+ \iow_now:Nn \@mainaux \ExplSyntaxOff
}
% \end{macrocode}
%
% \medskip
% Now, you create the diagonal nodes by using the |row| nodes and the |col|
-% nodes. If the engine is |xetex| or |luatex| we also create the ``½ nodes''.
+% nodes.
% \begin{macrocode}
\@@_create_diag_nodes:
% \end{macrocode}
@@ -10020,9 +10196,12 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \begin{macrocode}
+ % \bool_if:NT \l_@@_code_before_bool \@@_write_aux_for_cell_nodes:
+% \end{macrocode}
+%
% \medskip
% \begin{macrocode}
- \bool_gset_false:N \g_@@_NiceArray_bool
\str_gclear:N \g_@@_name_env_str
\@@_restore_iRow_jCol:
% \end{macrocode}
@@ -10040,12 +10219,14 @@ version 2005/12/01 or later.
% \bigskip
% The following command will extract the potential options (between square
% brackets) at the beginning of the |\CodeAfter| (that is to say, when
-% |\CodeAfter| is used, the options of that ``command'' |\CodeAfter|).
+% |\CodeAfter| is used, the options of that ``command'' |\CodeAfter|). Idem for
+% the |\CodeBefore.|
% \begin{macrocode}
\NewDocumentCommand \@@_CodeAfter_keys: { O { } }
{ \keys_set:nn { NiceMatrix / CodeAfter } { #1 } }
% \end{macrocode}
%
+%
%
% \bigskip
% We remind that the first mandatory argument of the command |\Block| is the
@@ -10144,6 +10325,53 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_write_aux_for_cell_nodes:
+ {
+ \pgfpicture
+ \pgfrememberpicturepositiononpagetrue
+ \pgf@relevantforpicturesizefalse
+ \int_step_inline:nnn \l_@@_first_row_int \g_@@_row_total_int
+ {
+ \int_step_inline:nnn \l_@@_first_col_int \g_@@_col_total_int
+ {
+ \cs_if_exist:cT { pgf @ sh @ ns @ \@@_env: - ##1 - ####1 }
+ {
+ \pgfscope
+ \pgftransformshift
+ { \pgfpointanchor { \@@_env: - ##1 - ####1 } { north~west } }
+ \pgfnode
+ { rectangle }
+ { center }
+ {
+ \hbox
+ { \pgfsys@markposition { \@@_env: - ##1 - ####1 - NW } }
+ }
+ { }
+ { }
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift
+ { \pgfpointanchor { \@@_env: - ##1 - ####1 } { south~east } }
+ \pgfnode
+ { rectangle }
+ { center }
+ {
+ \hbox
+ { \pgfsys@markposition { \@@_env: - ##1 - ####1 - SE } }
+ }
+ { }
+ { }
+ \endpgfscope
+ }
+ }
+ }
+ \endpgfpicture
+ \@@_create_extra_nodes:
+ }
+% \end{macrocode}
%
% \bigskip
% The following command creates the diagonal nodes (in fact, if the matrix is
@@ -12765,8 +12993,8 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_draw_vlines:
{
\int_step_inline:nnn
- { \bool_if:NTF \g_@@_NiceArray_bool 1 2 }
- { \bool_if:NTF \g_@@_NiceArray_bool { \@@_succ:n \c@jCol } \c@jCol }
+ { \bool_if:NTF \l_@@_NiceArray_bool 1 2 }
+ { \bool_if:NTF \l_@@_NiceArray_bool { \@@_succ:n \c@jCol } \c@jCol }
{
\tl_if_eq:NnF \l_@@_vlines_clist { all }
{ \clist_if_in:NnT \l_@@_vlines_clist { ##1 } }
@@ -12939,8 +13167,8 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_draw_hlines:
{
\int_step_inline:nnn
- { \bool_if:NTF \g_@@_NiceArray_bool 1 2 }
- { \bool_if:NTF \g_@@_NiceArray_bool { \@@_succ:n \c@iRow } \c@iRow }
+ { \bool_if:NTF \l_@@_NiceArray_bool 1 2 }
+ { \bool_if:NTF \l_@@_NiceArray_bool { \@@_succ:n \c@iRow } \c@iRow }
{
\tl_if_eq:NnF \l_@@_hlines_clist { all }
{ \clist_if_in:NnT \l_@@_hlines_clist { ##1 } }
@@ -13377,14 +13605,14 @@ version 2005/12/01 or later.
% We do a reduction by |\arraycolsep| for the environments with delimiters (and
% not for the other).
% \begin{macrocode}
- \bool_if:NTF \g_@@_NiceArray_bool \c_zero_dim \arraycolsep
+ \bool_if:NTF \l_@@_NiceArray_bool \c_zero_dim \arraycolsep
- \l_@@_left_margin_dim
}
\@@_qpoint:n { col - \@@_succ:n \c@jCol }
\dim_set:Nn \l_@@_x_final_dim
{
\pgf@x -
- \bool_if:NTF \g_@@_NiceArray_bool \c_zero_dim \arraycolsep
+ \bool_if:NTF \l_@@_NiceArray_bool \c_zero_dim \arraycolsep
+ \l_@@_right_margin_dim
}
% \end{macrocode}
@@ -13545,7 +13773,8 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
-% \bigskip
+%
+%
% \subsection*{The extra nodes}
%
% First, two variants of the functions |\dim_min:nn| and |\dim_max:nn|.
@@ -13558,7 +13787,7 @@ version 2005/12/01 or later.
% \bigskip
% The following command is called in |\@@_use_arraybox_with_notes_c:| just
% before the construction of the blocks (if the creation of medium nodes is
-% required, medium nodes are also created for the blocks dans that construction
+% required, medium nodes are also created for the blocks and that construction
% uses the standard medium nodes).
% \begin{macrocode}
\cs_new_protected:Npn \@@_create_extra_nodes:
@@ -14570,7 +14799,7 @@ version 2005/12/01 or later.
%
% \medskip
% If the creation of the ``medium nodes'' is required, we create a ``medium
-% node'' for the block. The function |\@@_pgf_rect_node:nnnnn| takes in as
+% node'' for the block. The function |\@@_pgf_rect_node:nnn| takes in as
% arguments the name of the node and two \textsc{pgf} points.
% \begin{macrocode}
\bool_if:NT \l_@@_medium_nodes_bool
@@ -15013,13 +15242,14 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% We define also an command |\AutoNiceMatrix| similar to the environment |{NiceMatrix}|.
+% We define also a command |\AutoNiceMatrix| similar to the environment |{NiceMatrix}|.
% \begin{macrocode}
\NewDocumentCommand \AutoNiceMatrix { O { } m O { } m ! O { } }
{
- \bool_gset_true:N \g_@@_NiceArray_bool
+ \group_begin:
+ \bool_set_true:N \l_@@_NiceArray_bool
\AutoNiceMatrixWithDelims . . { #2 } { #4 } [ #1 , #3 , #5 ]
- \bool_gset_false: \g_@@_NiceArray_bool
+ \group_end:
}
% \end{macrocode}
%
@@ -16010,17 +16240,6 @@ version 2005/12/01 or later.
% \end{macrocode}
%
%
-% \medskip
-% The following message will be deleted when we will delete the key
-% |delimiters-color| (and keep only the key |delimiters/color|).
-% \begin{macrocode}
-\@@_msg_new:nn { delimiters-color deleted }
- {
- The~key~'delimiters-color'~has~been~renamed~'delimiters/color'.\\
- ~However,~you~can~go~on~for~this~time.
- }
-% \end{macrocode}
-%
% \begin{macrocode}
\seq_new:N \c_@@_types_of_matrix_seq
\seq_set_from_clist:Nn \c_@@_types_of_matrix_seq
@@ -16579,7 +16798,7 @@ version 2005/12/01 or later.
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
- delimiters/color,~
+ delimiters~(several~subkeys),~
end-of-row,~
first-col,~
first-row,~
@@ -16689,7 +16908,7 @@ version 2005/12/01 or later.
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
- delimiters/color,~
+ delimiters~(several~subkeys),~
extra-left-margin,~
extra-right-margin,~
first-col,~
@@ -17271,6 +17490,9 @@ version 2005/12/01 or later.
% It's now possible to specify delimiters for submatrices in the preamble of an
% environment.
%
+%
+% \subsection*{Changes between versions 5.15 and 5.16}
+%
% \PrintIndex
%
% \tableofcontents
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index b710425395..9bae2b15ba 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/macros/latex/contrib/pbalance/LICENSE b/macros/latex/contrib/pbalance/LICENSE
index dea471c70c..a953e0b709 100644
--- a/macros/latex/contrib/pbalance/LICENSE
+++ b/macros/latex/contrib/pbalance/LICENSE
@@ -1,7 +1,7 @@
-Copyright 2020 Nelson Lago <lago@ime.usp.br>
+Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
This work may be distributed and/or modified under the conditions of the
-LaTeX Project Public License, either version 1.3 of this license or (at
+LaTeX Project Public License, either version 1.3c of this license or (at
your option) any later version. The latest version of this license can be
found at http://www.latex-project.org/lppl.txt and version 1.3 or later
is part of all distributions of LaTeX version 2005/12/01 or later.
diff --git a/macros/latex/contrib/pbalance/README.md b/macros/latex/contrib/pbalance/README.md
index a26f9b2a5e..93f1e7c969 100644
--- a/macros/latex/contrib/pbalance/README.md
+++ b/macros/latex/contrib/pbalance/README.md
@@ -13,8 +13,8 @@ the columns. There are, however, three caveats:
Code etc: <https://gitlab.com/lago/pbalance>
-Copyright 2020 Nelson Lago <lago@ime.usp.br>
+Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
This work may be distributed and/or modified under the conditions of the
-LaTeX Project Public License, either version 1.3 of this license or (at
+LaTeX Project Public License, either version 1.3c of this license or (at
your option) any later version.
diff --git a/macros/latex/contrib/pbalance/pbalance.dtx b/macros/latex/contrib/pbalance/pbalance.dtx
index 63876d5293..ea00526085 100644
--- a/macros/latex/contrib/pbalance/pbalance.dtx
+++ b/macros/latex/contrib/pbalance/pbalance.dtx
@@ -1,8 +1,8 @@
% \iffalse meta-comment
-% Copyright 2020 Nelson Lago <lago@ime.usp.br>
+% Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
%
% This work may be distributed and/or modified under the conditions of the
-% LaTeX Project Public License, either version 1.3 of this license or (at
+% LaTeX Project Public License, either version 1.3c of this license or (at
% your option) any later version. The latest version of this license can be
% found at http://www.latex-project.org/lppl.txt and version 1.3 or later
% is part of all distributions of LaTeX version 2005/12/01 or later.
@@ -15,7 +15,7 @@
% \iffalse
%
%<package>\NeedsTeXFormat{LaTeX2e}[2015/01/01]
-%<package>\ProvidesPackage{pbalance}[2020/12/16 v1.0.1 Poor man's balance]
+%<package>\ProvidesPackage{pbalance}[2021/04/26 v1.1.0 Poor man's balance]
%
%<*driver>
@@ -26,24 +26,15 @@
\urlstyle{sf}
\usepackage{hyperref}
\hypersetup{
- pdfborder={0 0 .6},
- pdfborderstyle={/S/U/W .6},
- urlbordercolor=DodgerBlue,
- citebordercolor=White,
- linkbordercolor=White,
- filebordercolor=White,
+ colorlinks=true,
+ citecolor=DarkGreen,
+ linkcolor=NavyBlue,
+ urlcolor=DarkRed,
+ filecolor=green,
+ anchorcolor=black,
}
\usepackage[draft]{pbalance}
-\makeatletter
-\dimgdef\@PBtmpHeight{0pt}
-\dimgdef\@PBtmpLeftHeight{0pt}
-\dimgdef\@PBtmpLeftFloatsHeight{0pt}
-\dimgdef\@PBtmpRightHeight{0pt}
-\dimgdef\@PBtmpRightFloatsHeight{0pt}
-\dimgdef\@PBtmpUsedLeft{0pt}
-\dimgdef\@PBtmpUsedRight{0pt}
-\makeatother
\usepackage{libertinus}
\usepackage[scale=.85]{sourcecodepro}
@@ -66,6 +57,7 @@
%
% \changes{v1.0}{2020/09/14}{Initial version}
% \changes{v1.0.1}{2020/12/16}{Improvements to documentation}
+% \changes{v1.1.0}{2021/04/26}{Do not crash in one-column mode}
%
% \GetFileInfo{pbalance.sty}
%
@@ -131,13 +123,21 @@
% need for extra passes during document preparation.
%
% If the last page does not have floats, footnotes, or marginpars, the
-% package simply uses \verb|\balance|, from the \texttt{balance} package;
+% package simply uses \verb|\balance|, from the \texttt{balance} package,
% otherwise it uses its own algorithm. You may instead use
% \verb|\shrinkLastPage{some-measurement}| to manually define how much
% shorter the first column of the last page should be. This, however, will
% not eliminate the need for extra passes (the package needs to find out
% which page is the last).
%
+% The package actually balances the last \emph{text} page; if the last
+% page is a float page, it is ignored. It also \emph{should} work if you
+% switch to single-column mode mid-document (with \verb|\onecolumn|); it
+% will then balance the last two-column text page. The same should happen
+% in a document that is mainly typeset in one column and you switch to
+% two-column layout (with \verb|\twocolumn|), but \emph{only} if the page
+% to be balanced does \emph{not} contain the \verb|\twocolumn| command.
+%
% If there are many floats near the end of the document, the \LaTeX{}
% float placement parameters (\verb|\topfraction|, \verb|topnumber|,
% etc.) may interfere negatively with the algorithm. In some rare
@@ -171,12 +171,13 @@
%
% \begin{enumerate}
%
-% \item It uses a \LaTeX{} pass to gather information: which is the last page?
-% Does it have floats? Footnotes? How much free space in each column?
+% \item It uses a \LaTeX{} pass to gather information: which is the last
+% two-column text page? Does it have floats? Footnotes? How much
+% free space in each column?
%
-% \item It uses this information in a subsequent pass to balance the last
+% \item It uses this information in a subsequent pass to balance that
% page. If there are no floats or footnotes, it uses the balance
-% package; otherwise it uses the measurements collected to shrink
+% package, otherwise it uses the measurements collected to shrink
% the first column (using \verb|\enlargethispage|) by a
% ``reasonable'' amount.
%
@@ -198,10 +199,10 @@
% To prevent this, it would be ideal to only start the process after all
% passes needed to stabilize the document have run. In practice, however,
% this would be too hard to detect (and demand even more passes). What
-% we do instead is simply wait for two consecutive passes to result
-% in columns of the same size in the last page. When this happens, we
-% proceed to balance in the next pass and assume (quite reasonably) that,
-% as long as the document is not modified, the effect of concurrent
+% we do instead is simply wait for two consecutive passes to result in
+% columns of the same size in the last two-column page. When this happens,
+% we proceed to balance in the next pass and assume (quite reasonably)
+% that, as long as the document is not modified, the effect of concurrent
% changes during that pass in the last page is small, so ignoring it
% disturbs the balancing only slightly\footnote{Like I said on the
% introduction: this package is a hack.}.
@@ -212,9 +213,6 @@
%
% \begin{itemize}
%
-% \item add \verb|\if@twocolumn| tests to prevent crashes and
-% other problems;
-%
% \item add options to (1) allow using the balance package on pages with
% floats and (2) completely disable the balance package;
%
@@ -237,11 +235,12 @@
% \section{The implementation}
%
% We define \verb|\@PBlastPage| using \texttt{zref-abspage}; It is the page
-% number for the last page of text. This might \emph{not} be the last page
-% of the document: there may be one or more float pages after it. Still,
-% it \emph{is} the page we want to balance. We do not act on it, however;
-% instead, we save its value to the aux file as \verb|\@PBprevLastPage| and
-% proceed to balance on the next \LaTeX{} pass.
+% number for the last two-column page of text. This might \emph{not} be the
+% last page of the document: there may be one or more float pages after it
+% or the user may have issued \verb|\onecolumn|. Still, it \emph{is} the page
+% we want to balance. We do not act on it, however; instead, we save its value
+% to the aux file as \verb|\@PBprevLastPage| and proceed to balance on the next
+% \LaTeX{} pass.
%
% We also define two toggles:
%
@@ -320,7 +319,7 @@
{#2}
{
% abspage refers to the finished page, not the nascent page
- \ifnumcomp{\@PBprevLastPage - 1}{=}{\value{abspage}}
+ \ifnumcomp{\@PBprevLastPage - 1}{=}{\value{abspage}}
{#1}
{#2}
}
@@ -429,10 +428,10 @@
% For the mechanism above to work, we need to know:
%
% \begin{enumerate}
-% \item The page number of the last page;
-% \item Whether the last page has floats, footnotes etc.;
-% \item The available height in the last page;
-% \item The height of the columns in the last page.
+% \item The page number of the last two-column text page;
+% \item Whether it has floats, footnotes etc.;
+% \item The available height in it;
+% \item The height of the columns in it.
% \end{enumerate}
%
% Let's collect this info for every page.
@@ -601,25 +600,30 @@
\ExplSyntaxOn
\AtBeginShipout{
- \ifboolexpr
- {
- % A float page is not the last text page, ignore
- togl {@PBtmpIsFloatPage}
- or
- % A page with a float column on the left and an empty
- % column on the right is not the last text page, ignore
- (
- togl {@PBtmpHasFloatcol}
- and
- test {\ifdimcomp{\@PBtmpUsedRight}{=}{\topskip}}
- )
- }
- {}
- {
- % This page is a candidate to be the last page
- \xdef\@PBlastPage{\the\value{abspage}}
- \@PBcopyPageData{tmp}{candidate}
- }
+ % It only makes sense to consider pages that actually have two
+ % columns. LaTeX3 does not do short-circuit evaluation, so we
+ % cannot add this test to the ifboolexpr below.
+ \if@twocolumn
+ \ifboolexpr
+ {
+ % A float page is not the last text page, ignore
+ togl {@PBtmpIsFloatPage}
+ or
+ % A page with a float column on the left and an empty
+ % column on the right is not the last text page, ignore
+ (
+ togl {@PBtmpHasFloatcol}
+ and
+ test {\ifdimcomp{\@PBtmpUsedRight}{=}{\topskip}}
+ )
+ }
+ {}
+ {
+ % This page is a candidate to be the last two-column text page
+ \xdef\@PBlastPage{\the\value{abspage}}
+ \@PBcopyPageData{tmp}{candidate}
+ }
+ \fi
% Reset before processing next page
\global\togglefalse{@PBtmpHasFloats}
@@ -635,8 +639,8 @@
% \end{macrocode}
%
-% All pages processed, the last candidate page is actually the last page.
-% Instead of continuing to use the \texttt{@PBcandidate*} macros we already
+% All pages processed, the last candidate page is actually the last two-column
+% page. Instead of continuing to use the \texttt{@PBcandidate*} macros we already
% have, we will keep the information we just gathered associated with the
% page number. We do this because, in the future, we may want to add suport
% for balancing multiple pages (such as the last page of each chapter) and
@@ -645,14 +649,20 @@
%
% \begin{macrocode}
-\AfterLastShipout{\@PBcopyPageData{candidate}{pg\@Roman{\@PBlastPage}}}
+\AfterLastShipout{
+ % If there are no two-column pages in the
+ % document, there is no candidate page.
+ \ifcsdef{@PBlastPage}
+ {\@PBcopyPageData{candidate}{pg\@Roman{\@PBlastPage}}}
+ {}
+}
% \end{macrocode}
%
% \subsubsection{Saving measurements}
% The whole document has already been processed and data about the last
-% page has been collected in macros with names \texttt{@PBpgNUM*}. We now
-% process this collected data and save whatever is relevant in the aux
+% two-column page has been collected in macros with names \texttt{@PBpgNUM*}.
+% We now process this collected data and save whatever is relevant in the aux
% file for the next \LaTeX{} pass.
%
% In the first \LaTeX{} pass, we will save data to the aux file in macros
@@ -978,19 +988,25 @@
\newcommand\@PBsaveUnbalancedInfo[1][]{
- \immediate\write\@mainaux{\gdef\string\@PBprevLastPage{\@PBlastPage}}
-
- \ifboolexpr{test {\ifdefvoid{\@PBprevLastPage}} or test {\ifstrequal{#1}{update}}}
- % Columns are currently unbalanced, either because this is
- % the first pass (we do not have any previous information)
- % or because the document has not stabilized yet, so any
- % previous information is unreliable. Save the information
- % we just collected as ``unbalanced''.
- {\@PBsavePageDataAs{pg\@Roman{\@PBlastPage}}{unbalpg\@Roman{\@PBlastPage}}}
- % Not the first pass, so columns are possibly balanced;
- % to save the unbalanced information, repeat what was
- % gathered during the first pass.
- {\@PBsavePageData{unbalpg\@Roman{\@PBprevLastPage}}}
+ % If there are no two-column pages in the
+ % document, there is nothing to save.
+ \ifcsdef{@PBlastPage}
+ {
+ \immediate\write\@mainaux{\gdef\string\@PBprevLastPage{\@PBlastPage}}
+
+ \ifboolexpr{test {\ifdefvoid{\@PBprevLastPage}} or test {\ifstrequal{#1}{update}}}
+ % Columns are currently unbalanced, either because this is
+ % the first pass (we do not have any previous information)
+ % or because the document has not stabilized yet, so any
+ % previous information is unreliable. Save the information
+ % we just collected as ``unbalanced''.
+ {\@PBsavePageDataAs{pg\@Roman{\@PBlastPage}}{unbalpg\@Roman{\@PBlastPage}}}
+ % Not the first pass, so columns are possibly balanced;
+ % to save the unbalanced information, repeat what was
+ % gathered during the first pass.
+ {\@PBsavePageData{unbalpg\@Roman{\@PBprevLastPage}}}
+ }
+ {}
}
\def\@PBsaveBalancedInfo{
@@ -1002,8 +1018,14 @@
\def\@PBnotifyRerun{
\AtVeryEndDocument{
- \PackageWarningNoLine{pbalance}
- {Last page columns not balanced. Rerun LaTeX}
+ % If there are no two-column pages in the document,
+ % it makes no sense to emit this warning.
+ \ifcsdef{@PBlastPage}
+ {
+ \PackageWarningNoLine{pbalance}
+ {Last two-column page cols not balanced. Rerun LaTeX}
+ }
+ {}
}
}
diff --git a/macros/latex/contrib/pbalance/pbalance.ins b/macros/latex/contrib/pbalance/pbalance.ins
index bb6356b0bf..4dbd564c67 100644
--- a/macros/latex/contrib/pbalance/pbalance.ins
+++ b/macros/latex/contrib/pbalance/pbalance.ins
@@ -1,7 +1,7 @@
-%% Copyright 2020 Nelson Lago <lago@ime.usp.br>
+%% Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
%%
%% This work may be distributed and/or modified under the conditions of the
-%% LaTeX Project Public License, either version 1.3 of this license or (at
+%% LaTeX Project Public License, either version 1.3c of this license or (at
%% your option) any later version. The latest version of this license can be
%% found at http://www.latex-project.org/lppl.txt and version 1.3 or later
%% is part of all distributions of LaTeX version 2005/12/01 or later.
@@ -16,10 +16,10 @@
\usedir{tex/latex/pbalance}
\preamble
-Copyright 2020 Nelson Lago <lago@ime.usp.br>
+Copyright 2020-2021 Nelson Lago <lago@ime.usp.br>
This work may be distributed and/or modified under the conditions of the
-LaTeX Project Public License, either version 1.3 of this license or (at
+LaTeX Project Public License, either version 1.3c of this license or (at
your option) any later version. The latest version of this license can be
found at http://www.latex-project.org/lppl.txt and version 1.3 or later
is part of all distributions of LaTeX version 2005/12/01 or later.
diff --git a/macros/latex/contrib/pbalance/pbalance.pdf b/macros/latex/contrib/pbalance/pbalance.pdf
index a3a0beccd6..7b8f149a1a 100644
--- a/macros/latex/contrib/pbalance/pbalance.pdf
+++ b/macros/latex/contrib/pbalance/pbalance.pdf
Binary files differ