diff options
Diffstat (limited to 'macros/latex/contrib/nicematrix/nicematrix.dtx')
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.dtx | 121 |
1 files changed, 103 insertions, 18 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index dceae17ad9..3083528029 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -1,4 +1,4 @@ -% \iffalse meta-comment +% \iffalse meta-comment % % This file should be compiled with $xelatex$. % @@ -17,8 +17,8 @@ % % \fi % \iffalse -\def\myfileversion{6.14} -\def\myfiledate{2023/02/18} +\def\myfileversion{6.15} +\def\myfiledate{2023/02/25} % % %<*batchfile> @@ -577,6 +577,11 @@ version 2005/12/01 or later. % |tikz={|\textsl{list}|}| where \textsl{list} is a list of couples % \textsl{key=value} of Tikz specifying the graphical characteristics of the % lines that will be drawn (for an example, see p.~\pageref{dashed}). +% \item \colorbox{yellow!50}{\textbf{Nouveau 6.15}}\par\nobreak +% By default, the rules are not drawn in the blocks (see the section about the +% rules: section~\ref{rules} p.~\pageref{rules}). However, if the key +% |transparent| is used, the rules are drawn. For an example, see +% section~\ref{tikz-key-examples} on page~\pageref{tikz-key-examples}. % \end{itemize} % % There is also keys for the horizontal and vertical positions of the content of @@ -857,7 +862,8 @@ version 2005/12/01 or later. % separated by |\\|) is aligned with the baseline of the last of the rows of the % array involved in the block. % \item With the key |T|, the content of the block is set upwards with only a -% margin equal to the PGF/Tikz parameter |inner ysep|. +% margin equal to the PGF/Tikz parameter |inner ysep| (use |\pgfset| to change +% the value of that parameter). % \item With the key |B|, the content of the block is set downwards with only a % margin equal to the PGF/Tikz parameter |inner ysep|. % \end{itemize} @@ -3214,7 +3220,34 @@ version 2005/12/01 or later. % \CodeAfter \line[shorten=6pt]{1-5}{4-7} % \end{bNiceMatrix}\] % +% % +% \bigskip +% Despite its name, the command |\SubMatrix| may also be used within a +% |{NiceTabular}|. Here is an example (which uses |\bottomrule| and +% |\toprule| of \pkg{booktabs}). +% +% \begin{BVerbatim}[baseline=c] +% \begin{NiceTabular}{~@{}ll~@{}} +% \toprule +% Part A & the first part \\ +% \Block{2-1}{Part B} & a first sub-part \\ +% & a second sub-part \\ +% \bottomrule +% \CodeAfter +% ~emphase#\SubMatrix{\{}{2-2}{3-2}{.}@ +% \end{NiceTabular} +% \end{BVerbatim} +% \hspace{2cm} +% \begin{NiceTabular}{@{}ll@{}} +% \toprule +% Part A & the first part \\ +% \Block{2-1}{Part B} & a first sub-part \\ +% & a second sub-part \\ +% \bottomrule +% \CodeAfter +% \SubMatrix{\{}{2-2}{3-2}{.} +% \end{NiceTabular} % % \subsection{The command \textbackslash SubMatrix in the \textbackslash CodeAfter} % @@ -5093,12 +5126,15 @@ version 2005/12/01 or later. % dashed rules with the tools provided by \pkg{nicematrix}, by creating a % customized line style with |custom-line|: cf.~p.~\pageref{custom-line}. % +% \bigskip +% The columns |d| of \pkg{dcolumn} are not supported (but it's possible to use +% the colums |S| of \pkg{siunitx}). % % \section{Examples} % % \subsection[{Utilisation of the key 'tikz' of the command \textbackslash % Block}]{Utilisation of the key ``tikz'' of the command \textbackslash Block} -%\label{tikz-key-examples} +% \label{tikz-key-examples} % % % The key |tikz| of the command |\Block| is available only when Tikz is @@ -5144,6 +5180,36 @@ version 2005/12/01 or later. % \end{NiceTabular} % \end{center} % +% \bigskip +% In the following example, we use the key |tikz| to hatch a row of the tabular. +% Remark that you use the key |transparent| of the command |\Block| in order to +% have the rules drawn in the block.\footnote{By default, the rules are not +% drawn in the blocks created by the command |\Block|: cf.~section~\ref{rules} +% p.~\pageref{rules}} +% +% \begin{Verbatim} +% \begin{NiceTabular}{ccc}[hvlines] +% \CodeBefore +% \columncolor[RGB]{169,208,142}{2} +% \Body +% one & two & three \\ +% \Block[~emphase#transparent, tikz={pattern = north west lines, pattern color = gray}@]{1-*}{} +% four & five & six \\ +% seven & eight & nine +% \end{Verbatim} +% +% \begin{center} +% \begin{NiceTabular}{ccc}[hvlines] +% \CodeBefore +% \columncolor[RGB]{169,208,142}{2} +% \Body +% one & two & three \\ +% \Block[transparent, tikz={pattern = north west lines, pattern color = gray}]{1-*}{} +% four & five & six \\ +% seven & eight & nine +% \end{NiceTabular} +% \end{center} +% % % \subsection{Notes in the tabulars} % @@ -10439,7 +10505,8 @@ version 2005/12/01 or later. % \end{macrocode} % We add a last column to raise a good error message when the user puts 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). +% possible to do that in |{NiceTabular*}| (we control that with the value of +% |\l_@@_tabular_width_dim|). % \begin{macrocode} \dim_compare:nNnT \l_@@_tabular_width_dim = \c_zero_dim { @@ -12690,8 +12757,15 @@ version 2005/12/01 or later. { * { - \int_compare:nNnTF \l_@@_last_col_int < 0 - \c@MaxMatrixCols + \int_case:nnF \l_@@_last_col_int + { + { -2 } { \c@MaxMatrixCols } + { -1 } { \int_eval:n { \c@MaxMatrixCols + 1 } } +% \end{macrocode} +% The value $0$ can't occur here since we are in a matrix (which is an +% environment without preamble). +% \begin{macrocode} + } { \int_eval:n { \l_@@_last_col_int - 1 } } } { #2 } @@ -18459,6 +18533,7 @@ version 2005/12/01 or later. - base } } + \dim_sub:Nn \l_tmpa_dim { 0.5 \arrayrulewidth } % added 2023-02-21 % \end{macrocode} % We retrieve (in |\pgf@x|) the $x$-value of the center of the block. % \begin{macrocode} @@ -20405,8 +20480,12 @@ version 2005/12/01 or later. \int_compare:nNnTF \l_@@_last_col_int = { -2 } { \@@_fatal:n { too~much~cols~for~matrix } } { - \bool_if:NF \l_@@_last_col_without_value_bool - { \@@_fatal:n { too~much~cols~for~matrix~with~last~col } } + \int_compare:nNnTF \l_@@_last_col_int = { -1 } + { \@@_fatal:n { too~much~cols~for~matrix } } + { + \bool_if:NF \l_@@_last_col_without_value_bool + { \@@_fatal:n { too~much~cols~for~matrix~with~last~col } } + } } } { \@@_fatal:n { too~much~cols~for~array } } @@ -20445,7 +20524,7 @@ version 2005/12/01 or later. \@@_msg_new:nn { too~much~cols~for~matrix~with~last~col } { Too~much~columns.\\ - In~the~row~\int_eval:n { \c@iRow - 1 },~ + In~the~row~\int_eval:n { \c@iRow },~ 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 }~ @@ -20458,24 +20537,23 @@ version 2005/12/01 or later. \@@_msg_new:nn { too~much~cols~for~matrix } { Too~much~columns.\\ - In~the~row~\int_eval:n { \c@jCol - 1 },~ + In~the~row~\int_eval:n { \c@iRow },~ you~try~to~use~more~columns~than~allowed~by~your~ \@@_full_name_env:.\@@_message_hdotsfor:\ Recall~that~the~maximal~ - number~of~columns~for~a~matrix~is~fixed~by~the~LaTeX~counter~ - 'MaxMatrixCols'.~Its~current~value~is~\int_use:N \c@MaxMatrixCols.~ + number~of~columns~for~a~matrix~(excepted~the~potential~exterior~ + columns)~is~fixed~by~the~LaTeX~counter~'MaxMatrixCols'.~ + Its~current~value~is~\int_use:N \c@MaxMatrixCols\ (use~ + \token_to_str:N \setcounter\ to~change~that~value).~ This~error~is~fatal. } % \end{macrocode} % % \medskip -% For the following message, remind that the test is not done after the -% construction of the array but in each row. That's why we have to put -% |\c@jCol-1| and not |\c@jCol|. % \begin{macrocode} \@@_msg_new:nn { too~much~cols~for~array } { Too~much~columns.\\ - In~the~row~\int_eval:n { \c@jCol - 1 },~ + In~the~row~\int_eval:n { \c@iRow },~ ~you~try~to~use~more~columns~than~allowed~by~your~ \@@_full_name_env:.\@@_message_hdotsfor:\ The~maximal~number~of~columns~is~ \int_use:N \g_@@_static_num_of_col_int\ @@ -21562,6 +21640,13 @@ version 2005/12/01 or later. % \small % \nolinkurl{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty} % } +% +% +% \subsection*{Changes between version 6.14 and 6.15} +% +% New key |transparent| for the command |\Block| (with that key, the rules are +% drawn within the block). +% % \subsection*{Changes between version 6.13 and 6.14} % % New keys for the command |\Block| for the vertical position of the content of |