summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-01-24 03:02:10 +0000
committerNorbert Preining <norbert@preining.info>2022-01-24 03:02:10 +0000
commit17f5b660e0ce0c5c1b1dc095df8213e078963809 (patch)
tree210a8643bac0dcb24683b9a8556e600ad3d1ba36 /macros
parent47551fbf494bf778f45c78692a0ff17d771b96d7 (diff)
CTAN sync 202201240302
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/chemformula/HISTORY252
-rw-r--r--macros/latex/contrib/chemformula/README15
-rw-r--r--macros/latex/contrib/chemformula/chemformula-manual.cls29
-rw-r--r--macros/latex/contrib/chemformula/chemformula-manual.pdfbin899303 -> 851188 bytes
-rw-r--r--macros/latex/contrib/chemformula/chemformula-manual.tex81
-rw-r--r--macros/latex/contrib/chemformula/chemformula.sty598
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx37
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin595797 -> 598876 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex22
-rw-r--r--macros/latex/contrib/ffcode/DEPENDS.txt1
-rw-r--r--macros/latex/contrib/ffcode/ffcode.pdfbin187051 -> 186877 bytes
-rw-r--r--macros/latex/contrib/ffcode/ffcode.sty21
-rw-r--r--macros/latex/contrib/ffcode/ffcode.tex2
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin490739 -> 499106 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex181
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx1016
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.ins4
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin1434511 -> 1482850 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin70955 -> 71880 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.sty138
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex28
21 files changed, 1656 insertions, 769 deletions
diff --git a/macros/latex/contrib/chemformula/HISTORY b/macros/latex/contrib/chemformula/HISTORY
new file mode 100644
index 0000000000..0cc66d3a76
--- /dev/null
+++ b/macros/latex/contrib/chemformula/HISTORY
@@ -0,0 +1,252 @@
+--------------------------------------------------------------------------
+the CHEMFORMULA package
+
+ typeset chemical compounds and reactions
+
+--------------------------------------------------------------------------
+Clemens Niederberger
+--------------------------------------------------------------------------
+https://github.com/cgnieder/chemformula/
+contact@mychemistry.eu
+--------------------------------------------------------------------------
+If you have any ideas, questions, suggestions or bugs to report, please
+feel free to contact me.
+--------------------------------------------------------------------------
+Copyright 2011--2022 Clemens Niederberger
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Clemens Niederberger.
+--------------------------------------------------------------------------
+VERSION HISTORY
+2012/01/28 - version 3.0 - bundled with packages `chemmacros' and `ghs'
+2012/01/30 - version 3.0a - bugfix
+ - renamed formula => chemformula
+ (following a request by Karl Berry for TeXlive)
+2012/02/03 - version 3.0b - stepped number with `chemmacros'
+2012/02/05 - version 3.0c - stepped number with `chemmacros'
+2012/02/10 - version 3.0d - several bugfixes
+ - new arrow type <>
+2012/02/19 - version 3.1 - new arrow types -/>, </- and <o>
+ - new commands \DeclareChemArrow, \RenewChemArrow and
+ \ShowChemArrow
+2012/02/26 - version 3.1a - stepped number with `chemmacros'
+2012/03/03 - version 3.1b - arrow types are stored in a sequence to automate the
+ search and replace in the right order
+ - new arrow type ==
+ - IUPAC compliance for stoichiometric factors
+ - new handling of super- and subscripts to correct
+ various flaws: clear distinction between isotope and
+ formula
+ - new option charge-vshift
+2012/03/14 - version 3.1c - improved arrow labels
+2012/03/20 - version 3.2 - new: option input via @{<options>}
+2012/05/07 - version 3.3 - \ch now bypasses \ref{}, \label{}, and \intertext{}
+2012/05/13 - version 3.3a - stepped number with `chemmacros'
+2012/05/18 - version 3.3b - stepped number with `chemmacros'
+2012/05/18 - version 3.3c - stepped number with `chemmacros'
+2012/07/24 - version 3.3d - stepped number with `chemmacros'
+ - default bond length set to 1.1667ex
+ - bug fix in the bonds
+2012/08/21 - version 3.3e - stepped number with `chemmacros'
+2012/09/11 - version 3.4 - cleaned a little, minor bug fixes
+ - switched to internal scratch variables
+ - new command \bond, more bond types
+ - new commands \DeclareChemBond, \DeclareChemBondAlias,
+ \RenewChemBond and \ShowChemBond
+ - radical point thicker, new options `radical-style'
+ and `radical-radius'
+2012/10/03 - version 3.4a - stepped number with `chemmacros'
+2013/01/04 - version 3.4b - bug fix in the sub- and superscript handling
+2013/01/28 - version 3.5 - disallow breaks at bonds
+ - allow breaks after arrows
+ - made some spaces in chemformulas stretch- and
+ shrinkable
+ - various internal code improvements
+ - changed defaults for horizontal spaces that have in
+ set in ex into corresponding values in em.
+ - improvements to the placement of sub- and superscripts
+2013/02/19 - version 3.5a - stepped number with `chemmacros'
+2013/02/26 - version 3.6 - support for use with the `breqn' package
+ - math escaping also via \(\)
+ - internal: clearer escaping macros
+ - new options: `radical-vshift', `radical-hshift'
+ and `radical-space'
+ - bug fix: `radical-...' options are now correctly set
+ - stoichiometric factors: add leading 0 if missing
+ - new option: `stoich-paren-parse'
+ - internal changes: be way more rigid about protected
+ and expandable macros
+ - internal changes: clearer distinction between
+ private macros and accessable module macros
+ - internal changes: clearer distinction between
+ document commands and module level commands
+ - !()() syntax now also works with babel's French
+2013/02/27 - version 3.6a - bug fix: escaped text and math stays escaped, i.e.
+ also arrow code like `<=>'
+2013/04/19 - version 3.6b - new option `arrow-min-length'
+ - bug fix: stoichiometric fractions correctly displayed
+2013/07/06 - version 4.0 - don't need `chemmacros' package any more,
+ `chemformula' can be used stand-alone;
+ this has lead to a few definitions that previously
+ were done by chemmacros; chemmacros will get them
+ now from chemformula when needed
+ - bug fix: allow braces in subscripts and superscripts
+ by disabling superfluous \chemformula_subscript:n
+ and \chemformula_superscript:n in the scripts write
+ commands
+ - remove superfluous rescanning at the begin of the
+ formula input; this is handled by the sanitize
+ command later anyway
+ - changed internal mathshifts from $ ... $ to \( ... \)
+ - removed superfluous \textstyle from math-frac
+ definition
+ - new command \charrow{}[][] that allows direct
+ access to chemformula's arrows
+ - new command \chname()() that allows direct access
+ to chemformula's naming
+ - new command \chcpd[]{} that allows typesetting a
+ simple single formula - also not nestable with \ch
+ - new command \setchemformula
+ - package option: `strict'
+ - don't allow a line break before a plus
+ (`chem-and')
+ - don't allow a line break between a stoichiometric
+ factor and a compound
+ - changed formal charges to match ``plain'' charges
+2013/07/26 - version 4.0a - added options `arrow-penalty' (0), `plus-penalty'
+ (700) and `bond-penalty' (10000) that determine if
+ there may be a break after an arrow, a bond or the
+ plus
+2013/08/24 - version 4.1 - changed `0' values in TikZ coordinates into `0pt'
+ see http://tex.stackexchange.com/q/128792/5049 and
+ http://tex.stackexchange.com/q/118467/5049 for
+ reference
+ - new option `tikz-external-disable'
+ - new option `frac-math-cmd'
+2013/10/24 - version 4.2 - \chemformula_font_inner: is only applied /once/ to
+ a formula, and at the beginning, fixes
+ https://bitbucket.org/cgnieder/chemmacros/issue/23
+ - fixed wrong setting of the TikZ bond style
+ - new option `arrow-style'
+ - new command \chlewis
+2013/11/04 - version 4.2a - bug fix in \chcpd,
+ - change sanitizing/restoring of category codes
+2014/01/24 - version 4.3 - changed behaviour of \DeclareChem to match
+ \DeclareRobustCommand, i.e., no check if command
+ is defined; added a \NewChem variant to each that
+ /does/ check; use \NewChem instead of \DeclareChem
+ for definitions
+ - new option stoich-print
+ - new command \chstoich
+2014/01/29 - version 4.4 - treat a single `-' as a minus sign
+2014/04/07 - version 4.5 - make sure that < and > have catcode 12 when read
+ as parts of arrows
+ - new arrow types `>=<', `>=<<', `>>=<' and `<==>'
+ - arrow lengths and compound offset now correctly
+ adapts to new fontsize if relative lengths (em,ex)
+ are used
+ - allow optional arguments to \\ in equation
+ environments
+ - allow optional arguments to \label in equation
+ environments
+ (credits: http://tex.stackexchange.com/a/166661/5049)
+ - support for Kröger-Vink notation
+2014/06/30 - version 4.6 - fix: a comma in a superscript is typeset according
+ to `decimal-marker' again
+ - fix charge type behaviour: option `circled' and
+ `circletype' are now obeyed if the option is
+ changed mid-document
+ - new option `chemformula/circled' similar to
+ `chemmacros/circled'
+ - new option `chemformula/circletype' similar to
+ `chemmacros/circletype'
+2014/08/04 - version 4.7 - change dependency: pgf library `arrows.meta'
+ instead of `arrows'
+ - new arrow tip definition allows redeclaration to
+ other existing tips by \pgfkeys{cf/.tip=<tip>}
+2014/08/08 - version 4.8 - fix bug introduced in last update: `butt cap' now
+ needs to be `Butt Cap' with the new `arrows.meta'
+ library
+ - split from `chemmacros' bundle as independent
+ package
+2014/10/07 - version 4.9 - new options: `minus-space', `minus-penalty',
+ `plus-output-symbol' and `minus-output-symbol'
+2015/03/16 - version 4.10 - new macros \NewChemCompoundProperty,
+ \RenewChemCompoundProperty,
+ \DeclareChemCompoundProperty,
+ \RemoveChemCompoundProperty
+2015/04/03 - version 4.10a - bug fix in \__chemformula_input_stoich:n
+2015/06/30 - version 4.11 - small changes in \chcpd
+ - remove unnecessary \mathchoice => noticable speed
+ improvement
+ - \NewChemAdditionSymbol
+ - \NewChemSymbol
+2015/08/12 - version 4.12 - remove chemmacros' `circletype' and `circled'
+ options. They really belong to chemmacros
+ - change requirement amsmath -> amstext
+ - shorten definition of double and triple bonds
+2015/08/29 - version 4.12a - \chemformula_formal_plus: ,
+ \chemformula_formal_minus:
+ \ProvideChem... equivalents to all \NewChem...
+ macros
+2015/09/08 - version 4.12b - trim spaces of \ch input -- due to a change in
+ l3kernel
+2015/01/01 - version 4.13 - clean up code
+ - check for blank input
+ - drop support for \[ and \]
+ - new option `atom-format'
+2015/10/21 - version 4.14 - fix issue
+ https://github.com/cgnieder/chemformula/issues/2
+ - new option `adduct-penalty'
+2016/01/07 - version 4.14a - \prop_get:Nn => \prop_item:Nn
+2016/05/03 - version 4.14b - local options now are correctly working again
+ - `atom-format' is only applied to formulas
+2016/05/11 - version 4.15 - arrow definitions don't have to be made in a
+ certain order any more
+ - new quasi equilibria arrows
+ - bug fix in \RenewChemArrow
+ - meaningful error if \charrow if used with an
+ unknown arrow type
+2016/06/08 - version 4.15a - change requirement amstext -> amsmath; \chname
+ uses \underset which needs amsmath
+2016/06/08 - version 4.15b - add missing variant of kernel function
+2016/08/21 - version 4.15c - corrected redundant definition of
+ \chemformula_single_bond:
+ - fix problem with TikZ externalization and
+ Kroeger-Vink notation
+2017/02/02 - version 4.15d - allow `name-format' to end with a macro that
+ takes an argument
+2017/03/23 - version 4.15e - small bug fix (issue #5)
+ - implement \shortintertext bypass
+2019/09/23 - version 4.15f - add missing definition for temporary variable
+2019/09/27 - version 4.15g - bug fix in fontspec option
+2019/10/13 - version 4.15h - new (undocumented) option `set-catcodes'
+ - fix behaviour with category codes
+ (https://tex.stackexchange.com/q/511592/)
+ - fix bug: local format changes are now applied
+ again
+2020/02/01 - version 4.15i - fix issue #12
+2020/03/07 - version 4.15j - make sure that < and > have catcode 12 when read
+ as arrows -- again...
+2020/03/15 - version 4.15k - fix https://tex.stackexchange.com/questions/532674/
+2020/12/22 - version 4.16 - new option `math-scripts'
+ - use LaTeX's new hooks
+ - get rid of unnecessary package dependencies
+2022/01/23 - version 4.17 - adjust options `stoich-print' and `frac-math-cmd'
+ and correct bug in `stoich-print'
+ - deprecate `stoich-print' and introduce `stoich-format'
+ - lazy boolean evaluation where possible
+ - fix deprecated file hook
+ - implement issue #17
+ - fix issue #18
+ - fix issue #19
+ - fix typos in code
diff --git a/macros/latex/contrib/chemformula/README b/macros/latex/contrib/chemformula/README
index c25182cc82..fd8728046b 100644
--- a/macros/latex/contrib/chemformula/README
+++ b/macros/latex/contrib/chemformula/README
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
-the CHEMFORMULA package v4.16 2020/12/22
+the CHEMFORMULA package v4.17 2022/01/23
typeset chemical compounds and reactions
@@ -8,7 +8,7 @@ Clemens Niederberger
Web: https://github.com/cgnieder/chemformula/
E-Mail: contact@mychemistry.eu
--------------------------------------------------------------------------
-Copyright 2011--2020 Clemens Niederberger
+Copyright 2011--2022 Clemens Niederberger
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
@@ -23,9 +23,14 @@ This work has the LPPL maintenance status `maintained'.
The Current Maintainer of this work is Clemens Niederberger.
--------------------------------------------------------------------------
The chemformula package consists of the following files
- - chemformula.sty,
- - chemformula-manual.cls, chemformula-manual.tex, chemformula-manual.pdf,
- - README
+ == STYLE FILES ==
+ chemformula.sty
+ == DOCUMENTATION FILES ==
+ chemformula-manual.tex
+ chemformula-manual.pdf
+ chemformula-manual.cls
+ README
+ HISTORY
--------------------------------------------------------------------------
If you have any ideas, questions, suggestions or bugs to report, please
feel free to contact me.
diff --git a/macros/latex/contrib/chemformula/chemformula-manual.cls b/macros/latex/contrib/chemformula/chemformula-manual.cls
index e9da59b2c5..0c0061d1a4 100644
--- a/macros/latex/contrib/chemformula/chemformula-manual.cls
+++ b/macros/latex/contrib/chemformula/chemformula-manual.cls
@@ -12,7 +12,7 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-% Copyright 2011--2020 Clemens Niederberger
+% Copyright 2011--2022 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -26,7 +26,7 @@
%
% The Current Maintainer of this work is Clemens Niederberger.
% --------------------------------------------------------------------------
-\ProvidesClass{chemformula-manual}[2020/02/01]
+\ProvidesClass{chemformula-manual}[2022/01/23]
\LoadClass[load-preamble,add-index]{cnltx-doc}
\RequirePackage{imakeidx}
@@ -301,6 +301,30 @@
\itemize\let\change\item
}{\enditemize}
+\chemsetup{
+ greek = newtx ,
+ formula = chemformula ,
+ chemformula/format = \libertineLF
+}
+
+\usepackage{acro}
+\acsetup{
+ format/long = \scshape ,
+ format/short = \scshape
+}
+\DeclareAcronym{iupac}{
+ short = iupac ,
+ long = International Union of Pure and Applied Chemistry ,
+ pdfstring = IUPAC ,
+ short-acc = IUPAC
+}
+
+\sisetup{
+ detect-mode=false,
+ mode=text,
+ text-font-command=\libertineLF
+}
+
\chemformula@add@version{2012-01-28}{3.0}
\chemformula@add@version{2012-01-30}{3.0a}
\chemformula@add@version{2012-02-03}{3.0b}
@@ -360,5 +384,6 @@
\chemformula@add@version{2020-03-07}{4.15j}
\chemformula@add@version{2020-03-15}{4.15k}
\chemformula@add@version{2020-12-22}{4.16}
+\chemformula@add@version{2022-01-23}{4.17}
\endinput
diff --git a/macros/latex/contrib/chemformula/chemformula-manual.pdf b/macros/latex/contrib/chemformula/chemformula-manual.pdf
index 6ce31cd5de..a313fc06d2 100644
--- a/macros/latex/contrib/chemformula/chemformula-manual.pdf
+++ b/macros/latex/contrib/chemformula/chemformula-manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/chemformula/chemformula-manual.tex b/macros/latex/contrib/chemformula/chemformula-manual.tex
index 00b7b2aa89..e1d592a263 100644
--- a/macros/latex/contrib/chemformula/chemformula-manual.tex
+++ b/macros/latex/contrib/chemformula/chemformula-manual.tex
@@ -1,5 +1,5 @@
-% !arara: pdflatex
-% !arara: biber
+% arara: pdflatex
+% arara: biber
% arara: pdflatex
% arara: pdflatex
% --------------------------------------------------------------------------
@@ -16,7 +16,7 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-% Copyright 2011--2020 Clemens Niederberger
+% Copyright 2011--2022 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -33,31 +33,6 @@
\documentclass{chemformula-manual}
\addbibresource{cnltx.bib}
-
-\chemsetup{
- greek = newtx ,
- formula = chemformula ,
- chemformula/format = \libertineLF
-}
-
-\usepackage{acro}
-\acsetup{
- format/long = \scshape ,
- format/short = \scshape
-}
-\DeclareAcronym{iupac}{
- short = iupac ,
- long = International Union of Pure and Applied Chemistry ,
- pdfstring = IUPAC ,
- short-acc = IUPAC
-}
-
-\sisetup{
- detect-mode=false,
- mode=text,
- text-rm=\libertineLF
-}
-
\addbibresource{\jobname.bib}
\begin{filecontents*}{\jobname.bib}
@book{iupac:greenbook,
@@ -231,28 +206,29 @@ parentheses in the \acs{iupac} Green Book~\cite{iupac:greenbook}:
(1/5) K "\ox{7,Mn}" O4 + (8/5) HCl == (1/5) "\ox{2,Mn}" Cl2 + (1/2) Cl2 + (1/5) KCl + (4/5) H2O
\end{reaction*}
-There are a few possibilities to customize the output.
+There are a few possibilities to customize the output:
\begin{options}
\keyval{decimal-marker}{marker}\Default{.}
The symbol to indicate the decimal.
\keychoice{frac-style}{math,xfrac,nicefrac}\Default{math}
Determines how fractions are displayed.
- \keyval{frac-math-cmd}{command sequence}\Default{\cs*{frac}}
- \sinceversion{4.1}Allows you to choose which command is used with
- \keyis{frac-style}{math}. This needs to be a command sequence that takes
- two arguments that are set in math mode.
+ \keyval{frac-math-cmd}{command sequence}\Default{\cs*{frac}\Marg{\#1}\Marg{\#2}}
+ \changedversion{4.17}Allows you to choose which command is used with
+ \keyis{frac-style}{math}.
\keyval{stoich-space}{skip}\Default{.1667em plus .0333em minus .0117em}
The space that is placed after the stoichiometric factor. A rubber
length.
\keybool{stoich-paren-parse}\Default{false}
If set to true stoichiometric factors enclosed by parentheses also are
parsed.
- \keyval{stoich-print}{cs}\Default{\cs{chstoich}}
- This option allows to redefine the macro that prints the stoichiometric
- factors. \meta{cs} should be a macro that takes one mandatory argument.
- \emph{Please note that using this option will disable \chemformula's
- stoichiometric parsing as that is done by the default command
- \cs{chstoich}.}
+ \keyval{stoich-format}{code}\Default
+ \sinceversion{4.17}Allows formatting of the stoichiometric factors. The
+ last macro given may take an argument.
+ \keyval{stoich-print}{code containing \#1}\Default{\#1}
+ \changedversion{4.17}This option allows to use specify a macro for
+ printing the stoichiometric factors where \code{\#1} represents the
+ factor. \emph{This option is depecated and will be removed some time in
+ the future. Use \option{stoich-format} instead.}
\end{options}
\begin{example}
@@ -360,11 +336,6 @@ expands.
\end{sourcecode}
See section~\ref{ssec:text} for a way around this.
-Please also note that formulas are placed inside a group!
-\begin{example}[side-by-side]
- \ch{A2\color{red}B3 C4}
-\end{example}
-
\subsection{Charges and Other Superscripts}
\paragraph{Basics}
If a compound \emph{ends} with a plus or minus sign it will be treated as
@@ -870,7 +841,7 @@ the spacing. That's why there is an alternative:
\end{commands}
\begin{example}
\ch{H2O +}\textcolor{red}{\ch{H2SO4}}\ch{-> H3O+ + HSO4-} \par
- \ch{H2O + @{format=\color{red}} H2SO4 -> H3O+ + HSO4-} \par
+ \ch{H2O + @{atom-format=\color{red}} H2SO4 -> H3O+ + HSO4-} \par
or of course:\par
\ch{H2O + \textcolor{red}{H2SO4} -> H3O+ + HSO4-}\par\bigskip
\ch{H2O +}\ch[subscript-vshift=2pt]{H2SO4}\ch{-> H3O+ + HSO4-} \par
@@ -1020,6 +991,16 @@ of the labels. What stays constant is the part that protrudes the labels.
\ch{A ->[ "\chemfig{-[:30]-[:-30]OH}" ] B} \par
\end{example}
+The\sinceversion{4.17} labels are typeset inside of a \env*{tabular}\Marg{c}
+environment. This means you can get several lines:
+\begin{example}[side-by-side]
+ \ch{A ->[{a\\b}] B} \par
+ \ch{A ->[a \newline b] B}
+\end{example}
+The command \cs*{\textbackslash} must be hidden in order to
+work. \cs*{tabularnewline} does work, of course. For convenience \chemformula\
+also allows \cs*{newline} here.
+
\subsection{Customization}
These are the options which enable you to customize the arrows:
\begin{options}
@@ -1192,7 +1173,8 @@ creating a name you only have to make sure it isn't followed by parentheses.
\chemformula\ provides two options to customize the output of the names:
\begin{options}
\keyval{name-format}{commands}\Default{\cs*{scriptsize}\cs*{centering}}
- The format of the name. This can be arbitrary input.
+ \changedversion{4.15d}The format of the name. This can be arbitrary input
+ and the last macro may receive the name as an argument.
\keychoice{name-width}{\meta{dim},auto}\Default{auto}
The width of the box where the label is put into. \code{auto} will detect
the width of the name and set the box to this width.
@@ -1578,6 +1560,13 @@ There are a number of options for customizations:
and code.
\end{changes}
+\begin{changes}{4.17}
+ \change Various bug fixes.
+ \change Lazy boolean evaluation where possible.
+ \change Place arrow's arguments in a tabular. This allows for multiple
+ lines.
+\end{changes}
+
\printbibliography
\end{document}
diff --git a/macros/latex/contrib/chemformula/chemformula.sty b/macros/latex/contrib/chemformula/chemformula.sty
index 4ba76f16b5..3a7b1d94a1 100644
--- a/macros/latex/contrib/chemformula/chemformula.sty
+++ b/macros/latex/contrib/chemformula/chemformula.sty
@@ -12,7 +12,7 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-% Copyright 2011--2020 Clemens Niederberger
+% Copyright 2011--2022 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -30,8 +30,8 @@
\usetikzlibrary{arrows.meta}
\ExplSyntaxOn
-\tl_const:Nn \c_chemformula_date_tl {2020/12/22}
-\tl_const:Nn \c_chemformula_version_number_tl {4.16}
+\tl_const:Nn \c_chemformula_date_tl {2022/01/23}
+\tl_const:Nn \c_chemformula_version_number_tl {4.17}
\tl_const:Nn \c_chemformula_version_suffix_tl {}
\tl_const:Nx \c_chemformula_version_tl
{ \c_chemformula_version_number_tl \c_chemformula_version_suffix_tl }
@@ -128,14 +128,50 @@
\NewChemSymbol \c_space_tl but~ a~ symbol~ `#1'~ doesn't~ exist.
}
+\msg_new:nnn {chemformula} {deprecated}
+ {
+ On~ line~ \msg_line_number: : \\
+ The~ #1~ `#2'~ is~ deprecated.~ Use~ #1~ `#3'~ instead .
+ }
+
+\msg_new:nnn {chemformula} {deprecated-function}
+ { The~ command~ #1~ is~ deprecated.~ Use~ #2 instead . }
+
+\msg_new:nnn {chemformula} {removed-function}
+ { The~ command~ #1~ has~ been~ removed. }
+
+\msg_new:nnn {chemformula} {removed}
+ {
+ On~ line~ \msg_line_number: : \\
+ The~ #1~ `#2'~ has~ been~ removed~ from~ chemformula. \\
+ If~ you~ need~ it~ back~ please~ open~ an~ issue~ on~ \\
+ https://github.com/cgnieder/chemformula/issues
+ \tl_if_blank:nF {#3} { \\ #3 }
+ }
+
+\msg_new:nnn {chemformula} {load-time-option}
+ {
+ `#1'~ is~ a~ load-time~ option! \\
+ You~ cannot~ set~ it~ with~ \token_to_str:N \setchemformula ! \\
+ You~ need~ to~ use~ \token_to_str:N \usepackage [#1] {chemformula} .
+ }
+
+\msg_new:nnn {chemformula} {unknown-option}
+ {
+ Unknown~ option~ `#1' \\
+ I~ dont'~ know~ the~ option~ `#1'.~ Please~ make~ sure~ there~ is~ no~
+ typo.~ Check~ the~ manual~ for~ help.
+ }
+
% --------------------------------------------------------------------------
% variants of kernel functions:
\cs_generate_variant:Nn \keys_set:nn {nV}
\cs_generate_variant:Nn \tl_if_blank:nF {V}
\cs_generate_variant:Nn \tl_if_in:nnT {x,nV}
\cs_generate_variant:Nn \tl_if_eq:nnT {V,x}
-\cs_generate_variant:Nn \tl_if_eq:nnTF {o}
-\cs_generate_variant:Nn \tl_set:Nn {cV}
+\cs_generate_variant:Nn \tl_if_eq:nnTF {o,V}
+\cs_generate_variant:Nn \tl_set:Nn {cV,Ne}
+\cs_generate_variant:Nn \tl_put_right:Nn {Ne}
\cs_generate_variant:Nn \tl_replace_all:Nnn {NV,Nnx}
\cs_generate_variant:Nn \tl_replace_once:Nnn {Nxx}
\cs_generate_variant:Nn \tl_set_rescan:Nnn {NnV}
@@ -168,6 +204,7 @@
\bool_new:N \l__chemformula_tmpa_bool
% booleans
+\bool_new:N \l__chemformula_debug_bool
\bool_new:N \l_chemformula_inside_ch_bool
\bool_new:N \l_chemformula_formal_charges_bool
\bool_new:N \l_chemformula_formal_chem_bool
@@ -178,6 +215,7 @@
\bool_new:N \l__chemformula_is_addition_symbol_bool
\bool_new:N \l__chemformula_is_symbol_bool
\bool_new:N \l__chemformula_is_arrow_bool
+\bool_new:N \l__chemformula_arrow_has_options_bool
\bool_new:N \l__chemformula_is_name_bool
\bool_new:N \l__chemformula_stoich_is_iupac_bool
\bool_new:N \l__chemformula_stoich_parse_iupac_bool
@@ -265,6 +303,7 @@
\tl_new:N \g__chemformula_output_tl
\tl_new:N \l__chemformula_input_tl
\tl_new:N \l__chemformula_stoich_tl
+\tl_new:N \l__chemformula_stoich_format_tl
\tl_new:N \l__chemformula_decimal_output_tl
\tl_new:N \l__chemformula_font_family_tl
\tl_new:N \l__chemformula_font_series_tl
@@ -365,6 +404,89 @@
\skip_set:Nn \l__chemformula_stoich_space_skip { .1667em plus .0333em minus .0117em }
\skip_set:Nn \l__chemformula_math_space_skip { .1667em plus .0333em minus .0117em }
+% ----------------------------------------------------------------------------
+% debugging
+\prg_new_conditional:Npnn \__chemformula_if_debug: {T,F,TF}
+ {
+ \bool_if:NTF \l__chemformula_debug_bool
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+% ----------------------------------------------------------------------------
+% deprecation & removal:
+% #1: type
+% #2: old
+% #3: new
+\cs_new_protected:Npn \__chemformula_deprecation_warning:nnn #1#2#3
+ { \msg_warning:nnnnn {chemformula} {deprecated} {#1} {#2} {#3} }
+\cs_generate_variant:Nn \__chemformula_deprecation_warning:nnn {nne,nV}
+
+% #1: type
+% #2: old
+% #3: additional text
+\cs_new_protected:Npn \chemformula_removal_warning:nnn #1#2#3
+ { \msg_warning:nnnnn {chemformula} {removed} {#1} {#2} {#3} }
+\cs_generate_variant:Nn \chemformula_removal_warning:nnn {nV}
+
+% #1: type
+% #2: old
+\cs_new_protected:Npn \chemformula_removal_warning:nn #1#2
+ { \msg_warning:nnnn {chemformula} {removed} {#1} {#2} }
+\cs_generate_variant:Nn \chemformula_removal_warning:nn {nV}
+
+% #1: new
+\cs_new_protected:Npn \chemformula_deprecate_option:n #1
+ { \__chemformula_deprecation_warning:nVn {option} \l_keys_key_str {#1} }
+
+% #1: additional text
+\cs_new_protected:Npn \chemformula_remove_option:n #1
+ { \chemformula_removal_warning:nVn {option} \l_keys_key_str {#1} }
+
+\cs_new_protected:Npn \chemformula_remove_option:
+ { \chemformula_removal_warning:nV {option} \l_keys_key_str }
+
+% #1: old
+% #2: new
+\cs_new_protected:Npn \chemformula_deprecate_function:NN #1#2
+ {
+ \cs_set_protected:Npn #1
+ {
+ \msg_error:nnnn {chemformula} {deprecated-function} {#1} {#2}
+ #2
+ }
+ }
+
+% #1: old
+\cs_new_protected:Npn \chemformula_remove_function:N #1
+ {
+ \cs_set_protected:Npn #1
+ { \msg_error:nnn {chemformula} {removed-function} {#1} }
+ }
+
+% --------------------------------------------------------------------------
+% load-time options:
+\cs_new_protected:Npn \__chemformula_loadtime_error:n #1
+ { \msg_error:nnV {chemformula} {#1} \l_keys_key_str }
+
+\cs_new_protected:Npn \__chemformula_loadtime_warning:n #1
+ { \msg_warning:nnV {chemformula} {#1} \l_keys_key_str }
+
+\keys_define:nn {chemformula/load-time}
+ {
+ debug .bool_set:N = \l__chemformula_debug_bool ,
+ debug .initial:n = false
+ }
+
+\ProcessKeysPackageOptions {chemformula/load-time}
+
+\keys_define:nn {chemformula}
+ {
+ debug .code:n = \__chemformula_loadtime_error:n {load-time-option} ,
+ unknown .code:n = \__chemformula_loadtime_warning:n {unknown-option} ,
+ load-time / debug .meta:nn = {chemformula} {debug}
+ }
+
% --------------------------------------------------------------------------
% catcode stuff
\cs_new_protected:Npn \__chemformula_save_catcodes:
@@ -413,8 +535,8 @@
{
\__chemformula_basic_catcodes:
% disable some of the specials (needed for sub- and superscripts):
- \char_set_catcode_letter:N \{
- \char_set_catcode_letter:N \}
+ \char_set_catcode_other:N \{
+ \char_set_catcode_other:N \}
}
{#2}
}
@@ -891,9 +1013,17 @@
{ \__chemformula_basic_catcodes: } {#1}
% determine length of the arrow
\hbox_set:Nn \l__chemformula_arrow_arg_i_box
- { \tl_use:N \l__chemformula_arrow_label_style_tl #2 }
+ {
+ \tl_use:N \l__chemformula_arrow_label_style_tl
+ \cs_set:Npn \newline { \tabularnewline }
+ \begin {tabular} {c} #2 \end {tabular}
+ }
\hbox_set:Nn \l__chemformula_arrow_arg_ii_box
- { \tl_use:N \l__chemformula_arrow_label_style_tl #3 }
+ {
+ \tl_use:N \l__chemformula_arrow_label_style_tl
+ \cs_set:Npn \newline { \tabularnewline }
+ \begin {tabular} {c} #3 \end {tabular}
+ }
\__chemformula_determine_arrow_length:NN
\l__chemformula_arrow_arg_i_box
\l__chemformula_arrow_arg_ii_box
@@ -1124,37 +1254,42 @@
% --------------------------------------------------------------------------
% MAIN COMMAND
-\cs_new_protected:Npn \__chemformula_ch_main:n #1
+\cs_set_protected:Npn \__chemformula_ch_main:n #1
{
\group_begin:
% abort if `#1' is blank:
\tl_if_blank:nF {#1}
{
- \tl_set:Nn \l__chemmacros_tmpa_tl {#1}
- \tl_trim_spaces:N \l__chemmacros_tmpa_tl
- \seq_set_split:NnV \l__chemformula_input_seq {~} \l__chemmacros_tmpa_tl
- % remove empty items in order to avoid unnecessary processing:
- \seq_remove_all:Nn \l__chemformula_input_seq {}
% disable \xspace:
\cs_set_eq:NN \xspace \scan_stop:
\bool_set_true:N \l_chemformula_inside_ch_bool
\tl_if_blank:VF \g__chemformula_options_tl
- {
- \keys_set:nV
- {chemformula}
- \g__chemformula_options_tl
- }
- \seq_map_function:NN
- \l__chemformula_input_seq
- \__chemformula_input:n
+ { \keys_set:nV {chemformula} \g__chemformula_options_tl }
+ \__chemformula_read_input:n {#1}
\__chemformula_prepare_output:NV
\l__chemformula_input_tl
\l__chemformula_catcodes_tl
\chemformula_write:V \l__chemformula_input_tl
+ \__chemformula_if_debug:T { \tl_show:N \l__chemformula_input_tl }
}
\group_end:
}
+\cs_new_protected:Npn \__chemformula_read_input:n #1
+ { \__chemformula_read_input:w #1 ~ \q_stop }
+\cs_generate_variant:Nn \__chemformula_read_input:n {V}
+
+\cs_new_protected:Npn \__chemformula_read_input:w #1 ~ #2 \q_stop
+ {
+ \__chemformula_input:n {#1}
+ \tl_set:Nn \l__chemformula_tmpa_tl {#2}
+ \tl_if_blank:VF \l__chemformula_tmpa_tl
+ {
+ \tl_trim_spaces:N \l__chemformula_tmpa_tl
+ \__chemformula_read_input:V \l__chemformula_tmpa_tl
+ }
+ }
+
\cs_new_protected:Npn \chemformula_write:n #1
{
\mode_if_math:TF
@@ -1171,7 +1306,7 @@
\tl_if_blank:nTF {#1}
{ \tl_gclear:N \g__chemformula_options_tl }
{ \tl_gset:Nn \g__chemformula_options_tl {#1} }
- \__chemformula_ch_newline:w #2 \\ \q_no_value \q_stop
+ \__chemformula_ch_newline:w #2 \\ \q_nil \q_stop
\group_align_safe_end:
\tl_use:N \g__chemformula_output_tl
\tl_gclear:N \g__chemformula_output_tl
@@ -1182,8 +1317,8 @@
% bypass \\:
\cs_new_protected:Npn \__chemformula_ch_newline:w #1 \\ #2 \q_stop
{
- \__chemformula_ch_align:w #1 & \q_no_value \q_stop
- \quark_if_no_value:nF {#2}
+ \__chemformula_ch_align:w #1 & \q_nil \q_stop
+ \quark_if_nil:nF {#2}
{
\tl_gput_right:Nn \g__chemformula_output_tl { \\ }
% look for optional argument:
@@ -1203,8 +1338,8 @@
% bypass &:
\cs_new_protected:Npn \__chemformula_ch_align:w #1 & #2 \q_stop
{
- \__chemformula_ch_intertext:w #1 \intertext{} \q_no_value \q_stop
- \quark_if_no_value:nF {#2}
+ \__chemformula_ch_intertext:w #1 \intertext{} \q_nil \q_stop
+ \quark_if_nil:nF {#2}
{
\tl_gput_right:Nn \g__chemformula_output_tl {&}
\__chemformula_ch_align:w #2 \q_stop
@@ -1214,8 +1349,8 @@
% bypass \intertext:
\cs_new_protected:Npn \__chemformula_ch_intertext:w #1 \intertext#2 #3 \q_stop
{
- \__chemformula_ch_shortintertext:w #1 \shortintertext{} \q_no_value \q_stop
- \quark_if_no_value:nF {#3}
+ \__chemformula_ch_shortintertext:w #1 \shortintertext{} \q_nil \q_stop
+ \quark_if_nil:nF {#3}
{
\tl_gput_right:Nn \g__chemformula_output_tl { \intertext {#2} }
\__chemformula_ch_intertext:w #3 \q_stop
@@ -1227,7 +1362,7 @@
{
\tl_gput_right:Nn \g__chemformula_output_tl
{ \__chemformula_ch_main:n {#1} }
- \quark_if_no_value:nF {#3}
+ \quark_if_nil:nF {#3}
{
\tl_gput_right:Nn \g__chemformula_output_tl { \shortintertext {#2} }
\__chemformula_ch_shortintertext:w #3 \q_stop
@@ -1330,6 +1465,11 @@
\prop_map_break:
}
}
+ \bool_if:NT \l__chemformula_is_arrow_bool
+ {
+ \tl_if_in:nnT {#1} {[}
+ { \bool_set_true:N \l__chemformula_arrow_has_options_bool }
+ }
}
% --------------------------------------------------------------------------
@@ -1348,19 +1488,11 @@
\bool_if:NF \l__chemformula_name_width_bool
{
\chemformula_dim_to_width:Nn \l__chemformula_name_dim
- {
- \group_begin:
- \l__chemformula_name_format_tl {#1}
- \group_end:
- }
+ { \chemformula_name_write:n {#1} }
}
\parbox
{ \dim_use:N \l__chemformula_name_dim }
- {
- \group_begin:
- \l__chemformula_name_format_tl {#1}
- \group_end:
- }
+ { \chemformula_name_write:n {#1} }
}
{
\text
@@ -1373,6 +1505,13 @@
\c_math_toggle_token
}
+\cs_new_protected:Npn \chemformula_name_write:n #1
+ {
+ \group_begin:
+ \l__chemformula_name_format_tl {#1}
+ \group_end:
+ }
+
\cs_new_protected:Npn \__chemformula_generate_name:Nn #1#2
{
\__chemformula_sanitize:Nn \l__chemformula_tmpa_tl {#2}
@@ -1716,7 +1855,7 @@
{
\bool_if:NTF \l__chemformula_number_style_math_bool
{ \ensuremath {#1} }
- { \ensuremath { \text {#1} } }
+ { \ensuremath { \text { { \chemformula_atom: #1 } } } }
}
\cs_generate_variant:Nn \__chemformula_number_style:n {V}
@@ -1724,7 +1863,7 @@
{
\bool_if:NTF \l__chemformula_charge_style_math_bool
{ \ensuremath {#1} }
- { \ensuremath { \text {#1} } }
+ { \ensuremath { \text { { \chemformula_atom: #1 } } } }
}
\cs_generate_variant:Nn \chemformula_charge_style:n {V}
@@ -1769,6 +1908,7 @@
}
\cs_generate_variant:Nn \__chemformula_subscript:n {V}
+
\cs_new_protected:Npn \chemformula_add_subscript_cleanup:nn #1#2
{
\seq_put_right:Nn \l__chemformula_clean_subscript_seq {#1}
@@ -2121,7 +2261,7 @@
\__chemformula_input_escape_text:V \l__chemformula_chemformula_tmpa_tl
\__chemformula_input_escape_math:n {#1}
\__chemformula_input_stoich:n {#1}
- \__chemformula_clean_chemmacros:V \l__chemformula_chemformula_tmpa_tl
+ \__chemformula_clean_chemformula:V \l__chemformula_chemformula_tmpa_tl
\__chemformula_input_compound:NV
\l__chemformula_input_tl
\l__chemformula_chemformula_tmpa_tl
@@ -2135,19 +2275,15 @@
% set options for next compound:
\cs_new_protected:Npn \__chemformula_input_options:n #1
{
- % \makeatother
- \char_set_catcode_other:N \@
- \tl_set_rescan:Nnn \l__chemformula_tmpa_tl
- { \char_set_catcode_letter:N \@ }
- {#1}
- \tl_if_in:VnTF \l__chemformula_tmpa_tl { @ }
+ \tl_set_rescan:Nnn \l__chemformula_tmpa_tl {} {#1}
+ \tl_set:Ne \l__chemformula_tmpb_tl { \tl_tail:V \l__chemformula_tmpa_tl }
+ \tl_set:Ne \l__chemformula_tmpa_tl { \tl_head:V \l__chemformula_tmpa_tl }
+ \str_if_eq:VnTF \l__chemformula_tmpa_tl {@}
{
\bool_set_false:N \l__chemformula_options_bool
\bool_set_true:N \l__chemformula_is_option_bool
- \tl_remove_all:Nn \l__chemformula_tmpa_tl { @ }
\exp_last_unbraced:Nno
- \tl_set:Nn \l__chemformula_internal_options_tl
- { \l__chemformula_tmpa_tl }
+ \tl_set:Nn \l__chemformula_internal_options_tl { \l__chemformula_tmpb_tl }
}
{ \bool_set_false:N \l__chemformula_is_option_bool }
}
@@ -2164,7 +2300,10 @@
\tl_map_inline:nn {#1}
{
\prop_if_in:NnF \l__chemformula_no_stoich_prop {##1}
- { \bool_set_false:N \l__chemformula_no_stoich_bool }
+ {
+ \bool_set_false:N \l__chemformula_no_stoich_bool
+ \tl_map_break:
+ }
}
\bool_if:NF \l__chemformula_no_stoich_bool
{
@@ -2175,7 +2314,10 @@
\bool_if:NT \l__chemformula_stoich_bool
{ \tl_put_right:NV \l__chemformula_stoich_tl \l__chemformula_tmpa_tl }
}
- { \bool_set_false:N \l__chemformula_stoich_bool }
+ {
+ \bool_set_false:N \l__chemformula_stoich_bool
+ \tl_map_break:
+ }
}
}
\bool_if:NTF \l__chemformula_stoich_bool
@@ -2186,7 +2328,7 @@
\__chemformula_sanitize:NV
\l__chemformula_stoich_tl
\l__chemformula_stoich_tl
- \__chemformula_print_stoich:V
+ \chemformula_print_stoich:V
\l__chemformula_stoich_tl
}
}
@@ -2195,15 +2337,23 @@
\cs_new_protected:Npn \chemformula_bm:n #1 {#1}
-\cs_new_protected:Npn \__chemformula_print_stoich:n #1
+\cs_new_protected:Npn \chemformula_print_stoich:n #1
{ \chemformula_parse_stoich:n {#1} }
-\cs_generate_variant:Nn \__chemformula_print_stoich:n {V}
+\cs_generate_variant:Nn \chemformula_print_stoich:n {V}
+
+\cs_new_protected:Npn \__chemformula_print_stoich:n #1
+ { { \l__chemformula_stoich_format_tl {#1} } }
\cs_new_protected:Npn \chemformula_parse_stoich:n #1
{ \__chemformula_parse_stoich:w #1 \q_nil }
\NewDocumentCommand \chstoich {m}
- { \chemformula_parse_stoich:n {#1} }
+ {
+ \group_begin:
+ \__chemformula_input_stoich:n {#1}
+ \l__chemformula_input_tl
+ \group_end:
+ }
\cs_new_protected:Npn \__chemformula_parse_stoich:w \q_mark #1 \q_nil
{
@@ -2235,8 +2385,14 @@
\tl_set:Nn \l__chemformula_tmpb_tl { \chemformula_decimal: }
% check if stoich starts with decimal-marker and add leading 0 if so:
\tl_if_eq:NNTF \l__chemformula_tmpa_tl \l__chemformula_tmpb_tl
- { \tl_put_right:Nn \l__chemformula_input_tl { 0#1 } }
- { \tl_put_right:Nn \l__chemformula_input_tl {#1} }
+ {
+ \tl_put_right:Nn \l__chemformula_input_tl
+ { \__chemformula_print_stoich:n {0#1} }
+ }
+ {
+ \tl_put_right:Nn \l__chemformula_input_tl
+ { \__chemformula_print_stoich:n {#1} }
+ }
}
\cs_new_protected:Npn \__chemformula_parse_stoich_frac:n #1
@@ -2249,20 +2405,20 @@
\cs_new_protected:Npn \__chemformula_parse_stoich_frac:w #1/#2 \q_nil
{
\tl_put_right:Nn \l__chemformula_input_tl
- { \__chemformula_frac:nn {#1} {#2} }
+ { \__chemformula_print_stoich:n { \__chemformula_frac:nn {#1} {#2} } }
}
\cs_new_protected:Npn \__chemformula_parse_stoich_misc_frac:w #1_#2/#3 \q_nil
{
\tl_put_right:Nn \l__chemformula_input_tl
- { \__chemformula_misc_frac:nnn {#1} {#2} {#3} }
+ { \__chemformula_print_stoich:n { \__chemformula_misc_frac:nnn {#1} {#2} {#3} } }
}
\cs_new_protected:Npn \__chemformula_parse_stoich_iupac:n #1
{
\bool_if:NTF \l__chemformula_stoich_parse_iupac_bool
{ \__chemformula_parse_stoich_iupac:w #1 \q_nil }
- { \tl_put_right:Nn \l__chemformula_input_tl {#1} }
+ { \tl_put_right:Nn \l__chemformula_input_tl { \__chemformula_print_stoich:n {#1} } }
}
\cs_new_protected:Npn \__chemformula_parse_stoich_iupac:w (#1) \q_nil
@@ -2304,6 +2460,9 @@
}
% --------------------------------------------------------------------------
+\cs_new_protected:Npn \chemformula_atom:
+ { \mode_if_math:F { \l__chemformula_atom_format_tl } }
+
% input compounds
\cs_new_protected:Npn \__chemformula_input_compound:Nn #1#2
{
@@ -2317,26 +2476,29 @@
\bool_if:NT \l__chemformula_is_option_bool
{
\bool_set_true:N \l__chemformula_options_bool
- \tl_put_right:Nx #1
+ \tl_put_right:Ne #1
{
\group_begin:
% open group
\keys_set:nn
{chemformula}
{ \exp_not:V \l__chemformula_internal_options_tl }
+ \chemformula_atom:
}
+ \tl_clear:N \l__chemformula_internal_options_tl
}
- \bool_if:nT
+ \bool_lazy_any:nF
{
- !\l__chemformula_is_option_bool &&
- !\l__chemformula_is_addition_symbol_bool &&
- !\l__chemformula_is_symbol_bool &&
- !\l__chemformula_is_arrow_bool &&
- !\l__chemformula_is_name_bool &&
- !\l__chemformula_first_last_text_bool &&
- !\l__chemformula_first_last_math_bool
+ { \l__chemformula_is_option_bool }
+ { \l__chemformula_is_addition_symbol_bool }
+ { \l__chemformula_is_symbol_bool }
+ { \l__chemformula_is_arrow_bool }
+ { \l__chemformula_is_name_bool }
+ { \l__chemformula_first_last_text_bool }
+ { \l__chemformula_first_last_math_bool }
}
{
+ \chemformula_atom:
\__chemformula_input_compound_no_check:Nn #1 {#2}
\bool_if:NT \l__chemformula_options_bool
{
@@ -2344,7 +2506,6 @@
{
% end group
\group_end:
- \tl_clear:N \l__chemformula_internal_options_tl
}
\bool_set_false:N \l__chemformula_options_bool
}
@@ -2497,13 +2658,6 @@
\__chemformula_if_only_parens:nTF {#2}
{ \tl_put_right:Nn #1 {#2} }
{
- % start with formatting:
- \tl_put_right:Nn #1
- {
- \tl_use:N \l__chemformula_format_tl
- \group_begin:
- \l__chemformula_atom_format_tl
- }
\__chemformula_sanitize:Nn \l__chemformula_tmpa_tl {#2}
% let's see if the compound starts with a sub- or superscript - if yes
% this is an isotope:
@@ -2526,8 +2680,15 @@
\prop_get:NnNTF \l__chemformula_compound_prop
{##1}
\l__chemformula_tmpb_tl
- { \tl_put_right:NV #1 \l__chemformula_tmpb_tl }
- { \tl_put_right:Nn #1 {##1} }
+ {
+ \tl_put_right:NV #1
+ \l__chemformula_tmpb_tl
+ }
+ {
+ \token_if_letter:NTF ##1
+ { \tl_put_right:Nn #1 { ##1 } }
+ { \tl_put_right:Nn #1 {##1} }
+ }
}
}
% if Kroeger-Vink notation is active:
@@ -2537,22 +2698,20 @@
{ \chemformula_prime: }
{ \chemformula_superscript:n { \chemformula_prime: } }
}
- % finish formatting:
- \tl_put_right:Nn #1 { \group_end: }
}
\tl_clear:N \l__chemformula_tmpa_tl
}
\cs_generate_variant:Nn \__chemformula_input_compound_no_check:Nn {NV}
% --------------------------------------------------------------------------
-% clean up chemmacros commands:
-\cs_new_protected:Npn \__chemformula_clean_chemmacros:n #1
+% clean up chemformula commands:
+\cs_new_protected:Npn \__chemformula_clean_chemformula:n #1
{
- \cs_set:Nn \chemmacros_text:n
+ \cs_set:Nn \chemformula_text:n
{ \mode_if_math:TF { \text {##1} } {##1} }
- \cs_set:Npn \chemmacros_xspace: {}
+ \cs_set:Npn \chemformula_xspace: {}
}
-\cs_generate_variant:Nn \__chemformula_clean_chemmacros:n {V}
+\cs_generate_variant:Nn \__chemformula_clean_chemformula:n {V}
% --------------------------------------------------------------------------
% input "and" sign
@@ -2733,11 +2892,11 @@
% input arrow
\cs_new_protected:Npn \__chemformula_input_arrow:n #1
{
- \bool_if:nT
+ \bool_lazy_all:nT
{
- \l__chemformula_is_arrow_bool &&
- !\l__chemformula_first_last_text_bool &&
- !\l__chemformula_first_last_math_bool
+ { \l__chemformula_is_arrow_bool }
+ { !\l__chemformula_first_last_text_bool }
+ { !\l__chemformula_first_last_math_bool }
}
{
\__chemformula_generate_arrows:Nn \l__chemformula_tmpa_tl {#1}
@@ -2751,11 +2910,11 @@
% input compound name
\cs_new_protected:Npn \__chemformula_input_name:n #1
{
- \bool_if:nT
+ \bool_lazy_all:nT
{
- \l__chemformula_is_name_bool &&
- !\l__chemformula_first_last_text_bool &&
- !\l__chemformula_first_last_math_bool
+ { \l__chemformula_is_name_bool }
+ { !\l__chemformula_first_last_text_bool }
+ { !\l__chemformula_first_last_math_bool }
}
{
\__chemformula_generate_name:Nn \l__chemformula_tmpa_tl {#1}
@@ -2961,25 +3120,24 @@
\bool_set_false:N \l__chemformula_xfrac_bool
\bool_set_true:N \l__chemformula_nicefrac_bool
\bool_set_false:N \l__chemformula_mathfrac_bool ,
- frac-math-cmd .code:n =
- { \cs_set_eq:NN \chemformula_math_frac:nn #1 } ,
+ frac-math-cmd .cs_set_protected:Np = \chemformula_math_frac:nn #1#2 ,
+ frac-math-cmd .initial:n = \frac {#1} {#2} ,
stoich-paren-parse .bool_set:N = \l__chemformula_stoich_parse_iupac_bool ,
stoich-space .skip_set:N = \l__chemformula_stoich_space_skip ,
+ stoich-format .tl_set:N = \l__chemformula_stoich_format_tl ,
stoich-print .code:n =
- \cs_set_eq:NN \chemformula_print_stoich:n #1 ,
+ \chemformula_remove_option:n {Use~ the~ option~ `stoich-format'~ instead.} ,
adduct-space .dim_set:N = \l__chemformula_adduct_space_dim ,
adduct-penalty .tl_set:N = \l__chemformula_adduct_penalty_tl ,
math-space .skip_set:N = \l__chemformula_math_space_skip ,
name-format .tl_set:N = \l__chemformula_name_format_tl ,
name-width .code:n =
- {
- \tl_if_eq:nnTF {#1} { auto }
- { \bool_set_false:N \l__chemformula_name_width_bool }
- {
- \bool_set_true:N \l__chemformula_name_width_bool
- \dim_set:Nn \l__chemformula_name_dim {#1}
- }
- } ,
+ \tl_if_eq:nnTF {#1} { auto }
+ { \bool_set_false:N \l__chemformula_name_width_bool }
+ {
+ \bool_set_true:N \l__chemformula_name_width_bool
+ \dim_set:Nn \l__chemformula_name_dim {#1}
+ } ,
bond-length .dim_set:N = \l__chemformula_bond_dim ,
bond-offset .dim_set:N = \l__chemformula_bond_space_dim ,
bond-style .code:n =
@@ -3282,7 +3440,7 @@
% --------------------------------------------------------------------------
% hyperref support
-\hook_gput_code:nnn {package/after/hyperref} {chemformula}
+\hook_gput_code:nnn {package/hyperref/after} {chemformula}
{
\pdfstringdefDisableCommands
{
@@ -3295,224 +3453,4 @@
}
\file_input_stop:
-
-% --------------------------------------------------------------------------
-VERSION HISTORY
-2012/01/28 - version 3.0 - bundled with packages `chemmacros' and `ghs'
-2012/01/30 - version 3.0a - bugfix
- - renamed formula => chemformula
- (following a request by Karl Berry for TeXlive)
-2012/02/03 - version 3.0b - stepped number with `chemmacros'
-2012/02/05 - version 3.0c - stepped number with `chemmacros'
-2012/02/10 - version 3.0d - several bugfixes
- - new arrow type <>
-2012/02/19 - version 3.1 - new arrow types -/>, </- and <o>
- - new commands \DeclareChemArrow, \RenewChemArrow and
- \ShowChemArrow
-2012/02/26 - version 3.1a - stepped number with `chemmacros'
-2012/03/03 - version 3.1b - arrow types are stored in a sequence to automate the
- search and replace in the right order
- - new arrow type ==
- - IUPAC compliance for stoichiometric factors
- - new handling of super- and subscripts to correct
- various flaws: clear distinction between isotope and
- formula
- - new option charge-vshift
-2012/03/14 - version 3.1c - improved arrow labels
-2012/03/20 - version 3.2 - new: option input via @{<options>}
-2012/05/07 - version 3.3 - \ch now bypasses \ref{}, \label{}, and \intertext{}
-2012/05/13 - version 3.3a - stepped number with `chemmacros'
-2012/05/18 - version 3.3b - stepped number with `chemmacros'
-2012/05/18 - version 3.3c - stepped number with `chemmacros'
-2012/07/24 - version 3.3d - stepped number with `chemmacros'
- - default bond length set to 1.1667ex
- - bug fix in the bonds
-2012/08/21 - version 3.3e - stepped number with `chemmacros'
-2012/09/11 - version 3.4 - cleaned a little, minor bug fixes
- - switched to internal scratch variables
- - new command \bond, more bond types
- - new commands \DeclareChemBond, \DeclareChemBondAlias,
- \RenewChemBond and \ShowChemBond
- - radical point thicker, new options `radical-style'
- and `radical-radius'
-2012/10/03 - version 3.4a - stepped number with `chemmacros'
-2013/01/04 - version 3.4b - bug fix in the sub- and superscript handling
-2013/01/28 - version 3.5 - disallow breaks at bonds
- - allow breaks after arrows
- - made some spaces in chemformulas stretch- and
- shrinkable
- - various internal code improvements
- - changed defaults for horizontal spaces that have in
- set in ex into corresponding values in em.
- - improvements to the placement of sub- and superscripts
-2013/02/19 - version 3.5a - stepped number with `chemmacros'
-2013/02/26 - version 3.6 - support for use with the `breqn' package
- - math escaping also via \(\)
- - internal: clearer escaping macros
- - new options: `radical-vshift', `radical-hshift'
- and `radical-space'
- - bug fix: `radical-...' options are now correctly set
- - stoichiometric factors: add leading 0 if missing
- - new option: `stoich-paren-parse'
- - internal changes: be way more rigid about protected
- and expandable macros
- - internal changes: clearer distinction between
- private macros and accessable module macros
- - internal changes: clearer distinction between
- document commands and module level commands
- - !()() syntax now also works with babel's French
-2013/02/27 - version 3.6a - bug fix: escaped text and math stays escaped, i.e.
- also arrow code like `<=>'
-2013/04/19 - version 3.6b - new option `arrow-min-length'
- - bug fix: stoichiometric fractions correctly displayed
-2013/07/06 - version 4.0 - don't need `chemmacros' package any more,
- `chemformula' can be used stand-alone;
- this has lead to a few definitions that previously
- were done by chemmacros; chemmacros will get them
- now from chemformula when needed
- - bug fix: allow braces in subscripts and superscripts
- by disabling superfluous \chemformula_subscript:n
- and \chemformula_superscript:n in the scripts write
- commands
- - remove superfluous rescanning at the begin of the
- formula input; this is handled by the sanitize
- command later anyway
- - changed internal mathshifts from $ ... $ to \( ... \)
- - removed superfluous \textstyle from math-frac
- definition
- - new command \charrow{}[][] that allows direct
- access to chemformula's arrows
- - new command \chname()() that allows direct access
- to chemformula's naming
- - new command \chcpd[]{} that allows typesetting a
- simple single formula - also not nestable with \ch
- - new command \setchemformula
- - package option: `strict'
- - don't allow a line break before a plus
- (`chem-and')
- - don't allow a line break between a stoichiometric
- factor and a compound
- - changed formal charges to match ``plain'' charges
-2013/07/26 - version 4.0a - added options `arrow-penalty' (0), `plus-penalty'
- (700) and `bond-penalty' (10000) that determine if
- there may be a break after an arrow, a bond or the
- plus
-2013/08/24 - version 4.1 - changed `0' values in TikZ coordinates into `0pt'
- see http://tex.stackexchange.com/q/128792/5049 and
- http://tex.stackexchange.com/q/118467/5049 for
- reference
- - new option `tikz-external-disable'
- - new option `frac-math-cmd'
-2013/10/24 - version 4.2 - \chemformula_font_inner: is only applied /once/ to
- a formula, and at the beginning, fixes
- https://bitbucket.org/cgnieder/chemmacros/issue/23
- - fixed wrong setting of the TikZ bond style
- - new option `arrow-style'
- - new command \chlewis
-2013/11/04 - version 4.2a - bug fix in \chcpd,
- - change sanitizing/restoring of category codes
-2014/01/24 - version 4.3 - changed behaviour of \DeclareChem to match
- \DeclareRobustCommand, i.e., no check if command
- is defined; added a \NewChem variant to each that
- /does/ check; use \NewChem instead of \DeclareChem
- for definitions
- - new option stoich-print
- - new command \chstoich
-2014/01/29 - version 4.4 - treat a single `-' as a minus sign
-2014/04/07 - version 4.5 - make sure that < and > have catcode 12 when read
- as parts of arrows
- - new arrow types `>=<', `>=<<', `>>=<' and `<==>'
- - arrow lengths and compound offset now correctly
- adapts to new fontsize if relative lengths (em,ex)
- are used
- - allow optional arguments to \\ in equation
- environments
- - allow optional arguments to \label in equation
- environments
- (credits: http://tex.stackexchange.com/a/166661/5049)
- - support for Kröger-Vink notation
-2014/06/30 - version 4.6 - fix: a comma in a superscript is typeset according
- to `decimal-marker' again
- - fix charge type behaviour: option `circled' and
- `circletype' are now obeyed if the option is
- changed mid-document
- - new option `chemformula/circled' similar to
- `chemmacros/circled'
- - new option `chemformula/circletype' similar to
- `chemmacros/circletype'
-2014/08/04 - version 4.7 - change dependency: pgf library `arrows.meta'
- instead of `arrows'
- - new arrow tip definition allows redeclaration to
- other existing tips by \pgfkeys{cf/.tip=<tip>}
-2014/08/08 - version 4.8 - fix bug introduced in last update: `butt cap' now
- needs to be `Butt Cap' with the new `arrows.meta'
- library
- - split from `chemmacros' bundle as independent
- package
-2014/10/07 - version 4.9 - new options: `minus-space', `minus-penalty',
- `plus-output-symbol' and `minus-output-symbol'
-2015/03/16 - version 4.10 - new macros \NewChemCompoundProperty,
- \RenewChemCompoundProperty,
- \DeclareChemCompoundProperty,
- \RemoveChemCompoundProperty
-2015/04/03 - version 4.10a - bug fix in \__chemformula_input_stoich:n
-2015/06/30 - version 4.11 - small changes in \chcpd
- - remove unnecessary \mathchoice => noticable speed
- improvement
- - \NewChemAdditionSymbol
- - \NewChemSymbol
-2015/08/12 - version 4.12 - remove chemmacros' `circletype' and `circled'
- options. They really belong to chemmacros
- - change requirement amsmath -> amstext
- - shorten definition of double and triple bonds
-2015/08/29 - version 4.12a - \chemformula_formal_plus: ,
- \chemformula_formal_minus:
- \ProvideChem... equivalents to all \NewChem...
- macros
-2015/09/08 - version 4.12b - trim spaces of \ch input -- due to a change in
- l3kernel
-2015/01/01 - version 4.13 - clean up code
- - check for blank input
- - drop support for \[ and \]
- - new option `atom-format'
-2015/10/21 - version 4.14 - fix issue
- https://github.com/cgnieder/chemformula/issues/2
- - new option `adduct-penalty'
-2016/01/07 - version 4.14a - \prop_get:Nn => \prop_item:Nn
-2016/05/03 - version 4.14b - local options now are correctly working again
- - `atom-format' is only applied to formulas
-2016/05/11 - version 4.15 - arrow definitions don't have to be made in a
- certain order any more
- - new quasi equilibria arrows
- - bug fix in \RenewChemArrow
- - meaningful error if \charrow if used with an
- unknown arrow type
-2016/06/08 - version 4.15a - change requirement amstext -> amsmath; \chname
- uses \underset which needs amsmath
-2016/06/08 - version 4.15b - add missing variant of kernel function
-2016/08/21 - version 4.15c - corrected redundant definition of
- \chemformula_single_bond:
- - fix problem with TikZ externalization and
- Kroeger-Vink notation
-2017/02/02 - version 4.15d - allow `name-format' to end with a macro that
- takes an argument
-2017/03/23 - version 4.15e - small bug fix (issue #5)
- - implement \shortintertext bypass
-2019/09/23 - version 4.15f - add missing definition for temporary variable
-2019/09/27 - version 4.15g - bug fix in fontspec option
-2019/10/13 - version 4.15h - new (undocumented) option `set-catcodes'
- - fix behaviour with category codes
- (https://tex.stackexchange.com/q/511592/)
- - fix bug: local format changes are now applied
- again
-2020/02/01 - version 4.15i - fix issue #12
-2020/03/07 - version 4.15j - make sure that < and > have catcode 12 when read
- as arrows -- again...
-2020/03/15 - version 4.15k - fix https://tex.stackexchange.com/questions/532674/
-2020/12/22 - version 4.16 - new option `math-scripts'
- - use LaTeX's new hooks
- - get rid of unnecessary package dependencies
-
% --------------------------------------------------------------------------
-% IDEAS:
-- Addukte: Zahlen nach * und . automatisch erkennen?
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 9c59694354..6bb74a2191 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2022/01/20}{1.48}
+\ProvidesExplClass{easybook}{2022/01/23}{1.50}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -305,7 +305,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2022/01/20}{1.48}
+\ProvidesExplPackage{easybase}{2022/01/23}{1.50}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -472,7 +472,7 @@
Please~browse~the~user~manual~for~the~new~options.
}
}
-\cs_new:Npn \eb_msg_abandon_option:n #1
+\cs_new_protected:Npn \eb_msg_abandon_option:n #1
{ \msg_warning:nnV { easybase } { abandon-#1 } \l_keys_key_str }
\cs_if_exist:NF \chapter
{
@@ -634,7 +634,7 @@
\exp_args:Nc \NewDocumentCommand { eb@mark@#1@label@layout }
{O{\use:c { CTEXthe#1 }}m}
{\tl_set:cn { eb@mark@#1@label } {##1##2}}
- \cs_new:cpn { eb_mark_#1_name_parse:n } ##1
+ \cs_new_protected:cpn { eb_mark_#1_name_parse:n } ##1
{
\tl_if_in:nnTF {##1} { [ }
{ \use:c { eb@mark@#1@label@layout }##1 }
@@ -761,13 +761,13 @@
{ \tl_clear:N \l__eb_fntext_after_tl }
{ \tl_set:Nn \l__eb_fntext_after_tl {#2} }
}
-\cs_new:Npn \eb_fnmate_counter_pifont:N #1
+\cs_new_protected:Npn \eb_fnmate_counter_pifont:N #1
{ \ding{\int_eval:n { 171 + #1 }} }
-\cs_new:Npn \eb_fnmate_counter_pifont_neg:N #1
+\cs_new_protected:Npn \eb_fnmate_counter_pifont_neg:N #1
{ \ding{\int_eval:n { 181 + #1 }} }
-\cs_new:Npn \eb_fnmate_counter_pisans:N #1
+\cs_new_protected:Npn \eb_fnmate_counter_pisans:N #1
{ \ding{\int_eval:n { 191 + #1 }} }
-\cs_new:Npn \eb_fnmate_counter_pisans_neg:N #1
+\cs_new_protected:Npn \eb_fnmate_counter_pisans_neg:N #1
{ \ding{\int_eval:n { 201 + #1 }} }
\cs_new_protected:Npn \DefineFntSymbols #1#2#3
{
@@ -804,13 +804,13 @@
{ plain }
{ \exp_not:N \int_use:N }
{ pifont }
- { \exp_not:N \eb_fnmate_counter_pifont:N }
+ { \eb_fnmate_counter_pifont:N }
{ pifont* }
- { \exp_not:N \eb_fnmate_counter_pifont_neg:N }
+ { \eb_fnmate_counter_pifont_neg:N }
{ pisans }
- { \exp_not:N \eb_fnmate_counter_pisans:N }
+ { \eb_fnmate_counter_pisans:N }
{ pisans* }
- { \exp_not:N \eb_fnmate_counter_pisans_neg:N }
+ { \eb_fnmate_counter_pisans_neg:N }
}
{ \exp_not:N \c@footnote }
}
@@ -1129,12 +1129,11 @@
{ \cs_set:Npn \@makefnmark { \hbox:n {#1} } }
\cs_new_protected:Npn \defdownfntmark #1
{ \cs_set:Npn \eb@makefnmark { \hbox:n {#1} } }
+\cs_new:Npn \notminipage { \tl_if_eq:NnTF \@mpfn { footnote } }
\defupfntmark
{
\eb_fnmate_format_initial:
- \tl_if_eq:NnTF \@mpfn { footnote }
- { \eb@fnmate@super{\@the@up@fnmark} }
- { \eb@fnmate@super{\@thefnmark} }
+ \eb@fnmate@super{\notminipage{\@the@up@fnmark}{\@thefnmark}}
}
\defdownfntmark
{
@@ -1164,7 +1163,7 @@
}
\cs_new_protected:Npn \eb_fncust_format_initial:
{
- % \hdrset{fntext-code = { }}
+ % \ebhdrset{fntext-code = { }}
\bool_set_false:N \l__eb_normal_footnote_bool
\bool_if:NF \l__eb_fncust_format_match_bool
{
@@ -1890,7 +1889,7 @@
\cs_new_protected:Npn \seteqcomp #1
{ \keys_set:nn { eb/eqcomp } {#1} }
-\cs_new:Npn \eb_eqsymb_left_margin_calc:
+\cs_new_protected:Npn \eb_eqsymb_left_margin_calc:
{
\hbox_set:Nn \l_tmpa_box { \l__eb_eqsymb_delim_tl }
\hbox_set:Nn \l_tmpb_box { \l__eb_eqsymb_intro_tl }
@@ -2231,7 +2230,7 @@
{
style = lst-base,
language = [LaTeX]TeX,
- texcsstyle = *\color{ctex@verb}\bfseries,
+ texcsstyle = *\color{ctex@verb}\eb@lst@if@display{\bfseries}{},
basicstyle = \ttfamily\eb@lst@if@display{\small}{\color{ctex@verb}},
keywordstyle = \color{ctex@verb}\eb@lst@if@display{\bfseries}{}
}
@@ -2433,7 +2432,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/20}{1.48}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/23}{1.50}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \addtotcbstyle #1#2
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index bd24bf650f..1d6687a2d7 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index b8dc427b71..49a70949c7 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -21,8 +21,8 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK 使用手册,
- version = v1.48,
- date = 2022/01/20,
+ version = v1.50,
+ date = 2022/01/23,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
email = q1jx@foxmail.com,
@@ -367,9 +367,9 @@
\subsection{上标和下标}
上标和下标的功能来自 \pkg*{spbmark} 宏包,下面有三个命令可以用于输出上标和下标。可以使用键值列表的形式对上下标格式进行局部或全局设置,下面命令中两个可选参数的键值列表是等效的。全局设置的详情见\ref{subsubsec:super-sub-script}。
\begin{commands}
- \command{super}[\oarg{键值列表1}\splitoarg{高度,深度}\marg{内容}\oarg{键值列表2}]
+ \command{super}[\oarg{键值列表1}\marg{内容}\oarg{键值列表2}]
输出上标的命令,与简短命令 \cs{sp} 等效。
- \command{sub}[\oarg{键值列表1}\splitoarg{高度,深度}\marg{内容}\oarg{键值列表2}]
+ \command{sub}[\oarg{键值列表1}\marg{内容}\oarg{键值列表2}]
输出下标的命令,与简短命令 \cs{sb} 等效。用法和参数与上标命令 \cs{super} 类似。
\command{supersub}[\oarg{键值列表1}\marg{上标内容}\marg{下标内容}\oarg{键值列表2}]
同时输出上标和下标的命令,与简短命令 \cs{spb} 等效。
@@ -377,7 +377,7 @@
根据上下标处于数学还是文本模式分别设置不同的值,应当在格式命令或偏移距离选项中使用。
\end{commands}
-上下标命令键值列表中共同的选项如下所示。如果 \option{vmove}、\option{hmove} 和 \option{cmd} 选项用于 \module*{style} 模块的全局设置,它们将根据前面最近一个命令的类型设定相应值。
+上下标命令键值列表中共同的选项如下所示。当下面除 \option{mode} 以外的选项用于 \module*{style} 模块全局设置时,它们将根据前面最近一个命令的类型设定相应值。
\begin{options}
\keyval-{vmove}{刚性长度}\Default{0pt}
上标或下标的垂直偏移。如果是上下标命令使用则代表上标和上标间的额外垂直距离 \option{vsep}。
@@ -385,6 +385,10 @@
上标或下标的水平偏移。如果是上下标命令使用则代表上标和上标的共同偏移。
\keyval-{cmd}{格式命令}\Default
上标或下标的格式命令选项。最后一个命令可以带有一个参数,这个参数用于接受上标或下标。
+ \keyval-{height}{刚性长度}\Default
+ 段落中当前行上标或下标的基线与前一行的间距。
+ \keyval-{depth}{刚性长度}\Default
+ 段落中当前行上标或下标的基线与下一行的间距。
\keychoice{mode}{text,math,match}\Default{match}
上标或下标的输出格式。可以为文本 \code{text} 或数学 \code{math} 模式。当使用选项 \code{match} 时可以根据当前段落所处的模式自动匹配。
\end{options}
@@ -829,6 +833,8 @@
定义脚注正文标记的格式,与正文标记编号命令 \cs{theupfootnote} 配合使用。
\command{defdownfntmark}[\marg{脚注内容标记格式}]
定义脚注内容标记的格式,与内容标记编号命令 \cs{thedownfootnote} 配合使用。
+ \command{notminipage}[\marg{普通页内容}\marg{迷你页内容}]
+ 用于在定义脚注标记的命令中判断当前脚注是否处于迷你页而输出不同的内容。
\command{theupfootnote}
保存正文标记编号类型选项 \option{fnmark-num} 指定的正文标记。
\command{thedownfootnote}
@@ -836,7 +842,7 @@
\end{commands}
\begin{ctexexam}
\defupfntmark{\super[vmove = 2pt]{\theupfootnote}}
- \defdownfntmark{\textcolor{blue}{\thedownfootnote}}
+ \defdownfntmark{\notminipage{\textcolor{blue}{\thedownfootnote}}{}}
\end{ctexexam}
\keychoice{fncust-form}{format code,match}\Default
单独设定自定义脚注标记的格式,选项 \code{match} 可以匹配 \option*{spcmd} 全局的值。自定义脚注的命令与用法可以见下方的介绍。
@@ -874,8 +880,8 @@
与 \option{tocformat} 用法一样,只是在已有的格式命令后附加代码。
\keyval-{tocindent}{刚性长度}
各级别目录中的标题左边缩进距离,通常标题级别越低缩进越大。
- \keyval-{tocrule}{目录引导线样式}
- 引导线选项 \option{tocrule} 中一般应当使用 \cs{tocrule} 命令绘制引导线,将会在下面介绍。
+ \keyval-{tocrule}{目录引导线命令}
+ 引导线选项 \option{tocrule} 中一般可以使用基于 \cs*{xleaders} 命令的 \cs{tocrule} 绘制引导线。
\keyval-{tocafter}{距离命令}\Default{\cs*{hspace}\Carg{1em}}
在各级别目录中标签与标题间的代码,默认为插入 \code{1em} 横向距离。
\keyval-{tocline}{目录中的标题}
diff --git a/macros/latex/contrib/ffcode/DEPENDS.txt b/macros/latex/contrib/ffcode/DEPENDS.txt
index d86449385c..935840f850 100644
--- a/macros/latex/contrib/ffcode/DEPENDS.txt
+++ b/macros/latex/contrib/ffcode/DEPENDS.txt
@@ -1,2 +1,3 @@
+hard xkeyval
hard minted
hard tcolorbox
diff --git a/macros/latex/contrib/ffcode/ffcode.pdf b/macros/latex/contrib/ffcode/ffcode.pdf
index 252a4fbb78..c49dd4103c 100644
--- a/macros/latex/contrib/ffcode/ffcode.pdf
+++ b/macros/latex/contrib/ffcode/ffcode.pdf
Binary files differ
diff --git a/macros/latex/contrib/ffcode/ffcode.sty b/macros/latex/contrib/ffcode/ffcode.sty
index 5ebb6a0fc5..65b846b8e5 100644
--- a/macros/latex/contrib/ffcode/ffcode.sty
+++ b/macros/latex/contrib/ffcode/ffcode.sty
@@ -21,7 +21,9 @@
% SOFTWARE.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ffcode}[2022/01/09 0.4.0 Fixed Font Code]
+\ProvidesPackage{ffcode}[2022/01/23 0.4.1 Fixed Font Code]
+
+\RequirePackage{xkeyval}
\makeatletter
\DeclareOptionX{nopygments}{\PassOptionsToPackage{draft=true}{minted}}
@@ -39,17 +41,16 @@
\RequirePackage{minted}
\setminted{breaklines}
+\setminted{escapeinside=||,mathescape}
+\setminted{highlightcolor=gray!30}
\usemintedstyle{bw}
\makeatletter\ifff@nonumbers
\ifff@nobars
- \newminted[ffcode]{text}{
- escapeinside=||,mathescape,highlightcolor=gray!30
- }
+ \newminted[ffcode]{text}{}
\else
\newminted[ffcode]{text}{
- framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,
- escapeinside=||,mathescape,highlightcolor=gray!30
+ framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline
}
\fi
\else
@@ -57,23 +58,23 @@
\ifff@nocn
\ifff@nobars
\newminted[ffcode]{text}{
- linenos,numbersep=2pt,highlightcolor=gray!30,escapeinside=||,mathescape
+ linenos,numbersep=2pt
}
\else
\newminted[ffcode]{text}{
framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,
- linenos,numbersep=2pt,highlightcolor=gray!30,escapeinside=||,mathescape
+ linenos,numbersep=2pt
}
\fi
\else
\ifff@nobars
\newminted[ffcode]{text}{
- firstnumber=last,linenos,numbersep=2pt,highlightcolor=gray!30,escapeinside=||,mathescape
+ firstnumber=last,linenos,numbersep=2pt
}
\else
\newminted[ffcode]{text}{
framesep=6pt,framerule=1pt,rulecolor=gray,frame=leftline,
- firstnumber=last,linenos,numbersep=2pt,highlightcolor=gray!30,escapeinside=||,mathescape
+ firstnumber=last,linenos,numbersep=2pt
}
\fi
\fi
diff --git a/macros/latex/contrib/ffcode/ffcode.tex b/macros/latex/contrib/ffcode/ffcode.tex
index b90ab7a411..607b71368b 100644
--- a/macros/latex/contrib/ffcode/ffcode.tex
+++ b/macros/latex/contrib/ffcode/ffcode.tex
@@ -30,7 +30,7 @@
\usepackage{microtype}
\title{\ff{ffcode}: \LaTeX{} Package \\ for Fixed-Font Code Blocks}
\author{Yegor Bugayenko}
-\date{0.4.0 2022/01/09}
+\date{0.4.1 2022/01/23}
\begin{document}
\pagenumbering{gobble}
\raggedbottom
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index ff9d46251c..0e75045e9a 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex
index 3690d37880..fc2cc12e34 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -533,8 +533,8 @@ cette clé prend comme valeur une liste d'éléments parmi les suivants : |left|
|right|, |top| et |bottom| ;
\item les clés |t| et |b| réglent la ligne de base qui sera donnée au bloc quand
celui-ci est constitué de plusieurs lignes (séparées par la commande |\\|) ;
-\item la clé |hvlines| trace tous les filets horizontaux et verticaux dans le
-bloc ;
+\item les clés |hlines|, |vlines| et |hvlines| tracent les filets correspondants
+dans le bloc ;
\item quand la clé |tikz| est utilisée, le chemin Tikz correspondant au
rectangle délimitant le bloc est exécuté avec Tikz\footnote{Tikz doit être
chargé préalablement (par défaut, \pkg{nicematrix} ne charge que
@@ -544,7 +544,10 @@ applicables à un chemin de Tikz). Pour des exemple d'utilisation de cette clé
|tikz|, voir p.~\pageref{tikz-key-examples} ;
\item \colorbox{yellow!50}{\textbf{Nouveau 6.3}}\enskip la clé |name| donne un
nom au nœud Tikz rectangulaire correspondant au bloc ; on peut utiliser ce nom
-avec Tikz dans le |\CodeAfter| (cf p.~\pageref{code-after}).
+avec Tikz dans le |\CodeAfter| (cf p.~\pageref{code-after});
+\item \colorbox{yellow!50}{\textbf{Nouveau 6.5}}\enskip la clé
+|respect-arraystretch| évite la remise à $1$ de |\arraystretch| en début de
+bloc (qui a lieu par défaut).
\end{itemize}
@@ -888,11 +891,9 @@ A&B&C&D \\
\end{scope}
\medskip
-\colorbox{yellow!50}{\textbf{Nouveau 6.2}}\enskip
-
-Dans les environnements de
-\pkg{nicematrix}, une instruction |\cline{|\textsl{\texttt{i}}|}| est
-équivalente à |\cline{|\textsl{\texttt{i}}|-|\textsl{\texttt{i}}|}|.
+Dans les environnements de \pkg{nicematrix}, une instruction
+|\cline{|\textsl{\texttt{i}}|}| est équivalente à
+|\cline{|\textsl{\texttt{i}}|-|\textsl{\texttt{i}}|}|.
\subsection{L'épaisseur et la couleur des filets}
@@ -1178,6 +1179,7 @@ Cette commande |\diagbox| peut aussi être utilisée dans un |\Block|.
\subsection{Filets en pointillés}
+\label{dotted}
Dans les environnements de \pkg{nicematrix}, il est possible d'utiliser la
commande |\hdottedline| (fournie par \pkg{nicematrix}) qui est l'équivalent pour
@@ -1238,7 +1240,71 @@ largeur du trait\footnote{En fait, avec l'extension \pkg{array}, cela est vrai
p.~\pageref{remark-cline}}. Avec \pkg{nicematrix}, les lignes en pointillés
tracées par |\hdottedline| et «|:|» ont ce même effet.
+\subsection{Commandes pour filets personnalisés}
+
+\colorbox{yellow!50}{\textbf{Nouveau 6.5}}\enskip Il est possible de définir des
+commandes et des lettres pour des filets personnalisés avec la clé
+|custom-line|, utilisable dans |\NiceMatrixOptions| ou bien dans un
+environnement. Cette clé prend en argument une liste de paires de la forme
+\textsl{clé=valeur}. Les clés disponibles sont les suivantes :
+
+\begin{itemize}
+\item la clé |command| indique le nom (sans la contre-oblique) d'une commande
+qui sera créée par \pkg{nicematrix} et que l'utilisateur pourra utiliser pour
+tracer des filets horizontaux (de manière similaire à |\hline|) ;
+
+\item la clé |letter| prend en argument une lettre\footnote{Les lettres
+ suivantes ne sont pas autorisées : \verb+lcrpmbVX:|()[]!@<>+} qui pourra être utilisée par
+l'utilisateur dans le préambule d'un environnement à préambule (comme
+|{NiceTabular}|) pour spécifier un filet vertical ;
+
+\item la clé |multiplicity| indique le nombre de traits successifs qui seront
+tracés : par exemple, une valeur de~$2$ va créer des filets doubles comme créés
+en standard par |\hline\hline| ou bien \verb+||+ dans le préambule d'un
+environnement ;
+\item la clé |color| fixe la couleur des filets ;
+
+\item la clé |sep-color| fixe la couleur entre deux filets consécutifs (n'a
+d'intérêt que dans le cas où la clé |multiplicity| est utilisée) ;
+
+\item la clé |dotted| impose un style de pointillés qui utilise le système
+de pointillés de la commande |\hdottedline| (et de la lettre \verb|:|) décrit à
+la partie précédente (cf. p.~\pageref{dotted}).
+\end{itemize}
+
+\medskip
+Ce système permet en particulier de définir des commandes pour tracer des filets
+avec une couleur spécifique (et ces filets respecteront les blocs comme les
+autres filets de \pkg{nicematrix}).
+
+\medskip
+\begin{Verbatim}
+\begin{NiceTabular}{lcIcIc}~emphase#[custom-line = {letter=I, color=blue}]@
+\hline
+ & \Block{1-3}{dimensions} \\
+ & L & l & h \\
+\hline
+Produit A & 3 & 1 & 2 \\
+Produit B & 1 & 3 & 4 \\
+Produit C & 5 & 4 & 1 \\
+\hline
+\end{NiceTabular}
+\end{Verbatim}
+
+
+\begin{center}
+\begin{NiceTabular}{lcIcIc}[custom-line = {letter=I, color=blue}]
+\hline
+ & \Block{1-3}{dimensions} \\
+ & L & l & H \\
+\hline
+Produit A & 3 & 1 & 2 \\
+Produit B & 1 & 3 & 4 \\
+Produit C & 5 & 4 & 1 \\
+\hline
+\end{NiceTabular}
+\end{center}
\section{Les couleurs des rangées et des colonnes}
@@ -1507,10 +1573,10 @@ l'intervalle constitué de toutes les rangées du tableau à partir de la rangé
\medskip
-La commande |\rowcolors| accepte une liste de couples clé-valeur comme argument
-optionnel en dernière position (l'argument optionel en première position
-correspond à l'espace colorimétrique). Les clés disponibles sont |cols|,
-|restart| et |respect-blocks|.
+La commande |\rowcolors| accepte une liste de couples \textsl{clé=valeur} comme
+argument optionnel en dernière position (l'argument optionel en première
+position correspond à l'espace colorimétrique). Les clés disponibles sont
+|cols|, |restart| et |respect-blocks|.
\begin{itemize}
\item La clé |cols| décrit un ensemble de colonnes sur lesquelles portera
l'effet de |\rowcolors|. Cet ensemble de colonnes est une liste d'intervalles de
@@ -1797,7 +1863,7 @@ seront appliquées à chacune des cases restantes sur la rangée en cours.
\medskip
Elle prend aussi en premier argument optionnel, entre crochets, une liste de
-couples clé-valeur.
+couples \textsl{clé=valeur}.
\begin{itemize}
\item \colorbox{yellow!50}{\bfseries Nouveau 6.3}\enskip La clé |nb-rows|
indique le nombre de rangées consécutives concernées par les spécifications de
@@ -2878,7 +2944,7 @@ la syntaxe $i$|-|$j$ où $i$ est le numéro de rangée et $j$ le numéro de colo
\item le troisième argument est le coin inférieur droit avec la même syntaxe ;
\item la quatrième argument est le délimiteur droit ;
\item le cinquième argument, optionnel, entre crochets, est une liste de couples
-clé-valeur.\footnote{Il n'y a pas d'argument optionnel entre crochets en première
+\textsl{clé=valeur}.\footnote{Il n'y a pas d'argument optionnel entre crochets en première
position car un crochet ouvrant juste après |\SubMatrix| doit pouvoir être
interprété comme le premier argument (obligatoire) de |\SubMatrix|: ce
crochet est alors le délimiteur gauche de la sous-matrice (ex. :
@@ -3068,7 +3134,7 @@ a_{31} & a_{32} & a_{33}
-\subsection{Les commandes \textbackslash OverBrace et le \textbackslash
+\subsection{Les commandes \textbackslash OverBrace et \textbackslash
UnderBrace dans le \textbackslash CodeAfter}
\colorbox{yellow!50}{\textbf{Nouveau 6.4}}
@@ -3078,7 +3144,7 @@ horizontales sur une partie du tableau. Ces commandes prennent trois arguments :
\begin{itemize}
\item le premier argument est le coin supérieur gauche du rectangle de cellules
impliquées dans l'accolade avec la syntaxe habituelle $i$|-|$j$ où $i$ est le
-numéro de rangée et $hj$ le numéro de colonne ;
+numéro de rangée et $j$ le numéro de colonne ;
\item le deuxième argument est le coin inférieur droit avec la même syntaxe ;
@@ -3107,8 +3173,8 @@ $\begin{pNiceMatrix}
\bigskip
Les commandes |\OverBrace| et |\UnderBrace| acceptent en fait un premier
-argument optionnel (entre crochets) pour une liste de couples clé-valeur. Les
-clés disponibles sont les suivantes :
+argument optionnel (entre crochets) pour une liste de couples
+\textsl{clé=valeur}. Les clés disponibles sont les suivantes :
\begin{itemize}
\item |left-shorten| et |right-shorten| qui ne prennent pas de valeur ; quand
|left-shorten| est utilisée, l'abscisse de l'extrémité de gauche de l'accolade
@@ -3418,20 +3484,21 @@ La commande |\nobreak| est pour le cas où l'option |para| est utilisée.
\item Les notes sont composées en fin de tableau en utilisant en interne un
-style de liste de \pkg{enumitem}.
-
-La clé |notes/enumitem-keys| permet de spécifier une liste de paires
-\textsl{clé=valeur} (au format de \pkg{enumitem}) permettant de paramétrer ce
-type de liste.
+style de liste de \pkg{enumitem}. Ce style de liste est défini de la manière
+suivante (avec, bien sûr, des clés de \pkg{enumitem}) :
-Valeur initiale :\quad |noitemsep , leftmargin = * , align = left , labelsep = 0pt|
+|noitemsep , leftmargin = * , align = left , labelsep = 0pt|
-Cette valeur initiale contient la spécification |align = left| qui demande que
-le label de la note soit composé à gauche dans la boîte qui lui est dévolue.
+La spécification |align = left| de ce style demande que le label de la note soit
+composé à gauche dans la boîte qui lui est dévolue. Ce réglage a l'avantage
+d'avoir les notes calées à gauche, ce qui est plaisant si on compose des
+tableaux dans l'esprit de \pkg{booktabs} (voir par exemple la table
+\ref{t:tabularnote}, p.~\pageref{t:tabularnote}).
-Ce réglage a l'avantage d'avoir les notes calées à gauche, ce qui est plaisant
-si on compose des tableaux dans l'esprit de \pkg{booktabs} (voir par exemple la
-table \ref{t:tabularnote}, p.~\pageref{t:tabularnote}).
+\medskip
+La clé |notes/enumitem-keys| fournie par \pkg{nicematrix} permet modifier ce
+type de liste de \pkg{enumitem} (en utilisant en interne la commande |\setlist*|
+de \pkg{enumitem}).
\item La clé |notes/enumitem-keys-para| est similaire à la précédente mais elle
@@ -3441,7 +3508,9 @@ type |inline| (suivant le vocabulaire de \pkg{enumitem}) qui est utilisée et le
paires \textsl{clé=valeur} doivent donc correspondre à une telle liste de type
|inline|.
-Valeur initiale :\quad |afterlabel = \nobreak, itemjoin = \quad|
+Initialement, le style de liste utilisé est défini par :\quad
+
+|afterlabel = \nobreak, itemjoin = \quad|
\item La clé |notes/code-before| est une liste de tokens qui seront insérés
@@ -4182,6 +4251,50 @@ créés une première fois avant la construction du tableau en utilisant des
informations écrites dans le fichier |aux| puis recréés lors de la composition
du tableau proprement dit).
+\bigskip
+Voici un exemple d'utilisation de ces nœuds dans le |\CodeAfter|.
+
+\begin{center}
+\fvset{commandchars=\~\#\+}
+\begin{Verbatim}
+\begin{NiceArray}{c@{\;}c@{\;}c@{\;}c@{\;}c}[create-medium-nodes]
+ u_1 &-& u_0 &=& r \\
+ u_2 &-& u_1 &=& r \\
+ u_3 &-& u_2 &=& r \\
+ u_4 &-& u_3 &=& r \\
+ \phantom{u_5} & & \phantom{u_4} &\smash{\vdots} & \\
+ u_n &-& u_{n-1} &=& r \\[3pt]
+ \hline
+ u_n &-& u_0 &=& nr \\
+\CodeAfter
+ \tikz[very thick, red, opacity=0.4,name suffix = -medium]
+ \draw (1-1.north west) -- (2-3.south east)
+ (2-1.north west) -- (3-3.south east)
+ (3-1.north west) -- (4-3.south east)
+ (4-1.north west) -- (5-3.south east)
+ (5-1.north west) -- (6-3.south east) ;
+\end{NiceArray}
+\end{Verbatim}
+\end{center}
+%
+\[\begin{NiceArray}{c@{\;}c@{\;}c@{\;}c@{\;}c}[create-medium-nodes]
+ u_1 &-& u_0 &=& r \\
+ u_2 &-& u_1 &=& r \\
+ u_3 &-& u_2 &=& r \\
+ u_4 &-& u_3 &=& r \\
+ \phantom{u_5} & & \phantom{u_4} &\smash{\vdots} & \\
+ u_n &-& u_{n-1} &=& r \\[3pt]
+ \hline
+ u_n &-& u_0 &=& nr \\
+ \CodeAfter
+ \tikz[very thick, red, opacity=0.4,name suffix = -medium]
+ \draw (1-1.north west) -- (2-3.south east)
+ (2-1.north west) --(3-3.south east)
+ (3-1.north west) -- (4-3.south east)
+ (4-1.north west) -- (5-3.south east)
+ (5-1.north west) -- (6-3.south east) ;
+\end{NiceArray}\]
+
\subsection{Les nœuds indiquant la position des filets}
@@ -5188,12 +5301,10 @@ Dans ce tableau, les instructions |\SubMatrix| sont exécutés après la
composition du tableau et les traits verticaux sont donc tracés sans espacer les
colonnes.
-
\medskip
-\colorbox{yellow!50}{\textbf{Nouveau 6.2}}\enskip En fait, on peut avec la clé
-|vlines-in-sub-matrix| choisir un spécificateur dans le préambule du tableau
-pour indiquer des filets verticaux qui seront tracés dans les |\SubMatrix|
-uniquement (en espaçant les colonnes).
+En fait, on peut avec la clé |vlines-in-sub-matrix| choisir un spécificateur
+dans le préambule du tableau pour indiquer des filets verticaux qui seront
+tracés dans les |\SubMatrix| uniquement (en espaçant les colonnes).
\medskip
\begin{Verbatim}
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index 5a6e2d1b85..80d98ae17e 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2018-2021 by F. Pantigny
+% Copyright (C) 2018-2022 by F. Pantigny
% -----------------------------------
%
% This file may be distributed and/or modified under the
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.4}
-\def\myfiledate{2021/11/23}
+\def\myfileversion{6.5}
+\def\myfiledate{2022/01/23}
%
%
%<*batchfile>
@@ -27,7 +27,7 @@
\preamble
-Copyright (C) 2018-2021 by F. Pantigny
+Copyright (C) 2018-2022 by F. Pantigny
-----------------------------------
This file may be distributed and/or modified under the
@@ -553,7 +553,7 @@ version 2005/12/01 or later.
%
% \interitem
% In fact, the command |\Block| accepts as first optional argument (between
-% square brackets) a list of couples key-value. The available keys are as
+% square brackets) a list of couples \textsl{key=value}. The available keys are as
% follows:
% \begin{itemize}
% \item the keys |l|, |c| and |r| are used to fix the horizontal position of the
@@ -576,8 +576,8 @@ version 2005/12/01 or later.
% by |left|, |right|, |top| and |bottom|;
% \item the keys |t| and |b| fix the base line that will be given to the block
% when it has a multi-line content (the lines are separated by |\\|);
-% \item the keys |hvlines| draws all the vertical and horizontal rules in the
-% block;
+% \item the keys |hlines|, |vlines| and |hvlines| draw all the corresponding
+% rules in the block;
% \item when the key |tikz| is used, the Tikz path corresponding of the
% rectangle which delimits the block is executed with Tikz\footnote{Tikz should
% be loaded (by default, \pkg{nicematrix} only loads \textsc{pgf}) and, if it's
@@ -587,7 +587,10 @@ version 2005/12/01 or later.
% \item \colorbox{yellow!50}{\textbf{New 6.3}}\enskip the key |name| provides a
% name to the rectangular Tikz node corresponding to the block; it's possible to
% use that name with Tikz in the |\CodeAfter| of the environment
-% (cf.~p.~\pageref{code-after}).
+% (cf.~p.~\pageref{code-after});
+% \item \colorbox{yellow!50}{\textbf{New 6.5}}\enskip the key
+% |respect-arraystretch| prevents the setting of |\arraystretch| to $1$ at the
+% beginning of the block (which is the behaviour by default).
% \end{itemize}
%
% \interitem
@@ -913,8 +916,6 @@ version 2005/12/01 or later.
% \end{scope}
%
% \medskip
-% \colorbox{yellow!50}{\textbf{New 6.2}}
-%
% In the environments of \pkg{nicematrix}, an instruction |\cline{|\textsl{\texttt{i}}|}|
% is equivalent to |\cline{|\textsl{\texttt{i}}|-|\textsl{\texttt{i}}|}|.
%
@@ -1191,6 +1192,7 @@ version 2005/12/01 or later.
%
% \subsection{Dotted rules}
%
+% \label{dotted}
%
% In the environments of the package \pkg{nicematrix}, it's possible to use
% the command |\hdottedline| (provided by \pkg{nicematrix}) which is a
@@ -1250,6 +1252,71 @@ version 2005/12/01 or later.
% |\hdottedline| and ``|:|'' do likewise.
%
%
+% \subsection{Commands for customized rules}
+%
+% \colorbox{yellow!50}{\textbf{New 6.5}}\enskip It's possible to define commands
+% and letters for customized rules with the key |custom-line| available in
+% |\NiceMatrixOptions| and in the options of individual environments. That key
+% takes in as argument a list of \textsl{key=value} pairs. The available keys
+% are the following:
+% \begin{itemize}
+% \item the key |command| is the name (without the backslahs) of a command that
+% will be created by \pkg{nicematrix} and that will be available for the final
+% user in order to draw horizontal rules (similarly to |\hline|);
+%
+% \item the key |letter| takes in as argument a letter\footnote{The following
+% letters are forbidden: \verb+lcrpmbVX:|()[]!@<>+} that the user will use in
+% the preamble of an environment with preamble (such as |{NiceTabular}| in order
+% to specify a vertical rule;
+%
+% \item the key |multiplicity| is the number to consecutive rules that will be
+% drawn: for instance, a value of $2$ will create double rules such those
+% created by |\hline\hline| or \verb+||+ in the preamble of an environment;
+%
+% \item the key |color| sets the color of the rule ;
+%
+% \item the key |sep-color| sets the color between two successive rules (should be
+% used only in conjonction with |multiplicity|);
+%
+% \item the key |dotted| forces a style with dotted rules such as those created by
+% |\hdottedline| or the letter ``|:|'' in the preamble (cf. p.~\pageref{dotted}).
+% \end{itemize}
+%
+% \medskip
+% That system may be used, in particular, for the definition of commands and
+% letters to draw rules with a specific color (and those rules will respect the
+% blocks as do all rules of \pkg{nicematrix}).
+%
+%
+% \medskip
+% \begin{Verbatim}
+% \begin{NiceTabular}{lcIcIc}~emphase#[custom-line = {letter=I, color=blue}]@
+% \hline
+% & \Block{1-3}{dimensions} \\
+% & L & l & h \\
+% \hline
+% Product A & 3 & 1 & 2 \\
+% Product B & 1 & 3 & 4 \\
+% Product C & 5 & 4 & 1 \\
+% \hline
+% \end{NiceTabular}
+% \end{Verbatim}
+%
+%
+% \begin{center}
+% \begin{NiceTabular}{lcIcIc}[custom-line = {letter=I, color=blue}]
+% \hline
+% & \Block{1-3}{dimensions} \\
+% & L & l & H \\
+% \hline
+% Product A & 3 & 1 & 2 \\
+% Product B & 1 & 3 & 4 \\
+% Product C & 5 & 4 & 1 \\
+% \hline
+% \end{NiceTabular}
+% \end{center}
+%
+%
%
%\section{The color of the rows and columns}
%
@@ -1508,9 +1575,10 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% The last argument of |\rowcolors| is an optional list of pairs key-value (the
-% optional argument in the first position corresponds to the colorimetric
-% space). The available keys are |cols|, |restart| and |respect-blocks|.
+% The last argument of |\rowcolors| is an optional list of pairs
+% \textsl{key=value} (the optional argument in the first position corresponds to
+% the colorimetric space). The available keys are |cols|, |restart| and
+% |respect-blocks|.
% \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
@@ -1784,7 +1852,7 @@ version 2005/12/01 or later.
%
% \medskip
% That command also takes in as optional argument (between square brackets)
-% a list of key-value pairs.
+% a list of \textsl{key=value} pairs.
% \begin{itemize}
% \item \colorbox{yellow!50}{\bfseries New 6.3}\enskip The key |nb-rows| sets
% the number of rows to which the specifications of the current command will
@@ -2139,7 +2207,7 @@ version 2005/12/01 or later.
% |{NiceArray}| and its variants), no letter must be given in that preamble for
% the potential first column and the potential last column: they will
% automatically (and necessarily) be of type |r| for the first column and |l|
-% for the last one.\footnote{The users wishing exteriors columns with another
+% for the last one.\footnote{The users wishing exterior columns with another
% type of alignment should consider the command |\SubMatrix| available in the
% |\CodeAfter| (cf.~p.~\pageref{sub-matrix}).}
% \item One may wonder how \pkg{nicematrix} determines the number of rows and
@@ -2841,7 +2909,7 @@ version 2005/12/01 or later.
% syntax $i$|-|$j$ where $i$ the number of row and $j$ the number of column;
% \item the third argument is the lower-right corner with the same syntax;
% \item the fourth argument is the right delimiter;
-% \item the last argument, which is optional, is a list of key-value
+% \item the last argument, which is optional, is a list of \textsl{key=value}
% pairs.\footnote{There is no optional argument between square brackets in first
% position because a square bracket just after |\SubMatrix| must be interpreted
% as the first (mandatory) argument of the command |\SubMatrix|: that bracket is
@@ -3070,7 +3138,7 @@ version 2005/12/01 or later.
% \bigskip
% In fact, the commands |\OverBrace| and |\UnderBrace| take in an optional
% argument (in first position and between square brackets) for a list of
-% key-value pairs. The available keys are:
+% \textsl{key=value} pairs. The available keys are:
% \begin{itemize}
% \item |left-shorten| and |right-shorten| which do not take in value; when the
% key |left-shorten| is used, the abscissa of the left extremity of the brace is
@@ -3372,20 +3440,23 @@ version 2005/12/01 or later.
%
%
% \item The notes are composed at the end of the tabular by using internally a
-% style of list of \pkg{enumitem}.
+% style of list of \pkg{enumitem}. This style of list is defined as follows (with, of
+% course, keys of \pkg{enumitem}):
%
-% The key |notes/enumitem-keys| specifies a list of pairs
-% \textsl{key=value} (following the specifications of \pkg{enumitem}) to
-% customize that type of list.
+% |noitemsep , leftmargin = * , align = left , labelsep = 0pt|
%
-% Initial value:\quad |noitemsep , leftmargin = * , align = left , labelsep = 0pt|
-%
-% This initial value contains the specification |align = left| which requires a
+% The specification |align = left| in that style requires a
% composition of the label leftwards in the box affected to that label.
% With that tuning, the notes are composed flush left, which is pleasant when
% composing tabulars in the spirit of \pkg{booktabs} (see for example the
% table \ref{t:tabularnote}, p.~\pageref{t:tabularnote}).
%
+% \medskip
+% The key |notes/enumitem-keys| specifies a list of pairs
+% \textsl{key=value} (following the specifications of \pkg{enumitem}) to
+% customize that style of list (it uses internally the command |\setlist*| of
+% \pkg{enumitem}).
+%
%
% \item The key |notes/enumitem-keys-para| is similar to the previous one but
% corresponds to the type of list used when the option |para| is in force. Of
@@ -3393,7 +3464,8 @@ version 2005/12/01 or later.
% \pkg{enumitem}) is used and the pairs \textsl{key=value} should correspond to
% such a list of type |inline|.
%
-% Initial value:\quad |afterlabel = \nobreak, itemjoin = \quad|
+% Initially, the style of list is defined by:\quad
+% |afterlabel = \nobreak, itemjoin = \quad|
%
%
% \item The key |notes/code-before| is a token list inserted by \pkg{nicematrix}
@@ -4128,6 +4200,52 @@ version 2005/12/01 or later.
% written on the |aux| file and created a second time during the contruction of
% the array itself).
%
+% \bigskip
+% Here is an example which uses these nodes in the |\CodeAfter|.
+%
+% \begin{center}
+% \fvset{commandchars=\~\#\+}
+% \begin{Verbatim}
+% \begin{NiceArray}{c@{\;}c@{\;}c@{\;}c@{\;}c}[create-medium-nodes]
+% u_1 &-& u_0 &=& r \\
+% u_2 &-& u_1 &=& r \\
+% u_3 &-& u_2 &=& r \\
+% u_4 &-& u_3 &=& r \\
+% \phantom{u_5} & & \phantom{u_4} &\smash{\vdots} & \\
+% u_n &-& u_{n-1} &=& r \\[3pt]
+% \hline
+% u_n &-& u_0 &=& nr \\
+% \CodeAfter
+% \tikz[very thick, red, opacity=0.4,name suffix = -medium]
+% \draw (1-1.north west) -- (2-3.south east)
+% (2-1.north west) -- (3-3.south east)
+% (3-1.north west) -- (4-3.south east)
+% (4-1.north west) -- (5-3.south east)
+% (5-1.north west) -- (6-3.south east) ;
+% \end{NiceArray}
+% \end{Verbatim}
+% \end{center}
+%
+% \[\begin{NiceArray}{c@{\;}c@{\;}c@{\;}c@{\;}c}[create-medium-nodes]
+% u_1 &-& u_0 &=& r \\
+% u_2 &-& u_1 &=& r \\
+% u_3 &-& u_2 &=& r \\
+% u_4 &-& u_3 &=& r \\
+% \phantom{u_5} & & \phantom{u_4} &\smash{\vdots} & \\
+% u_n &-& u_{n-1} &=& r \\[3pt]
+% \hline
+% u_n &-& u_0 &=& nr \\
+% \CodeAfter
+% \tikz[very thick, red, opacity=0.4,name suffix = -medium]
+% \draw (1-1.north west) -- (2-3.south east)
+% (2-1.north west) --(3-3.south east)
+% (3-1.north west) -- (4-3.south east)
+% (4-1.north west) -- (5-3.south east)
+% (5-1.north west) -- (6-3.south east) ;
+% \end{NiceArray}\]
+%
+%
+%
% \subsection{The nodes which indicate the position of the rules}
%
% \label{nodes-i}
@@ -4603,7 +4721,7 @@ version 2005/12/01 or later.
% loaded.\footnote{By default, \pkg{nicematrix} only loads \textsc{pgf}, which is
% a sub-layer of Tikz.}
%
-% For the following example, you need also the Tikz library |patterns|
+% For the following example, we need also the Tikz library |patterns|.
%
% \begin{Verbatim}
% \usetikzlibrary{patterns}
@@ -5110,10 +5228,9 @@ version 2005/12/01 or later.
%
%
%\bigskip
-% \colorbox{yellow!50}{\textbf{New 6.2}}\enskip In fact, it's possible, with the
-% key |vlines-in-sub-matrix|, to choice a letter in the preamble of the
-% array to specify vertical rules which will be drawn in the |\SubMatrix| only
-% (by adding space between the columns).
+% In fact, it's possible, with the key |vlines-in-sub-matrix|, to choice a
+% letter in the preamble of the array to specify vertical rules which will be
+% drawn in the |\SubMatrix| only (by adding space between the columns).
%
% \medskip
% \begin{Verbatim}
@@ -5714,7 +5831,7 @@ version 2005/12/01 or later.
\cs_set:Npn \CT@arc #1 #2
{
\dim_compare:nNnT \baselineskip = \c_zero_dim \noalign
- { \cs_gset:Npn \CT@arc@ { \color #1 { #2 } } }
+ { \cs_gset:Npn \CT@arc@ { \color #1 { #2 } } }
}
% \end{macrocode}
% Idem for |\CT@drs@|.
@@ -5723,7 +5840,7 @@ version 2005/12/01 or later.
\cs_set:Npn\CT@drs #1 #2
{
\dim_compare:nNnT \baselineskip = \c_zero_dim \noalign
- { \cs_gset:Npn \CT@drsc@ { \color #1 { #2 } } }
+ { \cs_gset:Npn \CT@drsc@ { \color #1 { #2 } } }
}
\cs_set:Npn \hline
{
@@ -5847,7 +5964,17 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_set_CT@arc@_ii: #1 \q_stop
{ \cs_set:Npn \CT@arc@ { \color { #1 } } }
% \end{macrocode}
-%
+%
+% \bigskip
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_set_CT@drsc@:
+ { \peek_meaning:NTF [ \@@_set_CT@drsc@_i: \@@_set_CT@drsc@_ii: }
+\cs_new_protected:Npn \@@_set_CT@drsc@_i: [ #1 ] #2 \q_stop
+ { \cs_set:Npn \CT@drsc@ { \color [ #1 ] { #2 } } }
+\cs_new_protected:Npn \@@_set_CT@drsc@_ii: #1 \q_stop
+ { \cs_set:Npn \CT@drsc@ { \color { #1 } } }
+% \end{macrocode}
+%
%
% \bigskip
% \begin{macrocode}
@@ -6342,6 +6469,7 @@ version 2005/12/01 or later.
% \begin{macrocode}
\seq_new:N \g_@@_pos_of_stroken_blocks_seq
% \end{macrocode}
+%
%
% \medskip
% If the user has used the key |corners| (or the key |hvlines-except-corners|,
@@ -6465,9 +6593,11 @@ version 2005/12/01 or later.
%
%
% \medskip
-% The following flag corresponds to the key |hvlines| of the command |\Block|.
+% The following flag corresponds to the keys |vlines| and |hlines| of the
+% command |\Block| (the key |hvlines| is the conjunction of both).
% \begin{macrocode}
-\bool_new:N \l_@@_hvlines_block_bool
+\bool_new:N \l_@@_vlines_block_bool
+\bool_new:N \l_@@_hlines_block_bool
% \end{macrocode}
%
%
@@ -6491,7 +6621,7 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% The following flag will be used by (for instance) |\@@_vline_ii:nnnn|.
+% The following flag will be used by (for instance) |\@@_vline_ii:|.
% When |\l_@@_dotted_bool| is |true|, a dotted line (with our system) will be drawn.
% \begin{macrocode}
\bool_new:N \l_@@_dotted_bool
@@ -7019,6 +7149,13 @@ version 2005/12/01 or later.
\bool_new:N \l_@@_nullify_dots_bool
% \end{macrocode}
%
+% \medskip
+% The following flag corresponds to the key |respect-arraystretch| (that key has
+% an effect on the blocks).
+% \begin{macrocode}
+\bool_new:N \l_@@_respect_arraystretch_bool
+% \end{macrocode}
+%
%
% \bigskip
% The following flag will be used when the current options specify that all the
@@ -7174,8 +7311,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / Global }
{
- delimiters .code:n =
- \keys_set:nn { NiceMatrix / delimiters } { #1 } ,
+ custom-line .code:n = \@@_custom_line:n { #1 } ,
+ delimiters .code:n = \keys_set:nn { NiceMatrix / delimiters } { #1 } ,
delimiters .value_required:n = true ,
rules .code:n = \keys_set:nn { NiceMatrix / rules } { #1 } ,
rules .value_required:n = true ,
@@ -7256,6 +7393,8 @@ version 2005/12/01 or later.
extra-margin .meta:n =
{ extra-left-margin = #1 , extra-right-margin = #1 } ,
extra-margin .value_required:n = true ,
+ respect-arraystretch .bool_set:N = \l_@@_respect_arraystretch_bool ,
+ respect-arraystretch .default:n = true
}
% \end{macrocode}
%
@@ -8284,7 +8423,7 @@ version 2005/12/01 or later.
% The box |\@arstrutbox| is a box constructed in the beginning of the
% environment |{array}|. The construction of that box takes into account the
% current value of |\arraystretch|\footnote{The option |small| of
-% \pkg{nicematrix} changes (among other) the value of |\arraystretch|. This is
+% \pkg{nicematrix} changes (among others) the value of |\arraystretch|. This is
% done, of course, before the call of |{array}|.} and |\extrarowheight| (of
% \pkg{array}). That box is inserted (via |\@arstrut|) in the beginning of each
% row of the array. That's why we use the dimensions of that box to initialize
@@ -9305,11 +9444,11 @@ version 2005/12/01 or later.
% \bigskip
% We redefine the column types |w| and |W|. We use |\@@_newcolumntype| instead
% of |\newcolumtype| because we don't want warnings for column types already
-% defined. These redefinitions are in fact \emph{protections} of the letters |w|
+% defined. These redefinitions are in fact \emph{protections} of the letters |w|
% and |W|. We don't want these columns type expanded because we will do the
-% patch ourselves after. We want to be able the standard column types |w| and
-% |W| in potential |{tabular}| of \pkg{array} in some cells of our array. That's
-% why we do those redefinitions in a TeX group.
+% patch ourselves after. We want to be able to use the standard column types |w|
+% and |W| in potential |{tabular}| of \pkg{array} in some cells of our array.
+% That's why we do those redefinitions in a TeX group.
% \begin{macrocode}
\group_begin:
% \end{macrocode}
@@ -9408,7 +9547,7 @@ version 2005/12/01 or later.
%
% \medskip
% Now, we can close the TeX group which was opened for the redefinition of
-% the columns of type |w| and |W|.
+% the columns of type |w| and~|W|.
% \begin{macrocode}
\group_end:
% \end{macrocode}
@@ -9470,6 +9609,8 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
+% The command |\@@_patch_preamble:n| is the main function for the transformation
+% of the preamble. It is recursive.
% \begin{macrocode}
\cs_new_protected:Npn \@@_patch_preamble:n #1
{
@@ -9498,18 +9639,18 @@ version 2005/12/01 or later.
\} { \@@_patch_preamble_ix:nn #1 }
X { \@@_patch_preamble_x:n }
% \end{macrocode}
-% When \pkg{tabularx} is loaded, a local redefinition of the specifier `X` is
-% done to replace `X` by `\@@_X`. Thus, our column type `X` will be used in the
-% `{NiceTabularX}`.
+% When \pkg{tabularx} is loaded, a local redefinition of the specifier |X| is
+% done to replace |X| by |\@@_X|. Thus, our column type |X| will be used in the
+% |{NiceTabularX}|.
% \begin{macrocode}
\@@_X { \@@_patch_preamble_x:n }
\q_stop { }
}
{
- \str_if_eq:VnTF \l_@@_letter_for_dotted_lines_str { #1 }
- { \@@_patch_preamble_xii:n #1 }
+ \str_case_e:nnF { #1 }
{
- \str_if_eq:VnTF \l_@@_letter_vlism_tl { #1 }
+ \l_@@_letter_for_dotted_lines_str { \@@_patch_preamble_xii:n #1 }
+ \l_@@_letter_vlism_tl
{
\seq_gput_right:Nx \g_@@_cols_vlism_seq
{ \int_eval:n { \c@jCol + 1 } }
@@ -9517,20 +9658,40 @@ version 2005/12/01 or later.
{ \exp_not:N ! { \skip_horizontal:N \arrayrulewidth } }
\@@_patch_preamble:n
}
- {
- \bool_lazy_and:nnTF
- { \str_if_eq_p:nn { : } { #1 } }
- \c_@@_arydshln_loaded_bool
+ { : }
+ {
+ \bool_if:NTF \c_@@_arydshln_loaded_bool
{
\tl_gput_right:Nn \g_@@_preamble_tl { : }
\@@_patch_preamble:n
}
- { \@@_fatal:nn { unknown~column~type } { #1 } }
- }
+ { \@@_fatal:n { colon~without~arydshln } }
+ }
+ }
+% \end{macrocode}
+% Now the case of a letter set by the final user for a customized rule. Such
+% customized rule is defined by using the key |custom-line| in
+% |\NiceMatrixOptions|. That key takes in as value a list of \textsl{key=value}
+% pairs. Among the keys avalaible in that list, there is the key |letter|. All
+% the letters defined by this way by the final user for such customized rules
+% are added in the set of keys |{NiceMatrix/ColumnTypes}|. That set of keys is
+% used to store the characteristics of those types of rules for convenience: the
+% keys of that set of keys won't never be used as keys by the final user (he
+% will use, instead, letters in the preamble of its array).
+% \begin{macrocode}
+ {
+ \keys_set_known:nnN { NiceMatrix / ColumnTypes } { #1 } \l_tmpa_tl
+ \tl_if_empty:NTF \l_tmpa_tl
+ \@@_patch_preamble:n
+ { \@@_fatal:nn { unknown~column~type } { #1 } }
}
}
}
% \end{macrocode}
+%
+% \bigskip
+% Now, we will list all the auxiliary functions for the different types of
+% entries in the preamble of the array.
%
% \medskip
% For |c|, |l| and |r|
@@ -9588,6 +9749,9 @@ version 2005/12/01 or later.
{
\skip_horizontal:n
{
+% \end{macrocode}
+% Here, the command |\dim_eval:n| is mandatory.
+% \begin{macrocode}
\dim_eval:n
{
\arrayrulewidth * \l_tmpa_int
@@ -9598,8 +9762,16 @@ version 2005/12/01 or later.
}
\tl_gput_right:Nx \g_@@_internal_code_after_tl
{
- \@@_vline:nnnn
- { \@@_succ:n \c@jCol } { \int_use:N \l_tmpa_int } { 1 } { }
+ \@@_vline:n
+ {
+ position = \@@_succ:n \c@jCol ,
+ multiplicity = \int_use:N \l_tmpa_int ,
+ }
+% \end{macrocode}
+% We don't have provided value for |start| nor for |end|, which means that the
+% rule will cover (potentially) all the rows of the array.
+%
+% \begin{macrocode}
}
\int_zero:N \l_tmpa_int
\str_if_eq:nnT { #1 } { \q_stop } { \bool_gset_true:N \g_tmpb_bool }
@@ -10288,9 +10460,17 @@ version 2005/12/01 or later.
\seq_gput_left:Nn \g_@@_multicolumn_sizes_seq { #1 }
\seq_gput_right:Nx \g_@@_pos_of_blocks_seq
{
- { \int_use:N \c@iRow }
+ {
+ \int_compare:nNnTF \c@jCol = 0
+ { \int_eval:n { \c@iRow + 1 } }
+ { \int_use:N \c@iRow }
+ } % modified 2022/01/10
{ \int_eval:n { \c@jCol + 1 } }
- { \int_use:N \c@iRow }
+ {
+ \int_compare:nNnTF \c@jCol = 0
+ { \int_eval:n { \c@iRow + 1 } }
+ { \int_use:N \c@iRow }
+ } % modified 2022/01/10
{ \int_eval:n { \c@jCol + #1 } }
{ } % for the name of the block
}
@@ -11092,8 +11272,14 @@ version 2005/12/01 or later.
% \begin{macrocode}
&
\omit
- \int_gincr:N \g_tmpa_int
+% \end{macrocode}
+% The two following lines have been added on 2021-12-15 to solve a bug
+% mentionned by Joao Luis Soares by mail.
+% \begin{macrocode}
+ \int_compare:nNnT \g_@@_col_total_int = 1
+ { \skip_gset:Nn \g_tmpa_skip { 0 pt~plus 1 fill } }
\skip_horizontal:N \g_tmpa_skip
+ \int_gincr:N \g_tmpa_int
\bool_lazy_all:nT
{
\l_@@_NiceArray_bool
@@ -13647,7 +13833,7 @@ version 2005/12/01 or later.
nb-rows .initial:n = 1 ,
rowcolor .tl_set:N = \l_tmpc_tl ,
rowcolor .value_required:n = true ,
- rowcolor .initial:n = \c_empty_tl ,
+ rowcolor .initial:n = ,
unknown .code:n = \@@_error:n { Unknown~key~for~RowStyle }
}
% \end{macrocode}
@@ -13950,20 +14136,12 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% \begin{macrocode}
-\keys_define:nn { NiceMatrix / arraycolor }
- { except-corners .code:n = \@@_error:n { key~except-corners } }
-% \end{macrocode}
-%
-% \bigskip
% The command |\@@_arraycolor| (linked to |\arraycolor| at the beginning of
% the |\CodeBefore|) will color the whole tabular (excepted the potential
-% exterior rows and columns). The third argument is a optional argument which a
-% list of pairs key-value.
+% exterior rows and columns) and the cells in the ``corners''.
% \begin{macrocode}
-\NewDocumentCommand \@@_arraycolor { O { } m O { } }
+\NewDocumentCommand \@@_arraycolor { O { } m }
{
- \keys_set:nn { NiceMatrix / arraycolor } { #3 }
\@@_rectanglecolor [ #1 ] { #2 }
{ 1 - 1 }
{ \int_use:N \c@iRow - \int_use:N \c@jCol }
@@ -13993,7 +14171,7 @@ version 2005/12/01 or later.
% |#1| (optional) is the color space ;
% |#2| is a list of intervals of rows ;
% |#3| is the list of colors ;
-% |#4| is for the optional list of pairs key-value.
+% |#4| is for the optional list of pairs \textsl{key=value}.
% \begin{macrocode}
\NewDocumentCommand \@@_rowlistcolors { O { } m m O { } }
{
@@ -14354,9 +14532,12 @@ version 2005/12/01 or later.
%
%
%
+% \bigskip
+% \subsection*{The vertical and horizontal rules}
+%
%
% \bigskip
-% \subsection*{The vertical rules}
+% \subsubsection*{OnlyMainNiceMatrix}
%
% We give to the user the possibility to define new types of columns (with
% |\newcolumntype| of \pkg{array}) for special vertical rules (\emph{e.g.} rules
@@ -14413,42 +14594,101 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% The following command will be executed in the |internal-code-after|. The rule
-% will be drawn \emph{before} the column |#1| (that is to say on the left side).
-% |#2| is the number of consecutive occurrences of \verb+|+. |#3| and |#4| are
-% the numbers of rows that define the delimitation of the horizontal rule that
-% we have to draw. If |#4| is empty, that means that the rule extends until the
-% last row.
+% \subsubsection*{General system for drawing rules}
+%
+% When a command, environment or ``subsystem'' of \pkg{nicematrix} wants to draw
+% a rule, it will write in the internal |\CodeAfter| a command |\@@_vline:n| or
+% |\@@_hline:n|. Both commands take in as argument a list of \textsl{key=value}
+% pairs. That list will first be analyzed with the following set of keys.
+% However, unknown keys will be analyzed further with another set of keys.
+%
+% \begin{macrocode}
+\keys_define:nn { NiceMatrix / Rules }
+ {
+ position .int_set:N = \l_@@_position_int ,
+ position .value_required:n = true ,
+ start .int_set:N = \l_@@_start_int ,
+ start .initial:n = 1 ,
+ end .int_set:N = \l_@@_end_int ,
+% \end{macrocode}
+% The following keys are no-op because there are keys which may be inherited
+% from a list of pairs \textsl{key=value} of a definition of a customized rule
+% (with the key |custom-line| of |\NiceMatrixOptions|).
+% \begin{macrocode}
+ letter .code:n = \prg_do_nothing: ,
+ command .code:n = \prg_do_nothing:
+ }
+% \end{macrocode}
+%
+% \bigskip
+% It's possible that the rule won't be drawn continuously from |start| ot |end|
+% because of the blocks (created with the command |\Block|), the virtual blocks
+% (created by |\Cdots|, etc.), etc. That's why an analyse is done and the rule
+% is cut in small rules which will actually be drawn. The small continuous rules
+% will be drawn by |\@@_vline_ii:| and |\@@_hline_ii:|. Those commands use the
+% following set of keys.
+%
+% \begin{macrocode}
+\keys_define:nn { NiceMatrix / RulesBis }
+ {
+ multiplicity .int_set:N = \l_@@_multiplicity_int ,
+ multiplicity .initial:n = 1 ,
+ dotted .bool_set:N = \l_@@_dotted_bool ,
+ dotted .initial:n = false ,
+ dotted .default:n = true ,
+ color .code:n = \@@_set_CT@arc@: #1 \q_stop ,
+ color .value_required:n = true ,
+ sep-color .code:n = \@@_set_CT@drsc@: #1 \q_stop ,
+ sep-color .value_required:n = true ,
+% \end{macrocode}
+% If the user uses the key |tikz|, the rule (or more precisely: the different
+% sub-rules since a rule may be broken by blocks or others) will be drawn with
+% Tikz.
+% \begin{macrocode}
+ tikz .tl_set:N = \l_@@_tikz_rule_tl ,
+ tikz .value_required:n = true ,
+ tikz .initial:n =
+ }
+% \end{macrocode}
+%
+%
+% \subsubsection*{The vertical rules}
+%
+% The following command will be executed in the internal |\CodeAfter|. The
+% argument |#1| is a list of \textsl{key=value} pairs.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_vline:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_vline:n #1
{
% \end{macrocode}
+% The group is for the options.
+% \begin{macrocode}
+ \group_begin:
+ \int_zero_new:N \l_@@_end_int
+ \int_set_eq:NN \l_@@_end_int \c@iRow
+ \keys_set_known:nnN { NiceMatrix / Rules } { #1 } \l_@@_other_keys_tl
+% \end{macrocode}
% The following test is for the case where the user does not use all the columns
% specified in the preamble of the environment (for instance, a preamble of
% \verb+|c|c|c|+ but only two columns used).
% \begin{macrocode}
- \int_compare:nNnT { #1 } < { \c@jCol + 2 }
- {
- \pgfpicture
- \@@_vline_i:nnnn { #1 } { #2 } { #3 } { #4 }
- \endpgfpicture
- }
+ \int_compare:nNnT \l_@@_position_int < { \c@jCol + 2 }
+ \@@_vline_i:
+ \group_end:
}
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_vline_i:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_vline_i:
{
+ \int_zero_new:N \l_@@_local_start_int
+ \int_zero_new:N \l_@@_local_end_int
% \end{macrocode}
% |\l_tmpa_tl| is the number of row and |\l_tmpb_tl| the number of column. When
% we have found a row corresponding to a rule to draw, we note its number in
% |\l_tmpc_tl|.
% \begin{macrocode}
- \tl_set:Nx \l_tmpb_tl { #1 }
- \tl_clear_new:N \l_tmpc_tl
- \int_step_variable:nnNn
- { #3 }
- { \tl_if_blank:nTF { #4 } { \int_use:N \c@iRow } { #4 } }
+ \tl_set:Nx \l_tmpb_tl { \int_eval:n \l_@@_position_int }
+ \int_step_variable:nnNn \l_@@_start_int \l_@@_end_int
\l_tmpa_tl
{
% \end{macrocode}
@@ -14468,32 +14708,26 @@ version 2005/12/01 or later.
\clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_v:
\bool_if:NTF \g_tmpa_bool
{
- \tl_if_empty:NT \l_tmpc_tl
+ \int_compare:nNnT \l_@@_local_start_int = 0
% \end{macrocode}
-% We keep in memory that we have a rule to draw.
+% We keep in memory that we have a rule to draw. |\l_@@_local_start_int| will be
+% the starting row of the rule that we will have to draw.
% \begin{macrocode}
- { \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl }
+ { \int_set:Nn \l_@@_local_start_int \l_tmpa_tl }
}
{
- \tl_if_empty:NF \l_tmpc_tl
+ \int_compare:nNnT \l_@@_local_start_int > 0
{
- \@@_vline_ii:nnnn
- { #1 }
- { #2 }
- \l_tmpc_tl
- { \int_eval:n { \l_tmpa_tl - 1 } }
- \tl_clear:N \l_tmpc_tl
+ \int_set:Nn \l_@@_local_end_int { \l_tmpa_tl - 1 }
+ \@@_vline_ii:
+ \int_zero:N \l_@@_local_start_int
}
}
}
- \tl_if_empty:NF \l_tmpc_tl
+ \int_compare:nNnT \l_@@_local_start_int > 0
{
- \@@_vline_ii:nnnn
- { #1 }
- { #2 }
- \l_tmpc_tl
- { \tl_if_blank:nTF { #4 } { \int_use:N \c@iRow } { #4 } }
- \tl_clear:N \l_tmpc_tl
+ \int_set_eq:NN \l_@@_local_end_int \l_@@_end_int
+ \@@_vline_ii:
}
}
% \end{macrocode}
@@ -14528,39 +14762,39 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% |#1| is the number of the column; |#2| is the number of vertical rules to
-% draw (with potentially a color between); |#3| and |#4| are the numbers of the
-% rows between which the rule has to be drawn.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_vline_ii:nnnn #1 #2 #3 #4
+\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:nnn { #1 } { #3 } { #4 } }
- { \@@_vline_iii:nnnn { #1 } { #2 } { #3 } { #4 } }
+ \@@_vline_iv:
+ {
+ \tl_if_empty:NTF \l_@@_tikz_rule_tl
+ \@@_vline_iii:
+ \@@_vline_v:
+ }
}
% \end{macrocode}
%
% \bigskip
-% The following code is for the standard case (the rule which is drawn is a
-% solid rule).
-%
-% |#1| is the number of the column; |#2| is the number of vertical rules to
-% draw (with potentially a color between); |#3| and |#4| are the numbers of the
-% rows between which the rule has to be drawn.
+% First the case of a standard rule, that is to say a rule which is not dotted
+% (and the user has not used the key |tikz|).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_vline_iii:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_vline_iii:
{
+ \pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
- \@@_qpoint:n { row - #3 }
+ \@@_qpoint:n { row - \int_use:N \l_@@_local_start_int }
\dim_set_eq:NN \l_tmpa_dim \pgf@y
- \@@_qpoint:n { col - #1 }
+ \@@_qpoint:n { col - \int_use:N \l_@@_position_int }
\dim_set_eq:NN \l_tmpb_dim \pgf@x
- \@@_qpoint:n { row - \@@_succ:n { #4 } }
+ \@@_qpoint:n { row - \int_eval:n { \l_@@_local_end_int + 1 } }
\dim_set_eq:NN \l_tmpc_dim \pgf@y
\bool_lazy_all:nT
{
- { \int_compare_p:nNn { #2 } > 1 }
+ { \int_compare_p:nNn \l_@@_multiplicity_int > 1 }
{ \cs_if_exist_p:N \CT@drsc@ }
{ ! \tl_if_blank_p:V \CT@drsc@ }
}
@@ -14570,7 +14804,10 @@ version 2005/12/01 or later.
\dim_add:Nn \l_tmpa_dim { 0.5 \arrayrulewidth }
\dim_sub:Nn \l_tmpc_dim { 0.5 \arrayrulewidth }
\dim_set:Nn \l_tmpd_dim
- { \l_tmpb_dim - ( \doublerulesep + \arrayrulewidth ) * ( #2 - 1 ) }
+ {
+ \l_tmpb_dim - ( \doublerulesep + \arrayrulewidth )
+ * ( \l_@@_multiplicity_int - 1 )
+ }
\pgfpathrectanglecorners
{ \pgfpoint \l_tmpb_dim \l_tmpa_dim }
{ \pgfpoint \l_tmpd_dim \l_tmpc_dim }
@@ -14579,7 +14816,7 @@ version 2005/12/01 or later.
}
\pgfpathmoveto { \pgfpoint \l_tmpb_dim \l_tmpa_dim }
\pgfpathlineto { \pgfpoint \l_tmpb_dim \l_tmpc_dim }
- \prg_replicate:nn { #2 - 1 }
+ \prg_replicate:nn { \l_@@_multiplicity_int - 1 }
{
\dim_sub:Nn \l_tmpb_dim \arrayrulewidth
\dim_sub:Nn \l_tmpb_dim \doublerulesep
@@ -14590,28 +14827,53 @@ version 2005/12/01 or later.
\pgfsetlinewidth { 1.1 \arrayrulewidth }
\pgfsetrectcap
\pgfusepathqstroke
+ \endpgfpicture
}
% \end{macrocode}
%
%
% \bigskip
-% The following code is for the case of a dotted rule (with our system).
-%
-% |#1| is the number of the column; |#2| and |#3| are the numbers of the
-% rows between which the rule has to be drawn.
+% The following code is for the case of a dotted rule (with our system of
+% rounded dots).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_vline_iv:nnn #1 #2 #3
+\cs_new_protected:Npn \@@_vline_iv:
{
+ \pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
- \@@_qpoint:n { col - #1 }
+ \@@_qpoint:n { col - \int_use:N \l_@@_position_int }
\dim_set_eq:NN \l_@@_x_initial_dim \pgf@x
\dim_set_eq:NN \l_@@_x_final_dim \pgf@x
- \@@_qpoint:n { row - #2 }
+ \@@_qpoint:n { row - \int_use:N \l_@@_local_start_int }
\dim_set_eq:NN \l_@@_y_initial_dim \pgf@y
- \@@_qpoint:n { row - \@@_succ:n { #3 } }
+ \@@_qpoint:n { row - \int_eval:n { \l_@@_local_end_int + 1 } }
\dim_set_eq:NN \l_@@_y_final_dim \pgf@y
+ \CT@arc@
\@@_draw_line:
+ \endpgfpicture
+ }
+% \end{macrocode}
+%
+% \bigskip
+% The following code is for the case when the user uses the key |tikz| (in the
+% definition of a customized rule by using the key |custom-line|).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_vline_v:
+ {
+ \begin {tikzpicture }
+ \pgfrememberpicturepositiononpagetrue
+ \pgf@relevantforpicturesizefalse
+ \@@_qpoint:n { row - \int_use:N \l_@@_local_start_int }
+ \dim_set_eq:NN \l_tmpa_dim \pgf@y
+ \@@_qpoint:n { col - \int_use:N \l_@@_position_int }
+ \dim_set_eq:NN \l_tmpb_dim \pgf@x
+ \@@_qpoint:n { row - \int_eval:n { \l_@@_local_end_int + 1 } }
+ \dim_set_eq:NN \l_tmpc_dim \pgf@y
+ \exp_args:NV \tikzset \l_@@_tikz_rule_tl
+ \use:x { \exp_not:N \draw [ \l_@@_tikz_rule_tl ] }
+ ( \l_tmpb_dim , \l_tmpa_dim ) --
+ ( \l_tmpb_dim , \l_tmpc_dim ) ;
+ \end { tikzpicture }
}
% \end{macrocode}
%
@@ -14636,43 +14898,46 @@ version 2005/12/01 or later.
{
\tl_if_eq:NnF \l_@@_vlines_clist { all }
{ \clist_if_in:NnT \l_@@_vlines_clist { ##1 } }
- { \@@_vline:nnnn { ##1 } 1 1 { } }
+ { \@@_vline:n { position = ##1 } }
}
}
% \end{macrocode}
%
%
%
-% \subsection*{The horizontal rules}
+% \subsubsection*{The horizontal rules}
%
% \bigskip
-% The following command will be executed in the internal |\CodeAfter|. The rule
-% will be drawn \emph{before} the row |#1|. |#2| is the number of consecutive
-% occurrences of |\Hline|. |#3| and |#4| are numbers of columns that define the
-% delimitation of the horizontal rule that we have to draw. If |#4| is empty,
-% that means that the rule extends until the last column.
+% The following command will be executed in the internal |\CodeAfter|. The
+% argument |#1| is a list of \textsl{key=value} pairs of the form
+% |{NiceMatrix/Rules}|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_hline:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_hline:n #1
{
- \pgfpicture
- \@@_hline_i:nnnn { #1 } { #2 } { #3 } { #4 }
- \endpgfpicture
+% \end{macrocode}
+% The group is for the options.
+% \begin{macrocode}
+ \group_begin:
+ \int_zero_new:N \l_@@_end_int
+ \int_set_eq:NN \l_@@_end_int \c@jCol
+ \keys_set_known:nnN { NiceMatrix / Rules } { #1 } \l_@@_other_keys_tl
+ \@@_hline_i:
+ \group_end:
}
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_hline_i:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_hline_i:
{
+ \int_zero_new:N \l_@@_local_start_int
+ \int_zero_new:N \l_@@_local_end_int
% \end{macrocode}
% |\l_tmpa_tl| is the number of row and |\l_tmpb_tl| the number of column. When
% we have found a column corresponding to a rule to draw, we note its number in
% |\l_tmpc_tl|.
% \begin{macrocode}
- \tl_set:Nn \l_tmpa_tl { #1 }
- \tl_clear_new:N \l_tmpc_tl
- \int_step_variable:nnNn
- { #3 }
- { \tl_if_blank:nTF { #4 } { \int_use:N \c@jCol } { #4 } }
+ \tl_set:Nx \l_tmpa_tl { \int_use:N \l_@@_position_int }
+ \int_step_variable:nnNn \l_@@_start_int \l_@@_end_int
\l_tmpb_tl
{
% \end{macrocode}
@@ -14692,32 +14957,26 @@ version 2005/12/01 or later.
\clist_if_empty:NF \l_@@_corners_clist \@@_test_in_corner_h:
\bool_if:NTF \g_tmpa_bool
{
- \tl_if_empty:NT \l_tmpc_tl
+ \int_compare:nNnT \l_@@_local_start_int = 0
% \end{macrocode}
-% We keep in memory that we have a rule to draw.
+% We keep in memory that we have a rule to draw. |\l_@@_local_start_int| will be
+% the starting row of the rule that we will have to draw.
% \begin{macrocode}
- { \tl_set_eq:NN \l_tmpc_tl \l_tmpb_tl }
+ { \int_set:Nn \l_@@_local_start_int \l_tmpb_tl }
}
{
- \tl_if_empty:NF \l_tmpc_tl
+ \int_compare:nNnT \l_@@_local_start_int > 0
{
- \@@_hline_ii:nnnn
- { #1 }
- { #2 }
- \l_tmpc_tl
- { \int_eval:n { \l_tmpb_tl - 1 } }
- \tl_clear:N \l_tmpc_tl
+ \int_set:Nn \l_@@_local_end_int { \l_tmpb_tl - 1 }
+ \@@_hline_ii:
+ \int_zero:N \l_@@_local_start_int
}
}
}
- \tl_if_empty:NF \l_tmpc_tl
+ \int_compare:nNnT \l_@@_local_start_int > 0
{
- \@@_hline_ii:nnnn
- { #1 }
- { #2 }
- \l_tmpc_tl
- { \tl_if_blank:nTF { #4 } { \int_use:N \c@jCol } { #4 } }
- \tl_clear:N \l_tmpc_tl
+ \int_set_eq:NN \l_@@_local_end_int \l_@@_end_int
+ \@@_hline_ii:
}
}
% \end{macrocode}
@@ -14753,32 +15012,37 @@ version 2005/12/01 or later.
%
% \bigskip
% \begin{macrocode}
-\cs_new_protected:Npn \@@_hline_ii:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_hline_ii:
{
+ \bool_set_false:N \l_@@_dotted_bool
+ \keys_set:nV { NiceMatrix / RulesBis } \l_@@_other_keys_tl
\bool_if:NTF \l_@@_dotted_bool
- { \@@_hline_iv:nnn { #1 } { #3 } { #4 } }
- { \@@_hline_iii:nnnn { #1 } { #2 } { #3 } { #4 } }
+ \@@_hline_iv:
+ {
+ \tl_if_empty:NTF \l_@@_tikz_rule_tl
+ \@@_hline_iii:
+ \@@_hline_v:
+ }
}
% \end{macrocode}
%
% \bigskip
-% |#1| is the number of the row; |#2| is the number of horizontal rules to
-% draw (with potentially a color between); |#3| and |#4| are the number of the
-% columns between which the rule has to be drawn.
+% First the case of a standard rule, that is to say a rule which is not dotted.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_hline_iii:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_hline_iii:
{
+ \pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
- \@@_qpoint:n { col - #3 }
+ \@@_qpoint:n { col - \int_use:N \l_@@_local_start_int }
\dim_set_eq:NN \l_tmpa_dim \pgf@x
- \@@_qpoint:n { row - #1 }
+ \@@_qpoint:n { row - \int_use:N \l_@@_position_int }
\dim_set_eq:NN \l_tmpb_dim \pgf@y
- \@@_qpoint:n { col - \@@_succ:n { #4 } }
+ \@@_qpoint:n { col - \int_eval:n { \l_@@_local_end_int + 1 } }
\dim_set_eq:NN \l_tmpc_dim \pgf@x
\bool_lazy_all:nT
{
- { \int_compare_p:nNn { #2 } > 1 }
+ { \int_compare_p:nNn \l_@@_multiplicity_int > 1 }
{ \cs_if_exist_p:N \CT@drsc@ }
{ ! \tl_if_blank_p:V \CT@drsc@ }
}
@@ -14786,7 +15050,10 @@ version 2005/12/01 or later.
\group_begin:
\CT@drsc@
\dim_set:Nn \l_tmpd_dim
- { \l_tmpb_dim - ( \doublerulesep + \arrayrulewidth ) * ( #2 - 1 ) }
+ {
+ \l_tmpb_dim - ( \doublerulesep + \arrayrulewidth )
+ * ( \l_@@_multiplicity_int - 1 )
+ }
\pgfpathrectanglecorners
{ \pgfpoint \l_tmpa_dim \l_tmpb_dim }
{ \pgfpoint \l_tmpc_dim \l_tmpd_dim }
@@ -14795,7 +15062,7 @@ version 2005/12/01 or later.
}
\pgfpathmoveto { \pgfpoint \l_tmpa_dim \l_tmpb_dim }
\pgfpathlineto { \pgfpoint \l_tmpc_dim \l_tmpb_dim }
- \prg_replicate:nn { #2 - 1 }
+ \prg_replicate:nn { \l_@@_multiplicity_int - 1 }
{
\dim_sub:Nn \l_tmpb_dim \arrayrulewidth
\dim_sub:Nn \l_tmpb_dim \doublerulesep
@@ -14806,6 +15073,7 @@ version 2005/12/01 or later.
\pgfsetlinewidth { 1.1 \arrayrulewidth }
\pgfsetrectcap
\pgfusepathqstroke
+ \endpgfpicture
}
% \end{macrocode}
%
@@ -14856,16 +15124,17 @@ version 2005/12/01 or later.
% \end{bNiceMatrix}$
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_hline_iv:nnn #1 #2 #3
+\cs_new_protected:Npn \@@_hline_iv:
{
+ \pgfpicture
\pgfrememberpicturepositiononpagetrue
\pgf@relevantforpicturesizefalse
- \@@_qpoint:n { row - #1 }
+ \@@_qpoint:n { row - \int_use:N \l_@@_position_int }
\dim_set_eq:NN \l_@@_y_initial_dim \pgf@y
\dim_set_eq:NN \l_@@_y_final_dim \pgf@y
- \@@_qpoint:n { col - #2 }
+ \@@_qpoint:n { col - \int_use:N \l_@@_local_start_int }
\dim_set_eq:NN \l_@@_x_initial_dim \pgf@x
- \int_compare:nNnT { #2 } = 1
+ \int_compare:nNnT \l_@@_local_start_int = 1
{
\dim_sub:Nn \l_@@_x_initial_dim \l_@@_left_margin_dim
\bool_if:NT \l_@@_NiceArray_bool
@@ -14878,9 +15147,9 @@ version 2005/12/01 or later.
\tl_if_eq:NnF \g_@@_left_delim_tl (
{ \dim_add:Nn \l_@@_x_initial_dim { 0.5 \l_@@_inter_dots_dim } }
}
- \@@_qpoint:n { col - \@@_succ:n { #3 } }
+ \@@_qpoint:n { col - \int_eval:n { \l_@@_local_end_int + 1 } }
\dim_set_eq:NN \l_@@_x_final_dim \pgf@x
- \int_compare:nNnT { #3 } = \c@jCol
+ \int_compare:nNnT \l_@@_local_end_int = \c@jCol
{
\dim_add:Nn \l_@@_x_final_dim \l_@@_right_margin_dim
\bool_if:NT \l_@@_NiceArray_bool
@@ -14888,7 +15157,32 @@ version 2005/12/01 or later.
\tl_if_eq:NnF \g_@@_right_delim_tl )
{ \dim_gsub:Nn \l_@@_x_final_dim { 0.5 \l_@@_inter_dots_dim } }
}
+ \CT@arc@
\@@_draw_line:
+ \endpgfpicture
+ }
+% \end{macrocode}
+%
+% \bigskip
+% The following code is for the case when the user uses the key |tikz| (in the
+% definition of a customized rule by using the key |custom-line|).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_hline_v:
+ {
+ \begin { tikzpicture }
+ \pgfrememberpicturepositiononpagetrue
+ \pgf@relevantforpicturesizefalse
+ \@@_qpoint:n { col - \int_use:N \l_@@_local_start_int }
+ \dim_set_eq:NN \l_tmpa_dim \pgf@x
+ \@@_qpoint:n { row - \int_use:N \l_@@_position_int }
+ \dim_set_eq:NN \l_tmpb_dim \pgf@y
+ \@@_qpoint:n { col - \int_eval:n { \l_@@_local_end_int + 1 } }
+ \dim_set_eq:NN \l_tmpc_dim \pgf@x
+ \exp_args:NV \tikzset \l_@@_tikz_rule_tl
+ \use:x { \exp_not:N \draw [ \l_@@_tikz_rule_tl ] }
+ ( \l_tmpa_dim , \l_tmpb_dim ) --
+ ( \l_tmpc_dim , \l_tmpb_dim ) ;
+ \end { tikzpicture }
}
% \end{macrocode}
%
@@ -14896,7 +15190,7 @@ version 2005/12/01 or later.
% \bigskip
% The command |\@@_draw_hlines:| draws all the horizontal rules excepted in the
% blocks (even the virtual blocks determined by commands such as |\Cdots| and in
-% the corners (if the key |corners| is used).
+% the corners (if the key |corners| is used)).
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_hlines:
{
@@ -14913,7 +15207,7 @@ version 2005/12/01 or later.
{
\tl_if_eq:NnF \l_@@_hlines_clist { all }
{ \clist_if_in:NnT \l_@@_hlines_clist { ##1 } }
- { \@@_hline:nnnn { ##1 } 1 1 { } }
+ { \@@_hline:n { position = ##1 } }
}
}
% \end{macrocode}
@@ -14950,12 +15244,163 @@ version 2005/12/01 or later.
+ \doublerulesep * ( \int_max:nn 0 { #1 - 1 } )
}
\tl_gput_right:Nx \g_@@_internal_code_after_tl
- { \@@_hline:nnnn { \@@_succ:n { \c@iRow } } { #1 } 1 { } }
+ {
+ \@@_hline:n
+ {
+ position = \int_eval:n { \c@iRow + 1 } ,
+ multiplicity = #1
+ }
+ }
\ifnum 0 = `{ \fi }
}
% \end{macrocode}
%
-% \subsection*{The key hvlines}
+% \subsubsection*{Customized rules defined by the final user}
+%
+% The final user can define a customized rule by using the key |custom-line| in
+% |\NiceMatrixOptions|. That key takes in as value a list of \textsl{key=value}
+% pairs.
+%
+%
+%
+% \medskip
+% Among the keys avalaible in that list, there is the key |letter| to specify a
+% letter that the final user will use in the preamble of the array. All the
+% letters defined by this way by the final user for such customized rules are
+% added in the set of keys |{NiceMatrix / ColumnTypes}|. That set of keys is
+% used to store the characteristics of those types of rules for convenience: the
+% keys of that set of keys won't never be used as keys by the final user (he
+% will use, instead, letters in the preamble of its array).
+%
+% \begin{macrocode}
+\keys_define:nn { NiceMatrix / ColumnTypes } { }
+% \end{macrocode}
+%
+%
+% \medskip
+% The following command will create the customized rule (it is executed when the
+% final user uses the key |custom-line| in |\NiceMatrixOption|).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_custom_line:n #1
+ {
+ \keys_set_known:nn { NiceMatrix / Custom-Line } { #1 }
+% \end{macrocode}
+% If the final user only wants to draw horizontal rules, he does not need to
+% specify a letter (for the vertical rules in the preamble of the array). On the
+% other hand, if he only wants to draw vertical rules, the does not need to
+% define a command (which is the tool to draw horizontal rules in the array). Of
+% course, a definition of custom lines with no letter and no command would be point-less.
+%
+% \begin{macrocode}
+ \bool_lazy_and:nnTF
+ { \str_if_empty_p:N \l_@@_letter_str }
+ { \str_if_empty_p:N \l_@@_command_str }
+ { \@@_error:n { No~letter~and~no~command } }
+ {
+ \str_if_empty:NF \l_@@_letter_str
+ {
+ \int_compare:nNnTF { \str_count:N \l_@@_letter_str } = 1
+ {
+ \exp_args:NnV \tl_if_in:NnTF
+ \c_@@_forbidden_letters_str \l_@@_letter_str
+ { \@@_error:n { Forbidden~letter } }
+ {
+ \exp_args:Nnx \keys_define:nn { NiceMatrix / ColumnTypes }
+ {
+ \l_@@_letter_str .code:n =
+ { \@@_custom_line_i:n { \exp_not:n { #1 } } }
+ }
+ }
+ }
+ { \@@_error:n { Several~letters } }
+ }
+ \str_if_empty:NF \l_@@_command_str
+ { \exp_args:NnV \@@_define_h_custom_line:nn { #1 } \l_tmpc_int }
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\str_const:Nn \c_@@_forbidden_letters_str { lcrpmbVX:|()[]!@<> }
+% \end{macrocode}
+%
+% \medskip
+% The previous command |\@@_custom_line:n| uses the following set of keys.
+% However, the whole definition of the customized lines (as provided by the
+% final user as argument of |custom-line|) will also be used further with
+% other sets of keys (for instance |{NiceMatrix/Rules}|). That's why the
+% following set of keys has only entries for three keys.
+% \begin{macrocode}
+\keys_define:nn { NiceMatrix / Custom-Line }
+ {
+ letter .str_set:N = \l_@@_letter_str ,
+ letter .value_required:n = true ,
+ letter .initial:n = ,
+ command .str_set:N = \l_@@_command_str ,
+ command .value_required:n = true ,
+ command .initial:n = ,
+% \end{macrocode}
+% We need to know the multiplicity of the rule right now in order to compute the
+% total width of the rule (and reserve space both in vertical and horizontal rules).
+% \begin{macrocode}
+ multiplicity .int_set:N = \l_tmpc_int ,
+ multiplicity .initial:n = 1 ,
+ multiplicity .value_required:n = true ,
+ }
+% \end{macrocode}
+%
+% \bigskip
+% The following command will create the command that the final user will use in
+% its array to draw a horizontal rule (hence the `|h|` in the name). |#1| is the
+% whole set of keys to pass to |\@@_line:n| and |#2| is the multiplicity of
+% the line (number of consecutive rules).
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_define_h_custom_line:nn #1 #2
+ {
+% \end{macrocode}
+% We use |\cs_set:cpn| and not |\cs_new:cpn| because we want a local définition.
+% Moreover, the command must \emph{not} be protected since it begins with |\noalign|.
+% \begin{macrocode}
+ \cs_set:cpn \l_@@_command_str
+ {
+ \noalign
+ {
+ \skip_vertical:n
+ {
+ \dim_eval:n
+ { \arrayrulewidth * #2 + \doublerulesep * ( #2 - 1) }
+ }
+ \tl_gput_right:Nx \g_@@_internal_code_after_tl
+ { \@@_hline:n { #1 , position = \int_eval:n { \c@iRow + 1 } } }
+ }
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_custom_line_i:n #1
+ {
+ \tl_gput_right:Nx \g_@@_preamble_tl
+ {
+ \exp_not:N !
+ {
+ \skip_horizontal:n
+ {
+ \dim_eval:n
+ {
+ \arrayrulewidth * \l_tmpc_int
+ + \doublerulesep * ( \l_tmpc_int - 1)
+ }
+ }
+ }
+ }
+ \tl_gput_right:Nx \g_@@_internal_code_after_tl
+ { \@@_vline:n { #1 , position = \@@_succ:n \c@jCol } }
+ }
+% \end{macrocode}
+%
+%
+% \subsubsection*{The key hvlines}
%
% The following command tests whether the current position in the array (given by
% |\l_tmpa_tl| for the row and |\l_tmpb_tl| for the column) would provide an
@@ -15248,12 +15693,7 @@ version 2005/12/01 or later.
% number of the row \emph{before} which we will draw the row.
% \begin{macrocode}
\cs_new_protected:Npn \@@_hdottedline:n #1
- {
- \group_begin:
- \bool_set_true:N \l_@@_dotted_bool
- \@@_hline:nnnn { #1 } { 1 } { 1 } { \int_use:N \c@jCol }
- \group_end:
- }
+ { \@@_hline:n { position = #1 , end = \int_use:N \c@jCol , dotted } }
% \end{macrocode}
%
%
@@ -15264,12 +15704,7 @@ version 2005/12/01 or later.
% \medskip
% \begin{macrocode}
\cs_new_protected:Npn \@@_vdottedline:n #1
- {
- \group_begin:
- \bool_set_true:N \l_@@_dotted_bool
- \@@_vline:nnnn { \int_eval:n { #1 + 1 } } { 1 } { 1 } { \int_use:N \c@iRow }
- \group_end:
- }
+ { \@@_vline:n { position = \int_eval:n { #1 + 1 } , dotted } }
% \end{macrocode}
%
% \bigskip
@@ -15721,7 +16156,9 @@ version 2005/12/01 or later.
b .code:n = \str_set:Nn \l_@@_vpos_of_block_tl b ,
b .value_forbidden:n = true ,
color .tl_set:N = \l_@@_color_tl ,
- color .value_required:n = true
+ color .value_required:n = true ,
+ respect-arraystretch .bool_set:N = \l_@@_respect_arraystretch_bool ,
+ respect-arraystretch .default:n = true ,
}
% \end{macrocode}
%
@@ -15759,8 +16196,9 @@ version 2005/12/01 or later.
% \medskip
% Now, the arguments have been extracted: |#1| is $i$ (the number of rows of the
% block), |#2| is $j$ (the number of columns of the block), |#3| is the list of
-% key-values, |#4| are the tokens to put before the math mode and the beginning
-% of the small array of the block and |#5| is the label of the block.
+% \textsl{key=values} pairs, |#4| are the tokens to put before the math mode and
+% the beginning of the small array of the block and |#5| is the label of the
+% block.
% \begin{macrocode}
\cs_new_protected:Npn \@@_Block_ii:nnnnn #1 #2 #3 #4 #5
{
@@ -15897,7 +16335,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\int_compare:nNnT { #1 } = 1 \g_@@_row_style_tl
\group_begin:
- \cs_set:Npn \arraystretch { 1 }
+ \bool_if:NF \l_@@_respect_arraystretch_bool
+ { \cs_set:Npn \arraystretch { 1 } }
\dim_zero:N \extrarowheight
#4
% \end{macrocode}
@@ -15911,9 +16350,12 @@ version 2005/12/01 or later.
\bool_if:NT \g_@@_rotate_bool { \str_set:Nn \l_@@_hpos_block_str c }
\bool_if:NTF \l_@@_NiceTabular_bool
{
- \bool_lazy_and:nnTF
- { \int_compare_p:nNn { #2 } = 1 }
- { \dim_compare_p:n { \l_@@_col_width_dim >= \c_zero_dim } }
+ \bool_lazy_all:nTF
+ {
+ { \int_compare_p:nNn { #2 } = 1 }
+ { \dim_compare_p:n { \l_@@_col_width_dim >= \c_zero_dim } }
+ { ! \l_@@_respect_arraystretch_bool }
+ }
% \end{macrocode}
% When the block is mono-column in a column with a fixed width (eg |p{3cm}|).
% \begin{macrocode}
@@ -15926,7 +16368,7 @@ version 2005/12/01 or later.
r \raggedleft
l \raggedright
}
- #5
+ #5
\end { minipage }
}
{
@@ -16037,7 +16479,8 @@ version 2005/12/01 or later.
\bool_if:NTF \l_@@_NiceTabular_bool
{
\group_begin:
- \cs_set:Npn \arraystretch { 1 }
+ \bool_if:NF \l_@@_respect_arraystretch_bool
+ { \cs_set:Npn \arraystretch { 1 } }
\dim_zero:N \extrarowheight
#4
% \end{macrocode}
@@ -16061,7 +16504,8 @@ version 2005/12/01 or later.
}
{
\group_begin:
- \cs_set:Npn \arraystretch { 1 }
+ \bool_if:NF \l_@@_respect_arraystretch_bool
+ { \cs_set:Npn \arraystretch { 1 } }
\dim_zero:N \extrarowheight
#4
\bool_if:NT \g_@@_rotate_bool
@@ -16107,8 +16551,11 @@ version 2005/12/01 or later.
color .value_required:n = true ,
borders .clist_set:N = \l_@@_borders_clist ,
borders .value_required:n = true ,
- hvlines .bool_set:N = \l_@@_hvlines_block_bool ,
- hvlines .default:n = true ,
+ hvlines .meta:n = { vlines = #1 , hlines = #1 } ,
+ vlines .bool_set:N = \l_@@_vlines_block_bool,
+ vlines .default:n = true ,
+ hlines .bool_set:N = \l_@@_hlines_block_bool,
+ hlines .default:n = true ,
line-width .dim_set:N = \l_@@_line_width_dim ,
line-width .value_required:n = true ,
l .code:n = \str_set:Nn \l_@@_hpos_block_str l ,
@@ -16132,7 +16579,9 @@ version 2005/12/01 or later.
b .value_forbidden:n = true ,
name .tl_set:N = \l_@@_block_name_str ,
name .value_required:n = true ,
- name .initial:n = \c_empty_tl ,
+ name .initial:n = ,
+ respect-arraystretch .bool_set:N = \l_@@_respect_arraystretch_bool ,
+ respect-arraystretch .default:n = true ,
unknown .code:n = \@@_error:n { Unknown~key~for~Block }
}
% \end{macrocode}
@@ -16208,16 +16657,28 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
- \bool_if:NTF \l_@@_hvlines_block_bool
+ \bool_if:NT \l_@@_vlines_block_bool
+ {
+ \tl_gput_right:Nx \g_nicematrix_code_after_tl
+ {
+ \@@_vlines_block:nnn
+ { \exp_not:n { #5 } }
+ { #1 - #2 }
+ { \int_use:N \l_@@_last_row_int - \int_use:N \l_@@_last_col_int }
+ }
+ }
+ \bool_if:NT \l_@@_hlines_block_bool
{
\tl_gput_right:Nx \g_nicematrix_code_after_tl
{
- \@@_hvlines_block:nnn
+ \@@_hlines_block:nnn
{ \exp_not:n { #5 } }
{ #1 - #2 }
{ \int_use:N \l_@@_last_row_int - \int_use:N \l_@@_last_col_int }
}
}
+ \bool_if:nT
+ { ! \l_@@_vlines_block_bool && ! \l_@@_hlines_block_bool }
{
% \end{macrocode}
% The sequence of the positions of the blocks (excepted the blocks with the key
@@ -16689,7 +17150,7 @@ version 2005/12/01 or later.
% block (with, as usual, the syntax $i$|-|$j$) and the third is the last cell of
% the block (with the same syntax).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_hvlines_block:nnn #1 #2 #3
+\cs_new_protected:Npn \@@_vlines_block:nnn #1 #2 #3
{
\dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
\keys_set_known:nn { NiceMatrix / BlockBorders } { #1 }
@@ -16702,12 +17163,37 @@ version 2005/12/01 or later.
\int_step_inline:nnn \l_tmpd_tl \l_tmpb_tl
{
\use:x
- { \@@_vline:nnnn { ##1 } 1 { \l_tmpc_tl } { \@@_pred:n \l_tmpa_tl } }
+ {
+ \@@_vline:n
+ {
+ position = ##1 ,
+ start = \l_tmpc_tl ,
+ end = \@@_pred:n \l_tmpa_tl
+ }
+ }
}
+ }
+\cs_new_protected:Npn \@@_hlines_block:nnn #1 #2 #3
+ {
+ \dim_set_eq:NN \l_@@_line_width_dim \arrayrulewidth
+ \keys_set_known:nn { NiceMatrix / BlockBorders } { #1 }
+ \@@_cut_on_hyphen:w #2 \q_stop
+ \tl_set_eq:NN \l_tmpc_tl \l_tmpa_tl
+ \tl_set_eq:NN \l_tmpd_tl \l_tmpb_tl
+ \@@_cut_on_hyphen:w #3 \q_stop
+ \tl_set:Nx \l_tmpa_tl { \int_eval:n { \l_tmpa_tl + 1 } }
+ \tl_set:Nx \l_tmpb_tl { \int_eval:n { \l_tmpb_tl + 1 } }
\int_step_inline:nnn \l_tmpc_tl \l_tmpa_tl
{
\use:x
- { \@@_hline:nnnn { ##1 } 1 { \l_tmpd_tl } { \@@_pred:n \l_tmpb_tl } }
+ {
+ \@@_hline:n
+ {
+ position = ##1 ,
+ start = \l_tmpd_tl ,
+ end = \int_eval:n { \l_tmpb_tl - 1 }
+ }
+ }
}
}
% \end{macrocode}
@@ -17083,7 +17569,7 @@ version 2005/12/01 or later.
%
%
% The |\CodeAfter| (inserted with the key |code-after| or after the keyword
-% |\CodeAfter|) may always begin with a list of pairs \emph{key-value} between
+% |\CodeAfter|) may always begin with a list of pairs \textsl{key=value} between
% square brackets. Here is the corresponding set of keys.
% \begin{macrocode}
\keys_define:nn { NiceMatrix }
@@ -17301,6 +17787,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / SubMatrix }
{
+ delimiters / color .tl_set:N = \l_@@_delimiters_color_tl ,
+ delimiters / color .value_required:n = true ,
hlines .clist_set:N = \l_@@_submatrix_hlines_clist ,
hlines .default:n = all ,
vlines .clist_set:N = \l_@@_submatrix_vlines_clist ,
@@ -17886,7 +18374,7 @@ version 2005/12/01 or later.
\group_begin:
% \end{macrocode}
% The four following token lists correspond to the position of the sub-matrix to
-% which an brace will be attached.
+% which a brace will be attached.
% \begin{macrocode}
\@@_compute_i_j:nn { #1 } { #2 }
\bool_lazy_or:nnTF
@@ -18082,8 +18570,8 @@ version 2005/12/01 or later.
\@@_msg_new:nn { Key~transparent }
{
The~key~'transparent'~is~now~obsolete~(because~it's~name~
- is~not~clear).~You~should~use~the~conjonction~of~'renew-dots'~
- and~'renew-matrix'.~However,~you~can~go~on.
+ is~not~clear).~You~must~use~the~conjonction~of~'renew-dots'~
+ and~'renew-matrix'.~This~error~is~fatal.
}
% \end{macrocode}
%
@@ -18094,12 +18582,7 @@ version 2005/12/01 or later.
renew-dots .value_forbidden:n = true ,
renew-matrix .code:n = \@@_renew_matrix: ,
renew-matrix .value_forbidden:n = true ,
- transparent .code:n =
- {
- \@@_renew_matrix:
- \bool_set_true:N \l_@@_renew_dots_bool
- \@@_error:n { Key~transparent }
- } ,
+ transparent .code:n = \@@_fatal:n { Key~transparent } ,
transparent .value_forbidden:n = true,
footnote .bool_set:N = \c_@@_footnote_bool ,
footnotehyper .bool_set:N = \c_@@_footnotehyper_bool ,
@@ -18176,18 +18659,6 @@ version 2005/12/01 or later.
% \bigskip
% \subsection*{Error messages of the package}
%
-%
-% The following message will be deleted when we will delete the key
-% |except-corners| for the command |\arraycolor|.
-% \begin{macrocode}
-\@@_msg_new:nn { key~except-corners }
- {
- The~key~'except-corners'~has~been~deleted~for~the~command~\token_to_str:N
- \arraycolor\ in~the~\token_to_str:N \CodeBefore.~You~should~instead~use~
- the~key~'corners'~in~your~\@@_full_name_env:.\\
- If~you~go~on,~this~key~will~be~ignored.
- }
-% \end{macrocode}
%
%
% \begin{macrocode}
@@ -18462,6 +18933,33 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \begin{macrocode}
+\@@_msg_new:nn { No~letter~and~no~command }
+ {
+ Your~use~of~'custom-line'~is~no-op~since~you~don't~have~used~the~
+ key~'letter'~(for~a~letter~for~vertical~rules)~nor~the~key~'command'~
+ (to~draw~horizontal~rules).\\
+ However,~you~can~go~on.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { Forbidden~letter }
+ {
+ You~can't~use~the~letter~'\l_@@_letter_str'~for~a~customized~line.\\
+ If~you~go~on,~it~will~be~ignored.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { Several~letters }
+ {
+ You~must~use~only~one~letter~as~value~for~the~key~'letter'~(and~
+ have~used~'\l_@@_letter_str').\\
+ If~you~go~on,~it~will~be~ignored.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\@@_msg_new:nn { Delimiter~with~small }
{
You~can't~put~a~delimiter~in~the~preamble~of~your~\@@_full_name_env:\
@@ -18593,6 +19091,17 @@ version 2005/12/01 or later.
This~error~is~fatal.
}
% \end{macrocode}
+%
+% \begin{macrocode}
+\@@_msg_new:nn { colon~without~arydshln }
+ {
+ The~column~type~':'~in~your~\@@_full_name_env:\
+ is~unknown.~If~you~want~to~use~':'~of~'arydshln',~you~should~
+ load~that~package.~If~you~want~a~dotted~line~of~'nicematrix',~you~
+ should~use~'\l_@@_letter_for_dotted_lines_str'.\\
+ This~error~is~fatal.
+ }
+% \end{macrocode}
%
% \begin{macrocode}
\@@_msg_new:nn { tabularnote~forbidden }
@@ -18684,7 +19193,8 @@ version 2005/12/01 or later.
}
{
The~available~keys~are~(in~alphabetic~order):~b,~borders,~c,~draw,~fill,~
- hvlines,~l,~line-width,~name,~rounded-corners,~r,~t~and~tikz.
+ hlines,~hvlines,~l,~line-width,~name,~rounded-corners,~r,~respect-arraystretch,
+ ~t,~tikz~and~vlines.
}
% \end{macrocode}
%
@@ -18815,6 +19325,7 @@ version 2005/12/01 or later.
code-for-last-col,~
code-for-last-row,~
corners,~
+ custom-key,~
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
@@ -18833,6 +19344,7 @@ version 2005/12/01 or later.
nullify-dots,~
renew-dots,~
renew-matrix,~
+ respect-arraystretch,~
right-margin,~
rules~(with~the~subkeys~'color'~and~'width'),~
small,~
@@ -18885,6 +19397,7 @@ version 2005/12/01 or later.
notes/para,~
nullify-dots,~
renew-dots,~
+ respect-arraystretch,~
right-margin,~
rules~(with~the~subkeys~'color'~and~'width'),~
small,~
@@ -18944,6 +19457,7 @@ version 2005/12/01 or later.
nullify-dots,~
r,~
renew-dots,~
+ respect-arraystretch,~
right-margin,~
rules~(with~the~subkeys~'color'~and~'width'),~
small,~
@@ -18979,6 +19493,7 @@ version 2005/12/01 or later.
colortbl-like,~
columns-width,~
corners,~
+ custom-line,~
create-extra-nodes,~
create-medium-nodes,~
create-large-nodes,~
@@ -18997,6 +19512,7 @@ version 2005/12/01 or later.
notes/para,~
nullify-dots,~
renew-dots,~
+ respect-arraystretch,~
right-margin,~
rules~(with~the~subkeys~'color'~and~'width'),~
t,~
@@ -19584,6 +20100,12 @@ version 2005/12/01 or later.
% Correction of a bug: the use of |\hdottedline| and |:| in the preamble of the
% array (of another letter specified by |letter-for-dotted-lines|) was
% incompatible with the key |xdots/line-style|.
+%
+% \subsection*{Changes between versions 6.4 and 6.5}
+%
+% Key |custom-line| in |\NiceMatrixOptions|.
+%
+% Key |respect-arraystretch|.
%
% \PrintIndex
%
diff --git a/macros/latex/contrib/nicematrix/nicematrix.ins b/macros/latex/contrib/nicematrix/nicematrix.ins
index b6fbed12ca..2bfd59f567 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.ins
+++ b/macros/latex/contrib/nicematrix/nicematrix.ins
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2018-2021 by F. Pantigny
+%% Copyright (C) 2018-2022 by F. Pantigny
%%
%%
%% This file may be distributed and/or modified under the
@@ -17,7 +17,7 @@
\usedir{tex/latex/nicematrix}
\preamble
-Copyright (C) 2018-2021 by F. Pantigny
+Copyright (C) 2018-2022 by F. Pantigny
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index d6c12ea75e..703b8f8c3b 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index 756cb37d36..2c833724ea 100644
--- a/macros/latex/contrib/spbmark/spbmark.pdf
+++ b/macros/latex/contrib/spbmark/spbmark.pdf
Binary files differ
diff --git a/macros/latex/contrib/spbmark/spbmark.sty b/macros/latex/contrib/spbmark/spbmark.sty
index 16e168baa2..bc2aeab66f 100644
--- a/macros/latex/contrib/spbmark/spbmark.sty
+++ b/macros/latex/contrib/spbmark/spbmark.sty
@@ -1,7 +1,7 @@
%
% ***************** THE SPBMARK PACKAGE *****************
%
-% Copyright (C) 2021 by Qu Yi <q1jx@foxmail.com>
+% Copyright (C) 2021-2022 by Qu Yi <q1jx@foxmail.com>
%
% This work may be distributed and/or modified under the
% conditions of the CC-BY 4.0 License.
@@ -9,9 +9,11 @@
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2018/12/31]
\RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/12/22}{1.2H}
+\ProvidesExplPackage{spbmark}{2022/01/23}{1.3}
{Customize superscripts and subscripts}
+\cs_generate_variant:Nn \box_set_ht:Nn { cv }
+\cs_generate_variant:Nn \box_set_dp:Nn { cv }
\cs_generate_variant:Nn \dim_max:nn { VV }
\cs_generate_variant:Nn \dim_compare:nNnTF { V }
\cs_generate_variant:Nn \msg_warning:nnn { nnV }
@@ -40,17 +42,15 @@
\tl_new:N \l__spb_super_cmd_ii_tl
\tl_new:N \l__spb_sub_cmd_ii_tl
-\tl_new:N \g__spb_hmove_init_tl
-\tl_new:N \g__spb_vmove_init_tl
-\tl_new:N \g__spb_cmd_init_tl
+\tl_new:N \g__spb_mark_case_init_tl
-\cs_new_protected:Npn \spb_local_case_init:nnnn #1#2#3#4
+\cs_new_protected:Npn \spb_local_case_init:nnn #1#2#3
{
- \str_case:xn { \tl_use:c { g__spb_#1_init_tl } }
+ \str_case:Vn \g__spb_mark_case_init_tl
{
- { super } {#2}
- { sub } {#3}
- { supersub } {#4}
+ { super } {#1}
+ { sub } {#2}
+ { supersub } {#3}
}
}
\cs_new_protected:Npn \defspbstyle #1#2
@@ -75,14 +75,14 @@
spbhmove .initial:n = 0pt,
vmove .code:n =
{
- \spb_local_case_init:nnnn { vmove }
+ \spb_local_case_init:nnn
{ \tl_set:Nn \l__spb_super_vmove_tl {#1} }
{ \tl_set:Nn \l__spb_sub_vmove_tl {#1} }
{ \tl_set:Nn \l__spb_supersub_vsep_tl {#1} }
},
hmove .code:n =
{
- \spb_local_case_init:nnnn { hmove }
+ \spb_local_case_init:nnn
{ \tl_set:Nn \l__spb_super_hmove_tl {#1} }
{ \tl_set:Nn \l__spb_sub_hmove_tl {#1} }
{ \tl_set:Nn \l__spb_supersub_hmove_tl {#1} }
@@ -94,7 +94,7 @@
spbcmd .code:n = \spb@both@cmd@assign{#1},
cmd .code:n =
{
- \spb_local_case_init:nnnn { cmd }
+ \spb_local_case_init:nnn
{ \tl_set:Nn \l__spb_super_cmd_i_tl {#1} }
{ \tl_set:Nn \l__spb_sub_cmd_i_tl {#1} }
{ \spb@both@cmd@assign{#1} }
@@ -104,11 +104,31 @@
spbcmd+ .code:n = \spb@both@cmd@assign+{#1},
cmd+ .code:n =
{
- \spb_local_case_init:nnnn { cmd }
+ \spb_local_case_init:nnn
{ \tl_put_right:Nn \l__spb_super_cmd_i_tl {#1} }
{ \tl_put_right:Nn \l__spb_sub_cmd_i_tl {#1} }
{ \spb@both@cmd@assign+{#1} }
},
+ spheight .tl_set:N = \l__super_height_i_tl,
+ sbheight .tl_set:N = \l__sub_height_i_tl,
+ spbheight .tl_set:N = \l__super_height_ii_tl,
+ height .code:n =
+ {
+ \spb_local_case_init:nnn
+ { \tl_set:Nn \l__super_height_i_tl {#1} }
+ { \tl_set:Nn \l__sub_height_i_tl {#1} }
+ { \tl_set:Nn \l__super_height_ii_tl {#1} }
+ },
+ spdepth .tl_set:N = \l__super_depth_i_tl,
+ sbdepth .tl_set:N = \l__sub_depth_i_tl,
+ spbdepth .tl_set:N = \l__sub_depth_ii_tl,
+ depth .code:n =
+ {
+ \spb_local_case_init:nnn
+ { \tl_set:Nn \l__super_depth_i_tl {#1} }
+ { \tl_set:Nn \l__sub_depth_i_tl {#1} }
+ { \tl_set:Nn \l__sub_depth_ii_tl {#1} }
+ },
vsep .tl_set:N = \l__spb_supersub_vsep_tl,
vsep .initial:n = 0.6ex,
halign .tl_set:N = \l__spb_supersub_halign_tl,
@@ -123,9 +143,13 @@
\cs_set_eq:NN \spb@textsubscript@save \textsubscript
\cs_set_eq:NN \spb@math@super@save \sp
\cs_set_eq:NN \spb@math@sub@save \sb
+\box_new:N \l__super_i_box
+\box_new:N \l__sub_i_box
+\box_new:N \l__super_ii_box
+\box_new:N \l__sub_ii_box
\cs_new:Npn \spb_math_print_store_i:nn #1#2
{
- \hbox_set:Nn \l_tmpa_box
+ \hbox_set:cn { l__#1_i_box }
{
\ensuremath
{
@@ -136,7 +160,7 @@
}
\cs_new:Npn \spb_text_print_store_i:nn #1#2
{
- \hbox_set:Nn \l_tmpa_box
+ \hbox_set:cn { l__#1_i_box }
{
\use:c { spb@text#1script@save }
{ \tl_use:c { l__spb_#1_cmd_i_tl }{#2} }
@@ -144,16 +168,16 @@
}
\cs_new:Npn \spb_math_print_store_ii:nn #1#2
{
- \hbox_set:Nn \l_tmpa_box
+ \hbox_set:Nn \l__super_ii_box
{ \ensuremath{\spb@math@super@save{\l__spb_super_cmd_ii_tl{#1}}} }
- \hbox_set:Nn \l_tmpb_box
+ \hbox_set:Nn \l__sub_ii_box
{ \ensuremath{\spb@math@sub@save{\l__spb_sub_cmd_ii_tl{#2}}} }
}
\cs_new:Npn \spb_text_print_store_ii:nn #1#2
{
- \hbox_set:Nn \l_tmpa_box
+ \hbox_set:Nn \l__super_ii_box
{ \spb@textsuperscript@save{\l__spb_super_cmd_ii_tl{#1}} }
- \hbox_set:Nn \l_tmpb_box
+ \hbox_set:Nn \l__sub_ii_box
{ \spb@textsubscript@save{\l__spb_sub_cmd_ii_tl{#2}} }
}
\cs_set_eq:NN \spbifmath \use_ii:nn
@@ -187,42 +211,41 @@
}
}
}
-\tl_set:Nn \l__spb_boxa_wd_tl { \box_wd:N \l_tmpa_box }
-\tl_set:Nn \l__spb_boxb_wd_tl { \box_wd:N \l_tmpb_box }
+\tl_set:Nn \l__spb_box_super_wd_i_tl { \box_wd:N \l__super_i_box }
+\tl_set:Nn \l__spb_box_sub_wd_i_tl { \box_wd:N \l__sub_i_box }
+\tl_set:Nn \l__spb_box_super_wd_ii_tl { \box_wd:N \l__super_ii_box }
+\tl_set:Nn \l__spb_box_sub_wd_ii_tl { \box_wd:N \l__sub_ii_box }
\tl_set:Nn \l__spb_box_max_wd_tl
- { \dim_max:VV \l__spb_boxa_wd_tl \l__spb_boxb_wd_tl }
+ { \dim_max:VV \l__spb_box_super_wd_ii_tl \l__spb_box_sub_wd_ii_tl }
\providecommand{\hbox_overlap_center:n}[1]
{ \hbox_to_zero:n { \hss #1\hss } }
-\cs_new:Npn \spb_boxa_move_up:n #1
- { \box_move_up:nn {#1} { \box_use:N \l_tmpa_box } }
-\cs_new:Npn \spb_boxa_move_down:n #1
- { \box_move_down:nn {#1} { \box_use:N \l_tmpa_box } }
-\cs_new:Npn \spb_boxb_move_down:n #1
- { \box_move_down:nn {#1} { \box_use:N \l_tmpb_box } }
-\cs_new:Npn \spb_boxa_vmove:nn #1
+\cs_new:Npn \spb_box_super_move_i_up:n #1
+ { \box_move_up:nn {#1} { \box_use:N \l__super_i_box } }
+\cs_new:Npn \spb_box_sub_move_i_down:n #1
+ { \box_move_down:nn {#1} { \box_use:N \l__sub_i_box } }
+\cs_new:Npn \spb_box_super_move_ii_up:n #1
+ { \box_move_up:nn {#1} { \box_use:N \l__super_ii_box } }
+\cs_new:Npn \spb_box_sub_move_ii_down:n #1
+ { \box_move_down:nn {#1} { \box_use:N \l__sub_ii_box } }
+\cs_new:Npn \spb_box_vmove:nn #1
{
\str_case:nn {#1}
{
- { super } { \spb_boxa_move_up:n }
- { sub } { \spb_boxa_move_down:n }
+ { super } { \spb_box_super_move_i_up:n }
+ { sub } { \spb_box_sub_move_i_down:n }
}
}
-\cs_generate_variant:Nn \spb_boxa_move_up:n { V }
-\cs_generate_variant:Nn \spb_boxb_move_down:n { V }
+\cs_generate_variant:Nn \spb_box_super_move_ii_up:n { V }
+\cs_generate_variant:Nn \spb_box_sub_move_ii_down:n { V }
\dim_new:N \l__spb_supersub_half_vsep_tl
\cs_new:Npn \spb_hbox_overlap_vmove:n #1
{
\tl_set:Nn \l__spb_supersub_half_vsep_tl
{ \l__spb_supersub_vsep_tl/2 }
\use:c { hbox_overlap_#1:n }
- { \spb_boxa_move_up:V \l__spb_supersub_half_vsep_tl }
+ { \spb_box_super_move_ii_up:V \l__spb_supersub_half_vsep_tl }
\use:c { hbox_overlap_#1:n }
- { \spb_boxb_move_down:V \l__spb_supersub_half_vsep_tl }
- }
-\cs_new_protected:Npn \spb_box_ht_dp_assign:nn #1#2
- {
- \tl_if_empty:nF {#1} { \box_set_ht:Nn \l_tmpa_box {#1} }
- \tl_if_novalue:nF {#2} { \box_set_dp:Nn \l_tmpa_box {#2} }
+ { \spb_box_sub_move_ii_down:V \l__spb_supersub_half_vsep_tl }
}
\NewDocumentCommand{\spb@both@cmd@assign}
{t+>{\SplitArgument{1}{,}}m}
@@ -243,45 +266,45 @@
\tl_put_right:Nn \l__spb_super_cmd_ii_tl {#1}
\tl_if_novalue:nF {#2} { \tl_put_right:Nn \l__spb_sub_cmd_ii_tl {#2} }
}
-\cs_new_protected:Npn \spb_global_value_init:n #1
+\cs_new_protected:Npn \spb_ht_dp_assign:nnn #1#2#3
{
- \tl_gset:Nn \g__spb_hmove_init_tl {#1}
- \tl_gset:Nn \g__spb_vmove_init_tl {#1}
- \tl_gset:Nn \g__spb_cmd_init_tl {#1}
+ \tl_if_empty:cF { l__#1_height_#3_tl }
+ { \box_set_ht:cv { l__#1_#3_box } { l__#1_height_#3_tl } }
+ \tl_if_empty:cF { l__#1_depth_i_tl }
+ { \box_set_dp:cv { l__#2_#3_box } { l__#2_depth_#3_tl } }
}
\cs_new_protected:Npn \spb_both_newcmd_map:n #1
{
- \exp_args:Nc \NewDocumentCommand {#1}
- {O{}>{\SplitArgument{1}{,}}O{}mO{}}
+ \exp_args:Nc \NewDocumentCommand {#1}{O{}mO{}}
{
\group_begin:
- \spb_global_value_init:n {#1}
- \keys_set:nn { ctex/style } {##1,##4}
- \spb_mode_switch:nnn {#1} {##3} { i }
+ \tl_gset:Nn \g__spb_mark_case_init_tl {#1}
+ \keys_set:nn { ctex/style } {##1,##3}
+ \spb_mode_switch:nnn {#1} {##2} { i }
\spb_content_hbox_set:n {#1}
- \spb_box_ht_dp_assign:nn ##2
- \box_use:N \l_tmpa_box
+ \spb_ht_dp_assign:nnn {#1} {#1} { i }
+ \box_use:c { l__#1_i_box }
\group_end:
}
}
\cs_new_protected:Npn \spb_content_hbox_set:n #1
{
- \hbox_set:Nn \l_tmpa_box
+ \hbox_set:cn { l__#1_i_box }
{
\dim_compare:nNnTF { \tl_use:c { l__spb_#1_hmove_tl } } < { 0pt }
{
\hbox_overlap_left:n
{
\hbox_overlap_right:n
- { \spb_boxa_vmove:nn {#1} { \tl_use:c { l__spb_#1_vmove_tl } } }
+ { \spb_box_vmove:nn {#1} { \tl_use:c { l__spb_#1_vmove_tl } } }
\skip_horizontal:n { -\tl_use:c { l__spb_#1_hmove_tl } }
}
}
{
\hbox_to_wd:nn
- { \l__spb_boxa_wd_tl + \tl_use:c { l__spb_#1_hmove_tl } }
- { \hss\spb_boxa_vmove:nn {#1} { \tl_use:c { l__spb_#1_vmove_tl } } }
+ { \tl_use:c { l__spb_box_#1_wd_i_tl } + \tl_use:c { l__spb_#1_hmove_tl } }
+ { \hss\spb_box_vmove:nn {#1} { \tl_use:c { l__spb_#1_vmove_tl } } }
}
}
}
@@ -292,9 +315,10 @@
\NewDocumentCommand{\supersub}{O{}mmO{}}
{
\group_begin:
- \spb_global_value_init:n { supersub }
+ \tl_gset:Nn \g__spb_mark_case_init_tl { supersub }
\keys_set:nn { ctex/style } {#1,#4}
\spb_mode_switch:nnn {#2} {#3} { ii }
+ \spb_ht_dp_assign:nnn { super } { sub } { ii }
\str_case:VnF \l__spb_supersub_halign_tl
{
{ l } { \use_i:nnn }
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index faa5c1a44c..08ed9bc04f 100644
--- a/macros/latex/contrib/spbmark/spbmark.tex
+++ b/macros/latex/contrib/spbmark/spbmark.tex
@@ -6,8 +6,8 @@
{
package = spbmark,
title = the spbmark package,
- version = v1.2H,
- date = 2021/12/22,
+ version = v1.3,
+ date = 2022/01/23,
authors = Qu Yi,
info = Customize superscript and subscript,
email = q1jx@foxmail.com,
@@ -61,9 +61,9 @@ The following macro package options will redefine the scripts commands of the \L
\section{User commands}
There are currently three commands to set superscript and subscript. Their format can be set temporarily using the optional parameters of the command, or set globally using a key-value list, see section \ref{sec:global control interface}.
\begin{commands}
- \command{super}[\oarg{kv list}\splitoarg{height}{depth}\marg{content}\oarg{kv list}]
+ \command{super}[\oarg{kv list}\marg{content}\oarg{kv list}]
This is a superscript output command. The two \meta{kv list} are equivalent.
- \command{sub}[\oarg{kv list}\splitoarg{height}{depth}\marg{content}\oarg{kv list}]
+ \command{sub}[\oarg{kv list}\marg{content}\oarg{kv list}]
This is a subscript output command. The two \meta{kv list} are equivalent.
\command{supersub}[\oarg{kv list}\marg{super cont}\marg{sub cont}\oarg{kv list}]
This is a command that outputs both superscript and subscript at the same time. You can also use the shorter command \cs{spb} instead of it. The two \meta{kv list} are equivalent.
@@ -73,9 +73,7 @@ There are currently three commands to set superscript and subscript. Their forma
In some cases, \code{math} or \code{text} output modes require different code for format or move. This command can be used when using the \code{match} option or changing the output mode locally, whitch should be used in the move or format options. It can switch the corresponding code according to different output modes.
\end{commands}
-The optional parameter \splitmeta{height}{depth} generally does not need to be used. The \meta{height} and \meta{depth} are separated by commas. Only the front part indicates the \meta{height} of the superscript or subscript, and only the back part indicates the \meta{depth}.
-
-The options common to \meta{kv list} of the three commands are as follows. They can be used in \meta{key-value list} for the \cs{spbset} command. If \option{vmove}, \option{hmove} and \option{cmd} are used in the \cs{spbset} command, it is set according to the type of the previous nearest command.
+The options common to \meta{kv list} of the three commands are as follows. They can be used in \meta{key-value list} for the \cs{spbset} command. When the following options are used in the \cs{spbset} command, in addition to \option{style} and \option{mode}, they are set according to the type of the previous most recent command.
\begin{options}
\keyval{vmove}{fixed length}\Default{0pt}
Vertical move of superscript or subscript. Represents the extra vertical distance \option{vsep} between superscript and subscript in the superscript and subscript commands.
@@ -85,6 +83,10 @@ The options common to \meta{kv list} of the three commands are as follows. They
The format commands of superscript or subscript. The last command can take a parameter, which accepts superscript or subscript. Represents the format of superscript and subscript in the superscript and subscript commands.
\keyval{cmd+}{format cmds}\Default
Add code to the previous global superscript or subscript format commands.
+ \keyval{height}{fixed length}\Default
+ The distance between the superscript or subscript baseline and the previous line.
+ \keyval{depth}{fixed length}\Default
+ The distance between the superscript or subscript baseline and the next line.
\keyval{style}{style name}\Default
Use the \meta{style name} defined by the \cs{defspbstyle} command to make it work global or local.
\keychoice{mode}{text,math,match}\Default{match}
@@ -120,6 +122,14 @@ The following list of keys control the format both of superscript or subscript.
The format commands of subscript. The last command in the code can take an argument, which is a subscript.
\keyval{sbcmd+}{format cmds}\Default
Add code to the previous global subcript format commands.
+ \keyval{spheight}{fixed length}\Default
+ The distance between the superscript baseline and the previous line.
+ \keyval{spdepth}{fixed length}\Default
+ The distance between the superscript baseline and the next line.
+ \keyval{sbheight}{fixed length}\Default
+ The distance between the subscript baseline and the previous line.
+ \keyval{sbdepth}{fixed length}\Default
+ The distance between the subscript baseline and the next line.
\end{options}
If \option{sphmove} is positive, the superscript or subscript moves to the right, conversely it moves to the left. However, for superscript, if \option{spvmove} is positive, the superscript moves up, conversely it moves down. For subscript, if \option{spvmove} is positive, the subscript moves down, conversely it moves up.
@@ -132,6 +142,10 @@ The following list of keys control the format of superscript and subscript.
The format commands of superscript and subscript. The first part is in superscript format, and the latter part is in subscript format. They are separated by commas, or only the first part exists.
\kvsplit{spbcmd+}{super cmds}{sub cmds}\Default
Add code to the previous global superscript and subscript format commands.
+ \keyval{spbheight}{fixed length}\Default
+ The distance between the superscript baseline and the previous line.
+ \keyval{spbdepth}{fixed length}\Default
+ The distance between the subscript baseline and the next line.
\keyval{vsep}{fixed length}\Default{0.6ex}
The extra vertical distance between superscript and subscript.
\keychoice{halign}{l,c,r}\Default{l}