summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-08-01 03:02:43 +0000
committerNorbert Preining <norbert@preining.info>2020-08-01 03:02:43 +0000
commit614c1765c3e9a6f5665cbf4f4fb60e768054c2d4 (patch)
tree57090b05f864f2b7a96c04eae6f19a74261aed62 /macros
parentaadc6fbc73f1ca0b93f8c406c46cdb2600bce890 (diff)
CTAN sync 202008010302
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/algxpar/algxpar.dtx168
-rw-r--r--macros/latex/contrib/algxpar/algxpar.ins6
-rw-r--r--macros/latex/contrib/algxpar/algxpar.pdfbin205770 -> 212046 bytes
-rw-r--r--macros/latex/contrib/horoscop/README2
-rw-r--r--macros/latex/contrib/horoscop/horoscop.dtx42
-rw-r--r--macros/latex/contrib/horoscop/horoscop.pdfbin701179 -> 701562 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin388513 -> 408728 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex1476
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx1910
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin953043 -> 990520 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/CHANGES11
-rw-r--r--macros/latex/contrib/tcolorbox/README2
-rw-r--r--macros/latex/contrib/tcolorbox/tcbbreakable.code.tex33
-rw-r--r--macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex8
-rw-r--r--macros/latex/contrib/tcolorbox/tcbexternal.code.tex8
-rw-r--r--macros/latex/contrib/tcolorbox/tcbfitting.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbhooks.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcblistings.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcblistingscore.code.tex8
-rw-r--r--macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbmagazine.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbminted.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbposter.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbprocessing.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbraster.code.tex8
-rw-r--r--macros/latex/contrib/tcolorbox/tcbskins.code.tex54
-rw-r--r--macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbtheorems.code.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcbvignette.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcbxparse.code.tex4
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdfbin273848 -> 273842 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex2
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-example.pdfbin457493 -> 457487 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-example.tex2
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdfbin442583 -> 442525 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex2
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex2
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.external.tex2
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex6
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex2
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty22
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.doc.s_snippet.sty3
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.pdfbin7151414 -> 7152072 bytes
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.sty69
-rw-r--r--macros/latex/contrib/tcolorbox/tcolorbox.tex12
45 files changed, 2484 insertions, 1426 deletions
diff --git a/macros/latex/contrib/algxpar/algxpar.dtx b/macros/latex/contrib/algxpar/algxpar.dtx
index bac74b7a35..d1263d7997 100644
--- a/macros/latex/contrib/algxpar/algxpar.dtx
+++ b/macros/latex/contrib/algxpar/algxpar.dtx
@@ -26,7 +26,7 @@
overlay first and middle={
\coordinate (A1) at ($(interior.south east) + (-10pt,5pt)$);
\coordinate (C1) at ($(interior.south east) + (-6pt,7.5pt)$);
- \draw[fill=tcbcol@frame] (A1) -- +(0,5pt) -- (C1) -- cycle;
+ \draw[fill=tcbcolframe] (A1) -- +(0,5pt) -- (C1) -- cycle;
},
]%
\begin{Verbatim}[gobble = 2, tabsize=4, commandchars = &\[\]]%
@@ -70,7 +70,7 @@
overlay first and middle={
\coordinate (A1) at ($(interior.south east) + (-10pt,5pt)$);
\coordinate (C1) at ($(interior.south east) + (-6pt,7.5pt)$);
- \draw[fill=tcbcol@frame] (A1) -- +(0,5pt) -- (C1) -- cycle;
+ \draw[fill=tcbcolframe] (A1) -- +(0,5pt) -- (C1) -- cycle;
},
]%
\small\VerbatimInput[tabsize=4, gobble = 2]{\jobname_code.tmp}
@@ -135,7 +135,7 @@
% Right brace \} Tilde \~}
%
%
-% \changes{v0.9}{2019/10/23}{Initial version}
+% \changes{v0.9}{2019/10/24}{Initial version}
%
% \GetFileInfo{algxpar.sty}
%
@@ -287,6 +287,12 @@
% \Statep{$s \gets a + b$}
% \Statep{\Write\ $s$}\end{example}
%
+% \DescribeMacro{\Set}
+% \DescribeMacro{\Setl}
+% Besides |\gets|, the macros |\Set| and |\Setl| can be used for assignments.
+%
+% |\Set|\marg{id}\marg{value} is a shortcut to |\Id{id} \gets value|. The ``long'' version for the assigment is |\Setl|\marg{id}\marg{value}, to get the verbose ``\algorithmicset\ \Id{id} \algorithmicsetto\ \Id{value}''.
+%
% \subsection{Comments}
% Comments use the symbol \makeatletter\axp@commentleftsymbol\makeatother\ preceding the commented text and stay close to the left margin. Comment macros are intended to be used with |\State| or |\Statex|, when no multiline handling is done. Comments with multiline control are considered starting at section~\ref{sec:statements}.
%
@@ -553,7 +559,7 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{algxpar}
- [2019/10/24 v0.9 Algorithms with multiline/paragraph support]
+ [2020/05/30 v0.91 Algorithms with multiline/paragraph support]
% \end{macrocode}
% \iffalse
@@ -593,16 +599,17 @@
% \begin{macro}{\False}
% \begin{macro}{\Nil}
% \begin{macro}{\Id}
+% \changes{v0.91}{2020/04/30}{Macro now can be used as super-/subscripts in math formulas, while still preventing hyphenaton in text mode.}
% \begin{macro}{\TextString}
% \begin{macro}{\VisibleSpace}
% \begin{macrocode}
-\algnewcommand\algorithmictrue{\textsc{True}}
-\algnewcommand\algorithmicfalse{\textsc{False}}
-\algnewcommand\algorithmicnil{\textsc{Nil}}
-\algnewcommand\True{\mbox{\algorithmictrue}}
-\algnewcommand\False{\mbox{\algorithmicfalse}}
-\algnewcommand\Nil{\mbox{\algorithmicnil}}
-\newcommand{\Id}[1]{\mbox{\textit{\rmfamily #1}}}
+\algnewcommand\algorithmictrue{True}
+\algnewcommand\algorithmicfalse{False}
+\algnewcommand\algorithmicnil{Nil}
+\algnewcommand\True{\ensuremath{\textsc{\rmfamily \algorithmictrue}}}
+\algnewcommand\False{\ensuremath{\textsc{\rmfamily \algorithmicfalse}}}
+\algnewcommand\Nil{\ensuremath{\textsc{\rmfamily \algorithmicnil}}}
+\newcommand{\Id}[1]{\ensuremath{\textit{\rmfamily#1}}}
\newcommand{\TextString}[1]{\textrm{\normalfont``{\ttfamily\mbox{#1}}''}}
\algnewcommand{\VisibleSpace}{\textrm{\color{black!70}\textvisiblespace}}
% \end{macrocode}
@@ -644,14 +651,24 @@
% \fi
% \begin{macro}{\Read}
% \begin{macro}{\Write}
+% \begin{macro}{\Set}
+% \changes{v0.91}{2020/06/14}{New macro for assignments, using $\gets$}
+% \begin{macro}{\Setl}
+% \changes{v0.91}{2020/06/14}{New macro for assignments (verbose)}
% \begin{macrocode}
\algnewcommand{\algorithmicread}{\textbf{read}}
\algnewcommand{\algorithmicwrite}{\textbf{write}}
+\algnewcommand\algorithmicset{Set}
+\algnewcommand\algorithmicsetto{to}
+\algnewcommand{\Set}[2]{\Id{#1} $\gets$ #2}
+\algnewcommand{\Setl}[2]{\algorithmicset\ #1 \algorithmicsetto\ #2}
\algnewcommand{\Read}{\algorithmicread}
\algnewcommand{\Write}{\algorithmicwrite}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
% \iffalse
%% Comments
@@ -698,7 +715,7 @@
\algblockdefx{While}{EndWhile}%
[2][]{%
\settowidth{\axp@whilewidth}{\algorithmicwhile\ }%
- \algparbox[#1]{\algorithmicwhile\ #2~\algorithmicdo}{\axp@whilewidth}%
+ \algparbox[x#1]{\algorithmicwhile\ #2~\algorithmicdo}{\axp@whilewidth}%
}%
{\algorithmicend\ \algorithmicwhile}
% \end{macrocode}
@@ -913,10 +930,11 @@
% \end{macro}
% \end{environment}
+% \changes{v0.91}{2020/04/30}{Small fix in the position of the triangle in line numbers.}
% \begin{macro}{\alglinenumber}
% \begin{macrocode}
\algrenewcommand{\alglinenumber}[1]%
- {\hspace{-1em}\color{black!35}{\scriptsize#1}{\tiny$\blacktriangleright$}}
+ {\hspace{-1.5em}\color{black!35}{\scriptsize#1}\raisebox{0.2ex}{\tiny$\blacktriangleright$}}
% \end{macrocode}
% \end{macro}
@@ -998,45 +1016,95 @@
% \renewcommand{\axp@commentrightsymbol}{\texttt{*/}}
% \end{commands}
%
-% The translation to Brazilian Portugues is straight forward.
+% To handle languages, the macro |\algxparset| should be used.
%
% \begin{macrocode}
-\ifaxp@brazilian
-\RequirePackage{icomma} % comma as decimal separator
-\algrenewcommand\algorithmicdescription{\textbf{Descrição}}
-\algrenewcommand\algorithmicinput{\textbf{Entrada}}
-\algrenewcommand\algorithmicoutput{\textbf{Saída}}
-\algrenewcommand\algorithmicrequire{\textbf{Pré}}
-\algrenewcommand\algorithmicensure{\textbf{Pós}}
-\algrenewcommand{\algorithmicend}{\textbf{fim}}
-\algrenewcommand{\algorithmicif}{\textbf{se}}
-\algrenewcommand{\algorithmicthen}{\textbf{então}}
-\algrenewcommand{\algorithmicelse}{\textbf{senão}}
-\algrenewcommand{\algorithmicswitch}{\textbf{escolha}}
-\algrenewcommand{\algorithmicof}{\textbf{de}}
-\algrenewcommand{\algorithmiccase}{\textbf{caso}}
-\algrenewcommand{\algorithmicotherwise}{\textbf{caso~contrário}}
-\algrenewcommand{\algorithmicfor}{\textbf{para}}
-\algrenewcommand{\algorithmicdo}{\textbf{faça}}
-\algrenewcommand{\algorithmicwhile}{\textbf{enquanto}}
-\algrenewcommand{\algorithmicforall}{\textbf{para cada}}
-\algrenewcommand{\algorithmicrepeat}{\textbf{repita}}
-\algrenewcommand{\algorithmicuntil}{\textbf{até que}}
-\algrenewcommand{\algorithmicloop}{\textbf{repita}}
-\algrenewcommand{\algorithmicforeach}{\textbf{para~cada}}
-\algrenewcommand{\algorithmicforall}{\textbf{para~todo}}
-\algrenewcommand{\algorithmicfunction}{\textbf{função}}
-\algrenewcommand{\algorithmicprocedure}{\textbf{procedimento}}
-\algrenewcommand{\algorithmicreturn}{\textbf{retorne}}
-\algrenewcommand\algorithmictrue{\textsc{Verdadeiro}}
-\algrenewcommand\algorithmicfalse{\textsc{Falso}}
-\algrenewcommand\algorithmicnil{\textsc{Nulo}}
-\algrenewcommand{\algorithmicread}{\textbf{leia}}
-\algrenewcommand{\algorithmicwrite}{\textbf{escreva}}
-\algrenewcommand{\To}{\textbf{até}}
-\algrenewcommand{\DownTo}{\textbf{decrescente~até}}
-\algrenewcommand{\Step}{\textbf{passo}}
-\fi
+\pgfkeys{
+ algxpar/.cd,
+ brazilian/.code = {\axp@languagebrazilian},
+ english/.code = {\axp@languageenglish},
+ default/.code = {\axp@languageenglish},
+}
+\newcommand{\algxparset}[1]{
+ \pgfkeys{
+ algxpar/.cd,
+ #1
+ }
+}
+\newcommand{\axp@languagebrazilian}{
+ \algrenewcommand\algorithmicdescription{\textbf{Descrição}}
+ \algrenewcommand\algorithmicinput{\textbf{Entrada}}
+ \algrenewcommand\algorithmicoutput{\textbf{Saída}}
+ \algrenewcommand\algorithmicrequire{\textbf{Pré}}
+ \algrenewcommand\algorithmicensure{\textbf{Pós}}
+ \algrenewcommand{\algorithmicend}{\textbf{fim}}
+ \algrenewcommand{\algorithmicif}{\textbf{se}}
+ \algrenewcommand{\algorithmicthen}{\textbf{então}}
+ \algrenewcommand{\algorithmicelse}{\textbf{senão}}
+ \algrenewcommand{\algorithmicswitch}{\textbf{escolha}}
+ \algrenewcommand{\algorithmicof}{\textbf{de}}
+ \algrenewcommand{\algorithmiccase}{\textbf{caso}}
+ \algrenewcommand{\algorithmicotherwise}{\textbf{caso~contrário}}
+ \algrenewcommand{\algorithmicfor}{\textbf{para}}
+ \algrenewcommand{\algorithmicdo}{\textbf{faça}}
+ \algrenewcommand{\algorithmicwhile}{\textbf{enquanto}}
+ \algrenewcommand{\algorithmicrepeat}{\textbf{repita}}
+ \algrenewcommand{\algorithmicuntil}{\textbf{até que}}
+ \algrenewcommand{\algorithmicloop}{\textbf{repita}}
+ \algrenewcommand{\algorithmicforeach}{\textbf{para~cada}}
+ \algrenewcommand{\algorithmicforall}{\textbf{para~todo}}
+ \algrenewcommand{\algorithmicfunction}{\textbf{função}}
+ \algrenewcommand{\algorithmicprocedure}{\textbf{procedimento}}
+ \algrenewcommand{\algorithmicreturn}{\textbf{retorne}}
+ \algrenewcommand{\algorithmictrue}{Verdadeiro}
+ \algrenewcommand{\algorithmicfalse}{Falso}
+ \algrenewcommand{\algorithmicnil}{Nulo}
+ \algrenewcommand{\algorithmicread}{\textbf{leia}}
+ \algrenewcommand{\algorithmicwrite}{\textbf{escreva}}
+ \algrenewcommand{\algorithmicset}{Defina}
+ \algrenewcommand{\algorithmicsetto}{como}
+ \algrenewcommand{\To}{\textbf{até}}
+ \algrenewcommand{\DownTo}{\textbf{decrescente~até}}
+ \algrenewcommand{\Step}{\textbf{passo}}
+}
+\newcommand{\axp@languageenglish}{
+ \algrenewcommand\algorithmicdescription{\textbf{Description}}
+ \algrenewcommand\algorithmicinput{\textbf{Input}}
+ \algrenewcommand\algorithmicoutput{\textbf{Output}}
+ \algrenewcommand\algorithmicrequire{\textbf{Pre}}
+ \algrenewcommand\algorithmicensure{\textbf{Post}}
+ \algrenewcommand{\algorithmicend}{\textbf{end}}
+ \algrenewcommand{\algorithmicif}{\textbf{if}}
+ \algrenewcommand{\algorithmicthen}{\textbf{then}}
+ \algrenewcommand{\algorithmicelse}{\textbf{else}}
+ \algrenewcommand{\algorithmicswitch}{\textbf{swith}}
+ \algrenewcommand{\algorithmicof}{\textbf{of}}
+ \algrenewcommand{\algorithmiccase}{\textbf{case}}
+ \algrenewcommand{\algorithmicotherwise}{\textbf{otherwise}}
+ \algrenewcommand{\algorithmicfor}{\textbf{for}}
+ \algrenewcommand{\algorithmicdo}{\textbf{do}}
+ \algrenewcommand{\algorithmicwhile}{\textbf{while}}
+ \algrenewcommand{\algorithmicrepeat}{\textbf{repeat}}
+ \algrenewcommand{\algorithmicuntil}{\textbf{until}}
+ \algrenewcommand{\algorithmicloop}{\textbf{loop}}
+ \algrenewcommand{\algorithmicforeach}{\textbf{for~each}}
+ \algrenewcommand{\algorithmicforall}{\textbf{for~all}}
+ \algrenewcommand{\algorithmicfunction}{\textbf{function}}
+ \algrenewcommand{\algorithmicprocedure}{\textbf{procedure}}
+ \algrenewcommand{\algorithmicreturn}{\textbf{retorne}}
+ \algrenewcommand{\algorithmictrue}{True}
+ \algrenewcommand{\algorithmicfalse}{False}
+ \algrenewcommand{\algorithmicnil}{Nil}
+ \algrenewcommand{\algorithmicread}{\textbf{read}}
+ \algrenewcommand{\algorithmicwrite}{\textbf{write}}
+ \algrenewcommand{\algorithmicset}{Set}
+ \algrenewcommand{\algorithmicsetto}{to}
+ \algrenewcommand{\To}{\textbf{to}}
+ \algrenewcommand{\DownTo}{\textbf{downto}}
+ \algrenewcommand{\Step}{\textbf{step}}
+}
+\axp@languageenglish % default language
+\ifaxp@brazilian\algxparset{brazilian}\fi
% \end{macrocode}
%
% \section{To do\ldots}
diff --git a/macros/latex/contrib/algxpar/algxpar.ins b/macros/latex/contrib/algxpar/algxpar.ins
index 289551de47..7e7a9c0eba 100644
--- a/macros/latex/contrib/algxpar/algxpar.ins
+++ b/macros/latex/contrib/algxpar/algxpar.ins
@@ -1,3 +1,4 @@
+% !TeX program = createsty.sh % | txs:///view
%%
%% Copyright (C) 2019 by Jander Moreira
%%
@@ -12,11 +13,12 @@
\preamble
-Copyright (C) 2019 by Jander Moreira (moreira.jander@gmail.com)
+Copyright (C) 2020 by Jander Moreira (moreira.jander@gmail.com)
\endpreamble
\generate{
+ \nopreamble\nopostamble
\file{algxpar.sty}{
\from{algxpar.dtx}{algxpar}
}
@@ -31,4 +33,4 @@ Copyright (C) 2019 by Jander Moreira (moreira.jander@gmail.com)
\Msg{*}
\Msg{**********************************************************}
-\endbatchfile \ No newline at end of file
+\endbatchfile
diff --git a/macros/latex/contrib/algxpar/algxpar.pdf b/macros/latex/contrib/algxpar/algxpar.pdf
index e5deed1d8f..7446f04ac1 100644
--- a/macros/latex/contrib/algxpar/algxpar.pdf
+++ b/macros/latex/contrib/algxpar/algxpar.pdf
Binary files differ
diff --git a/macros/latex/contrib/horoscop/README b/macros/latex/contrib/horoscop/README
index 5fbcef74bd..4ec342e798 100644
--- a/macros/latex/contrib/horoscop/README
+++ b/macros/latex/contrib/horoscop/README
@@ -1,4 +1,4 @@
-This is version 1.0 of the horoscop package for typesetting astrological
+This is version 1.01 of the horoscop package for typesetting astrological
charts in LaTeX.
Features include:
diff --git a/macros/latex/contrib/horoscop/horoscop.dtx b/macros/latex/contrib/horoscop/horoscop.dtx
index dfcf84b7af..cc7827e623 100644
--- a/macros/latex/contrib/horoscop/horoscop.dtx
+++ b/macros/latex/contrib/horoscop/horoscop.dtx
@@ -22,7 +22,7 @@
\usepackage{fmtcount}
\usepackage{graphicx}
\usepackage[scaled=0.9]{helvet}
-\usepackage[textsym,unicode,wasysym,marvosym,starfont]{horoscop}[2020/07/21]
+\usepackage[textsym,unicode,wasysym,marvosym,starfont]{horoscop}[2020/07/31]
\usepackage{mathpazo}
\usepackage{metalogo}
\usepackage{titlesec}
@@ -114,7 +114,7 @@
%
% \title{Typesetting astrology with \textsf{horoscop}}
% \author{Matthew Skala}
-% \date{July 21, 2020}
+% \date{July 31, 2020}
%
% \thispagestyle{empty}
% \phantomsection
@@ -141,7 +141,7 @@
% {\nolinkurl{mskala@ansuz.sooke.bc.ca}}}
%
% \vspace{0.5in}
-% {\Large\itshape Version 1.0, July 21, 2020}
+% {\Large\itshape Version 1.01, July 31, 2020}
% \vspace{2.5pc}
% \par}
%
@@ -232,16 +232,17 @@
% of the presentation at
% \url{http://zeeba.tv/astrological-charts-with-horoscop-and-starfont/}.
%
-% This release, version 1.0, represents a mature version of the package.
+% Version 1.0 represents a mature version of the package.
% The last release, version 0.92, was called a beta test, but it has
% been in use seven years now without needing any significant bug fixing or
% updates. The most serious issue in 0.92 was in the documentation of
% how to enter manually-calculated object positions; the underlying macros
% for it worked well.
%
-% So this 1.0 release is primarily an update to the documentation to fix
-% that issue, as well as to bump the version number and recognize the fact
-% that the package is mature and fully usable. I have also taken the
+% Version 1.0 was primarily an update to the documentation to fix that
+% issue; unfortunately, it still wasn't correct, so 1.01 is meant to fix it for
+% real this time. Version 1.0 made other documentation updates to recognize
+% the fact that the package is mature and fully usable. I also took the
% opportunity to add the Unicode-symbols feature, to reduce
% \textsf{horoscop}'s ties to classical \TeX\ and its font systems as users
% increasingly move toward Unicode engines and Unicode-based font selection;
@@ -1103,6 +1104,7 @@
% directly, as in the example below.
%
% \changes{v1.0}{2020/07/20}{Correct macro names for manual position example}
+% \changes{v1.01}{2020/07/31}{Correct macro names for manual position example, again}
% \begin{verbatim}
% \def\horoSunPos{267.5002492}\def\horoSunVel{1.0185515}
% \def\horoMoonPos{229.2067659}\def\horoMoonVel{11.9237313}
@@ -1116,18 +1118,18 @@
% \def\horoPlutoPos{133.0955746}\def\horoPlutoVel{-0.0150157}
% \def\horoNorthNodePos{70.7814892}\def\horoNorthNodeVel{-0.0529425}
% \def\horoLilithPos{265.3475147}\def\horoLilithVel{0.1108368}
-% \def\horoCuspPosI{207.9120843}
-% \def\horoCuspPosII{236.5553269}
-% \def\horoCuspPosIII{267.6976404}
-% \def\horoCuspPosIV{300.5365877}
-% \def\horoCuspPosV{332.9973490}
-% \def\horoCuspPosVI{2.5292853}
-% \def\horoCuspPosVII{27.9120843}
-% \def\horoCuspPosVIII{56.5553269}
-% \def\horoCuspPosIX{87.6976404}
-% \def\horoCuspPosX{120.5365877}
-% \def\horoCuspPosXI{152.9973490}
-% \def\horoCuspPosXII{182.5292853}
+% \def\horoCuspIPos{207.9120843}
+% \def\horoCuspIIPos{236.5553269}
+% \def\horoCuspIIIPos{267.6976404}
+% \def\horoCuspIVPos{300.5365877}
+% \def\horoCuspVPos{332.9973490}
+% \def\horoCuspVIPos{2.5292853}
+% \def\horoCuspVIIPos{27.9120843}
+% \def\horoCuspVIIIPos{56.5553269}
+% \def\horoCuspIXPos{87.6976404}
+% \def\horoCuspXPos{120.5365877}
+% \def\horoCuspXIPos{152.9973490}
+% \def\horoCuspXIIPos{182.5292853}
% \end{verbatim}
%
% A few less obvious macros also need to be set for manually-entered
@@ -2986,7 +2988,7 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{horoscop}%
- [2013/05/16 v0.92 Astrological chart macros by Matthew Skala]
+ [2020/07/31 v1.01 Astrological chart macros by Matthew Skala]
% \end{macrocode}
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/latex/contrib/horoscop/horoscop.pdf b/macros/latex/contrib/horoscop/horoscop.pdf
index d7874d4c46..9b8644119e 100644
--- a/macros/latex/contrib/horoscop/horoscop.pdf
+++ b/macros/latex/contrib/horoscop/horoscop.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index 6c8b213f5b..18e3ce9336 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 55491dddbd..bd13654d0d 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -146,7 +146,7 @@ commande est le groupe TeX courant : elles sont semi-globales).
\bigskip
{\bfseries \color{red} Important
-Dans cette version 5.0 de \pkg{nicematrix}, on doit utiliser les lettres |l|, |c| et
+Depuis la version 5.0 de \pkg{nicematrix}, on doit utiliser les lettres |l|, |c| et
|r| dans les préambules des environnements et non plus les lettres |L|, |C| et
|R|.
@@ -168,36 +168,35 @@ L'extension \pkg{nicematrix} définit les nouveaux environnements suivants :
\begin{ttfamily}
\setlength{\tabcolsep}{3mm}
\begin{tabular}{llll}
-\{NiceTabular\} & \{NiceArray\} & \{NiceMatrix\} \\
- & \{pNiceArray\} & \{pNiceMatrix\} \\
- & \{bNiceArray\} & \{bNiceMatrix\} \\
- & \{BNiceArray\} & \{BNiceMatrix\} \\
- & \{vNiceArray\} & \{vNiceMatrix\} \\
- & \{VNiceArray\} & \{VNiceMatrix\}
+\{NiceTabular\} & \{NiceArray\} & \{NiceMatrix\} \\
+\{NiceTabular*\} & \{pNiceArray\} & \{pNiceMatrix\} \\
+ & \{bNiceArray\} & \{bNiceMatrix\} \\
+ & \{BNiceArray\} & \{BNiceMatrix\} \\
+ & \{vNiceArray\} & \{vNiceMatrix\} \\
+ & \{VNiceArray\} & \{VNiceMatrix\}
\end{tabular}
\end{ttfamily}
\medskip
-Les environnements |{NiceArray}| et |{NiceTabular}| sont similaires aux environnements |{array}| et |{tabular}| de
+Les environnements |{NiceArray}|, |{NiceTabular}| et |{NiceTabular*}| sont
+similaires aux environnements |{array}|, |{tabular}| et |{tabular*}| de
l'extension \pkg{array} (qui est chargée par \pkg{nicematrix}).
\medskip
-Néanmoins, dans |{NiceArray}| (et ses variantes), les colonnes de type |w| (ex. : |wc{1cm}|) sont composées en mode
-mathématique alors que dans |{array}| de \pkg{array}, elles sont composées en
-mode texte.
+Les environnements |{pNiceArray}|, |{bNiceArray}|, etc. n'ont pas d'équivalents
+dans \pkg{array}.
\medskip
-Les environnements |{pNiceArray}|, |{bNiceArray}|, etc. n'ont pas d'équivalents dans \pkg{array}.
+Les environnements |{NiceMatrix}|, |{pNiceMatrix}|, etc. sont similaires aux
+environnements correspondants de l'\pkg{amsmath} (qui est chargée par
+\pkg{nicematrix}) : |{matrix}|, |{pmatrix}|, etc.
\medskip
-Les environnements |{NiceMatrix}|, |{pNiceMatrix}|, etc. sont similaires aux environnements correspondants de
-l'\pkg{amsmath} (qui est chargée par \pkg{nicematrix}) : |{matrix}|, |{pmatrix}|, etc.
-
-\medskip
-Tous les environnements de l'extension \pkg{nicematrix} acceptent, entre crochets, une liste optionnelle de paires
-de la forme \textsl{clé=valeur}. {\bfseries Il doit n'y avoir aucun espace devant le crochet ouvrant (|[|) de cette
-liste d'options.}
+Tous les environnements de l'extension \pkg{nicematrix} acceptent, entre
+crochets, une liste optionnelle de paires de la forme \textsl{clé=valeur}.
+{\bfseries Il doit n'y avoir aucun espace devant le crochet ouvrant (|[|) de
+ cette liste d'options.}
\bigskip
\textbf{Important}
@@ -215,8 +214,9 @@ doit être chargé avec l'option |define-L-C-R|.
\section{L'espace vertical entre les rangées}
-Il est bien connu que certaines rangées des tableaux créés par défault avec LaTeX sont trop proches l'une de
-l'autre. On en donne ci-dessous un exemple classique.
+Il est bien connu que certaines rangées des tableaux créés par défault avec
+LaTeX sont trop proches l'une de l'autre. On en donne ci-dessous un exemple
+classique.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=9cm]
@@ -231,13 +231,17 @@ $\begin{pmatrix}
\end{pmatrix}$
\bigskip
-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 \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 |\NiceMatrixOptions|.\footnote{On remarquera que ces paramètres s'appliquent aussi aux
- colonnes de type |S| de \pkg{siunitx} alors que \pkg{cellspace} n'est pas utilisable avec ces colonnes.}
+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
+\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
+|\NiceMatrixOptions|.\footnote{On remarquera que ces paramètres s'appliquent
+ aussi aux colonnes de type |S| de \pkg{siunitx} alors que \pkg{cellspace}
+ n'est pas utilisable avec ces colonnes.}
\medskip
\begin{Verbatim}
@@ -265,9 +269,10 @@ $\begin{pNiceMatrix}
\bigskip
\section{La clé baseline}
-L'extension \pkg{nicematrix} propose une option |baseline| pour la position verticale des tableaux. Cette
-option |baseline| prend comme valeur un entier qui indique le numéro de rangée dont la ligne de base servira de
-ligne de base pour le tableau.
+L'extension \pkg{nicematrix} propose une option |baseline| pour la position
+verticale des tableaux. Cette option |baseline| prend comme valeur un entier qui
+indique le numéro de rangée dont la ligne de base servira de ligne de base pour
+le tableau.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=9cm]
@@ -284,17 +289,18 @@ $A = \begin{pNiceMatrix}[baseline=2]
\end{pNiceMatrix}$
-\interitem
-L'option |baseline| peut aussi prendre les trois valeurs spéciales |t|, |c| et |b|. Ces trois lettres peuvent aussi
-être utilisées de manière absolue comme pour l'option des environnements |{tabular}| et |{array}| de \pkg{array}.
-La valeur initiale de |baseline| est~|c|.
+\interitem L'option |baseline| peut aussi prendre les trois valeurs spéciales
+|t|, |c| et |b|. Ces trois lettres peuvent aussi être utilisées de manière
+absolue comme pour l'option des environnements |{tabular}| et |{array}| de
+\pkg{array}. La valeur initiale de |baseline| est~|c|.
\bigskip
-Dans l'exemple suivant, on utilise l'option |t| (synonyme de |baseline=t|) immédiatement après un |\item| de liste.
-On remarquera que la présence d'un |\hline| initial n'empêche pas l'alignement sur la ligne de base de la première
-rangée (avec |{tabular}| ou |{array}| de \pkg{array}, il faut utiliser |\firsthline|\footnote{On peut aussi utiliser |\firsthline|
- dans les environnements de \pkg{nicematrix}.}).
+Dans l'exemple suivant, on utilise l'option |t| (synonyme de |baseline=t|)
+immédiatement après un |\item| de liste. On remarquera que la présence d'un
+|\hline| initial n'empêche pas l'alignement sur la ligne de base de la première
+rangée (avec |{tabular}| ou |{array}| de \pkg{array}, il faut utiliser
+|\firsthline|.
\smallskip
\begin{BVerbatim}[baseline=c,boxwidth=9cm]
@@ -365,15 +371,17 @@ u_n & 1 & 2 & 4 & 8 & 16 & 32 \\
\section{Les blocs}
\label{Block}
-Dans les environnements de \pkg{nicematrix}, on peut utiliser la commande |\Block| pour placer un élément au centre
-d'un rectangle de cases fusionnées. La commande |\Block| ne crée pas d'espace par elle-même.
+Dans les environnements de \pkg{nicematrix}, on peut utiliser la commande
+|\Block| pour placer un élément au centre d'un rectangle de cases fusionnées. La
+commande |\Block| ne crée pas d'espace par elle-même.
-La commande |\Block| doit être utilisée dans la case supérieure gauche du bloc avec deux arguments. 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. Le deuxième argument, est, sans surprise, le contenu du bloc.
+La commande |\Block| doit être utilisée dans la case supérieure gauche du bloc
+avec deux arguments. 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. Le deuxième argument, est, sans surprise, le contenu du bloc.
-Dans |{NiceTabular}|, le contenu est composé en mode texte. Dans les autres environnements, il est composé en mode
-mathématique.
+Dans |{NiceTabular}|, le contenu est composé en mode texte. Dans les autres
+environnements, il est composé en mode mathématique.
\medskip
\begin{BVerbatim}
@@ -397,10 +405,10 @@ arum & iris & jacinthe & muguet
\end{center}
-\interitem
-On remarquera que le centrage horizontal du contenu des blocs est correct même si un espacement des colonnes a été
-demandé par une instruction comme |!{\qquad}| dans le préambule (ce n'est pas le cas avec |\multicolumn|). Dans
-l'exemple suivant, l'en-tête «Premier groupe» est correctement centré.
+\interitem On remarquera que le centrage horizontal du contenu des blocs est
+correct même si un espacement des colonnes a été demandé par une instruction
+comme |!{\qquad}| dans le préambule (ce n'est pas le cas avec |\multicolumn|).
+Dans l'exemple suivant, l'en-tête «Premier groupe» est correctement centré.
\medskip
\begin{center}
@@ -458,10 +466,11 @@ $\begin{bNiceArray}{ccc|c}[margin]
\end{bNiceArray}$
\bigskip
-On peut souhaiter agrandir la taille du «$A$» placé dans le bloc de l'exemple précédent. Comme il est composé en
-mode mathématique, on ne peut pas directement utiliser une commande comme |\large|, |\Large| ou |\LARGE|. C'est
-pourquoi une option à mettre entre chevrons est proposée par |\Block| pour spécifier du code LaTeX qui sera inséré
-\emph{avant} le début du mode mathématique.
+On peut souhaiter agrandir la taille du «$A$» placé dans le bloc de l'exemple
+précédent. Comme il est composé en mode mathématique, on ne peut pas directement
+utiliser une commande comme |\large|, |\Large| ou |\LARGE|. C'est pourquoi une
+option à mettre entre chevrons est proposée par |\Block| pour spécifier du code
+LaTeX qui sera inséré \emph{avant} le début du mode mathématique.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
@@ -484,60 +493,93 @@ $\begin{bNiceArray}{ccc|c}[margin]
\section{Les filets horizontaux et verticaux}
-Les techniques habituelles pour tracer des filets peuvent être utilisées dans les environnements de
-\pkg{nicematrix}, à l'exception de |\vline|.
+Les techniques habituelles pour tracer des filets peuvent être utilisées dans
+les environnements de \pkg{nicematrix}, à l'exception de |\vline|. Il y a
+néanmoins quelques petites différences de comportement avec les environnements
+classiques.
-\subsection{L'épaisseur et la couleur des filets}
-Les environnements de \pkg{nicematrix} proposent une clé |rules/width| pour fixer la largeur (en fait l'épaisseur)
-des filets dans l'environnement. En fait, cette clé ne fait que fixer la valeur de |\arrayrulewidth|.
+\bigskip
+\subsection{Quelques différences avec les environnements classiques}
-\smallskip
-On sait que \pkg{colortbl} propose la commande |\arrayrulecolor| pour spécifier la couleur de ces filets.
+\subsubsection{Les filets verticaux}
-\smallskip
-Avec \pkg{nicematrix}, il est possible de spécifier une couleur même si \pkg{colortbl} n'est pas chargé. Par souci
-de compatibilité, la commande est nommée également |\arrayrulecolor|. Les environnements de \pkg{nicematrix}
-proposent également une clé |rules/color| qui permet de fixer cette couleur pour l'environnement en question.
+Dans les environnements de \pkg{nicematrix}, les filets verticaux spécifiés par
+\verb+|+ dans le préambule des environnements ne sont jamais coupés, même en cas
+de ligne incomplète ou de double filet horizontal spécifié par |\hline\hline|
+(il n'y a pas besoin d'utiliser \pkg{hhline}).\footnote{Il s'agit là du comportement depuis la version 5.1 de
+ \pkg{nicematrix}. Dans les versions précédentes, le comportement était
+ le comportement par défaut de \pkg{array}.}
-\medskip
-\begin{scope}
-\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-\begin{NiceTabular}{|ccc|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
-\hline
-rose & tulipe & lys \\
-arum & iris & violette \\
-muguet & dahlia & souci \\
-\hline
+\bigskip
+\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{NiceTabular}{|c|c|} \hline
+Premier & Deuxième \\ ~emphase#\hline\hline@
+Paul \\ \hline
+Marie & Pauline \\ \hline
\end{NiceTabular}
\end{BVerbatim}
-\begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
-\hline
-rose & tulipe & lys \\
-arum & iris & violette \\
-muguet & dahlia & souci \\
-\hline
+%
+\begin{NiceTabular}{|c|c|}[c] \hline
+Premier & Deuxième \\ \hline\hline
+Paul \\ \hline
+Marie & Pauline \\ \hline
\end{NiceTabular}
-\end{scope}
-\medskip
-Si on veut définir de nouveaux spécificateurs de colonnes pour des filets (par exemple plus épais ou bien d'une
-couleur spécifique), on aura peut-être intérêt à utiliser la commande |\OnlyMainNiceMatrix| décrite p.~\pageref{OnlyMainNiceMatrix}.
+\bigskip
+Si vous utilisez \pkg{booktabs} (qui fournit |\toprule|, |\midrule|,
+|\bottomrule|, etc.) et que vous tenez absolument à mettre des filets verticaux
+(ce qui est contraire à l'esprit à \pkg{booktabs}), vous constaterez que les
+filets tracés par \pkg{nicematrix} sont compatibles avec \pkg{booktabs}.
+\medskip
+\begin{BVerbatim}[baseline=c,boxwidth=10.5cm]
+$\begin{NiceArray}{~emphase#|cccc|@} \toprule
+a & b & c & d \\ \midrule
+1 & 2 & 3 & 4 \\
+1 & 2 & 3 & 4 \\ \bottomrule
+\end{NiceArray}$
+\end{BVerbatim}
+%
+$\begin{NiceArray}{|cccc|}
+\toprule
+a & b & c & d \\
+\midrule
+1 & 2 & 3 & 4 \\
+1 & 2 & 3 & 4 \\
+\bottomrule
+\end{NiceArray}$
\bigskip
-\subsection{Une remarque concernant \textbackslash cline}
+Il reste néanmoins possible de définir un spécificateur, nommé par exemple
+\verb|I|, pour tracer des filets verticaux avec le comportement standard de
+\pkg{array} :
+%
+\begin{Verbatim}
+\newcolumntype{I}{!{\vrule}}
+\end{Verbatim}
+
+En fait, en l'occurrence, il serait peut-être plus habile d'insérer
+|\OnlyMainNiceMatrix| (cf. p.~\pageref{OnlyMainNiceMatrix}) :
+\begin{Verbatim}
+\newcolumntype{I}{!{\OnlyMainNiceMatrix{\vrule}}}
+\end{Verbatim}
+
+
+
+\subsubsection{La commande \textbackslash cline}
\label{remark-cline}
-Les traits verticaux et horizontaux que l'on insère avec |\hline| et le spécificateur de colonne «\verb+|+» de
-\pkg{array} rendent le tableau plus large ou plus long d'une quantité égale à la largeur du trait.
+Les traits verticaux et horizontaux que l'on insère avec |\hline| et le
+spécificateur de colonne «\verb+|+» de \pkg{array} rendent le tableau plus large
+ou plus long d'une quantité égale à la largeur du trait (avec \pkg{array} et
+aussi avec \pkg{nicematrix}).
\smallskip
-Pour des raisons historiques, il n'en est pas de même pour la commande |\cline|, comme on peut le voir avec
-l'exemple suivant.
+Pour des raisons historiques, il n'en est pas de même pour la commande |\cline|,
+comme on peut le voir avec l'exemple suivant.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -560,8 +602,9 @@ A&B&C&D \\
\end{scope}
\medskip
-Dans les environnements de \pkg{nicematrix}, cette situation est corrigée (il est néanmoins possible de revenir au
-comportement par défaut de |\cline| avec la clé |standard-cline|).
+Dans les environnements de \pkg{nicematrix}, cette situation est corrigée (il
+est néanmoins possible de revenir au comportement par défaut de |\cline| avec la
+clé |standard-cline|).
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -584,12 +627,63 @@ A&B&C&D \\
\end{scope}
+
+\subsection{L'épaisseur et la couleur des filets}
+
+Les environnements de \pkg{nicematrix} proposent une clé |rules/width| pour
+fixer la largeur (en fait l'épaisseur) des filets dans l'environnement. En fait,
+cette clé ne fait que fixer la valeur de |\arrayrulewidth|.
+
+\smallskip
+On sait que \pkg{colortbl} propose la commande |\arrayrulecolor| pour spécifier
+la couleur de ces filets.
+
+\smallskip
+Avec \pkg{nicematrix}, il est possible de spécifier une couleur même si
+\pkg{colortbl} n'est pas chargé. Par souci de compatibilité, la commande est
+nommée également |\arrayrulecolor|. Les environnements de \pkg{nicematrix}
+proposent également une clé |rules/color| qui permet de fixer cette couleur pour
+l'environnement en question.
+
+\medskip
+\begin{scope}
+\hfuzz=10cm
+\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
+\begin{NiceTabular}{|ccc|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
+\hline
+rose & tulipe & lys \\
+arum & iris & violette \\
+muguet & dahlia & souci \\
+\hline
+\end{NiceTabular}
+\end{BVerbatim}
+\begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
+\hline
+rose & tulipe & lys \\
+arum & iris & violette \\
+muguet & dahlia & souci \\
+\hline
+\end{NiceTabular}
+\end{scope}
+
+\medskip
+Si on veut définir de nouveaux spécificateurs de colonnes pour des filets (par
+exemple plus épais ou bien d'une couleur spécifique), on aura peut-être intérêt
+à utiliser la commande |\OnlyMainNiceMatrix| décrite
+p.~\pageref{OnlyMainNiceMatrix}.
+
+
+
+
+
\bigskip
\subsection{Les clés hlines et vlines}
-La clé |hlines| demande un tracé de tous les filets horizontaux et la clé |vlines| demande un tracé de tous les
-filets verticaux. En fait, dans les environnements avec délimiteurs (comme |{pNiceMatrix}| ou |{bNiceArray}|), les
-filets extérieurs ne sont pas tracés (ce qui est le comportement certainement attendu).
+La clé |hlines| demande un tracé de tous les filets horizontaux et la clé
+|vlines| demande un tracé de tous les filets verticaux. En fait, dans les
+environnements avec délimiteurs (comme |{pNiceMatrix}| ou |{bNiceArray}|), les
+filets extérieurs ne sont pas tracés (ce qui est le comportement certainement
+attendu).
\medskip
@@ -607,61 +701,15 @@ $\begin{pNiceMatrix}[vlines,rules/width=0.2pt]
\end{pNiceMatrix}$
-\bigskip
-Il y a néanmoins une différence entre l'utilisation de l'option |vlines| et du spécificateur «\verb+|+» dans le
-préambule de l'environnement : les filets tracés par |vlines| traversent les double-filets horizontaux tracés par
-|\hline\hline| (il n'y a pas besoin d'utiliser \pkg{hhline}).
-
-\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11.5cm]
-$\begin{NiceMatrix}[~emphase#vlines@] \hline
-a & b & c & d \\ \hline \hline
-1 & 2 & 3 & 4 \\
-1 & 2 & 3 & 4 \\ \hline
-\end{NiceMatrix}$
-\end{BVerbatim}
-%
-$\begin{NiceMatrix}[vlines]
-\hline
-a & b & c & d \\
-\hline \hline
-1 & 2 & 3 & 4 \\
-1 & 2 & 3 & 4 \\
-\hline
-\end{NiceMatrix}$
-
-
-\bigskip
-Si vous utilisez \pkg{booktabs} (qui fournit |\toprule|, |\midrule|, |\bottomrule|, etc.) et que vous tenez
-absolument à mettre des filets verticaux (ce qui est contraire à l'esprit à \pkg{booktabs}), sachez que la clé
-|vlines| est compatible avec \pkg{booktabs}.
-
-\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11.5cm]
-$\begin{NiceMatrix}[~emphase#vlines@] \toprule
-a & b & c & d \\ \midrule
-1 & 2 & 3 & 4 \\
-1 & 2 & 3 & 4 \\ \bottomrule
-\end{NiceMatrix}$
-\end{BVerbatim}
-%
-$\begin{NiceMatrix}[vlines]
-\toprule
-a & b & c & d \\
-\midrule
-1 & 2 & 3 & 4 \\
-1 & 2 & 3 & 4 \\
-\bottomrule
-\end{NiceMatrix}$
-
\subsection{La clé hvlines}
\label{hvlines}
-La clé |hvlines| demande le tracé de tous les filets horizontaux et verticaux \emph{sauf dans les
- blocs}.\footnote{En fait, quand la clé |hvlines| (ou la clé |hvlines-except-corners| décrite juste après) est
- utilisée, les filets ne sont pas non plus tracés dans les blocs virtuels délimités par des cases reliées par des
- lignes pointillées (cf. p. \pageref{dotted-and-hvlines}).}
+La clé |hvlines| demande le tracé de tous les filets horizontaux et verticaux
+\emph{sauf dans les blocs}.\footnote{En fait, quand la clé |hvlines| (ou la clé
+ |hvlines-except-corners| décrite juste après) est utilisée, les filets ne sont
+ pas non plus tracés dans les blocs virtuels délimités par des cases reliées
+ par des lignes pointillées (cf. p. \pageref{dotted-and-hvlines}).}
\medskip
\begin{Verbatim}
@@ -685,8 +733,8 @@ arum & iris & jacinthe & muguet
\subsection{La clé hvlines-except-corners}
-La clé |hvlines-except-corners| demande le tracé de tous les filets horizontaux et verticaux \emph{sauf dans les
- blocs} et sauf dans les coins vides.
+La clé |hvlines-except-corners| demande le tracé de tous les filets horizontaux
+et verticaux \emph{sauf dans les blocs} et sauf dans les coins vides.
\medskip
\begin{Verbatim}
@@ -717,8 +765,8 @@ A & A & A & A & A & A \\
\end{NiceTabular}
\end{center}
-Comme on le voit, un «coin vide» est constitué de la réunion de tous les rectangles vides partant de la case située
-exactement dans le coin.
+Comme on le voit, un «coin vide» est constitué de la réunion de tous les
+rectangles vides partant de la case située exactement dans le coin.
\bigskip
\begin{BVerbatim}[boxwidth=11cm,baseline=c]
@@ -746,8 +794,9 @@ exactement dans le coin.
\subsection{La commande \textbackslash diagbox}
-La commande |\diagbox| (inspirée par l'extension \pkg{diagbox}) permet, quand elle est utilisée dans une case, de
-couper cette case selon une diagonale descendante.\footnote{L'auteur de ce document considère que ce type de
+La commande |\diagbox| (inspirée par l'extension \pkg{diagbox}) permet, quand
+elle est utilisée dans une case, de couper cette case selon une diagonale
+descendante.\footnote{L'auteur de ce document considère que ce type de
construction est un piètre choix graphique.}
\medskip
@@ -776,9 +825,10 @@ Cette commande |\diagbox| peut aussi être utilisée dans un |\Block|.
\subsection{Filets en pointillés}
-Dans les environnements de \pkg{nicematrix}, il est possible d'utiliser la commande |\hdottedline| (fournie
-par \pkg{nicematrix}) qui est l'équivalent pour les pointillés des commandes |\hline| et |\hdashline|
-(cette dernière étant une commande de \pkg{arydshln}).
+Dans les environnements de \pkg{nicematrix}, il est possible d'utiliser la
+commande |\hdottedline| (fournie par \pkg{nicematrix}) qui est l'équivalent pour
+les pointillés des commandes |\hline| et |\hdashline| (cette dernière étant une
+commande de \pkg{arydshln}).
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
@@ -798,8 +848,9 @@ $\begin{pNiceMatrix}
\bigskip
-Dans les environnements avec un préambule explicite (comme |{NiceTabular}|, |{NiceArray}|, etc.), il est possible
-de dessiner un trait vertical en pointillés avec le spécificateur «|:|».
+Dans les environnements avec un préambule explicite (comme |{NiceTabular}|,
+|{NiceArray}|, etc.), il est possible de dessiner un trait vertical en
+pointillés avec le spécificateur «|:|».
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
@@ -816,47 +867,77 @@ $\begin{pNiceArray}{cccc:c}
\end{pNiceArray}$
\bigskip
-Il est possible de changer dans \pkg{nicematrix} la lettre utilisée pour indiquer dans le préambule un trait
-vertical en pointillés avec l'option |letter-for-dotted-lines| disponible dans |\NiceMatrixOptions|.
+Il est possible de changer dans \pkg{nicematrix} la lettre utilisée pour
+indiquer dans le préambule un trait vertical en pointillés avec l'option
+|letter-for-dotted-lines| disponible dans |\NiceMatrixOptions|.
\bigskip
-\emph{Remarque} : Quand l'extension \pkg{array} (sur laquelle s'appuie \pkg{nicematrix}) est chargée, les traits
-verticaux et horizontaux que l'on insère rendent le tableau plus large ou plus long d'une quantité égale à la
-largeur du trait\footnote{En fait, cela est vrai pour |\hline| et «\verb+|+» mais pas pour |\cline|.}. Avec
-\pkg{nicematrix}, les lignes en pointillés tracées par |\hdottedline| et «|:|» ont le même effet.
+\emph{Remarque} : Quand l'extension \pkg{array} (sur laquelle s'appuie
+\pkg{nicematrix}) est chargée, les traits verticaux et horizontaux que l'on
+insère rendent le tableau plus large ou plus long d'une quantité égale à la
+largeur du trait\footnote{En fait, cela est vrai pour |\hline| et «\verb+|+»
+ mais pas pour |\cline| : cf. p.~\pageref{remark-cline}}. Avec
+\pkg{nicematrix}, les lignes en pointillés tracées par |\hdottedline| et «|:|»
+ont le même effet.
\section{Les couleurs des rangées et des colonnes}
-L'extension \pkg{colortbl} permet de colorier des cases, des rangées ou des colonnes d'un tableau. Néanmoins,
-l'affichage du \textsc{pdf} résultant n'est pas toujours parfait, en particulier quand on utilise également des
-filets. Dans certains lecteurs de \textsc{pdf}, des filets verticaux semblent disparaître. De fines lignes blanches
-peuvent également apparaître.
+\subsection{Utilisation de colortbl}
+
+Rappelons que l'extension \pkg{colortbl} peut être chargée directement par
+|\usepackage{colortbl}| ou en chargeant l'extension \pkg{xcolor} avec l'option
+|table| : |\usepackage[table]{xcolor}|.
\medskip
-L'extension \pkg{nicematrix} propose des outils similaires qui ne présentent pas ces inconvénients. Elle propose
-une clé |code-before|\footnote{Il existe aussi une clé |code-after| : cf. p.~\pageref{code-after}.} pour du code
-qui sera exécuté \emph{avant} le tracé du tableau. Dans ce |code-before|, de nouvelles commandes sont disponibles :
-|\cellcolor|, |\rectanglecolor|, |\rowcolor|, |\columncolor|, |\rowcolors| et |\chessboardcolors|.
-\label{code-before}
+Comme l'extension \pkg{nicematrix} est fondée sur \pkg{array}, il est possible
+d'utiliser \pkg{colortbl} avec \pkg{nicematrix}.
\medskip
-Ces outils sont indépendants de \pkg{colortbl}.\footnote{On peut donc colorier les filets, les cellules, les
- rangées, les colonnes, etc. sans charger \pkg{colortbl}. Le présent document ne charge pas \pkg{colortbl}.}
+Il y a néanmoins deux inconvénients :
+\begin{itemize}
+\item L'extension \pkg{colortbl} patche \pkg{array}, ce qui entraîne des
+incompatibilités (par exemple avec la commande |\hdotsfor|).
+
+\item L'extension \pkg{colortbl} construit le tableau ligne par ligne, en
+alternant rectangles colorés, filets et contenu des cases. Le \textsc{pdf}
+résultant déroute certains lecteurs de \textsc{pdf} et on a des artefacts
+d'affichage : des filets verticaux semblent disparaître ; au contraire, de fines
+lignes blanches peuvent apparaître. L'extension \pkg{nicematrix} proposent des
+outils qui évitent ces inconvénients.
+\end{itemize}
+
+\subsection{Les outils de nicematrix dans le code-before}
+
+L'extension \pkg{nicematrix} proposent des outils (indépendants de
+\pkg{colortbl}) pour tracer d'abord les rectangles colorés, puis le contenu des
+cases et les filets. Cette manière de faire est plus dans l'esprit du «modèle du
+peintre» des formats PostScript et \textsc{pdf} et convient donc mieux aux
+lecteurs de \textsc{pdf}. L'inconvénient est qu'elle nécessite plusieurs
+compilations successives.
+
+\medskip
+L'extension \pkg{nicematrix} fournit une clé |code-before| pour du code qui sera
+exécuté avant le tracé du tableau. De nouvelles commandes y sont disponibles :
+|\cellcolor|, |\rectanglecolor|, |\rowcolor|, |\columncolor|, |\rowcolors| et
+|\chessboardcolors|.
+\label{code-before}
\medskip
-Toutes ces commandes acceptent un argument optionnel (entre crochets et en première position) qui est le modèle
-colorimétrique pour la spécification des couleurs.
+Toutes ces commandes acceptent un argument optionnel (entre crochets et en
+première position) qui est le modèle colorimétrique pour la spécification des
+couleurs.
\medskip
\begin{itemize}
-\item La commande |\cellcolor| tient son nom de la commande |\cellcolor| de \pkg{colortbl}.
+\item La commande |\cellcolor| tient son nom de la commande |\cellcolor| de
+\pkg{colortbl}.
-Elle prend en arguments obligatoires une couleur et une liste de cases sous le format $i$-$j$ où $i$ est le
-numéro de ligne et $j$ le numéro de colonne.
+Elle prend en arguments obligatoires une couleur et une liste de cases sous le
+format $i$-$j$ où $i$ est le numéro de ligne et $j$ le numéro de colonne.
\medskip
\begin{scope}
@@ -878,8 +959,9 @@ h & i & j \\ \hline
\end{scope}
\bigskip
-\item La commande |\rectanglecolor| prend trois arguments obligatoires. Le premier est la couleur, les deux
-suivants fournissent la case en haut à gauche et la case en bas à droite du rectangle.
+\item La commande |\rectanglecolor| prend trois arguments obligatoires. Le
+premier est la couleur, les deux suivants fournissent la case en haut à gauche
+et la case en bas à droite du rectangle.
\medskip
\begin{scope}
@@ -903,9 +985,11 @@ h & i & j \\ \hline
\bigskip
-\item La commande |\rowcolor| doit son nom à la commande |\rowcolor| de \pkg{colortbl}. Son premier argument
-obligatoire est la couleur et le deuxième est une liste de numéros de rangées ou bien d'intervalles de rangées sous
-la forme $a$-$b$ (un intervalle de la forme $a$- représente toutes les rangées à partir de la rangée~$a$).
+\item La commande |\rowcolor| doit son nom à la commande |\rowcolor| de
+\pkg{colortbl}. Son premier argument obligatoire est la couleur et le deuxième
+est une liste de numéros de rangées ou bien d'intervalles de rangées sous la
+forme $a$-$b$ (un intervalle de la forme $a$- représente toutes les rangées à
+partir de la rangée~$a$).
\medskip
@@ -943,14 +1027,16 @@ a_{10} & b_{10} & c_{10} \\
\bigskip
-\item La commande |\columncolor| doit son nom à la commande |\columncolor| de \pkg{colortbl}. Sa syntaxe est
-similaire à celle de |\rowcolor|.
+\item La commande |\columncolor| doit son nom à la commande |\columncolor| de
+\pkg{colortbl}. Sa syntaxe est similaire à celle de |\rowcolor|.
\bigskip
-\item La commande |\rowcolors| (avec un \emph{s}) doit son nom à la commande |\rowcolors| de
-\pkg{xcolor}\footnote{La commande |\rowcolors| de \pkg{xcolor} est disponible quand \pkg{xcolor} est chargé avec
- l'option |table|.}. Le \emph{s} rappelle qu'il y a deux couleurs. Elle colorie alternativement les rangées avec
-les deux couleurs à partir de la rangée dont le numéro est donné en premier argument (obligatoire).
+\item La commande |\rowcolors| (avec un \emph{s}) doit son nom à la commande
+|\rowcolors| de \pkg{xcolor}\footnote{La commande |\rowcolors| de \pkg{xcolor}
+ est disponible quand \pkg{xcolor} est chargé avec l'option |table|.}. Le
+\emph{s} rappelle qu'il y a deux couleurs. Elle colorie alternativement les
+rangées avec les deux couleurs à partir de la rangée dont le numéro est donné en
+premier argument (obligatoire).
\medskip
\begin{scope}
@@ -978,8 +1064,8 @@ Estelle & 15
\bigskip
-\item La commande |\chessboardcolors| prend en arguments obligatoires deux couleurs et colorie les cases en
-quinconces avec les deux couleurs.
+\item La commande |\chessboardcolors| prend en arguments obligatoires deux
+couleurs et colorie les cases en quinconces avec les deux couleurs.
\medskip
\begin{scope}
@@ -1000,12 +1086,13 @@ $\begin{pNiceMatrix}%
\end{scope}
\medskip
-On a utilisé la clé |r| qui impose que toutes les colonnes soient alignées à droite (cf. p.~\pageref{key-R}).
+On a utilisé la clé |r| qui impose que toutes les colonnes soient alignées à
+droite (cf. p.~\pageref{key-R}).
\end{itemize}
\bigskip
-On remarquera que ces commandes sont compatibles avec les commandes de \pkg{booktabs} (|\toprule|, |\midrule|,
-|\bottomrule|, etc).
+On remarquera que ces commandes sont compatibles avec les commandes de
+\pkg{booktabs} (|\toprule|, |\midrule|, |\bottomrule|, etc).
\medskip
\begin{scope}
@@ -1050,14 +1137,61 @@ spécial & 12 & 12 & 0.5 & 70 \\
On a utilisé le type de colonne |S| de \pkg{siunitx}.
+\subsection{Outils de coloriage avec la syntaxe de colortbl}
+
+On peut accéder aux outils de coloriage précédents avec une syntaxe proche de
+celle proposée par \pkg{colortbl}. On doit pour cela utiliser la clé
+|colortbl-like| dans l'environnement concerné.\footnote{Pour le moment, cette
+ clé n'est pas disponible disponible dans |\NiceMatrixOptions|.}
+
+On a alors accès aux trois commandes suivantes :
+\begin{itemize}
+\item |\cellcolor| qui colorie la case courante ;
+\item |\rowcolor| à utiliser dans une case et qui colorie le reste de la rangée
+;
+\item |\columncolor| à utiliser dans le préambule de la même manière que la
+commande éponyme de \pkg{colortbl}\footnote{Contrairement à la commande
+|\columncolor| de \pkg{colortbl}, celle-ci peut apparaître à l'intérieur d'une
+autre commande, elle-même utilisée dans le préambule.}.
+\end{itemize}
+
+\medskip
+\begin{Verbatim}
+\begin{NiceTabular}[colortbl-like]{>{~emphase#\columncolor{blue!15}}@ccc}
+\toprule
+~emphase#\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]{>{\columncolor{blue!15}}ccc}
+\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}
\label{width}
-Dans les environnements avec un préambule explicite (comme |{NiceTabular}|, |{NiceArray}|, etc.), il est possible
-de fixer la largeur d'une colonne avec les lettres classiques |w| et |W| de l'extension \pkg{array}. Dans
-|{NiceTabular}|, les cases des colonnes de ce type sont composées en mode texte mais, dans |{NiceArray}|,
-|{pNiceArray}|, etc., elles sont composées en mode mathématique (alors que dans |{array}| de \pkg{array}, elles
-sont composées en mode texte).
+Dans les environnements avec un préambule explicite (comme |{NiceTabular}|,
+|{NiceArray}|, etc.), il est possible de fixer la largeur d'une colonne avec les
+lettres classiques |w| et |W| de l'extension \pkg{array}.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=9cm]
@@ -1075,8 +1209,9 @@ Rio & Tokyo & Oslo
\bigskip
-Dans les environnements de \pkg{nicematrix}, il est aussi possible de fixer la largeur \emph{minimale} de toutes
-les colonnes de la matrice directement avec l'option |columns-width|.
+Dans les environnements de \pkg{nicematrix}, il est aussi possible de fixer la
+largeur \emph{minimale} de toutes les colonnes de la matrice directement avec
+l'option |columns-width|.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1093,15 +1228,17 @@ $\begin{pNiceMatrix}[columns-width = 1cm]
\end{pNiceMatrix}$
\medskip
-Notez que l'espace inséré entre deux colonnes (égal à 2 |\tabcolsep| dans |{NiceTabular}| et à 2 |\arraycolsep|
-dans les autres environnements) n'est pas supprimé (il est évidemment possible de le supprimer en mettant
-|\tabcolsep| ou |\arraycolsep| à~$0$ avant).
+Notez que l'espace inséré entre deux colonnes (égal à 2 |\tabcolsep| dans
+|{NiceTabular}| et à 2 |\arraycolsep| dans les autres environnements) n'est pas
+supprimé (il est évidemment possible de le supprimer en mettant |\tabcolsep| ou
+|\arraycolsep| à~$0$ avant).
\bigskip
-Il est possible de donner la valeur spéciale |auto| à l'option |columns-width|: toutes les colonnes du tableau
-auront alors une largeur égale à la largeur de la case la plus large du tableau.\footnote{Le résultat est atteint
- dès la première compilation (mais PGF/Tikz écrivant des informations dans le fichier |.aux|, un message demandant une
- deuxième compilation apparaîtra).}\par\nobreak
+Il est possible de donner la valeur spéciale |auto| à l'option |columns-width|:
+toutes les colonnes du tableau auront alors une largeur égale à la largeur de la
+case la plus large du tableau.\footnote{Le résultat est atteint dès la première
+ compilation (mais PGF/Tikz écrivant des informations dans le fichier |.aux|,
+ un message demandant une deuxième compilation apparaîtra).}\par\nobreak
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1118,8 +1255,9 @@ $\begin{pNiceMatrix}[columns-width = auto]
\end{pNiceMatrix}$
\bigskip
-Sans surprise, il est possible de fixer la largeur minimale de toutes les colonnes de toutes les matrices dans une
-certaine portion de document avec la commande |\NiceMatrixOptions|.\par\nobreak
+Sans surprise, il est possible de fixer la largeur minimale de toutes les
+colonnes de toutes les matrices dans une certaine portion de document avec la
+commande |\NiceMatrixOptions|.\par\nobreak
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
@@ -1147,12 +1285,15 @@ c & d
\bigskip
-Mais il est aussi possible de fixer une zone dans laquelle toutes les matrices auront leurs colonnes de la même
-largeur, égale à la largeur de la case la plus large de toutes les matrices de la zone. Cette construction utilise
-l'environnement |{NiceMatrixBlock}| avec l'option |auto-columns-width|\footnote{Pour le moment, c'est le seul
- usage de l'environnement |{NiceMatrixBlock}| mais il pourrait y en avoir davantage dans le futur.}.
-L'environnement |{NiceMatrixBlock}| n'a pas de rapport direct avec la commande |\Block| présentée précédemment dans
-ce document (cf.~p.~\pageref{Block}).
+Mais il est aussi possible de fixer une zone dans laquelle toutes les matrices
+auront leurs colonnes de la même largeur, égale à la largeur de la case la plus
+large de toutes les matrices de la zone. Cette construction utilise
+l'environnement |{NiceMatrixBlock}| avec l'option
+|auto-columns-width|\footnote{Pour le moment, c'est le seul usage de
+ l'environnement |{NiceMatrixBlock}| mais il pourrait y en avoir davantage dans
+ le futur.}. L'environnement |{NiceMatrixBlock}| n'a pas de rapport direct avec
+la commande |\Block| présentée précédemment dans ce document
+(cf.~p.~\pageref{Block}).
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
@@ -1185,12 +1326,13 @@ $\begin{array}{c}
\bigskip
\section{Les rangées et colonnes extérieures}
-Les environnements de \pkg{nicematrix} permettent de composer des rangées et des colonnes «extérieures» grâce aux options
-|first-row|, |last-row|, |first-col| et |last-col|.
+Les environnements de \pkg{nicematrix} permettent de composer des rangées et des
+colonnes «extérieures» grâce aux options |first-row|, |last-row|, |first-col| et
+|last-col|.
\label{exterior}
-Si elle est présente, la «première rangée» (extérieure) est numérotée par $0$ (et non $1$). Il en est de même pour
-la «première colonne».
+Si elle est présente, la «première rangée» (extérieure) est numérotée par $0$
+(et non $1$). Il en est de même pour la «première colonne».
\begin{Verbatim}
$\begin{pNiceMatrix}[~emphase#first-row,last-row,first-col,last-col@,nullify-dots]
@@ -1220,29 +1362,34 @@ Les lignes pointillées ont été tracées avec les outils présentés p.~\pager
Il y a plusieurs remarques à formuler.
%
\begin{itemize}[beginpenalty=10000]
-\item Si on utilise un environnement avec préambule explicite (c'est-à-dire |{NiceArray}| ou l'une de ses
-variantes), on ne doit pas mettre dans ce préambule de spécification de colonne pour les éventuelles première et
-dernière colonne : ce sera automatiquement (et nécessairement) une colonne |R| pour la première colonne et une
-colonne |L| pour la dernière.
+\item Si on utilise un environnement avec préambule explicite (c'est-à-dire
+|{NiceArray}| ou l'une de ses variantes), on ne doit pas mettre dans ce
+préambule de spécification de colonne pour les éventuelles première et dernière
+colonne : ce sera automatiquement (et nécessairement) une colonne |R| pour la
+première colonne et une colonne |L| pour la dernière.
\item On peut se demander comment \pkg{nicematrix} détermine le nombre de rangées et de colonnes nécessaires à la
composition de la «dernière rangée» et de la «dernière colonne».
\begin{itemize}
-\item Dans le cas d'un environnement avec préambule, comme |{NiceTabular}| ou |{pNiceArray}|, le nombre de colonnes
-se déduit évidemment du préambule.
-
-\item Dans le cas où l'option |light-syntax| (cf. p. \pageref{light-syntax}) est utilisée, \pkg{nicematrix} profite
-du fait que cette option nécessite de toutes manières le chargement complet du contenu de l'environnement (d'où
-l'impossibilité de mettre du verbatim dans ce cas-là) avant composition du tableau. L'analyse du contenu de
-l'environnement donne le nombre de rangées (mais pas le nombre de colonnes).
-
-\item Dans les autres cas, \pkg{nicematrix} détermine le nombre de rangées et de colonnes à la première compilation
-et l'écrit dans le fichier |.aux| pour pouvoir l'utiliser à la compilation suivante.
-
-\textsl{Néanmoins, il est possible de donner le numéro de la dernière rangée et le numéro de la dernière colonne en
-arguments des options |last-row| et |last-col|, ce qui permettra d'accélérer le processus complet de
-compilation.} C'est ce que nous ferons dans la suite.
+\item Dans le cas d'un environnement avec préambule, comme |{NiceTabular}| ou
+|{pNiceArray}|, le nombre de colonnes se déduit évidemment du préambule.
+
+\item Dans le cas où l'option |light-syntax| (cf. p. \pageref{light-syntax}) est
+utilisée, \pkg{nicematrix} profite du fait que cette option nécessite de toutes
+manières le chargement complet du contenu de l'environnement (d'où
+l'impossibilité de mettre du verbatim dans ce cas-là) avant composition du
+tableau. L'analyse du contenu de l'environnement donne le nombre de rangées
+(mais pas le nombre de colonnes).
+
+\item Dans les autres cas, \pkg{nicematrix} détermine le nombre de rangées et de
+colonnes à la première compilation et l'écrit dans le fichier |.aux| pour
+pouvoir l'utiliser à la compilation suivante.
+
+\textsl{Néanmoins, il est possible de donner le numéro de la dernière rangée et
+ le numéro de la dernière colonne en arguments des options |last-row| et
+ |last-col|, ce qui permettra d'accélérer le processus complet de compilation.}
+C'est ce que nous ferons dans la suite.
\end{itemize}
\end{itemize}
@@ -1250,9 +1397,10 @@ compilation.} C'est ce que nous ferons dans la suite.
\bigskip
-On peut contrôler l'apparence de ces rangées et colonnes avec les options |code-for-first-row|,
-|code-for-last-row|, |code-for-first-col| et |code-for-last-col|. Ces options sont des listes de tokens qui seront
-insérées au début de chaque case de la rangée ou de la colonne considérée.
+On peut contrôler l'apparence de ces rangées et colonnes avec les options
+|code-for-first-row|, |code-for-last-row|, |code-for-first-col| et
+|code-for-last-col|. Ces options sont des listes de tokens qui seront insérées
+au début de chaque case de la rangée ou de la colonne considérée.
\begin{Verbatim}
\NiceMatrixOptions{~emphase#code-for-first-row@ = \color{red},
@@ -1292,17 +1440,21 @@ L_4 & a_{41} & a_{42} & a_{43} & a_{44} & L_4 \\
\emph{Remarques}
\begin{itemize}[beginpenalty=10000]
-\item Comme on peut le voir dans l'exemple précédent, les filets horizontaux et verticaux ne s'étendent pas dans
-les rangées et colonnes extérieures.
-
-Néanmoins, si on veut définir de nouveaux spécificateurs de colonnes pour des filets (par exemple plus épais), on
-aura sans doute intérêt à utiliser la commande |\OnlyMainNiceMatrix| décrite p.~\pageref{OnlyMainNiceMatrix}.
-\item Une spécification de couleur présente dans |code-for-first-row| s'applique à une ligne pointillée tracée
-dans cette «première rangée» (sauf si une valeur a été donnée à |xdots/color|). Idem pour les autres.
-\item Sans surprise, une éventuelle option |columns-width| (décrite p.~\pageref{width}) ne s'applique pas à la
-«première colonne» ni à la «dernière colonne».
-\item Pour des raisons techniques, il n'est pas possible d'utiliser l'option de la commande |\\| après la
-«première rangée» ou avant la «dernière rangée» (le placement des délimiteurs serait erroné).
+\item Comme on peut le voir dans l'exemple précédent, les filets horizontaux et
+verticaux ne s'étendent pas dans les rangées et colonnes extérieures.
+
+Néanmoins, si on veut définir de nouveaux spécificateurs de colonnes pour des
+filets (par exemple plus épais), on aura sans doute intérêt à utiliser la
+commande |\OnlyMainNiceMatrix| décrite p.~\pageref{OnlyMainNiceMatrix}.
+\item Une spécification de couleur présente dans |code-for-first-row| s'applique
+à une ligne pointillée tracée dans cette «première rangée» (sauf si une valeur a
+été donnée à |xdots/color|). Idem pour les autres.
+\item Sans surprise, une éventuelle option |columns-width| (décrite
+p.~\pageref{width}) ne s'applique pas à la «première colonne» ni à la «dernière
+colonne».
+\item Pour des raisons techniques, il n'est pas possible d'utiliser l'option de
+la commande |\\| après la «première rangée» ou avant la «dernière rangée» (le
+placement des délimiteurs serait erroné).
\end{itemize}
@@ -1312,24 +1464,27 @@ dans cette «première rangée» (sauf si une valeur a été donnée à |xdots/c
\label{Cdots}
-À l'intérieur des environnements de l'extension \pkg{nicematrix}, de nouvelles commandes sont définies : |\Ldots|,
-|\Cdots|, |\Vdots|, |\Ddots|, et |\Iddots|. Ces commandes sont conçues pour être utilisées à la place de |\dots|,
-|\cdots|, |\vdots|, |\ddots| et |\iddots|.\footnote{La commande |\iddots|, définie dans \pkg{nicematrix}, est une
- variante de |\ddots| avec les points allant vers le haut. Si \pkg{mathdots} est chargée, la
- version de \pkg{mathdots} est utilisée. Elle correspond à la commande |\adots| de \pkg{unicode-math}.}
-\newcounter{fniddots}
-\setcounter{fniddots}{\thefootnote}
+À l'intérieur des environnements de l'extension \pkg{nicematrix}, de nouvelles
+commandes sont définies : |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, et |\Iddots|.
+Ces commandes sont conçues pour être utilisées à la place de |\dots|, |\cdots|,
+|\vdots|, |\ddots| et |\iddots|.\footnote{La commande |\iddots|, définie dans
+ \pkg{nicematrix}, est une variante de |\ddots| avec les points allant vers le
+ haut. Si \pkg{mathdots} est chargée, la version de \pkg{mathdots} est
+ utilisée. Elle correspond à la commande |\adots| de \pkg{unicode-math}.}
+\newcounter{fniddots} \setcounter{fniddots}{\thefootnote}
\smallskip
-Chacune de ces commandes doit être utilisée seule dans la case du tableau et elle trace une ligne en pointillés
-entre les premières cases non vides\footnote{La définition précise de ce qui est considéré comme une «case vide»
- est donnée plus loin (cf. p.~\pageref{empty-cells}).} situées de part et d'autre de la case courante. Bien
-entendu, pour |\Ldots| et |\Cdots|, c'est une ligne horizontale ; pour |\Vdots|, c'est une ligne verticale et pour
-|\Ddots| et |\Iddots|, ce sont des lignes diagonales. On peut changer la couleur d'une ligne avec
-l'option~|color|.\footnote{Il est aussi possible de changer la couleur de toutes ces lignes pointillées avec
- l'option |xdots/color| (\textsl{xdots} pour rappeler que cela s'applique à |\Cdots|, |\Ldots|, |Vdots|, etc.) :
- cf. p.~\pageref{customization}).
-}\par\nobreak
+Chacune de ces commandes doit être utilisée seule dans la case du tableau et
+elle trace une ligne en pointillés entre les premières cases non
+vides\footnote{La définition précise de ce qui est considéré comme une «case
+ vide» est donnée plus loin (cf. p.~\pageref{empty-cells}).} situées de part et
+d'autre de la case courante. Bien entendu, pour |\Ldots| et |\Cdots|, c'est une
+ligne horizontale ; pour |\Vdots|, c'est une ligne verticale et pour |\Ddots| et
+|\Iddots|, ce sont des lignes diagonales. On peut changer la couleur d'une ligne
+avec l'option~|color|.\footnote{Il est aussi possible de changer la couleur de
+ toutes ces lignes pointillées avec l'option |xdots/color| (\textsl{xdots} pour
+ rappeler que cela s'applique à |\Cdots|, |\Ldots|, |Vdots|, etc.) : cf.
+ p.~\pageref{customization}). }\par\nobreak
\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1352,8 +1507,8 @@ a_1 & a_2 & & & a_n
-\interitem
-Pour représenter la matrice nulle, on peut choisir d'utiliser le codage suivant :\par\nobreak
+\interitem Pour représenter la matrice nulle, on peut choisir d'utiliser le
+codage suivant :\par\nobreak
\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1370,9 +1525,10 @@ $\begin{bNiceMatrix}
\end{bNiceMatrix}$
\bigskip
-On peut néanmoins souhaiter une matrice plus grande. Habituellement, dans un tel cas, les utilisateurs de LaTeX
-ajoutent une nouvelle ligne et une nouvelle colonne. Il est possible d'utiliser la même méthode avec
-\pkg{nicematrix} :\par\nobreak
+On peut néanmoins souhaiter une matrice plus grande. Habituellement, dans un tel
+cas, les utilisateurs de LaTeX ajoutent une nouvelle ligne et une nouvelle
+colonne. Il est possible d'utiliser la même méthode avec \pkg{nicematrix}
+:\par\nobreak
\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1391,13 +1547,12 @@ $\begin{bNiceMatrix}
\end{bNiceMatrix}$
\bigskip
-Dans la première colonne de cet exemple, il y a deux instructions |\Vdots| mais une seule ligne en pointillés sera
-tracée (il n'y a pas d'objets qui se superposent dans le fichier \textsc{pdf} résultant\footnote{Et il n'est pas
- possible de tracer une ligne |\Ldots| et une ligne |\Cdots| entre les mêmes cases.}).
+Dans la première colonne de cet exemple, il y a deux instructions |\Vdots| mais,
+bien entendu, une seule ligne en pointillés sera.
\bigskip
-En fait, dans cet exemple, il aurait été possible de tracer la même matrice plus rapidement avec le codage suivant
-:\par\nobreak
+En fait, dans cet exemple, il aurait été possible de tracer la même matrice plus
+rapidement avec le codage suivant :\par\nobreak
\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1416,15 +1571,19 @@ $\begin{bNiceMatrix}
\end{bNiceMatrix}$
\bigskip
-Il y a aussi d'autres moyens de changer la taille d'une matrice. On pourrait vouloir utiliser l'argument optionnel
-de la commande~|\\| pour l'espacement vertical et la commande~|\hspace*| dans une case pour l'espacement
-horizontal.\footnote{Dans \pkg{nicematrix}, il faut utiliser |\hspace*| et non |\hspace| car \pkg{nicematrix}
- utilise \pkg{array}. Remarquons aussi que l'on peut également régler la largeur des colonnes en utilisant l'environnement |{NiceArray}| (ou
- une de ses variantes) avec une colonne de type~|w| ou |W|: cf. p.~\pageref{width}}
-
-Toutefois, une commande~|\hspace*| pourrait interférer dans la construction des lignes en pointillés. C'est
-pourquoi l'extension \pkg{nicematrix} fournit une commande~|\Hspace| qui est une variante de |\hspace| transparente
-pour la construction des lignes en pointillés de \pkg{nicematrix}.\par\nobreak
+Il y a aussi d'autres moyens de changer la taille d'une matrice. On pourrait
+vouloir utiliser l'argument optionnel de la commande~|\\| pour l'espacement
+vertical et la commande~|\hspace*| dans une case pour l'espacement
+horizontal.\footnote{Dans \pkg{nicematrix}, il faut utiliser |\hspace*| et non
+ |\hspace| car \pkg{nicematrix} utilise \pkg{array}. Remarquons aussi que l'on
+ peut également régler la largeur des colonnes en utilisant l'environnement
+ |{NiceArray}| (ou une de ses variantes) avec une colonne de type~|w| ou |W|:
+ cf. p.~\pageref{width}}
+
+Toutefois, une commande~|\hspace*| pourrait interférer dans la construction des
+lignes en pointillés. C'est pourquoi l'extension \pkg{nicematrix} fournit une
+commande~|\Hspace| qui est une variante de |\hspace| transparente pour la
+construction des lignes en pointillés de \pkg{nicematrix}.\par\nobreak
\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1442,8 +1601,8 @@ $\begin{bNiceMatrix}
\subsection{L'option nullify-dots}
-Considérons la matrice suivante qui a été composée classiquement avec l'environnement |{pmatrix}| de
-\pkg{amsmath}.\par\nobreak
+Considérons la matrice suivante qui a été composée classiquement avec
+l'environnement |{pmatrix}| de \pkg{amsmath}.\par\nobreak
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1459,8 +1618,8 @@ x & & & & & x
\bigskip
-Si nous ajoutons des instructions |\ldots| dans la seconde rangée, la géométrie de la matrice est
-modifiée.\par\nobreak
+Si nous ajoutons des instructions |\ldots| dans la seconde rangée, la géométrie
+de la matrice est modifiée.\par\nobreak
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1475,8 +1634,9 @@ x & \ldots & \ldots & \ldots & \ldots & x
\end{pmatrix}$
\bigskip
-Par défaut, avec \pkg{nicematrix}, si nous remplaçons |{pmatrix}| par |{pNiceMatrix}| et |\ldots| par |\Ldots|, la
-géométrie de la matrice n'est pas changée.\par\nobreak
+Par défaut, avec \pkg{nicematrix}, si nous remplaçons |{pmatrix}| par
+|{pNiceMatrix}| et |\ldots| par |\Ldots|, la géométrie de la matrice n'est pas
+changée.\par\nobreak
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -1491,8 +1651,9 @@ x & \Ldots & \Ldots & \Ldots & \Ldots & x
\end{pNiceMatrix}$
\bigskip
-On pourrait toutefois préférer la géométrie de la première matrice $A$ et vouloir avoir la même géométrie avec une
-ligne en pointillés continue dans la seconde rangée. C'est possible en utilisant l'option |nullify-dots| (et une
+On pourrait toutefois préférer la géométrie de la première matrice $A$ et
+vouloir avoir la même géométrie avec une ligne en pointillés continue dans la
+seconde rangée. C'est possible en utilisant l'option |nullify-dots| (et une
seule instruction |\Ldots| suffit).\par\nobreak
\medskip
@@ -1508,19 +1669,21 @@ x & \Ldots & & & & x
\end{pNiceMatrix}$
\medskip
-L'option |nullify-dots| «smashe» les instructions |\Ldots| (et ses variantes) horizontalement mais aussi
-verticalement.
+L'option |nullify-dots| «smashe» les instructions |\Ldots| (et ses variantes)
+horizontalement mais aussi verticalement.
-\subsection{La commande \textbackslash Hdotsfor}
+\subsection{Les commandes \textbackslash Hdotsfor et \textbackslash Vdotsfor}
-Certaines personnes utilisent habituellement la commande |\hdotsfor| de l'extension \pkg{amsmath} pour tracer des
-lignes en pointillés horizontales dans une matrice. Dans les environnements de \pkg{nicematrix}, il convient
-d'utiliser |\Hdotsfor| à la place pour avoir les lignes en pointillés similaires à toutes celles tracées par
-l'extension \pkg{nicematrix}.
+Certaines personnes utilisent habituellement la commande |\hdotsfor| de
+l'extension \pkg{amsmath} pour tracer des lignes en pointillés horizontales dans
+une matrice. Dans les environnements de \pkg{nicematrix}, il convient d'utiliser
+|\Hdotsfor| à la place pour avoir les lignes en pointillés similaires à toutes
+celles tracées par l'extension \pkg{nicematrix}.
-Comme avec les autres commandes de \pkg{nicematrix} (comme |\Cdots|, |\Ldots|, |\Vdots|, etc.), la ligne en
-pointillés tracée par |\Hdotsfor| s'étend jusqu'au contenu des cases de part et d'autre.
+Comme avec les autres commandes de \pkg{nicematrix} (comme |\Cdots|, |\Ldots|,
+|\Vdots|, etc.), la ligne en pointillés tracée par |\Hdotsfor| s'étend jusqu'au
+contenu des cases de part et d'autre.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=7cm]
@@ -1539,8 +1702,8 @@ $\begin{pNiceMatrix}
\end{pNiceMatrix}$
\bigskip
-Néanmoins, si ces cases sont vides, la ligne en pointillés s'étend seulement dans les cases spécifiées par
-l'argument de |\Hdotsfor| (par conception).
+Néanmoins, si ces cases sont vides, la ligne en pointillés s'étend seulement
+dans les cases spécifiées par l'argument de |\Hdotsfor| (par conception).
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=7cm]
@@ -1559,38 +1722,81 @@ $\begin{pNiceMatrix}
\end{pNiceMatrix}$
\medskip
-Remarque : Contrairement à la commande |\hdotsfor| de \pkg{amsmath}, la commande |\Hdotsfor| est utilisable lorsque
-l'extension \pkg{colortbl} est chargée (mais vous risquez d'avoir des problèmes si vous utilisez |\rowcolor| sur la
-même rangée que |\Hdotsfor|).
+Remarque : Contrairement à la commande |\hdotsfor| de \pkg{amsmath}, la commande
+|\Hdotsfor| est utilisable lorsque l'extension \pkg{colortbl} est chargée (mais
+vous risquez d'avoir des problèmes si vous utilisez |\rowcolor| sur la même
+rangée que |\Hdotsfor|).
+
+\bigskip
+L'extension \pkg{nicematrix} propose aussi une commande |\Vdotsfor| similaire à
+|\Hdotsfor| mais traçant des lignes verticales.
+
+\bigskip
+L'exemple suivant utilise à la fois |\Hdotsfor| et |\Vdotsfor|:
+
+\begin{Verbatim}[formatcom=\small\color{gray}]
+\begin{bNiceMatrix}
+C[a_1,a_1] & \Cdots & C[a_1,a_n]
+ & \hspace*{20mm} & C[a_1,a_1^{(p)}] & \Cdots & C[a_1,a_n^{(p)}] \\
+\Vdots & \Ddots & \Vdots
+ & ~emphase#\Hdotsfor{1}@ & \Vdots & \Ddots & \Vdots \\
+C[a_n,a_1] & \Cdots & C[a_n,a_n]
+ & & C[a_n,a_1^{(p)}] & \Cdots & C[a_n,a_n^{(p)}] \\
+\rule{0pt}{15mm} & ~emphase#\Vdotsfor{1}@ & & \Ddots & & ~emphase#\Vdotsfor{1}@ \\
+C[a_1^{(p)},a_1] & \Cdots & C[a_1^{(p)},a_n]
+ & & C[a_1^{(p)},a_1^{(p)}] & \Cdots & C[a_1^{(p)},a_n^{(p)}] \\
+\Vdots & \Ddots & \Vdots
+ & ~emphase#\Hdotsfor{1}@ & \Vdots & \Ddots & \Vdots \\
+C[a_n^{(p)},a_1] & \Cdots & C[a_n^{(p)},a_n]
+ & & C[a_n^{(p)},a_1^{(p)}] & \Cdots & C[a_n^{(p)},a_n^{(p)}]
+\end{bNiceMatrix}
+\end{Verbatim}
+
+
+\[\begin{bNiceMatrix}
+C[a_1,a_1] & \Cdots & C[a_1,a_n] & \hspace*{20mm} & C[a_1,a_1^{(p)}] & \Cdots & C[a_1,a_n^{(p)}] \\
+\Vdots & \Ddots & \Vdots & \Hdotsfor{1} & \Vdots & \Ddots & \Vdots \\
+C[a_n,a_1] & \Cdots & C[a_n,a_n] & & C[a_n,a_1^{(p)}] & \Cdots & C[a_n,a_n^{(p)}] \\
+\rule{0pt}{15mm} & \Vdotsfor{1} & & \Ddots & & \Vdotsfor{1} \\
+C[a_1^{(p)},a_1] & \Cdots & C[a_1^{(p)},a_n] & & C[a_1^{(p)},a_1^{(p)}] & \Cdots & C[a_1^{(p)},a_n^{(p)}] \\
+\Vdots & \Ddots & \Vdots & \Hdotsfor{1} & \Vdots & \Ddots & \Vdots \\
+C[a_n^{(p)},a_1] & \Cdots & C[a_n^{(p)},a_n] & & C[a_n^{(p)},a_1^{(p)}] & \Cdots & C[a_n^{(p)},a_n^{(p)}]
+\end{bNiceMatrix}\]
+
+
\subsection{Comment créer les lignes en pointillés de manière transparente}
-L'extension \pkg{nicematrix} fournit une option appelée |transparent| qui permet d'utiliser du code existant de
-manière transparente dans les environnements de l'\pkg{amsmath} : |{matrix}|, |{pmatrix}|, etc. En fait, cette
-option est un alias pour la conjonction de deux options : |renew-dots| et |renew-matrix|.\footnote{Comme toutes les
- autres options, les options |renew-dots|, |renew-matrix| et |transparent| peuvent être fixées avec la commande
- |\NiceMatrixOptions|, mais elles peuvent aussi être passées en option du |\usepackage| (ce sont les trois
- seules).}
+L'extension \pkg{nicematrix} fournit une option appelée |transparent| qui permet
+d'utiliser du code existant de manière transparente dans les environnements de
+l'\pkg{amsmath} : |{matrix}|, |{pmatrix}|, etc. En fait, cette option est un
+alias pour la conjonction de deux options : |renew-dots| et
+|renew-matrix|.\footnote{Comme toutes les autres options, les options
+ |renew-dots|, |renew-matrix| et |transparent| peuvent être fixées avec la
+ commande |\NiceMatrixOptions|, mais elles peuvent aussi être passées en option
+ du |\usepackage| (ce sont les trois seules).}
\smallskip
\begin{itemize}
\item L'option |renew-dots|\par\nobreak
-Avec cette option, les commandes |\ldots|, |\cdots|, |\vdots|, |\ddots|, |\iddots|\footnotemark[\thefniddots] et
-|\hdotsfor| sont redéfinies dans les environnements de \pkg{nicematrix} et agissent alors comme |\Ldots|, |\Cdots|,
-|\Vdots|, |\Ddots|, |\Iddots| et |\Hdotsfor| ; la commande |\dots| (points de suspension «automatiques» de
-|amsmath|) est aussi redéfinie et se comporte comme |\Ldots|.
+Avec cette option, les commandes |\ldots|, |\cdots|, |\vdots|, |\ddots|,
+|\iddots|\footnotemark[\thefniddots] et |\hdotsfor| sont redéfinies dans les
+environnements de \pkg{nicematrix} et agissent alors comme |\Ldots|, |\Cdots|,
+|\Vdots|, |\Ddots|, |\Iddots| et |\Hdotsfor| ; la commande |\dots| (points de
+suspension «automatiques» de |amsmath|) est aussi redéfinie et se comporte comme
+|\Ldots|.
\item L'option |renew-matrix|\par\nobreak
-Avec cette option, l'environnement |{matrix}| est redéfini et se comporte comme |{NiceMatrix}| et il en est de même
-pour les cinq variantes.
+Avec cette option, l'environnement |{matrix}| est redéfini et se comporte comme
+|{NiceMatrix}| et il en est de même pour les cinq variantes.
\end{itemize}
\bigskip
-Par conséquent, avec l'option |transparent|, un code classique donne directement le résultat fourni par
-\pkg{nicematrix}.\par\nobreak
+Par conséquent, avec l'option |transparent|, un code classique donne directement
+le résultat fourni par \pkg{nicematrix}.\par\nobreak
\bigskip
\begin{scope}
@@ -1615,10 +1821,12 @@ $\begin{pmatrix}
\subsection{Les labels des lignes en pointillés}
-Les commandes |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots| et |\Hdotsfor| (ainsi que la commande |\line| dans
-le |code-after| décrite p.~\pageref{line-in-code-after}) peuvent en fait prendre deux arguments optionnels
-spécifiés par les caractères |_| et |^| pour des labels situés au-dessous et au-dessus de la ligne. Les arguments
-sont composés en mode mathématique avec |\scriptstyle|.
+Les commandes |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots| et |\Hdotsfor|
+(ainsi que la commande |\line| dans le |code-after| décrite
+p.~\pageref{line-in-code-after}) peuvent en fait prendre deux arguments
+optionnels spécifiés par les caractères |_| et |^| pour des labels situés
+au-dessous et au-dessus de la ligne. Les arguments sont composés en mode
+mathématique avec |\scriptstyle|.
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
$\begin{bNiceMatrix}
@@ -1637,9 +1845,10 @@ $\begin{bNiceMatrix}
\label{customization}
-Les lignes pointillées tracées par |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|, |\Iddots| et |\Hdotsfor| (ainsi que par la
-commande |\line| dans le |code-after| décrite p.~\pageref{line-in-code-after}) peuvent être
-paramétrées par trois options (que l'on met entre crochets après la commande) :
+Les lignes pointillées tracées par |\Ldots|, |\Cdots|, |\Vdots|, |\Ddots|,
+|\Iddots| et |\Hdotsfor| (ainsi que par la commande |\line| dans le |code-after|
+décrite p.~\pageref{line-in-code-after}) peuvent être paramétrées par trois
+options (que l'on met entre crochets après la commande) :
%
\begin{itemize}
\item |color| ;
@@ -1647,8 +1856,9 @@ paramétrées par trois options (que l'on met entre crochets après la commande)
\item |line-style|.
\end{itemize}
-Ces options peuvent aussi être fixées avec |\NiceMatrixOptions| ou bien au niveau d'un environnement mais elles
-doivent alors être préfixées par |xdots|, ce qui fait que leurs noms deviennent :
+Ces options peuvent aussi être fixées avec |\NiceMatrixOptions| ou bien au
+niveau d'un environnement mais elles doivent alors être préfixées par |xdots|,
+ce qui fait que leurs noms deviennent :
%
\begin{itemize}
\item |xdots/color| ;
@@ -1662,8 +1872,9 @@ Pour la clarté, dans la suite, on utilisera ces noms-là.
\textbf{L'option xdots/color}\par\nobreak
\smallskip
-L'option |xdots/color| indique bien entendu la couleur de la ligne tracée. On remarquera néanmoins que les lignes
-tracées dans les rangées et colonnes extérieures (décrites plus loin) bénificient d'un régime spécial : cf.
+L'option |xdots/color| indique bien entendu la couleur de la ligne tracée. On
+remarquera néanmoins que les lignes tracées dans les rangées et colonnes
+extérieures (décrites plus loin) bénificient d'un régime spécial : cf.
p.~\pageref{exterior}.
@@ -1671,21 +1882,24 @@ p.~\pageref{exterior}.
\textbf{L'option xdots/shorten}\par\nobreak
\smallskip
-L'option |xdots/shorten| indique la marge qui est laissée aux deux extrémités de la ligne. Le nom s'inspire des options
-«|shorten >|» et «|shorten <|» de Tikz, mais il faut remarquer que \pkg{nicematrix} ne propose que |xdots/shorten|.
-La valeur initiale de ce paramètre est de $0.3$~em (il est conseillé d'utiliser une unité de mesure dépendante de
-la fonte courante).
+L'option |xdots/shorten| indique la marge qui est laissée aux deux extrémités de
+la ligne. Le nom s'inspire des options «|shorten >|» et «|shorten <|» de Tikz,
+mais il faut remarquer que \pkg{nicematrix} ne propose que |xdots/shorten|. La
+valeur initiale de ce paramètre est de $0.3$~em (il est conseillé d'utiliser une
+unité de mesure dépendante de la fonte courante).
\bigskip
\textbf{L'option xdots/line-style}\par\nobreak
\smallskip
-Il faut savoir que, par défaut, les lignes de Tikz tracées avec le paramètre |dotted| sont composées de points
-carrés et non pas ronds.\footnote{La raison de départ est que le format \textsc{pdf} comporte un système de description
- de lignes en tiretés, qui, puisqu'il est incorporé dans le \textsc{pdf}, est affiché très rapidement par les
- lecteurs de \textsc{pdf}. Il est facile à partir de ce type de ligne de créer des lignes de points carrés alors
- qu'une ligne de points ronds doit être construite explicitement point par point.}
+Il faut savoir que, par défaut, les lignes de Tikz tracées avec le paramètre
+|dotted| sont composées de points carrés et non pas ronds.\footnote{La raison de
+ départ est que le format \textsc{pdf} comporte un système de description de
+ lignes en tiretés, qui, puisqu'il est incorporé dans le \textsc{pdf}, est
+ affiché très rapidement par les lecteurs de \textsc{pdf}. Il est facile à
+ partir de ce type de ligne de créer des lignes de points carrés alors qu'une
+ ligne de points ronds doit être construite explicitement point par point.}
\begin{BVerbatim}[baseline=c,boxwidth=9cm]
\tikz \draw [dotted] (0,0) -- (5,0) ;
@@ -1693,15 +1907,18 @@ carrés et non pas ronds.\footnote{La raison de départ est que le format \texts
\tikz \draw [dotted] (0,0) -- (5,0) ;
\bigskip
-Voulant proposer des lignes avec des points ronds dans le style de celui de |\ldots| (au moins celui des fontes
-\emph{Computer Modern}), l'extension \pkg{nicematrix} contient en interne son propre système de ligne en pointillés
-(qui, au passage, n'utilise que \pkg{pgf} et non \pkg{tikz}). Ce style est appelé le style |standard|. Cette valeur
-est la valeur initiale du paramètre |xdots/line-style|.
+Voulant proposer des lignes avec des points ronds dans le style de celui de
+|\ldots| (au moins celui des fontes \emph{Computer Modern}), l'extension
+\pkg{nicematrix} contient en interne son propre système de ligne en pointillés
+(qui, au passage, n'utilise que \pkg{pgf} et non \pkg{tikz}). Ce style est
+appelé le style |standard|. Cette valeur est la valeur initiale du paramètre
+|xdots/line-style|.
\bigskip
-Néanmoins (quand Tikz est chargé), on peut utiliser pour |xdots/line-style| n'importe quel style proposé par Tikz,
-c'est-à-dire n'importe quelle suite d'options Tikz applicables à un chemin (à l'exception de «|color|»,
-«|shorten >|» et «|shorten <|»).
+Néanmoins (quand Tikz est chargé), on peut utiliser pour |xdots/line-style|
+n'importe quel style proposé par Tikz, c'est-à-dire n'importe quelle suite
+d'options Tikz applicables à un chemin (à l'exception de «|color|»,
+«|shorten >|» et «|shorten <|»).
\medskip
Voici par exemple une matrice tridiagonale avec le style |loosely dotted| :\par\nobreak
@@ -1733,9 +1950,10 @@ b & a & b & \Ddots & & \Vdots \\
\label{dotted-and-hvlines}
-On a dit (cf. p. \pageref{hvlines}) que la clé |hvlines| trace tous les filets horizontaux et verticaux, exceptés
-dans les blocs. En fait, avec cette clé, les filets ne sont pas non plus tracés dans les blocs virtuels délimités
-par des cases reliées par des lignes pointillées.
+On a dit (cf. p. \pageref{hvlines}) que la clé |hvlines| trace tous les filets
+horizontaux et verticaux, exceptés dans les blocs. En fait, avec cette clé, les
+filets ne sont pas non plus tracés dans les blocs virtuels délimités par des
+cases reliées par des lignes pointillées.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
@@ -1758,13 +1976,15 @@ $\begin{bNiceMatrix}[margin,hvlines]
\label{code-after}
-L'option |code-after| peut être utilisée pour indiquer du code qui sera exécuté après la construction de la
-matrice.\footnote{Il existe aussi une clé |code-before| décrite p.~\pageref{code-before}.}
+L'option |code-after| peut être utilisée pour indiquer du code qui sera exécuté
+après la construction de la matrice.\footnote{Il existe aussi une clé
+ |code-before| décrite p.~\pageref{code-before}.}
-Une commande spéciale, nommée |\line| est disponible pour tracer directement des lignes en pointillés entre les
-cases. Elle prend deux arguments correspondant aux deux cases à relier, chacun de la forme $i$-$j$ où $i$ est le
-numéro de ligne et $j$ est le numéro de colonne. Elle peut par exemple être utilisée pour tracer une ligne entre
-deux cases adjacentes comme dans l'exemple suivant.
+Une commande spéciale, nommée |\line| est disponible pour tracer directement des
+lignes en pointillés entre les cases. Elle prend deux arguments correspondant
+aux deux cases à relier, chacun de la forme $i$-$j$ où $i$ est le numéro de
+ligne et $j$ est le numéro de colonne. Elle peut par exemple être utilisée pour
+tracer une ligne entre deux cases adjacentes comme dans l'exemple suivant.
\label{line-in-code-after}
\medskip
@@ -1788,11 +2008,11 @@ I & 0 & \Cdots &0 \\
\end{scope}
\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 cellule
-courante.}. Pour un exemple, voir page
+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 cellule courante.}. Pour un exemple, voir page
\pageref{exemple-CodeAfter}.
\section{Les notes dans les tableaux}
@@ -1907,7 +2127,8 @@ titre inséré par |\caption| dans un environnement |{table}| de LaTeX.
\item Si plusieurs commandes |\tabularnote{...}| se suivent \emph{sans aucun espace
entre elles}, les appels de notes correspondants sont composés ensemble,
-séparés par une virgule.
+séparés par une virgule (comme avec l'option |multiple| de \pkg{footmisc} pour
+les notes de pied de page).
\item Si une commande |\tabularnote{...}| se trouve exactement à la fin d'une cellule
(sans aucun espace après), l'appel de note est composé en débordement vers la
@@ -1960,8 +2181,8 @@ Wallis & John & 87 \\
\subsection{Personnalisation des notes de tableau}
-Les notes de tableau peuvent être personnalisées grâce à un ensemble de clés disponibles dans
-|\NiceMatrixOptions|. Ces clés ont un nom préfixé par |notes| :
+Les notes de tableau peuvent être personnalisées grâce à un ensemble de clés
+disponibles dans |\NiceMatrixOptions|. Ces clés ont un nom préfixé par |notes| :
\begin{itemize}
\item |notes/para|
\item |notes/bottomrule|
@@ -2120,8 +2341,8 @@ Si vous souhaitez utiliser l'environnement |{NiceTabular}| dans un environnement
\makeatother
\end{Verbatim}
-La commande |\AtBeginEnvironment| est une commande de l'extension \pkg{etoolbox} qui doit donc
-avoir été chargée au préalable.
+La commande |\AtBeginEnvironment| est une commande de l'extension \pkg{etoolbox}
+qui doit donc avoir été chargée au préalable.
\section{Autres fonctionnalités}
@@ -2151,7 +2372,8 @@ $\begin{pNiceArray}{ScW{c}{1cm}c}[nullify-dots,first-row]
\end{pNiceArray}$
\medskip
-En revanche, les colonnes |d| de l'extension \pkg{dcolumn} ne sont pas prises en charge par \pkg{nicematrix}.
+En revanche, les colonnes |d| de l'extension \pkg{dcolumn} ne sont pas prises en
+charge par \pkg{nicematrix}.
@@ -2159,8 +2381,9 @@ En revanche, les colonnes |d| de l'extension \pkg{dcolumn} ne sont pas prises en
\label{key-R}
-Les environnements sans préambule (|{NiceMatrix}|, |{pNiceMatrix}|, |{bNiceMatrix}|, etc.) proposent les options
-|l| et |r| (possédant |L| et |R| comme alias) qui imposent des colonnes alignées à gauche ou à droite.
+Les environnements sans préambule (|{NiceMatrix}|, |{pNiceMatrix}|,
+|{bNiceMatrix}|, etc.) proposent les options |l| et |r| qui imposent des
+colonnes alignées à gauche ou à droite.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10cm]
@@ -2175,9 +2398,10 @@ $\begin{bNiceMatrix}[r]
\end{bNiceMatrix}$
\medskip
-Il existe aussi l'option |S| qui impose que toutes les colonnes soient des colonnes |S| de \pkg{siunitx} (si cette
-extension est chargée).\footnote{Cela reprend une partie des fonctionnalités proposées par les environnements |{pmatrix*}|,
- |{bmatrix*}|, etc. de \pkg{mathtools}.}
+Il existe aussi l'option |S| qui impose que toutes les colonnes soient des
+colonnes |S| de \pkg{siunitx} (si cette extension est chargée).\footnote{Cela
+ reprend une partie des fonctionnalités proposées par les environnements
+ |{pmatrix*}|, |{bmatrix*}|, etc. de \pkg{mathtools}.}
\subsection{La commande \textbackslash rotate}
@@ -2213,8 +2437,8 @@ e_1 & e_2 & e_3 \\
\end{varwidth}
\bigskip
-Si la commande |\rotate| est utilisée dans la «dernière rangée» (extérieure à la matrice), les éléments qui
-subissent cette rotation sont alignés vers le haut.
+Si la commande |\rotate| est utilisée dans la «dernière rangée» (extérieure à la
+matrice), les éléments qui subissent cette rotation sont alignés vers le haut.
\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=12cm]
@@ -2245,9 +2469,10 @@ $A = \begin{pNiceMatrix}[last-row,last-col=4]
\label{small}
-Avec l'option |small|, les environnements de l'extension \pkg{nicematrix} sont composés d'une manière proche de ce
-que propose l'environnement |{smallmatrix}| de l'\pkg{amsmath} (et les environnements |{psmallmatrix}|,
-|{bsmallmatrix}|, etc. de \pkg{mathtools}).
+Avec l'option |small|, les environnements de l'extension \pkg{nicematrix} sont
+composés d'une manière proche de ce que propose l'environnement |{smallmatrix}|
+de l'\pkg{amsmath} (et les environnements |{psmallmatrix}|, |{bsmallmatrix}|,
+etc. de \pkg{mathtools}).
\bigskip
\begin{Verbatim}
@@ -2270,10 +2495,11 @@ $\begin{bNiceArray}{cccc|c}[~emphase#small@,
\bigskip
-On remarquera néanmoins que l'environnement |{NiceMatrix}| avec l'option |small| ne prétend pas être composé
-exactement comme l'environnement |{smallmatrix}|. C'est que les environnements de \pkg{nicematrix} sont tous fondés
-sur |{array}| (de \pkg{array}) alors que ce n'est pas le cas de |{smallmatrix}| (fondé directement sur un |\halign|
-de TeX).
+On remarquera néanmoins que l'environnement |{NiceMatrix}| avec l'option |small|
+ne prétend pas être composé exactement comme l'environnement |{smallmatrix}|.
+C'est que les environnements de \pkg{nicematrix} sont tous fondés sur |{array}|
+(de \pkg{array}) alors que ce n'est pas le cas de |{smallmatrix}| (fondé
+directement sur un |\halign| de TeX).
\medskip
En fait, l'option |small| correspond aux réglages suivants :
@@ -2286,15 +2512,17 @@ En fait, l'option |small| correspond aux réglages suivants :
\subsection{Les compteurs iRow et jCol}
-Dans les cases du tableau, il est possible d'utiliser les compteurs LaTeX |iRow| et |jCol| qui représentent le
-numéro de la rangée courante et le numéro de la colonne courante\footnote{On rappelle que le numéro de la «première
- rangée» (si elle existe) est $0$ et que le numéro de la «première colonne» (si elle existe) est $0$ également.}.
-Bien entendu, l'utilisateur ne doit pas modifier les valeurs de ces compteurs qui sont utilisés en interne par
-\pkg{nicematrix}.
+Dans les cases du tableau, il est possible d'utiliser les compteurs LaTeX |iRow|
+et |jCol| qui représentent le numéro de la rangée courante et le numéro de la
+colonne courante\footnote{On rappelle que le numéro de la «première rangée» (si
+ elle existe) est $0$ et que le numéro de la «première colonne» (si elle
+ existe) est $0$ également.}. Bien entendu, l'utilisateur ne doit pas modifier
+les valeurs de ces compteurs qui sont utilisés en interne par \pkg{nicematrix}.
-Dans le |code-before| (cf. p. \pageref{code-before}) et dans le |code-after| (cf. p. \pageref{code-after}), |iRow|
-représente le nombre total de rangées (hors éventuelles rangées extérieures) et |jCol| le nombre total de colonnes
-(hors potentielles colonnes extérieures).
+Dans le |code-before| (cf. p. \pageref{code-before}) et dans le |code-after|
+(cf. p. \pageref{code-after}), |iRow| représente le nombre total de rangées
+(hors éventuelles rangées extérieures) et |jCol| le nombre total de colonnes
+(hors potentielles colonnes extérieures).
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
@@ -2320,20 +2548,22 @@ $\begin{pNiceMatrix}[first-row,
\end{pNiceMatrix}$
\medskip
-Si des compteurs LaTeX nommés |iRow| ou |jCol| sont créés dans le document par d'autres extensions que
-\pkg{nicematrix} (ou tout simplement par l'utilisateur final), ces compteurs sont masqués dans les environnements
-de \pkg{nicematrix}.
+Si des compteurs LaTeX nommés |iRow| ou |jCol| sont créés dans le document par
+d'autres extensions que \pkg{nicematrix} (ou tout simplement par l'utilisateur
+final), ces compteurs sont masqués dans les environnements de \pkg{nicematrix}.
\bigskip
-L'extension \pkg{nicematrix} propose aussi des commandes pour composer automatiquement des matrices à partir d'un
-motif général. Ces commandes sont nommées |\AutoNiceMatrix|, |\pAutoNiceMatrix|, |\bAutoNiceMatrix|,
+L'extension \pkg{nicematrix} propose aussi des commandes pour composer
+automatiquement des matrices à partir d'un motif général. Ces commandes sont
+nommées |\AutoNiceMatrix|, |\pAutoNiceMatrix|, |\bAutoNiceMatrix|,
|\vAutoNiceMatrix|, |\VAutoNiceMatrix| et |\BAutoNiceMatrix|.
-Chacune de ces commandes prend deux arguments obligatoires : le premier est la taille de la matrice, sous la forme
-$n$-$p$, où $n$ est le nombre de rangées et $p$ est le nombre de colonnes et le deuxième est le motif (c'est-à-dire
-simplement des tokens qui seront insérés dans chaque case de la matrice, exceptées celles des éventuelles rangées et
-colonnes extérieures).
+Chacune de ces commandes prend deux arguments obligatoires : le premier est la
+taille de la matrice, sous la forme $n$-$p$, où $n$ est le nombre de rangées et
+$p$ est le nombre de colonnes et le deuxième est le motif (c'est-à-dire
+simplement des tokens qui seront insérés dans chaque case de la matrice,
+exceptées celles des éventuelles rangées et colonnes extérieures).
\medskip
\begin{Verbatim}
@@ -2349,11 +2579,13 @@ $C = ~emphase#\pAutoNiceMatrix@{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$
\label{light-syntax}
-L'option |light-syntax| (inspirée de l'extension \pkg{spalign}) permet d'alléger la saisie des matrices, ainsi que
-leur lisibilité dans le source TeX. Lorsque cette option est activée, on doit utiliser le point-virgule comme
-marqueur de fin de rangée et séparer les colonnes par des espaces ou des tabulations. On remarquera toutefois que,
-comme souvent dans le monde TeX, les espaces après les séquences de contrôle ne sont pas comptées et que les
-éléments entre accolades sont considérés comme un tout.
+L'option |light-syntax| (inspirée de l'extension \pkg{spalign}) permet d'alléger
+la saisie des matrices, ainsi que leur lisibilité dans le source TeX. Lorsque
+cette option est activée, on doit utiliser le point-virgule comme marqueur de
+fin de rangée et séparer les colonnes par des espaces ou des tabulations. On
+remarquera toutefois que, comme souvent dans le monde TeX, les espaces après les
+séquences de contrôle ne sont pas comptées et que les éléments entre accolades
+sont considérés comme un tout.
\medskip
@@ -2374,22 +2606,27 @@ b \cos a+\cos b { 2 \cos b }
\end{bNiceMatrix}$
\medskip
-On peut changer le caractère utilisé pour indiquer les fins de rangées avec l'option |end-of-row|. Comme dit
-précédemment, la valeur initiale de ce paramètre est un point-virgule.
+On peut changer le caractère utilisé pour indiquer les fins de rangées avec
+l'option |end-of-row|. Comme dit précédemment, la valeur initiale de ce
+paramètre est un point-virgule.
\medskip
-Lorsque l'option |light-syntax| est utilisée, il n'est pas possible de mettre d'éléments en verbatim (avec par
-exemple la commande |\verb|) dans les cases du tableau.\footnote{La raison en est que lorsque l'option
- |light-syntax| est utilisée, le contenu complet de l'environnement est chargé comme un argument de commande TeX.
- L'environnement ne se comporte plus comme un «vrai» environnement de LaTeX qui se contente d'insérer des
- commandes avant et après.}
+Lorsque l'option |light-syntax| est utilisée, il n'est pas possible de mettre
+d'éléments en verbatim (avec par exemple la commande
+|\verb|) dans les cases du tableau.\footnote{La raison en est que lorsque l'option |light-syntax|
+ est utilisée, le contenu complet de l'environnement est chargé comme un
+ argument de commande TeX. L'environnement ne se comporte plus comme un «vrai»
+ environnement de LaTeX qui se contente d'insérer des commandes avant et
+ après.}
\subsection{L'environnement \{NiceArrayWithDelims\}}
-En fait, l'environnement |{pNiceArray}| et ses variantes sont fondés sur un environnement plus général, appelé
-|{NiceArrayWithDelims}|. Les deux premiers arguments obligatoires de cet environnement sont les délimiteurs gauche
-et droit qui seront utilisés dans la construction de la matrice. Il est possible d'utiliser |{NiceArrayWithDelims}|
-si on a besoin de délimiteurs atypiques ou asymétriques.
+En fait, l'environnement |{pNiceArray}| et ses variantes sont fondés sur un
+environnement plus général, appelé |{NiceArrayWithDelims}|. Les deux premiers
+arguments obligatoires de cet environnement sont les délimiteurs gauche et droit
+qui seront utilisés dans la construction de la matrice. Il est possible
+d'utiliser |{NiceArrayWithDelims}| si on a besoin de délimiteurs atypiques ou
+asymétriques.
\medskip
\begin{BVerbatim}[baseline=c,boxwidth=11cm]
@@ -2417,28 +2654,33 @@ $\begin{NiceArrayWithDelims}
\subsection{Les nœuds correspondant aux contenus des cases}
-L'extension \pkg{nicematrix} crée un nœud PGF-Tikz pour chaque case (non vide) du tableau considéré. Ces nœuds sont
-utilisés, entre autres, pour tracer les lignes en pointillés entre les cases du tableau.
+L'extension \pkg{nicematrix} crée un nœud PGF-Tikz pour chaque case (non vide)
+du tableau considéré. Ces nœuds sont utilisés, entre autres, pour tracer les
+lignes en pointillés entre les cases du tableau.
\smallskip
-Tous les nœuds du document doivent avoir des noms deux à deux distincts et le nom de ces nœuds doit donc faire
-intervenir le numéro de l'environnement courant. Les environnements créés par \pkg{nicematrix} sont en effet
-numérotés par un compteur global interne.
+Tous les nœuds du document doivent avoir des noms deux à deux distincts et le
+nom de ces nœuds doit donc faire intervenir le numéro de l'environnement
+courant. Les environnements créés par \pkg{nicematrix} sont en effet numérotés
+par un compteur global interne.
\smallskip
-Si l'environnement concerné a le numéro $n$, alors le nœud de la rangée~$i$ et de la colonne~$j$ a pour nom
-|nm-|$n$|-|$i$|-|$j$.
+Si l'environnement concerné a le numéro $n$, alors le nœud de la rangée~$i$ et
+de la colonne~$j$ a pour nom |nm-|$n$|-|$i$|-|$j$.
\smallskip
-La commande |\NiceMatrixLastEnv| donne le numéro du dernier de ces environnements (pour LaTeX, il s'agit d'une
-commande — complètement développable — et non d'un compteur).
+La commande |\NiceMatrixLastEnv| donne le numéro du dernier de ces
+environnements (pour LaTeX, il s'agit d'une commande — complètement développable
+— et non d'un compteur).
\smallskip
-Il est néanmoins recommandé de passer plutôt par la clé |name|. Celle-ci permet de donner un nom à l'environnement.
-Une fois l'environnement nommé, les nœuds sont accessibles à travers les noms «\textsl{nom}-$i$-$j$» où
-\textsl{nom} est le nom donné au tableau et $i$ et $j$ les numéros de rangée et de colonne de la case considérée.
-On peut les utiliser avec \textsc{pgf} mais l'utilisateur final préférera sans doute utiliser Tikz (qui est une
-sur-couche de \textsc{pgf}). Il faut néanmoins se souvenir que \pkg{nicematrix} ne charge pas Tikz par défault.
+Il est néanmoins recommandé de passer plutôt par la clé |name|. Celle-ci permet
+de donner un nom à l'environnement. Une fois l'environnement nommé, les nœuds
+sont accessibles à travers les noms «\textsl{nom}-$i$-$j$» où \textsl{nom} est
+le nom donné au tableau et $i$ et $j$ les numéros de rangée et de colonne de la
+case considérée. On peut les utiliser avec \textsc{pgf} mais l'utilisateur final
+préférera sans doute utiliser Tikz (qui est une sur-couche de \textsc{pgf}). Il
+faut néanmoins se souvenir que \pkg{nicematrix} ne charge pas Tikz par défault.
\bigskip
\begin{BVerbatim}[baseline=c,boxwidth=11cm]
@@ -2463,8 +2705,9 @@ Ne pas oublier les options |remember picture| et |overlay|.
\bigskip
-Dans le |code-after|, et si Tikz est chargé, les choses sont plus simples. On peut (et on doit) désigner les nœuds
-sous la forme $i$-$j$ : il n'y a pas besoin de préciser l'environnement qui est évidemment l'environnement courant.
+Dans le |code-after|, et si Tikz est chargé, les choses sont plus simples. On
+peut (et on doit) désigner les nœuds sous la forme $i$-$j$ : il n'y a pas besoin
+de préciser l'environnement qui est évidemment l'environnement courant.
\medskip
@@ -2489,8 +2732,7 @@ $\begin{pNiceMatrix}
\bigskip
Dans l'exemple suivant, nous avons surligné tous les nœuds de la matrice (on
-explique plus loin la technique utilisée :
-cf. p. \pageref{highlight}).
+explique plus loin la technique utilisée : cf. p. \pageref{highlight}).
\[\begin{pNiceMatrix}
a & a + b & a + b + c \\
@@ -2521,19 +2763,22 @@ a & a & a
\subsection{Les «nœuds moyens» et les «nœuds larges»}
-En fait, l'extension \pkg{nicematrix} peut créer deux séries de nœuds supplémentaires (\emph{extra nodes} en
-anglais) : les «nœuds moyens» (\emph{medium nodes} en anglais) et les «nœuds larges» (\emph{large nodes} en
-anglais). Les premiers sont créés avec l'option |create-medium-nodes| et les seconds avec l'option
-|create-large-nodes|.\footnote{Il existe aussi l'option |create-extra-nodes| qui est un alias pour la conjonction
-de |create-medium-nodes| et |create-large-nodes|.}
+En fait, l'extension \pkg{nicematrix} peut créer deux séries de nœuds
+supplémentaires (\emph{extra nodes} en anglais) : les «nœuds moyens»
+(\emph{medium nodes} en anglais) et les «nœuds larges» (\emph{large nodes} en
+anglais). Les premiers sont créés avec l'option |create-medium-nodes| et les
+seconds avec l'option |create-large-nodes|.\footnote{Il existe aussi l'option
+ |create-extra-nodes| qui est un alias pour la conjonction de
+ |create-medium-nodes| et |create-large-nodes|.}
\medskip
Ces nœuds ne sont pas utilisés par défault par \pkg{nicematrix}.
\medskip
-Les noms des «nœuds moyens» s'obtiennent en ajoutant le suffixe «|-medium|» au nom des nœuds normaux. Dans
-l'exemple suivant, on a surligné tous les «nœuds moyens». Nous considérons que cet exemple se suffit à lui-même
-comme définition de ces nœuds.
+Les noms des «nœuds moyens» s'obtiennent en ajoutant le suffixe «|-medium|» au
+nom des nœuds normaux. Dans l'exemple suivant, on a surligné tous les «nœuds
+moyens». Nous considérons que cet exemple se suffit à lui-même comme définition
+de ces nœuds.
\[\begin{pNiceMatrix}[
create-medium-nodes,
code-after = {\begin{tikzpicture}
@@ -2558,10 +2803,12 @@ a & a & a
\medskip
-Les noms des «nœuds larges» s'obtiennent en ajoutant le suffixe «|-large|» au nom des nœuds normaux. Dans l'exemple
-suivant, on a surligné tous les «nœuds larges». Nous considérons que cet exemple se suffit à lui-même comme
-définition de ces nœuds.\footnote{Il n'y a pas de «nœuds larges» créés dans les rangées et colonnes extérieures
- (pour ces rangées et colonnes, voir p.~\pageref{exterior}).}
+Les noms des «nœuds larges» s'obtiennent en ajoutant le suffixe «|-large|» au
+nom des nœuds normaux. Dans l'exemple suivant, on a surligné tous les «nœuds
+larges». Nous considérons que cet exemple se suffit à lui-même comme définition
+de ces nœuds.\footnote{Il n'y a pas de «nœuds larges» créés dans les rangées et
+ colonnes extérieures (pour ces rangées et colonnes, voir
+ p.~\pageref{exterior}).}
\[\begin{pNiceMatrix}[
create-large-nodes,
@@ -2586,14 +2833,16 @@ a & a & a
\medskip
-Les «nœuds larges» de la première colonne et de la dernière colonne peuvent apparaître trop petits pour certains
-usages. C'est pourquoi il est possible d'utiliser les options |left-margin| et |right-margin| pour ajouter de
-l'espace des deux côtés du tableau et aussi de l'espace dans les «nœuds larges» de la première colonne et de la
-dernière colonne. Dans l'exemple suivant, nous avons utilisé les options |left-margin| et
-|right-margin|.\footnote{Les options |left-margin| et |right-margin| prennent des dimensions comme valeurs mais, si
- aucune valeur n'est donnée, c'est la valeur par défaut qui est utilisée et elle est égale à |\arraycolsep| (valeur
- initial : 5~pt). Il existe aussi une option |margin| pour fixer à la fois
- |left-margin| et |right-margin|.}
+Les «nœuds larges» de la première colonne et de la dernière colonne peuvent
+apparaître trop petits pour certains usages. C'est pourquoi il est possible
+d'utiliser les options |left-margin| et |right-margin| pour ajouter de l'espace
+des deux côtés du tableau et aussi de l'espace dans les «nœuds larges» de la
+première colonne et de la dernière colonne. Dans l'exemple suivant, nous avons
+utilisé les options |left-margin| et |right-margin|.\footnote{Les options
+ |left-margin| et |right-margin| prennent des dimensions comme valeurs mais, si
+ aucune valeur n'est donnée, c'est la valeur par défaut qui est utilisée et
+ elle est égale à |\arraycolsep| (valeur initial : 5~pt). Il existe aussi une
+ option |margin| pour fixer à la fois |left-margin| et |right-margin|.}
\[\begin{pNiceMatrix}[
create-large-nodes,left-margin,right-margin,
code-after = {\begin{tikzpicture}
@@ -2616,9 +2865,10 @@ a & a & a
\end{pNiceMatrix}\]
\medskip
-Il est aussi possible d'ajouter de l'espace sur les côtés du tableau avec les options |extra-left-margin| et
-|extra-right-margin|. Ces marges ne sont pas incorporées dans les «nœuds larges». Dans l'exemple suivant, nous
-avons utilisé |extra-left-margin| et |extra-right-margin| avec la valeur $3$~pt.
+Il est aussi possible d'ajouter de l'espace sur les côtés du tableau avec les
+options |extra-left-margin| et |extra-right-margin|. Ces marges ne sont pas
+incorporées dans les «nœuds larges». Dans l'exemple suivant, nous avons utilisé
+|extra-left-margin| et |extra-right-margin| avec la valeur $3$~pt.
\[\begin{pNiceMatrix}[
create-large-nodes,left-margin,right-margin,extra-right-margin=3pt,extra-left-margin=3pt,
code-after = {\begin{tikzpicture}
@@ -2642,8 +2892,8 @@ a & a & a
\bigskip
-\textbf{Attention} : Ces nœuds sont reconstruits à partir des contenus des cases et ne correspondent donc pas
-nécessairement aux cases délimitées par des filets.
+\textbf{Attention} : Ces nœuds sont reconstruits à partir des contenus des cases
+et ne correspondent donc pas nécessairement aux cases délimitées par des filets.
\bigskip
\begin{minipage}[c]{7.5cm}
@@ -2686,7 +2936,8 @@ noix & noisette & brugnon
\vspace{1cm}
\begin{minipage}[c]{7cm}
-Voici maintenant tous les «nœuds larges» de ce tableau (sans utilisation de |margin| ni de |extra-margin|).
+Voici maintenant tous les «nœuds larges» de ce tableau (sans utilisation de
+|margin| ni de |extra-margin|).
\end{minipage}
\hspace{1.5cm}
\begin{scope}
@@ -2715,17 +2966,12 @@ noix & noisette & brugnon
-
-
-
-
-
-
\subsection{Les nœuds «row» et «col»}
-L'extension \pkg{nicematrix} crée un nœud PGF-Tikz indiquant la position potentielle de chaque filet horizontal
-(avec les noms |row-|$i$) et de chaque filet vertical (avec les noms |col-|$j$), comme décrit sur la figure
-ci-dessous. Ces nœuds sont accessibles dans le |code-before| et dans le |code-after|.
+L'extension \pkg{nicematrix} crée un nœud PGF-Tikz indiquant la position
+potentielle de chaque filet horizontal (avec les noms |row-|$i$) et de chaque
+filet vertical (avec les noms |col-|$j$), comme décrit sur la figure ci-dessous.
+Ces nœuds sont accessibles dans le |code-before| et dans le |code-after|.
\begin{center}
\begin{NiceTabular}{ccc}[hvlines,rules/width=1pt,rules/color=gray]
rose & tulipe & lys \\
@@ -2750,8 +2996,9 @@ muguet & dahlia & souci
\bigskip
-Si on utilise Tikz (on rappelle que \pkg{nicematrix} ne charge pas Tikz par défaut), on peut donc accéder (dans le
-|code-before| et le |code-after|) à l'intersection du filet horizontal~$i$ et du filet vertical~$j$ avec la syntaxe
+Si on utilise Tikz (on rappelle que \pkg{nicematrix} ne charge pas Tikz par
+défaut), on peut donc accéder (dans le |code-before| et le |code-after|) à
+l'intersection du filet horizontal~$i$ et du filet vertical~$j$ avec la syntaxe
|(row-|$i$\verb+-|col-+$j$|)|.
@@ -2797,18 +3044,116 @@ Si on utilise Tikz (on rappelle que \pkg{nicematrix} ne charge pas Tikz par déf
\end{NiceMatrix}\]
+\section{Outils pour les développeurs}
+
+Comme son nom l'indique, la liste de tokens |\g_nicematrix_code_after_tl| est
+publique (conformément aux conventions de LaTeX3, toute variable dont le nom
+débute par |\g_nicematrix| ou |\l_nicematrix| est publique alors que toute variable
+dont le nom débute par |\g__nicematrix| ou par |\l__nicematrix| est privée).
+
+\medskip
+Cette variable contient le code qui constitue le «|code-after|». Le développeur
+peut donc l'utiliser pour y ajouter du code à partir d'une cellule du tableau
+(l'affectation devra être globale, ce qui permettra de sortir de la cellule, qui
+est un groupe au sens de TeX).
+
+\medskip
+\emph{Exemple} : On souhaite écrire une commande |\crossbox| qui barre en croix
+la cellule courante. Cette commande prendra en argument optionnel une liste de
+couples \textsl{clé}-\textsl{valeur} qui sera passée à Tikz avant que la croix
+ne soit tracée.
+
+
+On peut alors programmer cette commande |\crossbox| de la manière suivante, qui
+utilise explicitement la variable publique |\g_nicematrix_code_after_tl|.
+
+
+\begin{scope}
+\fvset{commandchars=\§\¤\μ}
+\begin{Verbatim}
+\ExplSyntaxOn
+\cs_new_protected:Nn \__pantigny_crossbox:nnn
+ {
+ \begin { tikzpicture }
+ \draw [ #3 ]
+ ( row-#1 -| col-\int_eval:n { #2 + 1 } )
+ -- ( row-\int_eval:n { #1 + 1 } -| col-#2 )
+ ( row-#1 -| col-\int_eval:n #2 )
+ -- ( row-\int_eval:n { #1 + 1 } -| col-\int_eval:n { #2 + 1 } ) ;
+ \end { tikzpicture }
+ }
+
+
+\NewDocumentCommand \crossbox { ! O { } }
+ {
+ \tl_gput_right:Nx §emphase¤\g_nicematrix_code_after_tlμ
+ {
+ \__pantigny_crossbox:nnn
+ { \int_use:c { c@iRow } }
+ { \int_use:c { c@jCol } }
+ { \exp_not:n { #1 } }
+ }
+ }
+\ExplSyntaxOff
+\end{Verbatim}
+\end{scope}
+
+
+\ExplSyntaxOn
+\cs_new_protected:Nn \__pantigny_crossbox:nnn
+ {
+ \begin { tikzpicture }
+ \draw [ #3 ]
+ ( row-#1 -| col-\int_eval:n { #2 + 1 } )
+ -- ( row-\int_eval:n { #1 + 1 } -| col-#2 )
+ ( row-#1 -| col-\int_eval:n #2 )
+ -- ( row-\int_eval:n { #1 + 1 } -| col-\int_eval:n { #2 + 1 } ) ;
+ \end { tikzpicture }
+ }
+
+
+\NewDocumentCommand \crossbox { ! O { } }
+ {
+ \tl_gput_right:Nx \g_nicematrix_code_after_tl
+ {
+ \__pantigny_crossbox:nnn
+ { \int_use:c { c@iRow } }
+ { \int_use:c { c@jCol } }
+ { \exp_not:n { #1 } }
+ }
+ }
+\ExplSyntaxOff
+
+\bigskip
+Voici un exemple d'utilisation :
+
+\medskip
+\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{NiceTabular}{ccc}[hvlines]
+merlan & requin & cabillaud \\
+baleine & ~emphase#\crossbox[red]@ & morue \\
+mante & raie & poule
+\end{NiceTabular}
+\end{BVerbatim}
+\begin{NiceTabular}{ccc}[hvlines]
+merlan & requin & cabillaud \\
+baleine & \crossbox[red] & morue \\
+mante & raie & poule
+\end{NiceTabular}
+
\section{Remarques techniques}
-Première remarque : l'extension \pkg{nicematrix} doit être chargée après l'extension \pkg{underscore}. Si ce n'est
-pas le cas, une erreur est levée.
+Première remarque : l'extension \pkg{nicematrix} doit être chargée après
+l'extension \pkg{underscore}. Si ce n'est pas le cas, une erreur est levée.
\subsection{Pour définir de nouveaux types de colonnes}
\label{OnlyMainNiceMatrix}
-L'extension \pkg{nicematrix} fournit la commande |\OnlyMainNiceMatrix| qui est destinée à être utilisée dans des
-définitions de nouveaux types de colonnes. Son argument n'est exécuté que si on se place dans la partie principale
-du tableau, c'est-à-dire que l'on n'est pas dans l'une des éventuelles rangées extérieures.
+L'extension \pkg{nicematrix} fournit la commande |\OnlyMainNiceMatrix| qui est
+destinée à être utilisée dans des définitions de nouveaux types de colonnes. Son
+argument n'est exécuté que si on se place dans la partie principale du tableau,
+c'est-à-dire que l'on n'est pas dans l'une des éventuelles rangées extérieures.
Par exemple, si on souhaite définir un type de colonne |?| pour tracer un trait fort (noir) d'épaisseur 1~pt, on
pourra écrire\footnote{La commande |\vrule| est une commande de TeX (et non de LaTeX).} :
@@ -2816,7 +3161,9 @@ pourra écrire\footnote{La commande |\vrule| est une commande de TeX (et non de
\newcolumntype{?}{!{\OnlyMainNiceMatrix{\vrule width 1 pt}}}
\end{Verbatim}
-Le trait fort correspondant ne s'étendra pas dans les rangées extérieures :
+Le trait fort correspondant ne s'étendra pas dans les rangées
+extérieures.\footnote{Un tel filet utilisant les techniques classiques de
+ \pkg{array}, il ne traversera pas les doubles filets horizontaux de |\hline\hline|.}
\medskip
\begin{scope}
@@ -2839,8 +3186,9 @@ C_1 & C_2 & C_3 & C_4
\end{scope}
\medskip
-Le spécificateur |?| ainsi créé est aussi utilisable dans les environnements |{tabular}| et |{array}| (de
-\pkg{array}) et, dans ce cas, |\OnlyMainNiceMatrix| est sans effet.
+Le spécificateur |?| ainsi créé est aussi utilisable dans les environnements
+|{tabular}| et |{array}| (de \pkg{array}) et, dans ce cas, |\OnlyMainNiceMatrix|
+est sans effet.
@@ -2849,11 +3197,13 @@ Le spécificateur |?| ainsi créé est aussi utilisable dans les environnements
\subsection{Lignes diagonales}
-Par défaut, toutes les lignes diagonales\footnote{On parle des lignes créées par |\Ddots| et non des lignes créées
- par une commande |\line| dans le |code-after|.} d'un même tableau sont «parallélisées». Cela signifie que la
-première diagonale est tracée et que, ensuite, les autres lignes sont tracées parallèlement à la première (par
-rotation autour de l'extrémité la plus à gauche de la ligne). C'est pourquoi la position des instructions |\Ddots|
-dans un tableau peut avoir un effet marqué sur le résultat final.
+Par défaut, toutes les lignes diagonales\footnote{On parle des lignes créées par
+ |\Ddots| et non des lignes créées par une commande |\line| dans le
+ |code-after|.} d'un même tableau sont «parallélisées». Cela signifie que la
+première diagonale est tracée et que, ensuite, les autres lignes sont tracées
+parallèlement à la première (par rotation autour de l'extrémité la plus à gauche
+de la ligne). C'est pourquoi la position des instructions |\Ddots| dans un
+tableau peut avoir un effet marqué sur le résultat final.
\medskip
Dans les exemples suivants, la première instruction |\Ddots| est marquée en couleur :
@@ -2898,7 +3248,8 @@ a+b & \Cdots & a+b & 1
\end{pNiceMatrix}$
\bigskip
-Il est possible de désactiver la parallélisation avec l'option |parallelize-diags| mise à |false|: \par\nobreak
+Il est possible de désactiver la parallélisation avec l'option
+|parallelize-diags| mise à |false|: \par\nobreak
\medskip
\NiceMatrixOptions{parallelize-diags=false}%
@@ -2919,10 +3270,11 @@ a+b & \Cdots & a+b & 1
\subsection{Les cases «vides»}
\label{empty-cells}
-Une instruction comme |\Ldots|, |\Cdots|, etc. essaye de déterminer la première case vide de part et d'autre de la
-case considérée. Néanmoins, une case vide n'est pas nécessairement sans contenu dans le codage TeX (c'est-à-dire
-sans aucun token entre les deux esperluettes~|&|). En effet, une case dont le contenu est |\hspace*{1cm}| peut être
-considérée comme vide.
+Une instruction comme |\Ldots|, |\Cdots|, etc. essaye de déterminer la première
+case vide de part et d'autre de la case considérée. Néanmoins, une case vide
+n'est pas nécessairement sans contenu dans le codage TeX (c'est-à-dire sans
+aucun token entre les deux esperluettes~|&|). En effet, une case dont le contenu
+est |\hspace*{1cm}| peut être considérée comme vide.
\interitem
Pour \pkg{nicematrix}, les règles précises sont les suivantes :
@@ -2943,31 +3295,39 @@ la dernière case (deuxième rangée et deuxième colonne) est vide.
\item Chaque case avec un rendu par TeX de largeur nulle est vide.
\medskip
-\item Une case avec une commande |\Hspace| (ou |\Hspace*|) est vide. Cette commande |\Hspace| est une commande
-définie par l'extension \pkg{nicematrix} avec la même signification que |\hspace| excepté que la case où cette
-commande est utilisée est considérée comme vide. Cette commande peut être utilisée pour fixer la largeur des
-colonnes sans interférer avec le tracé des lignes en pointillés par \pkg{nicematrix}.
+\item Une case avec une commande |\Hspace| (ou |\Hspace*|) est vide. Cette
+commande |\Hspace| est une commande définie par l'extension \pkg{nicematrix}
+avec la même signification que |\hspace| excepté que la case où cette commande
+est utilisée est considérée comme vide. Cette commande peut être utilisée pour
+fixer la largeur des colonnes sans interférer avec le tracé des lignes en
+pointillés par \pkg{nicematrix}.
\end{itemize}
\subsection{L'option exterior-arraycolsep}
-L'environnement |{array}| insère un espace horizontal égal à |\arraycolsep| avant et après chaque colonne. En
-particulier, il y a un espace égal à |\arraycolsep| avant et après le tableau. Cette caractéristique de
-l'environnement |{array}| n'était probablement pas une bonne idée\footnote{Dans la documentation de |{amsmath}|, on
- peut lire : {\itshape The extra space of |\arraycolsep| that \pkg{array} adds on each side is a waste so we
- remove it [in |{matrix}|] (perhaps we should instead remove it from array in general, but that's a harder
- task).}}. L'environnement |{matrix}| et ses variantes (|{pmatrix}|,
-|{vmatrix}|, etc.) de \pkg{amsmath} préfèrent supprimer ces espaces avec des instructions explicites
-|\hskip -\arraycolsep|\footnote{Et non en insérant |@{}| de part et d'autre du préambule, ce qui fait que la
- longueur des |\hline| n'est pas modifiée et elle peut paraître trop longue, surtout avec des crochets.}.
-L'extension \pkg{nicematrix} fait de même dans \emph{tous} ses environnements y compris l'environnement
-|{NiceArray}|. Néanmoins, si l'utilisateur souhaite que l'environnement |{NiceArray}| se comporte par défaut comme
-l'environnement |{array}| de \pkg{array} (par exemple pour faciliter l'adaptation d'un document existant), il peut
-contrôler ce comportement avec l'option |exterior-arraycolsep| accessible via la commande |\NiceMatrixOptions|.
-Avec cette option, des espaces extérieurs de longueur |\arraycolsep| seront insérés dans les environnements
-|{NiceArray}| (les autres environnements de l'extension \pkg{nicematrix} ne sont pas affectés).
+L'environnement |{array}| insère un espace horizontal égal à |\arraycolsep|
+avant et après chaque colonne. En particulier, il y a un espace égal à
+|\arraycolsep| avant et après le tableau. Cette caractéristique de
+l'environnement |{array}| n'était probablement pas une bonne idée\footnote{Dans
+ la documentation de |{amsmath}|, on peut lire : {\itshape The extra space of
+ |\arraycolsep| that \pkg{array} adds on each side is a waste so we remove it
+ [in |{matrix}|] (perhaps we should instead remove it from array in general,
+ but that's a harder task).}}. L'environnement |{matrix}| et ses variantes
+(|{pmatrix}|, |{vmatrix}|, etc.) de \pkg{amsmath} préfèrent supprimer ces
+espaces avec des instructions explicites |\hskip -\arraycolsep|\footnote{Et non
+ en insérant |@{}| de part et d'autre du préambule, ce qui fait que la longueur
+ des |\hline| n'est pas modifiée et elle peut paraître trop longue, surtout
+ avec des crochets.}. L'extension \pkg{nicematrix} fait de même dans
+\emph{tous} ses environnements y compris l'environnement |{NiceArray}|.
+Néanmoins, si l'utilisateur souhaite que l'environnement |{NiceArray}| se
+comporte par défaut comme l'environnement |{array}| de \pkg{array} (par exemple
+pour faciliter l'adaptation d'un document existant), il peut contrôler ce
+comportement avec l'option |exterior-arraycolsep| accessible via la commande
+|\NiceMatrixOptions|. Avec cette option, des espaces extérieurs de longueur
+|\arraycolsep| seront insérés dans les environnements |{NiceArray}| (les autres
+environnements de l'extension \pkg{nicematrix} ne sont pas affectés).
@@ -3086,7 +3446,8 @@ Dupont & Chantal & 15 janvier 1998 \\
Une matrice de permutation.\par\nobreak
-À titre d'exemple, on a augmenté la valeur du paramètre |xdots/shorten|.\par\nobreak
+À titre d'exemple, on a augmenté la valeur du paramètre
+|xdots/shorten|.\par\nobreak
\bigskip
@@ -3237,8 +3598,9 @@ $\begin{pNiceArray}{*6c|c}[nullify-dots,last-col,code-for-last-col=\scriptstyle]
\subsection{Des lignes pointillées qui ne sont plus pointillées}
-L'option |line-style| permet de changer le style des lignes tracées par |\Ldots|, |\Cdots|, etc. On peut de ce fait
-tracer des lignes qui ne sont plus pointillées.
+L'option |line-style| permet de changer le style des lignes tracées par
+|\Ldots|, |\Cdots|, etc. On peut de ce fait tracer des lignes qui ne sont plus
+pointillées.
\begin{Verbatim}
\NiceMatrixOptions
@@ -3273,8 +3635,9 @@ $\begin{pNiceMatrix}[first-row,first-col]
\subsection{Largeur des colonnes}
\medskip
-Dans l'exemple suivant, nous utilisons |{NiceMatrixBlock}| avec l'option |auto-columns-width| parce que nous
-voulons la même largeur (automatique) pour toutes les colonnes.
+Dans l'exemple suivant, nous utilisons |{NiceMatrixBlock}| avec l'option
+|auto-columns-width| parce que nous voulons la même largeur (automatique) pour
+toutes les colonnes.
\bigskip
\begin{BVerbatim}
@@ -3283,7 +3646,7 @@ voulons la même largeur (automatique) pour toutes les colonnes.
{ last-col,code-for-last-col = \color{blue}\scriptstyle,light-syntax}
\setlength{\extrarowheight}{1mm}
$\begin{pNiceArray}{cccc:c}
- 1 1 1 1 1 ;
+ 1 1 1 1 1 { } ;
2 4 8 16 9 ;
3 9 27 81 36 ;
4 16 64 256 100
@@ -3307,7 +3670,7 @@ $\begin{pNiceArray}{cccc:c}
\setlength{\extrarowheight}{1mm}
\enskip $\begin{pNiceArray}{cccc:c}
-1 1 1 1 1 ;
+1 1 1 1 1 { } ;
2 4 8 16 9 ;
3 9 27 81 36 ;
4 16 64 256 100
@@ -3366,8 +3729,9 @@ $\begin{pNiceArray}{cccc:c}
\label{highlight}
\medskip
-Les exemples suivants nécessitent d'avoir chargé Tikz (\pkg{nicematrix} ne charge que \textsc{pgf}) ainsi que la
-bibliothèque Tikz |fit|, ce qui peut se faire avec les deux instructions suivantes dans le préambule du document :
+Les exemples suivants nécessitent d'avoir chargé Tikz (\pkg{nicematrix} ne
+charge que \textsc{pgf}) ainsi que la bibliothèque Tikz |fit|, ce qui peut se
+faire avec les deux instructions suivantes dans le préambule du document :
\begin{verbatim}
\usepackage{tikz}
@@ -3377,13 +3741,15 @@ bibliothèque Tikz |fit|, ce qui peut se faire avec les deux instructions suivan
\medskip
-Pour mettre en évidence une case, il est possible de «dessiner» l'un des nœuds (le «nœud normal», le «nœud moyen»
-ou le «nœud large»). Dans l'exemple suivant, on utilise les «nœuds larges» de la diagonale de la matrice (avec la
-clé de Tikz «|name suffix|», il est facile d'utiliser les «nœuds larges»).
+Pour mettre en évidence une case, il est possible de «dessiner» l'un des nœuds
+(le «nœud normal», le «nœud moyen» ou le «nœud large»). Dans l'exemple suivant,
+on utilise les «nœuds larges» de la diagonale de la matrice (avec la clé de Tikz
+«|name suffix|», il est facile d'utiliser les «nœuds larges»).
-Nous redessinons les nœuds avec de nouveaux nœuds en utilisant la bibliothèque \pkg{fit} de Tikz. Comme nous
-voulons recréer des nœuds identiques aux premiers, nous devons fixer |inner sep = 0pt| (si on ne fait
-pas cela, les nouveaux nœuds seront plus grands que les nœuds d'origine créés par \pkg{nicematrix}).
+Nous redessinons les nœuds avec de nouveaux nœuds en utilisant la bibliothèque
+\pkg{fit} de Tikz. Comme nous voulons recréer des nœuds identiques aux premiers,
+nous devons fixer |inner sep = 0pt| (si on ne fait pas cela, les nouveaux nœuds
+seront plus grands que les nœuds d'origine créés par \pkg{nicematrix}).
\label{exemple-CodeAfter}
@@ -3419,18 +3785,22 @@ a_{41} & a_{42} & a_{43} & a_{44}
\end{tikzpicture}
\end{pNiceArray}\]
-On remarquera que les traits que l'on vient de tracer sont dessinés \emph{après} la matrice sans modifier la
-position des composantes de celle-ci. En revanche, les traits tracés par |\hline|, le spécificateur «\verb+|+» ou
-les options |hlines|, |vlines| et |hvlines| «écartent» les composantes de la matrice.\footnote{Pour la commande
- |\cline|, voir la remarque p.~\pageref{remark-cline}.}
+On remarquera que les traits que l'on vient de tracer sont dessinés \emph{après}
+la matrice sans modifier la position des composantes de celle-ci. En revanche,
+les traits tracés par |\hline|, le spécificateur «\verb+|+» ou les options
+|hlines|, |vlines| et |hvlines| «écartent» les composantes de la
+matrice.\footnote{Pour la commande |\cline|, voir la remarque
+ p.~\pageref{remark-cline}.}
-\vspace{1cm}
-Il est possible de colorier une rangée avec |\rowcolor| dans le |code-before| (ou avec |\rowcolor| de
-\pkg{colortbl} dans la première case de la rangée ). Les possibilités de réglages sont néanmoins limitées. C'est
-pourquoi nous présentons ici une autre méthode pour surligner une rangée de la matrice. Nous créons un nœud Tikz
-rectangulaire qui englobe les nœuds de la deuxième rangée en utilisant les outils de la bibliothèque Tikz
-\pkg{fit}. Ce nœud est rempli après la construction de la matrice. Pour que l'on puisse voir le texte \emph{sous}
-le nœud, nous devons utiliser la transparence avec le |blend mode| égal à |multiply|.
+\vspace{1cm} Il est possible de colorier une rangée avec |\rowcolor| dans le
+|code-before| (ou avec |\rowcolor| de \pkg{colortbl} dans la première case de la
+rangée ). Les possibilités de réglages sont néanmoins limitées. C'est pourquoi
+nous présentons ici une autre méthode pour surligner une rangée de la matrice.
+Nous créons un nœud Tikz rectangulaire qui englobe les nœuds de la deuxième
+rangée en utilisant les outils de la bibliothèque Tikz \pkg{fit}. Ce nœud est
+rempli après la construction de la matrice. Pour que l'on puisse voir le texte
+\emph{sous} le nœud, nous devons utiliser la transparence avec le |blend mode|
+égal à |multiply|.
\tikzset{highlight/.style={rectangle,
@@ -3464,9 +3834,10 @@ $\begin{bNiceMatrix}[~emphase#code-after = {\tikz \node [highlight = (2-1) (2-3)
\bigskip
-Ce code échoue avec |latex|-|dvips|-|ps2pdf| parce que Tikz pour |dvips|, pour le moment, ne prend pas en charge
-les \emph{blend modes}. Néanmoins, le code suivant, dans le préambule du document LaTeX, devrait activer les
-\emph{blend modes} pour ce mode de compilation.
+Ce code échoue avec |latex|-|dvips|-|ps2pdf| parce que Tikz pour |dvips|, pour
+le moment, ne prend pas en charge les \emph{blend modes}. Néanmoins, le code
+suivant, dans le préambule du document LaTeX, devrait activer les \emph{blend
+ modes} pour ce mode de compilation.
\begin{scope} \small
@@ -3485,11 +3856,12 @@ les \emph{blend modes}. Néanmoins, le code suivant, dans le préambule du docum
|\ExplSyntaxOff|
\end{scope}
-\vspace{1cm}
-On rappelle que dans le cas d'un ensemble de cases fusionnées (avec la commande |\Block|), un nœud Tikz est créé
-pour l'ensemble des cases avec pour nom $i$|-|$j$|-block| où $i$ et $j$ sont les numéros de ligne et de colonne de
-la case en haut à gauche (où a été utilisée la commande |\Block|). Si on a demandé la création des nœuds |medium|,
-alors un nœud de ce type est aussi créé pour ce bloc avec un nom suffixé par |-medium|.
+\vspace{1cm} On rappelle que dans le cas d'un ensemble de cases fusionnées (avec
+la commande |\Block|), un nœud Tikz est créé pour l'ensemble des cases avec pour
+nom $i$|-|$j$|-block| où $i$ et $j$ sont les numéros de ligne et de colonne de
+la case en haut à gauche (où a été utilisée la commande |\Block|). Si on a
+demandé la création des nœuds |medium|, alors un nœud de ce type est aussi créé
+pour ce bloc avec un nom suffixé par |-medium|.
@@ -3561,7 +3933,8 @@ a & a & a & L_3
\end{pNiceArray}\]
\medskip
-Le résultat peut paraître décevant. On peut l'améliorer en utilisant les «nœuds moyens» au lieu des «nœuds normaux».
+Le résultat peut paraître décevant. On peut l'améliorer en utilisant les «nœuds
+moyens» au lieu des «nœuds normaux».
\begin{Verbatim}
\begin{tikzpicture}[mes-options, ~emphase#name suffix = -medium@]
@@ -3594,7 +3967,8 @@ a & a & a & L_3
\vspace{1cm}
-Dans l'exemple suivant, on utilise les «nœuds larges» pour surligner une zone de la matrice.\par\nobreak
+Dans l'exemple suivant, on utilise les «nœuds larges» pour surligner une zone de
+la matrice.\par\nobreak
\begin{Verbatim}
\begin{pNiceArray}{>{\strut}cccc}[create-large-nodes,margin,extra-margin=2pt]
A_{11} & A_{12} & A_{13} & A_{14} \\
@@ -3634,8 +4008,9 @@ Dans l'exemple suivant, on utilise les «nœuds larges» pour surligner une zone
Dans l'exemple suivant, on souhaite illustrer le produit mathématique de deux matrices.
\medskip
-L'utilisation de |{NiceMatrixBlock}| avec l'option |auto-columns-width| va permettre que toutes les colonnes aient
-la même largeur ce qui permettra un alignement des deux matrices superposées.
+L'utilisation de |{NiceMatrixBlock}| avec l'option |auto-columns-width| va
+permettre que toutes les colonnes aient la même largeur ce qui permettra un
+alignement des deux matrices superposées.
\begin{Verbatim}
\begin{NiceMatrixBlock}[auto-columns-width]
\end{Verbatim}
@@ -3737,8 +4112,9 @@ L_i & a_{i1} & \Cdots & a_{ik} & \Cdots & a_{in} \\
\section*{Autre documentation}
-Le document |nicematrix.pdf| (fourni avec l'extension \pkg{nicematrix}) contient une traduction anglaise de la
-documentation ici présente, ainsi que le code source commenté et un historique des versions.
+Le document |nicematrix.pdf| (fourni avec l'extension \pkg{nicematrix}) contient
+une traduction anglaise de la documentation ici présente, ainsi que le code
+source commenté et un historique des versions.
\end{document}
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 4f023e6f6d..c2856d51a2 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{5.0}
-\def\myfiledate{2020/07/15}
+\def\myfileversion{5.1}
+\def\myfiledate{2020/07/31}
%
%
%<*batchfile>
@@ -191,7 +191,7 @@ version 2005/12/01 or later.
% \bigskip
% {\bfseries \color{red} Important
%
-% In this version 5.0 of \pkg{nicematrix}, one must use the letters |l|, |c| and
+% Since the version 5.0 of \pkg{nicematrix}, one must use the letters |l|, |c| and
% |r| in the preambles of the environments and no longer the letters |L|, |C| and
% |R|.
%
@@ -212,12 +212,12 @@ version 2005/12/01 or later.
% \begin{ttfamily}
% \setlength{\tabcolsep}{3mm}
% \begin{tabular}{llll}
-% \{NiceTabular\} & \{NiceArray\} & \{NiceMatrix\} \\
-% & \{pNiceArray\} & \{pNiceMatrix\} \\
-% & \{bNiceArray\} & \{bNiceMatrix\} \\
-% & \{BNiceArray\} & \{BNiceMatrix\} \\
-% & \{vNiceArray\} & \{vNiceMatrix\} \\
-% & \{VNiceArray\} & \{VNiceMatrix\}
+% \{NiceTabular\} & \{NiceArray\} & \{NiceMatrix\} \\
+% \{NiceTabular*\} & \{pNiceArray\} & \{pNiceMatrix\} \\
+% & \{bNiceArray\} & \{bNiceMatrix\} \\
+% & \{BNiceArray\} & \{BNiceMatrix\} \\
+% & \{vNiceArray\} & \{vNiceMatrix\} \\
+% & \{VNiceArray\} & \{VNiceMatrix\}
% \end{tabular}
% \end{ttfamily}
%
@@ -225,13 +225,9 @@ version 2005/12/01 or later.
%
%
% \medskip
-% The environments |{NiceArray}| and |{NiceTabular}| are similar to the
-% environments |{array}| and |{tabular}| of the package \pkg{array} (which is
-% loaded by \pkg{nicematrix}).
-%
-% However, in |{NiceArray}| (and its variants), the columns of type |w| (e.g.:
-% |wc{1cm}|) are composed in math mode whereas, in |{array}| of \pkg{array},
-% they are composed in text mode.
+% The environments |{NiceArray}|, |{NiceTabular}| and |{NiceTabular*}| are
+% similar to the environments |{array}|, |{tabular}| and |{tabular*}| of the
+% package \pkg{array} (which is loaded by \pkg{nicematrix}).
%
% \medskip
% The environments |{pNiceArray}|, |{bNiceArray}|, etc. have no equivalent in
@@ -318,7 +314,7 @@ version 2005/12/01 or later.
% \section{The vertical position of the arrays}
%
% The package \pkg{nicematrix} provides a option |baseline| for the vertical
-% position of the arrays. This option takes as value an integer which is the
+% position of the arrays. This option takes in as value an integer which is the
% number of the row on which the array will be aligned.
%
% \medskip
@@ -348,8 +344,7 @@ version 2005/12/01 or later.
% immediately after an |\item| of list. One should remark that the presence of a
% |\hline| at the beginning of the array doesn't prevent the alignment of the
% baseline with the baseline of the first row (with |{tabular}| or |{array}| of
-% \pkg{array}, one must use |\firsthline|\footnote{It's also possible to use
-% |\firsthline| in the environments of \pkg{nicematrix}.}).
+% \pkg{array}, one must use |\firsthline|.
%
% \medskip
% \begin{BVerbatim}[baseline=c,boxwidth=9cm]
@@ -545,61 +540,81 @@ version 2005/12/01 or later.
% \section{The rules}
%
% The usual techniques for the rules may be used in the environments of
-% \pkg{nicematrix} (excepted |\vline|).
+% \pkg{nicematrix} (excepted |\vline|). However, there is some small differences
+% with the classical environments.
%
+% \bigskip
+% \subsection{Some differences with the classical environments}
%
-% \subsection{The thickness and the color of the rules}
-%
-% The environments of \pkg{nicematrix} provide a key |rules/width| to set the
-% width (in fact the thickness) of the rules in the current environment. In
-% fact, this key merely sets the value of the length |\arrayrulewidth|.
-%
-% \smallskip
-% It's well known that \pkg{colortbl} provides the command |\arrayrulecolor| in
-% order to specify the color of the rules.
+% \subsubsection{The vertical rules}
%
-% \smallskip
-% With \pkg{nicematrix}, it's possible to specify the color of the rules even
-% when \pkg{colortbl} is not loaded. For sake of compatibility, the command is
-% also named |\arrayrulecolor|. The environments of \pkg{nicematrix} also
-% provide a key |rules/color| to fix the color of the rules in the current
-% environment.
-%
-% \medskip
-% \begin{scope}
-% \hfuzz=10cm
-% \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-% \begin{NiceTabular}{|ccc|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
-% \hline
-% rose & tulipe & lys \\
-% arum & iris & violette \\
-% muguet & dahlia & souci \\
-% \hline
+% In the environments of \pkg{nicematrix}, the vertical rules specified by
+% \verb+|+ in the preambles of the environments are never broken, even by an
+% incomplete row or by a double horizontal rule specified by |\hline\hline|
+% (there is no need to use \pkg{hhline}). \footnote{This is the behaviour since
+% the version 5.1 of \pkg{nicematrix}. Prior to that version, the behaviour was
+% the standard behaviour of \pkg{array}.}
+%
+% \bigskip
+% \begin{BVerbatim}[baseline=c,boxwidth=10cm]
+% \begin{NiceTabular}{|c|c|} \hline
+% First & Second \\ ~emphase#\hline\hline@
+% Peter \\ \hline
+% Mary & George\\ \hline
% \end{NiceTabular}
% \end{BVerbatim}
-% \begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
-% \hline
-% rose & tulipe & lys \\
-% arum & iris & violette \\
-% muguet & dahlia & souci \\
-% \hline
+% \begin{NiceTabular}{|c|c|}[c] \hline
+% First & Second \\ \hline\hline
+% Peter \\ \hline
+% Mary & George \\ \hline
% \end{NiceTabular}
-% \end{scope}
+%
+% \bigskip
+% If you use \pkg{booktabs} (which provides |\toprule|, |\midrule|,
+% |\bottomrule|, etc.) and if you really want to add vertical rules (which is
+% not in the spirit of \pkg{booktabs}), you should notice that the vertical rules
+% drawn by \pkg{nicematrix} are compatible with \pkg{booktabs}.
%
% \medskip
-% If one wishes to define new specifiers for columns in order to draw vertical
-% rules (for example with a specific color or thicker than the standard rules),
-% he should consider the command |\OnlyMainNiceMatrix| described on
-% page~\pageref{OnlyMainNiceMatrix}.
+% \begin{BVerbatim}[baseline=c,boxwidth=10.5cm]
+% $\begin{NiceArray}{~emphase#|cccc|@} \toprule
+% a & b & c & d \\ \midrule
+% 1 & 2 & 3 & 4 \\
+% 1 & 2 & 3 & 4 \\ \bottomrule
+% \end{NiceArray}$
+% \end{BVerbatim}
+% $\begin{NiceArray}{|cccc|}
+% \toprule
+% a & b & c & d \\
+% \midrule
+% 1 & 2 & 3 & 4 \\
+% 1 & 2 & 3 & 4 \\
+% \bottomrule
+% \end{NiceArray}$
+%
+% \bigskip
+% However, it's still possible to define a specifier (named, for instance, |I|)
+% to draw vertical rules with the standard behaviour of \pkg{array}.
+%
+% \begin{Verbatim}
+% \newcolumntype{I}{!{\vrule}}
+% \end{Verbatim}
+%
+% However, in this case, it is probably more clever to add a command
+% |\OnlyMainNiceMatrix| (cf. p.~\pageref{OnlyMainNiceMatrix}):
+% \begin{Verbatim}
+% \newcolumntype{I}{!{\OnlyMainNiceMatrix{\vrule}}}
+% \end{Verbatim}
%
%
% \bigskip
-% \subsection{A remark about \textbackslash cline}
+% \subsubsection{The command \textbackslash cline}
%
%\label{remark-cline}
%
% The horizontal and vertical rules drawn by |\hline| and the specifier
-% ``\verb+|+'' make the array larger or wider by a quantity equal to the width of the rule.
+% ``\verb+|+'' make the array larger or wider by a quantity equal to the width
+% of the rule (with \pkg{array} and also with \pkg{nicematrix}).
%
% \smallskip
% For historical reasons, this is not the case with the command |\cline|, as
@@ -647,6 +662,53 @@ version 2005/12/01 or later.
% \end{NiceTabular}
% \end{scope}
%
+%
+% \subsection{The thickness and the color of the rules}
+%
+% The environments of \pkg{nicematrix} provide a key |rules/width| to set the
+% width (in fact the thickness) of the rules in the current environment. In
+% fact, this key merely sets the value of the length |\arrayrulewidth|.
+%
+% \smallskip
+% It's well known that \pkg{colortbl} provides the command |\arrayrulecolor| in
+% order to specify the color of the rules.
+%
+% \smallskip
+% With \pkg{nicematrix}, it's possible to specify the color of the rules even
+% when \pkg{colortbl} is not loaded. For sake of compatibility, the command is
+% also named |\arrayrulecolor|. The environments of \pkg{nicematrix} also
+% provide a key |rules/color| to fix the color of the rules in the current
+% environment.
+%
+% \medskip
+% \begin{scope}
+% \hfuzz=10cm
+% \begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
+% \begin{NiceTabular}{|ccc|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
+% \hline
+% rose & tulipe & lys \\
+% arum & iris & violette \\
+% muguet & dahlia & souci \\
+% \hline
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
+% \hline
+% rose & tulipe & lys \\
+% arum & iris & violette \\
+% muguet & dahlia & souci \\
+% \hline
+% \end{NiceTabular}
+% \end{scope}
+%
+% \medskip
+% If one wishes to define new specifiers for columns in order to draw vertical
+% rules (for example with a specific color or thicker than the standard rules),
+% he should consider the command |\OnlyMainNiceMatrix| described on
+% page~\pageref{OnlyMainNiceMatrix}.
+%
+%
+%
% \subsection{The keys hlines and vlines}
%
% The key |hlines| draws all the horizontal rules and the key |vlines| draws all
@@ -668,52 +730,6 @@ version 2005/12/01 or later.
% 1 & 2 & 3 & 4 & 5 & 6
% \end{pNiceMatrix}$
%
-% \bigskip
-% However, there is a difference between the key |vlines| and the use of
-% the specifier ``"|"'' in the preamble of the environment: the rules drawn by
-% |vlines| completely cross the double-rules drawn by |\hline\hline| (you don't
-% need \pkg{hhline}).
-%
-% \medskip
-% \begin{BVerbatim}[baseline=c,boxwidth=11.5cm]
-% $\begin{NiceMatrix}[~emphase#vlines@] \hline
-% a & b & c & d \\ \hline \hline
-% 1 & 2 & 3 & 4 \\
-% 1 & 2 & 3 & 4 \\ \hline
-% \end{NiceMatrix}$
-% \end{BVerbatim}
-% $\begin{NiceMatrix}[vlines]
-% \hline
-% a & b & c & d \\
-% \hline \hline
-% 1 & 2 & 3 & 4 \\
-% 1 & 2 & 3 & 4 \\
-% \hline
-% \end{NiceMatrix}$
-%
-%
-% \bigskip
-% If you use \pkg{booktabs} (which provides |\toprule|, |midrule|, |bottomrule|,
-% etc.) and you really want to draw vertical rules (something opposed to the
-% spirit of \pkg{booktabs}), you should remark that the key |vlines| in
-% compatible with \pkg{booktabs}.
-%
-% \medskip
-% \begin{BVerbatim}[baseline=c,boxwidth=11.5cm]
-% $\begin{NiceMatrix}[~emphase#vlines@] \toprule
-% a & b & c & d \\ \midrule
-% 1 & 2 & 3 & 4 \\
-% 1 & 2 & 3 & 4 \\ \bottomrule
-% \end{NiceMatrix}$
-% \end{BVerbatim}
-% $\begin{NiceMatrix}[vlines]
-% \toprule
-% a & b & c & d \\
-% \midrule
-% 1 & 2 & 3 & 4 \\
-% 1 & 2 & 3 & 4 \\
-% \bottomrule
-% \end{NiceMatrix}$
%
%
% \subsection{The key hvlines}
@@ -888,37 +904,54 @@ version 2005/12/01 or later.
% \emph{Remark} : In the package \pkg{array} (on which the package
% \pkg{nicematrix} relies), horizontal and vertical rules make the array larger
% or wider by a quantity equal to the width of the rule\footnote{In fact, this
-% is true only for |\hline| and ``"|"'' but not for |\cline|.}. In
-% \pkg{nicematrix}, the dotted lines drawn by |\hdottedline| and ``|:|'' do
-% likewise.
+% is true only for |\hline| and ``"|"'' but not for |\cline|: cf
+% p.~\pageref{remark-cline}}. In \pkg{nicematrix}, the dotted lines drawn by
+% |\hdottedline| and ``|:|'' do likewise.
%
%
%
%\section{The color of the rows and columns}
%
-% With the classical package \pkg{colortbl}, it's possible to color the cells,
-% rows and columns of a tabular. However, the resulting \textsc{pdf} is not
-% always perfectly displayed by the \textsc{pdf} viewers, in particular in
-% conjonction with rules. With some \textsc{pdf} viewers, some vertical rules
-% seem to vanish. On the other side, some thin horizontal white lines may appear
-% in some circonstances.
+% \subsection{Utilisation of colortbl}
%
+% We recall that the package \pkg{colortbl} can be loaded directly with
+% |\usepackage{colortbl}| or by loading \pkg{xcolor} with the key |table|:
+% |\usepackage[table]{xcolor}|.
%
% \medskip
-% The package \pkg{nicematrix} provides similar tools which do not present these
-% drawbacks. It provides a key |code-before|\footnote{There is also a key
-% |code-after| : see p.~\pageref{code-after}.} for some code which will be
-% executed \emph{before} the drawing of the tabular. In this |code-before|, new
-% commands are available: |\cellcolor|, |\rectanglecolor|, |\rowcolor|,
-% |\columncolor|, |\rowcolors| and |\chessboardcolors|.
-% \label{code-before}
+% Since the package \pkg{nicematrix} is based on \pkg{array}, it's possible to
+% use \pkg{colortbl} with \pkg{nicematrix}.
%
% \medskip
-% These commands are independent of \pkg{colortbl}.\footnote{Thus, it's possible
-% to color the rules, the cells, the rows, the columns, etc. without loading
-% \pkg{colortbl}.}
+% However, there is two drawbacks:
+% \begin{itemize}
+% \item The package \pkg{colortbl} patches \pkg{array}, leading to some
+% incompatibilities (for example with the command |\hdotsfor|).
+%
+% \item The package \pkg{colortbl} constructs the array row by row, alterning
+% colored rectangles, rules and contents of the cells. The resulting
+% \textsc{pdf} is difficult to interpret by some \textsc{pdf} viewers and may
+% lead to artefacts on the screen : some rules seem to disappear and on the
+% other side, some thin white lines appear. The package \pkg{nicematrix}
+% provides some tools without those drawbacks.
+% \end{itemize}
+%
+% \subsection{The tools of nicematrix in the code-before}
+%
+% The package \pkg{nicematrix} provides some tools (independent of
+% \pkg{colortbl}) to draw the colored panels first, and, then, the content
+% of the cells and the rules. This strategy is more conform to the ``painting
+% model'' of the formats PostScript and \textsc{pdf} and is more suitable for
+% the \textsc{pdf} viewers. However, it requires several compilations.
%
% \medskip
+% The extension \pkg{nicematrix} provides a key |code-before| for some code that
+% will be executed before the drawing of the tabular. In this |code-before|, new
+% commands are available: |\cellcolor|, |\rectanglecolor|, |\rowcolor|,
+% |\columncolor|, |\rowcolors| and |\chessboardcolors|.
+% \label{code-before}
+%
+% \medskip
% All these commands accept an optional argument (between square brackets and
% in first position) which is the color model for the specification of the colors.
%
@@ -927,8 +960,8 @@ version 2005/12/01 or later.
% \item The command |\cellcolor| takes its name from the command |\cellcolor| of
% \pkg{colortbl}.
%
-% This command takes in mandatory arguments a color and a list of cells, each of
-% which with the format $i$-$j$ where $i$ is the number of row and $j$ the
+% This command takes in as mandatory arguments a color and a list of cells, each
+% of which with the format $i$-$j$ where $i$ is the number of row and $j$ the
% number of colummn of the cell.
%
%
@@ -1027,7 +1060,7 @@ version 2005/12/01 or later.
% \bigskip
% \item The command |\rowcolors| (with a \emph{s}) takes its name from the
% command |\rowcolors| of \pkg{xcolor}\footnote{The command |\rowcolors| of
-% \pkg{color} is available when \pkg{xcolor} is loaded with the
+% \pkg{xcolor} is available when \pkg{xcolor} is loaded with the
% option~|table|.}. The \emph{s} emphasizes the fact that there is \emph{two}
% colors. This command colors alternately the rows of the tabular, beginning
% with the row whose number is given in first (mandatory) argument. The two
@@ -1057,8 +1090,8 @@ version 2005/12/01 or later.
% \end{scope}
%
% \bigskip
-% \item The command |\chessboardcolors| takes in mandatory arguments two colors
-% and colors the cells of the tabular in quincunx with these colors.
+% \item The command |\chessboardcolors| takes in as mandatory arguments two colors
+% and it colors the cells of the tabular in quincunx with these colors.
%
% \medskip
% \begin{scope}
@@ -1091,7 +1124,7 @@ version 2005/12/01 or later.
% \begin{scope}
% \hfuzz=10cm
% \begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
-% \begin{NiceTabular}[c]{lssss}%
+% \begin{NiceTabular}[c]{lSSSS}%
% [code-before = \rowcolor{red!15}{1-2} \rowcolors{3}{blue!15}{}]
% ~emphase#\toprule@
% \Block{2-1}{Product} \\
@@ -1108,7 +1141,7 @@ version 2005/12/01 or later.
% ~emphase#\bottomrule@
% \end{NiceTabular}
% \end{BVerbatim}
-% \begin{NiceTabular}[c]{lssss}[code-before = \rowcolor{red!15}{1-2}
+% \begin{NiceTabular}[c]{lSSSS}[code-before = \rowcolor{red!15}{1-2}
% \rowcolors{3}{blue!15}{}]
% \toprule
% \Block{2-1}{Product} &
@@ -1129,15 +1162,63 @@ version 2005/12/01 or later.
% \medskip
% We have used the type of column |S| of \pkg{siunitx}.
%
+%
+% \subsection{Color tools with the syntax of colortbl}
+%
+% It's possible to access the preceding tools with a syntax close to the syntax
+% of \pkg{colortbl}. For that, one must use the key |colortbl-like| in the
+% current environment.\footnote{As of now, this key is not available in |\NiceMatrixOptions|.}
+%
+% There are three commands available (they are inspired by \pkg{colortbl} but
+% are \emph{independent} of \pkg{colortbl}):
+% \begin{itemize}
+% \item |\cellcolor| which colorizes a cell;
+% \item |\rowcolor| which must be used in a cell and which colorizes the end of
+% the row;
+% \item |\columncolor| which must be used in the preamble of the environment
+% with the same syntax as the corresponding command of
+% \pkg{colortbl}\footnote{Unlike the command |\columncolor| of \pkg{colortbl},
+% this command |\columncolor| can appear within another command, itself used in the
+% preamble.}.
+% \end{itemize}
+%
+% \medskip
+% \begin{Verbatim}
+% \begin{NiceTabular}[colortbl-like]{>{~emphase#\columncolor{blue!15}}@ccc}
+% \toprule
+% ~emphase#\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]{>{\columncolor{blue!15}}ccc}
+% \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}
%
% In the environments with an explicit preamble (like |{NiceTabular}|,
% |{NiceArray}|, etc.), it's possible to fix the width of a given column with
-% the standard letters |w| and |W| of the package \pkg{array}. In
-% |{NiceTabular}|, the cells of such columns are composed in text mode but, in
-% |{NiceArray}|, |{pNiceArray}|, etc., they are composed in math mode (whereas,
-% in |{array}| of \pkg{array}, they are composed in text mode).
+% the standard letters |w| and |W| of the package \pkg{array}.
%
% \medskip
% \begin{BVerbatim}[baseline=c,boxwidth=9cm]
@@ -1486,10 +1567,8 @@ version 2005/12/01 or later.
% \end{bNiceMatrix}$
%
% \bigskip
-% In the first column of this exemple, there are two instructions |\Vdots| but
-% only one dotted line is drawn (there is no overlapping graphic objects in the
-% resulting \textsc{pdf}\footnote{And it's not possible to draw a |\Ldots| and a
-% |\Cdots| line between the same cells.}).
+% In the first column of this exemple, there are two instructions |\Vdots| but,
+% of course, only one dotted line is drawn.
%
% \bigskip
% In fact, in this example, it would be possible to draw the same matrix more
@@ -1616,7 +1695,7 @@ version 2005/12/01 or later.
%
%
%
-% \subsection{The command \textbackslash Hdotsfor}
+% \subsection{The commands \textbackslash Hdotsfor and \textbackslash Vdotsfor}
%
% Some people commonly use the command |\hdotsfor| of \pkg{amsmath} in order to
% draw horizontal dotted lines in a matrix. In the environments of
@@ -1668,6 +1747,44 @@ version 2005/12/01 or later.
% |\Hdotsfor| may be used when the package \pkg{colortbl} is loaded (but you
% might have problem if you use |\rowcolor| on the same row as |\Hdotsfor|).
%
+% \bigskip
+% The package \pkg{nicematrix} also provides a command |\Vdotsfor| similar to
+% |\Hdotsfor| but for the vertical dotted lines.
+% \bigskip
+% The following example uses both |\Hdotsfor| and |\Vdotsfor|:
+%
+% \begin{Verbatim}[formatcom=\small\color{gray}]
+% \begin{bNiceMatrix}
+% C[a_1,a_1] & \Cdots & C[a_1,a_n]
+% & \hspace*{20mm} & C[a_1,a_1^{(p)}] & \Cdots & C[a_1,a_n^{(p)}] \\
+% \Vdots & \Ddots & \Vdots
+% & ~emphase#\Hdotsfor{1}@ & \Vdots & \Ddots & \Vdots \\
+% C[a_n,a_1] & \Cdots & C[a_n,a_n]
+% & & C[a_n,a_1^{(p)}] & \Cdots & C[a_n,a_n^{(p)}] \\
+% \rule{0pt}{15mm} & ~emphase#\Vdotsfor{1}@ & & \Ddots & & ~emphase#\Vdotsfor{1}@ \\
+% C[a_1^{(p)},a_1] & \Cdots & C[a_1^{(p)},a_n]
+% & & C[a_1^{(p)},a_1^{(p)}] & \Cdots & C[a_1^{(p)},a_n^{(p)}] \\
+% \Vdots & \Ddots & \Vdots
+% & ~emphase#\Hdotsfor{1}@ & \Vdots & \Ddots & \Vdots \\
+% C[a_n^{(p)},a_1] & \Cdots & C[a_n^{(p)},a_n]
+% & & C[a_n^{(p)},a_1^{(p)}] & \Cdots & C[a_n^{(p)},a_n^{(p)}]
+% \end{bNiceMatrix}
+% \end{Verbatim}
+%
+%
+% \[\begin{bNiceMatrix}
+% C[a_1,a_1] & \Cdots & C[a_1,a_n] & \hspace*{20mm} & C[a_1,a_1^{(p)}] & \Cdots & C[a_1,a_n^{(p)}] \\
+% \Vdots & \Ddots & \Vdots & \Hdotsfor{1} & \Vdots & \Ddots & \Vdots \\
+% C[a_n,a_1] & \Cdots & C[a_n,a_n] & & C[a_n,a_1^{(p)}] & \Cdots & C[a_n,a_n^{(p)}] \\
+% \rule{0pt}{15mm} & \Vdotsfor{1} & & \Ddots & & \Vdotsfor{1} \\
+% C[a_1^{(p)},a_1] & \Cdots & C[a_1^{(p)},a_n] & & C[a_1^{(p)},a_1^{(p)}] & \Cdots & C[a_1^{(p)},a_n^{(p)}] \\
+% \Vdots & \Ddots & \Vdots & \Hdotsfor{1} & \Vdots & \Ddots & \Vdots \\
+% C[a_n^{(p)},a_1] & \Cdots & C[a_n^{(p)},a_n] & & C[a_n^{(p)},a_1^{(p)}] & \Cdots & C[a_n^{(p)},a_n^{(p)}]
+% \end{bNiceMatrix}\]
+
+
+
+%
% \subsection{How to generate the continuous dotted lines transparently}
%
% The package \pkg{nicematrix} provides an option called |transparent| for using
@@ -1995,7 +2112,8 @@ version 2005/12/01 or later.
% \begin{itemize}
% \item If you have several successive commands |\tabularnote{...}| \emph{with no
% space at all between them}, the labels of the corresponding notes are composed
-% together, separated by commas.
+% together, separated by commas (this is similar to the option |multiple| of
+% \pkg{footmisc} for the footnotes).
%
% \item If a command |\tabularnote{...}| is exactly at the end of a cell (with
% no space at all after), the label of the note is composed in an overlapping
@@ -2086,7 +2204,7 @@ version 2005/12/01 or later.
% \item |notes/code-before|
% \end{itemize}
% For sake of commodity, it is also possible to set these keys in
-% |\NiceMatrixOptions| via a key |notes| which takes as value a list of
+% |\NiceMatrixOptions| via a key |notes| which takes in as value a list of
% pairs \textsl{key=value} where the name of the keys need no longer be
% prefixed by |notes|:
% \begin{center}
@@ -2191,7 +2309,7 @@ version 2005/12/01 or later.
% corresponds to the type of list used when the option |para| is in force. Of
% course, when the option |para| is used, a list of type |inline| (as called by
% \pkg{enumitem}) is used and the pairs \textsl{key=value} should correspond to
-% such a list of type |inline| .
+% such a list of type |inline|.
%
% Initial value:\quad |afterlabel = \nobreak, itemjoin = \quad|
%
@@ -2270,9 +2388,8 @@ version 2005/12/01 or later.
% \label{key-R}
%
% The environments without preamble (|{NiceMatrix}|, |{pNiceMatrix}|,
-% |{bNiceMatrix}|, etc.) provide two options |l| and |r| (equivalent at |L| and
-% |R|) which generate all the columns aligned leftwards (or
-% rightwards).
+% |{bNiceMatrix}|, etc.) provide two options |l| and |r| which generate all the
+% columns aligned leftwards (or rightwards).
%
%
% \medskip
@@ -2451,7 +2568,7 @@ version 2005/12/01 or later.
% |\AutoNiceMatrix|, |\pAutoNiceMatrix|, |\bAutoNiceMatrix|, |\vAutoNiceMatrix|,
% |\VAutoNiceMatrix| and |\BAutoNiceMatrix|.
%
-% These commands take two mandatory arguments. The first is the format of the
+% These commands take in two mandatory arguments. The first is the format of the
% matrix, with the syntax $n$-$p$ where $n$ is the number of rows and $p$ the
% number of columns. The second argument is the pattern (it's a list of tokens
% which are inserted in each cell of the constructed matrix, excepted in the
@@ -2924,6 +3041,102 @@ version 2005/12/01 or later.
% 1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1
% \end{NiceMatrix}\]
%
+% \section{Tools for the developpers}
+%
+% As its name implies, the token list |\g_nicematrix_code_after_tl| is public
+% (according to the LaTeX3 conventions, each variable with name beginning with
+% |\g_nicematrix| ou |\l_nicematrix| is public and each variable with name
+% beginning with |\g__nicematrix| or |\l__nicematrix| is private).
+%
+%
+% \medskip
+% This variable contains the code of what we have called the ``|code-after|''.
+% The developper can use it to add code from a cell of the array (the
+% affectation must be global, allowing to exit the cell, which is a TeX group).
+%
+% \medskip
+% \emph{Example} : We want to write a command |\crossbox| to draw a cross in the
+% current cell. This command will take in an optional argument between square
+% brackets for a list of pairs \textsl{key}-\textsl{value} which will be given to
+% Tikz before the drawing.
+%
+% It's possible to program such command |\crossbox| as follows, explicitely
+% using the public variable |\g_nicematrix_code_after_tl|.
+%
+%
+% \begin{scope}
+% \fvset{commandchars=\§\¤\μ}
+% \begin{Verbatim}
+% \ExplSyntaxOn
+% \cs_new_protected:Nn \__pantigny_crossbox:nnn
+% {
+% \begin { tikzpicture }
+% \draw [ #3 ]
+% ( row-#1 -| col-\int_eval:n { #2 + 1 } )
+% -- ( row-\int_eval:n { #1 + 1 } -| col-#2 )
+% ( row-#1 -| col-\int_eval:n #2 )
+% -- ( row-\int_eval:n { #1 + 1 } -| col-\int_eval:n { #2 + 1 } ) ;
+% \end { tikzpicture }
+% }
+%
+%
+% \NewDocumentCommand \crossbox { ! O { } }
+% {
+% \tl_gput_right:Nx §emphase¤\g_nicematrix_code_after_tlμ
+% {
+% \__pantigny_crossbox:nnn
+% { \int_use:c { c@iRow } }
+% { \int_use:c { c@jCol } }
+% { \exp_not:n { #1 } }
+% }
+% }
+% \ExplSyntaxOff
+% \end{Verbatim}
+% \end{scope}
+%
+%
+% \ExplSyntaxOn
+% \cs_new_protected:Nn \__pantigny_crossbox:nnn
+% {
+% \begin { tikzpicture }
+% \draw [ #3 ]
+% ( row-#1 -| col-\int_eval:n { #2 + 1 } )
+% -- ( row-\int_eval:n { #1 + 1 } -| col-#2 )
+% ( row-#1 -| col-\int_eval:n #2 )
+% -- ( row-\int_eval:n { #1 + 1 } -| col-\int_eval:n { #2 + 1 } ) ;
+% \end { tikzpicture }
+% }
+%
+%
+% \NewDocumentCommand \crossbox { ! O { } }
+% {
+% \tl_gput_right:Nx \g_nicematrix_code_after_tl
+% {
+% \__pantigny_crossbox:nnn
+% { \int_use:c { c@iRow } }
+% { \int_use:c { c@jCol } }
+% { \exp_not:n { #1 } }
+% }
+% }
+% \ExplSyntaxOff
+%
+% \bigskip
+% Here is an example of utilisation:
+%
+% \medskip
+% \begin{BVerbatim}[baseline=c,boxwidth=9cm]
+% \begin{NiceTabular}{ccc}[hvlines]
+% Tokyo & Paris & London \\
+% Cap Town & ~emphase#\crossbox[red]@ & Miami \\
+% Los Angeles & Madrid & Roma
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \begin{NiceTabular}{ccc}[hvlines]
+% Tokyo & Paris & London \\
+% Cap Town & \crossbox[red] & Miami \\
+% Los Angeles & Madrid & Roma
+% \end{NiceTabular}
+%
%
% \section{Technical remarks}
%
@@ -2944,7 +3157,9 @@ version 2005/12/01 or later.
% \newcolumntype{?}{!{\OnlyMainNiceMatrix{\vrule width 1 pt}}}
% \end{Verbatim}
%
-% The heavy vertical rule won't extend in the exterior rows:
+% The heavy vertical rule won't extend in the exterior rows.\footnote{Of course,
+% such rule is defined by the classical technics of \pkg{nicematrix} and, for
+% this reason, won't cross the double rules of |\hline\hline|.}
% \medskip
% \begin{scope}
% \newcolumntype{?}{!{\OnlyMainNiceMatrix{\vrule width 1 pt}}}
@@ -3128,8 +3343,8 @@ version 2005/12/01 or later.
%
% \medskip
% First, we write a command |\stars| similar the well-known commands
-% |\arabic|, |\alph|, |\Alph|, etc. which produce a number of stars equal to its argument
-% \footnote{In fact: the value of its argument.}
+% |\arabic|, |\alph|, |\Alph|, etc. which produces a number of stars equal to
+% its argument \footnote{In fact: the value of its argument.}
% \begin{Verbatim}
% \ExplSyntaxOn
% \NewDocumentCommand ~emphase#\stars@ { m }
@@ -3419,7 +3634,7 @@ version 2005/12/01 or later.
% { last-col,code-for-last-col = \color{blue}\scriptstyle,light-syntax}
% \setlength{\extrarowheight}{1mm}
% $\begin{pNiceArray}{cccc:c}
-% 1 1 1 1 1 ;
+% 1 1 1 1 1 {} ;
% 2 4 8 16 9 ;
% 3 9 27 81 36 ;
% 4 16 64 256 100
@@ -3443,7 +3658,7 @@ version 2005/12/01 or later.
% \setlength{\extrarowheight}{1mm}
%
% \enskip $\begin{pNiceArray}{cccc:c}
-% 1 1 1 1 1 ;
+% 1 1 1 1 1 {} ;
% 2 4 8 16 9 ;
% 3 9 27 81 36 ;
% 4 16 64 256 100
@@ -3975,6 +4190,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_error:nn { \msg_error:nnn { nicematrix } }
\cs_new_protected:Npn \@@_error:nnn { \msg_error:nnnn { nicematrix } }
\cs_new_protected:Npn \@@_fatal:n { \msg_fatal:nn { nicematrix } }
+\cs_new_protected:Npn \@@_fatal:nn { \msg_fatal:nnn { nicematrix } }
\cs_new_protected:Npn \@@_msg_new:nn { \msg_new:nnn { nicematrix } }
\cs_new_protected:Npn \@@_msg_new:nnn { \msg_new:nnnn { nicematrix } }
% \end{macrocode}
@@ -4360,6 +4576,32 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \bigskip
+% The following regex will be used to modify the preamble of the array when the
+% key |colortbl-like| is used.
+% \begin{macrocode}
+\regex_const:Nn \c_@@_columncolor_regex { \c { columncolor } }
+% \end{macrocode}
+%
+% \bigskip
+% If the final user uses \pkg{nicematrix}, PGF/Tikz will write instruction
+% |\pgfsyspdfmark| in the |aux| file. If he changes its mind and no longer loads
+% \pkg{nicematrix}, an error may occur at the next compilation because of
+% remanent instructions |\pgfsyspdfmark| in the |aux| file. With the following
+% code, we avoid that situation.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_provide_pgfsyspdfmark:
+ {
+ \iow_now:Nn \@mainaux
+ {
+ \ExplSyntaxOn
+ \cs_if_free:NT \pgfsyspdfmark
+ { \cs_set_eq:NN \pgfsyspdfmark \use:nnn }
+ \ExplSyntaxOff
+ }
+ \cs_gset_eq:NN \@@_provide_pgfsyspdfmark: \prg_do_nothing:
+ }
+% \end{macrocode}
%
% \subsection*{Parameters}
%
@@ -4380,7 +4622,7 @@ version 2005/12/01 or later.
\newcolumntype C c
\newcolumntype R r
}
-% \end{document}
+% \end{macrocode}
%
% \bigskip
% The following counter will count the environments |{NiceArray}|. The value of
@@ -4419,7 +4661,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% the following counter will count the environments |{NiceMatrixBlock}|.
+% The following counter will count the environments |{NiceMatrixBlock}|.
% \begin{macrocode}
\int_new:N \g_@@_NiceMatrixBlock_int
% \end{macrocode}
@@ -4457,10 +4699,26 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% If the user uses |{NiceTabular}|, we will raise the following flag.
+% If the user uses |{NiceTabular}| or |{NiceTabular*}|, we will raise the
+% following flag.
% \begin{macrocode}
\bool_new:N \l_@@_NiceTabular_bool
% \end{macrocode}
+%
+% \bigskip
+% If the user uses |{NiceTabular*}|, the width of the tabular (in the first
+% argument of the environment |{NiceTabular*}|) will be stored in the following
+% dimension.
+% \begin{macrocode}
+\dim_new:N \l_@@_tabular_width_dim
+% \end{macrocode}
+%
+% \bigskip
+% If the user uses an environment without preamble, we will raise the following
+% flag.
+% \begin{macrocode}
+\bool_new:N \l_@@_Matrix_bool
+% \end{macrocode}
%
% \bigskip
% \begin{macrocode}
@@ -4512,15 +4770,15 @@ version 2005/12/01 or later.
% The following token list corresponds to the option |code-after| (it's also
% possible to set the value of that parameter with the command |\CodeAfter|).
% \begin{macrocode}
-\tl_new:N \g_@@_code_after_tl
+\tl_new:N \g_nicematrix_code_after_tl
% \end{macrocode}
%
% \bigskip
-% The following token list has a function similar to |\g_@@_code_after_tl| but
-% it is used internally by \pkg{nicematrix}. In fact, we have to distinguish
-% between |\g_@@_code_after_tl| and |\g_@@_internal_code_after_tl| because we
-% must take care of the order in which instructions stored in that paremeters
-% are executed.
+% The following token list has a function similar to
+% |\g_nicematrix_code_after_tl| but it is used internally by \pkg{nicematrix}.
+% In fact, we have to distinguish between |\g_nicematrix_code_after_tl| and
+% |\g_@@_internal_code_after_tl| because we must take care of the order in which
+% instructions stored in that paremeters are executed.
% \begin{macrocode}
\tl_new:N \g_@@_internal_code_after_tl
% \end{macrocode}
@@ -4556,11 +4814,18 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% The following flag will be raised when the key |code-before| is used in the
-% environment. Indeed, if there is a |code-before| in the environment, we will
-% manage to have the |row| nodes and the |col| nodes available \emph{before} the
-% creation of the array.
+% |\l_@@_code_before_tl| may contain two types of informations:
+% \begin{itemize}
+% \item A |code-before| written in the |aux| file by a previous run. When the
+% |aux| file is read, this |code-before| is stored in
+% |\g_@@_code_before_|\textsl{i}|_tl| (where \textsl{i} is the number of the
+% environment) and, at the beginning of the environment, it will be put in
+% |\l_@@_code_before_tl|.
+% \item The final user can explicitely add material in |\l_@@_code_before_tl| by
+% using the key |code-before|.
+% \end{itemize}
% \begin{macrocode}
+\tl_new:N \l_@@_code_before_tl
\bool_new:N \l_@@_code_before_bool
% \end{macrocode}
%
@@ -4640,7 +4905,19 @@ version 2005/12/01 or later.
% required by the key |hvlines| (these rules won't be drawn within the virtual
% blocks corresponding to the dotted lines).
%
-%
+% \medskip
+% We are able to determine the number of columns specified in the preamble (for
+% the environments with explicit preamble, of course and without the potential
+% exterior columns).
+% \begin{macrocode}
+\int_new:N \g_@@_static_num_of_col_int
+% \end{macrocode}
+%
+% \medskip
+% Used for the color of the blocks.
+% \begin{macrocode}
+\tl_new:N \l_@@_color_tl
+% \end{macrocode}
%
% \bigskip
% \textbf{Variables for the exterior rows and columns}\par\nobreak
@@ -4704,11 +4981,12 @@ version 2005/12/01 or later.
% \item \textbf{Last column}\par\nobreak
%
% For the potential ``last column'', we use an integer. A value of $-2$ means
-% that there is no last column. A value of $-1$ means that there is a last
-% column but we don't know its value because the user has used the option
-% |last-col| without value (it's possible in an environment without preamble
-% like |{pNiceMatrix}|). A value of $0$ means that the option |last-col| has
-% been used in an environment with preamble (like |{pNiceArray}|).
+% that there is no last column. A value of $-1$ means that we are in an
+% environment without preamble (e.g. |{bNiceMatrix}|) and there is a last column
+% but we don't know its value because the user has used the option |last-col|
+% without value. A value of $0$ means that the option |last-col| has been used
+% in an environment with preamble (like |{pNiceArray}|): in this case, the key
+% was necessary without argument.
% \begin{macrocode}
\int_new:N \l_@@_last_col_int
\int_set:Nn \l_@@_last_col_int { -2 }
@@ -4717,7 +4995,7 @@ version 2005/12/01 or later.
% However, we have also a boolean. Consider the following code:
% \begin{center}
% \begin{BVerbatim}
-% \begin{pNiceArray}{CC}[last-col]
+% \begin{pNiceArray}{cc}[last-col]
% 1 & 2 \\
% 3 & 4
% \end{pNiceArray}
@@ -4984,6 +5262,15 @@ version 2005/12/01 or later.
% \bigskip
% \subsection*{The options}
%
+% By default, the commands |\cellcolor| and |\rowcolor| are available for the
+% user in the cells of the tabular (the user may use the commands provided by
+% |\colortbl|). However, if the key |colortbl-like| is used, these
+% commands are available.
+% \begin{macrocode}
+\bool_new:N \l_@@_colortbl_like_bool
+% \end{macrocode}
+%
+% \bigskip
% By default, the behaviour of |\cline| is changed in the environments of
% \pkg{nicematrix}: a |\cline| spreads the array by an amount equal to
% |\arrayrulewidht|. It's possible to disable this feature with the key
@@ -5075,9 +5362,9 @@ version 2005/12/01 or later.
% \bigskip
% The flag |\l_@@_hlines_bool| corresponds to the key |hlines|, the flag
% |\l_@@_vlines_bool| to the key |vlines| and the flag |hvlines| to the key
-% |hvlines|. Since version 4.1, the key |hvlines| is no longer a mere alias for
-% the conjonction of |hlines| and |vlines|. Indeed, with |hvlines|, the vertical
-% and horizontal rules are \emph{not} drawn within the blocks (created by |\Block|).
+% |hvlines|. The key |hvlines| is not a mere alias for the conjonction of
+% |hlines| and |vlines|. Indeed, with |hvlines|, the vertical and horizontal
+% rules are \emph{not} drawn within the blocks (created by |\Block|).
% \begin{macrocode}
\bool_new:N \l_@@_hlines_bool
\bool_new:N \l_@@_vlines_bool
@@ -5295,7 +5582,7 @@ version 2005/12/01 or later.
extra-right-margin .dim_set:N = \l_@@_extra_right_margin_dim ,
extra-margin .meta:n =
{ extra-left-margin = #1 , extra-right-margin = #1 } ,
- extra-margin .value_required:n = true
+ extra-margin .value_required:n = true ,
}
% \end{macrocode}
%
@@ -5311,7 +5598,7 @@ version 2005/12/01 or later.
{
\tl_if_empty:nF { #1 }
{
- \tl_set:Nn \l_@@_code_before_tl { #1 }
+ \tl_put_right:Nn \l_@@_code_before_tl { #1 }
\bool_set_true:N \l_@@_code_before_bool
}
} ,
@@ -5345,8 +5632,12 @@ version 2005/12/01 or later.
\str_set_eq:NN \l_@@_name_str \l_tmpa_str
} ,
name .value_required:n = true ,
- code-after .tl_gset:N = \g_@@_code_after_tl ,
+ code-after .tl_gset:N = \g_nicematrix_code_after_tl ,
code-after .value_required:n = true ,
+ colortbl-like .code:n =
+ \bool_set_true:N \l_@@_colortbl_like_bool
+ \bool_set_true:N \l_@@_code_before_bool ,
+ colortbl-like .value_forbidden:n = true
}
% \end{macrocode}
%
@@ -5412,9 +5703,7 @@ version 2005/12/01 or later.
\keys_define:nn { NiceMatrix }
{
NiceMatrixOptions .inherit:n =
- {
- NiceMatrix / Global ,
- } ,
+ { NiceMatrix / Global } ,
NiceMatrixOptions / xdots .inherit:n = NiceMatrix / xdots ,
NiceMatrixOptions / rules .inherit:n = NiceMatrix / rules ,
NiceMatrixOptions / notes .inherit:n = NiceMatrix / notes ,
@@ -5556,8 +5845,6 @@ version 2005/12/01 or later.
{ \int_set:Nn \l_@@_last_col_int { #1 } } ,
l .code:n = \tl_set:Nn \l_@@_type_of_col_tl l ,
r .code:n = \tl_set:Nn \l_@@_type_of_col_tl r ,
- L .code:n = \tl_set:Nn \l_@@_type_of_col_tl l ,
- R .code:n = \tl_set:Nn \l_@@_type_of_col_tl r ,
S .code:n = \bool_if:NTF \c_@@_siunitx_loaded_bool
{ \tl_set:Nn \l_@@_type_of_col_tl S }
{ \@@_error:n { option~S~without~siunitx } } ,
@@ -5900,17 +6187,34 @@ version 2005/12/01 or later.
% redefinition of |\array| incompatible with our use of |\array|.
%
% \begin{macrocode}
+\cs_new_protected:Npn \@@_revtex_array:
+ {
+ \cs_set_eq:NN \@acoll \@arrayacol
+ \cs_set_eq:NN \@acolr \@arrayacol
+ \cs_set_eq:NN \@acol \@arrayacol
+ \cs_set:Npn \@halignto { }
+ \@array@array
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\cs_new_protected:Npn \@@_array:
{
\bool_if:NTF \c_@@_revtex_bool
+ \@@_revtex_array:
{
- \cs_set_eq:NN \@acoll \@arrayacol
- \cs_set_eq:NN \@acolr \@arrayacol
- \cs_set_eq:NN \@acol \@arrayacol
- \cs_set:Npn \@halignto { }
- \@array@array
+ \bool_if:NTF \l_@@_NiceTabular_bool
+ { \dim_set_eq:NN \col@sep \tabcolsep }
+ { \dim_set_eq:NN \col@sep \arraycolsep }
+ \dim_compare:nNnTF \l_@@_tabular_width_dim = \c_zero_dim
+ { \cs_set:Npn \@halignto { } }
+ { \cs_set:Npx \@halignto { to \dim_use:N \l_@@_tabular_width_dim } }
+% \end{macrocode}
+% It \pkg{colortbl} is loaded, |\@tabarray| has been redefined to incorporate
+% |\CT@start|.
+% \begin{macrocode}
+ \@tabarray
}
- \array
% \end{macrocode}
% |\l_@@_baseline_str| may have the value |t|, |c| or |b|. However, if the value
% is |b|, we compose the |\array| (of \pkg{array}) with the option |t| and the
@@ -6008,12 +6312,10 @@ version 2005/12/01 or later.
% \bigskip
% The command |\@@_newcolumntype| is the command |\newcolumntype| of
% \pkg{array} without the warnings for redefinitions of columns types (we will
-% use it to redefine the columns types |w|, |W|, |p|, |m| and |b|).
+% use it to redefine the columns types |w| and |W|).
% \begin{macrocode}
\cs_set_protected:Npn \@@_newcolumntype #1
{
- % \cs_if_free:cT { NC @ find @ #1 }
- % { \NC@list \exp_after:wN { \the \NC@list \NC@do #1 } }
\cs_set:cpn { NC @ find @ #1 } ##1 #1 { \NC@ { ##1 } }
\peek_meaning:NTF [
{ \newcol@ #1 }
@@ -6023,31 +6325,29 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% The following command will be used to redefine the column types |p|, |m| and
-% |b|. That means that it will be used three times. The first argument is the
-% letter of the column type (|p|, |m| or |b|). The second is the letter of
-% position for the environment |{minipage}| (|t|, |c| or |b|).
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_define_columntype:nn #1 #2
- {
-% \end{macrocode}
-% We don't want a warning for redefinition of the column type. That's why we use
-% |\@@_newcolumntype| and not |\newcolumntype|.
+% When the key |renew-dots| is used, the following code will be executed.
% \begin{macrocode}
- \@@_newcolumntype #1 [ 1 ]
- {
- > {
- \@@_Cell:
- \begin { minipage } [ #2 ] { ##1 }
- \mode_leave_vertical: \box_use:N \@arstrutbox
- }
+\cs_set_protected:Npn \@@_renew_dots:
+ {
+ \cs_set_eq:NN \ldots \@@_Ldots
+ \cs_set_eq:NN \cdots \@@_Cdots
+ \cs_set_eq:NN \vdots \@@_Vdots
+ \cs_set_eq:NN \ddots \@@_Ddots
+ \cs_set_eq:NN \iddots \@@_Iddots
+ \cs_set_eq:NN \dots \@@_Ldots
+ \cs_set_eq:NN \hdotsfor \@@_Hdotsfor:
+ }
% \end{macrocode}
-% Here, we put |c| but we would have the result with |l| or |r|.
+%
+% \bigskip
+% When the key |colortbl-like| is used, the following code will be executed.
% \begin{macrocode}
- c
- < { \box_use:N \@arstrutbox \end { minipage } \@@_end_Cell: }
+\cs_new_protected:Npn \@@_colortbl_like:
+ {
+ \cs_set_eq:NN \cellcolor \@@_cellcolor_tabular
+ \cs_set_eq:NN \rowcolor \@@_rowcolor_tabular
+ \cs_set_eq:NN \columncolor \@@_columncolor_preamble
}
- }
% \end{macrocode}
%
% \bigskip
@@ -6103,8 +6403,6 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_set:Npn \ialign
{
- \bool_if:NT \l_@@_NiceTabular_bool
- { \dim_set_eq:NN \arraycolsep \@@_old_arraycolsep_dim }
\bool_if:NTF \c_@@_colortbl_loaded_bool
{
\CT@everycr
@@ -6159,8 +6457,6 @@ version 2005/12/01 or later.
\cs_set_eq:NN \@@_old_vdots \vdots
\cs_set_eq:NN \@@_old_ddots \ddots
\cs_set_eq:NN \@@_old_iddots \iddots
- \cs_set_eq:NN \firsthline \hline
- \cs_set_eq:NN \lasthline \hline
\bool_if:NTF \l_@@_standard_cline_bool
{ \cs_set_eq:NN \cline \@@_standard_cline }
{ \cs_set_eq:NN \cline \@@_cline }
@@ -6180,16 +6476,8 @@ version 2005/12/01 or later.
\cs_set_eq:NN \dotfill \@@_dotfill:
\cs_set_eq:NN \CodeAfter \@@_CodeAfter:n
\cs_set_eq:NN \diagbox \@@_diagbox:nn
- \bool_if:NT \l_@@_renew_dots_bool
- {
- \cs_set_eq:NN \ldots \@@_Ldots
- \cs_set_eq:NN \cdots \@@_Cdots
- \cs_set_eq:NN \vdots \@@_Vdots
- \cs_set_eq:NN \ddots \@@_Ddots
- \cs_set_eq:NN \iddots \@@_Iddots
- \cs_set_eq:NN \dots \@@_Ldots
- \cs_set_eq:NN \hdotsfor \@@_Hdotsfor:
- }
+ \bool_if:NT \l_@@_colortbl_like_bool \@@_colortbl_like:
+ \bool_if:NT \l_@@_renew_dots_bool \@@_renew_dots:
% \end{macrocode}
%
%
@@ -6231,135 +6519,11 @@ version 2005/12/01 or later.
\cs_set_eq:NN \@ifnextchar \new@ifnextchar
% \end{macrocode}
%
-%
-% \bigskip
-% We redefine the column types |p|, |m| and |b|. The command
-% |\@@_define_columntype:nn| is only used here.
-% \begin{macrocode}
- \@@_define_columntype:nn p t
- \@@_define_columntype:nn m c
- \@@_define_columntype:nn b b
-% \end{macrocode}
-%
-% \bigskip
-% We redefine the column types |w| and |W|. We use |\@@_newcolumntype| instead
-% of |\newcolumtype| because we don't want warnings for column types already
-% defined.
-% \begin{macrocode}
- \@@_newcolumntype w [ 2 ]
- {
- > {
- \hbox_set:Nw \l_@@_cell_box
- \@@_Cell:
- }
-% \end{macrocode}
-% |\@@_true_c:| will be replaced statically by |c| at the end of the construction
-% of the preamble.
-% \begin{macrocode}
- \@@_true_c:
- < {
- \@@_end_Cell:
- \hbox_set_end:
-% \end{macrocode}
-% The construction with |\@@_foldcase:| (defined below) should be replaced by
-% |\str_foldcase:n| when that command of \pkg{expl3} will be widespread. That
-% construction is only for giving the user the ability to write |wC{1cm}|
-% instead of |wc{1cm}| for homogeneity with the letters |L|, |C| and |R| used
-% elsewhere in the preamble instead of |l|, |c| and |r|.
-% \begin{macrocode}
- \tl_set:Nn \l_tmpa_tl { ##1 }
- \makebox [ ##2 ] [ \@@_foldcase: ]
- { \box_use_drop:N \l_@@_cell_box }
- }
- }
- \@@_newcolumntype W [ 2 ]
- {
- > {
- \hbox_set:Nw \l_@@_cell_box
- \@@_Cell:
- }
-% \end{macrocode}
-% |\@@_true_c:| will be replaced statically by |c| at the end of the construction
-% of the preamble.
-% \begin{macrocode}
- \@@_true_c:
- < {
- \@@_end_Cell:
- \hbox_set_end:
- \cs_set_eq:NN \hss \hfil
- \tl_set:Nn \l_tmpa_tl { ##1 }
- \makebox [ ##2 ] [ \@@_foldcase: ]
- { \box_use_drop:N \l_@@_cell_box }
- }
- }
-% \end{macrocode}
-%
-% \bigskip
-% By default, the letter used to specify a dotted line in the preamble of an
-% environment of \pkg{nicematrix} (for example in |{pNiceArray}|) is the letter
-% |:|. However, this letter is used by some packages, for example
-% \pkg{arydshln}. That's why it's possible to change the letter used by
-% \pkg{nicematrix} with the option |letter-for-dotted-lines| which changes the
-% value of |\l_@@_letter_for_dotted_lines_str|. We rescan this string (which is
-% always of length~1) in particular for the case where |pdflatex| is used with
-% \pkg{french-babel} (the colon is activated by \pkg{french-babel} at the
-% beginning of the document).
% \begin{macrocode}
- \tl_set_rescan:Nno
- \l_@@_letter_for_dotted_lines_str { } \l_@@_letter_for_dotted_lines_str
- \exp_args:NV \newcolumntype \l_@@_letter_for_dotted_lines_str
- {
- !
- {
+ \@@_renew_NC@rewrite@S:
% \end{macrocode}
%
-% \medskip
-% The following code because we want the dotted line to have exactly the same
-% position as a vertical rule drawn by ``"|"'' (considering the rule having a
-% width equal to the diameter of the dots).
-% \begin{macrocode}
- \int_compare:nNnF \c@iRow = 0
- {
- \int_compare:nNnF \c@iRow = \l_@@_last_row_int
- { \skip_horizontal:N 2\l_@@_radius_dim }
- }
-% \end{macrocode}
-%
-% \medskip
-% Consider the following code:
-% \begin{center}
-% \begin{BVerbatim}
-% \begin{NiceArray}{C:CC:C}
-% a & b
-% c & d \\
-% e & f & g & h \\
-% i & j & k & l
-% \end{NiceArray}
-% \end{BVerbatim}
-% \end{center}
-% The first ``|:|'' in the preamble will be encountered during the first row of
-% the environment |{NiceArray}| but the second one will be encountered only in
-% the third row. We have to issue a command |\vdottedline:n| in the |code-after|
-% only one time for each ``|:|'' in the preamble. That's why we keep a counter
-% |\g_@@_last_vdotted_col_int| and with this counter, we know whether a letter
-% ``|:|'' encountered during the parsing has already been taken into account in
-% the |code-after|.
-% \begin{macrocode}
- \int_compare:nNnT \c@jCol > \g_@@_last_vdotted_col_int
- {
- \int_gset_eq:NN \g_@@_last_vdotted_col_int \c@jCol
- \tl_gput_right:Nx \g_@@_internal_code_after_tl
-% \end{macrocode}
-% The command |\@@_vdottedline:n| is protected, and, therefore, won't be
-% expanded before writing on |\g_@@_internal_code_after_tl|.
% \begin{macrocode}
- { \@@_vdottedline:n { \int_use:N \c@jCol } }
- }
- }
- }
- \int_gzero_new:N \g_@@_last_vdotted_col_int
- \@@_renew_NC@rewrite@S:
- \int_gset:Nn \g_@@_last_vdotted_col_int { -1 }
\bool_gset_false:N \g_@@_last_col_found_bool
% \end{macrocode}
%
@@ -6374,24 +6538,15 @@ version 2005/12/01 or later.
\tl_gclear_new:N \g_@@_Ddots_lines_tl
\tl_gclear_new:N \g_@@_Iddots_lines_tl
\tl_gclear_new:N \g_@@_HVdotsfor_lines_tl
- }
% \end{macrocode}
%
% \medskip
-% The following command will be deleted when we will consider |\str_lowercase:n|
-% as widespread.
% \begin{macrocode}
-\cs_set:Npn \@@_foldcase:
- {
- \tl_case:NnF \l_tmpa_tl
- {
- C { c }
- L { l }
- R { r }
- }
- { \l_tmpa_tl }
+ \tl_gclear_new:N \g_@@_code_before_tl
}
% \end{macrocode}
+% This is the end of |\@@_pre_array:|.
+%
%
% \bigskip
% \subsection*{The environment \{NiceArrayWithDelims\}}
@@ -6399,7 +6554,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\NewDocumentEnvironment { NiceArrayWithDelims } { m m O { } m ! O { } }
{
- \bool_if:NT \c_@@_footnote_bool { \begin { savenotes } }
+ \@@_provide_pgfsyspdfmark:
+ \bool_if:NT \c_@@_footnote_bool \savenotes
% \end{macrocode}
% The aim of the following |\bgroup| (the corresponding |\egroup| is, of course,
% at the end of the environment) is to be able to put an exposant to a matrix in
@@ -6467,6 +6623,14 @@ version 2005/12/01 or later.
% In fact, the sequence |\g_@@_pos_of_blocks_seq| will also contain the
% positions of the cells with a |\diagbox|.
%
+% \begin{macrocode}
+ \tl_if_exist:cT { g_@@_code_before_ \int_use:N \g_@@_env_int _ tl }
+ {
+ \bool_set_true:N \l_@@_code_before_bool
+ \exp_args:NNv \tl_put_right:Nn \l_@@_code_before_tl
+ { g_@@_code_before_ \int_use:N \g_@@_env_int _ tl }
+ }
+% \end{macrocode}
%
% The set of keys is not exactly the same for |{NiceArray}| and for the variants
% of |{NiceArray}| (|{pNiceArray}|, |{bNiceArray}|, etc.) because, for
@@ -6485,7 +6649,6 @@ version 2005/12/01 or later.
% \end{macrocode}
%
%
-%
% \bigskip
% If the key |code-before| is used, we have to create the |col| nodes and the
% |row| nodes before the creation of the array. First, we have to test whether
@@ -6678,13 +6841,6 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% We construct the preamble of the array in |\l_tmpa_tl|.
-% \begin{macrocode}
- \tl_set:Nn \l_tmpa_tl { #4 }
-% \end{macrocode}
-%
-%
-% \bigskip
% If the user has loaded |nicematrix| with the option |define-L-C-R|, he will be
% able to use |L|, |C| and |R| instead of |l|, |c| and |r| in the preambles of
% the environments of \pkg{nicematrix} (it's a compatibility mode since |L|, |C|
@@ -6692,74 +6848,14 @@ version 2005/12/01 or later.
% \begin{macrocode}
\bool_if:NT \c_@@_define_L_C_R_bool \@@_define_L_C_R:
% \end{macrocode}
-%
-% \bigskip
-% We will do an ``expansion''\footnote{This ``expansion'' expands all the
-% constructions with |*| and with the new column types defined by
-% |\newcolumntype|.} of the preamble (with the tools of \pkg{array}
-% itself) and a replacement of the specifiers |c|, |l| and |r| by the specifiers
-% |C|, |L| and |R|.
-%
-%
-% We store our preamble in the token register |\@temptokena| (those
-% ``token registers'' are not supported by \pkg{expl3}).
-% \begin{macrocode}
- \@temptokena \exp_after:wN { \l_tmpa_tl }
-% \end{macrocode}
-% Initialisation of a flag used by \pkg{array} to detect the end of the expansion.
-% \begin{macrocode}
- \@tempswatrue
-% \end{macrocode}
-% The following line actually does the expansion (it's has been copied from
-% |array.sty|).
-% \begin{macrocode}
- \@whilesw \if@tempswa \fi { \@tempswafalse \the \NC@list }
-% \end{macrocode}
-% We put back the preamble in our token list |\l_tmpa_tl|.
-% \begin{macrocode}
- \tl_gset:NV \l_tmpa_tl \@temptokena
-% \end{macrocode}
-%
-% We do the replacement of letters |c|, |l| and |r| (these column types can't be
-% redefined by |\newcolumtype| of \pkg{array} and that's why we have to do the
-% job ``by hand'' after expansion of the preamble).
-% \begin{macrocode}
- \tl_replace_all:Nnn \l_tmpa_tl c { > \@@_Cell: c < \@@_end_Cell: }
- \tl_replace_all:Nnn \l_tmpa_tl l { > \@@_Cell: l < \@@_end_Cell: }
- \tl_replace_all:Nnn \l_tmpa_tl r { > \@@_Cell: r < \@@_end_Cell: }
- \tl_replace_all:Nnn \l_tmpa_tl \@@_true_c: c
-% \end{macrocode}
%
% \bigskip
-% We complete the preamble with the potential ``exterior columns''.
+% The preamble will be constructed in |\g_@@_preamble_tl|.
% \begin{macrocode}
- \int_compare:nNnTF \l_@@_first_col_int = 0
- { \tl_put_left:NV \l_tmpa_tl \c_@@_preamble_first_col_tl }
- {
- \bool_lazy_all:nT
- {
- \l_@@_NiceArray_bool
- { \bool_not_p:n \l_@@_NiceTabular_bool }
- { \bool_not_p:n \l_@@_vlines_bool }
- { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
- }
- { \tl_put_left:Nn \l_tmpa_tl { @ { } } }
- }
- \int_compare:nNnTF \l_@@_last_col_int > { -1 }
- { \tl_put_right:NV \l_tmpa_tl \c_@@_preamble_last_col_tl }
- {
- \bool_lazy_all:nT
- {
- \l_@@_NiceArray_bool
- { \bool_not_p:n \l_@@_NiceTabular_bool }
- { \bool_not_p:n \l_@@_vlines_bool }
- { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
- }
- { \tl_put_right:Nn \l_tmpa_tl { @ { } } }
- }
- \tl_put_right:Nn \l_tmpa_tl { > { \@@_error_too_much_cols: } l }
+ \@@_construct_preamble:n { #4 }
% \end{macrocode}
-% Now, the preamble is constructed in |\l_tmpa_tl|
+%
+% Now, the preamble is constructed in |\g_@@_preamble_tl|
%
%
%
@@ -6768,38 +6864,9 @@ version 2005/12/01 or later.
% |\hbox_set_end:| corresponding to this |\hbox_set:Nw| will be in the second
% part of the environment (and the closing |\c_math_toggle_token| also).
% \begin{macrocode}
- \hbox_set:Nw \l_@@_the_array_box
-% \end{macrocode}
-% Here is a trick. We will call |\array| and, at the beginning, |\array| will set
-% |\col@sep| equal to the current value of |\arraycolsep|. In we are in an
-% environment |{NiceTabular}|, we would like that |\array| sets |\col@sep| equal
-% to the current value of |\tabcolsep|. That's why we set |\arraycolsep| equal
-% to |\tabcolsep|. However, the value of |\tabcolsep| in each cell of the array
-% should be equal to the current value of |\tabcolsep| outside |{NiceTabular}|.
-% That's why we save the current value of |\arraycolsep| and we will restore the
-% value just before the |\halign|. It's possible because we do a redefinition of
-% |\ialign| (see just below).
-% \begin{macrocode}
- \bool_if:NT \l_@@_NiceTabular_bool
- {
- \dim_set_eq:NN \@@_old_arraycolsep_dim \arraycolsep
- \dim_set_eq:NN \arraycolsep \tabcolsep
- }
-% \end{macrocode}
-% If the key |\vlines| is used, we increase |\arraycolsep| by
-% |0.5\arrayrulewidth| in order to reserve space for the width of the vertical
-% rules drawn with Tikz after the end of the array. However, the first
-% |\arraycolsep| is used once (between columns, |\arraycolsep| is used twice).
-% That's why we add a |0.5\arrayrulewidth| more.
-% \begin{macrocode}
- \bool_if:NT \l_@@_vlines_bool
- {
- \dim_add:Nn \arraycolsep { 0.5 \arrayrulewidth }
- \skip_horizontal:N 0.5\arrayrulewidth
- }
+ \hbox_set:Nw \l_@@_the_array_box
% \end{macrocode}
%
-%
% \begin{macrocode}
\skip_horizontal:N \l_@@_left_margin_dim
\skip_horizontal:N \l_@@_extra_left_margin_dim
@@ -6819,14 +6886,6 @@ version 2005/12/01 or later.
\c_math_toggle_token
\skip_horizontal:N \l_@@_right_margin_dim
\skip_horizontal:N \l_@@_extra_right_margin_dim
-% \end{macrocode}
-% If the key |\vlines| is used, we have increased |\arraycolsep| by
-% |0.5\arrayrulewidth| in order to reserve space for the width of the vertical
-% rules drawn with Tikz after the end of the array. However, the last
-% |\arraycolsep| is used once (between columns, |\arraycolsep| is used twice).
-% That's why we add a |0.5 \arrayrulewidth| more.
-% \begin{macrocode}
- \bool_if:NT \l_@@_vlines_bool { \skip_horizontal:N 0.5\arrayrulewidth }
\hbox_set_end:
% \end{macrocode}
% End of the construction of the array (in the box |\l_@@_the_array_box|).
@@ -6856,7 +6915,17 @@ version 2005/12/01 or later.
% has the number~$0$.}
% \begin{macrocode}
\int_gset_eq:NN \c@jCol \g_@@_col_total_int
- \bool_if:nT \g_@@_last_col_found_bool { \int_gdecr:N \c@jCol }
+ \bool_if:nTF \g_@@_last_col_found_bool
+ { \int_gdecr:N \c@jCol }
+ {
+ \int_compare:nNnT \l_@@_last_col_int > { -1 }
+ { \@@_error:n { last~col~not~used } }
+ }
+ \bool_if:NF \l_@@_Matrix_bool
+ {
+ \int_compare:nNnT \c@jCol < \g_@@_static_num_of_col_int
+ { \@@_error:n { columns~not~used } }
+ }
% \end{macrocode}
%
% We fix also the value of |\c@iRow| and |\g_@@_row_total_int| with the
@@ -6883,68 +6952,17 @@ version 2005/12/01 or later.
%
% The construction of the real box is different when |\l_@@_NiceArray_bool| is
% true (|{NiceArray}| or |{NiceTabular}|) and in the other environments because,
-% in |{NiceArray}| or |{NiceTabular}|, we have to take into account the value of
-% |baseline| and we have no delimiter to put. We begin with this case.
+% in |{NiceArray}| or |{NiceTabular}|, we have no delimiter to put. We begin
+% with this case.
% \begin{macrocode}
\bool_if:NTF \l_@@_NiceArray_bool
{
-% \end{macrocode}
-% Remember that, when the key |b| is used, the |{array}| (of \pkg{array}) is
-% constructed with the option |t| (and not |b|). Now, we do the translation to
-% take into account the option |b|.
-% \begin{macrocode}
- \str_if_eq:VnTF \l_@@_baseline_str { b }
+ \str_case:VnF \l_@@_baseline_str
{
- \pgfpicture
- \@@_qpoint:n { row - 1 }
- \dim_gset_eq:NN \g_tmpa_dim \pgf@y
- \@@_qpoint:n { row - \int_use:N \c@iRow - base }
- \dim_gsub:Nn \g_tmpa_dim \pgf@y
- \endpgfpicture
- \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
- \int_compare:nNnT \l_@@_first_row_int = 0
- {
- \dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim
- \dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim
- }
- \box_move_up:nn \g_tmpa_dim { \@@_use_array_box_with_notes: }
- }
- {
- \str_if_eq:VnTF \l_@@_baseline_str { c }
- { \@@_use_array_box_with_notes: }
- {
-% \end{macrocode}
-% We convert a value of |t| to a value of |1|.
-% \begin{macrocode}
- \str_if_eq:VnT \l_@@_baseline_str { t }
- { \str_set:Nn \l_@@_baseline_str { 1 } }
-% \end{macrocode}
-% Now, we convert the value of |\l_@@_baseline_str| (which should represent an
-% integer) to an integer stored in |\l_tmpa_int|.
-% \begin{macrocode}
- \int_set:Nn \l_tmpa_int \l_@@_baseline_str
- \bool_lazy_or:nnT
- { \int_compare_p:nNn \l_tmpa_int < \l_@@_first_row_int }
- { \int_compare_p:nNn \l_tmpa_int > \g_@@_row_total_int }
- {
- \@@_error:n { bad~value~for~baseline }
- \int_set:Nn \l_tmpa_int 1
- }
- \pgfpicture
- \@@_qpoint:n { row - 1 }
- \dim_gset_eq:NN \g_tmpa_dim \pgf@y
- \@@_qpoint:n { row - \int_use:N \l_tmpa_int - base }
- \dim_gsub:Nn \g_tmpa_dim \pgf@y
- \endpgfpicture
- \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
- \int_compare:nNnT \l_@@_first_row_int = 0
- {
- \dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim
- \dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim
- }
- \box_move_up:nn \g_tmpa_dim { \@@_use_array_box_with_notes: }
- }
+ b \@@_use_arraybox_with_notes_b:
+ c \@@_use_arraybox_with_notes_c:
}
+ \@@_use_arraybox_with_notes:
}
% \end{macrocode}
%
@@ -6994,7 +7012,7 @@ version 2005/12/01 or later.
\bool_if:NTF \l_@@_NiceTabular_bool
{ \skip_horizontal:N -\tabcolsep }
{ \skip_horizontal:N -\arraycolsep }
- \@@_use_array_box_with_notes:
+ \@@_use_arraybox_with_notes_c:
\bool_if:NTF \l_@@_NiceTabular_bool
{ \skip_horizontal:N -\tabcolsep }
{ \skip_horizontal:N -\arraycolsep }
@@ -7033,13 +7051,355 @@ version 2005/12/01 or later.
}
\@@_after_array:
\egroup
- \bool_if:NT \c_@@_footnote_bool { \end { savenotes } }
+ \bool_if:NT \c_@@_footnote_bool \endsavenotes
}
% \end{macrocode}
% This is the end of the environment |{NiceArrayWithDelims}|.
%
%
+% \subsection*{We construct the preamble of the array}
+%
+% The transformation of the preamble is an operation in several steps.
+%
+% \bigskip
+% The argument of |\@@_construct_preamble:n| is the preamble as given by the
+% final user to the environement |{NiceTabular}| (or a variant). The preamble
+% will be constructed in |\g_@@_preamble_tl|.
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_construct_preamble:n #1
+ {
+% \end{macrocode}
+% First, we will do an ``expansion'' of the preamble with the tools of the
+% package \pkg{array} itself. This ``expansion'' will expand all the constructions
+% with |*| and with all column types (defined by the user or by various packages
+% using |\newcolumntype|).
+%
+% Since we use the tools of \pkg{array} to do this expansion, we will have a
+% programmation which is not in the style of \pkg{expl3}.
+%
+%
+% \bigskip
+% We redefine the column types |w| and |W|. We use |\@@_newcolumntype| instead
+% of |\newcolumtype| because we don't want warnings for column types already
+% defined. These redefinitions are in fact \emph{protections} of the letters |w|
+% and |W|. We don't want these columns type expanded because we will do the
+% patch ourselves after. We want to be able the standard column types |w| and
+% |W| in potential |{tabular}| of \pkg{array} in some cells of our array. That's
+% why we do those redefinitions in a TeX group.
+% \begin{macrocode}
+ \group_begin:
+% \end{macrocode}
+%
+% If we are in an environment without explicit preamble, we have nothing to do
+% (excepted the treatment on both sides of the preamble which will be done at
+% the end).
+% \begin{macrocode}
+ \bool_if:NTF \l_@@_Matrix_bool
+ { \tl_gset:Nn \g_@@_preamble_tl { #1 } }
+ {
+ \@@_newcolumntype w [ 2 ] { \@@_w: { ##1 } { ##2 } }
+ \@@_newcolumntype W [ 2 ] { \@@_W: { ##1 } { ##2 } }
+% \end{macrocode}
+%
+% First, we have to store our preamble in the token register |\@temptokena|
+% (those ``token registers'' are not supported by \pkg{expl3}).
+% \begin{macrocode}
+ \@temptokena { #1 }
+% \end{macrocode}
+% Initialisation of a flag used by \pkg{array} to detect the end of the expansion.
+% \begin{macrocode}
+ \@tempswatrue
+% \end{macrocode}
+% The following line actually does the expansion (it's has been copied from
+% |array.sty|).
+% \begin{macrocode}
+ \@whilesw \if@tempswa \fi { \@tempswafalse \the \NC@list }
+% \end{macrocode}
+%
+% \bigskip
+% Now, we have to ``patch'' that preamble by transforming some columns.
+% We will insert in the TeX flow the preamble in its actual form (that is to say
+% after the ``expansion'') following by a marker |\q_stop| and we will consume
+% these tokens constructing the (new form of the) preamble in
+% |\g_@@_preamble_tl|. This is done recursively with the command
+% |\@@_patch_preamble:n|. In the same time, we will count the columns with the
+% counter |\c@jCol|.
+% \begin{macrocode}
+ \int_gzero_new:N \c@jCol
+ \bool_if:NTF \l_@@_vlines_bool
+ {
+ \tl_gset:Nn \g_@@_preamble_tl
+ { ! { \skip_horizontal:N \arrayrulewidth } }
+ }
+ { \tl_gclear:N \g_@@_preamble_tl }
+% \end{macrocode}
+% The counter |\l_tmpa_int| will be count the number of consecutive occurrences
+% of the symbole \verb+|+.
+% \begin{macrocode}
+ \int_zero:N \l_tmpa_int
+% \end{macrocode}
+% Now, we actually patch the preamble (and it is constructed in
+% |\g_@@_preamble_tl|).
+% \begin{macrocode}
+ \exp_after:wN \@@_patch_preamble:n \the \@temptokena \q_stop
+ \int_gset_eq:NN \g_@@_static_num_of_col_int \c@jCol
+ }
+% \end{macrocode}
+%
+% \medskip
+% Now, we replace |\columncolor| by |\@@_columncolor_preamble|.
+% \begin{macrocode}
+ \bool_if:NT \l_@@_colortbl_like_bool
+ {
+ \regex_replace_all:NnN
+ \c_@@_columncolor_regex
+ { \c { @@_columncolor_preamble } }
+ \g_@@_preamble_tl
+ }
+% \end{macrocode}
+%
+% \bigskip
+% We complete the preamble with the potential ``exterior columns''.
+% \begin{macrocode}
+ \int_compare:nNnTF \l_@@_first_col_int = 0
+ { \tl_gput_left:NV \g_@@_preamble_tl \c_@@_preamble_first_col_tl }
+ {
+ \bool_lazy_all:nT
+ {
+ \l_@@_NiceArray_bool
+ { \bool_not_p:n \l_@@_NiceTabular_bool }
+ { \bool_not_p:n \l_@@_vlines_bool }
+ { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
+ }
+ { \tl_gput_left:Nn \g_@@_preamble_tl { @ { } } }
+ }
+ \int_compare:nNnTF \l_@@_last_col_int > { -1 }
+ { \tl_gput_right:NV \g_@@_preamble_tl \c_@@_preamble_last_col_tl }
+ {
+ \bool_lazy_all:nT
+ {
+ \l_@@_NiceArray_bool
+ { \bool_not_p:n \l_@@_NiceTabular_bool }
+ { \bool_not_p:n \l_@@_vlines_bool }
+ { \bool_not_p:n \l_@@_exterior_arraycolsep_bool }
+ }
+ { \tl_gput_right:Nn \g_@@_preamble_tl { @ { } } }
+ }
+% \end{macrocode}
+% We add a last column to raise a good error message when the user put more
+% columns than allowed by its preamble. However, for technical reasons, it's not
+% possible to do that in |{NiceTabular*}| (|\l_@@_tabular_width_dim|=0pt).
+% \begin{macrocode}
+ \dim_compare:nNnT \l_@@_tabular_width_dim = \c_zero_dim
+ {
+ \tl_gput_right:Nn
+ \g_@@_preamble_tl
+ { > { \@@_error_too_much_cols: } l }
+ }
+% \end{macrocode}
+%
+% \medskip
+% Now, we have to close the TeX group which was opened for the redefinition of
+% the columns of type |w| and |W|.
+% \begin{macrocode}
+ \group_end:
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble:n #1
+ {
+ \str_case:nnF { #1 }
+ {
+ c { \@@_patch_preamble_i:n #1 }
+ l { \@@_patch_preamble_i:n #1 }
+ r { \@@_patch_preamble_i:n #1 }
+ > { \@@_patch_preamble_ii:nn #1 }
+ < { \@@_patch_preamble_ii:nn #1 }
+ ! { \@@_patch_preamble_ii:nn #1 }
+ @ { \@@_patch_preamble_ii:nn #1 }
+ | { \@@_patch_preamble_iii:n #1 }
+ p { \@@_patch_preamble_iv:nnn t #1 }
+ m { \@@_patch_preamble_iv:nnn c #1 }
+ b { \@@_patch_preamble_iv:nnn b #1 }
+ \@@_w: { \@@_patch_preamble_v:nnnn { } #1 }
+ \@@_W: { \@@_patch_preamble_v:nnnn { \cs_set_eq:NN \hss \hfil } #1 }
+ \@@_true_c: { \@@_patch_preamble_vi:n #1 }
+ \q_stop { }
+ }
+ {
+ \str_if_eq:VnTF \l_@@_letter_for_dotted_lines_str { #1 }
+ { \@@_patch_preamble_vii:n #1 }
+ { \@@_fatal:nn { unknown~column~type } { #1 } }
+ }
+ }
+% \end{macrocode}
+%
+% \medskip
+% For |c|, |l| and |r|
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_i:n #1
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl { > \@@_Cell: #1 < \@@_end_Cell: }
+% \end{macrocode}
+% We increment the counter of columns.
+% \begin{macrocode}
+ \int_gincr:N \c@jCol
+ \bool_if:NT \l_@@_vlines_bool
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl
+ { ! { \skip_horizontal:N \arrayrulewidth } }
+ }
+ \@@_patch_preamble:n
+ }
+% \end{macrocode}
+%
+% \medskip
+% For |>|, |<|, |!| and |@|
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_ii:nn #1 #2
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl { #1 { #2 } }
+ \@@_patch_preamble:n
+ }
+% \end{macrocode}
+%
+%
+% \medskip
+% For \verb+|+
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_iii:n #1
+ {
+% \end{macrocode}
+% |\l_tmpa_int| is the number of successive occurrences of \verb+|+
+% \begin{macrocode}
+ \int_incr:N \l_tmpa_int
+ \@@_patch_preamble_iii_i:n
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_iii_i:n #1
+ {
+ \str_if_eq:nnTF { #1 } |
+ { \@@_patch_preamble_iii:n | }
+ {
+ \tl_gput_right:Nx \g_@@_preamble_tl
+ {
+ \exp_not:N !
+ {
+ \skip_horizontal:n
+ {
+ \dim_eval:n
+ {
+ \arrayrulewidth * \l_tmpa_int
+ + \doublerulesep * ( \l_tmpa_int - 1)
+ }
+ }
+ }
+ }
+ \tl_gput_right:Nx \g_@@_internal_code_after_tl
+ { \@@_vline:nn { \int_use:N \c@jCol } { \int_use:N \l_tmpa_int } }
+ \int_zero:N \l_tmpa_int
+ \@@_patch_preamble:n #1
+ }
+ }
+% \end{macrocode}
+%
+%
+% \medskip
+% For |p|, |m| and |b|
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_iv:nnn #1 #2 #3
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl
+ {
+ > {
+ \@@_Cell:
+ \begin { minipage } [ #1 ] { #3 }
+ \mode_leave_vertical:
+ \box_use:N \@arstrutbox
+ }
+ c
+ < { \box_use:N \@arstrutbox \end { minipage } \@@_end_Cell: }
+ }
+% \end{macrocode}
+% We increment the counter of columns.
+% \begin{macrocode}
+ \int_gincr:N \c@jCol
+ \@@_patch_preamble:n
+ }
+% \end{macrocode}
+%
+% \medskip
+% For |w| and |W|
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_v:nnnn #1 #2 #3 #4
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl
+ {
+ > {
+ \hbox_set:Nw \l_@@_cell_box
+ \@@_Cell:
+ }
+ c
+ < {
+ \@@_end_Cell:
+ #1
+ \hbox_set_end:
+ \makebox [ #4 ] [ #3 ] { \box_use_drop:N \l_@@_cell_box }
+ }
+ }
+% \end{macrocode}
+% We increment the counter of columns.
+% \begin{macrocode}
+ \int_gincr:N \c@jCol
+ \@@_patch_preamble:n
+ }
+% \end{macrocode}
+%
+% \medskip
+% For |\@@_true_c:| which will appear in our redefinition of the columns of type
+% |S| (of \pkg{siunitx}).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_vi:n #1
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl { c }
+% \end{macrocode}
+% We increment the counter of columns.
+% \begin{macrocode}
+ \int_gincr:N \c@jCol
+ \bool_if:NT \l_@@_vlines_bool
+ {
+ \tl_gput_right:Nn \g_@@_preamble_tl
+ { ! { \skip_horizontal:N \arrayrulewidth } }
+ }
+ \@@_patch_preamble:n
+ }
+% \end{macrocode}
%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_patch_preamble_vii:n #1
+ {
+% \end{macrocode}
+% Here, we have a problem in the cases of the use in the first column or the ``last
+% one''.
+% \begin{macrocode}
+ \tl_gput_right:Nn \g_@@_preamble_tl
+ { ! { \skip_horizontal:N 2\l_@@_radius_dim } }
+% \end{macrocode}
+% The command |\@@_vdottedline:n| is protected, and, therefore, won't be
+% expanded before writing on |\g_@@_internal_code_after_tl|.
+% \begin{macrocode}
+ \tl_gput_right:Nx \g_@@_internal_code_after_tl
+ { \@@_vdottedline:n { \int_use:N \c@jCol } }
+ \@@_patch_preamble:n
+ }
+% \end{macrocode}
+%
+%
% \bigskip
% The command |\@@_put_box_in_flow:| puts the box |\l_tmpa_box| (which contains
% the array) in the flow. It is used for the environments with delimiters.
@@ -7107,7 +7467,7 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_use_array_box_with_notes:
+\cs_new_protected:Npn \@@_use_arraybox_with_notes_c:
{
\int_compare:nNnTF \c@tabularnote = 0
{ \box_use_drop:N \l_@@_the_array_box }
@@ -7169,6 +7529,68 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
+% \medskip
+% The case of |baseline| equal to |b|. Remember that, when the key |b| is used,
+% the |{array}| (of \pkg{array}) is constructed with the option |t| (and not
+% |b|). Now, we do the translation to take into account the option |b|.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_use_arraybox_with_notes_b:
+ {
+ \pgfpicture
+ \@@_qpoint:n { row - 1 }
+ \dim_gset_eq:NN \g_tmpa_dim \pgf@y
+ \@@_qpoint:n { row - \int_use:N \c@iRow - base }
+ \dim_gsub:Nn \g_tmpa_dim \pgf@y
+ \endpgfpicture
+ \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
+ \int_compare:nNnT \l_@@_first_row_int = 0
+ {
+ \dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim
+ \dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim
+ }
+ \box_move_up:nn \g_tmpa_dim { \@@_use_arraybox_with_notes_c: }
+ }
+% \end{macrocode}
+%
+% \medskip
+% Now, the general case (hence the |g| in the name).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_use_arraybox_with_notes:
+ {
+% \end{macrocode}
+% We convert a value of |t| to a value of |1|.
+% \begin{macrocode}
+ \str_if_eq:VnT \l_@@_baseline_str { t }
+ { \str_set:Nn \l_@@_baseline_str { 1 } }
+% \end{macrocode}
+% Now, we convert the value of |\l_@@_baseline_str| (which should represent an
+% integer) to an integer stored in |\l_tmpa_int|.
+% \begin{macrocode}
+ \int_set:Nn \l_tmpa_int \l_@@_baseline_str
+ \bool_lazy_or:nnT
+ { \int_compare_p:nNn \l_tmpa_int < \l_@@_first_row_int }
+ { \int_compare_p:nNn \l_tmpa_int > \g_@@_row_total_int }
+ {
+ \@@_error:n { bad~value~for~baseline }
+ \int_set:Nn \l_tmpa_int 1
+ }
+ \pgfpicture
+ \@@_qpoint:n { row - 1 }
+ \dim_gset_eq:NN \g_tmpa_dim \pgf@y
+ \@@_qpoint:n { row - \int_use:N \l_tmpa_int - base }
+ \dim_gsub:Nn \g_tmpa_dim \pgf@y
+ \endpgfpicture
+ \dim_gadd:Nn \g_tmpa_dim \arrayrulewidth
+ \int_compare:nNnT \l_@@_first_row_int = 0
+ {
+ \dim_gadd:Nn \g_tmpa_dim \g_@@_ht_row_zero_dim
+ \dim_gadd:Nn \g_tmpa_dim \g_@@_dp_row_zero_dim
+ }
+ \box_move_up:nn \g_tmpa_dim { \@@_use_arraybox_with_notes_c: }
+ }
+% \end{macrocode}
+%
+%
%
% \bigskip
% The command |\@@_put_box_in_flow_bis:| is used when the option
@@ -7226,9 +7648,9 @@ version 2005/12/01 or later.
% \interitem
% The construction of the array in the environment |{NiceArrayWithDelims}| is,
% in fact, done by the environment |{@@-light-syntax}| or by the environment
-% |{@@-normal-syntax}| (whether the option |light-syntax| is used or not). When
-% the key |light-syntax| is not used, the construction is a standard
-% environment (and, thus, it's possible to use verbatim in the arrray).
+% |{@@-normal-syntax}| (whether the option |light-syntax| is in force or not).
+% When the key |light-syntax| is not used, the construction is a standard
+% environment (and, thus, it's possible to use verbatim in the array).
% \begin{macrocode}
\NewDocumentEnvironment { @@-normal-syntax } { }
% \end{macrocode}
@@ -7239,13 +7661,12 @@ version 2005/12/01 or later.
% by LaTeX for incorrect nested environments).
% \begin{macrocode}
{
- \peek_meaning_ignore_spaces:NTF \end
- { \@@_analyze_end:Nn }
+ \peek_meaning_ignore_spaces:NTF \end \@@_analyze_end:Nn
% \end{macrocode}
% Here is the call to |\array| (we have a dedicated macro |\@@_array:| because
% of compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}).
% \begin{macrocode}
- { \exp_args:NV \@@_array: \l_tmpa_tl }
+ { \exp_args:NV \@@_array: \g_@@_preamble_tl }
}
{
\@@_create_col_nodes:
@@ -7255,8 +7676,8 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% When the key |light-syntax| is used, we use an environment which takes its whole
-% body as an argument (with the specifier |b| of \pkg{xparse}).
+% When the key |light-syntax| is in force, we use an environment which takes its
+% whole body as an argument (with the specifier |b| of \pkg{xparse}).
% % \label{code-light-syntax}
% \begin{macrocode}
\NewDocumentEnvironment { @@-light-syntax } { b }
@@ -7275,12 +7696,13 @@ version 2005/12/01 or later.
{ \@@_fatal:n { double-backslash~in~light-syntax } }
}
% \end{macrocode}
-% Now, you extract the |code-after| or the body of the environment. Maybe, there
+% Now, you extract the |code-after| of the body of the environment. Maybe, there
% is no command |\CodeAfter| in the body. That's why you put a marker
% |\CodeAfter| after |#1|. If there is yet a |\CodeAfter| in |#1|, this second
% (or third...) |\CodeAfter| will be catched in the value of
-% |\g_@@_code_after_tl|. That doesn't matter because |\CodeAfter| will be set to
-% \textsl{no-op} before the execution of |\g_@@_code_after_tl|.
+% |\g_nicematrix_code_after_tl|. That doesn't matter because |\CodeAfter| will
+% be set to \textsl{no-op} before the execution of
+% |\g_nicematrix_code_after_tl|.
% \begin{macrocode}
\@@_light_syntax_i #1 \CodeAfter \q_stop
}
@@ -7296,7 +7718,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_light_syntax_i #1\CodeAfter #2\q_stop
{
- \tl_gput_right:Nn \g_@@_code_after_tl { #2 }
+ \tl_gput_right:Nn \g_nicematrix_code_after_tl { #2 }
% \end{macrocode}
% The body of the array, which is stored in the argument |#1|, is now
% splitted into items (and \emph{not} tokens).
@@ -7316,7 +7738,7 @@ version 2005/12/01 or later.
% Here is the call to |\array| (we have a dedicated macro |\@@_array:| because
% of compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}).
% \begin{macrocode}
- \exp_args:NV \@@_array: \l_tmpa_tl
+ \exp_args:NV \@@_array: \g_@@_preamble_tl
% \end{macrocode}
% We need a global affectation because, when executing |\l_tmpa_tl|, we will
% exit the first cell of the array.
@@ -7700,80 +8122,36 @@ version 2005/12/01 or later.
% We create the variants of the environment |{NiceArrayWithDelims}|.
%
% \begin{macrocode}
-\NewDocumentEnvironment { pNiceArray } { }
- {
- \str_if_empty:NT \g_@@_name_env_str
- { \str_gset:Nn \g_@@_name_env_str { pNiceArray } }
- \@@_test_if_math_mode:
- \NiceArrayWithDelims ( )
- }
- { \endNiceArrayWithDelims }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { bNiceArray } { }
- {
- \str_if_empty:NT \g_@@_name_env_str
- { \str_gset:Nn \g_@@_name_env_str { bNiceArray } }
- \@@_test_if_math_mode:
- \NiceArrayWithDelims [ ]
- }
- { \endNiceArrayWithDelims }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { BNiceArray } { }
- {
- \str_if_empty:NT \g_@@_name_env_str
- { \str_gset:Nn \g_@@_name_env_str { BNiceArray } }
- \@@_test_if_math_mode:
- \NiceArrayWithDelims \{ \}
- }
- { \endNiceArrayWithDelims }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\NewDocumentEnvironment { vNiceArray } { }
+\cs_new_protected:Npn \@@_def_env:nnn #1 #2 #3
{
- \str_if_empty:NT \g_@@_name_env_str
- { \str_gset:Nn \g_@@_name_env_str { vNiceArray } }
- \@@_test_if_math_mode:
- \NiceArrayWithDelims | |
+ \NewDocumentEnvironment { #1 NiceArray } { }
+ {
+ \str_if_empty:NT \g_@@_name_env_str
+ { \str_gset:Nn \g_@@_name_env_str { #1 NiceArray } }
+ \@@_test_if_math_mode:
+ \NiceArrayWithDelims #2 #3
+ }
+ { \endNiceArrayWithDelims }
}
- { \endNiceArrayWithDelims }
% \end{macrocode}
%
% \begin{macrocode}
-\NewDocumentEnvironment { VNiceArray } { }
- {
- \str_if_empty:NT \g_@@_name_env_str
- { \str_gset:Nn \g_@@_name_env_str { VNiceArray } }
- \@@_test_if_math_mode:
- \NiceArrayWithDelims \| \|
- }
- { \endNiceArrayWithDelims }
+\@@_def_env:nnn p ( )
+\@@_def_env:nnn b [ ]
+\@@_def_env:nnn B \{ \}
+\@@_def_env:nnn v | |
+\@@_def_env:nnn V \| \|
% \end{macrocode}
+%
%
% \bigskip
% \subsection*{The environment \{NiceMatrix\} and its variants}
%
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_define_env:n #1
- {
- \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
- {
- \str_gset:Nn \g_@@_name_env_str { #1 NiceMatrix }
- \tl_set:Nn \l_@@_type_of_col_tl c
- \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
- \exp_args:Nnx \@@_begin_of_NiceMatrix:nn { #1 } \l_@@_type_of_col_tl
- }
- { \use:c { end #1 NiceArray } }
- }
-% \end{macrocode}
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_begin_of_NiceMatrix:nn #1 #2
{
+ \bool_set_true:N \l_@@_Matrix_bool
\use:c { #1 NiceArray }
{
*
@@ -7782,22 +8160,28 @@ version 2005/12/01 or later.
\c@MaxMatrixCols
{ \@@_pred:n \l_@@_last_col_int }
}
- #2
+ { > \@@_Cell: #2 < \@@_end_Cell: }
}
}
% \end{macrocode}
%
% \begin{macrocode}
-\@@_define_env:n { }
-\@@_define_env:n p
-\@@_define_env:n b
-\@@_define_env:n B
-\@@_define_env:n v
-\@@_define_env:n V
+\clist_map_inline:nn { { } , p , b , B , v , V }
+ {
+ \NewDocumentEnvironment { #1 NiceMatrix } { ! O { } }
+ {
+ \str_gset:Nn \g_@@_name_env_str { #1 NiceMatrix }
+ \tl_set:Nn \l_@@_type_of_col_tl c
+ \keys_set:nn { NiceMatrix / NiceMatrix } { ##1 }
+ \exp_args:Nnx \@@_begin_of_NiceMatrix:nn { #1 } \l_@@_type_of_col_tl
+ }
+ { \use:c { end #1 NiceArray } }
+ }
% \end{macrocode}
%
% \bigskip
-% \subsection*{The environment \{NiceTabular\}}
+% \subsection*{The environments \{NiceTabular\} and \{NiceTabular*\}}
+%
% \begin{macrocode}
\NewDocumentEnvironment { NiceTabular } { O { } m ! O { } }
{
@@ -7808,7 +8192,20 @@ version 2005/12/01 or later.
}
{ \endNiceArray }
% \end{macrocode}
-%
+%
+% \bigskip
+% \begin{macrocode}
+\NewDocumentEnvironment { NiceTabular* } { m O { } m ! O { } }
+ {
+ \str_gset:Nn \g_@@_name_env_str { NiceTabular* }
+ \dim_set:Nn \l_@@_tabular_width_dim { #1 }
+ \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 }
+ \bool_set_true:N \l_@@_NiceTabular_bool
+ \NiceArray { #3 }
+ }
+ { \endNiceArray }
+% \end{macrocode}
+%
%
% \bigskip
% \subsection*{After the construction of the array}
@@ -7924,6 +8321,8 @@ version 2005/12/01 or later.
\iow_now:Nn \@mainaux \ExplSyntaxOff
}
% \end{macrocode}
+%
+%
%
% By default, the diagonal lines will be parallelized\footnote{It's possible to
% use the option |parallelize-diags| to disable this parallelization.}. There
@@ -8025,16 +8424,49 @@ version 2005/12/01 or later.
% \end{macrocode}
% When |light-syntax| is used, we insert systematically a |\CodeAfter| in the
% flow. Thus, it's possible to have two instructions |\CodeAfter| and the second
-% one may be present in |\g_@@_code_after_tl|. That's why we set
+% may be in |\g_nicematrix_code_after_tl|. That's why we set
% |\Code-after| to be \textsl{no-op} now.
% \begin{macrocode}
\cs_set_eq:NN \CodeAfter \prg_do_nothing:
% \end{macrocode}
% And here's the |code-after|:
% \begin{macrocode}
- \g_@@_code_after_tl
- \tl_gclear:N \g_@@_code_after_tl
+ \g_nicematrix_code_after_tl
+ \tl_gclear:N \g_nicematrix_code_after_tl
\group_end:
+% \end{macrocode}
+%
+%
+% \medskip
+% |\g_@@_code_before_tl| is for instructions in the cells of the array such as
+% |\rowcolor| and |\cellcolor| (when the key |colortbl-like| is in
+% force). These instructions will be written on the |aux| file to be added to
+% the |code-before| in the next run.
+% \begin{macrocode}
+ \tl_if_empty:NF \g_@@_code_before_tl
+ {
+% \end{macrocode}
+% The command |\rowcolor| in tabular will in fact use |\rectanglecolor| in order
+% to follow the behaviour of |\rowcolor| of \pkg{colortbl}. That's why there may
+% be a command |\rectanglecolor| in |\g_@@_code_before_tl|. In order to avoid an
+% error during the expansion, we define a protected version of |\rectanglecolor|.
+% \begin{macrocode}
+ \cs_set_protected:Npn \rectanglecolor { }
+ \cs_set_protected:Npn \columncolor { }
+ \iow_now:Nn \@mainaux \ExplSyntaxOn
+ \iow_now:Nx \@mainaux
+ {
+ \tl_gset:cn
+ { g_@@_code_before_ \int_use:N \g_@@_env_int _ tl }
+ { \g_@@_code_before_tl }
+ }
+ \iow_now:Nn \@mainaux \ExplSyntaxOff
+ \bool_set_true:N \l_@@_code_before_bool
+ }
+% \end{macrocode}
+%
+% \medskip
+% \begin{macrocode}
\str_gclear:N \g_@@_name_env_str
\@@_restore_iRow_jCol:
% \end{macrocode}
@@ -9264,7 +9696,7 @@ version 2005/12/01 or later.
\@@_old_multicolumn
{ #1 }
% \end{macrocode}
-% We will have to replace |\tl_lower_case:n| in some times
+% We will have to replace |\tl_lower_case:n| in the future
% since |\tl_lower_case:n| seems to be deprecated.
% \begin{macrocode}
{
@@ -9671,7 +10103,7 @@ version 2005/12/01 or later.
% lines must be parallelized).
%
% \bigskip
-% \subsection*{Commands available in the code-before}
+% \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|.
@@ -9893,6 +10325,48 @@ version 2005/12/01 or later.
}
}
% \end{macrocode}
+%
+% \bigskip
+% When the user uses the key |colortbl-like|, the following command will
+% be linked to |\cellcolor| in the tabular.
+% \begin{macrocode}
+\NewDocumentCommand \@@_cellcolor_tabular { O { } m }
+ {
+ \tl_gput_right:Nx \g_@@_code_before_tl
+ { \cellcolor [ #1 ] { #2 } { \int_use:N \c@iRow - \int_use:N \c@jCol } }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% When the user uses the key |rowcolor-in-tabular|, the following command will
+% be linked to |\rowcolor| in the tabular.
+% \begin{macrocode}
+\NewDocumentCommand \@@_rowcolor_tabular { O { } m }
+ {
+ \tl_gput_right:Nx \g_@@_code_before_tl
+ {
+ \exp_not:N \rectanglecolor [ #1 ] { #2 }
+ { \int_use:N \c@iRow - \int_use:N \c@jCol }
+ { \int_use:N \c@iRow - \exp_not:n { \int_use:N \c@jCol } }
+ }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% \begin{macrocode}
+\NewDocumentCommand \@@_columncolor_preamble { O { } m }
+ {
+ \int_compare:nNnT \c@iRow = 1
+ {
+% \end{macrocode}
+% You use |gput_left| because we want the specification of colors for the
+% columns drawn before the specifications of color for the rows (and the cells).
+% \begin{macrocode}
+ \tl_gput_left:Nx \g_@@_code_before_tl
+ { \exp_not:N \columncolor [ #1 ] { #2 } { \int_use:N \c@jCol } }
+ }
+ }
+% \end{macrocode}
%
% \bigskip
% \subsection*{The vertical rules}
@@ -9951,36 +10425,54 @@ version 2005/12/01 or later.
% |\int_compare:nNnT \c@iRow < \l_@@_last_row_int|).
%
%
-% \medskip
-% In fact, independently of |\OnlyMainNiceMatrix|, which is a convenience given
-% to the user, we have to modify the behaviour of the standard specifier ``"|"''.
%
-%
-% Remark first that the natural way to do that would be to redefine the
-% specifier ``"|"'' with |\newcolumntype|:
-% \begin{Verbatim}[commandchars=\~\#\+]
-% \newcolumntype { | } { ! { \OnlyMainNiceMatrix \vline } }
-% \end{Verbatim}
-%
-% However, this code fails if the user uses "\DefineShortVerb{\|}" of
-% \pkg{fancyvrb}. Moreover, it would not be able to deal correctly with two
-% consecutive specifiers ``"|"'' (in a preambule like "ccc||ccc").
-%
-% That's why we have done a redefinition of the macro |\@arrayrule| of
-% \pkg{array} and this redefinition will add |\@@_vline:| instead of |\vline|
-% in the preamble (that definition is in the beginning of
-% |{NiceArrayWithDelims}|).
-%
-% Here is the definition of |\@@_vline:|. This definition \emph{must} be
-% protected because you don't want that macro expanded during the construction
-% of the preamble (the tests in |\@@_OnlyMainNiceMatrix:n| must be effective in
-% each row and not once for all when the preamble is constructed). The command
-% |\CT@arc@| is a command of \pkg{colortbl} which sets the color of the rules in
-% the array. The package \pkg{nicematrix} uses it even if \pkg{colortbl} is not
-% loaded.
+%
+% \bigskip
+% The following command will be executed in the |internal-code-after|. |#1| is
+% the number the column where to draw the rule and |#2| is the number of
+% consecutive occurrences of \verb+|+.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_vline:
- { \@@_OnlyMainNiceMatrix:n { { \CT@arc@ \vline } } }
+\cs_new_protected:Npn \@@_vline:nn #1 #2
+ {
+ \bool_if:NTF \c_@@_tikz_loaded_bool
+ {
+ \tikzpicture
+ \@@_vline_i:nn { #1 } { #2 }
+ \endtikzpicture
+ }
+ {
+ \pgfpicture
+ \@@_vline_i:nn { #1 } { #2 }
+ \endpgfpicture
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_vline_i:nn #1 #2
+ {
+ \CT@arc@
+ \pgfrememberpicturepositiononpagetrue
+ \pgf@relevantforpicturesizefalse
+ \pgfsetlinewidth { 1.1 \arrayrulewidth }
+ \pgfsetrectcap
+ \@@_qpoint:n { row - 1 }
+ \dim_set_eq:NN \l_tmpa_dim \pgf@y
+ \@@_qpoint:n { col - \int_eval:n { #1 + 1 } }
+ \dim_set_eq:NN \l_tmpb_dim \pgf@x
+ \pgfpathmoveto { \pgfpoint \l_tmpb_dim \l_tmpa_dim }
+ \@@_qpoint:n { row - \@@_succ:n \c@iRow }
+ \dim_set_eq:NN \l_tmpc_dim \pgf@y
+ \pgfpathlineto { \pgfpoint \l_tmpb_dim \l_tmpc_dim }
+ \prg_replicate:nn { #2 - 1 }
+ {
+ \dim_sub:Nn \l_tmpb_dim \arrayrulewidth
+ \dim_sub:Nn \l_tmpb_dim \doublerulesep
+ \pgfpathmoveto { \pgfpoint \l_tmpb_dim \l_tmpa_dim }
+ \pgfpathlineto { \pgfpoint \l_tmpb_dim \l_tmpc_dim }
+ }
+ \pgfusepathqstroke
+ }
% \end{macrocode}
%
% \bigskip
@@ -10454,7 +10946,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_hdottedline_i:
{
% \end{macrocode}
-% We write in the code-after the instruction that will potentially draw the
+% We write in the code-after the instruction that will actually draw the
% dotted line. It's not possible to draw this dotted line now because we don't
% know the length of the line (we don't even know the number of columns).
% \begin{macrocode}
@@ -11145,6 +11637,8 @@ version 2005/12/01 or later.
{
tikz .tl_set:N = \l_@@_tikz_tl ,
tikz .value_required:n = true ,
+ color .tl_set:N = \l_@@_color_tl ,
+ color .value_required:n = true ,
}
% \end{macrocode}
%
@@ -11160,13 +11654,25 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_Block_iii:nnnnnn #1 #2 #3 #4 #5 #6
{
% \end{macrocode}
-% The group is for the keys (even if, as of now, there is only one key, called
-% |tikz| and not documented).
+% The group is for the keys.
% \begin{macrocode}
\group_begin:
\keys_set:nn { NiceMatrix / Block } { #5 }
% \end{macrocode}
%
+% \begin{macrocode}
+ \tl_if_empty:NF \l_@@_color_tl
+ {
+ \tl_gput_right:Nx \g_@@_code_before_tl
+ {
+ \exp_not:N \rectanglecolor
+ { \l_@@_color_tl }
+ { #1 - #2 }
+ { #3 - #4 }
+ }
+ }
+% \end{macrocode}
+%
% \medskip
% \begin{macrocode}
\cs_set_protected:Npn \diagbox ##1 ##2
@@ -11174,7 +11680,8 @@ version 2005/12/01 or later.
\tl_gput_right:Nx \g_@@_internal_code_after_tl
{
\@@_actually_diagbox:nnnnnn
- { #1 } { #2 } { #3 } { #4 } { ##1 } { ##2 }
+ { #1 } { #2 } { #3 } { #4 }
+ { \exp_not:n { ##1 } } { \exp_not:n { ##2 } }
}
}
% \end{macrocode}
@@ -11258,7 +11765,7 @@ version 2005/12/01 or later.
%
% We construct the node for the block with the name |(#1-#2-block)|.
%
-% The function |\@@_pgf_rect_node:nnnnn| takes as arguments the name of the node
+% The function |\@@_pgf_rect_node:nnnnn| takes in as arguments the name of the node
% and the four coordinates of two opposite corner points of the rectangle.
% \begin{macrocode}
\begin { pgfscope }
@@ -11318,7 +11825,7 @@ version 2005/12/01 or later.
%
% \medskip
% If the creation of the ``medium nodes'' is required, we create a ``medium
-% node'' for the block. The function |\@@_pgf_rect_node:nnnnn| takes as
+% node'' for the block. The function |\@@_pgf_rect_node:nnnnn| takes in as
% arguments the name of the node and two \textsc{pgf} points.
% \begin{macrocode}
\bool_if:NT \l_@@_medium_nodes_bool
@@ -11528,8 +12035,8 @@ version 2005/12/01 or later.
{ \int_use:N \c@jCol }
{ \int_use:N \c@iRow }
{ \int_use:N \c@jCol }
- { #1 }
- { #2 }
+ { \exp_not:n { #1 } }
+ { \exp_not:n { #2 } }
}
% \end{macrocode}
% We put the cell with |\diagbox| in the sequence |\g_@@_pos_of_blocks_seq|
@@ -11611,7 +12118,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\cs_new_protected:Npn \@@_CodeAfter:n #1 \end
{
- \tl_gput_right:Nn \g_@@_code_after_tl { #1 }
+ \tl_gput_right:Nn \g_nicematrix_code_after_tl { #1 }
\@@_CodeAfter_i:n
}
% \end{macrocode}
@@ -11628,11 +12135,11 @@ version 2005/12/01 or later.
{ \end { #1 } }
% \end{macrocode}
% If this is not the |\end| we are looking for, we put those tokens in
-% |\g_@@_code_after_tl| and we go on searching for the next command |\end| with
-% a recursive call to the command |\@@_CodeAfter:n|.
+% |\g_nicematrix_code_after_tl| and we go on searching for the next command
+% |\end| with a recursive call to the command |\@@_CodeAfter:n|.
% \begin{macrocode}
{
- \tl_gput_right:Nn \g_@@_code_after_tl { \end { #1 } }
+ \tl_gput_right:Nn \g_nicematrix_code_after_tl { \end { #1 } }
\@@_CodeAfter:n
}
}
@@ -11767,15 +12274,26 @@ version 2005/12/01 or later.
% \bigskip
% \subsection*{Error messages of the package}
%
+% The following command converts all the elements of a sequence (which are token
+% lists) into strings.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_convert_to_str_seq:N #1
+ {
+ \seq_clear:N \l_tmpa_seq
+ \seq_map_inline:Nn #1
+ {
+ \seq_put_left:Nx \l_tmpa_seq { \tl_to_str:n { ##1 } }
+ }
+ \seq_set_eq:NN #1 \l_tmpa_seq
+ }
+% \end{macrocode}
%
-% The following command creates a sequence of strings (|str|) from a |clist|. Be
-% careful: we use |\seq_set_map:NNn| and the name of that function will maybe
-% change to |\eq_set_map_x:NNn|.
+% The following command creates a sequence of strings (|str|) from a |clist|.
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_seq_of_str_from_clist:Nn #1 #2
{
\seq_set_from_clist:Nn #1 { #2 }
- \seq_set_map:NNn #1 #1 { \tl_to_str:n { ##1 } }
+ \@@_convert_to_str_seq:N #1
}
% \end{macrocode}
%
@@ -11824,8 +12342,8 @@ version 2005/12/01 or later.
{
You~try~to~use~more~columns~than~allowed~by~your~
\@@_full_name_env:.\@@_message_hdotsfor:\ The~maximal~number~of~
- columns~is~\int_eval:n { \l_@@_last_col_int - 1 }~(plus~the~potential~
- exterior~ones).~This~error~is~fatal.
+ columns~is~\int_eval:n { \l_@@_last_col_int - 1 }~(plus~the~
+ exterior~columns).~This~error~is~fatal.
}
% \end{macrocode}
%
@@ -11837,7 +12355,7 @@ version 2005/12/01 or later.
\@@_full_name_env:.\@@_message_hdotsfor:\ Recall~that~the~maximal~
number~of~columns~for~a~matrix~is~fixed~by~the~LaTeX~counter~
'MaxMatrixCols'.~Its~actual~value~is~\int_use:N \c@MaxMatrixCols.~
- This~error~is~fatal.
+ This~error~is~fatal.
}
% \end{macrocode}
%
@@ -11850,12 +12368,32 @@ version 2005/12/01 or later.
{
You~try~to~use~more~columns~than~allowed~by~your~
\@@_full_name_env:.\@@_message_hdotsfor:\ The~maximal~number~of~columns~is~
- \int_eval:n { \c@jCol - 1 }~(plus~the~potential~exterior~ones).~
+ \int_use:N \g_@@_static_num_of_col_int\
+ ~(plus~the~potential~exterior~ones).~
This~error~is~fatal.
}
% \end{macrocode}
%
% \begin{macrocode}
+\@@_msg_new:nn { last~col~not~used }
+ {
+ The~key~'last-col'~is~in~force~but~you~have~not~used~that~last~column~
+ in~your~\@@_full_name_env:.~However,~you~can~go~on.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { columns~not~used }
+ {
+ The~preamble~of~your~\@@_full_name_env:\ announces~\int_use:N
+ \g_@@_static_num_of_col_int\
+ columns~but~you~use~only~\int_use:N \c@jCol.\\
+ However,~you~can~go~on.
+ }
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
\@@_msg_new:nn { in~first~col }
{
You~can't~use~the~command~#1 in~the~first~column~(number~0)~of~the~array.\\
@@ -11998,6 +12536,15 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
+\@@_msg_new:nn { unknown~column~type }
+ {
+ The~column~type~'#1'~in~your~\@@_full_name_env:\
+ is~unknown. \\
+ This~error~is~fatal.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\@@_msg_new:nn { angle~option~in~NiceTabular }
{
You~should~not~the~option~between~angle~brackets~(<~and~>)~for~a~command~
@@ -12100,9 +12647,9 @@ version 2005/12/01 or later.
{
The~available~options~are~(in~alphabetic~order):~
allow-duplicate-names,~
- code-for-first-col,~
cell-space-bottom-limit,~
cell-space-top-limit,~
+ code-for-first-col,~
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
@@ -12154,6 +12701,7 @@ version 2005/12/01 or later.
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
+ colortbl-like,~
columns-width,~
create-extra-nodes,~
create-medium-nodes,~
@@ -12209,6 +12757,7 @@ version 2005/12/01 or later.
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
+ colortbl-like,~
columns-width,~
create-extra-nodes,~
create-medium-nodes,~
@@ -12219,14 +12768,14 @@ version 2005/12/01 or later.
first-row,~
hlines,~
hvlines,~
- l~(=L),~
+ l,~
last-col,~
last-row,~
left-margin,~
light-syntax,~
name,~
nullify-dots,~
- r~(=R),~
+ r,~
renew-dots,~
right-margin,~
rules/color,~
@@ -12261,6 +12810,7 @@ version 2005/12/01 or later.
code-for-first-row,~
code-for-last-col,~
code-for-last-row,~
+ colortbl-like,~
columns-width,~
create-extra-nodes,~
create-medium-nodes,~
@@ -12647,6 +13197,18 @@ version 2005/12/01 or later.
%
% Command |\tabularnote|
%
+% \subsection*{Changes between versions 5.0 and 5.1}
+%
+% The vertical rules specified by \verb+|+ in the preamble are not broken by
+% |\hline\hline| (and other).
+%
+% Environment |{NiceTabular*}|
+%
+% Command |\Vdotsfor| similar to |\Hdotsfor|
+%
+% The variable |\g_nicematrix_code_after_tl| is now public.
+%
+%
% \PrintIndex
%
% \tableofcontents
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index 5fda73de4e..f2ebe92444 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/CHANGES b/macros/latex/contrib/tcolorbox/CHANGES
index 0d3fa0e696..6f79224bc8 100644
--- a/macros/latex/contrib/tcolorbox/CHANGES
+++ b/macros/latex/contrib/tcolorbox/CHANGES
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
@@ -1144,3 +1144,12 @@ version 4.30 (2020/04/28)
- library 'poster':
poster width and height caveats described in more detail (#98)
+version 4.31 (2020/07/31)
+- bug fix (#101): \tcbincludepdf did not work for lualatex
+- bug fix (#103): Several tests had a missing \relax
+- bug fix (#106): Breakable tcolorbox may overlap with following the text
+- bug fix: 'space to' did not result in a stable value
+- Internal change: all 'code 2 args' replaced by 'code n args={2}'
+- documentation typo corrections (#102)
+- library 'documentation':
+ * indention of <environment content> changed to \ttfamily (#100)
diff --git a/macros/latex/contrib/tcolorbox/README b/macros/latex/contrib/tcolorbox/README
index bf06996dfa..9df1250c23 100644
--- a/macros/latex/contrib/tcolorbox/README
+++ b/macros/latex/contrib/tcolorbox/README
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2006-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
diff --git a/macros/latex/contrib/tcolorbox/tcbbreakable.code.tex b/macros/latex/contrib/tcolorbox/tcbbreakable.code.tex
index 0a3145d215..4f3eb68f92 100644
--- a/macros/latex/contrib/tcolorbox/tcbbreakable.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbbreakable.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbbreakable.code.tex: Code for breakable colorboxes
%%
%% -------------------------------------------------------------------------------------------
@@ -17,16 +17,16 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\let\tcb@parboxrestore@true=\tcb@parboxrestore
\let\tcb@parboxrestore@false\tcb@parbox@false@settings
% total height for boxes smaller than 0.4375\maxdimen and 0.4375\maxdimen else (ca 2.5m)
\def\tcb@defToTotalHeightBreakable#1#2{%
- \ifnum\ht#2<0 %
+ \ifnum\ht#2<0\relax%
\edef#1{7168pt}%
- \else\ifnum\ht#2<469762048 %
+ \else\ifnum\ht#2<469762048\relax%
\tcbdimto#1{\ht#2+\dp#2}%
\else%
\edef#1{7168pt}%
@@ -106,12 +106,12 @@
\ifdim\tcb@breakat@dim>0pt\relax%
\tcbdimto\tcb@h@page{\tcb@breakat@dim-\kvtcb@shrinkbreakgoal}%
\else%
- \ifx\kvtcb@float\@empty%
+ \ifx\kvtcb@float\@empty\relax%
\iftcb@multicol%
\ifnum\c@tcbbreakpart>1\relax%
\tcbdimto\tcb@h@page{\@colroom}%
\else%
- \ifdim\pagegoal=16383.99998pt
+ \ifdim\pagegoal=16383.99998pt\relax%
\tcbdimto\tcb@h@page{\@colroom}%
\else%
\@tempdima\pagetotal%
@@ -120,7 +120,7 @@
\fi%
\fi%
\else%
- \ifdim\pagegoal=16383.99998pt
+ \ifdim\pagegoal=16383.99998pt\relax%
\tcbdimto\tcb@h@page{\vsize}% detects floating objects
\else%
\tcb@comp@compress%
@@ -162,7 +162,7 @@
}
\def\tcb@following@title{%
- \ifx\kvtcb@followingtitle\@empty%
+ \ifx\kvtcb@followingtitle\@empty\relax%
\tcb@hasTitlefalse%
\let\tcb@h@title=\tcb@zpt%
\let\tcb@h@padtitle=\tcb@zpt%
@@ -189,7 +189,7 @@
\def\tcb@enlbreak@next@scan#1/#2@{%
\def\temp@a{#2}%
\tcbdimto\tcb@enlbreak@dim{#1}%
- \ifx\temp@a\@empty%
+ \ifx\temp@a\@empty\relax%
\let\tcb@enlbreak@next=\tcb@enlbreak@next@final%
\else%
\edef\tcb@enlbreak@seq{\temp@a @}%
@@ -212,7 +212,7 @@
\def\tcb@breakat@next@scan#1/#2@{%
\def\temp@a{#2}%
\tcbdimto\tcb@breakat@dim{#1}%
- \ifx\temp@a\@empty%
+ \ifx\temp@a\@empty\relax%
\let\tcb@breakat@next=\@empty%
\else%
\edef\tcb@breakat@seq{\temp@a @}%
@@ -264,12 +264,12 @@
\setcounter{tcbbreakpart}{0}%
\let\tcb@nobreak@warning\@empty%
\@ifundefined{columnbreak}{\tcb@multicolfalse}{%
- \ifnum\doublecol@number>\z@ %
+ \ifnum\doublecol@number>\z@\relax%
\tcb@multicoltrue%
\else%
\tcb@multicolfalse%
\fi}%
- \ifx\kvtcb@float\@empty%
+ \ifx\kvtcb@float\@empty\relax%
\iftcb@nobreak{%
\let\tcb@nobreak@warning\tcb@do@nobreak@warning%
\iftcb@ignorenobreak%
@@ -318,7 +318,7 @@
\tcb@split@start%
\endgroup%
\color{.}% hack for some special cases
- \ifx\kvtcb@float\@empty%
+ \ifx\kvtcb@float\@empty\relax%
\aftergroup\tcb@use@after@lastbox%
\fi%
}
@@ -514,7 +514,7 @@
\def\tcb@split@first{%
\setcounter{tcbbreakpart}{1}%
- \ifx\kvtcb@float\@empty%
+ \ifx\kvtcb@float\@empty\relax%
\iftcb@vfillbeforefirst%
\let\tcb@before@first=\vfill%
\else%
@@ -636,7 +636,8 @@
\def\tcb@split@force@last{%
\tcb@split@setstate@last%
- \ifdim\tcb@h@total>\tcb@h@page%
+ \ifdim\tcb@h@total>\tcb@h@page\relax%
+ \gdef\tcb@after@lastbox{\clearpage}%
\tcbdimto\kvtcb@bbbottom{\kvtcb@bbbottom+\tcb@h@page-\tcb@h@total}%
\fi%
}
@@ -978,7 +979,7 @@
compress page/all/.code={\def\tcb@comp@compress{\def\tcb@compress@height{\pageshrink-1sp}}},%
compress page/none/.code={\def\tcb@comp@compress{\let\tcb@compress@height\tcb@zpt}},%
compress page/baselineskip/.code={\def\tcb@comp@compress{%
- \ifdim\pageshrink>\baselineskip%
+ \ifdim\pageshrink>\baselineskip\relax%
\let\tcb@compress@height\baselineskip%
\else%
\def\tcb@compress@height{\pageshrink-1sp}%
diff --git a/macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex b/macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex
index 49c70baefb..819197e3b1 100644
--- a/macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbdocumentation.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbdocumentation.code.tex: Code for LaTeX documentations
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbuselibrary{listings,skins,xparse,external,raster}
@@ -487,7 +487,7 @@
\seq_gput_left:NV \g__tcobox_label_seq \kvtcb@doc@label
}
{\ttfamily\kvtcb@doc@parameter}\par
- \strut\nobreakspace\nobreakspace\meta{\kvtcb@text@envcontent}\par
+ \strut{\ttfamily\nobreakspace\nobreakspace}\meta{\kvtcb@text@envcontent}\par
\strut\cs{end}\brackets{\__tcobox_print_environment:}
\tcb@doc@do@description
}
@@ -808,7 +808,7 @@
\NewDocumentCommand\tcb@ref@doc{msm}{%
\hyperref[#1:#3]{\texttt{\ref*{#1:#3}}%
\IfBooleanTF{#2}{}{%
- \ifnum\getpagerefnumber{#1:#3}=\thepage%
+ \ifnum\getpagerefnumber{#1:#3}=\thepage\relax%
\else%
\textsuperscript{\ding{213}\,\kvtcb@text@pageshort\,\pageref*{#1:#3}}%
\fi}}%
diff --git a/macros/latex/contrib/tcolorbox/tcbexternal.code.tex b/macros/latex/contrib/tcolorbox/tcbexternal.code.tex
index ebf274f9b0..20a1254801 100644
--- a/macros/latex/contrib/tcolorbox/tcbexternal.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbexternal.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbexternal.code.tex: Code for externalization
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbuselibrary{pro@cessing}
@@ -217,8 +217,8 @@
clear preamble/.code={\def\tcbexternal@preamble{}},
preclass/.code={\appto\tcbexternal@preclass{#1}},
clear preclass/.code={\def\tcbexternal@preclass{}},
- PassOptionsToPackage/.code 2 args={\appto\tcbexternal@preclass{\PassOptionsToPackage{#1}{#2}}},
- PassOptionsToClass/.code 2 args={\appto\tcbexternal@preclass{\PassOptionsToClass{#1}{#2}}},
+ PassOptionsToPackage/.code n args={2}{\appto\tcbexternal@preclass{\PassOptionsToPackage{#1}{#2}}},
+ PassOptionsToClass/.code n args={2}{\appto\tcbexternal@preclass{\PassOptionsToClass{#1}{#2}}},
externalize/.code={},
-/.style={/tcb/external/externalize=false},
%
diff --git a/macros/latex/contrib/tcolorbox/tcbfitting.code.tex b/macros/latex/contrib/tcolorbox/tcbfitting.code.tex
index cf641991be..0808d0f4ef 100644
--- a/macros/latex/contrib/tcolorbox/tcbfitting.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbfitting.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbfitting.code.tex: Code for fit boxes
%%
%% -------------------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\newdimen\tcbfitdim
\newdimen\tcb@lowerfitdim
diff --git a/macros/latex/contrib/tcolorbox/tcbhooks.code.tex b/macros/latex/contrib/tcolorbox/tcbhooks.code.tex
index 135d78236e..84720b1c85 100644
--- a/macros/latex/contrib/tcolorbox/tcbhooks.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbhooks.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbhooks.code.tex: Code for adding hooks
%%
%% -------------------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbset{%
before upper app/.code={\appto\kvtcb@before@upper{#1}},%
diff --git a/macros/latex/contrib/tcolorbox/tcblistings.code.tex b/macros/latex/contrib/tcolorbox/tcblistings.code.tex
index aedb6eb143..9ac64e3fd5 100644
--- a/macros/latex/contrib/tcolorbox/tcblistings.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcblistings.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcblistings.code.tex: Code for colorboxes with listings
%%
%% -------------------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\RequirePackage{listings}[2007/02/22]
diff --git a/macros/latex/contrib/tcolorbox/tcblistingscore.code.tex b/macros/latex/contrib/tcolorbox/tcblistingscore.code.tex
index a241e3e3c1..1b76e30fbe 100644
--- a/macros/latex/contrib/tcolorbox/tcblistingscore.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcblistingscore.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcblistingscode.code.tex: Auxiliary code for colorboxes with listings
%%
%% -------------------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbuselibrary{pro@cessing}
@@ -178,11 +178,11 @@
\tcbset{%
listing file/.store in=\kvtcb@listingfile,%
comment/.store in=\kvtcb@listingcomment,%
- listing@process@inside/.code 2 args={%
+ listing@process@inside/.code n args={2}{%
\let\tcb@inputlisting\tcb@inputlisting@inside%
\let\tcb@listing@process=#1%
\let\tcb@use@listing@other=#2},%
- listing@process@outside/.code 2 args={%
+ listing@process@outside/.code n args={2}{%
\let\tcb@inputlisting=#1%
\let\tcb@use@listing@other=#2},%
listing only/.style={listing@process@inside={\tcb@listing@listing}{\tcbuselistingtext}},%
diff --git a/macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex b/macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex
index fa62475ca1..99cdae4c73 100644
--- a/macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcblistingsutf8.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcblistingsutf8.code.tex: Code for colorboxes with listings in UTF-8
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbuselibrary{listings}
diff --git a/macros/latex/contrib/tcolorbox/tcbmagazine.code.tex b/macros/latex/contrib/tcolorbox/tcbmagazine.code.tex
index 444c3867aa..e339447ada 100644
--- a/macros/latex/contrib/tcolorbox/tcbmagazine.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbmagazine.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbmagazine.code.tex: Code for box sets and magazine styles
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbuselibrary{breakable}
diff --git a/macros/latex/contrib/tcolorbox/tcbminted.code.tex b/macros/latex/contrib/tcolorbox/tcbminted.code.tex
index e5574ff669..073e2c7bb6 100644
--- a/macros/latex/contrib/tcolorbox/tcbminted.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbminted.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbminted.code.tex: Code for colorboxes with listings
%%
%% -------------------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\RequirePackage{minted}[2011/09/17]
diff --git a/macros/latex/contrib/tcolorbox/tcbposter.code.tex b/macros/latex/contrib/tcolorbox/tcbposter.code.tex
index 712095687b..c8bb522923 100644
--- a/macros/latex/contrib/tcolorbox/tcbposter.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbposter.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbposter.code.tex: Code for posters
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbuselibrary{breakable,magazine,skins,fitting}
diff --git a/macros/latex/contrib/tcolorbox/tcbprocessing.code.tex b/macros/latex/contrib/tcolorbox/tcbprocessing.code.tex
index 522d1469ff..c11451fe36 100644
--- a/macros/latex/contrib/tcolorbox/tcbprocessing.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbprocessing.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbprocessing.code.tex: Code for conditional processing
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\RequirePackage{pdftexcmds}
\RequirePackage{shellesc}
diff --git a/macros/latex/contrib/tcolorbox/tcbraster.code.tex b/macros/latex/contrib/tcolorbox/tcbraster.code.tex
index faf8c7cc31..7492e2a677 100644
--- a/macros/latex/contrib/tcolorbox/tcbraster.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbraster.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbskinsjigsaw.code.tex: Code for colorboxes with different skins
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\newcounter{tcbrastercolumn}
\newcounter{tcbrasterrow}
@@ -193,7 +193,7 @@
\color@vbox%
\hsize=\tcb@raster@width%
\let\tcb@end@raster\color@endbox%
- \fi\fi%&
+ \fi\fi%
\if@nobreak%
\iftcb@ignorenobreak%
{\par\nointerlineskip%
@@ -206,7 +206,7 @@
\tcb@parfillskip@check\kvtcb@raster@halign\noindent%
}{%
\ifhmode\unskip\fi%
- \ifnum\c@tcbrastercolumn>1 %
+ \ifnum\c@tcbrastercolumn>1\relax%
\kern\tcb@raster@skip@right%
\fi%
\begingroup%
diff --git a/macros/latex/contrib/tcolorbox/tcbskins.code.tex b/macros/latex/contrib/tcolorbox/tcbskins.code.tex
index cf0dc29e96..7297dc0e84 100644
--- a/macros/latex/contrib/tcolorbox/tcbskins.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbskins.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbskins.code.tex: Code for colorboxes with different skins
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\RequirePackage{tikz}[2010/10/13]
@@ -29,7 +29,7 @@
\begin{scope}[every node/.style={line width=0mm,inner sep=0mm,outer sep=0mm,draw=none,fill=none,rectangle}]
\node[name=frame,at={(0,0)},above right,minimum width=\tcb@width,minimum height=\tcb@height]{};
\node[name=interior,at={({\kvtcb@left@rule},{\kvtcb@bottom@rule})},above right,minimum width=\tcb@innerwidth,minimum height=\tcb@innerheight]{};
- \ifnum\tcbsegmentstate=1%
+ \ifnum\tcbsegmentstate=1\relax%
\node[name=segmentation,at={({\kvtcb@left@rule},{\the\dimexpr\kvtcb@bottom@rule+\kvtcb@boxsep*2+\tcb@break@bottomsep+\kvtcb@bottom+\tcb@height@lower\relax})},above right,
minimum width=\tcb@innerwidth,minimum height=\the\dimexpr\kvtcb@middle*2\relax]{};
\else\iftcb@sidebyside%
@@ -652,7 +652,7 @@
frame engine=path,interior titled engine=empty,interior engine=empty,segmentation engine=empty,title engine=path,%
interior titled code={%
\iftcb@lowerseparated%
- \ifnum\tcbsegmentstate=1%
+ \ifnum\tcbsegmentstate=1\relax%
\tcb@spec{beamer@color}\tcb@drawspec@UT%
\else%
{\tcb@spec{beamer@color}\tcb@drawwithtitle@path}%
@@ -663,7 +663,7 @@
\tcb@drawspec@T\tcb@spec{}},
interior code={%
\iftcb@lowerseparated%
- \ifnum\tcbsegmentstate=1
+ \ifnum\tcbsegmentstate=1\relax%
\tcb@spec{beamer@color}\tcb@drawspec@UR%
\else%
{\tcb@spec{beamer@color}\tcb@drawwithouttitle@path}%
@@ -680,7 +680,7 @@
frame engine=pathfirst,interior titled engine=empty,interior engine=empty,segmentation engine=empty,title engine=pathfirst,%
interior titled code={%
\iftcb@lowerseparated%
- \ifnum\tcbsegmentstate=1%
+ \ifnum\tcbsegmentstate=1\relax%
\tcb@spec{beamer@color}\tcb@drawspec@UT%
\else%
{\tcb@spec{beamer@color}\tcb@drawwithtitle@pathfirst}%
@@ -691,7 +691,7 @@
\tcb@drawspec@T\tcb@spec{}},%
interior code={%
\iftcb@lowerseparated%
- \ifnum\tcbsegmentstate=1
+ \ifnum\tcbsegmentstate=1\relax%
\tcb@spec{beamer@color}\tcb@drawspec@UR%
\else%
{\tcb@spec{beamer@color}\tcb@drawwithouttitle@pathfirst}%
@@ -706,7 +706,7 @@
frame engine=pathmiddle,interior titled engine=empty,interior engine=empty,segmentation engine=empty,title engine=pathmiddle,%
interior titled code={%
\iftcb@lowerseparated%
- \ifnum\tcbsegmentstate=1%
+ \ifnum\tcbsegmentstate=1\relax%
\tcb@spec{beamer@color}\tcb@drawspec@UT%
\else%
{\tcb@spec{beamer@color}\tcb@drawwithtitle@pathmiddle}%
@@ -717,7 +717,7 @@
\tcb@drawspec@T\tcb@spec{}},%
interior code={%
\iftcb@lowerseparated%
- \ifnum\tcbsegmentstate=1
+ \ifnum\tcbsegmentstate=1\relax%
\tcb@spec{beamer@color}\tcb@drawspec@US%
\else%
{\tcb@spec{beamer@color}\tcb@drawwithouttitle@pathmiddle}%
@@ -743,7 +743,7 @@
\tcb@drawspec@T\tcb@spec{}},%
interior code={%
\iftcb@lowerseparated%
- \ifnum\tcbsegmentstate=1
+ \ifnum\tcbsegmentstate=1\relax%
\tcb@spec{beamer@color}\tcb@drawspec@US%
\else%
{\tcb@spec{beamer@color}\tcb@drawwithouttitle@pathlast}%
@@ -1021,13 +1021,13 @@
\ifdim\dimexpr\kvtcb@yinnershift@boxedtitle<0pt\relax\let\kvtcb@yinnershift@boxedtitle\tcb@zpt\fi%
}},
boxtitle/adapt@top/.code={%
- \ifdim\dimexpr\tcboxedtitleheight+\kvtcb@yshift@boxedtitle>0pt\relax
+ \ifdim\dimexpr\tcboxedtitleheight+\kvtcb@yshift@boxedtitle>0pt\relax%
\tcbdimto\kvtcb@bbtop@stand{\kvtcb@bbtop@stand+\tcboxedtitleheight+\kvtcb@yshift@boxedtitle}%
\fi%
\tcbdimto\kvtcb@top{\kvtcb@top-\kvtcb@yinnershift@boxedtitle}%
},
boxtitle/adapt@bottom/.code={%
- \ifdim\dimexpr\tcboxedtitleheight-\kvtcb@yshift@boxedtitle>0pt\relax
+ \ifdim\dimexpr\tcboxedtitleheight-\kvtcb@yshift@boxedtitle>0pt\relax%
\tcbdimto\kvtcb@bbbottom@stand{\kvtcb@bbbottom@stand+\tcboxedtitleheight-\kvtcb@yshift@boxedtitle}%
\fi%
\tcbdimto\kvtcb@bottom{\kvtcb@bottom+\kvtcb@yinnershift@boxedtitle}%
@@ -1103,7 +1103,7 @@
\def\tcb@setratio#1#2#3{\edef#1{\strip@pt\dimexpr\number\numexpr\number\dimexpr#2\relax*65536/\number\dimexpr#3\relax\relax sp\relax}}
-\def\tcb@setratiorobust#1#2#3{\ifdim\dimexpr#3<1pt\tcb@setratio#1{#2}{1pt}\else\tcb@setratio#1{#2}{#3}\fi}
+\def\tcb@setratiorobust#1#2#3{\ifdim\dimexpr#3<1pt\relax\tcb@setratio#1{#2}{1pt}\else\tcb@setratio#1{#2}{#3}\fi}
\def\tcb@comp@waterbox@stretch#1#2#3{%
\tcb@setratiorobust\tcb@scale@x{#1\dimexpr#2}{\wd\tcb@waterbox}%
@@ -1288,10 +1288,10 @@
\pgfutil@loop%
\pgfutil@loop%
\pgftext[x=\pgf@xc,y=\pgf@yc,left,top]{\copy\tcb@waterbox}%
- \ifdim\pgf@xc<\pgf@xb%
+ \ifdim\pgf@xc<\pgf@xb\relax%
\advance\pgf@xc\tcb@ppbb@tilew%
\pgfutil@repeat%
- \ifdim\pgf@yc>\pgf@ya%
+ \ifdim\pgf@yc>\pgf@ya\relax%
\advance\pgf@yc-\tcb@ppbb@tileh%
\pgf@xc\pgf@xa%
\pgfutil@repeat%
@@ -1484,7 +1484,7 @@
\def\tcb@shadow@comp@ts@smart#1#2{%
- \ifdim#2>0pt\relax\tcbdimto\tcb@shadow@ts{#1-#2/2}%%
+ \ifdim#2>0pt\relax\tcbdimto\tcb@shadow@ts{#1-#2/2}%
\else\tcbdimto\tcb@shadow@ts{#1+#2/2}\fi%
}
@@ -1806,16 +1806,24 @@
\def\tcb@set@pdfpages#1#2{%
\IfFileExists{#2}{%
\ifdef{\pdfximage}{%
+ % pdftex
\pdfximage{#2}%
\edef#1{\the\pdflastximagepages}%
}{%
- \ifdef{\XeTeXpdfpagecount}{%
- \edef#1{\the\XeTeXpdfpagecount #2 }%
- \ifnum#1=0 %
- \edef#1{1}%
- \fi%
- }{\tcb@error{For PDF support run pdflatex, xelatex, or lualatex}{%
- Your compiler seems not to support PDF include files.}}%
+ \ifdef{\saveimageresource}{%
+ % luatex
+ \saveimageresource{#2}%
+ \edef#1{\the\lastsavedimageresourcepages}%
+ }{%
+ \ifdef{\XeTeXpdfpagecount}{%
+ % xetex
+ \edef#1{\the\XeTeXpdfpagecount #2 }%
+ \ifnum#1=0\relax%
+ \edef#1{1}%
+ \fi%
+ }{\tcb@error{For PDF support run pdflatex, xelatex, or lualatex}{%
+ Your compiler seems not to support PDF include files.}}%
+ }%
}%
}{\tcb@error{PDF file `#2' not found}{The PDF file `#2' was not found}}%
\relax%
diff --git a/macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex b/macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex
index 6bcd0fef7e..ca7f868827 100644
--- a/macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbskinsjigsaw.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbskinsjigsaw.code.tex: Code for colorboxes with different skins
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbuselibrary{skins}
diff --git a/macros/latex/contrib/tcolorbox/tcbtheorems.code.tex b/macros/latex/contrib/tcolorbox/tcbtheorems.code.tex
index c158bdd77b..ae26c751b7 100644
--- a/macros/latex/contrib/tcolorbox/tcbtheorems.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbtheorems.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbtheorems.code.tex: Code for theorems in colorboxes
%%
%% -------------------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\RequirePackage{amsmath}
@@ -106,7 +106,7 @@
terminator sign dash/.style={terminator sign={\ --}},%
terminator sign none/.style={terminator sign=},%
label separator/.store in=\kvtcb@label@sep,%
- description delimiters/.code 2 args={\def\kvtcb@desc@delim@left{#1}\def\kvtcb@desc@delim@right{#2}},%
+ description delimiters/.code n args={2}{\def\kvtcb@desc@delim@left{#1}\def\kvtcb@desc@delim@right{#2}},%
description delimiters parenthesis/.style={description delimiters=()},
description delimiters none/.style={description delimiters={}{}},
description color/.code={\def\temp@a{#1}\ifx\temp@a\@empty\relax%
diff --git a/macros/latex/contrib/tcolorbox/tcbvignette.code.tex b/macros/latex/contrib/tcolorbox/tcbvignette.code.tex
index dbc07bdf1e..6dfef8c103 100644
--- a/macros/latex/contrib/tcolorbox/tcbvignette.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbvignette.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbvignette.code.tex: Code for ornamental frames
%%
%% -------------------------------------------------------------------------------------------
@@ -17,7 +17,7 @@
%%
%% This work consists of all files listed in README
%%
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\tcbuselibrary{skins}
diff --git a/macros/latex/contrib/tcolorbox/tcbxparse.code.tex b/macros/latex/contrib/tcolorbox/tcbxparse.code.tex
index 13daf19c84..d2f9c1b088 100644
--- a/macros/latex/contrib/tcolorbox/tcbxparse.code.tex
+++ b/macros/latex/contrib/tcolorbox/tcbxparse.code.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcbxparse.code.tex: Code for xparse features
%%
%% -------------------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
%% This work consists of all files listed in README
%%
%\makeatletter
-\tcb@set@library@version{4.30}
+\tcb@set@library@version{4.31}
\RequirePackage{xparse}[2013/12/31]
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdf b/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdf
index a88e74ad07..777c531725 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdf
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex b/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex
index 5c52d044a4..9b6514fdba 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-example-poster.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcolorbox-example-poster.tex: a poster example for tcolorbox
%%
%% -------------------------------------------------------------------------------------------
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-example.pdf b/macros/latex/contrib/tcolorbox/tcolorbox-example.pdf
index e1de6b9fba..1798c61235 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-example.pdf
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-example.tex b/macros/latex/contrib/tcolorbox/tcolorbox-example.tex
index f1f61989b8..8e682612b2 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-example.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-example.tex
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcolorbox-example.tex: an example for tcolorbox
%%
%% -------------------------------------------------------------------------------------------
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdf b/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdf
index f3e875a401..b6c8a73e02 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdf
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex b/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex
index aca460f293..3d12a3a6c1 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox-tutorial-poster.tex
@@ -1,5 +1,5 @@
% \LaTeX-Main\
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcolorbox-tutorial-poster.tex: a tutorial for poster creation with tcolorbox
%%
%% -------------------------------------------------------------------------------------------
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex
index f053690e3f..5f9d4acccb 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.coreoptions.tex
@@ -1915,7 +1915,7 @@ colframe=blue!75!black,colback=white,height=3cm}
-\begin{docTcbKey}[][doc new=2015-02-15]{space to}{=\meta{macro}}{no default, initially unset}
+\begin{docTcbKey}[][doc new and updated={2015-02-15}{2020-07-30}]{space to}{=\meta{macro}}{no default, initially unset}
If the height of a |tcolorbox| is not the natural height, the space
difference between the forced and the natural size is saved into the
given local \meta{macro}. This \meta{macro} can and should be used inside
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.external.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.external.tex
index 8479f88f41..d1de4f3a15 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.external.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.external.tex
@@ -553,7 +553,7 @@ a & This table is externalized as snippet. Obviously,
\meta{env}! Otherwise, externalized and non-externalized version will have
different spacings.
\end{marker}
- \refEnv{extcolorbox} is an example application for\refCom{newtcbexternalizetcolorbox}.
+ \refEnv{extcolorbox} is an example application for \refCom{newtcbexternalizetcolorbox}.
\inputpreamblelisting{M}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex
index 0be60d6e07..9a0a8ad1a6 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.listings.tex
@@ -1182,9 +1182,9 @@ For the examples, three environments |texexp|, |texexptitled|,
and |texexptitledspec| are defined with automatic numbering.
\begin{itemize}
-\item |texexp| is used for untitled examles,
-\item |texexptitled| is used for titled examles,
-\item |texexptitledspec| is used for titled examles with special treatment.
+\item |texexp| is used for untitled examples,
+\item |texexptitled| is used for titled examples,
+\item |texexptitledspec| is used for titled examples with special treatment.
\end{itemize}
\inputpreamblelisting{D}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex b/macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex
index 2587521132..85436abcd7 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.poster.tex
@@ -287,7 +287,7 @@ The \meta{option list} can contain any |tcolorbox| option.
boxes = {sharp corners=downhill,arc=3mm,boxrule=1mm,
colback=white,colframe=cyan,
title style={left color=black,right color=cyan},
- fonttitle=\bfseries\scshape}
+ fonttitle=\bfseries}
]
\posterbox[adjusted title=First]{column=1,row=1,span=2}{First box}
\posterbox[adjusted title=Second]{column=1,row=2,span=2}{Second box}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty b/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty
index cf10fbe2c0..80604e3d04 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_main.sty
@@ -11,7 +11,7 @@
\RequirePackage[svgnames,table,hyperref]{xcolor}
\RequirePackage{tikz}
\RequirePackage{varioref}
-\RequirePackage[makeindex]{imakeidx}
+%\RequirePackage[makeindex]{imakeidx}
\RequirePackage[pdftex,bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref}
\RequirePackage{bookmark,varwidth,cleveref,incgraph}
@@ -310,3 +310,23 @@
compilable listing,
run pdflatex,#1
}
+
+\ExplSyntaxOn
+
+\cs_new:Npn \__tcobox_aux_mkdir:n #1
+ {
+ \file_if_exist:nF { "#1"/dir.marker }
+ {
+ \sys_shell_now:x {mkdir~"#1"}
+ \iow_open:Nn \g_tmpa_iow {"#1"/dir.marker}
+ \iow_close:N \g_tmpa_iow
+ }
+ }
+
+\NewDocumentCommand{ \tcbAUXmkdir }{ m }
+ {
+ \__tcobox_aux_mkdir:n {#1}
+ }
+
+\ExplSyntaxOff
+
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_snippet.sty b/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_snippet.sty
index c33f924d01..785b65b23c 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_snippet.sty
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.doc.s_snippet.sty
@@ -177,7 +177,8 @@
colbacktitle=red!50!yellow,before skip=6pt,after skip=6pt,
title={#2},#1}
-\newtcbexternalizetcolorbox{exmyownlisting}{myownlisting}{minipage}%
+\newtcbexternalizetcolorbox{exmyownlisting}{myownlisting}%
+ {minipage,environment with percent=false}%
{before skip=6pt,after skip=6pt}% same values as for mylisting
\end{tcbverbatimwrite}
\input{\jobname_preamble_M.tex}
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.pdf b/macros/latex/contrib/tcolorbox/tcolorbox.pdf
index 79654b9ebb..e9a5c9374d 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.pdf
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.pdf
Binary files differ
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.sty b/macros/latex/contrib/tcolorbox/tcolorbox.sty
index 5a0f6214f8..2af5529755 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.sty
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.sty
@@ -1,4 +1,4 @@
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcolorbox.sty: Text color boxes
%%
%% -------------------------------------------------------------------------------------------
@@ -18,8 +18,8 @@
%% This work consists of all files listed in README
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tcolorbox}[2020/04/28 version 4.30 text color boxes]
-\def\tcb@version{4.30}
+\ProvidesPackage{tcolorbox}[2020/07/31 version 4.31 text color boxes]
+\def\tcb@version{4.31}
\RequirePackage{pgf}[2008/01/15]
\RequirePackage{verbatim}[2003/08/22]
@@ -666,11 +666,11 @@
void/.style={capture=v@@d,capture/.code=,options@for/.code=,code={\def\tcbinputlisting@core{}}},
nirvana/.code={\let\tcb@draw@color@box\@empty},
check odd page/.is if=tcb@checkpage,
- if odd page/.code 2 args={%
+ if odd page/.code n args={2}{%
\tcbset{check odd page}%
\tcbifoddpage{\tcbset{#1}}{\tcbset{#2}}%
},
- if odd page or oneside/.code 2 args={%
+ if odd page or oneside/.code n args={2}{%
\tcbset{check odd page}%
\tcbifoddpageoroneside{\tcbset{#1}}{\tcbset{#2}}%
},
@@ -828,7 +828,7 @@
{\edef\ftype@tcbfloat{\the\c@float@type}%
\addtocounter{float@type}{\value{float@type}}}%
\def\c@tcbfloat{\c@float@type}% tricking the caption package
-\ifdim\parskip>\z@%
+\ifdim\parskip>\z@\relax%
\tcbset{autoparskip/.style=parskip}%
\else%
\tcbset{autoparskip/.style=noparskip}%
@@ -1043,7 +1043,7 @@
\newbox\tcb@temp%
\cslet{tcb@footnote@\romannumeral\c@tcblayer}{\tcb@temp}%
\tcbset{every box on layer \number\c@tcblayer/.style={reset,every box}}
- \ifnum\c@tcblayer<#1\repeat%
+ \ifnum\c@tcblayer<#1 \repeat%
\else%
\fi%
\xdef\tcb@managed@layers@max{#1}%
@@ -1061,12 +1061,12 @@
\def\tcb@layer@inc{%
\tcb@count@boxes%
\stepcounter{tcblayer}%
- \ifnum\c@tcblayer>1%
+ \ifnum\c@tcblayer>1\relax%
\tcbset{breakable@true/.code=}%
\else%
\ifinner\ifhmode\tcbset{breakable@true/.code=}\fi\fi%
\fi%
- \ifnum\c@tcblayer>\tcb@managed@layers@max%
+ \ifnum\c@tcblayer>\tcb@managed@layers@max\relax%
\tcbset{every box on higher layers}%
\else%
\expandafter\setbox\csname tcb@footnote@\romannumeral\c@tcblayer\endcsname\box\@mpfootins%
@@ -1079,12 +1079,12 @@
\tcb@count@boxes%
\global\advance\c@tcolorbox@number by -1\relax%
\stepcounter{tcblayer}%
- \ifnum\c@tcblayer>1%
+ \ifnum\c@tcblayer>1\relax%
\tcbset{breakable@true/.code=}%
\else%
\ifinner\ifhmode\tcbset{breakable@true/.code=}\fi\fi%
\fi%
- \ifnum\c@tcblayer>\tcb@managed@layers@max%
+ \ifnum\c@tcblayer>\tcb@managed@layers@max\relax%
\tcbset{every box on higher layers}%
\tcbset{every box on higher layers/.code=}%
\else%
@@ -1095,7 +1095,7 @@
}
\def\tcb@layer@dec{%
- \ifnum\c@tcblayer>\tcb@managed@layers@max%
+ \ifnum\c@tcblayer>\tcb@managed@layers@max\relax%
\else%
\expandafter\global\setbox\@mpfootins\box\csname tcb@footnote@\romannumeral\c@tcblayer\endcsname%
\setcounter{mpfootnote}{\csname tcb@footnote@cnt@\romannumeral\c@tcblayer\endcsname}%
@@ -1179,22 +1179,31 @@
\immediate\write\@auxout{\string\csgdef{tcb@space@#1}{#2}}%
}
-\def\tcb@ch@fixed@spacesave{%
- \tcbdimto\tcb@space{\tcb@space+\tcbheightspace}%
- \ifdim\dimexpr\tcb@space<0pt\relax
- \let\tcb@space\tcb@zpt%
- \else%
- \ifdim\dimexpr\tcb@space>\tcb@height\relax
- \let\tcb@space\tcb@height%
- \fi%
- \fi%
- \begingroup\edef\x{\endgroup\noexpand\tcb@savespace{\thetcolorboxnumber}{\tcb@space}}\x%
- \tcbdimto\tcb@height@upper{\ht\tcb@upperbox+\dp\tcb@upperbox+\tcbheightspace}%
- \let\tcbheightspace\tcb@zpt%
- \iftcb@lowerspace%
- \tcbdimto\tcb@height@lower{\ht\tcb@lowerbox+\dp\tcb@lowerbox}%
- \fi%
-}
+
+\ExplSyntaxOn
+\def\tcb@ch@fixed@spacesave
+ {
+ \fp_set:Nn \l_tmpa_fp { \tcb@space+\tcbheightspace }
+ \fp_compare:nTF { \l_tmpa_fp < 0 }
+ {
+ \fp_zero_new:N \l_tmpa_fp
+ }
+ {
+ \fp_compare:nT { \l_tmpa_fp > \tcb@height }
+ {
+ \fp_set:Nn \l_tmpa_fp { \tcb@height }
+ }
+ }
+ \tcbdimto\tcb@space { \fp_to_dim:n { trunc(\l_tmpa_fp,2) } }
+ \use:x { \exp_not:N\tcb@savespace{\thetcolorboxnumber}{\tcb@space} }
+ \tcbdimto\tcb@height@upper{\ht\tcb@upperbox+\dp\tcb@upperbox+\tcbheightspace}
+ \let\tcbheightspace\tcb@zpt
+ \iftcb@lowerspace
+ \tcbdimto\tcb@height@lower{\ht\tcb@lowerbox+\dp\tcb@lowerbox}
+ \fi
+ }
+\ExplSyntaxOff
+
\def\tcb@ch@fixed@split{%
\tcbdimto\tcb@height@space{\tcbheightspace+\ht\tcb@upperbox+\dp\tcb@upperbox+\ht\tcb@lowerbox+\dp\tcb@lowerbox}%
@@ -1859,8 +1868,8 @@
list type/.store in=\kvtcb@new@listtype,
%
init@hook@clear/.code={\def\kvtcb@init@hook{}},
- crefname/.code 2 args={\begingroup\edef\x{\endgroup\noexpand\crefname{\tcb@new@boxname}}\x{#1}{#2}\tcb@new@label@type},
- Crefname/.code 2 args={\begingroup\edef\x{\endgroup\noexpand\Crefname{\tcb@new@boxname}}\x{#1}{#2}\tcb@new@label@type},
+ crefname/.code n args={2}{\begingroup\edef\x{\endgroup\noexpand\crefname{\tcb@new@boxname}}\x{#1}{#2}\tcb@new@label@type},
+ Crefname/.code n args={2}{\begingroup\edef\x{\endgroup\noexpand\Crefname{\tcb@new@boxname}}\x{#1}{#2}\tcb@new@label@type},
%
blend into/.is choice,%
blend into/figures/.style={use counter*=figure,list inside=lof,/tcb/code={\appto\tcb@new@colopt{,before title={\tcb@blend@beforetitle{\fnum@figure}}}}},%
diff --git a/macros/latex/contrib/tcolorbox/tcolorbox.tex b/macros/latex/contrib/tcolorbox/tcolorbox.tex
index 33791d4810..f159b97142 100644
--- a/macros/latex/contrib/tcolorbox/tcolorbox.tex
+++ b/macros/latex/contrib/tcolorbox/tcolorbox.tex
@@ -1,5 +1,5 @@
% \LaTeX-Main\
-%% The LaTeX package tcolorbox - version 4.30 (2020/04/28)
+%% The LaTeX package tcolorbox - version 4.31 (2020/07/31)
%% tcolorbox.tex: Manual
%%
%% -------------------------------------------------------------------------------------------
@@ -31,8 +31,8 @@
\tcbEXTERNALIZE
\usepackage{tcolorbox.doc.s_snippet}
%\tcbset{external/PassOptionsToPackage={cache=false}{minted}}
-\ShellEscape{mkdir external}
-\ShellEscape{mkdir solutions}
+\tcbAUXmkdir{external}
+\tcbAUXmkdir{solutions}
\RequirePackage{csquotes}
\RequirePackage[style=numeric-comp,sorting=nyt,
@@ -43,8 +43,8 @@
\setlength{\bibitemsep}{\smallskipamount}
\addbibresource{tcolorbox.doc.bib}
-\def\version{4.30}%
-\def\datum{2020/04/28}%
+\def\version{4.31}%
+\def\datum{2020/07/31}%
\makeindex
\hypersetup{
@@ -62,7 +62,7 @@
%\geometry{showframe}
%\tcbset{draftmode}
\tcbset{/tcb/external/-}% for final run
-%\includeonly{tcolorbox.doc.picturecredits}
+%\includeonly{tcolorbox.doc.external}
%\hypersetup{colorlinks=false}