diff options
author | Norbert Preining <norbert@preining.info> | 2024-04-24 03:03:08 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-04-24 03:03:08 +0000 |
commit | a1bae2c92d8b9b9cbd26c71b0feb7abd276e5993 (patch) | |
tree | b1d5947913d3965ae86732f1813084c57b289b3d /macros/latex/contrib/nicematrix/nicematrix.tex | |
parent | b5598758830c291828e8dcf4693b17f97d2bf3b9 (diff) |
CTAN sync 202404240303
Diffstat (limited to 'macros/latex/contrib/nicematrix/nicematrix.tex')
-rw-r--r-- | macros/latex/contrib/nicematrix/nicematrix.tex | 109 |
1 files changed, 67 insertions, 42 deletions
diff --git a/macros/latex/contrib/nicematrix/nicematrix.tex b/macros/latex/contrib/nicematrix/nicematrix.tex index 767b973312..35de300099 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.tex +++ b/macros/latex/contrib/nicematrix/nicematrix.tex @@ -615,12 +615,12 @@ if it's not, an error will be raised.} by using as options the value of that key |tikz| (which must be a list of keys allowed for a TikZ path). \colorbox{yellow!50}{\textbf{New 6.24}}\enskip In fact, in the list of the keys -provided by the user as value of |tikz|, it's possible to put a key |offset|. -That key is not provided by TikZ but by \pkg{nicematrix}. It will narrow the -rectangular frame corresponding to the block by a margin (horizontally and -vertically) equal to the value (of that key |offset|). That new frame, a bit -narrower, will be executed by TikZ with options which are the other keys in the -list of keys provided as value to the key |tikz| of |\Block|. +provided by the user as value of |tikz|, it's possible to put a key +\Definition{offset}. That key is not provided by TikZ but by \pkg{nicematrix}. +It will narrow the rectangular frame corresponding to the block by a margin +(horizontally and vertically) equal to the value (of that key |offset|). That +new frame, a bit narrower, will be executed by TikZ with options which are the +other keys in the list of keys provided as value to the key |tikz| of |\Block|. For examples, cf. p.~\pageref{tikz-key-examples}. \end{itemize} @@ -741,7 +741,7 @@ Henry & 14 \\ \hline For the mono-row blocks, the natural height and depth are taken into account for the height and depth of the current row (as does a standard |\multicolumn| of LaTeX), except when an option of vertical position has been used for the block -(one of the keys |t|, |b|, |v-center|, |T| and |B| described in the part +(one of the keys |t|, |b|, |m|, |T| and |B| described in the part \ref{vertical-pos-block}, p.~\pageref{vertical-pos-block}). \subsection{The mono-cell blocks} @@ -909,14 +909,12 @@ Rank & \Block[C]{1-3}{First group} & & & \Block{1-3}{Second group} \\ \label{vertical-pos-block} For the vertical position, the command |\Blocks| accepts the keys -|v-center|\footnote{That key could not have been named |c| since the key |c| -is used for the horizontal alignement.}, -|t|, |b|, |T| and |B|. +|m|, |t|, |b|, |T| and |B|. \begin{itemize} \item \index{v-center (key of \texttt{\textbackslash Block})} -With the key \Definition{v-center}, the content of the block is vertically centered. +With the key \Definition{m}\footnote{That key has an alias: |v-center|.}, the content of the block is vertically centered. \item With the key \Definition{t}, the baseline of the content of the block is aligned with the baseline of the first row concerned by the block. \item with the key \Definition{b}, the baseline of the last row of the content of the @@ -925,15 +923,14 @@ separated by |\\|) is aligned with the baseline of the last of the rows of the array involved in the block. \item With the key \Definition{T}, the content of the block is set upwards. -\colorbox{yellow!50}{\textbf{Modification 6.18}}\enskip No vertical margin is -added. However, the contents of the block is (always) composed by -\pkg{nicematrix} in a |{minipage}|, a |{tabular}| or an |{array}| and, hence, -there will still remain a margin (in most cases). +No vertical margin is added. However, the contents of the block is (always) +composed by \pkg{nicematrix} in a |{minipage}|, a |{tabular}| or an |{array}| +and, hence, there will still remain a margin (in most cases). \item With the key \Definition{B}, the content of the block is set downwards. \end{itemize} -When no key is given, the key |v-center| applies (except in the mono-row blocks). +When no key is given, the key |m| applies (except in the mono-row blocks). @@ -1317,6 +1314,29 @@ $\begin{pNiceMatrix}[vlines,rules/width=0.2pt] \end{pNiceMatrix}$ +\medskip +When the key |hlines| is in force, it's still possible to use |\Hline\Hline| to +put a double horizontal rule. As well, it's possible to put \verb+||+ in the +preamble (of an environment with preamble) to put a double vertical rule, even +when the key |vlines| is in force. + +\medskip +\begin{Code}[width=10.6cm] +$\begin{NiceArray}{c\emph{||}ccccc}[hlines,vlines] + & a & b & c & d & e \\ \emph{\Hline\Hline} +x & 0 & 0 & 0 & 0 & 0 \\ +y & 0 & 0 & 0 & 0 & 0 \\ +z & 0 & 0 & 0 & 0 & 0 \\ +\end{NiceArray}$ +\end{Code} +$\begin{NiceArray}{c||ccccc}[hlines,vlines] + & a & b & c & d & e \\ \Hline\Hline +x & 0 & 0 & 0 & 0 & 0 \\ +y & 0 & 0 & 0 & 0 & 0 \\ +z & 0 & 0 & 0 & 0 & 0 \\ +\end{NiceArray}$ + + \subsubsection{The keys hvlines and hvlines-except-borders} \label{hvlines} @@ -2053,15 +2073,16 @@ the colorimetric space). The available keys are |cols|, |restart| and \index{respect-blocks (key of \texttt{\textbackslash rowcolors} du\newline \texttt{\textbackslash CodeBefore})} \begin{itemize} -\item The key |cols| describes a set of columns. The command |\rowcolors| will -color only the cells of these columns. The value is a comma-separated list of -intervals of the form $i$-$j$ (where $i$ or $j$ may be replaced by |*|). -\item With the key |restart|, each interval of rows (specified by the first -mandatory argument) begins with the same color.\footnote{Otherwise, the color +\item The key \Definition{cols} describes a set of columns. The command +|\rowcolors| will color only the cells of these columns. The value is a +comma-separated list of intervals of the form $i$-$j$ (where $i$ or $j$ may be +replaced by |*|). +\item With the key \Definition{restart}, each interval of rows (specified by the +first mandatory argument) begins with the same color.\footnote{Otherwise, the color of a given row relies only upon the parity of its absolute number.} -\item With the key |respect-blocks| the ``rows'' alternately colored may extend over -several rows if they have to incorporate blocks (created with the command -|\Block|: cf.~p.~\pageref{Block}). +\item With the key \Definition{respect-blocks} the ``rows'' alternately colored +may extend over several rows if they have to incorporate blocks (created with +the command |\Block|: cf.~p.~\pageref{Block}). \end{itemize} \medskip @@ -2174,7 +2195,8 @@ Alexandra \\ It's also possible to use in the command |\rowlistcolors| a color series defined by the command |\definecolorseries| of \pkg{xcolor} (and initialized with the command |\resetcolorseries|\footnote{For the initialization, in the -following example, you have used the counter |iRow| which, when used in the +following example, you have used the counter |iRow| (which corresponds to the +internal TeX counter |\c@iRow|) which, when used in the |\CodeBefore| (and in the |\CodeAfter|) corresponds to the number of rows of the array: cf.~p~\pageref{iRow}. That leads to an adjustement of the gradation of the colors to the size of the tabular.}). @@ -2508,8 +2530,8 @@ corresponding global keys (cf. p.~\pageref{cell-space}). \index{color!key of \texttt{\textbackslash RowStyle}} The key \Definition{rowcolor} sets the color of the background and the key \Definition{color} sets the 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 +|\color| but also inserts an instruction |\leavevmode| before. This +instruction prevents an extra vertical space in the cells which belong to columns of type |p|, |b|, |m|, |X| and |V| (which start in vertical mode of LaTeX).} \item \index{bold (key of \texttt{\textbackslash RowStyle})} The key @@ -4185,7 +4207,7 @@ the command applies to each of the tabular, except those in the exterior rows and columns (cf.~p.~\pageref{exterior}) and those in the empty corners (when the key |corners| is used: cf.~p.~\pageref{corners}). It applies in fact to each block (excepted those with the key |transparent|) and does not apply to the -cells located within these blocks. +individual cells located within these blocks. \medskip In fact, in the list of keys provided as argument of |\TikzEveryCell|, it's @@ -4956,16 +4978,18 @@ section \ref{delimiters-in-preamble}, p.~\pageref{delimiters-in-preamble}). \index{jCol (LaTeX counter)} In the cells of the array, it's possible to use the LaTeX counters |iRow| and -|jCol| which represent the number of the current row and the number of the -current column\footnote{We recall that the exterior ``first row'' (if it -exists) has the number~$0$ and that the exterior ``first column'' (if it -exists) has also the number~$0$.}. Of course, the user must not change the -value of these counters which are used internally by \pkg{nicematrix}. +|jCol|\footnote{There counters are actual LaTeX counters: the underlying TeX + counters are |\c@iRow| and |\c@jCol|} which represent the number of the +current row and the number of the current column. We recall that the exterior +``first row'' (if it exists) has the number~$0$ and that the exterior ``first +column'' (if it exists) has also the number~$0$. Of course, the user must not +change the value of these counters |iRow| and |jCol| which are used internally +by \pkg{nicematrix}. -In the |\CodeBefore| (cf. p. \pageref{code-before}) and in the |\CodeAfter| -(cf. p. \pageref{code-after}), |iRow| represents the total number of rows -(except the potential exterior rows) and |jCol| represents the total number -of columns (except the potential exterior columns). +In the |\CodeBefore| (cf. p. \pageref{code-before}) and in the |\CodeAfter| (cf. +p. \pageref{code-after}), |iRow| represents the total number of rows (except the +potential exterior rows: cf. p.~\pageref{exterior}) and |jCol| represents the +total number of columns (except the potential exterior columns). \medskip \begin{Code}[width=10.6cm] @@ -5064,6 +5088,7 @@ analyzed. The environment doesn't behave in that case as a standard environment of LaTeX which only put TeX commands before and after the content.} \medskip +\index{light-syntax-expanded} \colorbox{yellow!50}{\textbf{New 6.27}}\enskip The key |light-syntax-expanded| has the same behaviour as the key |light-syntax| but the body of the environment is expanded (in the TeX sens\footnote{More precisely, it's a @@ -5837,6 +5862,9 @@ using the public variable |\g_nicematrix_code_before_tl|. } \ExplSyntaxOff +\medskip +We have used the LaTeX |counters iRow| and |jCol| provided by \pkg{nicematrix} (cf.~p.~\pageref{iRow}). + \bigskip Here is an example of utilisation: @@ -6269,7 +6297,7 @@ its argument\footnote{In fact: the value of its argument.}. \begin{Code} \ExplSyntaxOn \NewDocumentCommand { \emph{\stars} } { m } - { \prg_replicate:nn { \value { #1 } } { $ \star $ } } + { \prg_replicate:nn { \value { #1 } } { \( \star \) } } \ExplSyntaxOff \end{Code} % @@ -6306,7 +6334,7 @@ require a width equal to that value: |widest*=\value{tabularnote}|. \begin{scope} \ExplSyntaxOn \NewDocumentCommand \stars { m } - { \prg_replicate:nn { \value { #1 } } { $ \star $ } } + { \prg_replicate:nn { \value { #1 } } { \( \star \) } } \NiceMatrixOptions { notes = @@ -7913,9 +7941,6 @@ New environment |{NiceArray}| with column types |L|, |C| and |R|. The dotted lines are no longer drawn with TikZ nodes but with TikZ circles (for efficiency). -Modification of the code which is now twice faster. - - \cleardoublepage |