diff options
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r-- | macros/latex/contrib/csassignments/csassignments.dtx | 9 | ||||
-rw-r--r-- | macros/latex/contrib/csassignments/csassignments.pdf | bin | 134810 -> 142906 bytes | |||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix-french.pdf | bin | 507325 -> 511876 bytes | |||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix-french.tex | 104 | ||||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.dtx | 894 | ||||
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.pdf | bin | 1564304 -> 1296290 bytes |
6 files changed, 740 insertions, 267 deletions
diff --git a/macros/latex/contrib/csassignments/csassignments.dtx b/macros/latex/contrib/csassignments/csassignments.dtx index 1be6fcaf47..7c52fd94d7 100644 --- a/macros/latex/contrib/csassignments/csassignments.dtx +++ b/macros/latex/contrib/csassignments/csassignments.dtx @@ -30,7 +30,7 @@ %</driver> % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{csassignments}[2022/06/01 v1.0.0 Assignments Class for CS] +\ProvidesClass{csassignments}[2022/07/28 v1.0.2 Assignments Class for CS] % \end{macrocode} % %<*driver> @@ -73,6 +73,7 @@ % % \changes{v1.0.0}{2022/06/01}{Publish class with documentation} % \changes{v1.0.1}{2022/06/07}{Rename class to not collide with existing assignments class} +% \changes{v1.0.2}{2022/07/28}{Fix a bug where verb+\ClassWarning+ lacked the right number of arguments} % % \GetFileInfo{csassignments.cls} % @@ -82,7 +83,7 @@ % \maketitle % \tableofcontents % -% \StopEventually{} ^^A +% \StopEventually{} ^^A % % \section{Introduction} % @@ -279,8 +280,8 @@ \end{tabular} \renewcommand{\arraystretch}{1}% \end{table} - }{\texttt{Compile again}\ClassWarning{Compile again to properly - display grading table}} + }{\texttt{Compile again}\ClassWarning{csassignments}{Compile again to % + properly display grading table}} } % \end{macrocode} % \end{macro} diff --git a/macros/latex/contrib/csassignments/csassignments.pdf b/macros/latex/contrib/csassignments/csassignments.pdf Binary files differindex 43b113f3b8..2f15269f66 100644 --- a/macros/latex/contrib/csassignments/csassignments.pdf +++ b/macros/latex/contrib/csassignments/csassignments.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf Binary files differindex 9ab3697a79..00d091b585 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index 55c66b32d1..c9c6eebe4d 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -15,6 +15,7 @@ \usepackage{enumitem} \usepackage{siunitx} \usepackage{verbatim} +\usepackage{caption} % We use \MakeShortVerb of shortvrb and not \DefineShortVerb of fancyvrb % because we don't want the contents of short verbatim colored in gray @@ -772,7 +773,7 @@ classiques. 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}). +(il n'y a pas besoin d'utiliser l'extension \pkg{hhline}). \medskip \begin{BVerbatim}[baseline=c,boxwidth=10cm] @@ -1342,9 +1343,8 @@ pointillés.\footnote{Néanmoins, l'utilisateur peut écraser ces définitions d \end{BVerbatim} \bigskip -Dans les environnements de \pkg{nicematrix}, il est donc possible d'utiliser les -commandes |\hdottedline| et |\cdottedline| pour tracer des filets horizontaux en -pointillés. +Il est donc possible d'utiliser les commandes |\hdottedline| et |\cdottedline| +pour tracer des filets horizontaux en pointillés. \medskip \begin{BVerbatim}[baseline=c,boxwidth=9.5cm] @@ -1352,7 +1352,7 @@ pointillés. 1 & 2 & 3 & 4 & 5 \\ ~emphase#\hdottedline@ 6 & 7 & 8 & 9 & 10 \\ - emphase#\cdottedline{1,4-5}@ +~emphase#\cdottedline{1,4-5}@ 11 & 12 & 13 & 14 & 15 \end{pNiceMatrix} \end{BVerbatim} @@ -1447,12 +1447,9 @@ successives.\footnote{Si vous utilisez Overleaf, Overleaf effectue \medskip L'extension \pkg{nicematrix} fournit une clé |code-before| pour du code qui sera -exécuté avant le tracé du tableau. - -\smallskip -Une syntaxe alternative est proposée : on peut placer le contenu de ce -|code-before| entre les mots-clés |\CodeBefore| et |\Body| juste au début de -l'environnement. +exécuté avant le tracé du tableau. Une syntaxe alternative est proposée : on +peut placer le contenu de ce |code-before| entre les mots-clés |\CodeBefore| et +|\Body| juste au début de l'environnement. \begin{Verbatim} \begin{pNiceArray}{~textsl#preamble@} @@ -3322,10 +3319,36 @@ $\begin{pNiceMatrix} \end{pNiceMatrix}$ -\section{Les notes dans les tableaux} +\section{Les légendes et les notes dans les tableaux} \label{s:notes} +\subsection{La légendes des tableaux} + +\colorbox{yellow!50}{\bfseries Nouveau 6.12}\enskip L'environnement +|{NiceTabular}| proposent des clés |caption|, |short-caption| et |label| à +utiliser lorsque le tableau est inséré dans un environnment flottant +(typiquement un environnement |{table}|). + +\smallskip +L'intérêt d'utiliser cette clé |caption| plutôt que la commande classique +|\caption| est que la légende, si elle longue, est justifiée à la largeur du +tableau (sans avoir à utiliser l'extension \pkg{threeparttable} ou l'extension +\pkg{floatrow}). + +\smallskip +Par défaut, la légende est placée au-dessous du tableau. Pour avoir la légence +placée au-dessus, il convient d'utiliser la clé |caption-above| dans +|\NiceMatrixOptions|. + +\smallskip +La clé |short-caption| correspond à l'argument optionnel de la commande +classique |\caption| et la clé |label| correspond bien sûr à la commande |\label|. + +\smallskip +Voir table \ref{t:tabularnote}, p.~\pageref{t:tabularnote} un exemple +d'utilisation des clés |caption| et |label|. + \subsection{Les notes de pied de page} \smallskip @@ -3409,7 +3432,10 @@ Dupont & Chantal & 15 janvier 1998 \\ \begin{itemize} \item La commande |\tabularnote| est en fait utilisable avant l'environnement de \pkg{nicematrix}, le but étant de pouvoir l'utiliser sur le -titre inséré par |\caption| dans un environnement |{table}| de LaTeX. +titre inséré par |\caption| dans un environnement |{table}| de LaTeX (ou dans la +commande |\captionof| de l'extension \pkg{caption}). Sans surprise, il est +également possible de l'utiliser dans la légende rentrée avec la clé |caption| +de l'environnement |{NiceTabular}|. \item Si plusieurs commandes |\tabularnote{...}| se suivent \emph{sans aucun espace entre elles}, les appels de notes correspondants sont composés ensemble, @@ -3431,30 +3457,35 @@ des notes avant les notes numérotées. \pkg{nicematrix}), la clé |notes/bottomrule| permet de faire tracer un |\bottomrule| de \pkg{booktabs} \emph{après} les notes. -\item \colorbox{yellow!50}{\textbf{Nouveau 6.8}}\enskip Lorsque plusieurs -commandes |\tabularnote| sont utilisées avec le même argument, une seule note -est insérée en fin de tableau (mais tous les labels sont marqués). Il est -possible de désactiver cette fonctionnalité avec la clé -|notes/detect-duplicates| +\item Lorsque plusieurs commandes |\tabularnote| sont utilisées avec le même +argument, une seule note est insérée en fin de tableau (mais tous les labels +sont marqués). Il est possible de désactiver cette fonctionnalité avec la clé +|notes/detect-duplicates|.\footnote{Pour des raisons techniques, il n'est pas + autorisé de mettre des |\tabularnote| avec exactement le même argument dans la + légende.} \item Il est possible de référencer une note de tableau (avec la commande |\label| placée après le |\tabularnote|). \end{itemize} % Voir sur la table \ref{t:tabularnote}, p.~\pageref{t:tabularnote}, certaines de ces -remarques illustrées. Cette table a été composée avec le code suivant. +remarques illustrées. Cette table a été composée avec le code suivant +(l'extension \pkg{caption} a été chargée dans ce document). \begin{center} \fvset{commandchars=\~\#\!} \begin{Verbatim}[formatcom=\small\color{gray}] \begin{table} -\setlength{\belowcaptionskip}{1ex} \centering -\caption{Utilisation de \texttt{\textbackslash - tabularnote}~emphase#\tabularnote{On peut mettre une note dans le titre.}!} -\label{t:tabularnote} +\NiceMatrixOptions{caption-above} \begin{NiceTabular}{@{}llc@{}}% - [~emphase#notes/bottomrule!, tabularnote = Un peu de texte avant les notes.] + [ + caption = Un tableau dont la légende a été rentrée avec la clé \texttt{caption} + ~emphase#\tabularnote{On peut mettre une note dans la légende.}! , + label = t:tabularnote , + tabularnote = Un peu de texte avant les notes. , + notes/bottomrule + ] \toprule Nom & Prénom & Durée de vie \\ \midrule @@ -3471,14 +3502,17 @@ Wallis & John & 87 \\ \end{Verbatim} \end{center} -\begin{table}[hb] -\setlength{\belowcaptionskip}{1ex} +\begin{table}[hbt] \centering -\caption{Utilisation de \texttt{\textbackslash tabularnote}\tabularnote{On peut - mettre une note dans le titre.}} -\label{t:tabularnote} +\NiceMatrixOptions{caption-above} \begin{NiceTabular}{@{}llc@{}}% - [notes/bottomrule, tabularnote = Un peu de texte avant les notes.] + [ + caption = Un tableau dont la légende a été rentrée avec la clé \texttt{caption} + \tabularnote{On peut mettre une note dans la légende.} , + label = t:tabularnote, + tabularnote = Un peu de texte avant les notes. , + notes/bottomrule + ] \toprule Nom & Prénom & Durée de vie \\ \midrule @@ -4637,7 +4671,7 @@ 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|. +utilise explicitement la variable publique |\g_nicematrix_code_before_tl|. \begin{scope} @@ -4653,7 +4687,7 @@ utilise explicitement la variable publique |\g_nicematrix_code_after_tl|. \NewDocumentCommand \crossbox { ! O { } } { - \tl_gput_right:Nx §emphase¤\g_nicematrix_code_after_tlμ + \tl_gput_right:Nx §emphase¤\g_nicematrix_code_before_tlμ { \__pantigny_crossbox:nnn { \int_use:c { c@iRow } } @@ -4677,7 +4711,7 @@ utilise explicitement la variable publique |\g_nicematrix_code_after_tl|. \NewDocumentCommand \crossbox { ! O { } } { - \tl_gput_right:Nx \g_nicematrix_code_after_tl + \tl_gput_right:Nx \g_nicematrix_code_before_tl { \__pantigny_crossbox:nnn { \int_use:c { c@iRow } } @@ -4710,9 +4744,7 @@ mante & raie & poule \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. - - +l'extension \pkg{underscore}. \subsection{Lignes diagonales} diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index 70db98bb3e..1f39dbe880 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{6.11} -\def\myfiledate{2022/07/16} +\def\myfileversion{6.12} +\def\myfiledate{2022/07/28} % % %<*batchfile> @@ -56,6 +56,7 @@ version 2005/12/01 or later. \usetikzlibrary{fit,patterns,arrows.meta,decorations.pathmorphing} \usepackage{nicematrix} \usepackage{siunitx} +\usepackage{caption} \usepackage{varwidth} \usepackage[auto-lang=false]{lipsum} @@ -806,7 +807,7 @@ version 2005/12/01 or later. % 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}). +% (there is no need to use the package~\pkg{hhline}). % % \bigskip % \begin{BVerbatim}[baseline=c,boxwidth=10cm] @@ -1359,7 +1360,7 @@ version 2005/12/01 or later. % 1 & 2 & 3 & 4 & 5 \\ % ~emphase#\hdottedline@ % 6 & 7 & 8 & 9 & 10 \\ -% emphase#\cdottedline{1,4-5}@ +% ~emphase#\cdottedline{1,4-5}@ % 11 & 12 & 13 & 14 & 15 % \end{pNiceMatrix} % \end{BVerbatim} @@ -3283,10 +3284,37 @@ version 2005/12/01 or later. % % % -% \section{The notes in the tabulars} +% \section{Captions and notes in the tabulars} % % \label{s:notes} % +% \subsection{Caption of a tabular} +% +% \smallskip +% \colorbox{yellow!50}{\bfseries New 6.12}\enskip The environment +% |{NiceTabular}| provides the keys |caption|, |short-caption| and |label| which +% may be used when the tabular is inserted in a floating environment (typically +% the environment |{table}|). +% +% \smallskip +% With the key |caption|, the caption, when it is long, is wrapped at the width +% of the tabular (without the use of the package \pkg{threeparttable} or the +% package \pkg{floatrow}). +% +% \smallskip +% By default, the caption is composed below the tabular. With the key +% |caption-above|, available in |\NiceMatrixOptions|, the caption will be +% composed above de tabular. +% +% \smallskip +% The key |short-caption| corresponds to the optional argument of the clasical +% command |\caption| and the key |label| corresponds, of course, to the command +% |\label|. +% +% \smallskip +% See table \ref{t:tabularnote}, p.~\pageref{t:tabularnote} for an example of +% use the keys |caption| and |label|. +% % \subsection{The footnotes} % % \smallskip @@ -3296,8 +3324,6 @@ version 2005/12/01 or later. % with the other notes of the document. % % \smallskip -% -% \smallskip % If \pkg{nicematrix} is loaded with the option |footnote| (with % |\usepackage[footnote]{nicematrix}| or with |\PassOptionsToPackage|), the % package \pkg{footnote} is loaded (if it is not yet loaded) and it is used to @@ -3388,13 +3414,17 @@ version 2005/12/01 or later. % % \item The command |\tabularnote| may be used \emph{before} % the environment of \pkg{nicematrix}. Thus, it's possible to use it on the -% title inserted by |\caption| in an environment |{table}| of LaTeX. -% -% \colorbox{yellow!50}{\textbf{New 6.8}}\enskip If several commands -% |\tabularnote| are used in a tabular with the same argument, only one note is -% inserted at the end of the tabular (but all the labels are composed, of -% course). It's possible to control that feature with the key -% |notes/detect-duplicates|. +% title inserted by |\caption| in an environment |{table}| of LaTeX (or in a +% command |\captionof| of the package \pkg{caption}). It's also possible, as +% expected, to use the command |\tabularnote| in the caption provided by the +% \emph{key} |caption| of the environment |{NiceTabaular}|. +% +% If several commands |\tabularnote| are used in a tabular with the same +% argument, only one note is inserted at the end of the tabular (but all the +% labels are composed, of course). It's possible to control that feature with +% the key |notes/detect-duplicates|.\footnote{For technical reasons, the final +% user is not allowed to put several commands |\tabularnote| with exactly the +% same argument in the caption of the tabular.} % % \item It's possible to create a reference to a tabular note created by |\tabularnote| % (with the usual command |\label| used after the |\tabularnote|). @@ -3402,19 +3432,22 @@ version 2005/12/01 or later. % % % For an illustration of some of those remarks, see table % \ref{t:tabularnote}, p.~\pageref{t:tabularnote}. This table has been composed -% with the following code. +% with the following code (the package \pkg{caption} has been loaded in this document). % % \begin{center} % \fvset{commandchars=\~\#\!} % \begin{Verbatim}[formatcom=\small\color{gray}] % \begin{table} -% \setlength{\belowcaptionskip}{1ex} % \centering -% \caption{Use of \texttt{\textbackslash tabularnote}~emphase#\tabularnote{It's possible! -% ~emphase#to put a note in the caption.}}! -% \label{t:tabularnote} +% \NiceMatrixOptions{caption-above} % \begin{NiceTabular}{@{}llc@{} -% [~emphase#notes/bottomrule!, tabularnote = Some text before the notes.] +% [ +% caption = A tabular whose caption has been specified by the key +% \texttt{caption}~emphase#\tabularnote{It's possible to put a tabular note in the caption}! , +% label = t:tabularnote , +% tabularnote = Some text before the notes. , +% notes/bottomrule +% ] % \toprule % Last name & First name & Length of life \\ % \midrule @@ -3432,14 +3465,16 @@ version 2005/12/01 or later. % \end{center} % % -% \begin{table}[hb] -% \setlength{\belowcaptionskip}{1ex} +% \begin{table}[hbt] % \centering -% \caption{Use of \texttt{\textbackslash tabularnote}\tabularnote{It's possible -% to put a note in the caption.}} -% \label{t:tabularnote} -% \begin{NiceTabular}{@{}llc@{}}[notes/bottomrule, -% tabularnote = Some text before the notes.] +% \NiceMatrixOptions{caption-above} +% \begin{NiceTabular}{@{}llc@{}}[ +% caption = A tabular whose caption has been specified by the key +% \texttt{caption}\tabularnote{It's possible to put a tabular note in the caption} , +% label = t:tabularnote , +% tabularnote = Some text before the notes. , +% notes/bottomrule +% ] % \toprule % Last name & First name & Length of life \\ % \midrule @@ -4572,7 +4607,7 @@ version 2005/12/01 or later. % Tikz before the drawing. % % It's possible to program such command |\crossbox| as follows, explicitely -% using the public variable |\g_nicematrix_code_after_tl|. +% using the public variable |\g_nicematrix_code_before_tl|. % % \begin{scope} % \fvset{commandchars=\§\¤\μ} @@ -4587,7 +4622,7 @@ version 2005/12/01 or later. % % \NewDocumentCommand \crossbox { ! O { } } % { -% \tl_gput_right:Nx §emphase¤\g_nicematrix_code_after_tlμ +% \tl_gput_right:Nx §emphase¤\g_nicematrix_code_before_tlμ % { % \__pantigny_crossbox:nnn % { \int_use:c { c@iRow } } @@ -4611,7 +4646,7 @@ version 2005/12/01 or later. % % \NewDocumentCommand \crossbox { ! O { } } % { -% \tl_gput_right:Nx \g_nicematrix_code_after_tl +% \tl_gput_right:Nx \g_nicematrix_code_before_tl % { % \__pantigny_crossbox:nnn % { \int_use:c { c@iRow } } @@ -4642,7 +4677,7 @@ version 2005/12/01 or later. % % \section{Technical remarks} % -% +% First remark: the package \pkg{underscore} must be loaded before \pkg{nicematrix}. % % \subsection{Diagonal lines} % @@ -5773,6 +5808,7 @@ version 2005/12/01 or later. % \bigskip % \begin{macrocode} \cs_new_protected:Npn \@@_error:n { \msg_error:nn { nicematrix } } +\cs_new_protected:Npn \@@_warning:n { \msg_warning:nn { nicematrix } } \cs_new_protected:Npn \@@_error:nn { \msg_error:nnn { nicematrix } } \cs_generate_variant:Nn \@@_error:nn { n x } \cs_new_protected:Npn \@@_error:nnn { \msg_error:nnnn { nicematrix } } @@ -5794,7 +5830,15 @@ version 2005/12/01 or later. { \msg_new:nnnn { nicematrix } { #1 } { #2 } { #3 } } } % \end{macrocode} -% +% +% \bigskip +% We also create a command which will genereate usually an error but only a +% warning on Overleaf. The argument is given by currification. +% \begin{macrocode} +\cs_new_protected:Npn \@@_error_or_warning:n + { \bool_if:NTF \c_@@_messages_for_Overleaf_bool \@@_warning:n \@@_error:n } +% \end{macrocode} +% % We try to detect whether the compilation is done on Overleaf. We use % |\c_sys_jobname_str| because, with Overleaf, the value of |\c_sys_jobname_str| % is always ``|output|''. @@ -5807,6 +5851,23 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_msg_redirect_name:nn { \msg_redirect_name:nnn { nicematrix } } +\cs_new_protected:Npn \@@_gredirect_none:n #1 + { + \group_begin: + \globaldefs = 1 + \@@_msg_redirect_name:nn { #1 } { none } + \group_end: + } +\cs_new_protected:Npn \@@_err_gredirect_none:n #1 + { + \@@_error:n { #1 } + \@@_gredirect_none:n { #1 } + } +\cs_new_protected:Npn \@@_warning_gredirect_none:n #1 + { + \@@_warning:n { #1 } + \@@_gredirect_none:n { #1 } + } % \end{macrocode} % % @@ -5829,9 +5890,6 @@ version 2005/12/01 or later. \@ifpackageloaded { varwidth } { \bool_const:Nn \c_@@_varwidth_loaded_bool { \c_true_bool } } { \bool_const:Nn \c_@@_varwidth_loaded_bool { \c_false_bool } } - \@ifpackageloaded { arydshln } - { \bool_const:Nn \c_@@_arydshln_loaded_bool { \c_true_bool } } - { \bool_const:Nn \c_@@_arydshln_loaded_bool { \c_false_bool } } \@ifpackageloaded { booktabs } { \bool_const:Nn \c_@@_booktabs_loaded_bool { \c_true_bool } } { \bool_const:Nn \c_@@_booktabs_loaded_bool { \c_false_bool } } @@ -5841,7 +5899,9 @@ version 2005/12/01 or later. \@ifpackageloaded { tabularx } { \bool_const:Nn \c_@@_tabularx_loaded_bool { \c_true_bool } } { \bool_const:Nn \c_@@_tabularx_loaded_bool { \c_false_bool } } - { } + \@ifpackageloaded { floatrow } + { \bool_const:Nn \c_@@_floatrow_loaded_bool { \c_true_bool } } + { \bool_const:Nn \c_@@_floatrow_loaded_bool { \c_false_bool } } \@ifpackageloaded { tikz } { % \end{macrocode} @@ -6262,6 +6322,14 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip +% If, in a tabular, there is a tabular note in a caption that must be composed +% \emph{above} the tabular, we will store in |\l_@@_note_in_caption_int| the +% number of notes in that caption. It will be stored in the |aux| file. +% \begin{macrocode} +\int_new:N \l_@@_note_in_caption_int +% \end{macrocode} +% +% \bigskip % The dimension |\l_@@_columns_width_dim| will be used when the options specify % that all the columns must have the same width (but, if the key |columns-width| % is used with the special value |auto|, the boolean @@ -6413,6 +6481,10 @@ version 2005/12/01 or later. % \begin{macrocode} \bool_new:N \l_@@_X_column_bool % \end{macrocode} +% +% \begin{macrocode} +\bool_new:N \g_@@_caption_finished_bool +% \end{macrocode} % % \bigskip % We will write in |\g_@@_aux_tl| all the instructions that we have to write on @@ -6645,7 +6717,13 @@ version 2005/12/01 or later. \bool_new:N \g_@@_empty_cell_bool % \end{macrocode} % -% +% \bigskip +% The following boolean will be used to deal with the commands |\tabularnote| in +% the caption (command |\caption| or key |caption|). +% \begin{macrocode} +\bool_new:N \g_@@_second_composition_bool +% \end{macrocode} +% % \bigskip % The following dimensions will be used internally to compute the width of the % potential ``first column'' and ``last column''. @@ -6859,6 +6937,13 @@ version 2005/12/01 or later. \bool_new:N \l_@@_dotted_bool % \end{macrocode} % +% \bigskip +% The following flag will be set to true during the composition of a caption +% specified (by the key |caption|). +% \begin{macrocode} +\bool_new:N \l_@@_in_caption_bool +% \end{macrocode} +% % % \bigskip % \textbf{Variables for the exterior rows and columns}\par\nobreak @@ -6993,6 +7078,38 @@ version 2005/12/01 or later. % \subsection*{The command \textbackslash tabularnote} % % \bigskip +% Of course, it's possible to use |\tabularnote| in the main tabular. But there +% is also the possibility to use that command in the caption of the tabular. And +% the caption may be specified by two means: +% +% \begin{itemize} +% \item The caption may of course be provided by the command |\caption| in a +% floating environment. Of course, a command |\tabularnote| in that |\caption| +% makes sens only if the |\caption| is \emph{before} the |{tabular}|. +% \item It's also possible to use |\tabularnote| in the value of the key +% |caption| of the |{NiceTabular}| when the key |caption-above| is in force. +% However, in that case, one must remind that the caption is composed +% \emph{after} the composition of the box which contains the main tabular +% (that's mandatory since that caption must be wrapped with a line width equal +% to the width ot the tabular). However, we want the labels of the successive +% tabular notes in the logical order. That's why: +% \begin{itemize} +% \item The number of tabular notes present in the caption will be written on +% the |aux| file and available in |\l_@@_note_in_caption_int|. +% \item During the composition of the main tabular, the tabular notes will be +% numbered from |\l_@@_note_in_caption_int|+1 and the notes will be stored in +% |\g_@@_notes_seq|. +% \item During the composition of the caption (value of |\l_@@_caption_tl|), the +% tabular notes will be numbered from $1$ to |\l_@@_note_in_caption_int| and the +% notes themselves will be stored in |\g_@@_notes_in_caption_seq|. +% \item After the composition of the main tabular and after the composition of +% the caption, the sequences |\g_@@_notes_in_caption_seq| and |\g_@@_notes_seq| +% will be merged (in that order) and the notes will be composed. +% \end{itemize} +% \end{itemize} +% +% +% \bigskip % The LaTeX counter |tabularnote| will be used to count the tabular notes during % the construction of the array (this counter won't be used during the % composition of the notes at the end of the array). You use a LaTeX counter @@ -7002,14 +7119,13 @@ version 2005/12/01 or later. \newcounter { tabularnote } % \end{macrocode} % -% \bigskip -% We will store in the following sequence the tabular notes of a given array. % \begin{macrocode} -\seq_new:N \g_@@_tabularnotes_seq +\seq_new:N \g_@@_notes_seq +\seq_new:N \g_@@_notes_in_caption_seq % \end{macrocode} % % \bigskip -% However, before the actual tabular notes, it's possible to put a text +% Before the actual tabular notes, it's possible to put a text % specified by the key |tabularnote| of the environment. The token list % |\l_@@_tabularnote_tl| corresponds to the value of that key. % \begin{macrocode} @@ -7017,12 +7133,11 @@ version 2005/12/01 or later. % \end{macrocode} % % \bigskip +% We prepare the tools for the formatting of the references of the footnotes (in +% the tabular itself). There may have several references of footnote at the same +% point and we have to take into account that point. % \begin{macrocode} \seq_new:N \l_@@_notes_labels_seq -% \end{macrocode} -% -% \bigskip -% \begin{macrocode} \newcounter{nicematrix_draft} \cs_new_protected:Npn \@@_notes_format:n #1 { @@ -7052,7 +7167,7 @@ version 2005/12/01 or later. % % \bigskip % We define |\thetabularnote| because it will be used by LaTeX if the user want -% to reference a footnote which has been marked by a |\label|. The TeX group is +% to reference a tabular which has been marked by a |\label|. The TeX group is % for the case where the user has put an instruction such as |\color{red}| in % |\@@_notes_style:n|. % \begin{macrocode} @@ -7073,7 +7188,10 @@ version 2005/12/01 or later. \bool_if:nTF { ! \c_@@_enumitem_loaded_bool } { \NewDocumentCommand \tabularnote { m } - { \@@_error:n { enumitem~not~loaded } } + { + \@@_error_or_warning:n { enumitem~not~loaded } + \@@_gredirect_none:n { enumitem~not~loaded } + } } { % \end{macrocode} @@ -7102,86 +7220,149 @@ version 2005/12/01 or later. } % \end{macrocode} % -% \medskip -% The command |\tabularnote| is available in the whole document (and not only in -% the environments of \pkg{nicematrix}) because we want it to be available in -% the caption of a |{table}| (before the following |{NiceTabular}| or -% |{NiceArray}|). That's also the reason why the variables |\c@tabularnote| and -% |\g_@@_tabularnotes_seq| will be cleared at the end of the environment of -% \pkg{nicematrix} (and not at the beginning). -% +% \bigskip +% One must remind that we have allowed a |\tabular| in the caption and +% that caption may also be found in the list of tables (|\listoftables|). We +% want the command |\tabularnote| be no-op during the composition of that list. +% That's why we program |\tabularnote| to be no-op excepted in a floating +% environment or in an environment of \pkg{nicematrix}. % \begin{macrocode} \NewDocumentCommand \tabularnote { m } { - \bool_if:nTF { ! \g_@@_NiceArray_bool && \l_@@_in_env_bool } - { \@@_error:n { tabularnote~forbidden } } - { + \bool_if:nT { \cs_if_exist_p:N \@captype || \l_@@_in_env_bool } + { + \bool_if:nTF { ! \g_@@_NiceArray_bool && \l_@@_in_env_bool } + { \@@_error:n { tabularnote~forbidden } } + { + \bool_if:NTF \l_@@_in_caption_bool + { \@@_tabularnote_ii:n { #1 } } + { \@@_tabularnote_i:n { #1 } } + } + } + } +% \end{macrocode} +% +% \bigskip +% For the version in normal conditions, that is to say not in the key |caption|. +% \begin{macrocode} + \cs_new_protected:Npn \@@_tabularnote_i:n #1 + { % \end{macrocode} % You have to see whether the argument of |\tabularnote| has yet been used as % argument of another |\tabularnote| in the same tabular. In that case, there % will be only one note (for both commands |\tabularnote|) at the end of the % tabular. We search the argument of our command |\tabularnote| in the -% |\g_@@_tabularnotes_seq|. The position in the sequence will be stored in +% |\g_@@_notes_seq|. The position in the sequence will be stored in % |\l_tmpa_int| (0 if the text is not in the sequence yet). % \begin{macrocode} - \int_zero:N \l_tmpa_int - \bool_if:NT \l_@@_notes_detect_duplicates_bool - { - \seq_map_indexed_inline:Nn \g_@@_tabularnotes_seq - { - \tl_if_eq:nnT { #1 } { ##2 } - { \int_set:Nn \l_tmpa_int { ##1 } \seq_map_break: } - } - } - \int_compare:nNnTF \l_tmpa_int = 0 - { - \stepcounter { tabularnote } - \seq_put_right:Nx \l_@@_notes_labels_seq - { \@@_notes_format:n { \int_use:c { c @ tabularnote } } } - \seq_gput_right:Nn \g_@@_tabularnotes_seq { #1 } - } + \int_zero:N \l_tmpa_int + \bool_if:NT \l_@@_notes_detect_duplicates_bool + { + \seq_map_indexed_inline:Nn \g_@@_notes_seq { - \seq_put_right:Nx \l_@@_notes_labels_seq - { \@@_notes_format:n { \int_use:N \l_tmpa_int } } + \tl_if_eq:nnT { #1 } { ##2 } + { \int_set:Nn \l_tmpa_int { ##1 } \seq_map_break: } } - \peek_meaning:NF \tabularnote - { + \int_compare:nNnF \l_tmpa_int = 0 + { \int_add:Nn \l_tmpa_int \l_@@_note_in_caption_int } + } + \int_compare:nNnTF \l_tmpa_int = 0 + { + \int_gincr:N \c@tabularnote + \seq_put_right:Nx \l_@@_notes_labels_seq + { \@@_notes_format:n { \int_use:c { c @ tabularnote } } } + \seq_gput_right:Nn \g_@@_notes_seq { #1 } + } + { + \seq_put_right:Nx \l_@@_notes_labels_seq + { \@@_notes_format:n { \int_use:N \l_tmpa_int } } + } + \peek_meaning:NF \tabularnote + { % \end{macrocode} % If the following token is \emph{not} a |\tabularnote|, we have finished the % sequence of successive commands |\tabularnote| and we have to format the % labels of these tabular notes (in the array). We compose those labels in a box % |\l_tmpa_box| because we will do a special construction in order to have this -% box in a overlapping position if we are at the end of a cell. +% box in an overlapping position if we are at the end of a cell. % \begin{macrocode} - \hbox_set:Nn \l_tmpa_box - { + \hbox_set:Nn \l_tmpa_box + { % \end{macrocode} % We remind that it is the command |\@@_notes_label_in_tabular:n| that will -% (most of the time) put the labels in a |\textsuperscript|. +% put the labels in a |\textsuperscript|. % \begin{macrocode} - \@@_notes_label_in_tabular:n - { - \seq_use:Nnnn - \l_@@_notes_labels_seq { , } { , } { , } - } - } + \@@_notes_label_in_tabular:n + { + \seq_use:Nnnn + \l_@@_notes_labels_seq { , } { , } { , } + } + } % \end{macrocode} -% We use |\refstepcounter| in order to have the (last) tabular note referenceable -% (with the standard command |\label|) and that's why we have to go back with a -% decrementation of the counter |tabularnote| first. +% We want the (last) tabular note referenceable (with the standard command |\label|). % \begin{macrocode} - \addtocounter { tabularnote } { -1 } - \refstepcounter { tabularnote } - \seq_clear:N \l_@@_notes_labels_seq - \hbox_overlap_right:n { \box_use:N \l_tmpa_box } + \int_gsub:Nn \c@tabularnote { 1 } + \int_set_eq:NN \l_tmpa_int \c@tabularnote + \refstepcounter { tabularnote } + \int_compare:nNnT \l_tmpa_int = \c@tabularnote + { \int_gincr:N \c@tabularnote } + \seq_clear:N \l_@@_notes_labels_seq + \hbox_overlap_right:n { \box_use:N \l_tmpa_box } % \end{macrocode} % If the command |\tabularnote| is used exactly at the end of the cell, the % |\unskip| (inserted by \pkg{array}?) will delete the skip we insert now % and the label of the footnote will be composed in an overlapping position (by % design). % \begin{macrocode} - \skip_horizontal:n { \box_wd:N \l_tmpa_box } + \skip_horizontal:n { \box_wd:N \l_tmpa_box } + } + } +% \end{macrocode} +% +% \bigskip +% Now the version when the command is used in the key |caption|. The main +% difficulty is that the argument of the command |\caption| is composed several +% times. In order to know the number of commands |\tabularnote| in the caption, +% we will consider that there should not be the same tabular note twice in the +% caption (in the main tabular, it's possible). Once we have found a tabular +% note which has yet been encoutered, we consider that you are in a new +% composition of the argument of |\caption|. At that time, we store in +% |\g_@@_nb_of_notes_int| the number of notes in the |\caption|. +% \begin{macrocode} + \cs_new_protected:Npn \@@_tabularnote_ii:n #1 + { + \int_gincr:N \c@tabularnote + \bool_if:NTF \g_@@_caption_finished_bool + { + \int_compare:nNnTF + \c@tabularnote > { \tl_count:N \g_@@_notes_in_caption_seq } + { \int_gset:Nn \c@tabularnote { 1 } } + \seq_if_in:NnF \g_@@_notes_in_caption_seq { #1 } + { \@@_fatal:n { Identical~notes~in~caption } } + } + { + \seq_if_in:NnTF \g_@@_notes_in_caption_seq { #1 } + { + \bool_gset_true:N \g_@@_caption_finished_bool + \int_gset:Nn \c@tabularnote { 1 } } + { \seq_gput_right:Nn \g_@@_notes_in_caption_seq { #1 } } + } + \seq_put_right:Nx \l_@@_notes_labels_seq + { \@@_notes_format:n { \int_use:N \c@tabularnote } } + \peek_meaning:NF \tabularnote + { + \hbox_set:Nn \l_tmpa_box + { + \@@_notes_label_in_tabular:n + { + \seq_use:Nnnn + \l_@@_notes_labels_seq { , } { , } { , } + } + } + \seq_clear:N \l_@@_notes_labels_seq + \hbox_overlap_right:n { \box_use:N \l_tmpa_box } + \skip_horizontal:n { \box_wd:N \l_tmpa_box } } } } @@ -7261,6 +7442,24 @@ version 2005/12/01 or later. % \bigskip % \subsection*{The options} % +% The following parameter corresponds to the keys |caption|, |short-caption| and +% |label| of the environment |{NiceTabular}|. +% \begin{macrocode} +\tl_new:N \l_@@_caption_tl +\tl_new:N \l_@@_short_caption_tl +\tl_new:N \l_@@_label_tl +% \end{macrocode} +% +% \bigskip +% The following parameter corresponds to the key |caption-above| of +% |\NiceMatrixOptions|. When this paremeter is |true|, the captions of the +% environments |{NiceTabular}|, specified with the key |caption| are put above +% the tabular (and below elsewhere). +% \begin{macrocode} +\bool_new:N \l_@@_caption_above_bool +% \end{macrocode} +% +% \bigskip % 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 @@ -7679,12 +7878,6 @@ version 2005/12/01 or later. % \begin{macrocode} \keys_define:nn { NiceMatrix / Env } { -% \end{macrocode} -% The key |hvlines-except-corners| is now deprecated (use |hvlines| and -% |corners| instead). -% \begin{macrocode} - hvlines-except-corners .code:n = \@@_fatal:n { hvlines-except-corners } , - hvlines-except-corners .default:n = { NW , SW , NE , SE } , corners .clist_set:N = \l_@@_corners_clist , corners .default:n = { NW , SW , NE , SE } , code-before .code:n = @@ -7847,9 +8040,10 @@ version 2005/12/01 or later. { width .code:n = \dim_set:Nn \l_@@_width_dim { #1 } , width .value_required:n = true , - last-col .code:n = \tl_if_empty:nF { #1 } - { \@@_error:n { last-col~non~empty~for~NiceMatrixOptions } } - \int_zero:N \l_@@_last_col_int , + last-col .code:n = + \tl_if_empty:nF { #1 } + { \@@_error:n { last-col~non~empty~for~NiceMatrixOptions } } + \int_zero:N \l_@@_last_col_int , small .bool_set:N = \l_@@_small_bool , small .value_forbidden:n = true , % \end{macrocode} @@ -7883,7 +8077,7 @@ version 2005/12/01 or later. % % \bigskip % Usually, an error is raised when the user tries to give the same name to two -% distincts environments of \pkg{nicematrix} (theses names are global and not +% distincts environments of \pkg{nicematrix} (these names are global and not % local to the current TeX scope). However, the option |allow-duplicate-names| % disables this feature. % \begin{macrocode} @@ -7897,6 +8091,8 @@ version 2005/12/01 or later. matrix / columns-type .code:n = \@@_set_preamble:Nn \l_@@_columns_type_tl { #1 }, matrix / columns-type .value_required:n = true , + caption-above .bool_set:N = \l_@@_caption_above_bool , + caption-above .default:n = true , unknown .code:n = \@@_error:n { Unknown~key~for~NiceMatrixOptions } } % \end{macrocode} @@ -8006,6 +8202,12 @@ version 2005/12/01 or later. notes / bottomrule .default:n = true , tabularnote .tl_set:N = \l_@@_tabularnote_tl , tabularnote .value_required:n = true , + caption .tl_set:N = \l_@@_caption_tl , + caption .value_required:n = true , + short-caption .tl_set:N = \l_@@_short_caption_tl , + short-caption .value_required:n = true , + label .tl_set:N = \l_@@_label_tl , + label .value_required:n = true , last-col .code:n = \tl_if_empty:nF {#1} { \@@_error:n { last-col~non~empty~for~NiceArray } } \int_zero:N \l_@@_last_col_int , @@ -8027,12 +8229,11 @@ version 2005/12/01 or later. \cs_new_protected:Npn \@@_cell_begin:w { % \end{macrocode} -% The token list |\g_@@_post_action_cell_tl| will be set during the -% composition of the box |\l_@@_cell_box| and will be used \emph{after} the -% composition in order to modify that box (that's why it's called a -% \emph{post-action}). +% |\g_@@_cell_after_hook_tl| will be set during the composition of the box +% |\l_@@_cell_box| and will be used \emph{after} the composition in order to +% modify that box. % \begin{macrocode} - \tl_gclear:N \g_@@_post_action_cell_tl + \tl_gclear:N \g_@@_cell_after_hook_tl % \end{macrocode} % At the beginning of the cell, we link |\CodeAfter| to a command which do % begin with |\\| (whereas the standard version of |\CodeAfter| does @@ -8203,11 +8404,11 @@ version 2005/12/01 or later. \@@_math_toggle_token: \hbox_set_end: % \end{macrocode} -% The token list |\g_@@_post_action_cell_tl| is (potentially) set during the +% The token list |\g_@@_cell_after_hook_tl| is (potentially) set during the % composition of the box |\l_@@_cell_box| and is used now \emph{after} the % composition in order to modify that box. % \begin{macrocode} - \g_@@_post_action_cell_tl + \g_@@_cell_after_hook_tl \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box: \@@_adjust_size_box: % \end{macrocode} @@ -8739,6 +8940,23 @@ version 2005/12/01 or later. \hook_gput_code:nnn { env / tabular / begin } { . } { \cs_set_eq:NN \multicolumn \@@_old_multicolumn } % \end{macrocode} +% If there is one or several commands |\tabularnote| in the caption specified +% by the key |caption| and if that caption has to be composed above the tabular, +% we have now that information because it has been written in the |aux| file at +% a previous run. We use that information to start couting the tabular notes in +% the main array at the right value (that remember that the caption will be +% composed \emph{after} the array!). +% \begin{macrocode} + \tl_if_exist:NT \l_@@_note_in_caption_tl + { + \tl_if_empty:NF \l_@@_note_in_caption_tl + { + \int_set_eq:NN \l_@@_note_in_caption_int + { \l_@@_note_in_caption_tl } + \int_gset:Nn \c@tabularnote { \l_@@_note_in_caption_tl } + } + } +% \end{macrocode} % % % The sequence |\g_@@_multicolumn_cells_seq| will contain the list of the cells @@ -9114,6 +9332,7 @@ version 2005/12/01 or later. } % \end{macrocode} % +% % \begin{macrocode} \NewDocumentCommand \@@_CodeBefore_keys: { O { } } { @@ -9419,7 +9638,7 @@ version 2005/12/01 or later. \bool_if:NT \l_@@_width_used_bool { \int_compare:nNnT \g_@@_total_X_weight_int = 0 - { \@@_error:n { width~without~X~columns } } + { \@@_error_or_warning:n { width~without~X~columns } } } % \end{macrocode} % @@ -9461,7 +9680,7 @@ version 2005/12/01 or later. % \bigskip % It the user has used the key |last-row| with a value, we control that the % given value is correct (since we have just constructed the array, we know the -% real number of rows of the array). +% actual number of rows of the array). % \begin{macrocode} \int_compare:nNnT \l_@@_last_row_int > { -2 } { @@ -9624,13 +9843,7 @@ version 2005/12/01 or later. \bool_if:NF \l_@@_Matrix_bool { \int_compare:nNnT \c@jCol < \g_@@_static_num_of_col_int - { - \@@_error:n { columns~not~used } - \group_begin: - \globaldefs = 1 - \@@_msg_redirect_name:nn { columns~not~used } { none } - \group_end: - } + { \@@_warning_gredirect_none:n { columns~not~used } } } \@@_after_array: % \end{macrocode} @@ -10238,10 +10451,10 @@ version 2005/12/01 or later. \cs_new_protected:Npn \@@_center_cell_box: { % \end{macrocode} -% By putting instructions in |\g_@@_post_action_cell_tl|, we require a +% By putting instructions in |\g_@@_cell_after_hook_tl|, we require a % post-action of the box |\l_@@_cell_box|. % \begin{macrocode} - \tl_gput_right:Nn \g_@@_post_action_cell_tl + \tl_gput_right:Nn \g_@@_cell_after_hook_tl { \int_compare:nNnT { \box_ht:N \l_@@_cell_box } @@ -10281,7 +10494,7 @@ version 2005/12/01 or later. \bool_if:NTF \c_@@_varwidth_loaded_bool { \@@_patch_preamble_iv_iv:nn { #2 } { varwidth } } { - \@@_error:n { varwidth~not~loaded } + \@@_error_or_warning:n { varwidth~not~loaded } \@@_patch_preamble_iv_iv:nn { #2 } { minipage } } } @@ -10543,7 +10756,7 @@ version 2005/12/01 or later. \keys_set:nV { WithArrows / X-column } \l_tmpa_tl \int_compare:nNnT \l_@@_weight_int < 0 { - \@@_error:nx { negative~weight } { \int_use:N \l_@@_weight_int } + \@@_error_or_warning:n { negative~weight } \int_set:Nn \l_@@_weight_int { - \l_@@_weight_int } } \int_gadd:Nn \g_@@_total_X_weight_int \l_@@_weight_int @@ -10568,7 +10781,7 @@ version 2005/12/01 or later. % \end{macrocode} % The following code will nullify the box of the cell. % \begin{macrocode} - \tl_gput_right:Nn \g_@@_post_action_cell_tl + \tl_gput_right:Nn \g_@@_cell_after_hook_tl { \hbox_set:Nn \l_@@_cell_box { } } % \end{macrocode} % We put a |{minipage}| to give to the user the ability to put a command such as @@ -10975,6 +11188,31 @@ version 2005/12/01 or later. % notes (that means that a |\vtop{\hsize=...}| is not enough). % \begin{macrocode} \begin { minipage } [ t ] { \box_wd:N \l_@@_the_array_box } + \bool_if:NT \l_@@_caption_above_bool + { + \tl_if_empty:NF \l_@@_caption_tl + { +% \end{macrocode} +% \begin{macrocode} + \bool_set_false:N \g_@@_caption_finished_bool + \int_gzero:N \c@tabularnote + \@@_insert_caption: +% \end{macrocode} +% If there is one or several commands |\tabularnote| in the caption, we will +% write in the |aux| file the number of such tabular notes. +% \begin{macrocode} + \int_gset:Nn \c@tabularnote + { \seq_count:N \g_@@_notes_in_caption_seq } + \int_compare:nNnF \c@tabularnote = 0 + { + \tl_gput_right:Nx \g_@@_aux_tl + { + \tl_set:Nn \exp_not:N \l_@@_note_in_caption_tl + { \int_eval:n { \c@tabularnote } } + } + } + } + } % \end{macrocode} % The |\hbox| avoids that the |pgfpicture| inside |\@@_draw_blocks| adds a extra % vertical space before the notes. @@ -10998,17 +11236,71 @@ version 2005/12/01 or later. % (because |\ttabbox| de-activate |\stepcounter| because if compiles several % twice its tabular). % \begin{macrocode} - \bool_lazy_or:nnT - { ! \seq_if_empty_p:N \g_@@_tabularnotes_seq } - { ! \tl_if_empty_p:V \l_@@_tabularnote_tl } + \bool_lazy_any:nT + { + { ! \seq_if_empty_p:N \g_@@_notes_seq } + { ! \seq_if_empty_p:N \g_@@_notes_in_caption_seq } + { ! \tl_if_empty_p:V \l_@@_tabularnote_tl } + } \@@_insert_tabularnotes: + \cs_set_eq:NN \tabularnote \@@_tabularnote_error:n + \bool_if:NF \l_@@_caption_above_bool \@@_insert_caption: \end { minipage } } % \end{macrocode} % +% \bigskip +% \begin{macrocode} +\cs_new_protected:Npn \@@_insert_caption: + { + \tl_if_empty:NF \l_@@_caption_tl + { + \cs_if_exist:NTF \@captype + { \@@_insert_caption_i: } + { \@@_error:n { caption~outside~float } } + } + } +% \end{macrocode} +% +% \bigskip +% \begin{macrocode} +\cs_new_protected:Npn \@@_insert_caption_i: + { + \group_begin: +% \end{macrocode} +% The flag |\l_@@_in_caption_bool| affects only the behaviour of the command +% |\tabularnote| when used in the caption. +% \begin{macrocode} + \bool_set_true:N \l_@@_in_caption_bool +% \end{macrocode} +% The package \pkg{floatrow} does a redefinition of |\@makecaption| which will +% extract the caption from the tabular. However, the old version of +% |\@makecaption| has been stored by \pkg{floatrow} in |\FR@makecaption|. That's +% why we restore the old version. +% \begin{macrocode} + \bool_if:NT \c_@@_floatrow_loaded_bool + { \cs_set_eq:NN \@makecaption \FR@makecaption } + \tl_if_empty:NTF \l_@@_short_caption_tl + { \caption { \l_@@_caption_tl } } + { \caption [ \l_@@_short_caption_tl ] { \l_@@_caption_tl } } + \tl_if_empty:NF \l_@@_label_tl { \label { \l_@@_label_tl } } + \group_end: + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_tabularnote_error:n #1 + { + \@@_error_or_warning:n { tabularnote~below~the~tabular } + \@@_gredirect_none:n { tabularnote~below~the~tabular } + } +% \end{macrocode} +% % \begin{macrocode} \cs_new_protected:Npn \@@_insert_tabularnotes: { + \seq_gconcat:NNN \g_@@_notes_seq \g_@@_notes_in_caption_seq \g_@@_notes_seq + \int_set:Nn \c@tabularnote { \seq_count:N \g_@@_notes_seq } \skip_vertical:N 0.65ex % \end{macrocode} % The TeX group is for potential specifications in the @@ -11027,7 +11319,7 @@ version 2005/12/01 or later. \bool_if:NTF \l_@@_notes_para_bool { \begin { tabularnotes* } - \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut + \seq_map_inline:Nn \g_@@_notes_seq { \item ##1 } \strut \end { tabularnotes* } % \end{macrocode} % The following |\par| is mandatory for the event that the user has put @@ -11037,7 +11329,7 @@ version 2005/12/01 or later. } { \tabularnotes - \seq_map_inline:Nn \g_@@_tabularnotes_seq { \item ##1 } \strut + \seq_map_inline:Nn \g_@@_notes_seq { \item ##1 } \strut \endtabularnotes } } @@ -11058,10 +11350,11 @@ version 2005/12/01 or later. % \begin{macrocode} { \CT@arc@ \hrule height \heavyrulewidth } } - { \@@_error:n { bottomrule~without~booktabs } } + { \@@_error_or_warning:n { bottomrule~without~booktabs } } } \l_@@_notes_code_after_tl - \seq_gclear:N \g_@@_tabularnotes_seq + \seq_gclear:N \g_@@_notes_seq + \seq_gclear:N \g_@@_notes_in_caption_seq \int_gzero:N \c@tabularnote } % \end{macrocode} @@ -11928,6 +12221,19 @@ version 2005/12/01 or later. { \dim_set_eq:NN \l_@@_width_dim \linewidth } \str_gset:Nn \g_@@_name_env_str { NiceTabular } \keys_set:nn { NiceMatrix / NiceTabular } { #1 , #3 } + \tl_if_empty:NF \l_@@_short_caption_tl + { + \tl_if_empty:NT \l_@@_caption_tl + { + \@@_error_or_warning:n { short-caption~without~caption } + \tl_set_eq:NN \l_@@_caption_tl \l_@@_short_caption_tl + } + } + \tl_if_empty:NF \l_@@_label_tl + { + \tl_if_empty:NT \l_@@_caption_tl + { \@@_error_or_warning:n { label~without~caption } } + } \bool_set_true:N \l_@@_NiceTabular_bool \NiceArray { #2 } } @@ -13331,7 +13637,6 @@ version 2005/12/01 or later. % \end{itemize} % % -% % \begin{macrocode} \cs_new_protected:Npn \@@_draw_line: { @@ -13339,11 +13644,6 @@ version 2005/12/01 or later. \pgf@relevantforpicturesizefalse \bool_lazy_or:nnTF { \tl_if_eq_p:NN \l_@@_xdots_line_style_tl \c_@@_standard_tl } -% \end{macrocode} -% The boolean |\l_@@_dotted_bool| is raised for the rules specified by either -% |\hdottedline| or |:| (or the letter specified by |letter-for-dotted-lines|) -% in the preamble of the array. -% \begin{macrocode} \l_@@_dotted_bool \@@_draw_standard_dotted_line: \@@_draw_unstandard_dotted_line: @@ -14212,7 +14512,7 @@ version 2005/12/01 or later. { \tl_gput_right:Nx \g_@@_row_style_tl { - \tl_gput_right:Nn \exp_not:N \g_@@_post_action_cell_tl + \tl_gput_right:Nn \exp_not:N \g_@@_cell_after_hook_tl { \dim_set:Nn \l_@@_cell_space_top_limit_dim { \dim_use:N \l_tmpa_dim } @@ -14226,7 +14526,7 @@ version 2005/12/01 or later. { \tl_gput_right:Nx \g_@@_row_style_tl { - \tl_gput_right:Nn \exp_not:N \g_@@_post_action_cell_tl + \tl_gput_right:Nn \exp_not:N \g_@@_cell_after_hook_tl { \dim_set:Nn \l_@@_cell_space_bottom_limit_dim { \dim_use:N \l_tmpb_dim } @@ -14978,7 +15278,8 @@ version 2005/12/01 or later. tikz .initial:n = , total-width .dim_set:N = \l_@@_rule_width_dim , total-width .value_required:n = true , - width .meta:n = { total-width = #1 } + width .meta:n = { total-width = #1 } , + unknown .code:n = \@@_error:n { Unknow~key~for~RulesBis } } % \end{macrocode} % @@ -15096,7 +15397,6 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_vline_ii: { - \bool_set_false:N \l_@@_dotted_bool \keys_set:nV { NiceMatrix / RulesBis } \l_@@_other_keys_tl \bool_if:NTF \l_@@_dotted_bool \@@_vline_iv: @@ -15352,7 +15652,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_hline_ii: { - \bool_set_false:N \l_@@_dotted_bool + % \bool_set_false:N \l_@@_dotted_bool \keys_set:nV { NiceMatrix / RulesBis } \l_@@_other_keys_tl \bool_if:NTF \l_@@_dotted_bool \@@_hline_iv: @@ -15559,9 +15859,10 @@ version 2005/12/01 or later. % % % \medskip -% The command |\@@_Hline:| will be linked to |\Hline| in the environments of \pkg{nicematrix}. +% The command |\@@_Hline:| will be linked to |\Hline| in the environments of +% \pkg{nicematrix}. % \begin{macrocode} -\cs_set:Npn \@@_Hline: { \noalign { \ifnum 0 = `} \fi \@@_Hline_i:n { 1 } } +\cs_set:Npn \@@_Hline: { \noalign \bgroup \@@_Hline_i:n { 1 } } % \end{macrocode} % % \medskip @@ -15571,11 +15872,11 @@ version 2005/12/01 or later. \cs_set:Npn \@@_Hline_i:n #1 { \peek_remove_spaces:n - { - \peek_meaning:NTF \Hline - { \@@_Hline_ii:nn { #1 + 1 } } - { \@@_Hline_iii:n { #1 } } - } + { + \peek_meaning:NTF \Hline + { \@@_Hline_ii:nn { #1 + 1 } } + { \@@_Hline_iii:n { #1 } } + } } % \end{macrocode} % @@ -15584,22 +15885,30 @@ version 2005/12/01 or later. % \end{macrocode} % % \begin{macrocode} -\cs_set:Npn \@@_Hline_iii:n #1 +\cs_set:Npn \@@_Hline_iii:n #1 { - \skip_vertical:n - { - \arrayrulewidth * ( #1 ) - + \doublerulesep * ( \int_max:nn 0 { #1 - 1 } ) - } + \peek_meaning:NTF [ + { \@@_Hline_iv:nw { #1 } } + { \@@_Hline_iv:nw { #1 } [ ] } + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_set:Npn \@@_Hline_iv:nw #1 [ #2 ] + { + \@@_compute_rule_width:n { multiplicity = #1 , #2 } + \skip_vertical:n { \l_@@_rule_width_dim } \tl_gput_right:Nx \g_@@_internal_code_after_tl { \@@_hline:n { + multiplicity = #1 , position = \int_eval:n { \c@iRow + 1 } , - multiplicity = #1 - } + total-width = \dim_use:N \l_@@_rule_width_dim , + #2 + } } - \ifnum 0 = `{ \fi } + \egroup } % \end{macrocode} % @@ -17107,10 +17416,7 @@ version 2005/12/01 or later. { \msg_error:nnnn { nicematrix } { Block~too~large~2 } { #1 } { #2 } \@@_msg_redirect_name:nn { Block~too~large~2 } { none } - \group_begin: - \globaldefs = 1 \@@_msg_redirect_name:nn { columns~not~used } { none } - \group_end: } { \msg_error:nnnn { nicematrix } { Block~too~large~1 } { #1 } { #2 } } } @@ -17178,7 +17484,18 @@ version 2005/12/01 or later. { { #1 } { #2 } { #3 } { #4 } { \l_@@_block_name_str } } } % \end{macrocode} -% +% +% \bigskip +% We have a problem here: if the final user has used the keys |hlines| and +% |color| together, the frame of the block is drawn with the color specified by +% |color| but the key |hlines| is no-op. +% \begin{macrocode} + \bool_lazy_and:nnT + { ! (\tl_if_empty_p:N \l_@@_draw_tl) } + { \l_@@_hlines_block_bool || \l_@@_vlines_block_bool } + { \@@_error:n { hlines~with~color } } +% \end{macrocode} +% \bigskip % \begin{macrocode} \tl_if_empty:NF \l_@@_draw_tl { @@ -17190,7 +17507,7 @@ version 2005/12/01 or later. { \int_use:N \l_@@_last_row_int - \int_use:N \l_@@_last_col_int } } \seq_gput_right:Nn \g_@@_pos_of_stroken_blocks_seq - { { #1 } { #2 } { #3 } { #4 } } + { { #1 } { #2 } { #3 } { #4 } } } % \end{macrocode} % @@ -17858,17 +18175,8 @@ version 2005/12/01 or later. % \bigskip % \subsection*{Automatic arrays} % -% -% \begin{macrocode} -\cs_new_protected:Npn \@@_set_size:n #1-#2 \q_stop - { - \int_set:Nn \l_@@_nb_rows_int { #1 } - \int_set:Nn \l_@@_nb_cols_int { #2 } - } -% \end{macrocode} % % -% \bigskip % We will extract the potential keys |columns-type|, |l|, |c|, |r| and pass % the other keys to the environment |{NiceArrayWithDelims}|. % \begin{macrocode} @@ -17883,17 +18191,21 @@ version 2005/12/01 or later. % \end{macrocode} % % \begin{macrocode} -\NewDocumentCommand \AutoNiceMatrixWithDelims { m m O { } m O { } m ! O { } } +\NewDocumentCommand \AutoNiceMatrixWithDelims + { m m O { } > { \SplitArgument { 1 } { - } } m O { } m ! O { } } + { \@@_auto_nice_matrix:nnnnnn { #1 } { #2 } #4 { #6 } { #3 , #5 , #7 } } +% \end{macrocode} +% +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_auto_nice_matrix:nnnnnn #1 #2 #3 #4 #5 #6 { - \int_zero_new:N \l_@@_nb_rows_int - \int_zero_new:N \l_@@_nb_cols_int - \@@_set_size:n #4 \q_stop % \end{macrocode} % The group is for the protection of the keys. % \begin{macrocode} \group_begin: \bool_set_true:N \l_@@_Matrix_bool - \keys_set_known:nnN { NiceMatrix / Auto } { #3, #5, #7 } \l_tmpa_tl + \keys_set_known:nnN { NiceMatrix / Auto } { #6 } \l_tmpa_tl % \end{macrocode} % We nullify the command |\@@_transform_preamble:| because we will provide a % preamble which is yet transformed (by using |\l_@@_columns_type_tl| which is @@ -17904,19 +18216,16 @@ version 2005/12/01 or later. \use:x { \exp_not:N \begin { NiceArrayWithDelims } { #1 } { #2 } - { - * { \int_use:N \l_@@_nb_cols_int } - { \exp_not:V \l_@@_columns_type_tl } - } + { * { #4 } { \exp_not:V \l_@@_columns_type_tl } } [ \exp_not:V \l_tmpa_tl ] } \int_compare:nNnT \l_@@_first_row_int = 0 { \int_compare:nNnT \l_@@_first_col_int = 0 { & } - \prg_replicate:nn { \l_@@_nb_cols_int - 1 } { & } + \prg_replicate:nn { #4 - 1 } { & } \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\ } - \prg_replicate:nn \l_@@_nb_rows_int + \prg_replicate:nn { #3 } { \int_compare:nNnT \l_@@_first_col_int = 0 { & } % \end{macrocode} @@ -17925,13 +18234,13 @@ version 2005/12/01 or later. % value of that |iRow| (since |iRow| is incremented in the first cell of the row % of the |\halign|). % \begin{macrocode} - \prg_replicate:nn { \l_@@_nb_cols_int - 1 } { { } #6 & } #6 + \prg_replicate:nn { #4 - 1 } { { } #5 & } #5 \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\ } \int_compare:nNnT \l_@@_last_row_int > { -2 } { \int_compare:nNnT \l_@@_first_col_int = 0 { & } - \prg_replicate:nn { \l_@@_nb_cols_int - 1 } { & } + \prg_replicate:nn { #4 - 1 } { & } \int_compare:nNnT \l_@@_last_col_int > { -1 } { & } \\ } \end { NiceArrayWithDelims } @@ -18170,7 +18479,8 @@ version 2005/12/01 or later. % If this is really the end of the current environment (of \pkg{nicematrix}), we % put back the command |\end| and its argument in the TeX flow. % \begin{macrocode} - \str_if_eq:eeTF \@currenvir { #1 } { \end { #1 } } + \str_if_eq:eeTF \@currenvir { #1 } + { \end { #1 } } % \end{macrocode} % If this is not the |\end| we are looking for, we put those tokens in % |\g_nicematrix_code_after_tl| and we go on searching for the next command @@ -19006,7 +19316,7 @@ version 2005/12/01 or later. { \pgfpoint { ( \l_@@_x_initial_dim + \l_@@_x_final_dim) / 2 } - { \pgf@y + \l_@@_brace_yshift_dim } + { \pgf@y + \l_@@_brace_yshift_dim - 3 pt} } \pgfnode { rectangle } @@ -19020,10 +19330,16 @@ version 2005/12/01 or later. { \hfil ## \hfil \crcr \@@_math_toggle_token: #1 \@@_math_toggle_token: \cr - \noalign { \skip_vertical:n { 4.5 pt } \nointerlineskip } - \hbox_to_wd:nn - { \l_@@_x_final_dim - \l_@@_x_initial_dim } - { \downbracefill } \cr + \noalign { \skip_vertical:n { 3 pt } \nointerlineskip } + \c_math_toggle_token + \overbrace + { + \hbox_to_wd:nn + { \l_@@_x_final_dim - \l_@@_x_initial_dim } + { } + } + \c_math_toggle_token + \cr } \group_end: } @@ -19044,7 +19360,7 @@ version 2005/12/01 or later. { \pgfpoint { ( \l_@@_x_initial_dim + \l_@@_x_final_dim) / 2 } - { \pgf@y - \l_@@_brace_yshift_dim } + { \pgf@y - \l_@@_brace_yshift_dim + 3 pt } } \pgfnode { rectangle } @@ -19057,10 +19373,16 @@ version 2005/12/01 or later. \halign { \hfil ## \hfil \crcr - \hbox_to_wd:nn - { \l_@@_x_final_dim - \l_@@_x_initial_dim } - { \upbracefill } \cr - \noalign { \skip_vertical:n { 4.5 pt } \nointerlineskip } + \c_math_toggle_token + \underbrace + { + \hbox_to_wd:nn + { \l_@@_x_final_dim - \l_@@_x_initial_dim } + { } + } + \c_math_toggle_token + \cr + \noalign { \skip_vertical:n { 3 pt } \nointerlineskip } \@@_math_toggle_token: #1 \@@_math_toggle_token: \cr } } @@ -19260,7 +19582,28 @@ version 2005/12/01 or later. % |\c_@@_footnote_bool| in order to know if we have to insert an environment % |{savenotes}|. % +% \bigskip +% \subsection*{About the package underscore} % +% +% \begin{macrocode} +\bool_new:N \l_@@_underscore_loaded_bool +\@ifpackageloaded { underscore } + { \bool_set_true:N \l_@@_underscore_loaded_bool } + { } +% \end{macrocode} +% +% \begin{macrocode} +\hook_gput_code:nnn { begindocument } { . } + { + \bool_if:NF \l_@@_underscore_loaded_bool + { + \@ifpackageloaded { underscore } + { \@@_error:n { underscore~after~nicematrix } } + } + } +% \end{macrocode} +% % \bigskip % \subsection*{Error messages of the package} % @@ -19320,7 +19663,7 @@ version 2005/12/01 or later. { Negative~weight.\\ The~weight~of~the~'X'~columns~must~be~positive~and~you~have~used~ - the~value~'#1'.\\ + the~value~'\int_use:N \l_@@_weight_int'.\\ The~absolute~value~will~be~used. } % \end{macrocode} @@ -19377,16 +19720,7 @@ version 2005/12/01 or later. } % \end{macrocode} % -% \begin{macrocode} -\@@_msg_new:nn { hvlines-except-corners } - { - Obsolete~key.\\ - The~key~'hvlines-except-corners'~is~now~obsolete.~You~should~instead~use~the~ - keys~'hvlines'~and~'corners'.\\ - This~error~is~fatal. - } -% \end{macrocode} -% + % % \begin{macrocode} \@@_msg_new:nn { columns~not~used } @@ -19435,6 +19769,24 @@ version 2005/12/01 or later. } % \end{macrocode} % +% +% \begin{macrocode} +\@@_msg_new:nn { caption~outside~float } + { + Key~caption~forbidden.\\ + You~can't~use~the~key~'caption'~because~you~are~not~in~a~floating~ + environment.~This~key~will~be~ignored. + } +% \end{macrocode} +% +% \begin{macrocode} +\@@_msg_new:nn { short-caption~without~caption } + { + You~should~not~use~the~key~'short-caption'~without~'caption'.~ + However,~your~'short-caption'~will~be~used~as~'caption'. + } +% \end{macrocode} +% % \begin{macrocode} \@@_msg_new:nn { double~closing~delimiter } { @@ -19463,6 +19815,29 @@ version 2005/12/01 or later. % \end{macrocode} % % \begin{macrocode} +\@@_msg_new:nn { Identical~notes~in~caption } + { + Identical~tabular~notes.\\ + You~can't~put~several~notes~with~the~same~content~in~ + \token_to_str:N \caption\ (but~you~can~in~the~main~tabular).\\ + If~you~go~on,~the~output~will~probably~be~erroneous. + } +% \end{macrocode} +% +% \begin{macrocode} +\@@_msg_new:nn { tabularnote~below~the~tabular } + { + \token_to_str:N \tabularnote\ forbidden\\ + You~can't~use~\token_to_str:N \tabularnote\ in~the~caption~ + of~your~tabular~because~the~caption~will~be~composed~below~ + the~tabular.~If~you~want~the~caption~above~the~tabular~use~the~ + key~'caption-above'~in~\token_to_str:N \NiceMatrixOptions.\\ + Your~\token_to_str:N \tabularnote\ will~be~discarded~and~ + no~similar~error~will~raised~in~this~document. + } +% \end{macrocode} +% +% \begin{macrocode} \@@_msg_new:nn { Unknown~key~for~rules } { Unknown~key.\\ @@ -19476,29 +19851,37 @@ version 2005/12/01 or later. { Unknown~key.\\ The~key~'\l_keys_key_str'~is~unknown~in~a~'custom-line'.~ - It~will~be~ignored. \\ + It~you~go~on,~you~will~probably~have~other~errors. \\ \c_@@_available_keys_str } { The~available~keys~are~(in~alphabetic~order):~ + ccommand,~ color,~ command,~ dotted,~ letter,~ multiplicity,~ sep-color,~ - tikz,~and~tota-width. + tikz,~and~total-width. } % \end{macrocode} % % \begin{macrocode} -\@@_msg_new:nn { Unknown~key~for~xdots } +\@@_msg_new:nnn { Unknown~key~for~xdots } { Unknown~key.\\ - As~for~now,~there~is~only~five~keys~available~here:~'color',~'inter',~ - 'line-style',~'radius',~ - and~'shorten'~(and~you~try~to~use~'\l_keys_key_str').~ - That~key~will~be~ignored. + The~key~'\l_keys_key_str'~is~unknown~for~a~command~for~drawing~dotted~rules.\\ + \c_@@_available_keys_str + } + { + The~available~keys~are~(in~alphabetic~order):~ + 'color',~ + 'inter',~ + 'line-style',~ + 'radius',~ + 'shorten',~ + 'shorten-end'~and~'shorten-start'. } % \end{macrocode} % @@ -19513,7 +19896,14 @@ version 2005/12/01 or later. } % \end{macrocode} % -% +% \begin{macrocode} +\@@_msg_new:nn { label~without~caption } + { + You~can't~use~the~key~'label'~in~your~'{NiceTabular}'~because~ + you~have~not~used~the~key~'caption'.~The~key~'label'~will~be~ignored. + } +% \end{macrocode} +% % \begin{macrocode} \@@_msg_new:nn { Construct~too~large } { @@ -19525,6 +19915,17 @@ version 2005/12/01 or later. % \end{macrocode} % % \begin{macrocode} +\@@_msg_new:nn { underscore~after~nicematrix } + { + Problem~with~'underscore'.\\ + The~package~'underscore'~should~be~loaded~before~'nicematrix'.~ + You~can~go~on~but~you~won't~be~able~to~write~something~such~as:\\ + '\token_to_str:N \Cdots\token_to_str:N _{n~\token_to_str:N \text{~times}}'. + } +% \end{macrocode} +% +% +% \begin{macrocode} \@@_msg_new:nn { ampersand~in~light-syntax } { Ampersand~forbidden.\\ @@ -19543,7 +19944,16 @@ version 2005/12/01 or later. (set~by~the~key~'end-of-row').~This~error~is~fatal. } % \end{macrocode} -% +% +% \begin{macrocode} +\@@_msg_new:nn { hlines~with~color } + { + Incompatible~keys.\\ + You~can't~use~the~keys~'hlines',~'vlines'~or~'hvlines'~for~a~ + '\token_to_str:N \Block'~when~the~key~'color'~or~'draw'~is~used.\\ + Your~key~will~be~discarded. + } +% \end{macrocode} % % \begin{macrocode} \@@_msg_new:nn { bad~value~for~baseline } @@ -19594,8 +20004,7 @@ version 2005/12/01 or later. % \begin{macrocode} \@@_msg_new:nn { width~without~X~columns } { - No~X~column.\\ - You~have~used~the~key~'width'~but~you~have~put~no~'X'~column. \\ + You~have~used~the~key~'width'~but~you~have~put~no~'X'~column.~ That~key~will~be~ignored. } % \end{macrocode} @@ -19845,7 +20254,8 @@ version 2005/12/01 or later. enumitem~not~loaded.\\ You~can't~use~the~command~\token_to_str:N\tabularnote\ ~because~you~haven't~loaded~'enumitem'.\\ - This~command~will~be~ignored. + All~the~commands~\token_to_str:N\tabularnote\ will~be~ + ignored~in~the~document. } % \end{macrocode} % @@ -19932,6 +20342,24 @@ version 2005/12/01 or later. % \end{macrocode} % % \begin{macrocode} +\@@_msg_new:nnn { Unknow~key~for~RulesBis } + { + Unkown~key.\\ + Your~key~'\l_keys_key_str'~is~unknown~for~a~rule.\\ + \c_@@_available_keys_str + } + { + The~available~keys~are~(in~alphabetic~order):~ + color,~ + dotted,~ + multiplicity,~ + sep-color,~ + tikz,~and~total-width. + } + +% \end{macrocode} +% +% \begin{macrocode} \@@_msg_new:nnn { Unknown~key~for~Block } { Unknown~key.\\ @@ -20072,6 +20500,7 @@ version 2005/12/01 or later. { The~available~keys~are~(in~alphabetic~order):~ allow-duplicate-names,~ + caption-above,~ cell-space-bottom-limit,~ cell-space-limits,~ cell-space-top-limit,~ @@ -20245,6 +20674,7 @@ version 2005/12/01 or later. b,~ baseline,~ c,~ + caption,~ cell-space-bottom-limit,~ cell-space-limits,~ cell-space-top-limit,~ @@ -20266,6 +20696,7 @@ version 2005/12/01 or later. first-row,~ hlines,~ hvlines,~ + label,~ last-col,~ last-row,~ left-margin,~ @@ -20278,6 +20709,7 @@ version 2005/12/01 or later. respect-arraystretch,~ right-margin,~ rules~(with~the~subkeys~'color'~and~'width'),~ + short-caption,~ t,~ tabularnote,~ vlines,~ @@ -20646,7 +21078,7 @@ version 2005/12/01 or later. % % \subsection*{Changes between versions 4.3 and 4.4} % -% New key |hvlines-except-corners|. +% New key |hvlines-except-corners| (now deprecated). % % \subsection*{Changes between versions 4.4 and 5.0} % @@ -20902,14 +21334,22 @@ version 2005/12/01 or later. % % \subsection*{Changes between version 6.10 and 6.11} % -% New key |matrix/columns-type| to spcecify the type of columns of the matrices. +% New key |matrix/columns-type| to specify the type of columns of the matrices. % -% New key |ccommand| in |custom-line| and new command |\cdotteline|. +% New key |ccommand| in |custom-line| and new command |\cdottedline|. % % \subsection*{Changes between version 6.11 and 6.12} % -% \PrintIndex +% New keys |caption|, |short-caption| and |label| in the environment +% |{NiceTabular}|. +% +% In |{NiceTabular}|, a caption specified by the key |caption| is wrapped to the +% width of the tabular. % +% Correction of a bug: it's now possible to use |\OverBrace| and |\UnderBrace| +% with \pkg{unicode-math} (with XeLaTeX or LuaLaTeX). +% +% \newpage % \tableofcontents % % \endinput diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf Binary files differindex 2f3b8fe6d7..88d123b069 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix.pdf |