summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-01-09 03:02:47 +0000
committerNorbert Preining <norbert@preining.info>2021-01-09 03:02:47 +0000
commit0b5fb424a9fab0df06b2d7b9f8edc803cb89a760 (patch)
tree02008dd79efebad99a4b20f38049574ad71a5c10 /macros
parentb3f791edc2a8218e3e64f40d7c10d1310362972c (diff)
CTAN sync 202101090302
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/base/README.md2
-rw-r--r--macros/latex/base/alltt.pdfbin173079 -> 173080 bytes
-rw-r--r--macros/latex/base/cfgguide.pdfbin220217 -> 220226 bytes
-rw-r--r--macros/latex/base/changes.txt29
-rw-r--r--macros/latex/base/classes.pdfbin520851 -> 520818 bytes
-rw-r--r--macros/latex/base/clsguide.pdfbin372555 -> 372576 bytes
-rw-r--r--macros/latex/base/cmfonts.pdfbin264505 -> 264510 bytes
-rw-r--r--macros/latex/base/cyrguide.pdfbin216997 -> 216995 bytes
-rw-r--r--macros/latex/base/doc.pdfbin631201 -> 631278 bytes
-rw-r--r--macros/latex/base/docstrip.pdfbin479501 -> 479441 bytes
-rw-r--r--macros/latex/base/encguide.pdfbin1532144 -> 1532142 bytes
-rw-r--r--macros/latex/base/exscale.pdfbin195877 -> 195882 bytes
-rw-r--r--macros/latex/base/fix-cm.pdfbin262059 -> 262057 bytes
-rw-r--r--macros/latex/base/fntguide.pdfbin418342 -> 418347 bytes
-rw-r--r--macros/latex/base/graphpap.pdfbin156277 -> 156276 bytes
-rw-r--r--macros/latex/base/ifthen.pdfbin205213 -> 205204 bytes
-rw-r--r--macros/latex/base/inputenc.pdfbin294900 -> 294927 bytes
-rw-r--r--macros/latex/base/latexchanges.pdfbin232390 -> 247704 bytes
-rw-r--r--macros/latex/base/latexchanges.tex97
-rw-r--r--macros/latex/base/latexrelease.pdfbin246195 -> 246192 bytes
-rw-r--r--macros/latex/base/latexsym.pdfbin192297 -> 192295 bytes
-rw-r--r--macros/latex/base/lb2.pdfbin138219 -> 138221 bytes
-rw-r--r--macros/latex/base/letter.pdfbin305786 -> 306166 bytes
-rw-r--r--macros/latex/base/lgc2.pdfbin101343 -> 101335 bytes
-rw-r--r--macros/latex/base/lppl.pdfbin125830 -> 125830 bytes
-rw-r--r--macros/latex/base/ltfilehook-code.pdfbin744388 -> 745530 bytes
-rw-r--r--macros/latex/base/ltfilehook-doc.pdfbin516587 -> 516657 bytes
-rw-r--r--macros/latex/base/ltfilehook.dtx93
-rw-r--r--macros/latex/base/lthooks-code.pdfbin926391 -> 929193 bytes
-rw-r--r--macros/latex/base/lthooks-doc.pdfbin626854 -> 626829 bytes
-rw-r--r--macros/latex/base/lthooks.dtx102
-rw-r--r--macros/latex/base/ltluatex.pdfbin305339 -> 305355 bytes
-rw-r--r--macros/latex/base/ltnews.pdfbin989398 -> 989349 bytes
-rw-r--r--macros/latex/base/ltnews01.pdfbin150020 -> 150020 bytes
-rw-r--r--macros/latex/base/ltnews02.pdfbin134751 -> 134751 bytes
-rw-r--r--macros/latex/base/ltnews03.pdfbin134742 -> 134739 bytes
-rw-r--r--macros/latex/base/ltnews04.pdfbin128772 -> 128773 bytes
-rw-r--r--macros/latex/base/ltnews05.pdfbin157181 -> 157182 bytes
-rw-r--r--macros/latex/base/ltnews06.pdfbin133138 -> 133141 bytes
-rw-r--r--macros/latex/base/ltnews07.pdfbin124029 -> 124030 bytes
-rw-r--r--macros/latex/base/ltnews08.pdfbin144482 -> 144483 bytes
-rw-r--r--macros/latex/base/ltnews09.pdfbin120222 -> 120221 bytes
-rw-r--r--macros/latex/base/ltnews10.pdfbin147946 -> 147944 bytes
-rw-r--r--macros/latex/base/ltnews11.pdfbin104936 -> 104939 bytes
-rw-r--r--macros/latex/base/ltnews12.pdfbin137919 -> 137922 bytes
-rw-r--r--macros/latex/base/ltnews13.pdfbin161065 -> 161063 bytes
-rw-r--r--macros/latex/base/ltnews14.pdfbin150907 -> 150913 bytes
-rw-r--r--macros/latex/base/ltnews15.pdfbin122092 -> 122092 bytes
-rw-r--r--macros/latex/base/ltnews16.pdfbin130687 -> 130689 bytes
-rw-r--r--macros/latex/base/ltnews17.pdfbin149838 -> 149848 bytes
-rw-r--r--macros/latex/base/ltnews18.pdfbin36005 -> 36004 bytes
-rw-r--r--macros/latex/base/ltnews19.pdfbin235073 -> 235075 bytes
-rw-r--r--macros/latex/base/ltnews20.pdfbin283318 -> 283324 bytes
-rw-r--r--macros/latex/base/ltnews21.pdfbin233492 -> 233489 bytes
-rw-r--r--macros/latex/base/ltnews22.pdfbin302836 -> 302831 bytes
-rw-r--r--macros/latex/base/ltnews23.pdfbin274459 -> 274456 bytes
-rw-r--r--macros/latex/base/ltnews24.pdfbin252645 -> 252643 bytes
-rw-r--r--macros/latex/base/ltnews25.pdfbin196326 -> 196325 bytes
-rw-r--r--macros/latex/base/ltnews26.pdfbin362839 -> 362839 bytes
-rw-r--r--macros/latex/base/ltnews27.pdfbin239758 -> 239759 bytes
-rw-r--r--macros/latex/base/ltnews28.pdfbin368226 -> 368231 bytes
-rw-r--r--macros/latex/base/ltnews29.pdfbin433004 -> 433003 bytes
-rw-r--r--macros/latex/base/ltnews30.pdfbin491246 -> 491245 bytes
-rw-r--r--macros/latex/base/ltnews31.pdfbin500919 -> 500928 bytes
-rw-r--r--macros/latex/base/ltnews32.pdfbin520923 -> 520917 bytes
-rw-r--r--macros/latex/base/ltshipout-code.pdfbin750748 -> 750800 bytes
-rw-r--r--macros/latex/base/ltshipout-doc.pdfbin503965 -> 504019 bytes
-rw-r--r--macros/latex/base/ltvers.dtx2
-rw-r--r--macros/latex/base/ltx3info.pdfbin191527 -> 191531 bytes
-rw-r--r--macros/latex/base/ltxdoc.pdfbin215102 -> 215098 bytes
-rw-r--r--macros/latex/base/makeindx.pdfbin160667 -> 160668 bytes
-rw-r--r--macros/latex/base/manifest.txt1
-rw-r--r--macros/latex/base/manual.pdfbin151347 -> 151352 bytes
-rw-r--r--macros/latex/base/modguide.pdfbin220388 -> 220389 bytes
-rw-r--r--macros/latex/base/nfssfont.pdfbin202451 -> 202447 bytes
-rw-r--r--macros/latex/base/proc.pdfbin216877 -> 216876 bytes
-rw-r--r--macros/latex/base/slides.pdfbin351586 -> 351590 bytes
-rw-r--r--macros/latex/base/slifonts.pdfbin214710 -> 214706 bytes
-rw-r--r--macros/latex/base/source2e.pdfbin4357396 -> 4360837 bytes
-rw-r--r--macros/latex/base/syntonly.pdfbin181787 -> 181862 bytes
-rw-r--r--macros/latex/base/tlc2.pdfbin164947 -> 164952 bytes
-rw-r--r--macros/latex/base/tulm.pdfbin156546 -> 156546 bytes
-rw-r--r--macros/latex/base/usrguide.pdfbin399035 -> 399074 bytes
-rw-r--r--macros/latex/base/usrguide3.pdfbin0 -> 181816 bytes
-rw-r--r--macros/latex/base/usrguide3.tex701
-rw-r--r--macros/latex/base/utf8ienc.pdfbin331074 -> 331005 bytes
-rw-r--r--macros/latex/base/webcomp.pdfbin136159 -> 136162 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin433072 -> 425830 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex127
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx577
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.ins4
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin1080998 -> 1078565 bytes
92 files changed, 1291 insertions, 444 deletions
diff --git a/macros/latex/base/README.md b/macros/latex/base/README.md
index 7c6328be6d..f9394d0f3b 100644
--- a/macros/latex/base/README.md
+++ b/macros/latex/base/README.md
@@ -1,7 +1,7 @@
The LaTeX kernel
================
-Release 2020-10-01 patch level 3
+Release 2020-10-01 patch level 4
Overview
--------
diff --git a/macros/latex/base/alltt.pdf b/macros/latex/base/alltt.pdf
index 5cb6410fa1..d31e7c526b 100644
--- a/macros/latex/base/alltt.pdf
+++ b/macros/latex/base/alltt.pdf
Binary files differ
diff --git a/macros/latex/base/cfgguide.pdf b/macros/latex/base/cfgguide.pdf
index c0cb3f3c6f..c4a7ad4323 100644
--- a/macros/latex/base/cfgguide.pdf
+++ b/macros/latex/base/cfgguide.pdf
Binary files differ
diff --git a/macros/latex/base/changes.txt b/macros/latex/base/changes.txt
index cc8d59b61b..e86d28740d 100644
--- a/macros/latex/base/changes.txt
+++ b/macros/latex/base/changes.txt
@@ -1,4 +1,4 @@
-================================================================================
+================================================================================
This file lists changes to the LaTeX2e files in reverse chronological order of
publication (therefore the dates might be out of sequence if there are hotfixes).
It is provided for convenience only. It therefore makes no claims to
@@ -10,6 +10,33 @@ are not part of the distribution.
All changes above are only part of the development branch for the next release.
================================================================================
+
+#########################
+# 2020-10-01 PL 4 Release
+#########################
+
+2021-01-07 Phelype Oleinik <phelype.oleinik@latex-project.org>
+
+ * ltfilehook.dtx:
+ Undefine \@expl@@@filehook@file@pop@@ to avoid error when rolling back (gh/463).
+
+ * lthooks.dtx:
+ Modified internal copies of l3tl commands to avoid errors with l3debug (gh/463).
+
+2020-12-18 Phelype Oleinik <phelype.oleinik@latex-project.org>
+
+ * lthooks.dtx:
+ Preserve trailing slash in file hook name if the file name is empty (gh/464).
+
+ * ltfilehook.dtx:
+ Restore \CurrentFile(Path)(Used) after the file is input (gh/464).
+
+2020-12-03 Joseph Wright <Joseph.Wright@latex-project.org>
+
+ * usrguide3.tex
+ New file to cover creation of document commands
+
+
#########################
# 2020-10-01 PL 3 Release
#########################
diff --git a/macros/latex/base/classes.pdf b/macros/latex/base/classes.pdf
index 05b9379ef4..7158ffe5e8 100644
--- a/macros/latex/base/classes.pdf
+++ b/macros/latex/base/classes.pdf
Binary files differ
diff --git a/macros/latex/base/clsguide.pdf b/macros/latex/base/clsguide.pdf
index c5d32dda9f..39a99b0d26 100644
--- a/macros/latex/base/clsguide.pdf
+++ b/macros/latex/base/clsguide.pdf
Binary files differ
diff --git a/macros/latex/base/cmfonts.pdf b/macros/latex/base/cmfonts.pdf
index fe8f0083f6..18f18adb32 100644
--- a/macros/latex/base/cmfonts.pdf
+++ b/macros/latex/base/cmfonts.pdf
Binary files differ
diff --git a/macros/latex/base/cyrguide.pdf b/macros/latex/base/cyrguide.pdf
index 6fa40a338b..2ae5f0aae3 100644
--- a/macros/latex/base/cyrguide.pdf
+++ b/macros/latex/base/cyrguide.pdf
Binary files differ
diff --git a/macros/latex/base/doc.pdf b/macros/latex/base/doc.pdf
index 5feed95398..8815f83c0b 100644
--- a/macros/latex/base/doc.pdf
+++ b/macros/latex/base/doc.pdf
Binary files differ
diff --git a/macros/latex/base/docstrip.pdf b/macros/latex/base/docstrip.pdf
index 2e31d253a1..9688ffddef 100644
--- a/macros/latex/base/docstrip.pdf
+++ b/macros/latex/base/docstrip.pdf
Binary files differ
diff --git a/macros/latex/base/encguide.pdf b/macros/latex/base/encguide.pdf
index 249493684e..141c91cc81 100644
--- a/macros/latex/base/encguide.pdf
+++ b/macros/latex/base/encguide.pdf
Binary files differ
diff --git a/macros/latex/base/exscale.pdf b/macros/latex/base/exscale.pdf
index 339a4d161a..0ebbe07a05 100644
--- a/macros/latex/base/exscale.pdf
+++ b/macros/latex/base/exscale.pdf
Binary files differ
diff --git a/macros/latex/base/fix-cm.pdf b/macros/latex/base/fix-cm.pdf
index f39aca2525..d72171f772 100644
--- a/macros/latex/base/fix-cm.pdf
+++ b/macros/latex/base/fix-cm.pdf
Binary files differ
diff --git a/macros/latex/base/fntguide.pdf b/macros/latex/base/fntguide.pdf
index 97c8a844f7..5faab35979 100644
--- a/macros/latex/base/fntguide.pdf
+++ b/macros/latex/base/fntguide.pdf
Binary files differ
diff --git a/macros/latex/base/graphpap.pdf b/macros/latex/base/graphpap.pdf
index 8cad84bb4c..4bc57dc7db 100644
--- a/macros/latex/base/graphpap.pdf
+++ b/macros/latex/base/graphpap.pdf
Binary files differ
diff --git a/macros/latex/base/ifthen.pdf b/macros/latex/base/ifthen.pdf
index be2ea9f956..32e87c1326 100644
--- a/macros/latex/base/ifthen.pdf
+++ b/macros/latex/base/ifthen.pdf
Binary files differ
diff --git a/macros/latex/base/inputenc.pdf b/macros/latex/base/inputenc.pdf
index 4c06af39d5..857279fa41 100644
--- a/macros/latex/base/inputenc.pdf
+++ b/macros/latex/base/inputenc.pdf
Binary files differ
diff --git a/macros/latex/base/latexchanges.pdf b/macros/latex/base/latexchanges.pdf
index 97fcc3330b..3b20501afd 100644
--- a/macros/latex/base/latexchanges.pdf
+++ b/macros/latex/base/latexchanges.pdf
Binary files differ
diff --git a/macros/latex/base/latexchanges.tex b/macros/latex/base/latexchanges.tex
index dc8eb4be4e..a00ca99d4f 100644
--- a/macros/latex/base/latexchanges.tex
+++ b/macros/latex/base/latexchanges.tex
@@ -38,10 +38,10 @@
\title{Changes to the \LaTeXe{} format}
-\author{\copyright~Copyright 2015--2020, \LaTeX3 Project Team.\\
+\author{\copyright~Copyright 2015--2021, \LaTeX3 Project Team.\\
All rights reserved.}
-\date{2020-02-02}
+\date{2021-01-08}
% a few commands from doc
\newcommand\Lpack[1]{\mbox{\textsf{#1}}}
@@ -75,16 +75,15 @@
\url{https://tex.stackexchange.com/q/#1}}
\fi
-\begin{document}
-\maketitle
+\setcounter{tocdepth}{1} % don't show subsections
-\tableofcontents
-\newpage
+\begin{document}
-\section{Introduction}
+\maketitle
+\begin{abstract}
This document describes changes that were made to the
\LaTeX\ format since the 2014-05-01 \LaTeX\ releases.
@@ -99,13 +98,79 @@ As a summary of changes for a main release will always be available in
but changes in any patch releases will be listed in more
detail here.
-More detailed change logs are available as
+More detailed change logs are available as
\texttt{changes.txt} in the base distribution, and full code
differences may be browsed via the code repository on GitHub
see for example
\url{https://github.com/latex3/latex2e/commits/master}.
+\end{abstract}
+
+\tableofcontents
+
+\newpage
+
+%\section{Introduction}
+
+
+
+\section{Changes introduced in 2020-10-01 patch~4}
+
+This patch fixed two bugs in the hook management: if debugging for the
+L3 programming layer was turned on it reported inconsistent use of
+local/global variables. This was a spurious warning but nevertheless
+disconcerting (\ghissue{463}). The other bug was more serious, in some
+situations a wrong value of \verb=\CurrentFile= inside of file-related hooks
+could lead to errors (\ghissue{464}).
+
+We also added the documentation file \texttt{userguide3.pdf} which
+will become the main home for documenting new features of \LaTeX. At
+this point in time it covers the \Lpack{xparse} functionality that has
+been added to the kernel.
+
+\section{Changes introduced in 2020-10-01 patch~3}
+
+This patch fixed some rollback issues that prevented successful
+rollback to other release levels in some cases. It also fixed an issue
+with file hooks involving files with explicit paths (\ghissue{422}).
+
+One important change was to handle hook declarations done in the
+document preamble in a special way, e.g., those done with
+\verb=\AtBeginDocument=. They are now always executed last and are not
+subject to the normal code sorting for hooks, because they are nearly always
+needed to overwrite earlier settings made in packages.
+
+Finally, the NFSS series handling was slightly changed to
+automatically drop surplus ``\texttt{m}''s from series specifications
+when needed (and warn about them when encountered), e.g.,
+``\texttt{mc}'' automatically becomes ``\texttt{c}'' which is the
+official NFSS name for a \emph{medium compact} series (\ghissue{453}).
+This was done to improve the fix in 2020-02-02 PL~5.
+
+\section{Changes introduced in 2020-10-01 patch~2}
+
+This patch fixed the passing of options to packages and classes when
+they are stored in a special place (denoted by \verb=\input@path=)
+instead of their normal location (\ghissue{414}). In that case the
+options got lost.
+
+\section{Changes introduced in 2020-10-01 patch~1}
+
+This patch fixed a file handling issue: to allow for spaces in file
+names quotes were used but this upsets Bib\TeX{} (\ghissue{400}). In
+addition, two rollback issues got corrected.
+
+\section{Changes introduced in 2020-10-01}
+Major enhancements in this release include pre-loading of the
+\Lpack{xparse} package for producing document-level commands with more
+complicated argument signatures and the new hook management system for
+\LaTeX{} documented in \texttt{lthooks-doc.pdf},
+\texttt{ltfilehook-doc.pdf} and \texttt{ltshipout-doc.pdf}.
+In addition there have been many smaller fixes and enhancements.
+Please see \ltnewsissue{32} for an overview of the new features and
+the change log in \texttt{changes.txt} for a more detailed list of
+individual changes.
\section{Changes introduced in 2020-02-02 patch~5}
@@ -167,7 +232,7 @@ Major enhancements in this release include pre-loading \Lpack{expl3}
to improve startup times, especially with Lua\TeX\ and Xe\TeX, and
extra features in the font selection mechanism. Please see
\ltnewsissue{31} for an overview of the new features and the change
-log in \texttt{changelog.txt} for a more detailed list of individual
+log in \texttt{changes.txt} for a more detailed list of individual
changes.
@@ -248,7 +313,7 @@ counter prefix commands \verb|p@...| so that they would take the counter
value as an argument instead of just acting as a prefix to them. These
packages also provided the \verb|\labelformat| macro to change the prefix
macro and \verb|\Ref| so that using counters defined that way in the
-beginning of sentences would have the proper capitalisation. These features
+beginning of sentences would have the proper capitalization. These features
were added to the \LaTeXe{} kernel.
The kernel now says ``Trying to load\ldots''
@@ -283,7 +348,7 @@ provided as alias for the names based on the Adobe font names
The use of potrusion in tables of contents is suppressed by default,
see \sxquestion{172785}.
-The handling of visible space in verbation was adjusted for
+The handling of visible space in verbatim was adjusted for
\ghissue{69} and \ghissue{70}.
Spaces are removed from the argument passed to BiBTeX, \ghissue{88}.
@@ -295,7 +360,7 @@ levels of split hyperlinks, avoiding a fatal pdftex error. \ghissue{94}.
\section{Changes introduced in 2018-04-01 patch~5}
-Improved support for non ASCII filenames on the commandline on
+Improved support for non ASCII filenames on the command line on
filesystems using legacy encodings.
Adjusted the new package rollback code so that some edge cases where rollback
@@ -344,11 +409,11 @@ Lua\TeX, now at 1.04.
Previously defining an encoding-specific composite with an undeclared
accent (or an accent declared later) gave no error, but did nothing useful.
-\LaTeX\ will now detect this and give the accent comamnd a default definition
+\LaTeX\ will now detect this and give the accent command a default definition
as an error, allowing the declared composite to work as intended.
The definition of \verb|\-| is adjusted to match the comments in
-\gnatsissue{3855} to accomodate non standard settings of \verb|\hyphenchar|.
+\gnatsissue{3855} to accommodate non standard settings of \verb|\hyphenchar|.
In parboxes and similar settings, \verb|\lineskiplimit| is now
reset (to the existing default value, \verb|\normallineskiplimit|).
@@ -409,7 +474,7 @@ Load Unicode data from new generic \texttt{unicode-data} distribution.
\section{Changes introduced in 2015/10/01 patch~2}
-This release fixes the behaviour of the allocation mechanism if the switch
+This release fixes the behavior of the allocation mechanism if the switch
from the standard to extended pool takes place within a group.
\section{Changes introduced in 2015/10/01 patch~1}
@@ -444,7 +509,7 @@ The command |\textcommabelow| has been added. This is mainly intended for Romani
\textcommabelow{S}\,\textcommabelow{s}\,\textcommabelow{T}\,\textcommabelow{t}.
\subsection{Unicode 8}
-The file |unicode-letters.def| used to initialise character data in
+The file |unicode-letters.def| used to initialize character data in
Unicode \TeX\ variants has been regenerated from data files updated
to Unicode~8.
diff --git a/macros/latex/base/latexrelease.pdf b/macros/latex/base/latexrelease.pdf
index d619076782..313eb94505 100644
--- a/macros/latex/base/latexrelease.pdf
+++ b/macros/latex/base/latexrelease.pdf
Binary files differ
diff --git a/macros/latex/base/latexsym.pdf b/macros/latex/base/latexsym.pdf
index 436ea23f3a..1ad33cec9d 100644
--- a/macros/latex/base/latexsym.pdf
+++ b/macros/latex/base/latexsym.pdf
Binary files differ
diff --git a/macros/latex/base/lb2.pdf b/macros/latex/base/lb2.pdf
index 7d989cb0a0..89e748bed0 100644
--- a/macros/latex/base/lb2.pdf
+++ b/macros/latex/base/lb2.pdf
Binary files differ
diff --git a/macros/latex/base/letter.pdf b/macros/latex/base/letter.pdf
index 104f1157e2..f229f68d3b 100644
--- a/macros/latex/base/letter.pdf
+++ b/macros/latex/base/letter.pdf
Binary files differ
diff --git a/macros/latex/base/lgc2.pdf b/macros/latex/base/lgc2.pdf
index f900bfefb3..d6032fe6a0 100644
--- a/macros/latex/base/lgc2.pdf
+++ b/macros/latex/base/lgc2.pdf
Binary files differ
diff --git a/macros/latex/base/lppl.pdf b/macros/latex/base/lppl.pdf
index 20a630928c..58364d502b 100644
--- a/macros/latex/base/lppl.pdf
+++ b/macros/latex/base/lppl.pdf
Binary files differ
diff --git a/macros/latex/base/ltfilehook-code.pdf b/macros/latex/base/ltfilehook-code.pdf
index fcbf09fe98..b31a72bc78 100644
--- a/macros/latex/base/ltfilehook-code.pdf
+++ b/macros/latex/base/ltfilehook-code.pdf
Binary files differ
diff --git a/macros/latex/base/ltfilehook-doc.pdf b/macros/latex/base/ltfilehook-doc.pdf
index bf7f37f22b..5fd86946d1 100644
--- a/macros/latex/base/ltfilehook-doc.pdf
+++ b/macros/latex/base/ltfilehook-doc.pdf
Binary files differ
diff --git a/macros/latex/base/ltfilehook.dtx b/macros/latex/base/ltfilehook.dtx
index c7ed13f041..b4f716748a 100644
--- a/macros/latex/base/ltfilehook.dtx
+++ b/macros/latex/base/ltfilehook.dtx
@@ -31,8 +31,8 @@
%%% From File: ltfilehook.dtx
%
% \begin{macrocode}
-\providecommand\ltfilehookversion{v1.0d}
-\providecommand\ltfilehookdate{2020/11/24}
+\providecommand\ltfilehookversion{v1.0e}
+\providecommand\ltfilehookdate{2021/01/07}
% \end{macrocode}
%
%<*driver>
@@ -514,7 +514,6 @@
% \begin{macro}{
% \@@_file_parse_full_name:nN,
% \@@_full_name:nn,
-% \@@_set_curr_file_assign:nnnNN
% }
% A utility macro to trigger \pkg{expl3}'s file-parsing and lookup,
% and return a normalized representation of the file name. If the
@@ -711,14 +710,33 @@
%<latexrelease> {\InputIfFileExists}{Hook management (files)}%
%<*2ekernel|latexrelease>
% \end{macrocode}
-%
+%
% \begin{macrocode}
\let\InputIfFileExists\@undefined
\DeclareRobustCommand \InputIfFileExists[2]{%
\IfFileExists{#1}%
{%
- \@expl@@@filehook@file@push@@
- \@filehook@set@CurrentFile
+ \@expl@@@filehook@file@push@@
+ \@filehook@set@CurrentFile
+% \end{macrocode}
+% We pre-expand \cs{@filef@und} so that in case another file is
+% loaded in the true branch of \cs{InputIfFileExists}, these don't
+% change their value meanwhile. This isn't a worry with
+% \cs[no-index]{CurrentFile...} because they are kept in a stack.
+%
+% \changes{v1.0d}{2020/11/20}
+% {Move loading to \cs{@input@file@exists@with@hooks} and expand
+% \cs{@filef@und} to avoid getting the wrong file name in the case of
+% a substitution.}
+% \begin{macrocode}
+ \expandafter\@swaptwoargs\expandafter
+ {\expandafter\@input@file@exists@with@hooks
+ \expandafter{\@filef@und}}%
+ {#2}%
+ \@expl@@@filehook@file@pop@@
+ }%
+}
+\def\@input@file@exists@with@hooks#1{%
% \end{macrocode}
% If the file exists then \cs{CurrentFile} holds its name. But we
% can't rely on that still being true after the file has been
@@ -740,32 +758,16 @@
% the file name and extension are returned so that file hooks can
% refer to the file by their name only. The path to the file is
% returned in \cs{CurrentFilePath}.
+% \changes{v1.0e}{2021/01/07}{Restore \cs[no-index]{CurrentFile(Path)(Used)}
+% after the input (gh/464)}
% \begin{macrocode}
- \edef\reserved@a{%
- \@expl@@@filehook@file@pop@assign@@nnnn
- {\CurrentFilePathUsed}%
- {\CurrentFileUsed}%
- {\CurrentFilePath}%
- {\CurrentFile}%
-% \end{macrocode}
-%
-% We pre-expand \cs{@filef@und} so that in case another file is
-% loaded in the true branch of \cs{InputIfFileExists}, these don't
-% change their value meanwhile. This isn't a worry with
-% \cs[no-index]{CurrentFile...} because they are kept in a stack.
-%
-% \changes{v1.0d}{2020/11/20}
-% {Move loading to \cs{@input@file@exists@with@hooks} and expand
-% \cs{@filef@und} to avoid getting the wrong file name in the case of
-% a substitution.}
-% \begin{macrocode}
- \noexpand\@input@file@exists@with@hooks{\@filef@und}}%
- \expandafter\@swaptwoargs\expandafter
- {\reserved@a}%
- {#2}%
- \@expl@@@filehook@file@pop@@
- }%
-}
+ \edef\reserved@a{%
+ \@expl@@@filehook@file@pop@assign@@nnnn
+ {\CurrentFilePathUsed}%
+ {\CurrentFileUsed}%
+ {\CurrentFilePath}%
+ {\CurrentFile}}%
+ \expandafter\@swaptwoargs\expandafter{\reserved@a}%
% \end{macrocode}
%
% Before adding to the file list we need to make all (letter) characters
@@ -787,18 +789,19 @@
% approach (grepping the packages in \TeX{} Live didn't bring up any
% obvious candidate for breaking with this catcode change).
% \begin{macrocode}
-\def\@input@file@exists@with@hooks#1{%
- \edef\reserved@a{\unqu@tefilef@und#1\@nil}%
- \@addtofilelist{\string@makeletter\reserved@a}%
- \UseHook{file/before}%
+ {\edef\reserved@a{\unqu@tefilef@und#1\@nil}%
+ \@addtofilelist{\string@makeletter\reserved@a}%
+ \UseHook{file/before}%
% \end{macrocode}
% The current file name is available in \cs{CurrentFile} so we use
% that in the specific hook.
% \begin{macrocode}
- \UseHook{file/before/\CurrentFile}%
- \@@input #1% <- trailing space comes from \@filef@und
+ \UseHook{file/before/\CurrentFile}%
+ \@@input #1% <- trailing space comes from \@filef@und
+ }%
% \end{macrocode}
-% And it is restored here so we can use it once more.
+% And here, \cs{CurrentFile} is restored
+% (by \cs{@expl@@@filehook@file@pop@assign@@nnnn}) so we can use it once more.
% \begin{macrocode}
\UseHook{file/after/\CurrentFile}%
\UseHook{file/after}}
@@ -1488,10 +1491,22 @@
% \begin{macrocode}
\ExplSyntaxOff
% \end{macrocode}
-%
+%
+% This one specifically has to be undefined because it is left over in
+% the input stream from \cs{InputIfFileExists} and executed when
+% \pkg{latexrelease} is loaded. It cannot be \cs{let} to \cs{@undefined}
+% otherwise it would error as well, so it is \cs{let} to \cs{relax} to
+% be silently ignored when loading \cs{latexrelease}.
+% \changes{v1.0e}{2021/01/07}{Added rollback for this case to avoid
+% spurious errors (part of gh/463)}
% \begin{macrocode}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
+%<latexrelease>
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\@expl@@@filehook@if@no@extension@@nTF}{2e tmp interfaces}%
+%<latexrelease>\let\@expl@@@filehook@file@pop@@\relax
+%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
%
diff --git a/macros/latex/base/lthooks-code.pdf b/macros/latex/base/lthooks-code.pdf
index 5bb5d7899f..b209ada543 100644
--- a/macros/latex/base/lthooks-code.pdf
+++ b/macros/latex/base/lthooks-code.pdf
Binary files differ
diff --git a/macros/latex/base/lthooks-doc.pdf b/macros/latex/base/lthooks-doc.pdf
index 1ca6ef3a6d..b72a3e2b2f 100644
--- a/macros/latex/base/lthooks-doc.pdf
+++ b/macros/latex/base/lthooks-doc.pdf
Binary files differ
diff --git a/macros/latex/base/lthooks.dtx b/macros/latex/base/lthooks.dtx
index cc79892ca7..0a04c38efb 100644
--- a/macros/latex/base/lthooks.dtx
+++ b/macros/latex/base/lthooks.dtx
@@ -31,8 +31,8 @@
%%% From File: lthooks.dtx
%
% \begin{macrocode}
-\def\lthooksversion{v1.0g}
-\def\lthooksdate{2020/12/18}
+\def\lthooksversion{v1.0h}
+\def\lthooksdate{2021/01/07}
% \end{macrocode}
%
%<*driver>
@@ -1873,35 +1873,80 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_tl_set:Nn,\@@_tl_set:cn,\@@_tl_set:cx}
-% \begin{macro}{\@@_tl_gset:Nn,\@@_tl_gset:cn,\@@_tl_gset:co,\@@_tl_gset:cx}
-% \begin{macro}{\@@_tl_gput_right:Nn,\@@_tl_gput_right:No,\@@_tl_gput_right:cn}
-% \begin{macro}{\@@_tl_gput_left:Nn,\@@_tl_gput_left:No}
-% \begin{macro}{\@@_tl_gclear:N,\@@_tl_gclear:c}
-% \begin{macro}{\@@_tl_gset_eq:NN}
+% \begin{macro}{\@@_tl_set:Nn,\@@_tl_set:Nx,
+% \@@_tl_set:cn,\@@_tl_set:cx}
% Private copies of a few \pkg{expl3} functions. \pkg{l3debug} will
% only add debugging to the public names, not to these copies, so we
% don't have to use \cs{debug_suspend:} and \cs{debug_resume:}
% everywhere.
+%
+% Functions like \cs{@@_tl_set:Nn} have to be redefined, rather than
+% copied because in \pkg{expl3} they use
+% \cs[no-index]{__kernel_tl_(g)set:Nx}, which is also patched by
+% \pkg{l3debug}.
+% \changes{v1.0h}{2021/01/07}{Manually define some \pkg{l3tl} commands
+% to work around \pkg{expl3} changes}
% \begin{macrocode}
-\cs_new_eq:NN \@@_tl_set:Nn \tl_set:Nn
-\cs_generate_variant:Nn \@@_tl_set:Nn { cn, cx }
-\cs_new_eq:NN \@@_tl_gset:Nn \tl_gset:Nn
-\cs_generate_variant:Nn \@@_tl_gset:Nn { cn, co, cx }
-\cs_new_eq:NN \@@_tl_gput_right:Nn \tl_gput_right:Nn
-\cs_generate_variant:Nn \@@_tl_gput_right:Nn { No, cn }
-\cs_new_eq:NN \@@_tl_gput_left:Nn \tl_gput_left:Nn
-\cs_generate_variant:Nn \@@_tl_gput_left:Nn { No }
-\cs_new_protected:Npn \@@_tl_gclear:N #1
- { \@@_tl_gset_eq:NN #1 \c_empty_tl }
-\cs_generate_variant:Nn \@@_tl_gclear:N { c }
-\cs_new_eq:NN \@@_tl_gset_eq:NN \tl_gset_eq:NN
+\cs_new_protected:Npn \@@_tl_set:Nn #1#2
+ { \cs_set_nopar:Npx #1 { \__kernel_exp_not:w {#2} } }
+\cs_new_protected:Npn \@@_tl_set:Nx #1#2
+ { \cs_set_nopar:Npx #1 {#2} }
+\cs_generate_variant:Nn \@@_tl_set:Nn { c }
+\cs_generate_variant:Nn \@@_tl_set:Nx { c }
% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\@@_tl_gset:Nn,\@@_tl_gset:No,\@@_tl_gset:Nx,
+% \@@_tl_gset:cn,\@@_tl_gset:co,\@@_tl_gset:cx}
+% Same as above.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_tl_gset:Nn #1#2
+ { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w {#2} } }
+\cs_new_protected:Npn \@@_tl_gset:No #1#2
+ { \cs_gset_nopar:Npx #1 { \__kernel_exp_not:w \exp_after:wN {#2} } }
+\cs_new_protected:Npn \@@_tl_gset:Nx #1#2
+ { \cs_gset_nopar:Npx #1 {#2} }
+\cs_generate_variant:Nn \@@_tl_gset:Nn { c }
+\cs_generate_variant:Nn \@@_tl_gset:No { c }
+\cs_generate_variant:Nn \@@_tl_gset:Nx { c }
+% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\@@_tl_gput_right:Nn,\@@_tl_gput_right:No,\@@_tl_gput_right:cn}
+% Same as above.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_tl_gput_right:Nn #1#2
+ { \@@_tl_gset:Nx #1 { \__kernel_exp_not:w \exp_after:wN { #1 #2 } } }
+\cs_generate_variant:Nn \@@_tl_gput_right:Nn { No, cn }
+% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\@@_tl_gput_left:Nn,\@@_tl_gput_left:No}
+% Same as above.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_tl_gput_left:Nn #1#2
+ {
+ \@@_tl_gset:Nx #1
+ { \__kernel_exp_not:w {#2} \__kernel_exp_not:w \exp_after:wN {#1} }
+ }
+\cs_generate_variant:Nn \@@_tl_gput_left:Nn { No }
+% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\@@_tl_gset_eq:NN}
+% Same as above.
+% \begin{macrocode}
+\cs_new_eq:NN \@@_tl_gset_eq:NN \tl_gset_eq:NN
+% \end{macrocode}
% \end{macro}
+%
+% \begin{macro}{\@@_tl_gclear:N,\@@_tl_gclear:c}
+% Same as above.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_tl_gclear:N #1
+ { \@@_tl_gset_eq:NN #1 \c_empty_tl }
+\cs_generate_variant:Nn \@@_tl_gclear:N { c }
+% \end{macrocode}
% \end{macro}
%
%
@@ -2527,11 +2572,20 @@
{ \@@_strip_double_slash:n {#1} }
\cs_new:Npn \@@_strip_double_slash:n #1
{ \@@_strip_double_slash:w #1 // \s_@@_mark }
-\cs_new:Npn \@@_strip_double_slash:w #1 // #2 \s_@@_mark
+% \end{macrocode}
+% This function is always called after testing if the argument is a
+% file hook with \cs{@@_if_file_hook:wTF}, so we can assume it has
+% three parts (it is either \verb|file/before/...| or
+% \verb|file/after/...|), so we use \verb|#1/#2/#3 //| instead of just
+% \verb|#1 //| to prevent losing a slash if the file name is empty.
+% \changes{v1.0h}{2021/01/07}{Assume hook name has at least three
+% nonempty parts (gh/464)}
+% \begin{macrocode}
+\cs_new:Npn \@@_strip_double_slash:w #1/#2/#3 // #4 \s_@@_mark
{
- \tl_if_empty:nTF {#2}
- {#1}
- { \@@_strip_double_slash:w #1 / #2 \s_@@_mark }
+ \tl_if_empty:nTF {#4}
+ { #1/#2/#3 }
+ { \@@_strip_double_slash:w #1/#2/#3 / #4 \s_@@_mark }
}
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/base/ltluatex.pdf b/macros/latex/base/ltluatex.pdf
index 7e559ecf45..2cc8ddad3f 100644
--- a/macros/latex/base/ltluatex.pdf
+++ b/macros/latex/base/ltluatex.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews.pdf b/macros/latex/base/ltnews.pdf
index 7da22f913b..19f3de087e 100644
--- a/macros/latex/base/ltnews.pdf
+++ b/macros/latex/base/ltnews.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews01.pdf b/macros/latex/base/ltnews01.pdf
index 54c09ea91b..a595669dd5 100644
--- a/macros/latex/base/ltnews01.pdf
+++ b/macros/latex/base/ltnews01.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews02.pdf b/macros/latex/base/ltnews02.pdf
index cfbebec582..ce3cca5271 100644
--- a/macros/latex/base/ltnews02.pdf
+++ b/macros/latex/base/ltnews02.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews03.pdf b/macros/latex/base/ltnews03.pdf
index 83b8cba6a6..9f4b7fb62b 100644
--- a/macros/latex/base/ltnews03.pdf
+++ b/macros/latex/base/ltnews03.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews04.pdf b/macros/latex/base/ltnews04.pdf
index 82f78370d2..0491401886 100644
--- a/macros/latex/base/ltnews04.pdf
+++ b/macros/latex/base/ltnews04.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews05.pdf b/macros/latex/base/ltnews05.pdf
index a3a3ba2608..4006b29016 100644
--- a/macros/latex/base/ltnews05.pdf
+++ b/macros/latex/base/ltnews05.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews06.pdf b/macros/latex/base/ltnews06.pdf
index f08f189840..86bb0d89c1 100644
--- a/macros/latex/base/ltnews06.pdf
+++ b/macros/latex/base/ltnews06.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews07.pdf b/macros/latex/base/ltnews07.pdf
index c44afe8b77..a6c31f8701 100644
--- a/macros/latex/base/ltnews07.pdf
+++ b/macros/latex/base/ltnews07.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews08.pdf b/macros/latex/base/ltnews08.pdf
index 575c90644e..0645d3dc33 100644
--- a/macros/latex/base/ltnews08.pdf
+++ b/macros/latex/base/ltnews08.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews09.pdf b/macros/latex/base/ltnews09.pdf
index 938671e92b..1d17dca6e7 100644
--- a/macros/latex/base/ltnews09.pdf
+++ b/macros/latex/base/ltnews09.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews10.pdf b/macros/latex/base/ltnews10.pdf
index 1b065aff91..cccbbd2ff3 100644
--- a/macros/latex/base/ltnews10.pdf
+++ b/macros/latex/base/ltnews10.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews11.pdf b/macros/latex/base/ltnews11.pdf
index b5dbd3f722..3073a3a2d3 100644
--- a/macros/latex/base/ltnews11.pdf
+++ b/macros/latex/base/ltnews11.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews12.pdf b/macros/latex/base/ltnews12.pdf
index 103e8b18e3..f33b9fa2b2 100644
--- a/macros/latex/base/ltnews12.pdf
+++ b/macros/latex/base/ltnews12.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews13.pdf b/macros/latex/base/ltnews13.pdf
index 0041691329..0b8da8f1a3 100644
--- a/macros/latex/base/ltnews13.pdf
+++ b/macros/latex/base/ltnews13.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews14.pdf b/macros/latex/base/ltnews14.pdf
index 2bc925c555..0efc5c9b02 100644
--- a/macros/latex/base/ltnews14.pdf
+++ b/macros/latex/base/ltnews14.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews15.pdf b/macros/latex/base/ltnews15.pdf
index 820600a8df..fce7d7f09f 100644
--- a/macros/latex/base/ltnews15.pdf
+++ b/macros/latex/base/ltnews15.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews16.pdf b/macros/latex/base/ltnews16.pdf
index 3c4336dd45..9010892932 100644
--- a/macros/latex/base/ltnews16.pdf
+++ b/macros/latex/base/ltnews16.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews17.pdf b/macros/latex/base/ltnews17.pdf
index cecb7a07dc..463a597b99 100644
--- a/macros/latex/base/ltnews17.pdf
+++ b/macros/latex/base/ltnews17.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews18.pdf b/macros/latex/base/ltnews18.pdf
index 494f0fa0ec..59ed450aef 100644
--- a/macros/latex/base/ltnews18.pdf
+++ b/macros/latex/base/ltnews18.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews19.pdf b/macros/latex/base/ltnews19.pdf
index 2c4a3b518a..40360ea17c 100644
--- a/macros/latex/base/ltnews19.pdf
+++ b/macros/latex/base/ltnews19.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews20.pdf b/macros/latex/base/ltnews20.pdf
index b1e5c67560..d9b48b8a9e 100644
--- a/macros/latex/base/ltnews20.pdf
+++ b/macros/latex/base/ltnews20.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews21.pdf b/macros/latex/base/ltnews21.pdf
index eb0264792c..8212b9a06b 100644
--- a/macros/latex/base/ltnews21.pdf
+++ b/macros/latex/base/ltnews21.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews22.pdf b/macros/latex/base/ltnews22.pdf
index ddfb6d3d3a..4192e08538 100644
--- a/macros/latex/base/ltnews22.pdf
+++ b/macros/latex/base/ltnews22.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews23.pdf b/macros/latex/base/ltnews23.pdf
index a32e1efbb4..399e25e457 100644
--- a/macros/latex/base/ltnews23.pdf
+++ b/macros/latex/base/ltnews23.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews24.pdf b/macros/latex/base/ltnews24.pdf
index 6dc47bb3de..18b2406db7 100644
--- a/macros/latex/base/ltnews24.pdf
+++ b/macros/latex/base/ltnews24.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews25.pdf b/macros/latex/base/ltnews25.pdf
index 82908a28f2..1b9c0bec61 100644
--- a/macros/latex/base/ltnews25.pdf
+++ b/macros/latex/base/ltnews25.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews26.pdf b/macros/latex/base/ltnews26.pdf
index 604db55709..4be6545a43 100644
--- a/macros/latex/base/ltnews26.pdf
+++ b/macros/latex/base/ltnews26.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews27.pdf b/macros/latex/base/ltnews27.pdf
index 472ea7679f..eaa272fd12 100644
--- a/macros/latex/base/ltnews27.pdf
+++ b/macros/latex/base/ltnews27.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews28.pdf b/macros/latex/base/ltnews28.pdf
index 14ef2d02dd..f326e75b15 100644
--- a/macros/latex/base/ltnews28.pdf
+++ b/macros/latex/base/ltnews28.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews29.pdf b/macros/latex/base/ltnews29.pdf
index e8197be1b3..bfae9f4a80 100644
--- a/macros/latex/base/ltnews29.pdf
+++ b/macros/latex/base/ltnews29.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews30.pdf b/macros/latex/base/ltnews30.pdf
index 920d022e99..433d868639 100644
--- a/macros/latex/base/ltnews30.pdf
+++ b/macros/latex/base/ltnews30.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews31.pdf b/macros/latex/base/ltnews31.pdf
index 6a62e97123..7ef233d67f 100644
--- a/macros/latex/base/ltnews31.pdf
+++ b/macros/latex/base/ltnews31.pdf
Binary files differ
diff --git a/macros/latex/base/ltnews32.pdf b/macros/latex/base/ltnews32.pdf
index 93536d352a..22b3c72894 100644
--- a/macros/latex/base/ltnews32.pdf
+++ b/macros/latex/base/ltnews32.pdf
Binary files differ
diff --git a/macros/latex/base/ltshipout-code.pdf b/macros/latex/base/ltshipout-code.pdf
index f95e0ebf75..fe2cee9f3d 100644
--- a/macros/latex/base/ltshipout-code.pdf
+++ b/macros/latex/base/ltshipout-code.pdf
Binary files differ
diff --git a/macros/latex/base/ltshipout-doc.pdf b/macros/latex/base/ltshipout-doc.pdf
index 074774312a..d762ede0a7 100644
--- a/macros/latex/base/ltshipout-doc.pdf
+++ b/macros/latex/base/ltshipout-doc.pdf
Binary files differ
diff --git a/macros/latex/base/ltvers.dtx b/macros/latex/base/ltvers.dtx
index c2ec2ffde3..c42a126a31 100644
--- a/macros/latex/base/ltvers.dtx
+++ b/macros/latex/base/ltvers.dtx
@@ -115,7 +115,7 @@
{2020-10-01}
%</2ekernel|latexrelease>
%<*2ekernel>
-\def\patch@level{3}
+\def\patch@level{4}
% \end{macrocode}
%
% \begin{macro}{\development@branch@name}
diff --git a/macros/latex/base/ltx3info.pdf b/macros/latex/base/ltx3info.pdf
index 070c822a17..383b3ab3d4 100644
--- a/macros/latex/base/ltx3info.pdf
+++ b/macros/latex/base/ltx3info.pdf
Binary files differ
diff --git a/macros/latex/base/ltxdoc.pdf b/macros/latex/base/ltxdoc.pdf
index e5d6fb99cf..9af62b008f 100644
--- a/macros/latex/base/ltxdoc.pdf
+++ b/macros/latex/base/ltxdoc.pdf
Binary files differ
diff --git a/macros/latex/base/makeindx.pdf b/macros/latex/base/makeindx.pdf
index 7993372c01..c439845e4b 100644
--- a/macros/latex/base/makeindx.pdf
+++ b/macros/latex/base/makeindx.pdf
Binary files differ
diff --git a/macros/latex/base/manifest.txt b/macros/latex/base/manifest.txt
index f3c8f2b216..0cf27343c1 100644
--- a/macros/latex/base/manifest.txt
+++ b/macros/latex/base/manifest.txt
@@ -38,6 +38,7 @@
% fntguide.tex -- Guide to font selection.
% modguide.tex -- Guide to modifying and distributing LaTeX.
% usrguide.tex -- User guide for this release.
+% usrguide3.tex -- User guide for expl3-based methods.
%
% ltnews01.tex -- What was new in the release dated 1994/06.
% ltnews02.tex -- What was new in the release dated 1994/12.
diff --git a/macros/latex/base/manual.pdf b/macros/latex/base/manual.pdf
index 50811f5d4c..5c746a312a 100644
--- a/macros/latex/base/manual.pdf
+++ b/macros/latex/base/manual.pdf
Binary files differ
diff --git a/macros/latex/base/modguide.pdf b/macros/latex/base/modguide.pdf
index 5f51237557..59433901a4 100644
--- a/macros/latex/base/modguide.pdf
+++ b/macros/latex/base/modguide.pdf
Binary files differ
diff --git a/macros/latex/base/nfssfont.pdf b/macros/latex/base/nfssfont.pdf
index 8f189189d9..17492f3e6f 100644
--- a/macros/latex/base/nfssfont.pdf
+++ b/macros/latex/base/nfssfont.pdf
Binary files differ
diff --git a/macros/latex/base/proc.pdf b/macros/latex/base/proc.pdf
index 35ba9262e0..3b22d4c207 100644
--- a/macros/latex/base/proc.pdf
+++ b/macros/latex/base/proc.pdf
Binary files differ
diff --git a/macros/latex/base/slides.pdf b/macros/latex/base/slides.pdf
index b4d275289c..d2a5303726 100644
--- a/macros/latex/base/slides.pdf
+++ b/macros/latex/base/slides.pdf
Binary files differ
diff --git a/macros/latex/base/slifonts.pdf b/macros/latex/base/slifonts.pdf
index 39952e8a88..f1120069c5 100644
--- a/macros/latex/base/slifonts.pdf
+++ b/macros/latex/base/slifonts.pdf
Binary files differ
diff --git a/macros/latex/base/source2e.pdf b/macros/latex/base/source2e.pdf
index 106d83f723..2905a8efef 100644
--- a/macros/latex/base/source2e.pdf
+++ b/macros/latex/base/source2e.pdf
Binary files differ
diff --git a/macros/latex/base/syntonly.pdf b/macros/latex/base/syntonly.pdf
index 1493490c91..48bab0767e 100644
--- a/macros/latex/base/syntonly.pdf
+++ b/macros/latex/base/syntonly.pdf
Binary files differ
diff --git a/macros/latex/base/tlc2.pdf b/macros/latex/base/tlc2.pdf
index 0c08e372a3..4e56aaa3fc 100644
--- a/macros/latex/base/tlc2.pdf
+++ b/macros/latex/base/tlc2.pdf
Binary files differ
diff --git a/macros/latex/base/tulm.pdf b/macros/latex/base/tulm.pdf
index d480c33dff..b871d94918 100644
--- a/macros/latex/base/tulm.pdf
+++ b/macros/latex/base/tulm.pdf
Binary files differ
diff --git a/macros/latex/base/usrguide.pdf b/macros/latex/base/usrguide.pdf
index 51412a147a..02e37ae675 100644
--- a/macros/latex/base/usrguide.pdf
+++ b/macros/latex/base/usrguide.pdf
Binary files differ
diff --git a/macros/latex/base/usrguide3.pdf b/macros/latex/base/usrguide3.pdf
new file mode 100644
index 0000000000..b7063c2603
--- /dev/null
+++ b/macros/latex/base/usrguide3.pdf
Binary files differ
diff --git a/macros/latex/base/usrguide3.tex b/macros/latex/base/usrguide3.tex
new file mode 100644
index 0000000000..4c3bde94f6
--- /dev/null
+++ b/macros/latex/base/usrguide3.tex
@@ -0,0 +1,701 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2020
+% The LaTeX3 Project and any individual authors listed elsewhere
+% in this file.
+%
+% This file is part of the LaTeX base system.
+% -------------------------------------------
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008 or later.
+%
+% This file has the LPPL maintenance status "maintained".
+%
+% The list of all files belonging to the LaTeX base distribution is
+% given in the file `manifest.txt'. See also `legal.txt' for additional
+% information.
+%
+% The list of derived (unpacked) files belonging to the distribution
+% and covered by LPPL is defined by the unpacking scripts (with
+% extension .ins) which are part of the distribution.
+%
+% \fi
+% Filename: usrguide3.tex
+
+\documentclass{ltxguide}
+
+\usepackage[T1]{fontenc} % needed for \textbackslash in tt
+
+\title{\LaTeX3 methods for authors}
+\author{\copyright~Copyright 2020, \LaTeX\ Project Team.\\
+ All rights reserved.}
+
+\date{Released 2020-12-02}
+
+\NewDocumentCommand\cs{m}{\texttt{\textbackslash\detokenize{#1}}}
+\NewDocumentCommand\marg{m}{\arg{#1}}
+\NewDocumentCommand\meta{m}{\ensuremath{\langle}\textit{#1}\ensuremath{\rangle}}
+\NewDocumentCommand\pkg{m}{\textsf{#1}}
+\NewDocumentCommand\text{m}{\ifmmode\mbox{#1}\else#1\fi}
+% Fix a 'feature'
+\makeatletter
+\renewcommand \verbatim@font {\normalfont \ttfamily}
+\makeatother
+
+\begin{document}
+
+\maketitle
+
+\tableofcontents
+
+\section{Introduction}
+
+\LaTeXe{} was released in 1994 and added a number of then-new concepts to
+\LaTeX{}. These are described in \texttt{usrguide}, which has largely remained
+unchanged. Since then, the \LaTeX{} team have worked on a number of ideas,
+firstly a programming language for \LaTeX{} (\pkg{expl3}) and then a range of
+tools for document authors which build on that language. Here, we describe
+\emph{stable} and \emph{widely-usable} concepts that have resulted from that
+work. These `new' ideas have been transferred from development packages
+into the \LaTeXe{} kernel. As such, they are now available to \emph{all}
+\LaTeX{} users and have the \emph{same stability} as any other part of the
+kernel. The fact that `behind the scenes' they are built on \pkg{expl3}
+is useful for the development team, but is not directly important to users.
+
+\section{Creating document commands and environments}
+
+\subsection{Overview}
+
+Creating document commands and environments using the \LaTeX3 toolset is based
+around the idea that a common set of descriptions can be used to cover almost
+all argument types used in real documents. Thus parsing is reduced to a simple
+description of which arguments a command takes: this description provides the
+`glue' between the document syntax and the implementation of the
+command.
+
+First, we will describe the argument types, then move on to explain how these
+can be used to create both document commands and environments. Various more
+specialized features are then described, which allow an even richer application
+of a simple interface set up.
+
+The details here are intended to help users create document commands in
+general. More technical detail, suitable for \TeX{} programmers, is included
+in \texttt{interface3}.
+
+\subsection{Describing argument types}
+
+In order to allow each argument to be defined independently, the parser does
+not simply need to know the number of arguments for a function, but also the
+nature of each one. This is done by constructing an \emph{argument
+specification}, which defines the number of arguments, the type of each
+argument and any additional information needed for the parser to read the user
+input and properly pass it through to internal functions.
+
+The basic form of the argument specifier is a list of letters, where each
+letter defines a type of argument. As will be described below, some of the
+types need additional information, such as default values. The argument types
+can be divided into two, those which define arguments that are mandatory
+(potentially raising an error if not found) and those which define optional
+arguments. The mandatory types
+\begin{itemize}
+ \item[\texttt{m}] A standard mandatory argument, which can either be a single token
+ alone or multiple tokens surrounded by curly braces |{}|. Regardless of the
+ input, the argument will be passed to the internal code without the outer
+ braces. This is the type specifier for a normal \TeX{} argument.
+ \item[\texttt{r}] Given as \texttt{r}\meta{token1}\meta{token2}, this denotes a
+ `required' delimited argument, where the delimiters are
+ \meta{token1} and \meta{token2}. If the opening delimiter \meta{token1} is
+ missing, the default marker |-NoValue-| will be inserted after a suitable
+ error.
+ \item[\texttt{R}] Given as \texttt{R}\meta{token1}\meta{token2}\marg{default},
+ this is a `required' delimited argument as for~\texttt{r},
+ but it has a user-definable recovery \meta{default} instead of
+ |-NoValue-|.
+ \item[\texttt{v}] Reads an argument `verbatim', between the following
+ character and its next occurrence, in a way similar to the argument
+ of the \LaTeXe{} command \cs{verb}. Thus a \texttt{v}-type argument
+ is read between two identical characters, which cannot be any of |%|, |\|,
+ |#|, |{|, |}| or \verb*| |. The verbatim argument can also be enclosed
+ between braces, |{| and |}|. A command with a verbatim argument will
+ produce an error when it appears within an argument of another function.
+ \item[\texttt{b}] Only suitable in the argument specification of an
+ environment, it denotes the body of the environment, between
+ |\begin|\marg{environment} and |\end|\marg{environment}. See
+ Section~\ref{sec:cmd:body} for details.
+\end{itemize}
+The types which define optional arguments are:
+\begin{itemize}
+ \item[\texttt{o}] A standard \LaTeX{} optional argument, surrounded with square
+ brackets, which will supply the special |-NoValue-| marker if not given
+ (as described later).
+ \item[\texttt{d}] Given as \texttt{d}\meta{token1}\meta{token2}, an optional
+ argument which is delimited by \meta{token1} and \meta{token2}. As with
+ \texttt{o}, if no value is given the special marker |-NoValue-| is
+ returned.
+ \item[\texttt{O}] Given as \texttt{O}\marg{default}, is like \texttt{o}, but returns
+ \meta{default} if no value is given.
+ \item[\texttt{D}] Given as \texttt{D}\meta{token1}\meta{token2}\marg{default}, it is
+ as for \texttt{d}, but returns \meta{default} if no value is given.
+ Internally, the \texttt{o}, \texttt{d} and \texttt{O} types are
+ short-cuts to an appropriated-constructed \texttt{D} type argument.
+ \item[\texttt{s}] An optional star, which will result in a value
+ \cs{BooleanTrue} if a star is present and \cs{BooleanFalse}
+ otherwise (as described later).
+ \item[\texttt{t}] An optional \meta{token}, which will result in a value
+ \cs{BooleanTrue} if \meta{token} is present and \cs{BooleanFalse}
+ otherwise. Given as \texttt{t}\meta{token}.
+ \item[\texttt{e}] Given as \texttt{e}\marg{tokens}, a set of optional
+ \emph{embellishments}, each of which requires a \emph{value}.
+ If an embellishment is not present, |-NoValue-| is returned. Each
+ embellishment gives one argument, ordered as for the list of
+ \meta{tokens} in the argument specification. All \meta{tokens}
+ must be distinct.
+ \item[\texttt{E}] As for \texttt{e} but returns one or more \meta{defaults}
+ if values are not given: \texttt{E}\marg{tokens}\marg{defaults}. See
+ Section~\ref{sec:cmd:embellishment} for more details.
+\end{itemize}
+
+\subsection{Modifying argument descriptions}
+
+In addition to the argument \emph{types} discussed above, the argument
+description also gives special meaning to three other characters.
+
+First, \texttt{+} is used to make an argument long (to accept paragraph
+tokens). In contrast to \cs{newcommand}, this applies on an
+argument-by-argument basis. So modifying the example to `|s o o +m O{default}|'
+means that the mandatory argument is now \cs{long}, whereas the optional
+arguments are not.
+
+Secondly, \texttt{!} is used to control whether spaces are allowed before
+optional arguments. There are some subtleties to this, as \TeX{} itself
+has some restrictions on where spaces can be `detected': more detail
+is given in Section~\ref{sec:cmd:opt-space}.
+
+Finally, the character \texttt{>} is used to declare so-called
+`argument processors', which can be used to modify the contents of an
+argument before it is passed to the macro definition. The use of argument
+processors is a somewhat advanced topic, (or at least a less commonly used
+feature) and is covered in Section~\ref{sec:cmd:processors}.
+
+\subsection{Creating document commands and environments}
+
+\begin{decl}
+ |\NewDocumentCommand| \arg{cmd} \arg{arg spec} \arg{code} \\
+ |\RenewDocumentCommand| \arg{cmd} \arg{arg spec} \arg{code} \\
+ |\ProvideDocumentCommand| \arg{cmd} \arg{arg spec} \arg{code} \\
+ |\DeclareDocumentCommand| \arg{cmd} \arg{arg spec} \arg{code}
+\end{decl}
+This family of commands are used to create a \meta{cmd}. The argument
+specification for the function is given by \meta{arg spec}, and the command
+uses the \meta{code} with |#1|, |#2|, etc.\ replaced by the arguments found
+by the parser.
+
+An example:
+\begin{verbatim}
+ \NewDocumentCommand\chapter{s o m}
+ {%
+ \IfBooleanTF{#1}%
+ {\typesetstarchapter{#3}}%
+ {\typesetnormalchapter{#2}{#3}}%
+ }
+\end{verbatim}
+would be a way to define a \cs{chapter} command which would essentially behave
+like the current \LaTeXe{} command (except that it would accept an optional
+argument even when a \texttt{*} was parsed). The \cs{typesetnormalchapter}
+could test its first argument for being |-NoValue-| to see if an optional
+argument was present. (See Section~\ref{sec:cmd:special} for details of
+\cs{IfBooleanTF} and testing for |-NoValue-|.)
+
+The difference between the \cs{New...} \cs{Renew...}, \cs{Provide...}
+and \cs{Declare...} versions is the behavior if \meta{cmd} is already
+defined.
+\begin{itemize}
+ \item \cs{NewDocumentCommand} will issue an error if \meta{cmd}
+ has already been defined.
+ \item \cs{RenewDocumentCommand} will issue an error if \meta{cmd}
+ has not previously been defined.
+ \item \cs{ProvideDocumentCommand} creates a new definition for
+ \meta{function} only if one has not already been given.
+ \item \cs{DeclareDocumentCommand} will always create the new
+ definition, irrespective of any existing \meta{cmd} with the
+ same name. This should be used sparingly.
+\end{itemize}
+
+\begin{decl}
+ |\NewDocumentEnvironment| \arg{env} \arg{arg spec} \arg{beg-code} \arg{end-code} \\
+ |\RenewDocumentEnvironment| \arg{env} \arg{arg spec} \arg{beg-code} \arg{end-code} \\
+ |\ProvideDocumentEnvironment| \arg{env} \arg{arg spec} \arg{beg-code} \arg{end-code} \\
+ |\DeclareDocumentEnvironment| \arg{env} \arg{arg spec} \arg{beg-code} \arg{end-code}
+\end{decl}
+These commands work in the same way as \cs{NewDocumentCommand}, etc.\@, but
+create environments (\cs{begin}\arg{env} \ldots{}
+\cs{end}\arg{environment}). Both the \meta{beg-code} and \meta{end-code}
+may access the arguments as defined by \meta{arg spec}. The arguments will be
+given following \cs{begin}\arg{environment}.
+
+\subsection{Optional arguments}
+\label{sec:cmd:opt}
+
+In contrast to commands created using \LaTeXe{}'s \cs{newcommand}, optional
+arguments created using \cs{NewDocumentCommand} may safely be nested. Thus for
+example, following
+\begin{verbatim}
+\NewDocumentCommand\foo{om}{I grabbed `#1' and `#2'}
+\NewDocumentCommand\baz{o}{#1-#1}
+\end{verbatim}
+using the command as
+\begin{verbatim}
+\foo[\baz[stuff]]{more stuff}
+\end{verbatim}
+will print
+\begin{quote}
+I grabbed `stuff-stuff' and `more stuff'
+\end{quote}
+This is particularly useful when placing a command with an optional argument
+\emph{inside} the optional argument of a second command.
+
+When an optional argument is followed by a mandatory argument with the same
+delimiter, the parser issues a warning because the optional argument could not
+be omitted by the user, thus becoming in effect mandatory. This can apply to
+\texttt{o}, \texttt{d}, \texttt{O}, \texttt{D}, \texttt{s}, \texttt{t},
+\texttt{e}, and \texttt{E} type arguments followed by \texttt{r} or
+\texttt{R}-type required arguments.
+
+The default for \texttt{O}, \texttt{D} and \texttt{E} arguments can be
+the result of grabbing another argument. Thus for example
+\begin{verbatim}
+ \NewDocumentCommand\foo{O{#2} m}
+\end{verbatim}
+would use the mandatory argument as the default for the leading optional
+one.
+
+\subsection{Spacing and optional arguments}
+\label{sec:cmd:opt-space}
+
+\TeX{} will find the first argument after a function name irrespective of any
+intervening spaces. This is true for both mandatory and optional arguments. So
+|\foo[arg]| and \verb*|\foo [arg]| are equivalent. Spaces are also ignored when
+collecting arguments up to the last mandatory argument to be collected (as it
+must exist). So after
+\begin{verbatim}
+ \NewDocumentCommand\foo{m o m}{ ... }
+\end{verbatim}
+the user input |\foo{arg1}[arg2]{arg3}| and \verb*|\foo{arg1} [arg2] {arg3}|
+will both be parsed in the same way.
+
+The behavior of optional arguments \emph{after} any mandatory arguments is
+selectable. The standard settings will allow spaces here, and thus with
+\begin{verbatim}
+ \NewDocumentCommand\foobar{m o}{ ... }
+\end{verbatim}
+both |\foobar{arg1}[arg2]| and \verb*|\foobar{arg1} [arg2]| will find an
+optional argument. This can be changed by giving the modified |!| in the
+argument specification:
+\begin{verbatim}
+ \NewDocumentCommand\foobar{m !o}{ ... }
+\end{verbatim}
+where \verb*|\foobar{arg1} [arg2]| will not find an optional argument.
+
+There is one subtly here due to the difference in handling by \TeX{} of
+`control symbols', where the command name is made up of a single
+character, such as `\texttt{\textbackslash\textbackslash}'.
+Spaces are not ignored by \TeX{} here,
+and thus it is possible to require an optional argument directly follow such a
+command. The most common example is the use of \texttt{\textbackslash\textbackslash}
+in \pkg{amsmath} environments, which in the terms here would be defined as
+\begin{verbatim}
+ \NewDocumentCommand\\{!s !o}{ ... }
+\end{verbatim}
+
+\subsection{`Embellishments'}
+\label{sec:cmd:embellishment}
+
+The \texttt{E}-type argument allows one default value per test token. This is
+achieved by giving a list of defaults for each entry in the list, for example:
+\begin{verbatim}
+ E{^_}{{UP}{DOWN}}
+\end{verbatim}
+If the list of default values is \emph{shorter} than the list of test tokens,
+the special |-NoValue-| marker will be returned (as for the \texttt{e}-type
+argument). Thus for example
+\begin{verbatim}
+ E{^_}{{UP}}
+\end{verbatim}
+has default \texttt{UP} for the |^| test character, but will return the
+|-NoValue-| marker as a default for |_|. This allows mixing of explicit
+defaults with testing for missing values.
+
+
+\subsection{Testing special values}
+\label{sec:cmd:special}
+
+Optional arguments make use of dedicated variables to return information about
+the nature of the argument received.
+
+\begin{decl}
+ |\IfNoValueTF| \arg{arg} \arg{true code} \arg{false code} \\
+ |\IfNoValueT| \arg{arg} \arg{true code} \arg{false code} \\
+ |\IfNoValueF| \arg{arg} \arg{true code} \arg{false code}
+\end{decl}
+The \cs{IfNoValue(TF)} tests are used to check if \meta{argument} (|#1|,
+|#2|, \emph{etc.}) is the special |-NoValue-| marker For example
+\begin{verbatim}
+ \NewDocumentCommand\foo{o m}
+ {%
+ \IfNoValueTF {#1}%
+ {\DoSomethingJustWithMandatoryArgument{#2}}%
+ {\DoSomethingWithBothArguments{#1}{#2}}%
+ }
+\end{verbatim}
+will use a different internal function if the optional argument
+is given than if it is not present.
+
+Note that three tests are available, depending on which outcome
+branches are required: \cs{IfNoValueTF}, \cs{IfNoValueT} and
+\cs{IfNoValueF}.
+
+As the \cs{IfNoValue(TF)} tests are expandable, it is possible to
+test these values later, for example at the point of typesetting or
+in an expansion context.
+
+It is important to note that |-NoValue-| is constructed such that it
+will \emph{not} match the simple text input |-NoValue-|, i.e.~that
+\begin{verbatim}
+ \IfNoValueTF{-NoValue-}
+\end{verbatim}
+will be logically \texttt{false}.
+When two optional arguments follow each other (a syntax we typically
+discourage), it can make sense to allow users of the command to
+specify only the second argument by providing an empty first
+argument. Rather than testing separately for emptiness and for
+|-NoValue-| it is then best to use the argument type~|O| with an
+empty default value, and simply test for emptiness using the
+\pkg{expl3} conditional \cs{tl_if_blank:nTF} or its \pkg{etoolbox}
+analogue \cs{ifblank}.
+
+\begin{decl}
+ |\IfValueTF| \arg{arg} \arg{true code} \arg{false code} \\
+ |\IfValueT| \arg{arg} \arg{true code} \arg{false code} \\
+ |\IfValueF| \arg{arg} \arg{true code} \arg{false code}
+\end{decl}
+The reverse form of the \cs{IfNoValue(TF)} tests are also available
+as \cs{IfValue(TF)}. The context will determine which logical
+form makes the most sense for a given code scenario.
+
+\begin{decl}
+ |\BooleanFalse| \\
+ |\BooleanTrue|
+\end{decl}
+The \texttt{true} and \texttt{false} flags set when searching for
+an optional character (using \texttt{s} or \texttt{t\meta{char}}) have
+names which are accessible outside of code blocks.
+
+\begin{decl}
+ |\IfBooleanTF| \arg{arg} \arg{true code} \arg{false code} \\
+ |\IfBooleanT| \arg{arg} \arg{true code} \arg{false code} \\
+ |\IfBooleanF| \arg{arg} \arg{true code} \arg{false code}
+\end{decl}
+Used to test if \meta{argument} (|#1|, |#2|, \emph{etc.}) is
+\cs{BooleanTrue} or \cs{BooleanFalse}. For example
+\begin{verbatim}
+ \NewDocumentCommand\foo{sm}
+ {%
+ \IfBooleanTF {#1}%
+ {\DoSomethingWithStar{#2}}%
+ {\DoSomethingWithoutStar{#2}}%
+ }
+\end{verbatim}
+checks for a star as the first argument, then chooses the action to
+take based on this information.
+
+\subsection{Argument processors}
+\label{sec:cmd:processors}
+
+Argument processor are applied to an argument \emph{after} it has been grabbed
+by the underlying system but before it is passed to \meta{code}. An argument
+processor can therefore be used to regularize input at an early stage, allowing
+the internal functions to be completely independent of input form. Processors
+are applied to user input and to default values for optional arguments, but
+\emph{not} to the special |-NoValue-| marker.
+
+Each argument processor is specified by the syntax \texttt{>}\marg{processor}
+in the argument specification. Processors are applied from right to left, so
+that
+\begin{verbatim}
+ >{\ProcessorB} >{\ProcessorA} m
+\end{verbatim}
+would apply \cs{ProcessorA} followed by \cs{ProcessorB} to the tokens grabbed
+by the \texttt{m} argument.
+
+\begin{decl}
+ |\SplitArgument| \arg{number} \arg{token(s)}
+\end{decl}
+This processor splits the argument given at each occurrence of the
+\meta{tokens} up to a maximum of \meta{number} tokens (thus
+dividing the input into $\text{\meta{number}} + 1$ parts).
+An error is given if too many \meta{tokens} are present in the
+input. The processed input is placed inside
+$\text{\meta{number}} + 1$ sets of braces for further use.
+If there are fewer than \arg{number} of \arg{tokens} in the argument
+then |-NoValue-| markers are added at the end of the processed
+argument.
+\begin{verbatim}
+ \NewDocumentCommand \foo {>{\SplitArgument{2}{;}} m}
+ {\InternalFunctionOfThreeArguments#1}
+\end{verbatim}
+If only a single character \meta{token} is used for the split, any
+category code $13$ (active) character matching the \meta{token} will
+be replaced before the split takes place.
+Spaces are trimmed at each end of each item parsed.
+
+\begin{decl}
+ |\SplitList| \arg{token(s)}
+\end{decl}
+This processor splits the argument given at each occurrence of the
+\meta{token(s)} where the number of items is not fixed. Each item is
+then wrapped in braces within |#1|. The result is that the
+processed argument can be further processed using a mapping function
+(see below).
+\begin{verbatim}
+ \NewDocumentCommand \foo {>{\SplitList{;}} m}
+ {\MappingFunction#1}
+\end{verbatim}
+If only a single character \meta{token} is used for the split, any
+category code $13$ (active) character matching the \meta{token} will
+be replaced before the split takes place.
+Spaces are trimmed at each end of each item parsed.
+
+\begin{decl}
+ |\ProcessList| \arg{list} \arg{function}
+\end{decl}
+To support \cs{SplitList}, the function \cs{ProcessList} is available
+to apply a \meta{function} to every entry in a \meta{list}. The
+\meta{function} should absorb one argument: the list entry. For example
+\begin{verbatim}
+ \NewDocumentCommand \foo {>{\SplitList{;}} m}
+ {\ProcessList{#1}{\SomeDocumentCommand}}
+\end{verbatim}
+
+\begin{decl}
+ |\ReverseBoolean|
+\end{decl}
+This processor reverses the logic of \cs{BooleanTrue} and
+\cs{BooleanFalse}, so that the example from earlier would become
+\begin{verbatim}
+ \NewDocumentCommand\foo{>{\ReverseBoolean} s m}
+ {%
+ \IfBooleanTF#1%
+ {\DoSomethingWithoutStar{#2}}%
+ {\DoSomethingWithStar{#2}}%
+ }
+\end{verbatim}
+
+\begin{decl}
+ |\TrimSpaces|
+\end{decl}
+Removes any leading and trailing spaces (tokens with character code~$32$
+and category code~$10$) for the ends of the argument. Thus for example
+declaring a function
+\begin{verbatim}
+ \NewDocumentCommand\foo {>{\TrimSpaces} m}
+ {\showtokens{#1}}
+\end{verbatim}
+and using it in a document as
+\begin{flushleft}
+ \verb= =\verb*=\foo{ hello world }=
+\end{flushleft}
+will show `\verb*=hello world=' at the terminal, with the space at each
+end removed. \cs{TrimSpaces} will remove multiple spaces from the ends of
+the input in cases where these have been included such that the standard
+\TeX{} conversion of multiple spaces to a single space does not apply.
+
+\subsection{Body of an environment}
+\label{sec:cmd:body}
+
+While environments |\begin|\marg{environment}\ \dots{}\,|\end|\marg{environment}
+are typically used in cases where the code implementing the \meta{environment}
+does not need to access the contents of the environment (its `body'),
+it is sometimes useful to have the body as a standard argument.
+
+This is achieved by ending the argument specification with~\texttt{b}, which is
+a dedicated argument type for this situation. For instance
+\begin{verbatim}
+ \NewDocumentEnvironment{twice} {O{\ttfamily} +b}
+ {#2#1#2} {}
+\end{verbatim}
+\begin{verbatim}
+ \begin{twice}[\itshape]
+ Hello world!
+ \end{twice}
+\end{verbatim}
+typesets `Hello world!{\itshape Hello world!}'.
+
+The prefix |+| is used to allow multiple paragraphs in the environment's body.
+Argument processors can also be applied to \texttt{b}~arguments. By default,
+spaces are trimmed at both ends of the body: in the example there would
+otherwise be spaces coming from the ends the lines after |[\itshape]| and
+|world!|. Putting the prefix |!| before \texttt{b} suppresses space-trimming.
+
+When \texttt{b} is used in the argument specification, the last argument of the environment declaration (e.g., \cs{NewDocumentEnvironment}), which consists of an \meta{end code} to insert at
+|\end|\marg{environment}, is redundant since one can simply put that code at
+the end of the \meta{start code}. Nevertheless this (empty) \meta{end code}
+must be provided.
+
+Environments that use this feature can be nested.
+
+\subsection{Fully-expandable document commands}
+
+Document commands created using \cs{NewDocumentCommand}, etc.\@, are normally
+created so that they do not expand unexpectedly. This is done using engine
+features, so is more powerful than \LaTeXe{}'s \cs{protect} mechanism. There
+are \emph{very rare} occasion when it may be useful to create functions using a
+expansion-only grabber. This imposes a number of restrictions on the
+nature of the arguments accepted by a function, and the code it implements.
+This facility should only be used when \emph{absolutely necessary}.
+
+\begin{decl}
+ |\NewExpandableDocumentCommand| \arg{cmd} \arg{arg spec} \arg{code} \\
+ |\RenewExpandableDocumentCommand| \arg{cmd} \arg{arg spec} \arg{code} \\
+ |\ProvideExpandableDocumentCommand| \arg{cmd} \arg{arg spec} \arg{code} \\
+ |\DeclareExpandableDocumentCommand| \arg{cmd} \arg{arg spec} \arg{code}
+\end{decl}
+This family of commands is used to create a document-level \meta{function},
+which will grab its arguments in a fully-expandable manner. The
+argument specification for the function is given by \meta{arg spec},
+and the function will execute \meta{code}. In general, \meta{code} will
+also be fully expandable, although it is possible that this will
+not be the case (for example, a function for use in a table might
+expand so that \cs{omit} is the first non-expandable non-space token).
+
+Parsing arguments by pure expansion imposes a number of restrictions on
+both the type of arguments that can be read and the error checking
+available:
+\begin{itemize}
+ \item The last argument (if any are present) must be one of the
+ mandatory types \texttt{m}, \texttt{r} or \texttt{R}.
+ \item The `verbatim' argument type \texttt{v} is not available.
+ \item Argument processors (using \texttt{>}) are not available.
+ \item It is not possible to differentiate between, for example
+ |\foo[| and |\foo{[}|: in both cases the \texttt{[} will be
+ interpreted as the start of an optional argument. As a
+ result, checking for optional arguments is less robust than
+ in the standard version.
+\end{itemize}
+
+\subsection{Details about argument delimiters}
+
+In normal (non-expandable) commands, the delimited types look for the
+initial delimiter by peeking ahead (using \pkg{expl3}'s |\peek_...|
+functions) looking for the delimiter token. The token has to have the
+same meaning and `shape' of the token defined as delimiter.
+There are three possible cases of delimiters: character tokens, control
+sequence tokens, and active character tokens. For all practical purposes
+of this description, active character tokens will behave exactly as
+control sequence tokens.
+
+\subsubsection{Character tokens}
+
+A character token is characterized by its character code, and its meaning
+is the category code~(|\catcode|). When a command is defined, the meaning
+of the character token is fixed into the definition of the command and
+cannot change. A command will correctly see an argument delimiter if
+the open delimiter has the same character and category codes as at the
+time of the definition. For example in:
+\begin{verbatim}
+ \NewDocumentCommand { \foobar } { D<>{default} } {(#1)}
+\end{verbatim}
+\begin{verbatim}
+ \foobar <hello> \par
+ \char_set_catcode_letter:N <
+ \foobar <hello>
+\end{verbatim}
+the output would be:
+\begin{verbatim}
+ (hello)
+ (default)<hello>
+\end{verbatim}
+as the open-delimiter |<| changed in meaning between the two calls to
+|\foobar|, so the second one doesn't see the |<| as a valid delimiter.
+Commands assume that if a valid open-delimiter was found, a matching
+close-delimiter will also be there. If it is not (either by being
+omitted or by changing in meaning), a low-level \TeX{} error is raised
+and the command call is aborted.
+
+\subsubsection{Control sequence tokens}
+
+A control sequence (or control character) token is characterized by is
+its name, and its meaning is its definition.
+A token cannot have two different meanings at the same time.
+When a control sequence is defined as delimiter in a command,
+it will be detected as delimiter whenever the control sequence name
+is found in the document regardless of its current definition.
+For example in:
+\begin{verbatim}
+ \cs_set:Npn \x { abc }
+ \NewDocumentCommand { \foobar } { D\x\y{default} } {(#1)}
+ \foobar \x hello\y \par
+ \cs_set:Npn \x { def }
+ \foobar \x hello\y
+\end{verbatim}
+the output would be:
+\begin{verbatim}
+ (hello)
+ (hello)
+\end{verbatim}
+with both calls to the command seeing the delimiter |\x|.
+
+\subsection{Creating new argument processors}
+
+\begin{decl}
+ |\ProcessedArgument|
+\end{decl}
+Argument processors allow manipulation of a grabbed argument before it is
+passed to the underlying code. New processor implementations may be created
+as functions which take one trailing argument, and which leave their result in
+the \cs{ProcessedArgument} variable. For example, \cs{ReverseBoolean} is
+defined as
+\begin{verbatim}
+\ExplSyntaxOn
+ \cs_new_protected:Npn \ReverseBoolean #1
+ {
+ \bool_if:NTF #1
+ { \tl_set:Nn \ProcessedArgument { \c_false_bool } }
+ { \tl_set:Nn \ProcessedArgument { \c_true_bool } }
+ }
+\ExplSyntaxOff
+\end{verbatim}
+[As an aside: the code is written in \pkg{expl3}, so we don't have to
+ worry about spaces creeping into the definition.]
+
+\subsection{Access to the argument specification}
+
+The argument specifications for document commands and environments are
+available for examination and use.
+
+\begin{decl}
+ |\GetDocumentCommandArgSpec| \arg{function} \\
+ |\GetDocumentEnvironmentArgSpec| \arg{environment}
+\end{decl}
+These functions transfer the current argument specification for the
+requested \meta{function} or \meta{environment} into the token list
+variable \cs{ArgumentSpecification}. If the \meta{function} or
+\meta{environment} has no known argument specification then an error
+is issued. The assignment to \cs{ArgumentSpecification} is local to
+the current \TeX{} group.
+
+\begin{decl}
+ |\ShowDocumentCommandArgSpec| \arg{function} \\
+ |\ShowDocumentEnvironmentArgSpec| \arg{environment}
+\end{decl}
+These functions show the current argument specification for the
+requested \meta{function} or \meta{environment} at the terminal. If
+the \meta{function} or \meta{environment} has no known argument
+specification then an error is issued.
+
+\end{document}
diff --git a/macros/latex/base/utf8ienc.pdf b/macros/latex/base/utf8ienc.pdf
index 00da2138cd..6ff7254be8 100644
--- a/macros/latex/base/utf8ienc.pdf
+++ b/macros/latex/base/utf8ienc.pdf
Binary files differ
diff --git a/macros/latex/base/webcomp.pdf b/macros/latex/base/webcomp.pdf
index 1c36db0c61..1a1cca038f 100644
--- a/macros/latex/base/webcomp.pdf
+++ b/macros/latex/base/webcomp.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index c203937ba5..833a876d41 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 1e14babd29..ca8beb88fc 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -12,7 +12,6 @@
\usepackage{tikz}
\usetikzlibrary{fit,patterns}
-
\usepackage{enumitem}
\usepackage{siunitx}
\usepackage{verbatim}
@@ -236,8 +235,12 @@ $\begin{pmatrix}
En s'inspirant de l'extension \pkg{cellspace} qui traite de ce problème,
l'extension \pkg{nicematrix} propose deux clés |cell-space-top-limit| et
|cell-space-bottom-limit| qui sont similaires aux deux paramètres
-|\cellspacetoplimit| et |\cellspacebottomlimit| proposés par \pkg{cellspace}. La
-valeur initiale de ces paramètres est $0$~pt pour que les environnements de
+|\cellspacetoplimit| et |\cellspacebottomlimit| proposés par \pkg{cellspace}.
+
+\colorbox{yellow!50}{\textbf{Nouveau 5.9}}\enskip Il existe aussi une clé
+|cell-space-limits| pour régler simultanément les deux paramètres.
+
+La valeur initiale de ces paramètres est $0$~pt pour que les environnements de
\pkg{nicematrix} aient par défaut le même comportement que ceux de \pkg{array}
et de l'\pkg{amsmath} mais une valeur de $1$~pt serait un bon choix. On
conseille de régler leurs valeurs avec la commande
@@ -247,7 +250,7 @@ conseille de régler leurs valeurs avec la commande
\medskip
\begin{Verbatim}
-\NiceMatrixOptions{~emphase#cell-space-top-limit = 1pt,cell-space-bottom-limit = 1pt@}
+\NiceMatrixOptions{~emphase#cell-space-limits = 1pt@}
\end{Verbatim}
\begin{BVerbatim}[baseline=c,boxwidth=9cm]
@@ -257,10 +260,7 @@ $\begin{pNiceMatrix}
\end{pNiceMatrix}$
\end{BVerbatim}
\begin{scope}
-\NiceMatrixOptions{
- cell-space-top-limit = 1pt ,
- cell-space-bottom-limit = 1pt ,
-}
+\NiceMatrixOptions{ cell-space-limits = 1pt }
$\begin{pNiceMatrix}
\frac12 & -\frac12 \\
\frac13 & \frac14 \\
@@ -377,7 +377,7 @@ horizontal.
\smallskip
\begin{Verbatim}
-\NiceMatrixOptions{cell-space-top-limit=1pt,cell-space-bottom-limit=1pt}
+\NiceMatrixOptions{cell-space-limits=1pt}
\end{Verbatim}
\smallskip
@@ -391,7 +391,7 @@ $A=\begin{pNiceArray}{cc|cc}[baseline=line-3]
\end{pNiceArray}$
\end{BVerbatim}
\begin{scope}
-\NiceMatrixOptions{cell-space-top-limit=1pt,cell-space-bottom-limit=1pt}
+\NiceMatrixOptions{cell-space-limits=1pt}
\raisebox{-5mm}{$A=\begin{pNiceArray}{cc|cc}[baseline=line-3]
\dfrac1A & \dfrac1B & 0 & 0 \\
\dfrac1C & \dfrac1D & 0 & 0 \\
@@ -420,11 +420,11 @@ avec deux arguments.
\item Le premier argument est la taille de ce bloc avec la syntaxe $i$-$j$ où
$i$ est le nombre de rangées et $j$ le nombre de colonnes du bloc.
-\colorbox{yellow!30}{Nouveau 5.6}\enskip Si cet argument est laissé
-blanc, la valeur par défaut est |1-1|. Si le nombre de rangées n'est pas
-indiqué, le bloc s'étend jusqu'à la dernière rangée (idem pour les colonnes).
+Si cet argument est laissé blanc, la valeur par défaut est |1-1|. Si le nombre
+de rangées n'est pas indiqué, ou bien est égal à |*|, le bloc s'étend jusqu'à la
+dernière rangée (idem pour les colonnes).
-\item Le deuxième argument, est le contenu du bloc. On peut utiliser |\\| dans
+\item Le deuxième argument est le contenu du bloc. On peut utiliser |\\| dans
ce contenu pour avoir un contenu sur plusieurs lignes. Dans |{NiceTabular}|, le
contenu est composé en mode texte tandis que, dans les autres environnements, il
est composé en mode mathématique.
@@ -538,11 +538,11 @@ arum & iris & jacinthe & muguet
\end{center}
\medskip
-\colorbox{yellow!50}{\bfseries Nouveau 5.7}\enskip Comme on le voit sur cet
-exemple, on peut fixer la couleur de fond avec la clé |fill| et la couleur du
-cadre avec la clé |draw|\footnote{Si la clé |draw| est utilisée sans valeur,
-c'est la couleur par défaut des filets de tableaux qui est utilisée.}. On peut
-aussi fixer l'épaisseur du trait avec la clé |line-width|.
+\colorbox{yellow!30}{Nouveau 5.7}\enskip Comme on le voit sur cet exemple, on
+peut fixer la couleur de fond avec la clé |fill| et la couleur du cadre avec la
+clé |draw|\footnote{Si la clé |draw| est utilisée sans valeur, c'est la couleur
+ par défaut des filets de tableaux qui est utilisée.}. On peut aussi fixer
+l'épaisseur du trait avec la clé |line-width|.
@@ -597,10 +597,9 @@ Henri & 14 \\ \hline
\subsection{Les blocs mono-rangée}
-\colorbox{yellow!30}{Nouveau 5.6}\enskip Pour les blocs mono-rangée, la
-hauteur (\emph{height}) et la profondeur (\emph{depth}) naturelles sont prises en
-compte pour la hauteur et la largeur de la rangée en cours (comme le fait la
-commande standard |\multicolumn| de LaTeX).
+Pour les blocs mono-rangée, la hauteur (\emph{height}) et la profondeur
+(\emph{depth}) naturelles sont prises en compte pour la hauteur et la largeur de
+la rangée en cours (comme le fait la commande standard |\multicolumn| de LaTeX).
@@ -622,7 +621,7 @@ bloc sur plusieurs lignes.
la consigne générale donnée dans le préambule pour cette colonne.
\item On peut tracer un cadre autour du bloc avec la clé |draw| de la commande
-|\Block|.\footnote{Pour colorier le fond d'une case, il n'est pas besoin
+|\Block|.\footnote{Pour colorier le fond d'une case, il n'y a pas besoin
d'utiliser un bloc mono-case : on peut utiliser la commande |\cellcolor| si la
clé |colortbl-like| est utilisée : voir p.~\pageref{colortbl-like}.}
\end{itemize}
@@ -984,7 +983,7 @@ rectangles vides partant de la case située exactement dans le coin.
\bigskip
On peut passer en argument de |\hvlines-except-corners| une liste de coins à
-prendre en considération. Les coins étant désignés par |NW|, |SW|, |NE| et |SE|
+prendre en considération, les coins étant désignés par |NW|, |SW|, |NE| et |SE|
(\emph{north west}, \emph{south west}, \emph{north east} et \emph{south east}).
\medskip
@@ -1137,7 +1136,7 @@ SumatraPDF) donne de meilleurs résultats que Adobe Reader.
couleur. Ce phénomène se produit quand chaque case est coloriée avec sa
propre instruction |fill| (opérateur |fill| de PostScript noté |f| en PDF).
C'est le cas avec \pkg{colortbl} avec lequel chaque case est coloriée
-individuellement même si on utilise |\columncolor| ou |\rowcolor|.
+individuellement, même si on utilise |\columncolor| ou |\rowcolor|.
Concernant ce phénomène, Adobe Reader donne de meilleurs résultats que
MuPDF.
@@ -1195,9 +1194,6 @@ h & i & j \\ \hline
\end{NiceTabular}
\end{scope}
-\medskip
-Une commande |\cellcolor| ne produit qu'une instruction |fill| (codée |f|) dans
-le \textsc{pdf}.
\bigskip
\item La commande |\rectanglecolor| prend trois arguments obligatoires. Le
@@ -1266,9 +1262,6 @@ a_{10} & b_{10} & c_{10} \\
\end{NiceArray}$
\end{scope}
-\medskip
-Une commande |\rowcolor| ne produit qu'une instruction |fill| (codée |f|) dans
-le \textsc{pdf}.
\bigskip
@@ -1305,7 +1298,7 @@ la forme $i$|-|$j$.
\item \colorbox{yellow!50}{\textbf{Nouveau 5.8}}\enskip Avec la clé |restart|, chacun
des intervalles de rangées spécifié par le premier argument de |\rowcolors|
recommence avec la même couleur.\footnote{Autrement, la couleur d'une rangée ne
- dépend que de la partié de son number.}
+ dépend que de la partié de son numéro.}
\item Avec la clé |respect-blocks|, qui est de type booléen, les ``rangées''
@@ -1320,7 +1313,7 @@ tableau pour englober les blocs (créés par la commande |\Block|).
\begin{BVerbatim}[baseline=c,boxwidth=9cm]
\begin{NiceTabular}{clr}%
[hvlines,code-before = ~emphase#{\rowcolors{2}{blue!10}{}[cols=2-3,restart]}@]
-\Block{1-3}{Résultats} \\
+\Block{1-*}{Résultats} \\
\Block{2-1}{A}& Pierre & 12 \\
& Jacques & 8 \\
\Block{4-1}{B}& Stéphanie & 18 \\
@@ -1331,7 +1324,7 @@ tableau pour englober les blocs (créés par la commande |\Block|).
\end{BVerbatim}
\begin{NiceTabular}{clr}[hvlines,
code-before = {\rowcolors{2}{blue!10}{}[cols=2-3,restart]},baseline=2]
-\Block{1-3}{Résultats} \\
+\Block{1-*}{Résultats} \\
\Block{2-1}{A}& Pierre & 12 \\
& Jacques & 8 \\
\Block{4-1}{B}& Stéphanie & 18 \\
@@ -1505,52 +1498,6 @@ Dupont & Chantal & 15 janvier 1998 \\
\end{NiceTabular}
\end{center}
-\medskip
-\emph{Remarque}\par\nobreak
-
-Chacune de ces instructions |\cellcolor|, |\rowcolor| ou |\columncolor|
-(utilisée hors du |code-before|) produit une instruction |fill| (codée |f|) dans
-le \textsc{pdf} final. En cas de juxtaposition de rectangles de même couleur,
-une fine ligne blanche peut donc apparaître dans certains lecteurs de
-\textsc{pdf}\footnote{Par exemple SumatraPDF, qui utilise MuPDF de Artifex
- Software, ou PDF.js utilisé par Firefox.} (entre les
-deux premières colonnes dans l'exemple ci-dessus). Pour éviter cela, il convient
-d'utiliser les outils proposés dans le |code-before|. C'est ce que l'on fait
-dans le codage qui suit.
-
-
-\medskip
-\begin{Verbatim}
-\begin{NiceTabular}[colortbl-like]{ccc}%
- [code-before = ~emphase#\columncolor{blue!15}{1,2}@]
-\toprule
-\rowcolor{red!15}
-Nom & Prénom & Année de naissance \\
-\midrule
-Achard & Jacques & 5 juin 1962 \\
-Lefebvre & Mathilde & 23 mai 1988 \\
-Vanesse & Stéphanie & 30 octobre 1994 \\
-Dupont & Chantal & 15 janvier 1998 \\
-\bottomrule
-\end{NiceTabular}
-\end{Verbatim}
-
-
-\begin{center}
-\begin{NiceTabular}[colortbl-like]{ccc}%
- [code-before = \columncolor{blue!15}{1,2}]
-\toprule
-\rowcolor{red!15}
-Nom & Prénom & Année de naissance \\
-\midrule
-Achard & Jacques & 5 juin 1962 \\
-Lefebvre & Mathilde & 23 mai 1988 \\
-Vanesse & Stéphanie & 30 octobre 1994 \\
-Dupont & Chantal & 15 janvier 1998 \\
-\bottomrule
-\end{NiceTabular}
-\end{center}
-
\section{La largeur des colonnes}
@@ -2199,13 +2146,13 @@ mathématique avec |\scriptstyle|.
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
- & ~emphase#\Ddots^{n \text{ times}}@ & \\
+ & ~emphase#\Ddots^{n \text{ fois}}@ & \\
0 & & 1
\end{bNiceMatrix}$
\end{BVerbatim}
$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
- & \Ddots^{n \text{ times}} & \\
+ & \Ddots^{n \text{ fois}} & \\
0 & & 1
\end{bNiceMatrix}$
@@ -2380,13 +2327,9 @@ I & 0 & \Cdots &0 \\
\medskip
Pour améliorer la lisibilité du code, une syntaxe alternative est proposée : on
peut spécifier les instructions du |code-after| à la fin de l'environnement,
-après le mot-clé |\CodeAfter|\footnote{Dans certaines circonstances, on doit
- mettre |\omit \CodeAfter|, |\omit| étant un mot-clé de TeX qui annule le motif
- de la case courante.} (pour un exemple, voir page
-\pageref{exemple-CodeAfter}). \colorbox{yellow!30}{Nouveau 5.5}\enskip
-Avant la version 5.5, il fallait parfois mettre le mot-clé |\omit| devant
-|\CodeAfter| dans certaines circonstances. Depuis la version 5.5, on ne doit
-\emph{jamais} mettre |\omit|.
+après le mot-clé |\CodeAfter| (pour un exemple, voir page
+\pageref{exemple-CodeAfter}).
+
\section{Les notes dans les tableaux}
@@ -3055,9 +2998,7 @@ lignes en pointillés entre les cases du tableau.
\textbf{Attention} : Par défaut, aucun nœud n'est créé dans une case vide.
\smallskip
-\colorbox{yellow!30}{Nouveau 5.6}\enskip
-Néanmoins, on peut forcer la création d'un nœud avec la commande
-|\NotEmpty|.\footnote{Il faut toutefois remarquer qu'avec cette commande, la
+Néanmoins, on peut forcer la création d'un nœud avec la commande |\NotEmpty|.\footnote{Il faut toutefois remarquer qu'avec cette commande, la
case est considérée comme non vide, ce qui a des conséquences sur le tracé des
lignes pointillées (cf.~p.~\pageref{Cdots}).}
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 83f99f5cbd..c6f1a06f31 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{5.8}
-\def\myfiledate{2021/01/01}
+\def\myfileversion{5.9}
+\def\myfiledate{2021/01/08}
%
%
%<*batchfile>
@@ -279,17 +279,22 @@ version 2005/12/01 or later.
% Inspired by the package \pkg{cellspace} which deals with that problem, the
% package \pkg{nicematrix} provides two keys |cell-space-top-limit| and
% |cell-space-bottom-limit| similar to the parameters |\cellspacetoplimit| and
-% |\cellspacebottomlimit| of \pkg{cellspace}. The initial value of these
-% parameters is $0$~pt in order to have for the environments of \pkg{nicematrix}
-% the same behaviour as those of \pkg{array} and \pkg{amsmath}. However, a value
-% of $1$~pt would probably be a good choice and we suggest to set them with
-% |\NiceMatrixOptions|.\footnote{One should remark that these parameters apply
-% also to the columns of type |S| of \pkg{siunitx} whereas the package
-% \pkg{cellspace} is not able to act on such columns of type~|S|.}
+% |\cellspacebottomlimit| of \pkg{cellspace}.
+%
+% \colorbox{yellow!50}{\bfseries{New 5.9}}\enskip
+% There is also a key |cell-space-limits| to set both parameters at once.
+%
+% The initial value of these parameters is $0$~pt in order to have for the
+% environments of \pkg{nicematrix} the same behaviour as those of \pkg{array}
+% and \pkg{amsmath}. However, a value of $1$~pt would probably be a good choice
+% and we suggest to set them with |\NiceMatrixOptions|.\footnote{One should
+% remark that these parameters apply also to the columns of type |S| of
+% \pkg{siunitx} whereas the package \pkg{cellspace} is not able to act on such
+% columns of type~|S|.}
%
% \medskip
% \begin{Verbatim}
-% \NiceMatrixOptions{~emphase#cell-space-top-limit = 1pt,cell-space-bottom-limit = 1pt@}
+% \NiceMatrixOptions{~emphase#cell-space-limits = 1pt@}
% \end{Verbatim}
%
% \begin{BVerbatim}[baseline=c,boxwidth=9cm]
@@ -299,10 +304,7 @@ version 2005/12/01 or later.
% \end{pNiceMatrix}$
% \end{BVerbatim}
% \begin{scope}
-% \NiceMatrixOptions{
-% cell-space-top-limit = 1pt ,
-% cell-space-bottom-limit = 1pt ,
-% }
+% \NiceMatrixOptions{cell-space-limits = 1pt}
% $\begin{pNiceMatrix}
% \frac12 & -\frac12 \\
% \frac13 & \frac14 \\
@@ -419,7 +421,7 @@ version 2005/12/01 or later.
%
% \smallskip
% \begin{Verbatim}
-% \NiceMatrixOptions{cell-space-top-limit=1pt,cell-space-bottom-limit=1pt}
+% \NiceMatrixOptions{cell-space-limits=1pt}
% \end{Verbatim}
%
% \smallskip
@@ -433,7 +435,7 @@ version 2005/12/01 or later.
% \end{pNiceArray}$
% \end{BVerbatim}
% \begin{scope}
-% \NiceMatrixOptions{cell-space-top-limit=1pt,cell-space-bottom-limit=1pt}
+% \NiceMatrixOptions{cell-space-limits=1pt}
% \raisebox{-5mm}{$A=\begin{pNiceArray}{cc|cc}[baseline=line-3]
% \dfrac1A & \dfrac1B & 0 & 0 \\
% \dfrac1C & \dfrac1D & 0 & 0 \\
@@ -461,9 +463,9 @@ version 2005/12/01 or later.
% $i$\verb|-|$j$ where $i$ is the number of rows of the block and $j$ its number
% of columns.
%
-% \colorbox{yellow!30}{New 5.6}\enskip If this argument is empty, its
-% default value is |1-1|. If the number of rows is not specified, the block
-% extends until the last row (idem for the columns).
+% If this argument is empty, its default
+% value is |1-1|. If the number of rows is not specified, or equal to |*|, the
+% block extends until the last row (idem for the columns).
%
% \item The second argument is the content of the block. It's possible to use
% |\\| in that content to have a content on several lines. In |{NiceTabular}|
@@ -579,11 +581,11 @@ version 2005/12/01 or later.
% \end{NiceTabular}
% \end{center}
%
-% \colorbox{yellow!50}{\bfseries New 5.7}\enskip As we can see on this example,
-% it's possible to fill the block by using the key |fill| and to draw the frame
-% with the key |draw|\footnote{If the key |draw| is used without value, the
-% default color the rules of the tabulars is used}. It's also possible to change
-% the width (thickness) of that rules with the key |line-width|.
+% \colorbox{yellow!30}{New 5.7}\enskip As we can see on this example, it's
+% possible to fill the block by using the key |fill| and to draw the frame with
+% the key |draw|\footnote{If the key |draw| is used without value, the default
+% color the rules of the tabulars is used}. It's also possible to change the
+% width (thickness) of that rules with the key |line-width|.
%
% \subsection{The mono-column blocks}
%
@@ -636,9 +638,9 @@ version 2005/12/01 or later.
%
% \subsection{The mono-row blocks}
%
-% \colorbox{yellow!30}{New 5.6}\enskip For the mono-row blocks, the
-% natural height and depth are taken into account for the height and depth of
-% the current row (as does a standard |\multicolumn| of LaTeX).
+% For the mono-row blocks, the natural height and depth are taken into account
+% for the height and depth of the current row (as does a standard |\multicolumn|
+% of LaTeX).
%
% \subsection{The mono-cell blocks}
%
@@ -1205,10 +1207,6 @@ version 2005/12/01 or later.
% \end{NiceTabular}
% \end{scope}
%
-% \medskip
-% A command |\cellcolor| generates only one instruction |fill| (coded |f|) in the
-% resulting \textsc{pdf}.
-%
% \bigskip
% \item The command |\rectanglecolor| takes three mandatory arguments. The first
% is the color. The second is the upper-left cell of the rectangle and the third
@@ -1274,10 +1272,6 @@ version 2005/12/01 or later.
% \end{NiceArray}$
% \end{scope}
%
-% \medskip
-% A command |\rowcolor| generates only one instruction |fill| (coded |f|) in the
-% resulting \textsc{pdf}.
-%
%
% \bigskip
% \item The command |\columncolor| takes its name from the command
@@ -1323,7 +1317,7 @@ version 2005/12/01 or later.
% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
% \begin{NiceTabular}{clr}
% [hvlines,code-before = ~emphase#{\rowcolors{2}{blue!10}{}[cols=2-3,restart]}@]
-% \Block{1-3}{Results} \\
+% \Block{1-}{Results} \\
% John & 12 \\
% Stephen & 8 \\
% Sarah & 18 \\
@@ -1334,7 +1328,7 @@ version 2005/12/01 or later.
% \end{BVerbatim}
% \begin{NiceTabular}{clr}[hvlines,code-before =
% {\rowcolors{2}{blue!10}{}[cols=2-3,restart]},baseline=2]
-% \Block{1-3}{Results} \\
+% \Block{1-}{Results} \\
% \Block{2-1}{A}& John & 12 \\
% & Stephen & 8 \\
% \Block{4-1}{B}& Sarah & 18 \\
@@ -1503,47 +1497,6 @@ version 2005/12/01 or later.
% \end{NiceTabular}
% \end{center}
%
-% \medskip
-% Each instruction |\cellcolor|, |\rowcolor| or |\columncolor| will generate an
-% instruction |fill| (coded~|f|) in the resulting \textsc{pdf}. In cases of
-% juxtaposed colored rectangles, one may have a thin white color line in some
-% \textsc{pdf} viewers\footnote{For example SumatraPDF, which uses MuPDF
-% of Artifex Software, or PDF.js used by Firefox.} (between the
-% two first columns in the above example). In you want to avoid this problem,
-% you should use the tools in the |code-before|. That's what we do with the
-% following code.
-%
-%
-% \medskip
-% \begin{Verbatim}
-% \begin{NiceTabular}[colortbl-like]{ccc}%
-% [code-before = ~emphase#\columncolor{blue!15}{1,2}@]
-% \toprule
-% \rowcolor{red!15}
-% Last name & First name & Birth day \\
-% \midrule
-% Achard & Jacques & 5 juin 1962 \\
-% Lefebvre & Mathilde & 23 mai 1988 \\
-% Vanesse & Stephany & 30 octobre 1994 \\
-% Dupont & Chantal & 15 janvier 1998 \\
-% \bottomrule
-% \end{NiceTabular}
-% \end{Verbatim}
-%
-%
-% \begin{center}
-% \begin{NiceTabular}[colortbl-like]{ccc}[code-before = \columncolor{blue!15}{1,2}]
-% \toprule
-% \rowcolor{red!15}
-% Last name & First name & Birth day \\
-% \midrule
-% Achard & Jacques & 5 juin 1962 \\
-% Lefebvre & Mathilde & 23 mai 1988 \\
-% Vanesse & Stephany & 30 octobre 1994 \\
-% Dupont & Chantal & 15 janvier 1998 \\
-% \bottomrule
-% \end{NiceTabular}
-% \end{center}
%
% \section{The width of the columns}
% \label{width}
@@ -2353,9 +2306,7 @@ version 2005/12/01 or later.
% For the legibility of the code, an alternative syntax is provided: it's
% possible to give the instructions of the |\code-after| at the end of the
% environment, after the keyword |\CodeAfter| (for an example, cf.
-% p.~\pageref{example-CodeAfter}). \colorbox{yellow!30}{New 5.5}\enskip
-% Before the version 5.5, it was necessary, in some circonstancies, to put the
-% keyword |\omit| before |\CodeAfter|. Since version~5.5, one must never put~|\omit|.
+% p.~\pageref{example-CodeAfter}).
%
%
%
@@ -3016,7 +2967,6 @@ version 2005/12/01 or later.
% \textbf{Caution} : By default, no node is created in a empty cell.
%
% \smallskip
-% \colorbox{yellow!30}{New 5.6}\enskip
% However, it's possible to impose the creation of a node with the command |\NotEmpty|.
% \footnote{One should note that, with that command, the cell is considered as
% non-empty, which has consequencies for the continuous dotted lines (cf.
@@ -5797,7 +5747,7 @@ version 2005/12/01 or later.
% contain an integer (which represents the number of the row to which align the
% array).
% \begin{macrocode}
-\str_new:N \l_@@_baseline_tl
+\tl_new:N \l_@@_baseline_tl
\tl_set:Nn \l_@@_baseline_tl c
% \end{macrocode}
%
@@ -6005,6 +5955,12 @@ version 2005/12/01 or later.
cell-space-top-limit .value_required:n = true ,
cell-space-bottom-limit .dim_set:N = \l_@@_cell_space_bottom_limit_dim ,
cell-space-bottom-limit .value_required:n = true ,
+ cell-space-limits .code:n =
+ {
+ \dim_set:Nn \l_@@_cell_space_bottom_limit_dim { #1 }
+ \dim_set:Nn \l_@@_cell_space_top_limit_dim { #1 }
+ } ,
+ cell-spaces-limits .value_required:n = true ,
xdots .code:n = \keys_set:nn { NiceMatrix / xdots } { #1 } ,
max-delimiter-width .bool_set:N = \l_@@_max_delimiter_width_bool ,
light-syntax .bool_set:N = \l_@@_light_syntax_bool ,
@@ -7282,7 +7238,9 @@ version 2005/12/01 or later.
% by the user between instructions in the |code-before|.
% \begin{macrocode}
\bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
+ \seq_clear_new:N \l_@@_colors_seq
\l_@@_code_before_tl
+ \@@_actually_color:
\bool_if:NT \l_@@_NiceTabular_bool \c_math_toggle_token
\group_end:
}
@@ -8329,9 +8287,9 @@ version 2005/12/01 or later.
\tl_if_empty:nT { #1 } { \@@_fatal:n { empty~environment } }
\tl_map_inline:nn { #1 }
{
- \tl_if_eq:nnT { ##1 } { & }
+ \str_if_eq:nnT { ##1 } { & }
{ \@@_fatal:n { ampersand~in~light-syntax } }
- \tl_if_eq:nnT { ##1 } { \\ }
+ \str_if_eq:nnT { ##1 } { \\ }
{ \@@_fatal:n { double-backslash~in~light-syntax } }
}
% \end{macrocode}
@@ -10012,59 +9970,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_line:
{
- \pgfrememberpicturepositiononpagetrue
- \pgf@relevantforpicturesizefalse
- \tl_if_eq:NNTF \l_@@_xdots_line_style_tl \c_@@_standard_tl
- \@@_draw_standard_dotted_line:
- \@@_draw_non_standard_dotted_line:
- }
-% \end{macrocode}
-%
-% \medskip
-% We have to do a special construction with |\exp_args:NV| to be able to put in
-% the list of options in the correct place in the Tikz instruction.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_draw_non_standard_dotted_line:
- {
- \begin { scope }
- \exp_args:No \@@_draw_non_standard_dotted_line:n
- { \l_@@_xdots_line_style_tl , \l_@@_xdots_color_tl }
- }
-% \end{macrocode}
-% We have used the fact that, in \textsc{pgf}, un color name can be put directly
-% in a list of options (that's why we have put diredtly |\l_@@_xdots_color_tl|).
-%
-% \smallskip
-% The argument of |\@@_draw_non_standard_dotted_line:n| is, in fact, the list of options.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_draw_non_standard_dotted_line:n #1
- {
- \draw
- [
- #1 ,
- shorten~> = \l_@@_xdots_shorten_dim ,
- shorten~< = \l_@@_xdots_shorten_dim ,
- ]
- ( \l_@@_x_initial_dim , \l_@@_y_initial_dim )
- -- node [ sloped , above ]
- { \c_math_toggle_token \scriptstyle \l_@@_xdots_up_tl \c_math_toggle_token }
- node [ sloped , below ]
- {
- \c_math_toggle_token
- \scriptstyle \l_@@_xdots_down_tl
- \c_math_toggle_token
- }
- ( \l_@@_x_final_dim , \l_@@_y_final_dim ) ;
- \end { scope }
- }
-% \end{macrocode}
-%
-% \bigskip
-% The command |\@@_draw_standard_dotted_line:| draws the line with our system of points
-% (which give a dotted line with real round points).
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_draw_standard_dotted_line:
- {
% \end{macrocode}
% First, we put the labels.
% \begin{macrocode}
@@ -10114,6 +10019,50 @@ version 2005/12/01 or later.
}
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
+ \tl_if_eq:NNTF \l_@@_xdots_line_style_tl \c_@@_standard_tl
+ \@@_draw_standard_dotted_line:
+ \@@_draw_non_standard_dotted_line:
+ }
+% \end{macrocode}
+%
+% \medskip
+% We have to do a special construction with |\exp_args:NV| to be able to put in
+% the list of options in the correct place in the Tikz instruction.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_draw_non_standard_dotted_line:
+ {
+ \begin { scope }
+ \exp_args:No \@@_draw_non_standard_dotted_line:n
+ { \l_@@_xdots_line_style_tl , \l_@@_xdots_color_tl }
+ }
+% \end{macrocode}
+% We have used the fact that, in \textsc{pgf}, un color name can be put directly
+% in a list of options (that's why we have put diredtly |\l_@@_xdots_color_tl|).
+%
+% \smallskip
+% The argument of |\@@_draw_non_standard_dotted_line:n| is, in fact, the list of options.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_draw_non_standard_dotted_line:n #1
+ {
+ \draw
+ [
+ #1 ,
+ shorten~> = \l_@@_xdots_shorten_dim ,
+ shorten~< = \l_@@_xdots_shorten_dim ,
+ ]
+ ( \l_@@_x_initial_dim , \l_@@_y_initial_dim )
+ --
+ ( \l_@@_x_final_dim , \l_@@_y_final_dim ) ;
+ \end { scope }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% The command |\@@_draw_standard_dotted_line:| draws the line with our system of points
+% (which give a dotted line with real round points).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_draw_standard_dotted_line:
+ {
\group_begin:
% \end{macrocode}
% The dimension |\l_@@_l_dim| is the length $\ell$ of the line to draw. We use
@@ -10832,73 +10781,88 @@ version 2005/12/01 or later.
% \bigskip
% \subsection*{Colors of cells, rows and columns}
%
-% In the beginning of the |code-before|, the command |\@@_rowcolor:nn| will be
-% linked to |\rowcolor| and the command |\@@_columncolor:nn| to |\columncolor|.
+% We want to avoid the thin white lines that are shown in some \textsc{pdf}
+% viewers (eg: with the engine MuPDF used by SumatraPDF). That's why we try to
+% draw rectangles of the same color in the same instruction |\pgfusepathqfill|
+% (and they will be in the same instruction |fill|---coded |f|--- in the
+% resulting \textsc{pdf}).
+%
+% The commands |\@@_rowcolor|, |\@@_columncolor| and |\@@_rectanglecolor|
+% (which are linked to |\rowcolor|, |\columncolor| and |\rectanglecolor| before
+% the execution of the |code-before|) don't directly draw the corresponding
+% rectangles. Instead, they store their instructions color by color:
+% \begin{itemize}
+% \item A sequence |\l_@@_colors_seq| will be built containing all the colors
+% used by at least one of these instructions. Each \emph{color} may be prefixed
+% by it color model (eg: |[gray]{0.5}|).
+% \item For the color whose index in |\l_@@_colors_seq| is equal to~$i$, a list of
+% instructions which use that color will be constructed in the token list
+% |\l_@@_color_|$i$|_tl|. In that token list, the instructions will
+% |\@@_rowcolor:n|, |\@@_columncolor:n| and |\@@_rectanglecolor:nn|
+% (corresponding of |\@@_rowcolor|, |\@@_columncolor| and |\@@_rectanglecolor|).
+% \end{itemize}
+%
%
+% bigskip
+% |#1| is the color and |#2| is an instruction using that color. Despite its
+% name, the command |\@@_add_to_color_seq| doesn't only add a color to
+% |\l_@@_colors_seq|: it also updates the corresponding token list
+% |\l_@@_color_|$i$|_tl|.
% \begin{macrocode}
-\cs_set_protected:Npn \@@_cut_on_hyphen:w #1-#2\q_stop
+\cs_new_protected:Npn \@@_add_to_colors_seq:nn #1 #2
{
- \tl_set:Nn \l_tmpa_tl { #1 }
- \tl_set:Nn \l_tmpb_tl { #2 }
- }
% \end{macrocode}
-%
-% \bigskip
-% The following command uses two implicit arguments : |\l_@@_rows_tl| and
-% |\l_@@_cols_tl| which are specifications for a set of row and a set of
-% columns. The cartesian product is filled with the current color.
+% Firt, we look for the number of the color and, if it's found, we store it in
+% |\l_tmpa_int|. If the color is not present in |\l_@@_colors_seq|,
+% |\l_tmpa_int| will remain equal to $0$.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_cartesian_fill:
- {
+ \int_zero:N \l_tmpa_int
+ \seq_map_indexed_inline:Nn \l_@@_colors_seq
+ { \tl_if_eq:nnT { #1 } { ##2 } { \int_set:Nn \l_tmpa_int { ##1 } } }
+ \int_compare:nNnTF \l_tmpa_int = \c_zero_int
% \end{macrocode}
-% We begin the loop over the columns.
+% First, the case where the color is a \emph{new} color (not in the sequence).
% \begin{macrocode}
- \clist_map_inline:Nn \l_@@_cols_tl
{
- \tl_set:Nn \l_tmpa_tl { ##1 }
- \tl_if_in:NnTF \l_tmpa_tl { - }
- { \@@_cut_on_hyphen:w ##1 \q_stop }
- { \@@_cut_on_hyphen:w ##1 - ##1 \q_stop }
- \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } }
- \tl_if_empty:NT \l_tmpb_tl
- { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } }
- \int_compare:nNnT \l_tmpb_tl > \c@jCol
- { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } }
- \@@_qpoint:n { col - \l_tmpa_tl }
- \bool_lazy_and:nnTF
- { \str_if_eq_p:Vn \l_tmpa_tl 0 }
- { \int_compare_p:nNn \l_@@_first_col_int > 0 }
- { \dim_set:Nn \l_tmpc_dim { \pgf@x - 0.5 \arrayrulewidth } }
- { \dim_set:Nn \l_tmpc_dim { \pgf@x + 0.5 \arrayrulewidth } }
- \@@_qpoint:n { col - \@@_succ:n \l_tmpb_tl }
- \dim_set:Nn \l_tmpa_dim { \pgf@x + 0.5 \arrayrulewidth }
+ \seq_put_right:Nn \l_@@_colors_seq { #1 }
+ \tl_set:cn { l_@@_color _ \seq_count:N \l_@@_colors_seq _ tl } { #2 }
+ }
% \end{macrocode}
-% We begin the loop over the rows
+% Now, the case where the color is \emph{not} a new color (the color is in the
+% sequence at the position |\l_tmpa_int|).
% \begin{macrocode}
- \clist_map_inline:Nn \l_@@_rows_tl
- {
- \tl_set:Nn \l_tmpa_tl { ####1 }
- \tl_if_in:NnTF \l_tmpa_tl { - }
- { \@@_cut_on_hyphen:w ####1 \q_stop }
- { \@@_cut_on_hyphen:w ####1 - ####1 \q_stop }
- \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } }
- \tl_if_empty:NT \l_tmpb_tl
- { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@iRow } }
- \int_compare:nNnT \l_tmpb_tl > \c@iRow
- { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@iRow } }
+ { \tl_put_right:cn { l_@@_color _ \int_use:N \l_tmpa_int _tl } { #2 } }
+ }
% \end{macrocode}
-% Now, the numbers of both rows are in |\l_tmpa_tl| and |\l_tmpb_tl|.
+%
% \begin{macrocode}
- \@@_qpoint:n { row - \@@_succ:n \l_tmpb_tl }
- \dim_set:Nn \l_tmpb_dim { \pgf@y + 0.5 \arrayrulewidth }
- \@@_qpoint:n { row - \l_tmpa_tl }
- \dim_set:Nn \l_tmpd_dim { \pgf@y + 0.5 \arrayrulewidth }
- \pgfpathrectanglecorners
- { \pgfpoint \l_tmpc_dim \l_tmpd_dim }
- { \pgfpoint \l_tmpa_dim \l_tmpb_dim }
- }
+\cs_generate_variant:Nn \@@_add_to_colors_seq:nn { x n }
+% \end{macrocode}
+%
+% \bigskip
+% The macro |\@@_actually_color:| will actually fill all the rectangles, color by
+% color (using the sequence |\l_@@_colors_seq| and all the token lists of the
+% form |\l_@@_color_|$i$|_tl|).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_actually_color:
+ {
+ \pgfpicture
+ \pgf@relevantforpicturesizefalse
+ \seq_map_indexed_inline:Nn \l_@@_colors_seq
+ {
+ \color ##2
+ \use:c { l_@@_color _ ##1 _tl }
+ \pgfusepathqfill
}
- \pgfusepathqfill
+ \endpgfpicture
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_cut_on_hyphen:w #1-#2\q_stop
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_set:Nn \l_tmpb_tl { #2 }
}
% \end{macrocode}
%
@@ -10910,18 +10874,23 @@ version 2005/12/01 or later.
{
\tl_if_blank:nF { #2 }
{
- \pgfpicture
- \pgf@relevantforpicturesizefalse
- \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 }
- \tl_set:Nn \l_@@_rows_tl { #3 }
- \tl_set:Nn \l_@@_cols_tl { - }
+ \@@_add_to_colors_seq:xn
+ { \tl_if_blank:nF { #1 } { [ #1 ] } { #2 } }
+ { \@@_rowcolor:n { #3 } }
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_rowcolor:n #1
+ {
+ \tl_set:Nn \l_@@_rows_tl { #1 }
+ \tl_set:Nn \l_@@_cols_tl { - }
% \end{macrocode}
-% The command |\@@_cartesian_fill:| takes in two implicit arguments:
+% The command |\@@_cartesian_path:| takes in two implicit arguments:
% |\l_@@_cols_tl| and |\l_@@_row_tl|.
% \begin{macrocode}
- \@@_cartesian_fill:
- \endpgfpicture
- }
+ \@@_cartesian_path:
}
% \end{macrocode}
%
@@ -10933,18 +10902,22 @@ version 2005/12/01 or later.
{
\tl_if_blank:nF { #2 }
{
- \pgfpicture
- \pgf@relevantforpicturesizefalse
- \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 }
- \tl_set:Nn \l_@@_rows_tl { - }
- \tl_set:Nn \l_@@_cols_tl { #3 }
+ \@@_add_to_colors_seq:xn
+ { \tl_if_blank:nF { #1 } { [ #1 ] } { #2 } }
+ { \@@_columncolor:n { #3 } }
+ }
+ }
+% \end{macrocode}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_columncolor:n #1
+ {
+ \tl_set:Nn \l_@@_rows_tl { - }
+ \tl_set:Nn \l_@@_cols_tl { #1 }
% \end{macrocode}
-% The command |\@@_cartesian_fill:| takes in two implicit arguments:
+% The command |\@@_cartesian_path:| takes in two implicit arguments:
% |\l_@@_cols_tl| and |\l_@@_row_tl|.
% \begin{macrocode}
- \@@_cartesian_fill:
- \endpgfpicture
- }
+ \@@_cartesian_path:
}
% \end{macrocode}
%
@@ -10955,19 +10928,17 @@ version 2005/12/01 or later.
\NewDocumentCommand \@@_rectanglecolor { O { } m m m }
{
\tl_if_blank:nF { #2 }
- {
- \pgfpicture
- \pgf@relevantforpicturesizefalse
- \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 }
- \@@_rectanglecolor_i:nn { #3 } { #4 }
- \endpgfpicture
+ {
+ \@@_add_to_colors_seq:xn
+ { \tl_if_blank:nF { #1 } { [ #1 ] } { #2 } }
+ { \@@_rectanglecolor:nn { #3 } { #4 } }
}
}
% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_rectanglecolor_i:nn #1 #2
+\cs_new_protected:Npn \@@_rectanglecolor:nn #1 #2
{
\@@_cut_on_hyphen:w #1 \q_stop
\tl_clear_new:N \l_tmpc_tl
@@ -10978,10 +10949,10 @@ version 2005/12/01 or later.
\tl_set:Nx \l_@@_rows_tl { \l_tmpc_tl - \l_tmpa_tl }
\tl_set:Nx \l_@@_cols_tl { \l_tmpd_tl - \l_tmpb_tl }
% \end{macrocode}
-% The command |\@@_cartesian_fill:| takes in two implicit arguments:
+% The command |\@@_cartesian_path:| takes in two implicit arguments:
% |\l_@@_cols_tl| and |\l_@@_row_tl|.
% \begin{macrocode}
- \@@_cartesian_fill:
+ \@@_cartesian_path:
}
% \end{macrocode}
%
@@ -10991,18 +10962,28 @@ version 2005/12/01 or later.
% \begin{macrocode}
\NewDocumentCommand \@@_cellcolor { O { } m m }
{
- \tl_if_blank:nF { #2 }
+ \clist_map_inline:nn { #3 }
+ { \@@_rectanglecolor [ #1 ] { #2 } { ##1 } { ##1 } }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\NewDocumentCommand \@@_chessboardcolors { O { } m m }
+ {
+ \int_step_inline:nn { \int_use:N \c@iRow }
{
- \pgfpicture
- \pgf@relevantforpicturesizefalse
- \tl_if_empty:nTF { #1 } \color { \color [ #1 ] } { #2 }
- \clist_map_inline:nn { #3 }
- { \@@_rectanglecolor_i:nn { ##1 } { ##1 } }
- \pgfusepathqfill
- \endpgfpicture
- }
+ \int_step_inline:nn { \int_use:N \c@jCol }
+ {
+ \int_if_even:nTF { ####1 + ##1 }
+ { \@@_cellcolor [ #1 ] { #2 } }
+ { \@@_cellcolor [ #1 ] { #3 } }
+ { ##1 - ####1 }
+ }
+ }
}
% \end{macrocode}
+%
%
% \bigskip
% \begin{macrocode}
@@ -11112,10 +11093,11 @@ version 2005/12/01 or later.
{ \color [ #1 ] }
{ #3 }
% \end{macrocode}
-% The command |\@@_cartesian_fill:| takes in two implicit arguments:
+% The command |\@@_cartesian_path:| takes in two implicit arguments:
% |\l_@@_cols_tl| and |\l_@@_row_tl|.
% \begin{macrocode}
- \@@_cartesian_fill:
+ \@@_cartesian_path:
+ \pgfusepathqfill
}
\bool_set_false:N \l_tmpa_bool
}
@@ -11127,10 +11109,11 @@ version 2005/12/01 or later.
{ \color [ #1 ] }
{ #4 }
% \end{macrocode}
-% The command |\@@_cartesian_fill:| takes in two implicit arguments:
+% The command |\@@_cartesian_path:| takes in two implicit arguments:
% |\l_@@_cols_tl| and |\l_@@_row_tl|.
% \begin{macrocode}
- \@@_cartesian_fill:
+ \@@_cartesian_path:
+ \pgfusepathqfill
}
\bool_set_true:N \l_tmpa_bool
}
@@ -11182,23 +11165,65 @@ version 2005/12/01 or later.
% \end{macrocode}
%
%
+%
% \bigskip
+% The following command uses two implicit arguments : |\l_@@_rows_tl| and
+% |\l_@@_cols_tl| which are specifications for a set of rows and a set of
+% columns. It creates a path but does \emph{not} fill it. It must be filled by
+% another command after.
% \begin{macrocode}
-\NewDocumentCommand \@@_chessboardcolors { O { } m m }
- {
- \int_step_inline:nn { \int_use:N \c@iRow }
+\cs_new_protected:Npn \@@_cartesian_path:
+ {
+% \end{macrocode}
+% We begin the loop over the columns.
+% \begin{macrocode}
+ \clist_map_inline:Nn \l_@@_cols_tl
{
- \int_step_inline:nn { \int_use:N \c@jCol }
- {
- \int_if_even:nTF { ####1 + ##1 }
- { \@@_cellcolor [ #1 ] { #2 } }
- { \@@_cellcolor [ #1 ] { #3 } }
- { ##1 - ####1 }
+ \tl_set:Nn \l_tmpa_tl { ##1 }
+ \tl_if_in:NnTF \l_tmpa_tl { - }
+ { \@@_cut_on_hyphen:w ##1 \q_stop }
+ { \@@_cut_on_hyphen:w ##1 - ##1 \q_stop }
+ \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } }
+ \tl_if_empty:NT \l_tmpb_tl
+ { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } }
+ \int_compare:nNnT \l_tmpb_tl > \c@jCol
+ { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } }
+ \@@_qpoint:n { col - \l_tmpa_tl }
+ \int_compare:nNnTF \l_@@_first_col_int = \l_tmpa_tl
+ { \dim_set:Nn \l_tmpc_dim { \pgf@x - 0.5 \arrayrulewidth } }
+ { \dim_set:Nn \l_tmpc_dim { \pgf@x + 0.5 \arrayrulewidth } }
+ \@@_qpoint:n { col - \@@_succ:n \l_tmpb_tl }
+ \dim_set:Nn \l_tmpa_dim { \pgf@x + 0.5 \arrayrulewidth }
+% \end{macrocode}
+% We begin the loop over the rows
+% \begin{macrocode}
+ \clist_map_inline:Nn \l_@@_rows_tl
+ {
+ \tl_set:Nn \l_tmpa_tl { ####1 }
+ \tl_if_in:NnTF \l_tmpa_tl { - }
+ { \@@_cut_on_hyphen:w ####1 \q_stop }
+ { \@@_cut_on_hyphen:w ####1 - ####1 \q_stop }
+ \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } }
+ \tl_if_empty:NT \l_tmpb_tl
+ { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@iRow } }
+ \int_compare:nNnT \l_tmpb_tl > \c@iRow
+ { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@iRow } }
+% \end{macrocode}
+% Now, the numbers of both rows are in |\l_tmpa_tl| and |\l_tmpb_tl|.
+% \begin{macrocode}
+ \@@_qpoint:n { row - \@@_succ:n \l_tmpb_tl }
+ \dim_set:Nn \l_tmpb_dim { \pgf@y + 0.5 \arrayrulewidth }
+ \@@_qpoint:n { row - \l_tmpa_tl }
+ \dim_set:Nn \l_tmpd_dim { \pgf@y + 0.5 \arrayrulewidth }
+ \pgfpathrectanglecorners
+ { \pgfpoint \l_tmpc_dim \l_tmpd_dim }
+ { \pgfpoint \l_tmpa_dim \l_tmpb_dim }
}
- }
+ }
}
% \end{macrocode}
%
+%
% \bigskip
% When the user uses the key |colortbl-like|, the following command will
% be linked to |\cellcolor| in the tabular.
@@ -11211,7 +11236,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% When the user uses the key |rowcolor-in-tabular|, the following command will
+% When the user uses the key |colortbll-like|, the following command will
% be linked to |\rowcolor| in the tabular.
% \begin{macrocode}
\NewDocumentCommand \@@_rowcolor_tabular { O { } m }
@@ -12646,8 +12671,27 @@ version 2005/12/01 or later.
{
% \end{macrocode}
%
+% \medskip
+% We recall that |#1| and |#2| have been extracted from the first mandatory
+% argument of |\Block| (which is of the syntax $i$|-|$j$). However, the user is
+% allowed to omit $i$ or $j$ (or both). We detect that situation by replacing a
+% missing value by 100 (it's a convention: when the block will actually be drawn
+% these values will be detected and interpreted as \emph{maximal possible value}).
+% \begin{macrocode}
+ \bool_lazy_or:nnTF
+ { \tl_if_blank_p:n { #1 } }
+ { \str_if_eq_p:nn { #1 } { * } }
+ { \int_set:Nn \l_tmpa_int { 100 } }
+ { \int_set:Nn \l_tmpa_int { #1 } }
+ \bool_lazy_or:nnTF
+ { \tl_if_blank_p:n { #2 } }
+ { \str_if_eq_p:nn { #2 } { * } }
+ { \int_set:Nn \l_tmpb_int { 100 } }
+ { \int_set:Nn \l_tmpb_int { #2 } }
+% \end{macrocode}
+%
% \begin{macrocode}
- \int_compare:nNnTF { #2 } = 1
+ \int_compare:nNnTF \l_tmpb_int = 1
{
\tl_if_empty:NTF \l_@@_cell_type_tl
{ \tl_set:Nn \l_@@_pos_of_block_tl c }
@@ -12661,20 +12705,6 @@ version 2005/12/01 or later.
\keys_set_known:nn { NiceMatrix / Block / FirstPass } { #3 }
% \end{macrocode}
%
-% \medskip
-% We recall that |#1| and |#2| have been extracted from the first mandatory
-% argument of |\Block| (which is of the syntax $i$|-|$j$). However, the user is
-% allowed to omit $i$ or $j$ (or both). We detect that situation by replacing a
-% missing value by 100 (it's a convention: when the block will actually be drawn
-% these values will be detected and interpreted as \emph{maximal possible value}).
-% \begin{macrocode}
- \tl_if_empty:nTF { #1 }
- { \int_set:Nn \l_tmpa_int { 100 } }
- { \int_set:Nn \l_tmpa_int { #1 } }
- \tl_if_empty:nTF { #2 }
- { \int_set:Nn \l_tmpb_int { 100 } }
- { \int_set:Nn \l_tmpb_int { #2 } }
-% \end{macrocode}
%
% \begin{macrocode}
\tl_set:Nx \l_tmpa_tl
@@ -12693,14 +12723,14 @@ version 2005/12/01 or later.
%
% \medskip
% If the block is mono-column or mono-row, we have a special treatment. That's
-% why we have two macros: |\@@_Block_iii:nnnnn| and |\@@_Block_iv:nnnnn| (the five
+% why we have two macros: |\@@_Block_iv:nnnnn| and |\@@_Block_v:nnnnn| (the five
% arguments of those macros are provided by curryfication).
% \begin{macrocode}
\bool_lazy_or:nnTF
{ \int_compare_p:nNn { \l_tmpa_int } = 1 }
{ \int_compare_p:nNn { \l_tmpb_int } = 1 }
- { \exp_args:Nxx \@@_Block_iii:nnnnn }
{ \exp_args:Nxx \@@_Block_iv:nnnnn }
+ { \exp_args:Nxx \@@_Block_v:nnnnn }
{ \l_tmpa_int } { \l_tmpb_int } { #3 } { #4 } { #5 }
}
% \end{macrocode}
@@ -12714,7 +12744,7 @@ version 2005/12/01 or later.
% current row). However, that box will be put in the array \emph{after the
% construction of the array} (by using \textsc{pgf}).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_Block_iii:nnnnn #1 #2 #3 #4 #5
+\cs_new_protected:Npn \@@_Block_iv:nnnnn #1 #2 #3 #4 #5
{
\int_gincr:N \g_@@_block_box_int
\cs_set_protected_nopar:Npn \diagbox ##1 ##2
@@ -12847,7 +12877,7 @@ version 2005/12/01 or later.
% composed right now in a box. The composition in a box will be done further,
% just after the construction of the array.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_Block_iv:nnnnn #1 #2 #3 #4 #5
+\cs_new_protected:Npn \@@_Block_v:nnnnn #1 #2 #3 #4 #5
{
\seq_gput_right:Nx \g_@@_blocks_seq
{
@@ -12941,13 +12971,14 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_draw_blocks:
{
\cs_set_eq:NN \ialign \@@_old_ialign:
- \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iii:nnnnnn ##1 }
+ \seq_map_inline:Nn \g_@@_blocks_seq { \@@_Block_iv:nnnnnn ##1 }
}
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_Block_iii:nnnnnn #1 #2 #3 #4 #5 #6
+\cs_new_protected:Npn \@@_Block_iv:nnnnnn #1 #2 #3 #4 #5 #6
{
+% \end{macrocode}
% The integer |\l_@@_last_row_int| will be the last row of the block and
% |\l_@@_last_col_int| its last column.
% \begin{macrocode}
@@ -12985,12 +13016,12 @@ version 2005/12/01 or later.
}
{ \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } }
}
- { \@@_Block_iv:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } }
+ { \@@_Block_v:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { #6 } }
}
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_Block_iv:nnnnnn #1 #2 #3 #4 #5 #6
+\cs_new_protected:Npn \@@_Block_v:nnnnnn #1 #2 #3 #4 #5 #6
{
% \end{macrocode}
% The sequence of the positions of the blocks will be used when drawing the rules
@@ -13950,7 +13981,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\@@_msg_new:nn { ampersand~in~light-syntax }
{
- You~can't~use~an~ampersand~(\token_to_str &)~to~separate~columns~because
+ You~can't~use~an~ampersand~(\token_to_str:N &)~to~separate~columns~because~
~you~have~used~the~key~'light-syntax'.~This~error~is~fatal.
}
% \end{macrocode}
@@ -14187,6 +14218,7 @@ version 2005/12/01 or later.
The~available~keys~are~(in~alphabetic~order):~
allow-duplicate-names,~
cell-space-bottom-limit,~
+ cell-space-limits,~
cell-space-top-limit,~
code-for-first-col,~
code-for-first-row,~
@@ -14235,6 +14267,7 @@ version 2005/12/01 or later.
baseline,~
c,~
cell-space-bottom-limit,~
+ cell-space-limits,~
cell-space-top-limit,~
code-after,~
code-for-first-col,~
@@ -14293,6 +14326,7 @@ version 2005/12/01 or later.
baseline,~
c,~
cell-space-bottom-limit,~
+ cell-space-limits,~
cell-space-top-limit,~
code-after,~
code-for-first-col,~
@@ -14347,6 +14381,7 @@ version 2005/12/01 or later.
baseline,~
c,~
cell-space-bottom-limit,~
+ cell-space-limits,~
cell-space-top-limit,~
code-after,~
code-for-first-col,~
@@ -14818,6 +14853,14 @@ version 2005/12/01 or later.
%
% Better error messages for the command |\Block|.
%
+% \subsection*{Changes between versions 5.8 and 5.9}
+%
+% Correction of a bug: in the previous versions, it was not possible to use the
+% key |line-style| for the continuous dotted lines when the Tikz library |babel|
+% was loaded.
+%
+% New key |cell-space-limits|.
+%
% \PrintIndex
%
% \tableofcontents
diff --git a/macros/latex/contrib/nicematrix/nicematrix.ins b/macros/latex/contrib/nicematrix/nicematrix.ins
index 7c31f66579..b6fbed12ca 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.ins
+++ b/macros/latex/contrib/nicematrix/nicematrix.ins
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2018-2020 by F. Pantigny
+%% Copyright (C) 2018-2021 by F. Pantigny
%%
%%
%% This file may be distributed and/or modified under the
@@ -17,7 +17,7 @@
\usedir{tex/latex/nicematrix}
\preamble
-Copyright (C) 2018-2020 by F. Pantigny
+Copyright (C) 2018-2021 by F. Pantigny
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index ac45e01da6..750e4fd683 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ