diff options
Diffstat (limited to 'macros/latex/contrib/nicematrix/nicematrix.tex')
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.tex | 83 |
1 files changed, 55 insertions, 28 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix.tex b/macros/latex/contrib/nicematrix/nicematrix.tex index 9987ba819b..91758773dd 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.tex +++ b/macros/latex/contrib/nicematrix/nicematrix.tex @@ -687,7 +687,7 @@ derogation of the type of column given in the preamble of the array. command |\Block| and to fill the background with rounded corners with the keys |fill| and |rounded-corners|.\footnote{If one simply wishes to color the background of a unique cell, there is no point using the command |\Block|: -it's possible to use the command |\cellcolor| (when the key |colortbl-like| is +it's possible to use the command |\cellcolor| (when the key |color-inside| is used).} \item It's possible to draw one or several borders of the cell with the key |borders|. @@ -1753,7 +1753,6 @@ by a comma) \item the colorimetric space (|RGB|, |rgb|, |HTML|, etc) as specified by the the extension \pkg{xcolor}; \item \index{opacity (key of commands such as\newline \texttt{\textbackslash rowcolor}, etc.)} -\colorbox{yellow!50}{\textbf{New 6.18}}\par\nobreak a specification of opacity of the form \texttt{opacity = \textsl{value}}.\footnote{Caution : that feature creates instructions of transparency in the \textsc{pdf} and some \textsc{pdr} don't support such instructions.} @@ -2198,9 +2197,9 @@ special & 12 & 12 & 0.5 & 70 \\ We have used the type of column |S| of \pkg{siunitx}. -\subsection{Color tools with the syntax of colortbl} +\subsection{Color tools to be used inside the tabular} -\index{colortbl-like} +\index{color-inside} \index{cellcolor@\texttt{\textbackslash cellcolor}!command in tabular} \index{rowcolor@\texttt{\textbackslash rowcolor}!command in tabular} \index{columncolor@\texttt{\textbackslash columncolor}!command in the preamble @@ -2208,11 +2207,12 @@ We have used the type of column |S| of \pkg{siunitx}. 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 +of \pkg{colortbl}. For that, one must use the key |color-inside|\footnote{There + is an alias for that key : \texttt{colortbl-like}.} in the current environment.\footnote{Up to now, this key is \emph{not} available in |\NiceMatrixOptions|.} -There are three commands available (they are inspired by \pkg{colortbl} but -are \emph{independent} of \pkg{colortbl}): +There are several commands available (the first three ones are inspired by +\pkg{colortbl} but are \emph{independent} of \pkg{colortbl}): \begin{itemize} \item |\cellcolor| which colorizes a cell;\footnote{However, this command |\cellcolor| will delete the following spaces, which does not the command @@ -2223,13 +2223,17 @@ the row; with the same syntax as the corresponding command of \pkg{colortbl} (however, unlike the command |\columncolor| of \pkg{colortbl}, this command |\columncolor| can appear within another command, itself used in the -preamble of the array). +preamble of the array); +\item \colorbox{yellow!50}{\textbf{New 6.21}}\enskip |\rowcolors| which takes in as arguments two colors and color the rest of +the tabular with those colors; +\item \colorbox{yellow!50}{\textbf{New 6.21}}\enskip |\rowlistcolors| which takes in as argument a color and color the rest of +the tabular with the colors of that list of colors. \end{itemize} \smallskip \begin{Verbatim} \NewDocumentCommand { \Blue } { } { ~emphase#\columncolor{blue!15}@ } -\begin{NiceTabular}[colortbl-like]{>{\Blue}c>{\Blue}cc} +\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc} \toprule ~emphase#\rowcolor{red!15}@ Last name & First name & Birth day \\ @@ -2245,7 +2249,7 @@ Dupont & Chantal & 15 janvier 1998 \\ \begin{center} \NewDocumentCommand { \Blue } { } { \columncolor{blue!15} } -\begin{NiceTabular}[colortbl-like]{>{\Blue}c>{\Blue}cc} +\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc} \toprule \rowcolor{red!15} Last name & First name & Birth day \\ @@ -2288,7 +2292,7 @@ color of the text.\footnote{The key |color| uses the command |\color| but inserts also an instruction |\leavevmode| before. This instruction prevents a extra vertical space in the cells which belong to columns of type |p|, |b|, |m|, |X| and |V| (which start in -vertical mode).} +vertical mode of LaTeX).} \item \index{bold (key of \texttt{\textbackslash RowStyle})} The key |bold| enforces bold characters for the cells of the row, both in math and text mode. \end{itemize} @@ -4331,34 +4335,37 @@ provided by \pkg{nicematrix} (see the key |caption| in the section \section{Other features} -\subsection{The key rounded-corners of \{NiceTabular\}} +\subsection{The key rounded-corners} \label{tabular-rounded-corners} \index{rounded-corners!key of \texttt{\{NiceTabular\}}} \index{Corners (rounded ---)!for a tabular} -\colorbox{yellow!50}{\textbf{New 6.18}}\par\nobreak - -\smallskip The key |rounded-corners| that we will describe now has no direct link with the key |corners| (which is used to specify ``empty corners'') described in the part~\ref{corners}, p.~\pageref{corners}. \smallskip -The environment |{NiceTabular}| provides a key |rounded-corners| which specify -that the tabular should have rounded corners with a radius equal to the value of -that key (the default value is 4~pt\footnote{This value is the initial value of - the \emph{rounded corners} of Tikz.}). More precisely, that key has two -effects that we describe now. +The key |rounded-corners| specifies that the tabular should have rounded corners +with a radius equal to the value of that key (the default value is +4~pt\footnote{This value is the initial value of the \emph{rounded corners} of + Tikz.}). More precisely, that key has two effects that we describe now. \begin{itemize} \item All the commands for coloring the cells, columns and rows (in the -|\CodeBefore| but also directly in the array when the key |colortbl-like| is +|\CodeBefore| but also directly in the array when the key |color-inside| is used) will respect those rounded corners. \item When the key |hvlines| is used, the exterior rules will be drawn with -rounded corners. +rounded corners.\footnote{Of course, when used in an environment with delimiters +(|{pNiceMatrix}|, |{bNiceArray}|, etc.), the key |hvlines| does not draw the +exterior rules.} \end{itemize} + +\colorbox{yellow!50}{New 6.21}\enskip That key is available in all +the environments and commands (e.g. |\pAutoNiceMatrix|) of \pkg{nicematrix} and also +in the command |\NiceMatrixOptions|. + \bigskip \begin{BVerbatim}[baseline=c,boxwidth=9cm] \begin{NiceTabular} @@ -4549,6 +4556,17 @@ $A = \begin{pNiceMatrix}[last-row=4,last-col=4] \end{pNiceMatrix}$ \end{varwidth} +\bigskip +\colorbox{yellow!50}{\textbf{New 6.21}}\enskip The command |\tabular| has a key +|c|: |\tabular[c]|. When that key is used, the content is composed in a +|\vcenter| and, therefore, in most cases, we will have a vertical alignment. + + + +\bigskip +Caution: the command |\rotate| is designed to be used in a |\Block| or in +columns of type |l|, |r|, |c|, |w| ou |W|; if it is used in other column types +(such as |p{...}|), the result will maybe differ from what is expected. \subsection{The option small} @@ -4788,8 +4806,8 @@ $\begin{NiceArrayWithDelims} The command |\OnlyMainNiceMatrix| executes its argument only when it is in the main part of the array, that is to say when it is not in one of the exterior -rows. If it is used outside an environment of \pkg{nicematrix}, that command is -no-op. +rows or one of the exterior columns. If it is used outside an environment of +\pkg{nicematrix}, that command is no-op. For an example of utilisation, see \url{tex.stackexchange.com/questions/488566} @@ -6561,16 +6579,16 @@ see the remark p.~\pageref{remark-cline}.} \vspace{1cm} It's possible to color a row with |\rowcolor| in the |code-before| (or with -|\rowcolor| in the first cell of the row if the key |colortbl-like| is +|\rowcolor| in the first cell of the row if the key |color-inside| is used−even when \pkg{colortbl} is not loaded). -\index{colortbl-like|textit} +\index{color-inside|textit} \index{rowcolor@\texttt{\textbackslash rowcolor}!command in tabular|textit} \medskip \begin{Verbatim} -\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like] +\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside] ~emphase#\rowcolor{red!15}@A_{11} & A_{12} & A_{13} & A_{14} \\ A_{21} & ~emphase#\rowcolor{red!15}@A_{22} & A_{23} & A_{24} \\ A_{31} & A_{32} & ~emphase#\rowcolor{red!15}@A_{33} & A_{34} \\ @@ -6580,7 +6598,7 @@ used−even when \pkg{colortbl} is not loaded). -\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,colortbl-like] +\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside] \rowcolor{red!15}A_{11} & A_{12} & A_{13} & A_{14} \\ A_{21} & \rowcolor{red!15}A_{22} & A_{23} & A_{24} \\ A_{31} & A_{32} & \rowcolor{red!15}A_{33} & A_{34} \\ @@ -6885,6 +6903,15 @@ The successive versions of the file |nicematrix.sty| provided by TeXLive are ava \nolinkurl{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/nicematrix/nicematrix.sty} } +\subsection*{Changes between version 6.20a and 6.21} + +Key |c| for the command |\tabularnote|. + +New commands |\rowcolors| and |\rowlistcolors| available in the array itself +(previously, there were only two commands |\rowcolors| and |\rowlistcolors| +avaailable in the |\CodeBefore|. + + \subsection*{Changes between version 6.20 and 6.20a} The value of the key |name| of an environment of \pkg{nicematrix} is expanded |