From f4d05c7d6b687c6730e84b104235e648ca4b3ecd Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 5 Dec 2023 03:01:12 +0000 Subject: CTAN sync 202312050301 --- macros/generic/ltxcmds/README.md | 4 +- macros/generic/ltxcmds/ltxcmds.dtx | 25 +- macros/generic/ltxcmds/ltxcmds.pdf | Bin 397106 -> 419825 bytes macros/latex/contrib/fbox/CHANGELOG | 1 + macros/latex/contrib/fbox/doc/fbox.pdf | Bin 46291 -> 48539 bytes macros/latex/contrib/fbox/doc/fbox.tex | 15 +- macros/latex/contrib/fbox/latex/fbox.sty | 18 +- macros/latex/contrib/heria/README.md | 38 + macros/latex/contrib/heria/heria-proposal.pdf | Bin 0 -> 313877 bytes macros/latex/contrib/heria/heria.dtx | 2783 ++++++++++++++++++++ macros/latex/contrib/heria/heria.ins | 92 + macros/latex/contrib/heria/heria.pdf | Bin 0 -> 303966 bytes .../latex/contrib/nicematrix/nicematrix-code.dtx | 1496 ++++++----- .../latex/contrib/nicematrix/nicematrix-code.pdf | Bin 968279 -> 972770 bytes .../latex/contrib/nicematrix/nicematrix-french.pdf | Bin 600879 -> 598788 bytes .../latex/contrib/nicematrix/nicematrix-french.tex | 13 +- macros/latex/contrib/nicematrix/nicematrix.pdf | Bin 617157 -> 614351 bytes macros/latex/contrib/nicematrix/nicematrix.tex | 152 +- 18 files changed, 3865 insertions(+), 772 deletions(-) create mode 100644 macros/latex/contrib/heria/README.md create mode 100644 macros/latex/contrib/heria/heria-proposal.pdf create mode 100644 macros/latex/contrib/heria/heria.dtx create mode 100644 macros/latex/contrib/heria/heria.ins create mode 100644 macros/latex/contrib/heria/heria.pdf (limited to 'macros') diff --git a/macros/generic/ltxcmds/README.md b/macros/generic/ltxcmds/README.md index 2aef65aa3a..e9a4b0dc3d 100644 --- a/macros/generic/ltxcmds/README.md +++ b/macros/generic/ltxcmds/README.md @@ -1,6 +1,6 @@ # ltxcmds package for latex -Version: 2020-05-10 v1.25 +Version: 2023-12-04 v1.26 The package ltxcmds exports some utility macros from the LaTeX kernel into a separate namespace and @@ -8,7 +8,7 @@ also provides them for other formats such as plain-TeX. ## Copyright (C) * 2007, 2009-2011 Heiko Oberdiek -* 2016-2020 Oberdiek Package Support Group +* 2016-2023 Oberdiek Package Support Group ## License LATEX Project Public License, version 1.3c or later. diff --git a/macros/generic/ltxcmds/ltxcmds.dtx b/macros/generic/ltxcmds/ltxcmds.dtx index 9940671d4d..7970f6a011 100644 --- a/macros/generic/ltxcmds/ltxcmds.dtx +++ b/macros/generic/ltxcmds/ltxcmds.dtx @@ -1,12 +1,12 @@ % \iffalse meta-comment % % File: ltxcmds.dtx -% Version: 2020-05-10 v1.25 +% Version: 2023-12-04 v1.26 % Info: LaTeX kernel commands for general use % % Copyright (C) % 2009-2011 Heiko Oberdiek -% 2016-2020 Oberdiek Package Support Group +% 2016-2023 Oberdiek Package Support Group % https://github.com/ho-tex/ltxcmds/issues % % This work may be distributed and/or modified under the @@ -86,7 +86,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)} +\Msg{* Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO)} \Msg{************************************************************************} \keepsilent @@ -98,11 +98,11 @@ This is a generated file. Project: ltxcmds -Version: 2020-05-10 v1.25 +Version: 2023-12-04 v1.26 Copyright (C) 2009-2011 Heiko Oberdiek - 2016-2020 Oberdiek Package Support Group + 2016-2023 Oberdiek Package Support Group This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -166,7 +166,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{ltxcmds.drv}% - [2020-05-10 v1.25 LaTeX kernel commands for general use (HO)]% + [2023-12-04 v1.26 LaTeX kernel commands for general use (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2011/11/22] \usepackage{zref-savepos} @@ -183,7 +183,7 @@ and the derived files % \GetFileInfo{ltxcmds.drv} % % \title{The \xpackage{ltxcmds} package} -% \date{2020-05-10 v1.25} +% \date{2023-12-04 v1.26} % \author{Heiko Oberdiek\thanks % {Please report any issues at \url{https://github.com/ho-tex/ltxcmds/issues}}} % @@ -334,7 +334,7 @@ and the derived files % \end{declcs} % % Macros with uppercase letters are expandable in two expansion steps. -% Changes in version 2020-05-10 v1.25: +% Changes in version 2023-12-04 v1.26: % \begin{itemize} % \item % Macros \cs{ltx@carsecond}, \cs{ltx@carthird}, \cs{ltx@carfourth}, @@ -701,7 +701,7 @@ and the derived files \fi \expandafter\x\csname ver@ltxcmds.sty\endcsname \ProvidesPackage{ltxcmds}% - [2020-05-10 v1.25 LaTeX kernel commands for general use (HO)]% + [2023-12-04 v1.26 LaTeX kernel commands for general use (HO)]% % \end{macrocode} % % \begin{macrocode} @@ -1497,9 +1497,9 @@ and the derived files \def\ltx@ifl@t@r#1#2{% \ifnum\expandafter\ltx@parse@version@#1//00\@nil<% \expandafter\ltx@parse@version@#2//00\@nil - \expandafter\@secondoftwo + \expandafter\ltx@secondoftwo \else - \expandafter\@firstoftwo + \expandafter\ltx@firstoftwo \fi} \def\ltx@parse@version@#1{\ltx@parse@version0#1} \def\ltx@parse@version#1/#2/#3#4#5\@nil{% @@ -2348,6 +2348,9 @@ $ \next % LaTeX kernel. \cs{pdfmatch} is no longer used with pdftex, and the tests for dates before % 1994 have been removed % \end{Version} +% \begin{Version}{2023-12-04 v1.26} +% \item corrected \cs{ltx@ifl@t@r} for plain. +% \end{Version} % \end{History} % % \PrintIndex diff --git a/macros/generic/ltxcmds/ltxcmds.pdf b/macros/generic/ltxcmds/ltxcmds.pdf index 1dfb9104f3..ab59f45da8 100644 Binary files a/macros/generic/ltxcmds/ltxcmds.pdf and b/macros/generic/ltxcmds/ltxcmds.pdf differ diff --git a/macros/latex/contrib/fbox/CHANGELOG b/macros/latex/contrib/fbox/CHANGELOG index d8eb3919fb..6a2c75bf4c 100644 --- a/macros/latex/contrib/fbox/CHANGELOG +++ b/macros/latex/contrib/fbox/CHANGELOG @@ -1,3 +1,4 @@ +0.07 2023-12-04 - added optional argument linewidth for \fparbox 0.06 2022-02-20 - added individual color option 0.05 2020-06-22 - added optional arguments boxrule and boxsep 0.04 2020-01-03 - added \fparbox[]{} diff --git a/macros/latex/contrib/fbox/doc/fbox.pdf b/macros/latex/contrib/fbox/doc/fbox.pdf index e4176b5bad..6c0d9eaf9a 100644 Binary files a/macros/latex/contrib/fbox/doc/fbox.pdf and b/macros/latex/contrib/fbox/doc/fbox.pdf differ diff --git a/macros/latex/contrib/fbox/doc/fbox.tex b/macros/latex/contrib/fbox/doc/fbox.tex index fad6aa5004..27bf1aa7ad 100644 --- a/macros/latex/contrib/fbox/doc/fbox.tex +++ b/macros/latex/contrib/fbox/doc/fbox.tex @@ -1,5 +1,4 @@ -%% $Id: fbox.tex 449 2022-02-20 20:50:12Z herbert $ -% +%% $Id: fbox.tex 828 2023-12-04 19:56:29Z herbert $% \listfiles\setcounter{errorcontextlines}{100} \documentclass[paper=a4,fontsize=11pt,DIV=13,parskip=half-, captions=tableabove,twoside=on]{scrartcl} @@ -62,7 +61,7 @@ Equipped with the talking points above, you’re ready to help anyone search and \def\setVersion#1{\setVVersion#1!!} \def\setVVersion#1=#2!!{\def\fboxVersion{#2}} -\setVersion{version = 0.06}% +\setVersion{version = 0.07}% \title{Package \texttt{fbox} \\--\\ \normalsize \fboxVersion\ (\today)} \author{Herbert Voß\thanks{\url{hvoss@tug.org}\newline Thanks to Rolf Niepraschk}} @@ -99,6 +98,7 @@ The optional argument can be \item[tcolor] Color for the top line (black) \item[rcolor] Color for the right line (black) \item[bcolor] Color for the bottom line (black) +\item[linewidth] linewidth for \Lcs{fparbox} (\Ldim{linewidth}) \item[] Any combination of the letters l, r, b, and t, or altenatively L, R, B, and T for l)eft, r)right, b)ottom, and t)op of the frame parts. A missing or an empty argument is the same as the default @@ -236,10 +236,19 @@ of the frame parts. A missing or an empty argument is the same as the default \fparbox*[bT,boxrule=5pt,boxsep=6pt]{\demoText} \end{LTXexample} +\begin{LTXexample} +\fparbox*[bT,boxrule=5pt,boxsep=6pt, + linewidth=0.75\linewidth]{\demoText} +\end{LTXexample} + \begin{LTXexample} \fparbox*[bT,boxrule=3pt,boxsep=10pt]{\demoText} \end{LTXexample} +\begin{LTXexample} +\fparbox*[bT,boxrule=3pt,boxsep=10pt, + linewidth=7cm]{\demoText} +\end{LTXexample} \begin{LTXexample} \fparbox[Br,boxrule=5pt,boxsep=10pt]{\demoText} diff --git a/macros/latex/contrib/fbox/latex/fbox.sty b/macros/latex/contrib/fbox/latex/fbox.sty index b12207a78d..0fa7d36ad2 100644 --- a/macros/latex/contrib/fbox/latex/fbox.sty +++ b/macros/latex/contrib/fbox/latex/fbox.sty @@ -1,6 +1,6 @@ %% This is file `fbox.sty' %% -%% Copyright (C) 2019, 2022 +%% Copyright (C) 2019, ..., 2023 %% Herbert Voss %% %% It may be distributed and/or modified under the @@ -11,23 +11,27 @@ %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. % -% $Id: fbox.sty 449 2022-02-20 20:50:12Z herbert $ +% $Id: fbox.sty 828 2023-12-04 19:56:29Z herbert $ % % ------------------------------------- -\ProvidesPackage{fbox}[2022/02/20 v. 0.06 allow parts of the frame (hv)] +\ProvidesPackage{fbox}[2023/12/04 v. 0.07 allow parts of the frame (hv)] % \RequirePackage{xkeyval} \RequirePackage{xcolor} \newlength\fbox@@rule \newlength\fbox@@sep +\newlength\fbox@@linewidth \define@key{fbox}{boxrule}[0.4pt]{\setlength\fbox@@rule{#1}} \define@key{fbox}{boxsep}[3pt]{\setlength\fbox@@sep{#1}} \define@key{fbox}{bcolor}[black]{\def\fbox@bcolor{#1}} \define@key{fbox}{tcolor}[black]{\def\fbox@tcolor{#1}} \define@key{fbox}{lcolor}[black]{\def\fbox@lcolor{#1}} \define@key{fbox}{rcolor}[black]{\def\fbox@rcolor{#1}} -\setkeys*{fbox}{boxrule=\fboxrule,boxsep=\fboxsep,lcolor,rcolor,bcolor,tcolor} +\define@key{fbox}{linewidth}[\linewidth]{\setlength\fbox@@linewidth{#1}} +\setkeys*{fbox}{boxrule=\fboxrule,boxsep=\fboxsep, + lcolor,rcolor,bcolor,tcolor, + linewidth=\linewidth} % latex.ltx %\fboxsep = 3pt @@ -122,10 +126,12 @@ \long\def\fparbox{\@ifnextchar*{\@fbox@startrue\FParBox@}{\@fbox@starfalse\FParBox@*}} \def\FParBox@*{\@ifnextchar[\FParBox@i\FParBox@ii} \long\def\FParBox@i[#1]#2{% - \savebox\fpar@b@x{\parbox{\dimexpr\linewidth-2\fbox@@sep-2\fbox@@rule}{#2}}% + \setkeys*{fbox}{linewidth=\linewidth,#1}% + \savebox\fpar@b@x{\parbox{\dimexpr\fbox@@linewidth-2\fbox@@sep-2\fbox@@rule}{#2}}% \FBox@i[#1]{\usebox\fpar@b@x}} \long\def\FParBox@ii#1{% - \savebox\fpar@b@x{\parbox{\dimexpr\linewidth-2\fbox@@sep-2\fbox@@rule}{#1}}% + \setkeys*{fbox}{linewidth=\linewidth}% + \savebox\fpar@b@x{\parbox{\dimexpr\fbox@@linewidth-2\fbox@@sep-2\fbox@@rule}{#1}}% \orig@fbox{\usebox\fpar@b@x}} diff --git a/macros/latex/contrib/heria/README.md b/macros/latex/contrib/heria/README.md new file mode 100644 index 0000000000..b3d5cf32b1 --- /dev/null +++ b/macros/latex/contrib/heria/README.md @@ -0,0 +1,38 @@ +# heria: A LaTeX class for Horizon Europe RIA and IA grant proposals + +## Overview + +The `heria` class facilitates the preparation of Research and +Innovation Action (RIA) and Innovation Action (IA) funding proposals +for the European Commission's Horizon Europe program. The class is a +conversion of the official Part B template into LaTeX; it preserves +the formatting and most of the instructions of the original version, +and has the additional feature that tables (listing the participants, +work packages, deliverables, etc.) are programmatically generated +according to data supplied by the user. + +## Building and installing + +To build the class, run the file `heria.ins` through `latex` or +`pdflatex` and then copy the resulting `.cls` and `.tex` files into a +directory searched by LaTeX. + +To generate the documentation, run the file `heria.dtx` through +`pdflatex`. + +To generate the skeleton proposal, build the class and then run the +file `heria-proposal.tex` through `pdflatex`. + +## Source repository and bug tracker + +For now, the source code is hosted on GitHub at +[https://github.com/logological/heria](https://github.com/logological/heria). +There you will also find an issue tracker for reporting bugs and +feature requests. + +## Licence + +The `heria` class is distributed under the conditions of the [LaTeX +Project Public License](https://www.latex-project.org/lppl.txt), +either version 1.3 of this license or (at your option) any later +version. diff --git a/macros/latex/contrib/heria/heria-proposal.pdf b/macros/latex/contrib/heria/heria-proposal.pdf new file mode 100644 index 0000000000..f8d64312a9 Binary files /dev/null and b/macros/latex/contrib/heria/heria-proposal.pdf differ diff --git a/macros/latex/contrib/heria/heria.dtx b/macros/latex/contrib/heria/heria.dtx new file mode 100644 index 0000000000..5c6b5e9691 --- /dev/null +++ b/macros/latex/contrib/heria/heria.dtx @@ -0,0 +1,2783 @@ +% \iffalse meta-comment +% +% Copyright 2023 Tristan Miller +% ----------------------------- +% +% 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 +% https://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2008 or later. +% +% \fi +% +% \iffalse +%<*driver> +\ProvidesFile{heria.dtx} +% +%<*class> +%% Copyright 2023 Tristan Miller +%% Copyright 2016 John Kormylo +%% +%% 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 +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesClass{heria} +%<*class> +[2023-12-04 v3.2.1.0 Class for Horizon Europe (R)IA proposals] +% +% +%<*driver> +\documentclass{ltxdoc} +\DisableCrossrefs +\CodelineIndex +\RecordChanges +\addtolength\marginparwidth{5ex} +\addtolength\oddsidemargin{6ex} +\addtolength\evensidemargin{6ex} +\begin{document} +\DocInput{heria.dtx} +\end{document} +% +% \fi +% +% \CheckSum{1506} +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% +% \GetFileInfo{heria.dtx} +% +% \DoNotIndex{\newcommand,\newenvironment} +% +% +% \title{\textsf{heria}: A \LaTeX\ class for\\ Horizon Europe RIA and +% IA grant proposals\thanks{This document corresponds to +% \textsf{heria}~\fileversion, dated \filedate. See §\ref{sec:version} +% for an explanation of the versioning scheme.}} +% +% \author{Tristan Miller\\ +% Austrian Research Institute for Artificial Intelligence\\ +% \texttt{tristan.miller@ofai.at}} +% +% \maketitle +% \tableofcontents +% +% \section{Introduction}\label{sec:introduction} +% +% This document describes the usage of \textsf{heria}, a \LaTeX\ class +% that facilitates the preparation of Research and Innovation Action +% (RIA) and Innovation Action (IA) funding proposals for the European +% Commission's~(EC) Horizon Europe program. The Commission prescribes +% a detailed, structured format for the technical description +% (``Part~B'') of these proposals, but provides templates only in Rich +% Text Format (RTF), a format that does not lend itself well to +% collaborative authorship and \mbox{(cross-)}reference management. +% The \textsf{heria} class is a conversion of the official Part~B +% template into \LaTeX; it preserves the formatting and most of the +% instructions of the original version, and has the additional feature +% that tables (listing the participants, work packages, deliverables, +% etc.)\ are programmatically generated according to data supplied by +% the user. The advantage of this becomes clear when one considers +% that much of the data is reused across multiple tables. +% +% At the time of writing (2023-12-04), open calls to the RIA and IA +% calls require proposals to be submitted according to either +% Version~3.2 (2022-11-15) or Version~3.3 (2023-09-27) of the Part~B +% template. The \textsf{heria} package was developed with reference +% to the Version~3.2 template; however, according to the changelog for +% the Version~3.3 template, the only difference from the previous +% version is the addition of some instructions concerning the use of +% generative AI tools for the preparation of the proposal. +% +% \section{Usage} +% +% The EC's official template is structured in such a way that form and +% content cannot be entirely separated. The best way of starting a new +% proposal is therefore to make a copy of \texttt{heria-proposal.tex}, +% the skeleton proposal distributed with this package, and then adapt +% it to your project. The following subsections describe the various +% macros and environments provided by \textsf{heria}, roughly in the +% same order presented in the skeleton proposal. +% +% \subsection{Preamble} +% +% Your proposal document should begin with the following line if you +% want the template instructions to be included in the output: +% \begin{quote}\verb|\documentclass[showinstructions]{heria}|\end{quote} +% Otherwise you can omit the \verb|showinstructions| option: +% \begin{quote}\verb|\documentclass{heria}|\end{quote} +% +% The \verb|heria| class is based on the default \LaTeX\ +% \verb|article| class, and so all of the macros and environments from +% the latter are available for you to use. The class automatically +% sets the font, margins, etc.\ mandated by the official instructions, +% and redefines some of the \verb|article| macros as described later +% in this document. +% +% \medskip +% +% \noindent Following \cs{documentclass} you should provide the +% proposal metadata using the following macros: +% +% \DescribeMacro{\title} This macro takes the title of the proposal as +% its sole argument. This title will be printed by the \cs{maketitle} +% macro (see below) and used for the PDF metadata. +% +% \DescribeMacro{\callname} This macro takes as its sole argument the +% official natural-language description of the call to which the +% proposal is being submitted. It will be printed in the page header. +% +% \DescribeMacro{\callidentifier} This macro takes as its sole +% argument the identifier of the call to which the proposal is being +% submitted, which will be printed in the page header. Call +% identifiers normally have the format +% \texttt{HORIZON-XX0-0000-XXXXX-00-XXXXX}. +% +% \DescribeMacro{\calltopic} This macro takes as its sole argument the +% identifier of the specific topic within the call to which the +% proposal is being submitted. Such identifiers normally have the +% format \texttt{HORIZON-XX0-0000-XXXXX-00-00}. The official template +% does not require proposals to mention the call topic, so you are +% free to omit the \cs{calltopic} macro. If you do use it, it will be +% printed by \cs{maketitle} below the proposal title. +% +% \subsection{Title} +% +% \DescribeMacro{\maketitle} This is generally the first macro that +% should be called in the main body of the document. As with the +% standard \verb|article| class, it typesets the title. +% +% \subsection{Section headings, tags, and instructions} +% +% \DescribeMacro{\heinstructions} When the \verb|showinstructions| +% options is passed to the document class, the \cs{heinstructions} +% macro prints instructions from the official EC template. These +% instructions are contained in files distributed with the +% \textsf{heria} class; the macro's sole argument is used to construct +% the name of one of these files. To suppress printing of individual +% instructions, you can simply remove or comment out the corresponding +% \cs{heinstructions} macro. +% +% \DescribeMacro{\opentag}\DescribeMacro{\closetag} The official +% template includes a number of ``tags'' that are used for the EC's +% ``internal processing of information, mostly for statistical +% gathering.'' The \cs{opentag} and \cs{closetag} macros are used to +% emit the tags at the appropriate places in the proposal, and so +% should be left in their original positions in the skeleton template. +% The EC asks that proposal authors ``not move, delete, re-order, or +% alter tags in any way''. +% +% \DescribeMacro{\section}\DescribeMacro{\subsection}\DescribeMacro{\subsubsection} +% These three macros take a mandatory argument specifying the title of +% the corresponding section, subsection, or subsubsection, +% respectively. These document subdivisions are fixed by the official +% template and so generally should not be renamed or reordered, though +% it is probably safe to add additional ones where it does not disrupt +% the numbering of the existing ones. Many sections and subsections +% \emph{must} be preceded or followed by certain tags, which are +% specified in the first and second optional arguments, respectively. +% The third optional argument contains the recommended page limit, +% when specified by the official template. The page limit will be +% printed only when the \verb|showinstructions| option is passed to +% the document class. +% +% \subsection{Participants} +% +% \DescribeMacro{\participant} Participants should be listed in the +% same order as in Part~A of the proposal, which is completed using an +% online form. Use one invocation of \cs{participant} for each +% participant, with the following three mandatory arguments, in order: +% the participant's full name, the participant's short name, and the +% participant's two-letter country code. The first participant will +% be marked in the participant table as the project coordinator. Note +% that while the short name is typeset in the proposal, it is also +% used internally by the \verb|heria| class as part of a \LaTeX\ +% counter name, and so should generally consist only of ASCII letters. +% +% \DescribeMacro{\makeparticipantstable} This macro emits the table of +% participants using the data from the \cs{participant} macro. +% Participants are automatically numbered according to the order of +% the \cs{participant} macros. +% +% \subsection{Summary tableau} +% +% \DescribeEnv{summarycanvas} \DescribeEnv{summarybox} Proposals must +% include a summary tableau of six boxes that briefly describe the +% project's specific needs; expected results; dissemination, +% exploitation, and communication measures; target groups; outcomes; +% and impacts. The \verb|summarycanvas| and \verb|summaryenv| +% environments are provided for this purpose. Each \verb|summarybox| +% environment typesets a shaded box headed by its mandatory argument. +% Three such boxes can be grouped side by side into a single +% \verb|summarycanvas| environment. The skeleton proposal +% demonstrates how all six boxes can be placed in a floating figure on +% a single landscape page, though other arrangements seem to be +% permissible. +% +% \subsection{Work packages and deliverables} +% +% \DescribeMacro{\makeworkpackagestable} This macro emits the table of +% work packages, using the data from the \cs{workpackage} macros. Work +% packages are automatically numbered according to the order of the +% \cs{workpackage} macros. +% +% \DescribeMacro{\workpackage} This macro declares a work package, and +% takes five mandatory arguments: a unique identifier (used only +% internally by \verb|heria| for cross-referencing purposes), the work +% package title, the short name of the lead participant (as specified +% in the corresponding \cs{participant} macro), the numeric starting +% month (measured from the start of the project), and the numeric +% ending month. Since the unique identifier is used as part of a +% \LaTeX\ counter name, you should generally use only ASCII letters. +% Work packages are automatically numbered. You should use one +% \cs{workpackage} macro for each work package in your project. +% +% \DescribeEnv{objectives} This environment typesets a box containing +% an enumerated list of objectives for the most recently declared work +% package. Use the \cs{item} macro to begin each objective. +% +% \DescribeEnv{descriptionofwork} This environment typesets a box +% where you can describe the work program of the most recently +% declared work package. You can enter this information in free-form +% and\slash or use the \cs{task} macro to enumerate individual tasks. +% +% \DescribeMacro{\task} This macro typesets basic information about a +% work package task. The format used by this macro is not strictly +% mandated by the official template, but you may nonetheless find it +% useful. The macro takes three mandatory arguments: the task name, +% the short name of the lead participant (as specified in the +% corresponding \cs{participant} macro), a list of other participants +% (as free-form text, but advisedly using short names of participants +% where appropriate), and the starting and ending months for the task +% (as free-form text). You should use one \cs{task} macro for each +% task in your work package. You can, if you wish, follow each +% \cs{task} macro with a free-form description of the task. +% +% \DescribeMacro{\deliverable} This macro declares a deliverable for +% the most recently declared work package. There are six mandatory +% arguments: the deliverable name, a short description of the +% deliverable, the short name of the lead participant (as specified in +% the corresponding \cs{participant} macro), the deliverable type, the +% dissemination level, and the numeric delivery month (in months from +% the beginning of the project). The type and dissemination level +% arguments must be selected from the identifiers given in the +% template instructions. +% +% \DescribeMacro{\makedeliverablestable} This macro emits the table of +% deliverables, using the data from the \cs{deliverable} +% macros. Deliverables are automatically numbered according to the +% order of the \cs{deliverable} macros. +% +% \subsection{Milestones} +% +% \DescribeMacro{\milestone} This macro declares a project milestone. +% It takes four mandatory arguments: the milestone name, a free-form +% list of related work packages, the due date (in number of months +% from the start of the project), and a free-form means of +% verification. You should use one \cs{milestone} macro for each +% milestone in your project. +% +% \DescribeMacro{\makemilestonestable} This macro emits the table of +% milestones, using the data from the \cs{milestone} +% macros. Milestones are automatically numbered according to the order +% of the \cs{milestone} macros. +% +% \subsection{Critical risks} +% +% \DescribeMacro{\criticalrisk} This macro declares a critical risk +% for the project. It takes five mandatory arguments: a free-form +% description of the risk, the likelihood of the risk, the severity of +% the risk, and a free-form description of proposed mitigation +% measures. The likelihood and severity arguments must be selected +% from the identifiers given in the template instructions. You should +% use one \cs{criticalrisk} macro for each critical risk in your +% project. +% +% \DescribeMacro{\makecriticalriskstable} This macro emits the table +% of critical risks, using the data from the \cs{criticalrisk} +% macros. Critical risks are output in the order of the +% \cs{criticalrisk} macros. +% +% \subsection{Summary of staff effort} +% +% \DescribeMacro{\staffeffort} This macro declares the number of +% person-months a given project participant will spend on a given work +% package. It takes three mandatory arguments: the short name of the +% participant (as specified in the corresponding \cs{participant} +% macro), the short name of the work package (as specified in the +% corresponding \cs{workpackage} macro), and the number of months. +% You must provide one and only one \cs{staffeffort} macro for every +% possible combination of participant and work package in your project. +% +% \DescribeMacro{\makestaffefforttable} This macro emits the summary +% of staff effort table, using the data from the \cs{staffeffort} +% macros. The table rows and columns are automatically ordered +% according to the order of the \cs{participant} and \cs{workpackage} +% macros, respectively, and the total person-months per participant +% and total person-months per work package are automatically +% calculated. +% +% \subsection{Costs} +% +% \DescribeMacro{\subcontractingcost} This macro declares a +% subcontracting cost. It takes three mandatory arguments: the short +% name of a participant (as specified in the corresponding +% \cs{participant} macro), the amount of the subcontracting cost in +% euros, and a free-form description of the tasks and justification +% for the subcontracting cost. You should use one +% \cs{subcontractingcost} macro for each subcontracting cost in your +% project. +% +% \DescribeMacro{\makesubcontractingcoststable} This macro emits the +% tables of subcontracting costs, using the data from the +% \cs{subcontractingcost} macros. Subcontracting costs are +% automatically grouped by participant and then output according to +% the order of the \cs{participant} and \cs{subcontractingcost} +% macros. +% +% \DescribeMacro{\purchasecost} This macro declares the purchase costs +% for a participant. It takes eight mandatory arguments: +% \begin{quote}\cs{purchasecost}\marg{participant}\verb|%|\\ +% \hspace*{5ex}\marg{goodscost}\marg{justification}\verb|%|\\ +% \hspace*{5ex}\marg{travelcost}\marg{justification}\verb|%|\\ +% \hspace*{5ex}\marg{equipmentcost}\marg{justification}\verb|%|\\ +% \hspace*{5ex}\marg{remainingcosts}\end{quote} +% Here \meta{participant} is the short name of a participant (as +% specified in the corresponding \cs{participant} macro); +% \meta{goodscost}, \meta{travelcost}, \meta{equipmentcost}, and +% \meta{remainingcost} are the amount of the ``other goods, works and +% services'', ``travel and subsistence'', ``equipment'', and +% ``remaining purchase costs'', respectively, in euros; and the +% \meta{justification} arguments are free-form justifications for the +% immediately preceding cost. (According to the official template, +% the remaining purchase costs do not require a justification.) You +% should use one \cs{purchasecost} macro for each participant with +% purchase costs in your project. +% +% \DescribeMacro{\makepurchasecoststable} This macro emits the tables +% of purchase costs, using the data from the \cs{purchasecost} macros. +% Purchase costs are output according to the order of the +% \cs{participant} macros, and then in reverse order of the largest +% costs, with the ``remaining purchase costs'' output last. +% +% \DescribeMacro{\othercost} This macro declares an ``other'' cost +% (i.e.,\ in the ``other costs'' category). It takes three mandatory +% arguments: the short name of a participant (as specified in the +% corresponding \cs{participant} macro), the amount of the ``other'' +% cost in euros, and a free-form justification for the cost. You +% should use one \cs{othercost} macro for each ``other'' cost in your +% project. +% +% \DescribeMacro{\makeothercoststable} This macro emits the tables of +% ``other'' costs, using the data from the \cs{othercost} macros. +% ``Other'' costs are automatically grouped by participant and then +% output according to the order of the \cs{participant} and +% \cs{othercost} macros. +% +% \DescribeMacro{\inkindcontribution} This macro declares an in-kind +% contribution. It takes five mandatory arguments: the short name of a +% participant (as specified in the corresponding \cs{participant} +% macro), the third party name, the category of the contribution +% (selected from \texttt{Seconded personnel}, \texttt{Travel and +% subsistence}, \texttt{Equipment}, \texttt{Other goods, works and +% services}, and \texttt{Internally invoiced goods and services}), the +% amount of the cost in euros, and a free-form justification for the +% in-kind contribution. You should use one \cs{inkindcontribution} +% macro for each in-kind contribution in your project. +% +% \DescribeMacro{\makeinkindcontributionstable} This macro emits the +% tables of in-kind contributions, using the data from the +% \cs{inkindcontribution} macros. In-kind contributions are +% automatically grouped by participant and then output according to +% the order of the \cs{participant} and \cs{inkindcontribution} +% macros. +% +% \section{Hints and tips} +% +% \paragraph{Part A.} Some proposal data---in particular, the list of +% participants and the costs---must be entered not just in Part~B of +% the proposal, but also in the online Part~A form. It is your +% responsibility to ensure that this data is consistent across the two +% parts of the proposal. +% +% \paragraph{File structure.} Rather than putting all the work package +% data into your main proposal document, you may find it convenient to +% put the \cs{workpackage} macro, the \verb|objectives| environment, +% the \verb|descriptionofwork| environment, and the \cs{deliverable} +% macros corresponding to a single work package into a dedicated file, +% which you can then include in your main proposal document with the +% \cs{input} macro. This will make it easier for you to shuffle the +% order of work packages as you write your proposal. (You may wish to +% split off other sections of the proposal into their own files, +% though the official template gives considerably less freedom to +% reorder them.) +% +% \paragraph{Vertical spacing.} The \textsf{heria} class applies the +% same vertical spacing as the \textsf{article} class; this is +% particularly generous around section headings. If you find yourself +% running up against the page limit, you may wish to add some +% \cs{vspace} commands, with a negative length as the argument, to +% tighten up the spaces before section headings, and perhaps also the +% tables. +% +% \section{Limitations and caveats} +% +% \paragraph{No backward compatibility.} This version of the +% \textsf{heria} class implements a specific version of the official +% Horizon Europe template as described in §\ref{sec:introduction}. It +% is intended that \textsf{heria}, over the course of its development, +% will track changes made to the official template. Since these +% changes may be incompatible with previous versions, you are advised +% to retain a copy of the version of \textsf{heria} you used to +% produce a proposal; this way you will still be able to build the +% proposal even if you later install a new version of \textsf{heria}. +% See §\ref{sec:version} for further information on \textsf{heria}'s +% versioning scheme and when to expect breaking changes. +% +% \paragraph{Table 3.1h.} The instructions in the official template +% are ambiguous about the construction of the tables for purchase +% costs. In particular, it's not clear whether each individual cost +% exceeding 15\% of the personnel costs must be listed in a separate +% row, or whether all costs in each category (``travel and +% subsistence'', ``equipment'', etc.)\ should be combined into a +% single row. The \textsf{heria} class takes the latter +% interpretation; this may or may not be the same interpretation +% adopted by the funding agency and its reviewers. +% +% \paragraph{Error handling.} The class currently does very little +% error checking on its input. Usually invalid input (e.g., mistyping +% the short name of a participant or work package in a macro argument, +% or neglecting to provide a macro necessary to generate a table) +% \emph{will} result in an error that prevents the document from +% compiling, though the diagnostic message emitted by \LaTeX\ may be +% somewhat cryptic. +% +% \paragraph{Coverage of instructions.} The class reproduces most, +% but not all, of the instructions from the official template. In +% particular, it omits all the instructions occurring before the title +% of the proposal, including three pages of introductory material and +% definitions. You should not rely solely on the instructions emitted +% by the class, which are provided only as a convenience; be sure to +% also read the instructions in the official template (and in the text +% of the call to which you are applying). +% +% \section{Package development} +% +% \subsection{Source repository and bug tracker} +% +% For now, the package's source code is hosted on GitHub at +% \url{https://github.com/logological/heria}. There you will also +% find an issue tracker for reporting bugs and feature requests. +% +% \subsection{Versioning scheme}\label{sec:version} +% +% Each release of the \textsf{heria} class carries a version number in +% the format \textit{omaj.\allowbreak omin.\allowbreak maj.\allowbreak +% min}. Here \textit{omaj.omin} is the version number of the official +% Horizon Europe RIA template that the class implements, and +% \textit{maj} and \textit{min} represent, respectively, major and +% minor revisions to the class (including any ancillary files, such as +% the skeleton proposal and documentation). A major revision is one +% that includes breaking changes or significant new features; minor +% revisions are for all other changes. You should generally assume +% that any change to \textit{omaj.omin} introduces breaking changes to +% the class interface and\slash or significant changes to the official +% proposal preparation instructions. +% +% \subsection{Version history} +% +% \begin{description} +% \item[v3.2.1.0 (2023-12-04)] Initial release. +% \end{description} +% +% \section{Disclaimer} +% +% The \textsf{heria} package is distributed in the hope that it will +% be useful, but WITHOUT ANY WARRANTY; without even the implied +% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +% PURPOSE. (See the \LaTeX\ Project Public License for further +% details.) In particular, users should understand that the +% \textsf{heria} proposal template is wholly unofficial, and its +% author(s) accept no responsibility for any omissions, errors, or +% discrepancies with respect to the requirements set forth in the +% official Horizon Europe templates and associated documentation. If +% you produce a proposal with this template, then you alone are +% responsible for ensuring that it matches all the official +% requirements before submitting it to the funding body. +% +% \appendix +% +% \section{Implementation} +% +% \StopEventually{} +% +% \subsection*{Basic setup} +% +% Import the \verb|article| class and set up some basic features +% (margins, hyperlinks, etc.) +% +%\iffalse +%<*class> +%\fi +% \begin{macrocode} +\LoadClass[11pt,a4paper]{article} +\RequirePackage[T1]{fontenc} % T1 font encoding +\RequirePackage[left=15mm, + top=15mm, + bottom=15mm, + right=15mm, + includehead, + includefoot, + headheight=10pt, + headsep=5mm, + footskip=18pt, + ]{geometry} +\RequirePackage[pdftex]{graphicx} % For graphics + +\RequirePackage[pdftex,pdfusetitle]{hyperref} % Hyperlinks +\hypersetup{% + colorlinks=true, + breaklinks=true, + urlcolor=black, + linkcolor=black, + citecolor=black, + pdfsubject={}, + pdfkeywords={}, +} + +\RequirePackage{xfp} % Floating point numbers + +% \end{macrocode} +% +% A helper function to display variables +% +% \begin{macrocode} +\newcommand{\disptoken}[1]{% + \csname#1\endcsname +} +% \end{macrocode} +% +% \subsection*{Tables and framed boxes} +% +% \begin{macrocode} +\RequirePackage{colortbl} % for shaded table rows +\RequirePackage{xltabular} % for breakable tables with var-width columns +\RequirePackage[table]{xcolor} % for colours and shaded table cells +\RequirePackage[breakable,raster]{tcolorbox} % for framed boxes +% \end{macrocode} +% +% \subsection*{Colours} +% +% \begin{macrocode} +\definecolor{taggrey}{HTML}{B5B5B5} +\definecolor{footergrey}{HTML}{D8D8D8} +\definecolor{tablegrey}{HTML}{F2F2F2} +\definecolor{summaryblue}{HTML}{00B0F0} +% \end{macrocode} +% +% \subsection*{Basic proposal variables} +% +% \begin{macrocode} +\newcommand{\callname}[1]{\gdef\@callname{#1}}% +\newcommand{\callidentifier}[1]{\gdef\@callidentifier{#1}}% +\newcommand{\calltopic}[1]{\gdef\@calltopic{#1}}% +% \end{macrocode} +% +% \subsection*{Participants} +% +% \begin{macrocode} +\newcounter{@pcount} % Participant counter +\newcommand{\participant}[3]{% + \stepcounter{@pcount}% + \newcounter{@p#2num}% + \setcounter{@p#2num}{\value{@pcount}}% + \expandafter\xdef\csname @pFullName\arabic{@p#2num}\endcsname{#1}% + \expandafter\xdef\csname @pShortName\arabic{@p#2num}\endcsname{#2}% + \expandafter\xdef\csname @pCountry\arabic{@p#2num}\endcsname{#3}% + \newcounter{@pSubcontractingCosts\arabic{@p#2num}}% + \newcounter{@pPurchaseCosts\arabic{@p#2num}}% + \newcounter{@pOtherCosts\arabic{@p#2num}}% + \newcounter{@pInkindContributions\arabic{@p#2num}}% +} +% \end{macrocode} +% +% Get participant number from short name +% +% \begin{macrocode} +\newcommand{\getPnum}[1]{% + \@ifundefined{c@@p#1num}{}{\arabic{@p#1num}}% +} +% \end{macrocode} +% +% Participants table row +% +% \begin{macrocode} +\newcommand{\ptablerow}[1]{% + \stepcounter{#1} + \the\value{#1} + \ifthenelse{\value{#1}=1}{ (Coordinator) &}{&}% + \disptoken{@pFullName\arabic{#1}} (\disptoken{@pShortName\arabic{#1}}) & + \disptoken{@pCountry\arabic{#1}} \\ + \hline% +} +% \end{macrocode} +% +% Participants table +% +% \begin{macrocode} +\newcommand{\makeparticipantstable}{% + \newcounter{@ptable} + \begin{center} + \begin{xltabular}{0.9\textwidth}{|l|X|l|} + \hline + \textbf{Participant No.} & + \textbf{Participant organisation name} & + \textbf{Country} \\ + \hline + \whiledo% + {\value{@ptable}<\numexpr\value{@pcount}-1}% + {\ptablerow{@ptable}}% + \ptablerow{@ptable} + \end{xltabular} + \end{center} +} +% \end{macrocode} +% +% \subsection*{Work packages} +% +% \begin{macrocode} +\RequirePackage{atveryend} +\newcounter{@wpcount} % Work package counter +\newcommand{\workpackage}[5]{% + \stepcounter{@wpcount}% + \newcounter{@wp\arabic{@wpcount}deliverable}% + \newcounter{@wp\arabic{@wpcount}task}% + \newcounter{@wp#1num}% + \setcounter{@wp#1num}{\value{@wpcount}}% + \expandafter\xdef\csname % + @wpPersonMonths\arabic{@wp#1num}\endcsname{0}% + \expandafter\xdef\csname @wpShortName\arabic{@wp#1num}\endcsname{#1}% + \expandafter\xdef\csname @wpTitle\arabic{@wp#1num}\endcsname{#2}% + \expandafter\xdef\csname % + @wpLeadParticipantShortName\arabic{@wp#1num}\endcsname{#3}% + \expandafter\xdef\csname @wpStartMonth\arabic{@wp#1num}\endcsname{#4}% + \expandafter\xdef\csname @wpEndMonth\arabic{@wp#1num}\endcsname{#5}% + \@bsphack + \protected@write\@auxout{}% + {\string\makeworkpackagestable@data{\arabic{@wp#1num} + & #2 & \getPnum{#3} & #3 & % + \@ifundefined{@wpTotalPersonMonths\arabic{@wp#1num}}% + {\textbf{??}}% + {\disptoken{@wpTotalPersonMonths\arabic{@wp#1num}}}% + & #4 & #5}}% + \@esphack + \ifthenelse{\arabic{@wp#1num}=1}{}{\bigskip} + \noindent\begin{tabularx}% + {1.0\linewidth}{|>{\columncolor{tablegrey}}l|X|} + \hline + \bfseries Work package number & \arabic{@wp#1num} \\ + \hline + \bfseries Work package title & #2 \\ + \hline + \end{tabularx} +} +\newcommand{\makeworkpackagestable@data}[1]{% + \g@addto@macro\makeworkpackagestable@body{#1 \\ \hline}% +} +\def\makeworkpackagestable@body{}% initialize +\AtBeginDocument{\global\let\makeworkpackagestable@body@startup% + \makeworkpackagestable@body} +\AtEndDocument{% + \global\let\makeworkpackagestable@body@end\@empty + \def\makeworkpackagestable@data#1% + {\g@addto@macro\makeworkpackagestable@body@end{#1 \\ \hline}}% +} +\AtVeryEndDocument{% + \ifx\makeworkpackagestable@body@startup% + \makeworkpackagestable@body@end\else + \@latex@warning{Rerun for \string\makeworkpackagestable}% + \fi +} +% \end{macrocode} +% +% Work packages table +% +% \begin{macrocode} +\RequirePackage{makecell} +\newcommand{\makeworkpackagestable}{% + \begin{center} + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{1.0\textwidth}{|c|X|c|c|c|c|c|} + \hline + \rowcolor{tablegrey}% + \thead{Work\\ package\\ No.} & + \thead{Work package title} & + \thead{Lead\\ participant\\ No.} & + \thead{Lead\\ participant\\ short name} & + \thead{Person-\\months} & + \thead{Start\\ month} & + \thead{End\\ month} \\ + \hline + \makeworkpackagestable@body + \end{xltabular} + \end{center} +} +% \end{macrocode} +% +% Get work package number from short name +% +% \begin{macrocode} +\newcommand{\getWPnum}[1]{% + \@ifundefined{c@@wp#1num}{}{\arabic{@wp#1num}}% +} +% \end{macrocode} +% +% Work package objectives +% +% \begin{macrocode} +\newenvironment{objectives}{% + \begin{tcolorbox}[colback=white, + parbox=false, + boxrule=0.75pt, + boxsep=0mm, + breakable + ]% + \textsf{\textbf{Objectives}~~~}% + \begin{enumerate*}[nolistsep,noitemsep,itemjoin={~---~},% + label=\textbf{O\arabic{@wpcount}.\arabic*}]% + }{% + \end{enumerate*}% + \end{tcolorbox}% + } +% \end{macrocode} +% +% Work package description +% +% \begin{macrocode} +\newenvironment{descriptionofwork}{% + \begin{tcolorbox}[colback=white, + parbox=false, + boxrule=0.75pt, + boxsep=0mm, + breakable + ]% + \textsf{\textbf{Description of work}~~~} + }{% + \end{tcolorbox}% + } +% \end{macrocode} +% +% Tasks +% +% \begin{macrocode} +\NewDocumentCommand{\task}{mmmm}{% + \stepcounter{@wp\arabic{@wpcount}task} + \par\medskip\noindent\textbf{Task % + \arabic{@wpcount}.\arabic{@wp\arabic{@wpcount}task}: #1} + \textit{(Lead: #2; Participants: #3; Month: #4)}\hspace{1em}% +} +% \end{macrocode} +% +% \subsection*{Deliverables} +% +% \begin{macrocode} +\newcounter{@dcount} % Deliverable counter +\newcommand{\deliverable}[6]{% + \stepcounter{@wp\arabic{@wpcount}deliverable}% + \stepcounter{@dcount}% + \expandafter\xdef\csname @dNumber\arabic{@dcount}\endcsname% + {\arabic{@wpcount}.\arabic{@wp\arabic{@wpcount}deliverable}}% + \expandafter\xdef\csname % + @dWorkPackage\arabic{@dcount}\endcsname{\arabic{@wpcount}}% + \expandafter\xdef\csname @dName\arabic{@dcount}\endcsname{#1}% + \expandafter\gdef\csname @dDescription\arabic{@dcount}\endcsname{#2}% + \expandafter\xdef\csname @dLead\arabic{@dcount}\endcsname{#3}% + \expandafter\xdef\csname @dType\arabic{@dcount}\endcsname{#4}% + \expandafter\xdef\csname % + @dDisseminationLevel\arabic{@dcount}\endcsname{#5}% + \expandafter\xdef\csname @dDeliveryDate\arabic{@dcount}\endcsname{#6}% +} +% \end{macrocode} +% +% Deliverables table row +% +% \begin{macrocode} +\newcommand{\dtablerow}[1]{% + \stepcounter{#1} + \disptoken{@dNumber\arabic{#1}} & + \disptoken{@dName\arabic{#1}} & + \disptoken{@dDescription\arabic{#1}} & + \disptoken{@dWorkPackage\arabic{#1}} & + \disptoken{@dLead\arabic{#1}} & + \disptoken{@dType\arabic{#1}} & + \disptoken{@dDisseminationLevel\arabic{#1}} & + \disptoken{@dDeliveryDate\arabic{#1}} \\ + \hline% +} +% \end{macrocode} +% +% Deliverables table +% +% \begin{macrocode} +\newcommand{\makedeliverablestable}{% + \newcounter{@dtable} + \begin{center} + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{1.0\textwidth}% + {|c|>{\raggedright\hsize=.667\hsize\linewidth=\hsize}X% + |>{\hsize=1.333\hsize\linewidth=\hsize}X|c|c|c|c|p{15mm}|} + \hline + \rowcolor{tablegrey}% + \thead{\#} & + \thead{Name} & + \thead{Short description} & + \thead{WP\\ \#} & + \thead{Lead\\ participant} & + \thead{Type} & + \thead{Dissem.\\ level} & + \thead{Delivery\\ month} \\ + \hline + \whiledo% + {\value{@dtable}<\numexpr\value{@dcount}-1}% + {\dtablerow{@dtable}}% + \dtablerow{@dtable} + \end{xltabular} + \end{center} +} +% \end{macrocode} +% +% \subsection*{Milestones} +% +% \begin{macrocode} +\newcounter{@mcount} % Milestone counter +\newcommand{\milestone}[4]{% + \stepcounter{@mcount}% + \expandafter\gdef\csname @mName\arabic{@mcount}\endcsname{#1}% + \expandafter\xdef\csname @mWorkPackages\arabic{@mcount}\endcsname{#2}% + \expandafter\xdef\csname @mDueDate\arabic{@mcount}\endcsname{#3}% + \expandafter\xdef\csname % + @mMeansOfVerification\arabic{@mcount}\endcsname{#4}% +} +% \end{macrocode} +% +% Milestones table row +% +% \begin{macrocode} +\newcommand{\mtablerow}[1]{% + \stepcounter{#1} + \arabic{#1} & + \disptoken{@mName\arabic{#1}} & + \disptoken{@mWorkPackages\arabic{#1}} & + \disptoken{@mDueDate\arabic{#1}} & + \disptoken{@mMeansOfVerification\arabic{#1}} \\ + \hline% +} +% \end{macrocode} +% +% Milestones table +% +% \begin{macrocode} +\newcommand{\makemilestonestable}{% + \newcounter{@mtable} + \begin{center} + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{1.0\textwidth}{|c|X|p{26mm}|c|p{26mm}|} + \hline + \rowcolor{tablegrey}% + \thead{\#} & + \thead{Milestone\\ name} & + \thead{Related\\ WP(s)} & + \thead{Month\\ due} & + \thead{Means of\\ verification} \\ + \hline + \whiledo% + {\value{@mtable}<\numexpr\value{@mcount}-1}% + {\mtablerow{@mtable}}% + \mtablerow{@mtable} + \end{xltabular} + \end{center} +} +% \end{macrocode} +% +% \subsection*{Critical risks} +% +% \begin{macrocode} +\newtcbox{\risktag}[1][black]{% + fontupper=\scriptsize\sffamily\bfseries,% + on line,% + arc=3pt,% + colupper=white,% + colback=#1!50!black,% + colframe=#1!50!black,% + before upper={\rule[-3pt]{0pt}{10pt}},% + boxrule=1pt,% + boxsep=0pt,% + left=2pt,% + right=2pt,% + top=1pt,% + bottom=.5pt% +} +\newcounter{@crcount} % Critical risk counter +\newcommand{\criticalrisk}[5]{% + \stepcounter{@crcount}% + \expandafter\gdef\csname % + @crDescription\arabic{@crcount}\endcsname{#1}% + \expandafter\xdef\csname @crLikelihood\arabic{@crcount}\endcsname{#2}% + \expandafter\xdef\csname @crSeverity\arabic{@crcount}\endcsname{#3}% + \expandafter\xdef\csname % + @crWorkPackages\arabic{@crcount}\endcsname{#4}% + \expandafter\gdef\csname @crMitigation\arabic{@crcount}\endcsname{#5}% +} +% \end{macrocode} +% +% Critical risk table row +% +% \begin{macrocode} +\newcommand{\crtablerow}[1]{% + \stepcounter{#1}% + \disptoken{@crDescription\arabic{#1}}\newline + \risktag[blue]{Likelihood: \disptoken{@crLikelihood\arabic{#1}}} + \risktag[red]{Severity: \disptoken{@crSeverity\arabic{#1}}} & + \disptoken{@crWorkPackages\arabic{#1}} & + \disptoken{@crMitigation\arabic{#1}} \\ + \hline% +} +% \end{macrocode} +% +% Critical risks table +% +% \begin{macrocode} +\newcommand{\makecriticalriskstable}{% + \newcounter{@crtable} + \begin{center} + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{1.0\textwidth}{|p{60mm}|c|X|} + \hline + \rowcolor{tablegrey}% + \thead{Description of risk (indicate level of\\ % + (i) likelihood, and (ii) severity:\\ % + Low\slash Medium\slash High)} & + \thead{WP(s)\\ involved} & + \thead{Proposed risk-mitigation measures} \\ + \hline + \whiledo% + {\value{@crtable}<\numexpr\value{@crcount}-1}% + {\crtablerow{@crtable}}% + \crtablerow{@crtable} + \end{xltabular} + \end{center} +} +% \end{macrocode} +% +% \subsection*{Staff effort} +% +% \begin{macrocode} +\newcommand{\staffeffort}[3]{% + \expandafter\xdef\csname @se#1.#2\endcsname{#3}% +} +% \end{macrocode} +% +% Summary of staff effort table row +% +% \begin{macrocode} +\newcommand{\setablerow}[1]{% + \def\serowtotal{0}% + \setcounter{@secolumn}{0}% + \bfseries\the\value{#1} \disptoken{@pShortName\arabic{#1}}% + \edef\serowtemp{}% + \whiledo{\value{@secolumn}<\value{@wpcount}}{% + \stepcounter{@secolumn}% + \edef\sewpname{\disptoken{@wpShortName\the\value{@secolumn}}}% + \edef\sewpcell% + {\disptoken{@se\disptoken{@pShortName\the\value{#1}}.\sewpname}}% + \edef\serowtotal% + {\fpeval{\serowtotal + \sewpcell}}% Total PMs per participant + \xdef\setotalpm{\fpeval{\setotalpm + \sewpcell}}% Total PMs + \expandafter\xdef\csname % + @wpPersonMonths\arabic{@secolumn}\endcsname{\fpeval{% + \sewpcell+\csname % + @wpPersonMonths\arabic{@secolumn}\endcsname}}% Total PMs per WP + \IfEq% If... + {\disptoken{@pShortName\the\value{#1}}}% ...the current PI + {\disptoken{@wpLeadParticipantShortName% + \the\value{@secolumn}}}% ...is the WP lead + {\protected@edef\seformat{\bfseries}}% ...then apply boldface + {\edef\seformat{}}% ...otherwise don't. + \protected@edef\serowtemp% + {\serowtemp&\seformat \sewpcell}% Print PI's PMs for this WP + }% + \protected@edef\serowtemp{\serowtemp&\fpeval{round(\serowtotal,0)}}% + \serowtemp% + \stepcounter{#1}% +} +% \end{macrocode} +% +% Summary of staff effort table +% +% \begin{macrocode} +\newcommand{\makestaffefforttable}{% + \newcounter{@setable} + \stepcounter{@setable} + \newcounter{@secolumn} + \xdef\setotalpm{0} + \edef\serowtemp{} + \begin{center} + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{1.0\textwidth}% + {|>{\columncolor{tablegrey}}l|*{\value{@wpcount}}{r|}% + >{\columncolor{tablegrey}}r|} + \hline + % Table header + \rowcolor{tablegrey}% + \whiledo{\value{@secolumn}<\value{@wpcount}}{% + \stepcounter{@secolumn}% + \protected@edef\serowtemp% + {\serowtemp&\protect\thead{WP\the\value{@secolumn}}}% + } + \serowtemp & \thead{Total PMs\\ per Participant} \\ + \hline + % Participant rows + \whiledo% + {\value{@setable}<\numexpr\value{@pcount}}% + {\setablerow{@setable}\\ \hline}% + \setablerow{@setable} \\ \hline% + % Total + \rowcolor{tablegrey}% + \setcounter{@secolumn}{0} + \bfseries Total PMs + \whiledo{\value{@secolumn}<\value{@wpcount}}{% + \stepcounter{@secolumn}% + \edef\serowtemp{\serowtemp&\fpeval{round(\csname % + @wpPersonMonths\arabic{@secolumn}\endcsname,0)}}% + \@bsphack + \protected@write\@auxout{}% + {\string\expandafter\string\expandafter\string\expandafter% + \string\gdef\string\disptoken{@wpTotalPersonMonths% + \arabic{@secolumn}}{\fpeval{round(\disptoken{@wpPersonMonths% + \arabic{@secolumn}},0)}}}% + \@esphack + } + \serowtemp & \fpeval{round(\setotalpm,0)} \\ + \hline + \end{xltabular} + \end{center} +} +% \end{macrocode} +% +% \subsection*{Subcontracting costs} +% +% \begin{macrocode} +\newcommand{\subcontractingcost}[3]{% + \stepcounter{@pSubcontractingCosts\getPnum{#1}} + \expandafter\xdef\csname % + @scCost\getPnum{#1}.\arabic{@pSubcontractingCosts\getPnum{#1}}% + \endcsname{#2}% + \expandafter\xdef\csname % + @scJustification\getPnum{#1}.\arabic{@pSubcontractingCosts\getPnum% + {#1}}\endcsname{#3}% +} +% \end{macrocode} +% +% Subcontracting costs table +% +% \begin{macrocode} +\newcommand{\makesubcontractingcoststable}{% + \newcounter{@scparticipant} + \begin{center} + % For each participant + \whiledo{\value{@scparticipant}<\value{@pcount}}{% + \stepcounter{@scparticipant}% + \ifthenelse% + {\value{@pSubcontractingCosts\arabic% + {@scparticipant}}>0}% If they have subcontracting costs + {\sctablesection% + {@scparticipant}}% Print their subcontracting costs table + {}% Otherwise, do nothing + }% + \end{center} +} +% \end{macrocode} +% +% Subcontracting costs table section +% +% \begin{macrocode} +\newcommand{\sctablesection}[1]{% + \newcounter{@sccost\arabic{#1}} + \edef\scrowtemp{} + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}l|r|X|} + \hline + \rowcolor{tablegrey} + \multicolumn{3}{|l|}{\bfseries\the\value{#1} % + \disptoken{@pShortName\arabic{#1}}} \\ + \hline + \rowcolor{tablegrey} + & \thead{Cost (€)} + & \thead{Description of tasks and justification} \\ + \hline + % For each subcontracting cost + \whiledo% + {\value{@sccost\arabic{#1}}<\numexpr\value% + {@pSubcontractingCosts\arabic{#1}}-1}{% + \stepcounter{@sccost\arabic{#1}}% + \sctablerow{#1}{@sccost\arabic{#1}}% + }% + \stepcounter{@sccost\arabic{#1}}% + \sctablerow{#1}{@sccost\arabic{#1}}% + \end{xltabular} +} +% \end{macrocode} +% +% Subcontracting costs table row +% +% \begin{macrocode} +\newcommand{\sctablerow}[2]{% + \thead{Subcontracting} & + \disptoken{@scCost\arabic{#1}.\arabic{#2}} & + \disptoken{@scJustification\arabic{#1}.\arabic{#2}} + \\ \hline +} +% \end{macrocode} +% +% \subsection*{Other costs} +% +% \begin{macrocode} +\newcommand{\othercost}[3]{% + \stepcounter{@pOtherCosts\getPnum{#1}} + \expandafter\xdef\csname % + @ocCost\getPnum{#1}.\arabic{@pOtherCosts\getPnum{#1}}\endcsname{#2}% + \expandafter\xdef\csname % + @ocJustification\getPnum{#1}.\arabic% + {@pOtherCosts\getPnum{#1}}\endcsname{#3}% +} +% \end{macrocode} +% +% Other costs table +% +% \begin{macrocode} +\newcommand{\makeothercoststable}{% + \newcounter{@ocparticipant} + \begin{center} + % For each participant + \whiledo{\value{@ocparticipant}<\value{@pcount}}{% + \stepcounter{@ocparticipant}% + \ifthenelse% + {\value{@pOtherCosts\arabic% + {@ocparticipant}}>0}% If they have other costs + {\octablesection{@ocparticipant}}% Print their other costs table + {}% Otherwise, do nothing + }% + \end{center} +} +% \end{macrocode} +% +% Other costs table section +% +% \begin{macrocode} +\newcommand{\octablesection}[1]{% + \newcounter{@occost\arabic{#1}} + \edef\ocrowtemp{} + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}l|r|X|} + \hline + \rowcolor{tablegrey} + \multicolumn{3}{|l|}{\bfseries\the\value{#1} % + \disptoken{@pShortName\arabic{#1}}} \\ + \hline + \rowcolor{tablegrey} + & \thead{Cost (€)} & \thead{Justification} \\ + \hline + % For each other cost + \whiledo% + {\value{@occost\arabic{#1}}<\numexpr\value% + {@pOtherCosts\arabic{#1}}-1}{% + \stepcounter{@occost\arabic{#1}}% + \octablerow{#1}{@occost\arabic{#1}}% + }% + \stepcounter{@occost\arabic{#1}}% + \octablerow{#1}{@occost\arabic{#1}}% + \end{xltabular} +} +% \end{macrocode} +% +% Other costs table row +% +% \begin{macrocode} +\newcommand{\octablerow}[2]{% + \thead{Internally invoiced\\ goods and services} & + \disptoken{@ocCost\arabic{#1}.\arabic{#2}} & + \disptoken{@ocJustification\arabic{#1}.\arabic{#2}} + \\ \hline +} +% \end{macrocode} +% +% \subsection*{Purchase costs} +% +% \begin{macrocode} +\newcommand{\purchasecost}[8]{% + \stepcounter{@pPurchaseCosts\getPnum{#1}} + \expandafter\xdef\csname @pcTravelCost\getPnum{#1}\endcsname{#2}% + \expandafter\xdef\csname % + @pcTravelJustification\getPnum{#1}\endcsname{#3}% + \expandafter\xdef\csname @pcEquipmentCost\getPnum{#1}\endcsname{#4}% + \expandafter\xdef\csname % + @pcEquipmentJustification\getPnum{#1}\endcsname{#5}% + \expandafter\xdef\csname @pcOtherCost\getPnum{#1}\endcsname{#6}% + \expandafter\xdef\csname % + @pcOtherJustification\getPnum{#1}\endcsname{#7}% + \expandafter\xdef\csname @pcRemainingCost\getPnum{#1}\endcsname{#8}% + \expandafter\xdef\csname % + @pcTotalCost\getPnum{#1}\endcsname% + {\the\numexpr #2+#4+#6+#8 \relax}% TO DO + % \expandafter\xdef\csname @pcTotalCost\getPnum{#1}\endcsname{100}% +} +% \end{macrocode} +% +% Purchase costs table +% +% \begin{macrocode} +\newcommand{\makepurchasecoststable}{% + \newcounter{@pcparticipant} + \begin{center} + % For each participant + \whiledo{\value{@pcparticipant}<\value{@pcount}}{% + \stepcounter{@pcparticipant}% + \ifthenelse% + {\value{@pPurchaseCosts\arabic% + {@pcparticipant}}>0}% If they have purchase costs + {\pctablesection% + {@pcparticipant}}% Print their purchase costs table + {}% Otherwise, do nothing + }% + \end{center} +} +% \end{macrocode} +% +% Purchase costs table section +% +% \begin{macrocode} +\newcommand\swap[2]{ + \let\pcTemp#1 + \let#1#2 + \let#2\pcTemp +} +\newcommand{\pctablesection}[1]{% + \newcounter{@pccost\arabic{#1}} + % Define table rows + \def\pcRowA{% + \thead{Travel and subsistence} & + \disptoken{@pcTravelCost\arabic{#1}} & + \disptoken{@pcTravelJustification\arabic{#1}} + }% + \edef\pcCostA{\disptoken{@pcTravelCost\arabic{#1}}}% + \def\pcRowB{% + \thead{Equipment} & + \disptoken{@pcEquipmentCost\arabic{#1}} & + \disptoken{@pcEquipmentJustification\arabic{#1}} + }% + \edef\pcCostB{\disptoken{@pcEquipmentCost\arabic{#1}}}% + \def\pcRowC{% + \thead{Other goods, works\\ and services} & + \disptoken{@pcOtherCost\arabic{#1}} & + \disptoken{@pcOtherJustification\arabic{#1}} + }% + \edef\pcCostC{\disptoken{@pcOtherCost\arabic{#1}}}% + % Sort table rows + \ifthenelse{\pcCostA<\pcCostC}{% + \swap{\pcRowA}{\pcRowC} + \swap{\pcCostA}{\pcCostC} + }{} + \ifthenelse{\pcCostA<\pcCostB}{% + \swap{\pcRowA}{\pcRowB} + \swap{\pcCostA}{\pcCostB} + }{} + \ifthenelse{\pcCostB<\pcCostC}{% + \swap{\pcRowC}{\pcRowB} + \swap{\pcCostC}{\pcCostB} + }{} + + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{\textwidth}{|>{\columncolor{tablegrey}}p{43mm}|r|X|} + \hline + \rowcolor{tablegrey} + \multicolumn{3}{|l|}{\bfseries\the\value{#1} % + \disptoken{@pShortName\arabic{#1}}} \\ + \hline + \rowcolor{tablegrey} + & \thead{Cost (€)} & \thead{Justification} \\ + \hline + % Output purchase costs in sorted order + \pcRowA \\ \hline + \pcRowB \\ \hline + \pcRowC \\ \hline + % Output remaining and total costs + \thead{Remaining purchase\\ costs (<15\% of pers.\\ costs)} + & \disptoken{@pcRemainingCost\arabic{#1}} \\ + \cline{1-2} + \thead{Total} & \disptoken{@pcTotalCost\arabic{#1}} \\ + \cline{1-2} + \end{xltabular} +} +% \end{macrocode} +% +% \subsection*{In-kind contributions} +% +% \begin{macrocode} +\newcommand{\inkindcontribution}[5]{% + \stepcounter{@pInkindContributions\getPnum{#1}} + \expandafter\xdef\csname % + @ikcThirdPartyName\getPnum{#1}.\arabic% + {@pInkindContributions\getPnum{#1}}\endcsname{#2}% + \expandafter\xdef\csname % + @ikcCategory\getPnum{#1}.\arabic% + {@pInkindContributions\getPnum{#1}}\endcsname{#3}% + \expandafter\xdef\csname % + @ikcCost\getPnum{#1}.\arabic% + {@pInkindContributions\getPnum{#1}}\endcsname{#4}% + \expandafter\xdef\csname % + @ikcJustification\getPnum{#1}.\arabic% + {@pInkindContributions\getPnum{#1}}\endcsname{#5}% +} +% \end{macrocode} +% +% In-kind contributions table +% +% \begin{macrocode} +\newcommand{\makeinkindcontributionstable}{% + \newcounter{@ikcparticipant} + \begin{center} + % For each participant + \whiledo{\value{@ikcparticipant}<\value{@pcount}}{% + \stepcounter{@ikcparticipant}% + \ifthenelse% + {\value{@pInkindContributions\arabic% + {@ikcparticipant}}>0}% If they have in-kind contributions + {\ikctablesection% + {@ikcparticipant}}% Print their in-kind contributions table + {}% Otherwise, do nothing + }% + \end{center} +} +% \end{macrocode} +% +% In-kind contributions table section +% +% \begin{macrocode} +\newcommand{\ikctablesection}[1]{% + \newcounter{@ikccost\arabic{#1}} + \edef\ikcrowtemp{} + \renewcommand\theadfont{\normalsize\bfseries} + \begin{xltabular}{\textwidth}% + {|>{\raggedright}p{40mm}|>{\raggedright}p{35mm}|r|X|} + \hline + \rowcolor{tablegrey} + \multicolumn{4}{|l|}{\bfseries\the\value{#1} % + \disptoken{@pShortName\arabic{#1}}} \\ + \hline + \rowcolor{tablegrey} + \thead{Third party name} & \thead{Category} & + \thead{Cost (€)} & \thead{Justification} \\ + \hline + % For each in-kind contribution + \whiledo% + {\value{@ikccost\arabic{#1}}<\numexpr\value% + {@pInkindContributions\arabic{#1}}-1}{% + \stepcounter{@ikccost\arabic{#1}}% + \ikctablerow{#1}{@ikccost\arabic{#1}}% + }% + \stepcounter{@ikccost\arabic{#1}}% + \ikctablerow{#1}{@ikccost\arabic{#1}}% + \end{xltabular} +} +% \end{macrocode} +% +% In-kind contributions table row +% +% \begin{macrocode} +\newcommand{\ikctablerow}[2]{% + \disptoken{@ikcThirdPartyName\arabic{#1}.\arabic{#2}} & + \disptoken{@ikcCategory\arabic{#1}.\arabic{#2}} & + \disptoken{@ikcCost\arabic{#1}.\arabic{#2}} & + \disptoken{@ikcJustification\arabic{#1}.\arabic{#2}} + \\ \hline +} +% \end{macrocode} +% +% \subsection*{Summary canvas} +% +% \begin{macrocode} +\RequirePackage{pdflscape} % PDF landscape for Summary canvas +\newenvironment{summarycanvas}{% + \begin{tcbraster}[% + raster columns=3, + ]% +}{% + \end{tcbraster}% +} +\newenvironment{summarybox}[1]{% + \begin{tcolorbox}[% + colframe=summaryblue, + colbacktitle=summaryblue, + %height fill, + fonttitle=\bfseries\sffamily, + halign title=center, + title={#1} + ] +}{% + \end{tcolorbox}% +} +% \end{macrocode} +% +% Code for sideways figures, adapted from +% \url{https://tex.stackexchange.com/a/307142/22603}. +% Copyright 2016 John Kormylo and licensed under the Creative Commons +% Attribution-ShareAlike 4.0 license (CC~BY-SA~4.0), per personal +% communication with Tristan Miller on 2023-12-02. +% +% \begin{macrocode} +\RequirePackage{everypage} +\RequirePackage{environ} +\newcounter{abspage}% \thepage not reliab +\newcommand{\newSFPage}[1]% #1 = \theabspage + {\global\expandafter\let\csname SFPage@#1\endcsname\null} +\NewEnviron{SidewaysFigure}{\begin{figure}[p] +\protected@write\@auxout% + {\let\theabspage=\relax}% delays expansion until shipout + {\string\newSFPage{\theabspage}}% +\ifdim\textwidth=\textheight + \rotatebox{90}{\parbox[c][\textwidth][c]{\linewidth}{\BODY}}% +\else + \rotatebox{90}{\parbox[c][\textwidth][c]{\textheight}{\BODY}}% +\fi +\end{figure}} +\AddEverypageHook{% check if sideways figure on this page + \ifdim\textwidth=\textheight + \stepcounter{abspage}% already in landscape + \else + \@ifundefined{SFPage@\theabspage}{}{\global\pdfpageattr{/Rotate 0}}% + \stepcounter{abspage}% + \@ifundefined{SFPage@\theabspage}{}% + {\global\pdfpageattr{/Rotate 90}}% + \fi} +% \end{macrocode} +% +% \subsection*{Font setup} +% +% \begin{macrocode} +\RequirePackage{newtxtext} % Use Times for main text +\RequirePackage{newtxmath} % Use Times for math +\renewcommand*\ttdefault{lmvtt} % Latin Modern Typewriter Proportional +% \end{macrocode} +% +% \subsection*{Page header and footer} +% +% \begin{macrocode} +\RequirePackage{lastpage} +\RequirePackage{fancyhdr} +\newcommand{\Paragraph}[1]{\vspace*{-.45em}\paragraph{#1.}} +\pagestyle{fancy} +\renewcommand{\headrulewidth}{0pt} % Remove line at top +\lhead{\sffamily\scriptsize Call: \@callidentifier\ --- \@callname} +\rhead{} +\chead{} +\cfoot{\raisebox{\dimexpr(-\height+\ht\strutbox-\dp\strutbox)/2}{% + \begin{tcolorbox}[nobeforeafter, + fontupper=\scriptsize\sffamily, + colback=footergrey, + boxrule=0.75pt, + halign=center, + boxsep=0mm, + ]% + \strut Part B -- Page \thepage\ of \pageref*{LastPage}% + \end{tcolorbox}% + }% +} +% \end{macrocode} +% +% \subsection*{Titles and section headings} +% +% Document title +% +% \begin{macrocode} +\def\@maketitle{% + \newpage% + \noindent% + \large% + \framebox[\textwidth]% + {\null\hfill\textsf{\textbf{\textsc{\@title}}}\hfill\null}% + \par + \vskip 1.5em\thispagestyle{fancy}% + \ifdefined\@calltopic + \vspace{-5mm} + \begin{center} + Topic: \@calltopic + \end{center} + \fi +} +% \end{macrocode} +% +% Format page limits used by the Horizon Europe template +% +% \begin{macrocode} +\NewDocumentCommand{\showpagelimit}{m} +{% + \ifheria@showinstructions% + {\normalfont\sffamily\itshape [e.g.\ #1]}% + \fi% +} +% \end{macrocode} +% +% Format ``tags'' used by the Horizon Europe template +% +% \begin{macrocode} +\ExplSyntaxOn +\NewDocumentCommand{\hetag}{mm} + {% + \textcolor{taggrey}{\normalfont\sffamily\footnotesize% + \clist_map_inline:nn { #2 } { \# #1 ##1 #1 \# ~}% + }% + } +\ExplSyntaxOff +\NewDocumentCommand{\opentag}{m}{\hetag{@}{#1}} +\NewDocumentCommand{\closetag}{m}{\noindent\hetag{§}{#1}} +% \end{macrocode} +% +% Format section titles, with optional opening and closing tags +% +% \begin{macrocode} +\RequirePackage[explicit]{titlesec} +\titleformat{\section} + {\normalfont\normalsize\bfseries\sffamily}% + {\thesection}{1em}{#1 \sectiontag\sectionpagelimit} +\titleformat{\subsection} + {\normalfont\normalsize\bfseries\sffamily}% + {\thesubsection}{1em}{#1 \sectiontag\sectionpagelimit} +\titleformat{\subsubsection} + {\normalfont\normalsize\bfseries\sffamily}% + {\thesubsubsection}{1em}{#1 \sectiontag\sectionpagelimit} +\NewDocumentCommand{\extendedsection}{sO{#3}mooo}{% + \IfValueTF{#4}% + {\renewcommand{\sectiontag}{\opentag{#4}}}% + {\renewcommand{\sectiontag}{}}% + \IfValueTF{#6}% + {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}% + {\renewcommand{\sectionpagelimit}{}}% + \IfValueT{#5}{% + \closetag{#5}% + }% + \IfBooleanTF{#1}{% + \latexsection*{#3}% + }{% + \latexsection[#2]{#3}% + }% +} +\NewDocumentCommand{\extendedsubsection}{sO{#3}mooo}{% + \IfValueTF{#4}% + {\renewcommand{\sectiontag}{\opentag{#4}}}% + {\renewcommand{\sectiontag}{}}% + \IfValueTF{#6}% + {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}% + {\renewcommand{\sectionpagelimit}{}}% + \IfValueT{#5}{% + \closetag{#5}% + }% + \IfBooleanTF{#1}{% + \latexsubsection*{#3}% + }{% + \latexsubsection[#2]{#3}% + }% +} +\NewDocumentCommand{\extendedsubsubsection}{sO{#3}mooo}{% + \IfValueTF{#4}% + {\renewcommand{\sectiontag}{\opentag{#4}}}% + {\renewcommand{\sectiontag}{}}% + \IfValueTF{#6}% + {\renewcommand{\sectionpagelimit}{\showpagelimit{#6}}}% + {\renewcommand{\sectionpagelimit}{}}% + \IfValueT{#5}{% + \closetag{#5}% + }% + \IfBooleanTF{#1}{% + \latexsubsubsection*{#3}% + }{% + \latexsubsubsection[#2]{#3}% + }% +} +\newcommand{\sectiontag}{} +\newcommand{\sectionpagelimit}{} +\AtBeginDocument{% + \NewCommandCopy{\latexsection}{\section}% + \RenewCommandCopy{\section}{\extendedsection}% + \NewCommandCopy{\latexsubsection}{\subsection}% + \RenewCommandCopy{\subsection}{\extendedsubsection}% + \NewCommandCopy{\latexsubsubsection}{\subsubsection}% + \RenewCommandCopy{\subsubsection}{\extendedsubsubsection}% +} +% \end{macrocode} +% +% \subsection*{Official Horizon Europe template instructions} +% +% \begin{macrocode} +\RequirePackage[inline]{enumitem} % For custom bullets +\RequirePackage[normalem]{ulem} % For underlined text +\RequirePackage{kvoptions} +\SetupKeyvalOptions{ + family=heria, + prefix=heria@ +} +\DeclareBoolOption{showinstructions} +\ProcessKeyvalOptions* + +\RequirePackage{twemojis} +\RequirePackage{xspace} +\newcommand{\twarn}{\twemoji{warning}\xspace} +\RequirePackage{verbatim} +\newenvironment{instructions}{% + \begin{tcolorbox}[fontupper=\sffamily, + fonttitle=\sffamily\bfseries, + colback=blue!5!white, + colframe=blue!75!black, + parbox=false, + breakable + ]% + }{% + \end{tcolorbox}% + } + +\newcommand{\heinstructions}[1]{% + \ifheria@showinstructions% + \begin{instructions}% + \input{hi-#1}% + \end{instructions}% + \fi% +} +% \end{macrocode} +%\iffalse +% +%<*hi-annexes> +\textbf{ANNEXES TO PROPOSAL PART B} + +Some calls may ask to upload annexes to proposal part B. The annexes +must be uploaded as separate documents in the submission system. The +most common annexes to be uploaded in Horizon Europe are (standard +templates are published in the Funding \& Tenders portal): + +\begin{itemize} +\item + \textbf{CLINICAL TRIALS:} Annex with information on clinical trials +\item + \textbf{FINANCIAL SUPPORT TO THIRD PARTIES:} Annex with information on + financial support to third parties.~ +\item + \textbf{CALLS FLAGGED AS SECURITY SENSITIVE:} Annex with information + on security aspects.~ +\item + \textbf{ETHICS:} ethics self-assessment should be included in proposal + part A. However, in calls where several serious ethics issues are + expected, the character limited in this section of proposal part A may + not be sufficient for participants to give all necessary information. + In those cases, participants may include additional information in an + annex to proposal part B.~~ +\end{itemize} +% +%<*hi-capacity> +\twarn \emph{The individual participants of the consortium are + described in a separate section under Part A. There is no need to + repeat that information here.} + +\begin{itemize} +\item + Describe the consortium. How does it match the project's objectives, + and bring together the necessary disciplinary and inter-disciplinary + knowledge? Show how this includes expertise in social sciences and + humanities, open science practices, and gender aspects of R\&I, as + appropriate. Include in the description affiliated entities and + associated partners, if any. +\item + Show how the partners will have access to critical infrastructure + needed to carry out the project activities. +\item + Describe how the members complement one another (and cover the value + chain, where appropriate) +\item + In what way does each of them contribute to the project? Show that + each has a valid role, and adequate resources in the project to fulfil + that role. +\item + If applicable, describe the industrial/commercial involvement in the + project to ensure exploitation of the results and explain why this is + consistent with and will help to achieve the specific measures which + are proposed for exploitation of the results of the project (see + section 2.2). +\item + \textbf{Other countries and international organisations}: If one or + more of the participants requesting EU funding is based in a country + or is an international organisation that is not automatically eligible + for such funding (entities from Member States of the EU, from + Associated Countries and from one of the countries in the exhaustive + list included in the Work Programme General Annexes B are + automatically eligible for EU funding), explain why the participation + of the entity in question is essential to successfully carry out the + project. +\end{itemize} +% +%<*hi-criticalrisks> +\begin{tcolorbox}[standard jigsaw,opacityback=0] +\textbf{Definition critical risk:} + +A critical risk is a plausible event or issue that could have a high +adverse impact on the ability of the project to achieve its objectives. + +\textbf{Level of likelihood to occur: Low/medium/high} + +The likelihood is the estimated probability that the risk will +materialise even after taking account of the mitigating measures put in +place. + +\textbf{Level of severity: Low/medium/high} + +The relative seriousness of the risk and the significance of its effect. +\end{tcolorbox} +% +%<*hi-deliverables-key> +\begin{tcolorbox}[standard jigsaw,opacityback=0] +\textbf{KEY} + +Deliverable numbers in order of delivery dates. Please use the numbering +convention \textless WP number\textgreater.\textless number of +deliverable within that WP\textgreater. + +For example, deliverable 4.2 would be the second deliverable from work +package 4. + +\textbf{Type:} + +Use one of the following codes: + +\begin{quote} +R: Document, report (excluding the periodic and final reports) + +DEM: Demonstrator, pilot, prototype, plan designs + +DEC: Websites, patents filing, press \& media actions, videos, etc. + +DATA: Data sets, microdata, etc. + +DMP: Data management plan + +ETHICS: Deliverables related to ethics issues. + +SECURITY: Deliverables related to security issues + +OTHER: Software, technical diagram, algorithms, models, etc. +\end{quote} + +\textbf{Dissemination level:} + +Use one of the following codes: + +\begin{quote} +PU -- Public, fully open, e.g. web (Deliverables flagged as public will +be automatically published in CORDIS project's page) + +SEN -- Sensitive, limited under the conditions of the Grant Agreement + +Classified R-UE/EU-R -- EU RESTRICTED under the Commission Decision +No2015/444 + +Classified C-UE/EU-C -- EU CONFIDENTIAL under the Commission Decision +No2015/444 + +Classified S-UE/EU-S -- EU SECRET under the Commission Decision +No2015/444 +\end{quote} + +\textbf{Delivery date} + +Measured in months from the project start date (month 1) +\end{tcolorbox} +% +%<*hi-deliverables> +Only include deliverables that you consider essential for effective +project monitoring.\footnote{You must include a data + management plan (DMP) and a `plan for dissemination and exploitation + including communication activities as distinct deliverables within the + first 6 months of the project. The DMP will evolve during the lifetime + of the project in order to present the status of the + project\textquotesingle s reflections on data management. A template + for such a plan is available in the + \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/common/guidance/om_en.pdf}{Online + Manual} on the Funding \& Tenders Portal.} +% +%<*hi-excellence> +\begin{tcolorbox}[standard jigsaw,opacityback=0] + \textbf{Excellence – aspects to be taken into account.} + \begin{itemize} + \item Clarity and pertinence of the project’s objectives, and the + extent to which the proposed work is ambitious, and goes beyond + the state of the art. + \item Soundness of the proposed methodology, including the + underlying concepts, models, assumptions, interdisciplinary + approaches, appropriate consideration of the gender dimension in + research and innovation content, and the quality of open science + practices, including sharing and management of research outputs + and engagement of citizens, civil society and end users where + appropriate. + \end{itemize} + \end{tcolorbox} + \noindent \twarn The following aspects will be taken into account + only to the extent that the proposed work is within the scope of the + work programme topic. +% +%<*hi-impact> +\begin{tcolorbox}[standard jigsaw,opacityback=0] +\emph{\textbf{Impact -- aspects to be taken into account.}} + +\begin{itemize} +\item + Credibility of the pathways to achieve the expected outcomes and + impacts specified in the work programme, and the likely scale and + significance of the contributions due to the project. +\item + Suitability and quality of the measures to maximise expected outcomes + and impacts, as set out in the dissemination and exploitation plan, + including communication activities. +\end{itemize} + \end{tcolorbox} + + \emph{The results of your project should make a contribution to the +expected outcomes set out for the work programme topic over the medium +term, and to the wider expected impacts set out in the `destination' +over the longer term.} + +\emph{In this section you should show how your project could contribute +to the outcomes and impacts described in the work programme, the likely +scale and significance of this contribution, and the measures to +maximise these impacts.} +% +%<*hi-inkind> +Please complete the table below for each participant that will make use +of in-kind contributions (non-financial resources made available free of +charge by third parties). In kind contributions provided by third +parties free of charge are declared by the participants as eligible +direct costs in the corresponding cost category (e.g. personnel costs or +purchase costs for equipment). +% +%<*hi-measures> +\begin{itemize} +\item + Describe the planned measures to maximise the impact of your project + by providing a first version of your `\uline{plan for the + dissemination and exploitation including communication activities'}. + Describe the dissemination, exploitation and communication measures + that are planned, and the target group(s) addressed (e.g. scientific + community, end users, financial actors, public at large). + +\begin{itemize}[label=\twarn] +\item + \emph{Please remember that this plan is an admissibility condition, + unless the work programme topic explicitly states otherwise. In case + your proposal is selected for funding, a more detailed `plan for + dissemination and exploitation including communication activities' + will need to be provided as a mandatory project deliverable within 6 + months after signature date. This plan shall be periodically updated + in alignment with the project's progress.} +\item + \emph{\uline{Communication}}\footnote{For further guidance on + communicating EU research and innovation for project participants, + please refer to the + \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/common/guidance/om_en.pdf}{Online + Manual} on the Funding \& Tenders Portal} \emph{measures should + promote the project throughout the full lifespan of the project. The + aim is to inform and reach out to society and show the activities + performed, and the use and the benefits the project will have for + citizens. Activities must be strategically planned, with clear + objectives, start at the outset and continue through the lifetime of + the project. The description of the communication activities needs to + state the main messages as well as the tools and channels that will be + used to reach out to each of the chosen target groups.} +\item + \emph{All measures should be proportionate to the scale of the + project, and should contain concrete actions to be implemented both + during and after the end of the project, e.g. standardisation + activities. Your plan should give due consideration to the possible + follow-up of your project, once it is finished. In the justification, + explain why each measure chosen is best suited to reach the target + group addressed. Where relevant, and for innovation actions, in + particular, describe the measures for a plausible path to + commercialise the innovations.} +\item + \emph{If exploitation is expected primarily in non-associated third + countries, justify by explaining how that exploitation is still in the + Union's interest.} +\item + \emph{Describe possible feedback to policy measures generated by the + project that will contribute to designing, monitoring, reviewing and + rectifying (if necessary) existing policy and programmatic measures or + shaping and supporting the implementation of new policy initiatives + and decisions.} +\end{itemize} + +\item + Outline your strategy for the management of intellectual property, + foreseen protection measures, such as patents, design rights, + copyright, trade secrets, etc., and how these would be used to support + exploitation. + +\begin{itemize}[label=\twarn] +\item + \emph{If your project is selected, you will need an appropriate + consortium agreement to manage (amongst other things) the ownership + and access to key knowledge (IPR, research data etc.). Where relevant, + these will allow you, collectively and individually, to pursue market + opportunities arising from the project.} +\item + \emph{If your project is selected, you must indicate the owner(s) of + the results (results ownership list) in the final periodic report.} +\end{itemize} +\end{itemize} + + +% +%<*hi-methodology> +\begin{itemize} +\item + Describe and explain the overall methodology, including the concepts, + models and assumptions that underpin your work. Explain how this will + enable you to deliver your project's objectives. Refer to any + important challenges you may have identified in the chosen methodology + and how you intend to overcome them. \emph{{[}e.g. 10 pages{]}} + +\begin{itemize}[label=\twarn] +\item + \emph{This section should be presented as a narrative. The detailed + tasks and work packages are described below under `Implementation'.} +\item + \emph{Where relevant, include how the project methodology complies + with the `do no significant harm' principle as per Article 17 of + \href{https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=celex:32020R0852}{Regulation + (EU) No 2020/852} on the establishment of a framework to facilitate + sustainable investment (i.e. the so-called \textquotesingle EU + Taxonomy Regulation\textquotesingle). This means that the methodology + is designed in a way it is not significantly harming any of the six + environmental objectives of the EU Taxonomy Regulation.} +\item + \emph{If you plan to use, develop and/or deploy artificial + intellingence (AI) based systems and/or techniques you must + demonstrate their technical robustness. AI-based systems or techniques + should be, or be developed to become:~} + + \begin{itemize} + \item + \emph{technically robust, accurate and reproducible, and able to + deal with and inform about possible failures, inaccuracies and + errors, proportionate to the assessed risk they pose~} + \item + \emph{socially robust, in that they duly consider the context and + environment in which they operate~} + \item + \emph{reliable and function as intended, minimizing unintentional + and unexpected harm, preventing unacceptable harm and safeguarding + the physical and mental integrity of humans~} + \item + \emph{able to provide a suitable explanation of their + decision-making processes, whenever they can have a significant + impact on people's lives.} + \end{itemize} +\end{itemize} + +\item + Describe any national or international research and innovation + activities whose results will feed into the project, and how that link + will be established; \emph{{[}e.g. 1 page{]}} +\item + Explain how expertise and methods from different disciplines will be + brought together and integrated in pursuit of your objectives. If you + consider that an inter-disciplinary approach is unnecessary in the + context of the proposed work, please provide a justification. + \emph{{[}e.g. 1/2 page{]}} +\item + For topics where the work programme indicates the need for the + integration of social sciences and humanities, show the role of these + disciplines in the project or provide a justification if you consider + that these disciplines are not relevant to your proposed project. + \emph{{[}e.g. 1/2 page{]}} +\item + Describe how the gender dimension (i.e. sex and/or gender analysis) is + taken into account in the project's research and innovation content + \emph{{[}e.g. 1 page{]}. If} you do not consider such a gender + dimension to be relevant in your project, please provide a + justification. + +\begin{itemize}[label=\twarn] +\item + \emph{Note: This section is mandatory except for topics which have + been identified in the work programme as not requiring the integration + of the gender dimension into R\&I content.} +\item + \emph{Remember that that this question relates to the \uline{content} + of the planned research and innovation activities, and not to gender + balance in the teams in charge of carrying out the project.} +\item + \emph{Sex and gender analysis refers to biological characteristics and + social/cultural factors respectively. For guidance on methods of sex / + gender analysis and the issues to be taken into account, please refer + to} + \url{https://ec.europa.eu/info/news/gendered-innovations-2-2020-nov-24_en} +\end{itemize} + +\item + Describe how appropriate open science practices are implemented as an + integral part of the proposed methodology. Show how the choice of + practices and their implementation are adapted to the nature of your + work, in a way that will increase the chances of the project + delivering on its objectives \emph{{[}e.g. 1 page{]}}. If you believe + that none of these practices are appropriate for your project, please + provide a justification here. + +\begin{itemize}[label=\twarn] +\item + \emph{Open science is an approach based on open cooperative work and + systematic sharing of knowledge and tools as early and widely as + possible in the process. Open science practices include early and open + sharing of research (for example through preregistration, registered + reports, pre-prints, or crowd-sourcing); research output management; + measures to ensure reproducibility of research outputs; providing open + access to research outputs (such as publications, data, software, + models, algorithms, and workflows); participation in open peer-review; + and involving all relevant knowledge actors including citizens, civil + society and end users in the co-creation of R\&I agendas and contents + (such as citizen science).} +\item + \emph{Please note that this question does not refer to outreach + actions that may be planned as part of communication, dissemination + and exploitation activities. These aspects should instead be described + below under `Impact'.} +\end{itemize} + +\item + Research \textbf{data management and management of other research + outputs:} Applicants generating/collecting data and/or other research + outputs (except for publications) during the project must provide + maximum 1 page on how the data/ research outputs will be managed in + line with the FAIR principles (Findable, Accessible, Interoperable, + Reusable), addressing the following (the description should be + specific to your project): \emph{{[}1 page{]}} + +\begin{quote} +\textbf{Types of data/research outputs} (e.g. experimental, +observational, images, text, numerical) and their estimated size; if +applicable, combination with, and provenance of, existing data. + +\textbf{Findability of data/research outputs:} Types of~persistent and +unique~identifiers (e.g. digital object identifiers)~and~trusted +repositories~that will be used. + +\textbf{Accessibility of data/research outputs:}~IPR considerations and +timeline for open access (if open access not provided, explain why); +provisions for access to restricted data for verification purposes. + +\textbf{Interoperability of data/research outputs:} Standards, formats +and vocabularies for data and metadata. + +\textbf{Reusability of data/research outputs}:~ Licenses for data +sharing and re-use (e.g. Creative Commons, Open Data +Commons);~availability of tools/software/models for data generation and +validation/interpretation /re-use. + +\textbf{Curation and storage/preservation costs}; person/team +responsible for data management and quality assurance. +\end{quote} + +\begin{itemize}[label=\twarn] +\item + \emph{Proposals selected for funding under Horizon Europe will need to + develop a~detailed data management plan (DMP) for making their + data/research outputs findable, accessible, interoperable and reusable + (FAIR) as a deliverable by month 6 and revised towards the end of a + project's lifetime.} +\item + \emph{For guidance on open science practices and research data + management, please refer to the relevant section of the + \href{https://ec.europa.eu/info/funding-tenders/opportunities/docs/2021-2027/horizon/guidance/programme-guide_horizon_en.pdf}{HE + Programme Guide} on the Funding \& Tenders Portal.} +\end{itemize} +\end{itemize} +% +%<*hi-milestones> +\begin{tcolorbox}[standard jigsaw,opacityback=0] +\textbf{KEY} + +\textbf{Due date} + +Measured in months from the project start date (month 1) + +\textbf{Means of verification} + +Show how you will confirm that the milestone has been attained. Refer to +indicators if appropriate. For example: a laboratory prototype that is +`up and running'; software released and validated by a user group; field +survey complete and data quality validated. +\end{tcolorbox} +% +%<*hi-objectives> +\begin{itemize} +\item + Briefly describe the objectives of your proposed work. Why are they + pertinent to the work programme topic? Are they measurable and + verifiable? Are they realistically achievable? +\item + Describe how your project goes beyond the state-of-the-art, and the + extent the proposed work is ambitious. Indicate any exceptional + ground-breaking R\&I, novel concepts and approaches, new products, + services or business and organisational models. Where relevant, + illustrate the advance by referring to products and services already + available on the market. Refer to any patent or publication search + carried out. +\item + Describe where the proposed work is positioned in terms of R\&I + maturity (i.e. where it is situated in the spectrum from `idea to + application', or from `lab to market'). Where applicable, provide an + indication of the Technology Readiness Level, if possible + distinguishing the start and by the end of the project. + + \begin{itemize}[label=\twarn] + \item \emph{Please bear in mind that advances beyond the state of + the art must be interpreted in the light of the positioning of + the project. Expectations will not be the same for RIAs at + lower TRL, compared with Innovation Actions at high TRLs. } + \end{itemize} +\end{itemize} +% +%<*hi-othercosts> +Please complete the table below for each participant that would like to +declare costs under other costs categories (e.g. internally invoiced +goods and services), irrespective of the percentage of personnel costs. +% +%<*hi-participant-numbering> +Please use the same participant numbering and name as that used in the +administrative proposal forms. +% +%<*hi-participants> +\twarn The consortium members are listed in part A of the proposal +(application forms). A summary list should also be provided in the +table below. +% +%<*hi-pathways> +\begin{itemize} +\item + \begin{quote} + Provide a \textbf{narrative} explaining how the project's results + are expected to make a difference in terms of impact, beyond the + immediate scope and duration of the project. The narrative should + include the components below, tailored to your project. + \end{quote} + +\begin{enumerate} +\def\labelenumi{(\alph{enumi})} +\item + Describe the unique contribution your project results would make + towards (1) the \textbf{outcomes} specified in this topic, and (2) the + \textbf{wider impacts}, in the longer term, specified in the + respective destinations in the work programme. + +\begin{itemize}[label=\twarn] +\item + \emph{Be specific, referring to the effects of your project, and not + R\&I in general in this field.} +\item + \emph{State the target groups that would benefit. Even if target + groups are mentioned in general terms in the work programme, you + should be specific here, breaking target groups into particular + interest groups or segments of society relevant to this project.} +\item + \emph{The outcomes and impacts of your project may:} + + \begin{itemize} + \item + \emph{Scientific, e.g. contributing to specific scientific advances, + across and within disciplines, creating new knowledge, reinforcing + scientific equipment and instruments, computing systems (i.e. + research infrastructures);} + \item + \emph{Economic/technological, e.g. bringing new products, services, + business processes to the market, increasing efficiency, decreasing + costs, increasing profits, contributing to standards' setting, etc.} + \item + \emph{Societal , e.g. decreasing CO\textsubscript{2} emissions, + decreasing avoidable mortality, improving policies and decision + making, raising consumer awareness.} + \end{itemize} + +\emph{Only include such outcomes and impacts where your project would +make a significant and direct contribution. Avoid describing very +tenuous links to wider impacts. However, include any potential +negative environmental outcome or impact of the project including when +expected results are brought at scale (such as at commercial level). +Where relevant, explain how the potential harm can be managed.} +\end{itemize} + +\item + Give an indication of the scale and significance of the project's + contribution to the expected outcomes and impacts, should the project + be successful. Provide quantified estimates where possible and + meaningful. + +\begin{itemize}[label=\twarn] +\item + `\emph{\uline{Scale'} refers to how widespread the outcomes and + impacts are likely to be. For example, in terms of the size of the + target group, or the proportion of that group, that should benefit + over time; \uline{`Significance'} refers to the importance, or value, + of those benefits. For example, number of additional healthy life + years; efficiency savings in energy supply.} + +\item + \emph{Explain your baselines, benchmarks and assumptions used for + those estimates. Wherever possible, quantify your estimation of the + effects that you expect from your project. Explain assumptions that + you make, referring for example to any relevant studies or statistics. + Where appropriate, try to use only one methodology for calculating + your estimates: not different methodologies for each partner, region + or country (the extrapolation should preferably be prepared by one + partner).} + +\item + \emph{Your estimate must relate to this project only - the effect of + other initiatives should not be taken into account.} +\end{itemize} + +\item + Describe any requirements and potential barriers - arising from + factors beyond the scope and duration of the project - that may + determine whether the desired outcomes and impacts are achieved. These + may include, for example, other R\&I work within and beyond Horizon + Europe; regulatory environment; targeted markets; user behaviour. + Indicate if these factors might evolve over time. Describe any + mitigating measures you propose, within or beyond your project, that + could be needed should your assumptions prove to be wrong, or to + address identified barriers. + +\begin{itemize}[label=\twarn] +\item + \emph{Note that this does not include the critical risks inherent to + the management of the project itself , which should be described below + under `Implementation'.} +\end{itemize} +\end{enumerate} +\end{itemize} +% +%<*hi-purchasecosts> +Please complete the table below for each participant if the purchase +costs (i.e. the sum of the costs for 'travel and subsistence', +`equipment', and `other goods, works and services') exceeds 15\% of the +personnel costs for that participant (according to the budget table in +proposal part A). The record must list cost items in order of costs and +starting with the largest cost item, up to the level that the remaining +costs are below 15\% of personnel costs. +% +%<*hi-quality> +\begin{tcolorbox}[standard jigsaw,opacityback=0] + \emph{\textbf{Quality and efficiency of the implementation -- aspects to +be taken into account}} + +\begin{itemize} +\item + \emph{Quality and effectiveness of the work plan, assessment of risks, + and appropriateness of the effort assigned to work packages, and the + resources overall} +\item + \emph{Capacity and role of each participant, and extent to which the + consortium as a whole brings together the necessary expertise.} +\end{itemize} + \end{tcolorbox} +% +%<*hi-staffeffort> +\emph{Please indicate the number of person/months over the whole +duration of the planned work, for each work package, for each +participant. Identify the work-package leader for each WP by showing the +relevant person-month figure in bold.} +% +%<*hi-subcontractingcosts> +For each participant describe and justify the tasks to be subcontracted +(please note that core tasks of the project should not be +sub-contracted). +% +%<*hi-summary> + Provide a summary of this section by presenting in the canvas below the +key elements of your project impact pathway and of the measures to +maximise its impact. +% +%<*hi-tables> +\twarn \emph{Use plain text for the tables in section 3.1. If the proposal is +invited to start Grant Agreement preparation, these tables will have to +be encoded in the grant management IT tool, where no graphics or special +formats are supported.} +% +%<*hi-workplan> +Please provide the following: + +\begin{itemize} +\item + + brief presentation of the overall structure of the work plan; +\item + + timing of the different work packages and their components (Gantt + chart or similar); +\item + + graphical presentation of the components showing how they inter-relate + (Pert chart or similar). +\item + + detailed work description, i.e.: + + \begin{itemize} + \item + + a list of work packages (table 3.1a); + \item + + a description of each work package (table 3.1b); + \item + + a list of deliverables (table 3.1c); +\begin{itemize}[label=\twarn] +\item + \emph{Give full details. Base your account on the logical structure of + the project and the stages in which it is to be carried out.} + \emph{The number of work packages should be proportionate to the scale + and complexity of the project.} +\item + \emph{You should give enough detail in each work package to justify + the proposed resources to be allocated and also quantified information + so that progress can be monitored, including by the Commission} +\item + \emph{Resources assigned to work packages should be in line with their + objectives and deliverables. You are advised to include a distinct + work package on `project management', and to give due visibility in + the work plan to `data management' `dissemination and exploitation' + and `communication activities', either with distinct tasks or distinct + work packages.} +\item + \emph{You will be required to update the `plan for the dissemination + and exploitation of results including communication activities', and a + `data management plan', (this does not apply to topics where a plan + was not required.) This should include a record of activities related + to dissemination and exploitation that have been undertaken and those + still planned.} +\item + \emph{Please make sure the information in this section matches the + costs as stated in the budget table in section 3 of the application + forms, and the number of person months, shown in the detailed work + package descriptions.} +\end{itemize} +\end{itemize} + +\item + a list of milestones (table 3.1d); + +\item + a list of critical risks, relating to project implementation, that the + stated project\textquotesingle s objectives may not be achieved. + Detail any risk mitigation measures. You will be able to update the + list of critical risks and mitigation measures as the project + progresses (table 3.1e); + +\item + a table showing number of person months required (table 3.1f); + +\item + a table showing description and justification of subcontracting costs + for each participant (table 3.1g); + +\item + a table showing justifications for `purchase costs' (table 3.1h) for + participants where those costs exceed 15\% of the personnel costs + (according to the budget table in proposal part A); + +\item + if applicable, a table showing justifications for `other costs + categories' (table 3.1i); + +\item + if applicable, a table showing in-kind contributions from third + parties (table 3.1j) +\end{itemize} +% +%<*hi-wp-description> +(where appropriate, broken down into tasks), lead partner and role of +participants. Deliverables linked to each WP are listed in table 3.1c +(no need to repeat the information here). +% +%<*hi-wp-objectives> +\twarn \emph{Participants involved in each WP and their efforts are + shown in table 3.1f. Lead participant and starting and end date of + each WP are shown in table 3.1a.)} +% +%<*heria-proposal> +%% Copyright 2023 Tristan Miller +%% +%% 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 +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +\documentclass[showinstructions]{heria} + +\title{Skeleton Horizon Europe Proposal} +\callname{insert call name} +\callidentifier{HORIZON-XX0-0000-XXXXX-00-XXXXX} +\calltopic{HORIZON-XX0-0000-XXXXX-00-00} + +\begin{document} +\maketitle + +\heinstructions{participants} + +\noindent\opentag{APP-FORM-HERIAIA}% +\section*{List of participants}[][][1 page]\label{sec:listofparticipants} + +\participant + {University of Upper Freedonia} % Participant organisation name + {UUF} % Participant short name + {AT} % Country + +\participant + {Molvania State University} % Participant organisation name + {MSU} % Participant short name + {DE} % Country + +\participant + {Institute for Underwater Basket Weaving} % Participant organisation name + {IUBW} % Participant short name + {UK} % Country + +\makeparticipantstable + +\heinstructions{participant-numbering} + +\section{Excellence}[REL-EVA-RE]\label{sec:excellence} + +\heinstructions{excellence} + +\subsection{Objectives and ambition}[PRJ-OBJ-PO][][4 pages]\label{sec:objectives} + +\heinstructions{objectives} + +\subsection{Methodology}[CON-MET-CM,COM-PLE-CP][PRJ-OBJ-PO][14 pages]\label{sec:methodology} + +\heinstructions{methodology} + +\subsubsection{Overall methodology}[][][10 pages]\label{sec:overallmethodology} + +\subsubsection{Connections to other research activities}[][][1 page]\label{sec:connections} + +\subsubsection{Interdisciplinarity}[][][1/2 page]\label{sec:interdisciplinarity} + +\subsubsection{Gender dimension}[][][1/2 page]\label{sec:gender} + +\subsubsection{Open science}[][][1 page]\label{sec:openscience} + +\subsubsection{Research data management}[][][1 page]\label{sec:rdm} + +\section{Impact}[IMP-ACT-IA][CON-MET-CM,COM-PLE-CP,REL-EVA-RE]\label{sec:impact} + +\heinstructions{impact} + +\subsection{Project's pathways towards impact}[][][4 pages]\label{sec:pathways} + +\heinstructions{pathways} + +\subsection{Measures to maximise impact: Dissemination, exploitation and communication}[COM-DIS-VIS-CDV][][5 pages, including section 2.3]\label{sec:measures} + +\heinstructions{measures} + +\subsection{Summary}\label{sec:summary} + +\heinstructions{summary} + +\closetag{COM-DIS-VIS-CDV} + +\begin{SidewaysFigure} +\begin{summarycanvas}% + \begin{summarybox}{SPECIFIC NEEDS} + \end{summarybox}% + \begin{summarybox}{EXPECTED RESULTS} + \end{summarybox}% + \begin{summarybox}{D \& E \& C MEASURES} + \end{summarybox}% +\end{summarycanvas}% +\begin{summarycanvas}% + \begin{summarybox}{TARGET GROUPS} + \end{summarybox}% + \begin{summarybox}{OUTCOMES} + \end{summarybox}% + \begin{summarybox}{IMPACTS} + \end{summarybox}% +\end{summarycanvas}% +\caption{Impact summary tableau}\label{fig:impact} +\end{SidewaysFigure} + +\section{Quality and efficiency of the implementation}[QUA-LIT-QL,WRK-PLA-WP][IMP-ACT-IA]\label{sec:quality} + +\heinstructions{quality} + +\subsection{Work plan and resources}[][][14 pages (19 pages for topics using lump sum funding)~-- including tables]\label{sec:workplan} + +\heinstructions{workplan} + +\subsubsection*{Table 3.1a: List of work packages} + +\heinstructions{tables} + +\makeworkpackagestable + +\subsubsection*{Table 3.1b: Work package description} + +\workpackage + {ra} % unique ID (used only for cross-referencing deliverables, etc. in LaTeX) + {Requirements analysis} % work package title + {UUF}% Lead participant (using short name) + {1}% Start month + {6}% End month + +\heinstructions{wp-objectives} +\begin{objectives} +\item First objective +\item Second objective +\item \dots +\end{objectives} + +\begin{descriptionofwork} +\heinstructions{wp-description} +\task + {Literature survey} % task name + {UUF} % short name of lead participant + {MSU} % other participants (or "all participants", etc.) + {1--6} % month(s) + In this task, we will read a lot of books, and\dots +\end{descriptionofwork} + +\deliverable + {dmp} % deliverable name + {Data management plan} % short description + {MSU} % short name of lead participant + {DMP}% type; see Table 3.1c instructions for valid values + {PU}% dissemination level; see Table 3.1c instructions for valid values + {6}% delivery date (in months from beginning of project) + +\workpackage% + {integration}% Unique ID (used only for cross-referencing deliverables, etc. in LaTeX) + {System integration}% Title + {UUF}% Lead partner (using short name ID) + {1}% Start month + {20}% End month + +\heinstructions{wp-objectives} +\begin{objectives} +\item First objective +\item Second objective +\item \dots +\end{objectives} + +\begin{descriptionofwork} +\heinstructions{wp-description} +\task + {Develop prototype} % task name + {UUF} % short name of lead participant + {MSU} % other participants (or "all participants", etc.) + {1--10} % month(s) + In this task, we will do lots of coding, and\dots +\end{descriptionofwork} + +\deliverable + {demo} % deliverable name + {Working demo system} % short description + {IUBW} % short name of lead participant + {DEM}% type; see Table 3.1c instructions for valid values + {SEN}% dissemination level; see Table 3.1c instructions for valid values + {10}% delivery date (in months from beginning of project) + +\workpackage% + {dissemination}% Unique ID (used only for cross-referencing deliverables, etc. in LaTeX) + {Dissemination and exploitation}% Title + {UUF}% Lead partner (using short name ID) + {7}% Start month + {20}% End month + +\heinstructions{wp-objectives} +\begin{objectives} +\item First objective +\item Second objective +\item \dots +\end{objectives} + +\begin{descriptionofwork} +\heinstructions{wp-description} +\task + {Organise public workshop} % task name + {MSU} % short name of lead participant + {all participants} % other participants (or "all participants", etc.) + {7--10} % month(s) + In this task, we will unite the greatest minds\dots +\end{descriptionofwork} + +\deliverable + {proceedings} % deliverable name + {Workshop proceedings} % short description + {MSU} % short name of lead participant + {R}% type; see Table 3.1c instructions for valid values + {PU}% dissemination level; see Table 3.1c instructions for valid values + {11}% delivery date (in months from beginning of project) + +\subsubsection*{Table 3.1c: List of deliverables} + +\heinstructions{deliverables} + +\makedeliverablestable + +\heinstructions{deliverables-key} + +\subsubsection*{Table 3.1d: List of milestones} + +\milestone + {Define use cases} % milestone name + {WP1} % related work package(s) + {12} % month due + {expert review} % means of verification + +\milestone + {Minimum viable product (MVP)} % milestone name + {WP2} % related work package(s) + {20} % month due + {expert review} % means of verification + +\heinstructions{milestones} +\makemilestonestable + +\subsubsection*{Table 3.1e: Critical risks for implementation}[RSK-MGT-RM] + +\criticalrisk + {Datasets are not available} % description of risk + {Low} % Likelihood + {High} % Severity + {WP1, WP2} % Work package(s) involved + {We'll find new ones} % Proposed risk-mitigation measures + +\heinstructions{criticalrisks} +\makecriticalriskstable + +\subsubsection*{Table 3.1f: Summary of staff effort}[][RSK-MGT-RM] + +\staffeffort + {UUF} % short name of participant + {ra} % name of work package + {23} % number of person-months +\staffeffort{UUF}{integration}{6} +\staffeffort{UUF}{dissemination}{11} +\staffeffort{MSU}{ra}{18} +\staffeffort{MSU}{integration}{17} +\staffeffort{MSU}{dissemination}{1} +\staffeffort{IUBW}{ra}{21} +\staffeffort{IUBW}{integration}{14} +\staffeffort{IUBW}{dissemination}{5} + +\heinstructions{staffeffort} +\makestaffefforttable + +\subsubsection*{Table 3.1g: `Subcontracting costs' items} + +\heinstructions{subcontractingcosts} + +\subcontractingcost + {UUF} % short name of participant + {25000} % cost in euros + {Design project website} % description of tasks and justification + +\makesubcontractingcoststable + +\subsubsection*{Table 3.1h: `Purchase costs' items (travel and subsistence, equipment and other goods, works and services)} + +\heinstructions{purchasecosts} + +\purchasecost + {IUBW} % short name of participant + {6125} % travel cost in euros + {Attendance at two conferences} % justification + {2120} % equipment cost in euros + {Computing cluster} % justification + {4775} % other costs in euros + {Crowdsourcing study} % justification + {1000} % remaining costs + +\makepurchasecoststable + +\subsubsection*{Table 3.1i: `Other costs categories' items (e.g., internally invoiced goods and services)} + +\heinstructions{othercosts} + +\othercost + {UUF} % short name of participant + {500} % cost in euros + {Cookies for bribing reviewers} % justification +\othercost + {MSU} % short name of participant + {15000} % cost in euros + {Legal fees for defending bribery charges} % justification + +\makeothercoststable + +\subsubsection*{Table 3.1j: `In-kind contributions' provided by third parties} + +\inkindcontribution + {UUF} % short name of participant + {Freedonian Ministry of Education} % third party name + {Travel and subsistence} % category (see template instructions for list) + {300} % cost in euros + {Use of minister's private jet} % justification + +\heinstructions{inkind} +\makeinkindcontributionstable + +\subsection{Capacity of participants and consortium as a whole}[CON-SOR-CS,PRJ-MGT-PM][][3 pages]\label{sec:capacity} + +\heinstructions{capacity} + +\closetag{CON-SOR-CS,PRJ-MGT-PM} + +\closetag{QUA-LIT-QL,WRK-PLA-WP} + +\heinstructions{annexes} +\end{document} +% +% \fi +% \Finale diff --git a/macros/latex/contrib/heria/heria.ins b/macros/latex/contrib/heria/heria.ins new file mode 100644 index 0000000000..89b8b7f72c --- /dev/null +++ b/macros/latex/contrib/heria/heria.ins @@ -0,0 +1,92 @@ +%% +%% Copyright 2023 Tristan Miller +%% +%% 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 +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% + +\input docstrip.tex +\keepsilent + +\usedir{tex/latex/heria} + +\preamble + +This is a generated file. + +\endpreamble + +\generate{\file{heria.cls}{\from{heria.dtx}{class}}} +\generate{\file{heria-proposal.tex}{\from{heria.dtx}{heria-proposal}}} + +\generate{\file{hi-annexes.tex}{\from{heria.dtx}{hi-annexes}}} +\generate{\file{hi-capacity.tex}{\from{heria.dtx}{hi-capacity}}} +\generate{\file{hi-criticalrisks.tex}{\from{heria.dtx}{hi-criticalrisks}}} +\generate{\file{hi-deliverables-key.tex}{\from{heria.dtx}{hi-deliverables-key}}} +\generate{\file{hi-deliverables.tex}{\from{heria.dtx}{hi-deliverables}}} +\generate{\file{hi-excellence.tex}{\from{heria.dtx}{hi-excellence}}} +\generate{\file{hi-impact.tex}{\from{heria.dtx}{hi-impact}}} +\generate{\file{hi-inkind.tex}{\from{heria.dtx}{hi-inkind}}} +\generate{\file{hi-measures.tex}{\from{heria.dtx}{hi-measures}}} +\generate{\file{hi-methodology.tex}{\from{heria.dtx}{hi-methodology}}} +\generate{\file{hi-milestones.tex}{\from{heria.dtx}{hi-milestones}}} +\generate{\file{hi-objectives.tex}{\from{heria.dtx}{hi-objectives}}} +\generate{\file{hi-othercosts.tex}{\from{heria.dtx}{hi-othercosts}}} +\generate{\file{hi-participant-numbering.tex}{\from{heria.dtx}{hi-participant-numbering}}} +\generate{\file{hi-participants.tex}{\from{heria.dtx}{hi-participants}}} +\generate{\file{hi-pathways.tex}{\from{heria.dtx}{hi-pathways}}} +\generate{\file{hi-purchasecosts.tex}{\from{heria.dtx}{hi-purchasecosts}}} +\generate{\file{hi-quality.tex}{\from{heria.dtx}{hi-quality}}} +\generate{\file{hi-staffeffort.tex}{\from{heria.dtx}{hi-staffeffort}}} +\generate{\file{hi-subcontractingcosts.tex}{\from{heria.dtx}{hi-subcontractingcosts}}} +\generate{\file{hi-summary.tex}{\from{heria.dtx}{hi-summary}}} +\generate{\file{hi-tables.tex}{\from{heria.dtx}{hi-tables}}} +\generate{\file{hi-workplan.tex}{\from{heria.dtx}{hi-workplan}}} +\generate{\file{hi-wp-description.tex}{\from{heria.dtx}{hi-wp-description}}} +\generate{\file{hi-wp-objectives.tex}{\from{heria.dtx}{hi-wp-objectives}}} + +\Msg{*********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the} +\Msg{* following files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space heria.cls} +\Msg{* \space\space heria-proposal.tex} +\Msg{* \space\space hi-annexes.tex} +\Msg{* \space\space hi-capacity.tex} +\Msg{* \space\space hi-criticalrisks.tex} +\Msg{* \space\space hi-deliverables-key.tex} +\Msg{* \space\space hi-deliverables.tex} +\Msg{* \space\space hi-excellence.tex} +\Msg{* \space\space hi-impact.tex} +\Msg{* \space\space hi-inkind.tex} +\Msg{* \space\space hi-measures.tex} +\Msg{* \space\space hi-methodology.tex} +\Msg{* \space\space hi-milestones.tex} +\Msg{* \space\space hi-objectives.tex} +\Msg{* \space\space hi-othercosts.tex} +\Msg{* \space\space hi-participant-numbering.tex} +\Msg{* \space\space hi-participants.tex} +\Msg{* \space\space hi-pathways.tex} +\Msg{* \space\space hi-purchasecosts.tex} +\Msg{* \space\space hi-quality.tex} +\Msg{* \space\space hi-staffeffort.tex} +\Msg{* \space\space hi-subcontractingcosts.tex} +\Msg{* \space\space hi-summary.tex} +\Msg{* \space\space hi-tables.tex} +\Msg{* \space\space hi-workplan.tex} +\Msg{* \space\space hi-wp-description.tex} +\Msg{* \space\space hi-wp-objectives.tex} +\Msg{*} +\Msg{* To produce the documentation run the file heria.dtx} +\Msg{* through pdflatex.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*********************************************************} + +\endbatchfile \ No newline at end of file diff --git a/macros/latex/contrib/heria/heria.pdf b/macros/latex/contrib/heria/heria.pdf new file mode 100644 index 0000000000..af4f0cd627 Binary files /dev/null and b/macros/latex/contrib/heria/heria.pdf differ diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.dtx b/macros/latex/contrib/nicematrix/nicematrix-code.dtx index 63334d973f..3683787bcf 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-code.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix-code.dtx @@ -17,8 +17,8 @@ % % \fi % \iffalse -\def\myfileversion{6.26} -\def\myfiledate{2023/11/22} +\def\myfileversion{6.26a} +\def\myfiledate{2023/12/04} % % %<*batchfile> @@ -205,8 +205,8 @@ version 2005/12/01 or later. \bool_new:N \g_@@_messages_for_Overleaf_bool \bool_gset:Nn \g_@@_messages_for_Overleaf_bool { - \str_if_eq_p:Vn \c_sys_jobname_str { _region_ } % for Emacs - || \str_if_eq_p:Vn \c_sys_jobname_str { output } % for Overleaf + \str_if_eq_p:on \c_sys_jobname_str { _region_ } % for Emacs + || \str_if_eq_p:on \c_sys_jobname_str { output } % for Overleaf } % \end{macrocode} % @@ -370,6 +370,27 @@ version 2005/12/01 or later. % \bigskip % \section{Technical definitions} % +% +% The following constants are defined only for efficiency in the tests. +% \begin{macrocode} +\tl_const:Nn \c_@@_b_tl { b } +\tl_const:Nn \c_@@_c_tl { c } +\tl_const:Nn \c_@@_l_tl { l } +\tl_const:Nn \c_@@_r_tl { r } +\tl_const:Nn \c_@@_all_tl { all } +\tl_const:Nn \c_@@_dot_tl { . } +\tl_const:Nn \c_@@_default_tl { default } +\tl_const:Nn \c_@@_star_tl { * } +\str_const:Nn \c_@@_r_str { r } +\str_const:Nn \c_@@_c_str { c } +\str_const:Nn \c_@@_l_str { l } +\str_const:Nn \c_@@_R_str { R } +\str_const:Nn \c_@@_C_str { C } +\str_const:Nn \c_@@_L_str { L } +\str_const:Nn \c_@@_j_str { j } +\str_const:Nn \c_@@_si_str { si } +% \end{macrocode} +% % The following token list will be used for definitions of user commands (with % |\NewDocumentCommand|) with an embellishment using an \emph{underscore} (there % may be problems because of the catcode of the underscore). @@ -474,12 +495,12 @@ version 2005/12/01 or later. \mathinner { \tex_mkern:D 1 mu - \box_move_up:nn { 1 pt } { \hbox:n { . } } + \box_move_up:nn { 1 pt } { \hbox { . } } \tex_mkern:D 2 mu - \box_move_up:nn { 4 pt } { \hbox:n { . } } + \box_move_up:nn { 4 pt } { \hbox { . } } \tex_mkern:D 2 mu \box_move_up:nn { 7 pt } - { \vbox:n { \kern 7 pt \hbox:n { . } } } + { \vbox:n { \kern 7 pt \hbox { . } } } \tex_mkern:D 1 mu } } @@ -536,7 +557,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_nopar:Npn \CT@arc@ { \color #1 { #2 } } } } % \end{macrocode} % Idem for |\CT@drs@|. @@ -570,7 +591,8 @@ version 2005/12/01 or later. \cs_set:Npn \@@_standard_cline:w #1-#2 \q_stop { \int_if_zero:nT \l_@@_first_col_int { \omit & } - \int_compare:nNnT { #1 } > 1 { \multispan { \int_eval:n { #1 - 1 } } & } + \int_compare:nNnT { #1 } > \c_one_int + { \multispan { \int_eval:n { #1 - 1 } } & } \multispan { \int_eval:n { #2 - #1 + 1 } } { \CT@arc@ @@ -647,10 +669,10 @@ version 2005/12/01 or later. % % % \bigskip -% The following command is a small shortcut. +% The following command will be nullified in the environment |{NiceTabular}|, +% |{NiceTabular*}| and |{NiceTabularX}|. % \begin{macrocode} -\cs_new:Npn \@@_math_toggle_token: - { \bool_if:NF \l_@@_tabular_bool \c_math_toggle_token } +\cs_set_eq:NN \@@_math_toggle: \c_math_toggle_token % \end{macrocode} % % \bigskip @@ -664,7 +686,7 @@ version 2005/12/01 or later. { \cs_set:Npn \CT@arc@ { \color { #1 } } } } } -\cs_generate_variant:Nn \@@_set_CT@arc@:n { V } +\cs_generate_variant:Nn \@@_set_CT@arc@:n { o } % \end{macrocode} % % \bigskip @@ -675,7 +697,7 @@ version 2005/12/01 or later. { \cs_set:Npn \CT@drsc@ { \color #1 } } { \cs_set:Npn \CT@drsc@ { \color { #1 } } } } -\cs_generate_variant:Nn \@@_set_CT@drsc@:n { V } +\cs_generate_variant:Nn \@@_set_CT@drsc@:n { o } % \end{macrocode} % % \bigskip @@ -688,14 +710,14 @@ version 2005/12/01 or later. { #1 #2 } { #1 { #2 } } } -\cs_generate_variant:Nn \@@_exp_color_arg:Nn { N V } +\cs_generate_variant:Nn \@@_exp_color_arg:Nn { N o } % \end{macrocode} % % The following command must be protected because of its use of the command |\color|. % \begin{macrocode} \cs_new_protected:Npn \@@_color:n #1 { \tl_if_blank:nF { #1 } { \@@_exp_color_arg:Nn \color { #1 } } } -\cs_generate_variant:Nn \@@_color:n { V } +\cs_generate_variant:Nn \@@_color:n { o } % \end{macrocode} % % \bigskip @@ -776,10 +798,10 @@ version 2005/12/01 or later. \hook_gput_code:nnn { begindocument } { . } { \bool_if:NTF \c_@@_revtex_bool - { \cs_new_protected:Npn \@@_redefine_mkpream: { } } + { \cs_set_eq:NN \@@_redefine_mkpream: \prg_do_nothing: } { \IfPackageLoadedTF { arydshln } - { \cs_new_protected:Npn \@@_redefine_mkpream: { } } + { \cs_set_eq:NN \@@_redefine_mkpream: \prg_do_nothing: } { \cs_new_protected:Npn \@@_redefine_mkpream: { \cs_set_eq:NN \@mkpream \@@_mkpream: } @@ -954,9 +976,10 @@ version 2005/12/01 or later. % |r|, |l|, |c| and |j|. For example, a column |p[l]{3cm}| will provide the % value |l| for all the cells of the column. % \begin{macrocode} -\str_new:N \l_@@_hpos_cell_str -\str_set:Nn \l_@@_hpos_cell_str { c } +\tl_new:N \l_@@_hpos_cell_tl +\tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_c_tl % \end{macrocode} +% % % \bigskip % When there is a mono-column block (created by the command |\Block|), we want @@ -974,13 +997,6 @@ version 2005/12/01 or later. \dim_new:N \g_@@_blocks_ht_dim \dim_new:N \g_@@_blocks_dp_dim % \end{macrocode} -% -% \bigskip -% The following dimension will be used by the command |\Block| for the blocks -% with a key of vertical position equal to |T| or |B|. -% \begin{macrocode} -\dim_new:N \l_@@_block_ysep_dim -% \end{macrocode} % % \bigskip % The following dimension correspond to the key |width| (which may be fixed in @@ -1110,7 +1126,7 @@ version 2005/12/01 or later. % |matrix / columns-type| of |\NiceMatrixOptions|. % \begin{macrocode} \tl_new:N \l_@@_columns_type_tl -\tl_set:Nn \l_@@_columns_type_tl { c } +\str_set:Nn \l_@@_columns_type_tl { c } % \end{macrocode} % % \bigskip @@ -1201,15 +1217,6 @@ version 2005/12/01 or later. \tl_new:N \l_@@_pgf_node_code_tl % \end{macrocode} % -% \bigskip -% The following token list has a function similar to -% |\g_nicematrix_code_after_tl| but it is used internally by \pkg{nicematrix}. -% In fact, we have to distinguish between |\g_nicematrix_code_after_tl| and -% |\g_@@_pre_code_after_tl| because we must take care of the order in which -% instructions stored in that parameters are executed. -% \begin{macrocode} - -% \end{macrocode} % % \bigskip % The so-called |\CodeBefore| is splitted in two parts because we want to control @@ -1462,7 +1469,16 @@ version 2005/12/01 or later. \int_new:N \l_@@_col_min_int \int_new:N \l_@@_col_max_int % \end{macrocode} -% +% \medskip +% The following counters will be used when drawing the rules. +% \begin{macrocode} +\int_new:N \l_@@_start_int +\int_set_eq:NN \l_@@_start_int \c_one_int +\int_new:N \l_@@_end_int +\int_new:N \l_@@_local_start_int +\int_new:N \l_@@_local_end_int +% \end{macrocode} +% % \medskip % The following sequence will be used when the command |\SubMatrix| is used in % the |\CodeBefore| (and not in the |\CodeAfter|). It will contain the position of @@ -1552,8 +1568,8 @@ version 2005/12/01 or later. % \medskip % For the vertical position, the possible values are |c|, |t| and |b|. % \begin{macrocode} -\str_new:N \l_@@_vpos_of_block_str -\str_set:Nn \l_@@_vpos_of_block_str { c } +\str_new:N \l_@@_vpos_block_str +\str_set:Nn \l_@@_vpos_block_str { c } % \end{macrocode} % % @@ -1640,7 +1656,7 @@ version 2005/12/01 or later. % the value will be~$0$. % \begin{macrocode} \int_new:N \l_@@_first_col_int -\int_set:Nn \l_@@_first_col_int 1 +\int_set_eq:NN \l_@@_first_col_int \c_one_int % \end{macrocode} % % \medskip @@ -1720,8 +1736,8 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_set_protected:Npn \@@_cut_on_hyphen:w #1-#2\q_stop { - \tl_set:Nn \l_tmpa_tl { #1 } - \tl_set:Nn \l_tmpb_tl { #2 } + \cs_set_nopar:Npn \l_tmpa_tl { #1 } + \cs_set_nopar:Npn \l_tmpb_tl { #2 } } % \end{macrocode} % @@ -1733,7 +1749,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_expand_clist:N #1 { - \clist_if_in:NnF #1 { all } + \clist_if_in:NVF #1 \c_@@_all_tl { \clist_clear:N \l_tmpa_clist \clist_map_inline:Nn #1 @@ -1741,8 +1757,8 @@ version 2005/12/01 or later. \tl_if_in:nnTF { ##1 } { - } { \@@_cut_on_hyphen:w ##1 \q_stop } { - \tl_set:Nn \l_tmpa_tl { ##1 } - \tl_set:Nn \l_tmpb_tl { ##1 } + \cs_set_nopar:Npn \l_tmpa_tl { ##1 } + \cs_set_nopar:Npn \l_tmpb_tl { ##1 } } \int_step_inline:nnn { \l_tmpa_tl } { \l_tmpb_tl } { \clist_put_right:Nn \l_tmpa_clist { ####1 } } @@ -1929,14 +1945,15 @@ version 2005/12/01 or later. % \begin{macrocode} \NewDocumentCommand \tabularnote { o m } { - \bool_if:nT { \cs_if_exist_p:N \@captype || \l_@@_in_env_bool } + \bool_lazy_or:nnT { \cs_if_exist_p:N \@captype } \l_@@_in_env_bool { - \bool_if:nTF { ! \l_@@_tabular_bool && \l_@@_in_env_bool } + \bool_lazy_and:nnTF { ! \l_@@_tabular_bool } \l_@@_in_env_bool { \@@_error:n { tabularnote~forbidden } } { \bool_if:NTF \l_@@_in_caption_bool - { \@@_tabularnote_caption:nn { #1 } { #2 } } - { \@@_tabularnote:nn { #1 } { #2 } } + \@@_tabularnote_caption:nn + \@@_tabularnote:nn + { #1 } { #2 } } } } @@ -2017,7 +2034,7 @@ version 2005/12/01 or later. % labels of these tabular notes (in the array). We compose those labels in a box % |\l_tmpa_box| because we will do a special construction in order to have this % box in an overlapping position if we are at the end of a cell when -% |\l_@@_hpos_cell_str| is equal to |c| or |r|. +% |\l_@@_hpos_cell_tl| is equal to |c| or |r|. % \begin{macrocode} \hbox_set:Nn \l_tmpa_box { @@ -2034,15 +2051,15 @@ version 2005/12/01 or later. % \end{macrocode} % We want the (last) tabular note referenceable (with the standard command |\label|). % \begin{macrocode} - \int_gsub:Nn \c@tabularnote { 1 } + \int_gdecr:N \c@tabularnote \int_set_eq:NN \l_tmpa_int \c@tabularnote \refstepcounter { tabularnote } \int_compare:nNnT \l_tmpa_int = \c@tabularnote { \int_gincr:N \c@tabularnote } \seq_clear:N \l_@@_notes_labels_seq \bool_lazy_or:nnTF - { \str_if_eq_p:Vn \l_@@_hpos_cell_str { c } } - { \str_if_eq_p:Vn \l_@@_hpos_cell_str { r } } + { \tl_if_eq_p:NN \l_@@_hpos_cell_tl \c_@@_c_tl } + { \tl_if_eq_p:NN \l_@@_hpos_cell_tl \c_@@_r_tl } { \hbox_overlap_right:n { \box_use:N \l_tmpa_box } % \end{macrocode} @@ -2071,8 +2088,7 @@ version 2005/12/01 or later. { \bool_if:NTF \g_@@_caption_finished_bool { - \int_compare:nNnT - \c@tabularnote = \g_@@_notes_caption_int + \int_compare:nNnT \c@tabularnote = \g_@@_notes_caption_int { \int_gzero:N \c@tabularnote } % \end{macrocode} % Now, we try to detect duplicate notes in the caption. @@ -2354,10 +2370,10 @@ version 2005/12/01 or later. % \end{macrocode} % % \medskip -% The following flag corresponds to the key |respect-arraystretch| (that key has -% an effect on the blocks). +% When the key |respect-arraystretch| is used, the following command will be nullified. % \begin{macrocode} -\bool_new:N \l_@@_respect_arraystretch_bool +\cs_new_protected:Npn \@@_reset_arraystretch: + { \cs_set_nopar:Npn \arraystretch { 1 } } % \end{macrocode} % % @@ -2596,13 +2612,13 @@ version 2005/12/01 or later. hvlines .code:n = { \bool_set_true:N \l_@@_hvlines_bool - \clist_set:Nn \l_@@_vlines_clist { all } - \clist_set:Nn \l_@@_hlines_clist { all } + \tl_set_eq:NN \l_@@_vlines_clist \c_@@_all_tl + \tl_set_eq:NN \l_@@_hlines_clist \c_@@_all_tl } , hvlines-except-borders .code:n = { - \clist_set:Nn \l_@@_vlines_clist { all } - \clist_set:Nn \l_@@_hlines_clist { all } + \tl_set_eq:NN \l_@@_vlines_clist \c_@@_all_tl + \tl_set_eq:NN \l_@@_hlines_clist \c_@@_all_tl \bool_set_true:N \l_@@_hvlines_bool \bool_set_true:N \l_@@_except_borders_bool } , @@ -2632,8 +2648,9 @@ 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 , + respect-arraystretch .code:n = + \cs_set_eq:NN \@@_reset_arraystretch: \prg_do_nothing: , + respect-arraystretch .value_forbidden:n = true , pgf-node-code .tl_set:N = \l_@@_pgf_node_code_tl , pgf-node-code .value_required:n = true } @@ -3051,50 +3068,75 @@ version 2005/12/01 or later. % the |\everycr| because some packages, like \pkg{arydshln}, create special rows % in the |\halign| that we don't want to take into account. % \begin{macrocode} - \int_compare:nNnT \c@jCol = 1 - { \int_compare:nNnT \l_@@_first_col_int = 1 \@@_begin_of_row: } + \int_compare:nNnT \c@jCol = \c_one_int + { \int_compare:nNnT \l_@@_first_col_int = \c_one_int \@@_begin_of_row: } % \end{macrocode} % The content of the cell is composed in the box |\l_@@_cell_box|. The -% |\hbox_set_end:| corresponding to this |\hbox_set:Nw| will be in the -% |\@@_cell_end:| (and the potential |\c_math_toggle_token| also). +% |\hbox_set_end:| corresponding to this |\hbox_set:Nw| is in the +% |\@@_cell_end:|. % \begin{macrocode} \hbox_set:Nw \l_@@_cell_box - \bool_if:NF \l_@@_tabular_bool - { - \c_math_toggle_token - \bool_if:NT \l_@@_small_bool \scriptstyle - } +% \end{macrocode} +% The following command is nullified in the tabulars. +% \begin{macrocode} + \@@_tuning_not_tabular_begin: % \end{macrocode} % % \begin{macrocode} + \@@_tuning_first_row: + \@@_tuning_last_row: \g_@@_row_style_tl + } % \end{macrocode} -% -% We will call \emph{corners} of the matrix the cases which are at the -% intersection of the exterior rows and exterior columns (of course, the four -% corners doesn't always exist simultaneously). % -% The codes |\l_@@_code_for_first_row_tl| and \emph{al} don't apply in the -% corners of the matrix. +% The following command will be nullified unless there is a first row. % \begin{macrocode} - \int_if_zero:nTF \c@iRow +\cs_new_protected:Npn \@@_tuning_first_row: + { + \int_if_zero:nT \c@iRow { - \int_compare:nNnT \c@jCol > 0 + \int_compare:nNnT \c@jCol > \c_zero_int { \l_@@_code_for_first_row_tl \xglobal \colorlet { nicematrix-first-row } { . } } } + } +% \end{macrocode} +% +% The following command will be nullified unless there is a last row and we +% know its value (\emph{ie}: |\l_@@_lat_row_int > 0|). +% \begin{macrocode} +\cs_new_protected:Npn \@@_tuning_last_row: + { + \int_compare:nNnT \c@iRow = \l_@@_last_row_int { - \int_compare:nNnT \c@iRow = \l_@@_last_row_int - { - \l_@@_code_for_last_row_tl - \xglobal \colorlet { nicematrix-last-row } { . } - } + \l_@@_code_for_last_row_tl + \xglobal \colorlet { nicematrix-last-row } { . } } } % \end{macrocode} +% +% A different value will be provided to the following command when the key +% |small| is in force. +% \begin{macrocode} +\cs_set_eq:NN \@@_tuning_key_small: \prg_do_nothing: +% \end{macrocode} % +% The following commands are nullified in the tabulars. +% \begin{macrocode} +\cs_set_nopar:Npn \@@_tuning_not_tabular_begin: + { + \c_math_toggle_token +% \end{macrocode} +% A special value is provided by the following controls sequence when the key +% |small| is in force. +% \begin{macrocode} + \@@_tuning_key_small: + } +\cs_set_eq:NN \@@_tuning_not_tabular_end: \c_math_toggle_token +% \end{macrocode} +% % \interitem % The following macro |\@@_begin_of_row| is usually used in the cell % number~$1$ of the row. However, when the key |first-col| is used, @@ -3140,7 +3182,7 @@ version 2005/12/01 or later. { \dim_max:nn \g_@@_ht_row_zero_dim { \box_ht:N \l_@@_cell_box } } } { - \int_compare:nNnT \c@iRow = 1 + \int_compare:nNnT \c@iRow = \c_one_int { \dim_gset:Nn \g_@@_ht_row_one_dim { \dim_max:nn \g_@@_ht_row_one_dim { \box_ht:N \l_@@_cell_box } } @@ -3204,8 +3246,11 @@ version 2005/12/01 or later. % % \begin{macrocode} \cs_new_protected:Npn \@@_cell_end: - { - \@@_math_toggle_token: + { +% \end{macrocode} +% The following command is nullified in the tabulars. +% \begin{macrocode} + \@@_tuning_not_tabular_end: \hbox_set_end: \@@_cell_end_i: } @@ -3273,11 +3318,14 @@ version 2005/12/01 or later. \bool_if:NTF \g_@@_empty_cell_bool { \box_use_drop:N \l_@@_cell_box } { - \bool_lazy_or:nnTF + \bool_if:NTF \g_@@_not_empty_cell_bool - { \dim_compare_p:nNn { \box_wd:N \l_@@_cell_box } > \c_zero_dim } \@@_node_for_cell: - { \box_use_drop:N \l_@@_cell_box } + { + \dim_compare:nNnTF { \box_wd:N \l_@@_cell_box } > \c_zero_dim + \@@_node_for_cell: + { \box_use_drop:N \l_@@_cell_box } + } } \int_gset:Nn \g_@@_col_total_int { \int_max:nn \g_@@_col_total_int \c@jCol } \bool_gset_false:N \g_@@_empty_cell_bool @@ -3302,7 +3350,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_cell_end_for_w_s: { - \@@_math_toggle_token: + \@@_math_toggle: \hbox_set_end: \bool_if:NF \g_@@_rotate_bool { @@ -3569,7 +3617,7 @@ version 2005/12/01 or later. % \begin{macrocode} \tl_if_empty:NF \l_@@_hlines_clist { - \tl_if_eq:NnF \l_@@_hlines_clist { all } + \tl_if_eq:NNF \l_@@_hlines_clist \c_@@_all_tl { \exp_args:NNe \clist_if_in:NnT @@ -3704,6 +3752,10 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_set_nopar:Npn \arraystretch { 0.47 } \dim_set:Nn \arraycolsep { 1.45 pt } +% \end{macrocode} +% By default, |\@@_small_scripstyle:| is null. +% \begin{macrocode} + \cs_set_eq:NN \@@_tuning_key_small: \scriptstyle } % \end{macrocode} % @@ -3799,6 +3851,10 @@ version 2005/12/01 or later. \cs_set_eq:NN \rowcolor \@@_rowcolor_tabular \cs_set_eq:NN \rowcolors \@@_rowcolors_tabular \cs_set_eq:NN \rowlistcolors \@@_rowlistcolors_tabular + \int_compare:nNnT \l_@@_first_row_int > \c_zero_int + { \cs_set_eq:NN \@@_tuning_first_row: \prg_do_nothing: } + \int_compare:nNnT \l_@@_last_row_int < \c_zero_int + { \cs_set_eq:NN \@@_tuning_last_row: \prg_do_nothing: } \bool_if:NT \l_@@_renew_dots_bool \@@_renew_dots: % \end{macrocode} % We redefine |\multicolumn| and, since we want |\multicolumn| to be available @@ -4494,7 +4550,7 @@ version 2005/12/01 or later. % % \bigskip % \begin{macrocode} - \@@_set_CT@arc@:V \l_@@_rules_color_tl + \@@_set_CT@arc@:o \l_@@_rules_color_tl % \end{macrocode} % % \bigskip @@ -4540,7 +4596,7 @@ version 2005/12/01 or later. % |X|-column of weight~$n$, the width will be |\l_@@_X_columns_dim| multiplied % by~$n$. % \begin{macrocode} - \int_compare:nNnT \g_@@_total_X_weight_int > 0 + \int_compare:nNnT \g_@@_total_X_weight_int > \c_zero_int { \tl_build_gput_right:Nx \g_@@_aux_tl { @@ -4593,7 +4649,7 @@ version 2005/12/01 or later. % has the number~$0$.} % \begin{macrocode} \int_gset_eq:NN \c@jCol \g_@@_col_total_int - \bool_if:nTF \g_@@_last_col_found_bool + \bool_if:NTF \g_@@_last_col_found_bool { \int_gdecr:N \c@jCol } { \int_compare:nNnT \l_@@_last_col_int > { -1 } @@ -4617,10 +4673,7 @@ version 2005/12/01 or later. % p.~\pageref{overlap-left}). % \begin{macrocode} \int_if_zero:nT \l_@@_first_col_int - { - % \skip_horizontal:N \col@sep % 05-08-23 - \skip_horizontal:N \g_@@_width_first_col_dim - } + { \skip_horizontal:N \g_@@_width_first_col_dim } % \end{macrocode} % % The construction of the real box is different whether we have delimiters to @@ -4628,12 +4681,13 @@ version 2005/12/01 or later. % \begin{macrocode} \bool_if:nTF { ! \g_@@_delims_bool } { - \str_case:VnF \l_@@_baseline_tl - { - b \@@_use_arraybox_with_notes_b: - c \@@_use_arraybox_with_notes_c: + \tl_if_eq:NNTF \l_@@_baseline_tl \c_@@_c_tl + \@@_use_arraybox_with_notes_c: + { + \tl_if_eq:NNTF \l_@@_baseline_tl \c_@@_b_tl + \@@_use_arraybox_with_notes_b: + \@@_use_arraybox_with_notes: } - \@@_use_arraybox_with_notes: } % \end{macrocode} % @@ -4669,7 +4723,7 @@ version 2005/12/01 or later. \hbox_set:Nn \l_tmpa_box { \c_math_toggle_token - \@@_color:V \l_@@_delimiters_color_tl + \@@_color:o \l_@@_delimiters_color_tl \exp_after:wN \left \g_@@_left_delim_tl \vcenter { @@ -4692,14 +4746,9 @@ version 2005/12/01 or later. % We take into account the ``last row'' (we have previously computed its total % height in |\l_tmpb_dim|). % \begin{macrocode} - \skip_vertical:n { -\l_tmpb_dim + \arrayrulewidth } + \skip_vertical:N -\l_tmpb_dim + \skip_vertical:N \arrayrulewidth } -% \end{macrocode} -% Curiously, we have to put again the following specification of color. -% Otherwise, with XeLaTeX (and not with the other engines), the closing -% delimiter is not colored. -% \begin{macrocode} - \@@_color:V \l_@@_delimiters_color_tl \exp_after:wN \right \g_@@_right_delim_tl \c_math_toggle_token } @@ -4713,7 +4762,8 @@ version 2005/12/01 or later. \bool_if:NTF \l_@@_delimiters_max_width_bool { \@@_put_box_in_flow_bis:nn - \g_@@_left_delim_tl \g_@@_right_delim_tl + \g_@@_left_delim_tl + \g_@@_right_delim_tl } \@@_put_box_in_flow: } @@ -4724,10 +4774,7 @@ version 2005/12/01 or later. % |\g_@@_width_last_col_dim|: see p.~\pageref{overlap-right}). % \begin{macrocode} \bool_if:NT \g_@@_last_col_found_bool - { - \skip_horizontal:N \g_@@_width_last_col_dim - % \skip_horizontal:N \col@sep % 2023-08-05 - } + { \skip_horizontal:N \g_@@_width_last_col_dim } \bool_if:NT \l_@@_preamble_bool { \int_compare:nNnT \c@jCol < \g_@@_static_num_of_col_int @@ -4752,7 +4799,7 @@ version 2005/12/01 or later. \iow_now:Nx \@mainaux { \tl_gset:cn { c_@@_ \int_use:N \g_@@_env_int _ tl } - { \exp_not:V \g_@@_aux_tl } + { \exp_not:o \g_@@_aux_tl } } \iow_now:Nn \@mainaux { \ExplSyntaxOff } % \end{macrocode} @@ -4809,7 +4856,7 @@ version 2005/12/01 or later. % \begin{macrocode} \int_zero:N \l_tmpa_int \tl_gclear:N \g_@@_array_preamble_tl - \tl_if_eq:NnTF \l_@@_vlines_clist { all } + \tl_if_eq:NNTF \l_@@_vlines_clist \c_@@_all_tl { \tl_gset:Nn \g_@@_array_preamble_tl { ! { \skip_horizontal:N \arrayrulewidth } } @@ -4869,9 +4916,11 @@ version 2005/12/01 or later. % If there were delimiters at the beginning or at the end of the preamble, the % environment |{NiceArray}| is transformed into an environment |{xNiceMatrix}|. % \begin{macrocode} - \bool_lazy_or:nnT - { ! \str_if_eq_p:Vn \g_@@_left_delim_tl { . } } - { ! \str_if_eq_p:Vn \g_@@_right_delim_tl { . } } + \tl_if_eq:NNTF \g_@@_left_delim_tl \c_@@_dot_tl + { + \tl_if_eq:NNF \g_@@_right_delim_tl \c_@@_dot_tl + { \bool_gset_true:N \g_@@_delims_bool } + } { \bool_gset_true:N \g_@@_delims_bool } % \end{macrocode} % @@ -4885,28 +4934,34 @@ version 2005/12/01 or later. % We complete the preamble with the potential ``exterior columns'' (on both sides). % \begin{macrocode} \int_if_zero:nTF \l_@@_first_col_int - { \tl_gput_left:NV \g_@@_array_preamble_tl \c_@@_preamble_first_col_tl } + { \tl_gput_left:No \g_@@_array_preamble_tl \c_@@_preamble_first_col_tl } { - \bool_lazy_all:nT + \bool_if:NF \g_@@_delims_bool { - { \bool_not_p:n \g_@@_delims_bool } - { \bool_not_p:n \l_@@_tabular_bool } - { \tl_if_empty_p:N \l_@@_vlines_clist } - { \bool_not_p:n \l_@@_exterior_arraycolsep_bool } + \bool_if:NF \l_@@_tabular_bool + { + \tl_if_empty:NT \l_@@_vlines_clist + { + \bool_if:NF \l_@@_exterior_arraycolsep_bool + { \tl_gput_left:Nn \g_@@_array_preamble_tl { @ { } } } + } + } } - { \tl_gput_left:Nn \g_@@_array_preamble_tl { @ { } } } } \int_compare:nNnTF \l_@@_last_col_int > { -1 } - { \tl_gput_right:NV \g_@@_array_preamble_tl \c_@@_preamble_last_col_tl } + { \tl_gput_right:No \g_@@_array_preamble_tl \c_@@_preamble_last_col_tl } { - \bool_lazy_all:nT + \bool_if:NF \g_@@_delims_bool { - { \bool_not_p:n \g_@@_delims_bool } - { \bool_not_p:n \l_@@_tabular_bool } - { \tl_if_empty_p:N \l_@@_vlines_clist } - { \bool_not_p:n \l_@@_exterior_arraycolsep_bool } + \bool_if:NF \l_@@_tabular_bool + { + \tl_if_empty:NT \l_@@_vlines_clist + { + \bool_if:NF \l_@@_exterior_arraycolsep_bool + { \tl_gput_right:Nn \g_@@_array_preamble_tl { @ { } } } + } + } } - { \tl_gput_right:Nn \g_@@_array_preamble_tl { @ { } } } } % \end{macrocode} % We add a last column to raise a good error message when the user puts more @@ -4926,7 +4981,7 @@ version 2005/12/01 or later. % The preamble provided by the final user will be read by a finite % automata. The following function |\@@_rec_preamble:n| will read that preamble % (usually letter by letter) in a recursive way (hence the name of that function). -% in the preamble and +% in the preamble. % \begin{macrocode} \cs_new_protected:Npn \@@_rec_preamble:n #1 { @@ -4935,7 +4990,7 @@ version 2005/12/01 or later. % calling directly a function in the main hashtable of TeX (thanks to the % mechanism |\csname...\endcsname|. Be careful: all these functions take in as % first argument the letter (or token) itself.\footnote{We do that because it's -% a easy way to insert the letter at some places in the code that we will add to +% an easy way to insert the letter at some places in the code that we will add to % |\g_@@_array_preamble_tl|.} % \begin{macrocode} \cs_if_exist:cTF { @@ _ \token_to_str:N #1 } @@ -4965,23 +5020,47 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new:Npn \@@_c #1 { - \tl_gput_right:NV \g_@@_array_preamble_tl \g_@@_pre_cell_tl + \tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl + \tl_gclear:N \g_@@_pre_cell_tl + \tl_gput_right:Nn \g_@@_array_preamble_tl + { > \@@_cell_begin:w c < \@@_cell_end: } +% \end{macrocode} +% +% We increment the counter of columns and then we test for the presence of a |<|. +% \begin{macrocode} + \int_gincr:N \c@jCol + \@@_rec_preamble_after_col:n + } +% \end{macrocode} +% \begin{macrocode} +\cs_new:Npn \@@_l #1 + { + \tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl \tl_gclear:N \g_@@_pre_cell_tl \tl_gput_right:Nn \g_@@_array_preamble_tl { - > { \@@_cell_begin:w \str_set:Nn \l_@@_hpos_cell_str { #1 } } - #1 + > { \@@_cell_begin:w \tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_l_tl } + l < \@@_cell_end: } + \int_gincr:N \c@jCol + \@@_rec_preamble_after_col:n + } % \end{macrocode} -% -% We increment the counter of columns and then we test for the presence of a |<|. % \begin{macrocode} +\cs_new:Npn \@@_r #1 + { + \tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl + \tl_gclear:N \g_@@_pre_cell_tl + \tl_gput_right:Nn \g_@@_array_preamble_tl + { + > { \@@_cell_begin:w \tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_r_tl } + r + < \@@_cell_end: + } \int_gincr:N \c@jCol \@@_rec_preamble_after_col:n } -\cs_set_eq:NN \@@_l \@@_c -\cs_set_eq:NN \@@_r \@@_c % \end{macrocode} % % \medskip @@ -5081,37 +5160,37 @@ version 2005/12/01 or later. % \begin{macrocode} \keys_define:nn { WithArrows / p-column } { - r .code:n = \str_set:Nn \l_@@_hpos_col_str { r } , + r .code:n = \str_set_eq:NN \l_@@_hpos_col_str \c_@@_r_str , r .value_forbidden:n = true , - c .code:n = \str_set:Nn \l_@@_hpos_col_str { c } , + c .code:n = \str_set_eq:NN \l_@@_hpos_col_str \c_@@_c_str , c .value_forbidden:n = true , - l .code:n = \str_set:Nn \l_@@_hpos_col_str { l } , + l .code:n = \str_set_eq:NN \l_@@_hpos_col_str \c_@@_l_str , l .value_forbidden:n = true , R .code:n = \IfPackageLoadedTF { ragged2e } - { \str_set:Nn \l_@@_hpos_col_str { R } } + { \str_set_eq:NN \l_@@_hpos_col_str \c_@@_R_str } { \@@_error_or_warning:n { ragged2e~not~loaded } - \str_set:Nn \l_@@_hpos_col_str { r } + \str_set_eq:NN \l_@@_hpos_col_str \c_@@_r_str } , R .value_forbidden:n = true , L .code:n = \IfPackageLoadedTF { ragged2e } - { \str_set:Nn \l_@@_hpos_col_str { L } } + { \str_set_eq:NN \l_@@_hpos_col_str \c_@@_L_stsr } { \@@_error_or_warning:n { ragged2e~not~loaded } - \str_set:Nn \l_@@_hpos_col_str { l } + \str_set_eq:NN \l_@@_hpos_col_str \c_@@_l_str } , L .value_forbidden:n = true , C .code:n = \IfPackageLoadedTF { ragged2e } - { \str_set:Nn \l_@@_hpos_col_str { C } } + { \str_set_eq:NN \l_@@_hpos_col_str \c_@@_C_str } { \@@_error_or_warning:n { ragged2e~not~loaded } - \str_set:Nn \l_@@_hpos_col_str { c } + \str_set_eq:NN \l_@@_hpos_col_str \c_@@_c_str } , C .value_forbidden:n = true , - S .code:n = \str_set:Nn \l_@@_hpos_col_str { si } , + S .code:n = \str_set_eq:NN \l_@@_hpos_col_str \c_@@_si_str , S .value_forbidden:n = true , p .code:n = \str_set:Nn \l_@@_vpos_col_str { p } , p .value_forbidden:n = true , @@ -5167,9 +5246,9 @@ version 2005/12/01 or later. % the initial value), |l|, |c|, |r|, |L|, |C| and |R| (when the user has used % the corresponding key in the optional argument of the specifier). % \begin{macrocode} - \str_set:Nn \l_@@_hpos_col_str { j } - \tl_set:Nn \l_tmpa_tl { #1 } - \@@_keys_p_column:V \l_tmpa_tl + \str_set_eq:NN \l_@@_hpos_col_str \c_@@_j_str + % \tl_set:Nn \l_tmpa_tl { #1 } + \@@_keys_p_column:n { #1 } \@@_make_preamble_ii_iv:nnn { #2 } { minipage } { } } % \end{macrocode} @@ -5177,7 +5256,6 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_keys_p_column:n #1 { \keys_set_known:nnN { WithArrows / p-column } { #1 } \l_tmpa_tl } -\cs_generate_variant:Nn \@@_keys_p_column:n { V } % \end{macrocode} % % \medskip @@ -5190,22 +5268,22 @@ version 2005/12/01 or later. \use:e { \@@_make_preamble_ii_v:nnnnnnnn - { \str_if_eq:VnTF \l_@@_vpos_col_str { p } { t } { b } } + { \str_if_eq:onTF \l_@@_vpos_col_str { p } { t } { b } } { \dim_eval:n { #1 } } { % \end{macrocode} % The parameter |\l_@@_hpos_col_str| (as |\l_@@_vpos_col_str|) exists only % during the construction of the preamble. During the composition of the array -% itself, you will have, in each cell, the parameter |\l_@@_hpos_cell_str| which +% itself, you will have, in each cell, the parameter |\l_@@_hpos_cell_tl| which % will provide the horizontal alignment of the column to which belongs the cell. % \begin{macrocode} - \str_if_eq:VnTF \l_@@_hpos_col_str j - { \str_set:Nn \exp_not:N \l_@@_hpos_cell_str { } } + \str_if_eq:NNTF \l_@@_hpos_col_str \c_@@_j_str + { \tl_clear:N \exp_not:N \l_@@_hpos_cell_tl } { - \str_set:Nn \exp_not:N \l_@@_hpos_cell_str + \cs_set_nopar:Npn \exp_not:N \l_@@_hpos_cell_tl { \str_lowercase:V \l_@@_hpos_col_str } } - \str_case:Vn \l_@@_hpos_col_str + \str_case:on \l_@@_hpos_col_str { c { \exp_not:N \centering } l { \exp_not:N \raggedright } @@ -5216,12 +5294,12 @@ version 2005/12/01 or later. } #3 } - { \str_if_eq:VnT \l_@@_vpos_col_str { m } \@@_center_cell_box: } - { \str_if_eq:VnT \l_@@_hpos_col_str { si } \siunitx_cell_begin:w } - { \str_if_eq:VnT \l_@@_hpos_col_str { si } \siunitx_cell_end: } + { \str_if_eq:onT \l_@@_vpos_col_str { m } \@@_center_cell_box: } + { \str_if_eq:onT \l_@@_hpos_col_str { si } \siunitx_cell_begin:w } + { \str_if_eq:onT \l_@@_hpos_col_str { si } \siunitx_cell_end: } { #2 } { - \str_case:VnF \l_@@_hpos_col_str + \str_case:onF \l_@@_hpos_col_str { { j } { c } { si } { c } @@ -5251,7 +5329,7 @@ version 2005/12/01 or later. % % |#3| is the coding for the horizontal position of the content of the cell % (|\centering|, |\raggedright|, |\raggedleft| or nothing). It's also possible -% to put in that |#3| some code to fix the value of |\l_@@_hpos_cell_str| which +% to put in that |#3| some code to fix the value of |\l_@@_hpos_cell_tl| which % will be available in each cell of the column. % % |#4| is an extra-code which contains |\@@_center_cell_box:| (when the column @@ -5268,10 +5346,10 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_make_preamble_ii_v:nnnnnnnn #1 #2 #3 #4 #5 #6 #7 #8 { - \str_if_eq:VnTF \l_@@_hpos_col_str { si } + \tl_if_eq:NNTF \l_@@_hpos_col_str \c_@@_si_str { \tl_gput_right:Nn \g_@@_array_preamble_tl { > { \@@_test_if_empty_for_S: } } } { \tl_gput_right:Nn \g_@@_array_preamble_tl { > { \@@_test_if_empty: } } } - \tl_gput_right:NV \g_@@_array_preamble_tl \g_@@_pre_cell_tl + \tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl \tl_gclear:N \g_@@_pre_cell_tl \tl_gput_right:Nn \g_@@_array_preamble_tl { @@ -5430,9 +5508,8 @@ version 2005/12/01 or later. \cs_new_protected:Npn \@@_make_preamble_V_ii:nn #1 #2 { \str_set:Nn \l_@@_vpos_col_str { p } - \str_set:Nn \l_@@_hpos_col_str { j } - \tl_set:Nn \l_tmpa_tl { #1 } - \@@_keys_p_column:V \l_tmpa_tl + \str_set_eq:NN \l_@@_hpos_col_str \c_@@_j_str + \@@_keys_p_column:n { #1 } \IfPackageLoadedTF { varwidth } { \@@_make_preamble_ii_iv:nnn { #2 } { varwidth } { } } { @@ -5476,14 +5553,14 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_make_preamble_w_i:nnnn #1 #2 { - \tl_gput_right:NV \g_@@_array_preamble_tl \g_@@_pre_cell_tl + \tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl \tl_gclear:N \g_@@_pre_cell_tl \tl_gput_right:Nn \g_@@_array_preamble_tl { > { \dim_set:Nn \l_@@_col_width_dim { #2 } \@@_cell_begin:w - \str_set:Nn \l_@@_hpos_cell_str { c } + \tl_set_eq:NN \l_@@_hpos_cell_tl \c_@@_c_tl } c < { @@ -5504,7 +5581,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_make_preamble_w_ii:nnnn #1 #2 #3 #4 { - \tl_gput_right:NV \g_@@_array_preamble_tl \g_@@_pre_cell_tl + \tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl \tl_gclear:N \g_@@_pre_cell_tl \tl_gput_right:Nn \g_@@_array_preamble_tl { @@ -5517,7 +5594,7 @@ version 2005/12/01 or later. \dim_set:Nn \l_@@_col_width_dim { #4 } \hbox_set:Nw \l_@@_cell_box \@@_cell_begin:w - \str_set:Nn \l_@@_hpos_cell_str { #3 } + \cs_set_nopar:Npn \l_@@_hpos_cell_tl { #3 } } c < { @@ -5566,7 +5643,7 @@ version 2005/12/01 or later. { \IfPackageLoadedTF { siunitx } { - \tl_gput_right:NV \g_@@_array_preamble_tl \g_@@_pre_cell_tl + \tl_gput_right:No \g_@@_array_preamble_tl \g_@@_pre_cell_tl \tl_gclear:N \g_@@_pre_cell_tl \tl_gput_right:Nn \g_@@_array_preamble_tl { @@ -5601,14 +5678,14 @@ version 2005/12/01 or later. % \begin{macrocode} \int_if_zero:nTF \c@jCol { - \str_if_eq:VnTF \g_@@_left_delim_tl { . } + \tl_if_eq:NNTF \g_@@_left_delim_tl \c_@@_dot_tl { % \end{macrocode} % In that case, in fact, the first letter of the preamble must be considered as % the left delimiter of the array. % \begin{macrocode} \tl_gset:Nn \g_@@_left_delim_tl { #1 } - \tl_gset:Nn \g_@@_right_delim_tl { . } + \tl_gset_eq:NN \g_@@_right_delim_tl \c_@@_dot_tl \@@_rec_preamble:n #2 } { @@ -5657,7 +5734,7 @@ version 2005/12/01 or later. { \tl_if_eq:nnTF { \stop } { #2 } { - \str_if_eq:VnTF \g_@@_right_delim_tl { . } + \tl_if_eq:NNTF \g_@@_right_delim_tl \c_@@_dot_tl { \tl_gset:Nn \g_@@_right_delim_tl { #1 } } { \tl_gput_right:Nn \g_@@_array_preamble_tl { ! { \enskip } } @@ -5684,7 +5761,7 @@ version 2005/12/01 or later. { \tl_if_eq:nnTF { \stop } { #3 } { - \str_if_eq:VnTF \g_@@_right_delim_tl { . } + \tl_if_eq:NNTF \g_@@_right_delim_tl \c_@@_dot_tl { \tl_gput_right:Nn \g_@@_array_preamble_tl { ! { \enskip } } \tl_gput_right:Nx \g_@@_pre_code_after_tl @@ -5728,7 +5805,7 @@ version 2005/12/01 or later. \str_if_eq:nnTF { #1 } { @ } \@@_rec_preamble_after_col_ii:n { - \tl_if_eq:NnTF \l_@@_vlines_clist { all } + \tl_if_eq:NNTF \l_@@_vlines_clist \c_@@_all_tl { \tl_gput_right:Nn \g_@@_array_preamble_tl { ! { \skip_horizontal:N \arrayrulewidth } } @@ -5761,7 +5838,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_rec_preamble_after_col_ii:n #1 { - \tl_if_eq:NnTF \l_@@_vlines_clist { all } + \tl_if_eq:NNTF \l_@@_vlines_clist \c_@@_all_tl { \tl_gput_right:Nn \g_@@_array_preamble_tl { @ { #1 \skip_horizontal:N \arrayrulewidth } } @@ -5785,7 +5862,7 @@ version 2005/12/01 or later. { \tl_clear:N \l_tmpa_tl \int_step_inline:nn { #2 } { \tl_put_right:Nn \l_tmpa_tl { #3 } } - \exp_last_unbraced:NV \@@_rec_preamble:n \l_tmpa_tl + \exp_last_unbraced:No \@@_rec_preamble:n \l_tmpa_tl } % \end{macrocode} % @@ -5843,7 +5920,7 @@ version 2005/12/01 or later. % (when the user has used the corresponding key in the optional argument of the % specifier |X|). % \begin{macrocode} - \tl_set:Nn \l_@@_vpos_col_str { p } + \str_set:Nn \l_@@_vpos_col_str { p } % \end{macrocode} % % The integer |\l_@@_weight_int| will be the weight of the |X| column (the @@ -5853,11 +5930,13 @@ version 2005/12/01 or later. % of those columns as in \pkg{tabu} (now obsolete) or \pkg{tabularray}. % \begin{macrocode} \int_zero_new:N \l_@@_weight_int - \int_set:Nn \l_@@_weight_int { 1 } - \tl_set:Nn \l_tmpa_tl { #1 } - \@@_keys_p_column:V \l_tmpa_tl - \keys_set:nV { WithArrows / X-column } \l_tmpa_tl - \int_compare:nNnT \l_@@_weight_int < 0 + \int_set_eq:NN \l_@@_weight_int \c_one_int + \@@_keys_p_column:n { #1 } +% \end{macrocode} +% The unknown keys are put in |\l_tmpa_tl| +% \begin{macrocode} + \keys_set:no { WithArrows / X-column } \l_tmpa_tl + \int_compare:nNnT \l_@@_weight_int < \c_zero_int { \@@_error_or_warning:n { negative~weight } \int_set:Nn \l_@@_weight_int { - \l_@@_weight_int } @@ -5988,7 +6067,7 @@ version 2005/12/01 or later. % The following lines are an adaptation of the definition of |\multicolumn| in % \pkg{array}. % \begin{macrocode} - \exp_args:NV \@mkpream \g_@@_preamble_tl + \exp_args:No \@mkpream \g_@@_preamble_tl \@addtopreamble \@empty \endgroup % \end{macrocode} @@ -5997,7 +6076,7 @@ version 2005/12/01 or later. % Now, we do a treatment specific to \pkg{nicematrix} which has no equivalent % in the original definition of |\multicolumn|. % \begin{macrocode} - \int_compare:nNnT { #1 } > 1 + \int_compare:nNnT { #1 } > \c_one_int { \seq_gput_left:Nx \g_@@_multicolumn_cells_seq { \int_use:N \c@iRow - \int_eval:n { \c@jCol + 1 } } @@ -6067,7 +6146,7 @@ version 2005/12/01 or later. \cs_if_exist:cTF { NC @ find @ #1 } { \tl_set_eq:Nc \l_tmpa_tl { NC @ rewrite @ #1 } - \exp_last_unbraced:NV \@@_make_m_preamble:n \l_tmpa_tl + \exp_last_unbraced:No \@@_make_m_preamble:n \l_tmpa_tl } { \tl_if_eq:nnT { #1 } { S } @@ -6085,7 +6164,7 @@ version 2005/12/01 or later. { \tl_gput_right:Nn \g_@@_preamble_tl { - > { \@@_cell_begin:w \str_set:Nn \l_@@_hpos_cell_str { #1 } } + > { \@@_cell_begin:w \cs_set_nopar:Npn \l_@@_hpos_cell_tl { #1 } } #1 < \@@_cell_end: } @@ -6157,7 +6236,7 @@ version 2005/12/01 or later. \dim_set:Nn \l_@@_col_width_dim { #4 } \hbox_set:Nw \l_@@_cell_box \@@_cell_begin:w - \str_set:Nn \l_@@_hpos_cell_str { #3 } + \cs_set_nopar:Npn \l_@@_hpos_cell_tl { #3 } } c < { @@ -6210,12 +6289,14 @@ version 2005/12/01 or later. { \box_set_ht:Nn \l_tmpa_box { \box_ht:N \l_tmpa_box + \l_tmpa_dim } \box_set_dp:Nn \l_tmpa_box { \box_dp:N \l_tmpa_box + \l_tmpb_dim } - \tl_if_eq:NnTF \l_@@_baseline_tl { c } + \tl_if_eq:NNTF \l_@@_baseline_tl \c_@@_c_tl { \box_use_drop:N \l_tmpa_box } \@@_put_box_in_flow_i: } % \end{macrocode} % +% \bigskip +% % \medskip % The command |\@@_put_box_in_flow_i:| is used when the value of % |\l_@@_baseline_tl| is different of |c| (which is the initial value and the @@ -6233,30 +6314,31 @@ version 2005/12/01 or later. % Now, |\g_tmpa_dim| contains the $y$-value of the center of the array (the % delimiters are centered in relation with this value). % \begin{macrocode} - \str_if_in:NnTF \l_@@_baseline_tl { line- } + \tl_if_in:NnTF \l_@@_baseline_tl { line- } { \int_set:Nn \l_tmpa_int { \str_range:Nnn \l_@@_baseline_tl 6 - { \tl_count:V \l_@@_baseline_tl } + { \tl_count:o \l_@@_baseline_tl } } \@@_qpoint:n { row - \int_use:N \l_tmpa_int } } { - \str_case:VnF \l_@@_baseline_tl - { - { t } { \int_set:Nn \l_tmpa_int 1 } - { b } { \int_set_eq:NN \l_tmpa_int \c@iRow } + \tl_if_eq:NnTF \l_@@_baseline_tl { t } + { \int_set_eq:NN \l_tmpa_int \c_one_int } + { + \tl_if_eq:NnTF \l_@@_baseline_tl { b } + { \int_set_eq:NN \l_tmpa_int \c@iRow } + { \int_set:Nn \l_tmpa_int \l_@@_baseline_tl } } - { \int_set:Nn \l_tmpa_int \l_@@_baseline_tl } \bool_lazy_or:nnT { \int_compare_p:nNn \l_tmpa_int < \l_@@_first_row_int } { \int_compare_p:nNn \l_tmpa_int > \g_@@_row_total_int } { \@@_error:n { bad~value~for~baseline } - \int_set:Nn \l_tmpa_int 1 + \int_set_eq:NN \l_tmpa_int \c_one_int } \@@_qpoint:n { row - \int_use:N \l_tmpa_int - base } % \end{macrocode} @@ -6289,7 +6371,7 @@ version 2005/12/01 or later. % \begin{macrocode} \bool_if:NT \l_@@_NiceMatrix_without_vlines_bool { - \int_compare:nNnT \c@jCol > 1 % added 2023-08-13 + \int_compare:nNnT \c@jCol > \c_one_int { \box_set_wd:Nn \l_@@_the_array_box { \box_wd:N \l_@@_the_array_box - \arraycolsep } @@ -6315,7 +6397,7 @@ version 2005/12/01 or later. % tabular notes for which the command |\tabularnote| has been used without its % optional argument (between square brackets). % \begin{macrocode} - \int_compare:nNnT \g_@@_notes_caption_int > 0 + \int_compare:nNnT \g_@@_notes_caption_int > \c_zero_int { \tl_build_gput_right:Nx \g_@@_aux_tl { @@ -6353,7 +6435,7 @@ version 2005/12/01 or later. { { ! \seq_if_empty_p:N \g_@@_notes_seq } { ! \seq_if_empty_p:N \g_@@_notes_in_caption_seq } - { ! \tl_if_empty_p:V \g_@@_tabularnote_tl } + { ! \tl_if_empty_p:o \g_@@_tabularnote_tl } } \@@_insert_tabularnotes: \cs_set_eq:NN \tabularnote \@@_tabularnote_error:n @@ -6408,7 +6490,7 @@ version 2005/12/01 or later. % caption is composed only once. In that case, we fix the value of % |\g_@@_caption_finished_bool| now. % \begin{macrocode} - \bool_if:NF \g_@@_caption_finished_bool % added 2023/06/30 + \bool_if:NF \g_@@_caption_finished_bool { \bool_gset_true:N \g_@@_caption_finished_bool \int_gset_eq:NN \g_@@_notes_caption_int \c@tabularnote @@ -6449,7 +6531,7 @@ version 2005/12/01 or later. % the |\unskip| are designed to give the ability to put a |\bottomrule| at the % end of the notes with a good vertical space. % \begin{macrocode} - \int_compare:nNnT \c@tabularnote > 0 + \int_compare:nNnT \c@tabularnote > \c_zero_int { \bool_if:NTF \l_@@_notes_para_bool { @@ -6545,7 +6627,7 @@ version 2005/12/01 or later. % We convert a value of |t| to a value of |1|. % \begin{macrocode} \tl_if_eq:NnT \l_@@_baseline_tl { t } - { \tl_set:Nn \l_@@_baseline_tl { 1 } } + { \cs_set_nopar:Npn \l_@@_baseline_tl { 1 } } % \end{macrocode} % Now, we convert the value of |\l_@@_baseline_tl| (which should represent an % integer) to an integer stored in |\l_tmpa_int|. @@ -6560,7 +6642,7 @@ version 2005/12/01 or later. \str_range:Nnn \l_@@_baseline_tl 6 - { \tl_count:V \l_@@_baseline_tl } + { \tl_count:o \l_@@_baseline_tl } } \@@_qpoint:n { row - \int_use:N \l_tmpa_int } } @@ -6668,7 +6750,7 @@ version 2005/12/01 or later. % Here is the call to |\array| (we have a dedicated macro |\@@_array:| because % of compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}). % \begin{macrocode} - \exp_args:NV \@@_array: \g_@@_array_preamble_tl + \exp_args:No \@@_array: \g_@@_array_preamble_tl } } } @@ -6745,7 +6827,7 @@ version 2005/12/01 or later. % \begin{macrocode} \seq_pop_right:NN \l_@@_rows_seq \l_tmpa_tl \tl_if_empty:NF \l_tmpa_tl - { \seq_put_right:NV \l_@@_rows_seq \l_tmpa_tl } + { \seq_put_right:No \l_@@_rows_seq \l_tmpa_tl } % \end{macrocode} % If the environment uses the option |last-row| without value (i.e. without % saying the number of the rows), we have now the opportunity to compute that @@ -6769,7 +6851,7 @@ version 2005/12/01 or later. % First, we treat the first row. % \begin{macrocode} \seq_pop_left:NN \l_@@_rows_seq \l_tmpa_tl - \@@_line_with_light_syntax:V \l_tmpa_tl + \@@_line_with_light_syntax:o \l_tmpa_tl % \end{macrocode} % Now, the other rows (with the same treatment, excepted that we have to insert % |\\| between the rows). @@ -6802,7 +6884,7 @@ version 2005/12/01 or later. % |\@@_array:| because of compatibility with the classes \cls{revtex4-1} and % \cls{revtex4-2}). % \begin{macrocode} - \exp_args:NV \@@_array: \g_@@_array_preamble_tl \l_@@_new_body_tl + \exp_args:No \@@_array: \g_@@_array_preamble_tl \l_@@_new_body_tl } % \end{macrocode} % @@ -6818,11 +6900,11 @@ version 2005/12/01 or later. { \seq_count:N \l_@@_cells_seq } } \seq_pop_left:NN \l_@@_cells_seq \l_tmpa_tl - \exp_args:NNV \tl_build_put_right:Nn \l_@@_new_body_tl \l_tmpa_tl + \exp_args:NNo \tl_build_put_right:Nn \l_@@_new_body_tl \l_tmpa_tl \seq_map_inline:Nn \l_@@_cells_seq { \tl_build_put_right:Nn \l_@@_new_body_tl { & ##1 } } } -\cs_generate_variant:Nn \@@_line_with_light_syntax:n { V } +\cs_generate_variant:Nn \@@_line_with_light_syntax:n { o } % \end{macrocode} % % @@ -6833,7 +6915,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_analyze_end:Nn #1 #2 { - \str_if_eq:VnT \g_@@_name_env_str { #2 } + \str_if_eq:onT \g_@@_name_env_str { #2 } { \@@_fatal:n { empty~environment } } % \end{macrocode} % We reput in the stream the |\end{...}| we have extracted and the user will @@ -6962,10 +7044,10 @@ version 2005/12/01 or later. % We begin a loop over the columns. The integer |\g_tmpa_int| will be the % number of the current column. This integer is used for the Tikz nodes. % \begin{macrocode} - \int_gset:Nn \g_tmpa_int 1 + \int_gset_eq:NN \g_tmpa_int \c_one_int \bool_if:NTF \g_@@_last_col_found_bool - { \prg_replicate:nn { \int_max:nn { \g_@@_col_total_int - 3 } 0 } } - { \prg_replicate:nn { \int_max:nn { \g_@@_col_total_int - 2 } 0 } } + { \prg_replicate:nn { \int_max:nn { \g_@@_col_total_int - 3 } \c_zero_int } } + { \prg_replicate:nn { \int_max:nn { \g_@@_col_total_int - 2 } \c_zero_int } } { & \omit @@ -7010,17 +7092,17 @@ version 2005/12/01 or later. % 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 + \int_compare:nNnT \g_@@_col_total_int = \c_one_int { \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 + \bool_lazy_any:nT { - { \bool_not_p:n \g_@@_delims_bool } - { \bool_not_p:n \l_@@_tabular_bool } - { \clist_if_empty_p:N \l_@@_vlines_clist } - { \bool_not_p:n \l_@@_exterior_arraycolsep_bool } - { ! \l_@@_bar_at_end_of_pream_bool } + \g_@@_delims_bool + \l_@@_tabular_bool + { ! \clist_if_empty_p:N \l_@@_vlines_clist } + \l_@@_exterior_arraycolsep_bool + \l_@@_bar_at_end_of_pream_bool } { \skip_horizontal:N -\col@sep } \bool_if:NT \l_@@_code_before_bool @@ -7120,22 +7202,21 @@ version 2005/12/01 or later. % have to compute some dimensions of this box. % \begin{macrocode} \hbox_set:Nw \l_@@_cell_box - \@@_math_toggle_token: - \bool_if:NT \l_@@_small_bool \scriptstyle + \@@_math_toggle: + \@@_tuning_key_small: % \end{macrocode} % We insert |\l_@@_code_for_first_col_tl|... but we don't insert it in the % potential ``first row'' and in the potential ``last row''. % \begin{macrocode} - \bool_lazy_and:nnT - { \int_compare_p:nNn \c@iRow > 0 } + \int_compare:nNnT \c@iRow > \c_zero_int { - \bool_lazy_or_p:nn - { \int_compare_p:nNn \l_@@_last_row_int < 0 } + \bool_lazy_or:nnT + { \int_compare_p:nNn \l_@@_last_row_int < \c_zero_int } { \int_compare_p:nNn \c@iRow < \l_@@_last_row_int } - } - { - \l_@@_code_for_first_col_tl - \xglobal \colorlet { nicematrix-first-col } { . } + { + \l_@@_code_for_first_col_tl + \xglobal \colorlet { nicematrix-first-col } { . } + } } } % \end{macrocode} @@ -7145,7 +7226,7 @@ version 2005/12/01 or later. l < { - \@@_math_toggle_token: + \@@_math_toggle: \hbox_set_end: \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box: \@@_adjust_size_box: @@ -7202,16 +7283,16 @@ version 2005/12/01 or later. % have to compute some dimensions of this box. % \begin{macrocode} \hbox_set:Nw \l_@@_cell_box - \@@_math_toggle_token: - \bool_if:NT \l_@@_small_bool \scriptstyle + \@@_math_toggle: + \@@_tuning_key_small: % \end{macrocode} % We insert |\l_@@_code_for_last_col_tl|... but we don't insert it in the % potential ``first row'' and in the potential ``last row''. % \begin{macrocode} - \int_compare:nNnT \c@iRow > 0 + \int_compare:nNnT \c@iRow > \c_zero_int { \bool_lazy_or:nnT - { \int_compare_p:nNn \l_@@_last_row_int < 0 } + { \int_compare_p:nNn \l_@@_last_row_int < \c_zero_int } { \int_compare_p:nNn \c@iRow < \l_@@_last_row_int } { \l_@@_code_for_last_col_tl @@ -7222,7 +7303,7 @@ version 2005/12/01 or later. l < { - \@@_math_toggle_token: + \@@_math_toggle: \hbox_set_end: \bool_if:NT \g_@@_rotate_bool \@@_rotate_cell_box: \@@_adjust_size_box: @@ -7330,7 +7411,7 @@ version 2005/12/01 or later. { #2 } } \tl_set:Nn \l_tmpb_tl { \use:c { #1 NiceArray } } - \exp_args:NV \l_tmpb_tl \l_tmpa_tl + \exp_args:No \l_tmpb_tl \l_tmpa_tl } % \end{macrocode} % @@ -7426,13 +7507,22 @@ version 2005/12/01 or later. } } { } - \bool_set_true:N \l_@@_tabular_bool + \@@_settings_for_tabular: \NiceArray { #2 } } { \endNiceArray } % \end{macrocode} % -% +% \begin{macrocode} +\cs_new_protected:Npn \@@_settings_for_tabular: + { + \bool_set_true:N \l_@@_tabular_bool + \cs_set_eq:NN \@@_math_toggle: \prg_do_nothing: + \cs_set_eq:NN \@@_tuning_not_tabular_begin: \prg_do_nothing: + \cs_set_eq:NN \@@_tuning_not_tabular_end: \prg_do_nothing: + } +% \end{macrocode} +% % \bigskip % \begin{macrocode} \NewDocumentEnvironment { NiceTabularX } { m O { } m ! O { } } @@ -7441,7 +7531,7 @@ version 2005/12/01 or later. \dim_zero_new:N \l_@@_width_dim \dim_set:Nn \l_@@_width_dim { #1 } \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 } - \bool_set_true:N \l_@@_tabular_bool + \@@_settings_for_tabular: \NiceArray { #3 } } { @@ -7458,7 +7548,7 @@ version 2005/12/01 or later. \str_gset:Nn \g_@@_name_env_str { NiceTabular* } \dim_set:Nn \l_@@_tabular_width_dim { #1 } \keys_set:nn { NiceMatrix / NiceTabular } { #2 , #4 } - \bool_set_true:N \l_@@_tabular_bool + \@@_settings_for_tabular: \NiceArray { #3 } } { \endNiceArray } @@ -7755,7 +7845,7 @@ version 2005/12/01 or later. % potential ``argument'' with the command |\@@_CodeAfter_keys:|. % \begin{macrocode} \bool_set_true:N \l_@@_in_code_after_bool - \exp_last_unbraced:NV \@@_CodeAfter_keys: \g_nicematrix_code_after_tl + \exp_last_unbraced:No \@@_CodeAfter_keys: \g_nicematrix_code_after_tl \scan_stop: \tl_gclear:N \g_nicematrix_code_after_tl \group_end: @@ -7774,7 +7864,7 @@ version 2005/12/01 or later. \tl_build_gput_right:Nx \g_@@_aux_tl { \tl_gset:Nn \exp_not:N \g_@@_pre_code_before_tl - { \exp_not:V \g_@@_pre_code_before_tl } + { \exp_not:o \g_@@_pre_code_before_tl } } \tl_gclear:N \g_@@_pre_code_before_tl } @@ -7783,7 +7873,7 @@ version 2005/12/01 or later. \tl_build_gput_right:Nx \g_@@_aux_tl { \tl_gset:Nn \exp_not:N \g_@@_code_before_tl - { \exp_not:V \g_nicematrix_code_before_tl } + { \exp_not:o \g_nicematrix_code_before_tl } } \tl_gclear:N \g_nicematrix_code_before_tl } @@ -8042,7 +8132,7 @@ version 2005/12/01 or later. \bool_set_false:N \l_@@_final_open_bool \int_compare:nNnTF \l_@@_final_i_int > \l_@@_row_max_int { - \int_compare:nNnTF { #3 } = 1 + \int_compare:nNnTF { #3 } = \c_one_int { \bool_set_true:N \l_@@_final_open_bool } { \int_compare:nNnT \l_@@_final_j_int > \l_@@_col_max_int @@ -8058,7 +8148,7 @@ version 2005/12/01 or later. { \int_compare:nNnT \l_@@_final_j_int > \l_@@_col_max_int { - \int_compare:nNnT { #4 } = 1 + \int_compare:nNnT { #4 } = \c_one_int { \bool_set_true:N \l_@@_final_open_bool } } } @@ -8137,7 +8227,7 @@ version 2005/12/01 or later. \bool_set_false:N \l_@@_initial_open_bool \int_compare:nNnTF \l_@@_initial_i_int < \l_@@_row_min_int { - \int_compare:nNnTF { #3 } = 1 + \int_compare:nNnTF { #3 } = \c_one_int { \bool_set_true:N \l_@@_initial_open_bool } { \int_compare:nNnT \l_@@_initial_j_int = { \l_@@_col_min_int - 1 } @@ -8147,7 +8237,7 @@ version 2005/12/01 or later. { \int_compare:nNnTF \l_@@_initial_j_int < \l_@@_col_min_int { - \int_compare:nNnT { #4 } = 1 + \int_compare:nNnT { #4 } = \c_one_int { \bool_set_true:N \l_@@_initial_open_bool } } { @@ -8265,18 +8355,25 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_set_protected:Npn \@@_adjust_to_submatrix:nnnnnn #1 #2 #3 #4 #5 #6 { - \bool_if:nT + \int_compare:nNnF { #3 } > { #1 } { - \int_compare_p:n { #3 <= #1 } - && \int_compare_p:n { #1 <= #5 } - && \int_compare_p:n { #4 <= #2 } - && \int_compare_p:n { #2 <= #6 } - } - { - \int_set:Nn \l_@@_row_min_int { \int_max:nn \l_@@_row_min_int { #3 } } - \int_set:Nn \l_@@_col_min_int { \int_max:nn \l_@@_col_min_int { #4 } } - \int_set:Nn \l_@@_row_max_int { \int_min:nn \l_@@_row_max_int { #5 } } - \int_set:Nn \l_@@_col_max_int { \int_min:nn \l_@@_col_max_int { #6 } } + \int_compare:nNnF { #1 } > { #5 } + { + \int_compare:nNnF { #4 } > { #2 } + { + \int_compare:nNnF { #2 } > { #6 } + { + \int_set:Nn \l_@@_row_min_int + { \int_max:nn \l_@@_row_min_int { #3 } } + \int_set:Nn \l_@@_col_min_int + { \int_max:nn \l_@@_col_min_int { #4 } } + \int_set:Nn \l_@@_row_max_int + { \int_min:nn \l_@@_row_max_int { #5 } } + \int_set:Nn \l_@@_col_max_int + { \int_min:nn \l_@@_col_max_int { #6 } } + } + } + } } } % \end{macrocode} @@ -8407,7 +8504,7 @@ version 2005/12/01 or later. { \color { nicematrix-last-row } } } \keys_set:nn { NiceMatrix / xdots } { #3 } - \tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } + \tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } \@@_actually_draw_Ldots: \group_end: } @@ -8502,7 +8599,7 @@ version 2005/12/01 or later. { \color { nicematrix-last-row } } } \keys_set:nn { NiceMatrix / xdots } { #3 } - \tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } + \tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } \@@_actually_draw_Cdots: \group_end: } @@ -8566,7 +8663,6 @@ version 2005/12/01 or later. { \dim_max:nn \l_@@_y_initial_dim \pgf@y } } } - % modified 2023-08-10 \dim_compare:nNnT \l_@@_y_initial_dim = { - \c_max_dim } { \@@_qpoint:n { row - \int_use:N \l_@@_initial_i_int - base } @@ -8599,7 +8695,6 @@ version 2005/12/01 or later. { \dim_min:nn \l_@@_y_final_dim \pgf@y } } } - % modified 2023-08-10 \dim_compare:nNnT \l_@@_y_final_dim = \c_max_dim { \@@_qpoint:n { row - \int_use:N \l_@@_final_i_int - base } @@ -8632,7 +8727,7 @@ version 2005/12/01 or later. { \color { nicematrix-last-col } } } \keys_set:nn { NiceMatrix / xdots } { #3 } - \tl_if_empty:VF \l_@@_xdots_color_tl + \tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } \@@_actually_draw_Vdots: \group_end: @@ -8677,10 +8772,7 @@ version 2005/12/01 or later. \dim_set_eq:NN \l_@@_x_initial_dim \pgf@x \dim_sub:Nn \l_@@_x_initial_dim \l_@@_left_margin_dim \dim_sub:Nn \l_@@_x_initial_dim \l_@@_extra_left_margin_dim - % \bool_if:NT \g_@@_delims_bool - % { - \dim_sub:Nn \l_@@_x_initial_dim \c_@@_shift_exterior_Vdots_dim - % } + \dim_sub:Nn \l_@@_x_initial_dim \c_@@_shift_exterior_Vdots_dim } { \bool_lazy_and:nnTF @@ -8694,12 +8786,7 @@ version 2005/12/01 or later. \dim_set_eq:NN \l_@@_x_initial_dim \pgf@x \dim_add:Nn \l_@@_x_initial_dim \l_@@_right_margin_dim \dim_add:Nn \l_@@_x_initial_dim \l_@@_extra_right_margin_dim - % \bool_if:NT \g_@@_delims_bool - % { - \dim_add:Nn - \l_@@_x_initial_dim - \c_@@_shift_exterior_Vdots_dim - % } + \dim_add:Nn \l_@@_x_initial_dim \c_@@_shift_exterior_Vdots_dim } % \end{macrocode} % We have a dotted line open on both sides which is \emph{not} in an exterior column. @@ -8721,14 +8808,15 @@ version 2005/12/01 or later. % \begin{macrocode} { \bool_set_false:N \l_tmpa_bool - \bool_lazy_and:nnT - { ! \l_@@_initial_open_bool } - { ! \l_@@_final_open_bool } - { - \@@_set_initial_coords_from_anchor:n { south~west } - \@@_set_final_coords_from_anchor:n { north~west } - \bool_set:Nn \l_tmpa_bool - { \dim_compare_p:nNn \l_@@_x_initial_dim = \l_@@_x_final_dim } + \bool_if:NF \l_@@_initial_open_bool + { + \bool_if:NF \l_@@_final_open_bool + { + \@@_set_initial_coords_from_anchor:n { south~west } + \@@_set_final_coords_from_anchor:n { north~west } + \bool_set:Nn \l_tmpa_bool + { \dim_compare_p:nNn \l_@@_x_initial_dim = \l_@@_x_final_dim } + } } % \end{macrocode} % Now, we try to determine whether the column is of type |c| or may be @@ -8788,7 +8876,7 @@ version 2005/12/01 or later. \group_begin: \@@_open_shorten: \keys_set:nn { NiceMatrix / xdots } { #3 } - \tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } + \tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } \@@_actually_draw_Ddots: \group_end: } @@ -8833,7 +8921,7 @@ version 2005/12/01 or later. % We test if the diagonal line is the first one (the counter |\g_@@_ddots_int| % is created for this usage). % \begin{macrocode} - \int_compare:nNnTF \g_@@_ddots_int = 1 + \int_compare:nNnTF \g_@@_ddots_int = \c_one_int % \end{macrocode} % If the diagonal line is the first one, we have no adjustment of the line to do % but we store the $\Delta_x$ and the $\Delta_y$ of the line because these @@ -8883,7 +8971,7 @@ version 2005/12/01 or later. \group_begin: \@@_open_shorten: \keys_set:nn { NiceMatrix / xdots } { #3 } - \tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } + \tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } \@@_actually_draw_Iddots: \group_end: } @@ -8919,7 +9007,7 @@ version 2005/12/01 or later. \bool_if:NT \l_@@_parallelize_diags_bool { \int_gincr:N \g_@@_iddots_int - \int_compare:nNnTF \g_@@_iddots_int = 1 + \int_compare:nNnTF \g_@@_iddots_int = \c_one_int { \dim_gset:Nn \g_@@_delta_x_two_dim { \l_@@_x_final_dim - \l_@@_x_initial_dim } @@ -8970,7 +9058,7 @@ version 2005/12/01 or later. % \end{macrocode} % % \medskip -% We have to do a special construction with |\exp_args:NV| to be able to put in +% We have to do a special construction with |\exp_args:No| to be able to put in % the list of options in the correct place in the Tikz instruction. % \begin{macrocode} \cs_new_protected:Npn \@@_draw_unstandard_dotted_line: @@ -8988,7 +9076,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_draw_unstandard_dotted_line:n #1 { - \@@_draw_unstandard_dotted_line:nVVV + \@@_draw_unstandard_dotted_line:nooo { #1 } \l_@@_xdots_up_tl \l_@@_xdots_down_tl @@ -9048,53 +9136,31 @@ version 2005/12/01 or later. ) } } - \bool_lazy_and:nnT % security - { \dim_compare_p:nNn { \dim_abs:n \l_@@_l_dim } < \c_@@_max_l_dim } - { \dim_compare_p:nNn { \dim_abs:n \l_@@_l_dim } > { 1 pt } } +% \end{macrocode} +% It seems that, during the first compilations, the value of |\l_@@_l_dim| may +% be erroneous (equal to zero or very large). We must detect these cases +% because they would cause errors during the drawing of the dotted line. Maybe +% we should also write something in the |aux| file to say that one more +% compilation should be done. +% \begin{macrocode} + \dim_compare:nNnT \l_@@_l_dim < \c_@@_max_l_dim { - \dim_set:Nn \l_tmpa_dim - { - \l_@@_x_initial_dim - + ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) - * \dim_ratio:nn \l_@@_xdots_shorten_start_dim \l_@@_l_dim - } - \dim_set:Nn \l_tmpb_dim - { - \l_@@_y_initial_dim - + ( \l_@@_y_final_dim - \l_@@_y_initial_dim ) - * \dim_ratio:nn \l_@@_xdots_shorten_start_dim \l_@@_l_dim - } - \dim_set:Nn \l_@@_tmpc_dim - { - \l_@@_x_final_dim - - ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) - * \dim_ratio:nn \l_@@_xdots_shorten_end_dim \l_@@_l_dim - } - \dim_set:Nn \l_@@_tmpd_dim - { - \l_@@_y_final_dim - - ( \l_@@_y_final_dim - \l_@@_y_initial_dim ) - * \dim_ratio:nn \l_@@_xdots_shorten_end_dim \l_@@_l_dim - } - \dim_set_eq:NN \l_@@_x_initial_dim \l_tmpa_dim - \dim_set_eq:NN \l_@@_y_initial_dim \l_tmpb_dim - \dim_set_eq:NN \l_@@_x_final_dim \l_@@_tmpc_dim - \dim_set_eq:NN \l_@@_y_final_dim \l_@@_tmpd_dim + \dim_compare:nNnT \l_@@_l_dim > { 1 pt } + \@@_draw_unstandard_dotted_line_i: } % \end{macrocode} -% % % If the key |xdots/horizontal-labels| has been used. % \begin{macrocode} \bool_if:NT \l_@@_xdots_h_labels_bool - { - \tikzset - { - @@_node_above / .style = { auto = left } , - @@_node_below / .style = { auto = right } , - @@_node_middle / .style = { inner~sep = \c_@@_innersep_middle_dim } - } - } + { + \tikzset + { + @@_node_above / .style = { auto = left } , + @@_node_below / .style = { auto = right } , + @@_node_middle / .style = { inner~sep = \c_@@_innersep_middle_dim } + } + } \tl_if_empty:nF { #4 } { \tikzset { @@_node_middle / .append~style = { fill = white } } } \draw @@ -9111,7 +9177,44 @@ version 2005/12/01 or later. ( \l_@@_x_final_dim , \l_@@_y_final_dim ) ; \end { scope } } -\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:nnnn { n V V V } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_draw_unstandard_dotted_line_i: + { + \dim_set:Nn \l_tmpa_dim + { + \l_@@_x_initial_dim + + ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) + * \dim_ratio:nn \l_@@_xdots_shorten_start_dim \l_@@_l_dim + } + \dim_set:Nn \l_tmpb_dim + { + \l_@@_y_initial_dim + + ( \l_@@_y_final_dim - \l_@@_y_initial_dim ) + * \dim_ratio:nn \l_@@_xdots_shorten_start_dim \l_@@_l_dim + } + \dim_set:Nn \l_@@_tmpc_dim + { + \l_@@_x_final_dim + - ( \l_@@_x_final_dim - \l_@@_x_initial_dim ) + * \dim_ratio:nn \l_@@_xdots_shorten_end_dim \l_@@_l_dim + } + \dim_set:Nn \l_@@_tmpd_dim + { + \l_@@_y_final_dim + - ( \l_@@_y_final_dim - \l_@@_y_initial_dim ) + * \dim_ratio:nn \l_@@_xdots_shorten_end_dim \l_@@_l_dim + } + \dim_set_eq:NN \l_@@_x_initial_dim \l_tmpa_dim + \dim_set_eq:NN \l_@@_y_initial_dim \l_tmpb_dim + \dim_set_eq:NN \l_@@_x_final_dim \l_@@_tmpc_dim + \dim_set_eq:NN \l_@@_y_final_dim \l_@@_tmpd_dim + } +% \end{macrocode} +% +% \begin{macrocode} +\cs_generate_variant:Nn \@@_draw_unstandard_dotted_line:nnnn { n o o o } % \end{macrocode} % % \bigskip @@ -9145,10 +9248,11 @@ version 2005/12/01 or later. % we should also write something in the |aux| file to say that one more % compilation should be done. % \begin{macrocode} - \bool_lazy_or:nnF - { \dim_compare_p:nNn { \dim_abs:n \l_@@_l_dim } > \c_@@_max_l_dim } - { \dim_compare_p:nNn \l_@@_l_dim = \c_zero_dim } - \@@_draw_standard_dotted_line_i: + \dim_compare:nNnT \l_@@_l_dim < \c_@@_max_l_dim + { + \dim_compare:nNnT \l_@@_l_dim > { 1 pt } + \@@_draw_standard_dotted_line_i: + } \group_end: % \end{macrocode} % \begin{macrocode} @@ -9226,7 +9330,7 @@ version 2005/12/01 or later. { 2 \l_@@_l_dim } } \pgf@relevantforpicturesizefalse - \int_step_inline:nnn 0 \l_tmpa_int + \int_step_inline:nnn \c_zero_int \l_tmpa_int { \pgfpathcircle { \pgfpoint \l_@@_x_initial_dim \l_@@_y_initial_dim } @@ -9339,11 +9443,11 @@ version 2005/12/01 or later. % \begin{macrocode} \hook_gput_code:nnn { begindocument } { . } { - \tl_set:Nn \l_@@_argspec_tl { m E { _ ^ : } { { } { } { } } } - \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl + \cs_set_nopar:Npn \l_@@_argspec_tl { m E { _ ^ : } { { } { } { } } } + \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl \cs_new_protected:Npn \@@_Ldots { \@@_collect_options:n { \@@_Ldots_i } } - \exp_args:NNV \NewDocumentCommand \@@_Ldots_i \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_Ldots_i \l_@@_argspec_tl { \int_if_zero:nTF \c@jCol { \@@_error:nn { in~first~col } \Ldots } @@ -9365,7 +9469,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_Cdots { \@@_collect_options:n { \@@_Cdots_i } } - \exp_args:NNV \NewDocumentCommand \@@_Cdots_i \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_Cdots_i \l_@@_argspec_tl { \int_if_zero:nTF \c@jCol { \@@_error:nn { in~first~col } \Cdots } @@ -9387,7 +9491,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_Vdots { \@@_collect_options:n { \@@_Vdots_i } } - \exp_args:NNV \NewDocumentCommand \@@_Vdots_i \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_Vdots_i \l_@@_argspec_tl { \int_if_zero:nTF \c@iRow { \@@_error:nn { in~first~row } \Vdots } @@ -9410,7 +9514,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_Ddots { \@@_collect_options:n { \@@_Ddots_i } } - \exp_args:NNV \NewDocumentCommand \@@_Ddots_i \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_Ddots_i \l_@@_argspec_tl { \int_case:nnF \c@iRow { @@ -9440,7 +9544,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_Iddots { \@@_collect_options:n { \@@_Iddots_i } } - \exp_args:NNV \NewDocumentCommand \@@_Iddots_i \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_Iddots_i \l_@@_argspec_tl { \int_case:nnF \c@iRow { @@ -9536,7 +9640,7 @@ version 2005/12/01 or later. % \begin{macrocode} \hook_gput_code:nnn { begindocument } { . } { - \tl_set:Nn \l_@@_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } } + \cs_set_nopar:Npn \l_@@_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } } \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl % \end{macrocode} % We don't put |!| before the last optionnal argument for homogeneity with @@ -9544,7 +9648,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_Hdotsfor_i { \@@_collect_options:n { \@@_Hdotsfor_ii } } - \exp_args:NNV \NewDocumentCommand \@@_Hdotsfor_ii \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_Hdotsfor_ii \l_@@_argspec_tl { \tl_gput_right:Nx \g_@@_HVdotsfor_lines_tl { @@ -9563,7 +9667,7 @@ version 2005/12/01 or later. { & \multicolumn { 1 } { c } { } - \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i: % added 2023-08-26 + \cs_set_eq:NN \CodeAfter \@@_CodeAfter_i: } } } @@ -9583,9 +9687,9 @@ version 2005/12/01 or later. % \end{macrocode} % For the column, it's a bit more complicated. % \begin{macrocode} - \int_compare:nNnTF { #2 } = 1 + \int_compare:nNnTF { #2 } = \c_one_int { - \int_set:Nn \l_@@_initial_j_int 1 + \int_set_eq:NN \l_@@_initial_j_int \c_one_int \bool_set_true:N \l_@@_initial_open_bool } { @@ -9632,7 +9736,7 @@ version 2005/12/01 or later. } \keys_set:nn { NiceMatrix / xdots } { #4 } - \tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } + \tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } \@@_actually_draw_Ldots: \group_end: % \end{macrocode} @@ -9652,11 +9756,11 @@ version 2005/12/01 or later. % \begin{macrocode} \hook_gput_code:nnn { begindocument } { . } { - \tl_set:Nn \l_@@_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } } + \cs_set_nopar:Npn \l_@@_argspec_tl { m m O { } E { _ ^ : } { { } { } { } } } \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl \cs_new_protected:Npn \@@_Vdotsfor: { \@@_collect_options:n { \@@_Vdotsfor_i } } - \exp_args:NNV \NewDocumentCommand \@@_Vdotsfor_i \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_Vdotsfor_i \l_@@_argspec_tl { \bool_gset_true:N \g_@@_empty_cell_bool \tl_gput_right:Nx \g_@@_HVdotsfor_lines_tl @@ -9690,9 +9794,9 @@ version 2005/12/01 or later. % \end{macrocode} % For the row, it's a bit more complicated. % \begin{macrocode} - \int_compare:nNnTF { #1 } = 1 + \int_compare:nNnTF { #1 } = \c_one_int { - \int_set:Nn \l_@@_initial_i_int 1 + \int_set_eq:NN \l_@@_initial_i_int \c_one_int \bool_set_true:N \l_@@_initial_open_bool } { @@ -9738,7 +9842,7 @@ version 2005/12/01 or later. { \color { nicematrix-last-col } } } \keys_set:nn { NiceMatrix / xdots } { #4 } - \tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } + \tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } \@@_actually_draw_Vdots: \group_end: % \end{macrocode} @@ -9819,13 +9923,14 @@ version 2005/12/01 or later. % \begin{macrocode} \hook_gput_code:nnn { begindocument } { . } { - \tl_set:Nn \l_@@_argspec_tl { O { } m m ! O { } E { _ ^ : } { { } { } { } } } + \cs_set_nopar:Npn \l_@@_argspec_tl + { O { } m m ! O { } E { _ ^ : } { { } { } { } } } \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl - \exp_args:NNV \NewDocumentCommand \@@_line \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_line \l_@@_argspec_tl { \group_begin: \keys_set:nn { NiceMatrix / xdots } { #1 , #4 , down = #5 , up = #6 } - \tl_if_empty:VF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } + \tl_if_empty:oF \l_@@_xdots_color_tl { \color { \l_@@_xdots_color_tl } } \use:e { \@@_line_i:nn @@ -9842,15 +9947,10 @@ version 2005/12/01 or later. { \bool_set_false:N \l_@@_initial_open_bool \bool_set_false:N \l_@@_final_open_bool - \bool_if:nTF - { - \cs_if_free_p:c { pgf @ sh @ ns @ \@@_env: - #1 } - || - \cs_if_free_p:c { pgf @ sh @ ns @ \@@_env: - #2 } - } - { - \@@_error:nnn { unknown~cell~for~line~in~CodeAfter } { #1 } { #2 } - } + \bool_lazy_or:nnTF + { \cs_if_free_p:c { pgf @ sh @ ns @ \@@_env: - #1 } } + { \cs_if_free_p:c { pgf @ sh @ ns @ \@@_env: - #2 } } + { \@@_error:nnn { unknown~cell~for~line~in~CodeAfter } { #1 } { #2 } } % \end{macrocode} % The test of |measuring@| is a security (cf. question 686649 on TeX StackExchange). % \begin{macrocode} @@ -9922,7 +10022,7 @@ version 2005/12/01 or later. % |#1| is the first row \emph{after} the scope of the instructions in |#2| % \begin{macrocode} \cs_new:Npn \@@_if_row_less_than:nn #1 #2 - { \int_compare:nNnT { \int_use:N \c@iRow } < { #1 } { #2 } } + { \int_compare:nNnT \c@iRow < { #1 } { #2 } } % \end{macrocode} % % \bigskip @@ -9997,20 +10097,20 @@ version 2005/12/01 or later. \tl_gput_right:Nx \g_@@_pre_code_before_tl { % \end{macrocode} -% The command |\@@_exp_color_arg:NV| is \emph{fully expandable}. +% The command |\@@_exp_color_arg:No| is \emph{fully expandable}. % \begin{macrocode} - \@@_exp_color_arg:NV \@@_rectanglecolor \l_tmpa_tl + \@@_exp_color_arg:No \@@_rectanglecolor \l_tmpa_tl { \int_use:N \c@iRow - \int_use:N \c@jCol } { \int_use:N \c@iRow - * } } % \end{macrocode} % Then, the other rows (if there is several rows). % \begin{macrocode} - \int_compare:nNnT \l_@@_key_nb_rows_int > 1 + \int_compare:nNnT \l_@@_key_nb_rows_int > \c_one_int { \tl_gput_right:Nx \g_@@_pre_code_before_tl { - \@@_exp_color_arg:NV \@@_rowcolor \l_tmpa_tl + \@@_exp_color_arg:No \@@_rowcolor \l_tmpa_tl { \int_eval:n { \c@iRow + 1 } - \int_eval:n { \c@iRow + \l_@@_key_nb_rows_int - 1 } @@ -10241,7 +10341,7 @@ version 2005/12/01 or later. \@@_clip_with_rounded_corners: \seq_map_indexed_inline:Nn \g_@@_colors_seq { - \int_compare:nNnTF { ##1 } = 1 + \int_compare:nNnTF { ##1 } = \c_one_int { \cs_set_eq:NN \@@_cartesian_path:n \@@_cartesian_path_nocolor:n \use:c { g_@@_color _ 1 _tl } @@ -10285,7 +10385,7 @@ version 2005/12/01 or later. % \end{macrocode} % |\l_tmpa_tl| (if not empty) is now the opacity and |\l_tmpb_tl| (if not empty) is now the colorimetric space. % \begin{macrocode} - \tl_if_empty:NF \l_tmpa_tl { \exp_args:NV \pgfsetfillopacity \l_tmpa_tl } + \tl_if_empty:NF \l_tmpa_tl { \exp_args:No \pgfsetfillopacity \l_tmpa_tl } \tl_if_empty:NTF \l_tmpb_tl { \@declaredcolor } { \use:e { \exp_not:N \@undeclaredcolor [ \l_tmpb_tl ] } } @@ -10306,8 +10406,8 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_cartesian_color:nn #1 #2 { - \tl_set:Nn \l_@@_rows_tl { #1 } - \tl_set:Nn \l_@@_cols_tl { #2 } + \cs_set_nopar:Npn \l_@@_rows_tl { #1 } + \cs_set_nopar:Npn \l_@@_cols_tl { #2 } \@@_cartesian_path: } % \end{macrocode} @@ -10349,7 +10449,7 @@ version 2005/12/01 or later. { \@@_add_to_colors_seq:en { \tl_if_blank:nF { #1 } { [ #1 ] } { #2 } } - { \@@_rectanglecolor:nnn { #3 } { #4 } { 0 pt } } + { \@@_rectanglecolor:nnn { #3 } { #4 } { \c_zero_dim } } } } % \end{macrocode} @@ -10379,7 +10479,7 @@ version 2005/12/01 or later. \tl_set_eq:NN \l_@@_tmpc_tl \l_tmpa_tl \tl_set_eq:NN \l_@@_tmpd_tl \l_tmpb_tl \@@_cut_on_hyphen:w #2 \q_stop - \tl_set:Nx \l_@@_rows_tl { \l_@@_tmpc_tl - \l_tmpa_tl } + \tl_set:Nx \l_@@_rows_tl { \l_@@_tmpc_tl - \l_tmpa_tl } \tl_set:Nx \l_@@_cols_tl { \l_@@_tmpd_tl - \l_tmpb_tl } % \end{macrocode} % The command |\@@_cartesian_path:n| takes in two implicit arguments: @@ -10404,9 +10504,9 @@ version 2005/12/01 or later. % \begin{macrocode} \NewDocumentCommand \@@_chessboardcolors { O { } m m } { - \int_step_inline:nn { \int_use:N \c@iRow } + \int_step_inline:nn \c@iRow { - \int_step_inline:nn { \int_use:N \c@jCol } + \int_step_inline:nn \c@jCol { \int_if_even:nTF { ####1 + ##1 } { \@@_cellcolor [ #1 ] { #2 } } @@ -10468,14 +10568,14 @@ version 2005/12/01 or later. \seq_clear_new:N \l_@@_colors_seq \seq_set_split:Nnn \l_@@_colors_seq { , } { #3 } \tl_clear_new:N \l_@@_cols_tl - \tl_set:Nn \l_@@_cols_tl { - } + \cs_set_nopar:Npn \l_@@_cols_tl { - } \keys_set:nn { NiceMatrix / rowcolors } { #4 } % \end{macrocode} % The counter |\l_@@_color_int| will be the rank of the current color in the list of % colors (modulo the length of the list). % \begin{macrocode} \int_zero_new:N \l_@@_color_int - \int_set:Nn \l_@@_color_int 1 + \int_set_eq:NN \l_@@_color_int \c_one_int \bool_if:NT \l_@@_respect_blocks_bool { % \end{macrocode} @@ -10494,10 +10594,10 @@ version 2005/12/01 or later. % \begin{macrocode} \clist_map_inline:nn { #2 } { - \tl_set:Nn \l_tmpa_tl { ##1 } + \cs_set_nopar:Npn \l_tmpa_tl { ##1 } \tl_if_in:NnTF \l_tmpa_tl { - } { \@@_cut_on_hyphen:w ##1 \q_stop } - { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@iRow } } + { \tl_set:No \l_tmpb_tl { \int_use:N \c@iRow } } % \end{macrocode} % Now, |l_tmpa_tl| and |l_tmpb_tl| are the first row and the last row of the % interval of rows that we have to treat. The counter |\l_tmpa_int| will be the @@ -10527,7 +10627,7 @@ version 2005/12/01 or later. % Now, the last row of the block is computed in |\l_tmpb_int|. % \begin{macrocode} } - \tl_set:Nx \l_@@_rows_tl + \tl_set:No \l_@@_rows_tl { \int_use:N \l_tmpa_int - \int_use:N \l_tmpb_int } % \end{macrocode} % |\l_@@_tmpc_tl| will be the color that we will use. @@ -10595,11 +10695,13 @@ version 2005/12/01 or later. % \begin{macrocode} \prg_new_conditional:Nnn \@@_not_in_exterior:nnnnn p { - \bool_lazy_or:nnTF - { \int_if_zero_p:n { #4 } } - { \int_compare_p:nNn { #2 } = { \int_eval:n { \c@jCol + 1 } } } + \int_if_zero:nTF { #4 } \prg_return_false: - \prg_return_true: + { + \int_compare:nNnTF { #2 } > \c@jCol + \prg_return_false: + \prg_return_true: + } } % \end{macrocode} % @@ -10609,14 +10711,13 @@ version 2005/12/01 or later. % \begin{macrocode} \prg_new_conditional:Nnn \@@_intersect_our_row:nnnnn p { - \bool_if:nTF - { - \int_compare_p:n { #1 <= \l_tmpa_int } - && - \int_compare_p:n { \l_tmpa_int <= #3 } - } - \prg_return_true: + \int_compare:nNnTF { #1 } > \l_tmpa_int \prg_return_false: + { + \int_compare:nNnTF \l_tmpa_int > { #3 } + \prg_return_false: + \prg_return_true: + } } % \end{macrocode} % @@ -10628,50 +10729,62 @@ version 2005/12/01 or later. % below a command |\@@_cartesian_path:| which corresponds to a value $0$~pt for % the radius of the corners. % -% This command is in particular used in |\@@_rectanglecolor:nnn| (used in +% This command is, in particular, used in |\@@_rectanglecolor:nnn| (used in % |\@@_rectanglecolor|, itself used in |\@@_cellcolor|). % \begin{macrocode} \cs_new_protected:Npn \@@_cartesian_path_normal:n #1 { - \bool_lazy_any:nT + \dim_compare:nNnTF { #1 } = \c_zero_dim { - { ! \seq_if_empty_p:N \l_@@_corners_cells_seq } - { \dim_compare_p:nNn { #1 } = \c_zero_dim } - { ! \@@_nocolor_used_bool } + \bool_if:NTF + \@@_nocolor_used_bool + \@@_cartesian_path_normal_ii: + { + \seq_if_empty:NTF \l_@@_corners_cells_seq + { \@@_cartesian_path_normal_i:n { #1 } } + \@@_cartesian_path_normal_ii: + } } - { - \@@_expand_clist:NN \l_@@_cols_tl \c@jCol - \@@_expand_clist:NN \l_@@_rows_tl \c@iRow - } + { \@@_cartesian_path_normal_i:n { #1 } } + } +% \end{macrocode} +% +% +% \bigskip +% First, the situation where is a rectangular zone of cells will be colored as a +% whole (in the instructions of the resulting \textsc{pdf}). The argument is the +% radius of the corners. +% \begin{macrocode} +\cs_new_protected:Npn \@@_cartesian_path_normal_i:n #1 + { + \pgfsetcornersarced { \pgfpoint { #1 } { #1 } } % \end{macrocode} % We begin the loop over the columns. % \begin{macrocode} \clist_map_inline:Nn \l_@@_cols_tl { - \tl_set:Nn \l_tmpa_tl { ##1 } + \cs_set_nopar:Npn \l_tmpa_tl { ##1 } \tl_if_in:NnTF \l_tmpa_tl { - } { \@@_cut_on_hyphen:w ##1 \q_stop } { \@@_cut_on_hyphen:w ##1 - ##1 \q_stop } - \bool_lazy_or:nnT - { \tl_if_blank_p:V \l_tmpa_tl } - { \str_if_eq_p:Vn \l_tmpa_tl { * } } - { \tl_set:Nn \l_tmpa_tl { 1 } } - \bool_lazy_or:nnT - { \tl_if_blank_p:V \l_tmpb_tl } - { \str_if_eq_p:Vn \l_tmpb_tl { * } } - { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } + \tl_if_empty:NTF \l_tmpa_tl + { \cs_set_nopar:Npn \l_tmpa_tl { 1 } } + { + \tl_if_eq:NNT \l_tmpa_tl \c_@@_star_tl + { \cs_set_nopar:Npn \l_tmpa_tl { 1 } } + } + \tl_if_empty:NTF \l_tmpb_tl + { \tl_set:No \l_tmpb_tl { \int_use:N \c@jCol } } + { + \tl_if_eq:NNT \l_tmpb_tl \c_@@_star_tl + { \tl_set:No \l_tmpb_tl { \int_use:N \c@jCol } } + } \int_compare:nNnT \l_tmpb_tl > \g_@@_col_total_int - { \tl_set:Nx \l_tmpb_tl { \int_use:N \g_@@_col_total_int } } + { \tl_set:No \l_tmpb_tl { \int_use:N \g_@@_col_total_int } } % \end{macrocode} % |\l_@@_tmpc_tl| will contain the number of column. % \begin{macrocode} \tl_set_eq:NN \l_@@_tmpc_tl \l_tmpa_tl -% \end{macrocode} -% If we decide to provide the commands |\cellcolor|, |\rectanglecolor|, -% |\rowcolor|, |\columncolor|, |\rowcolors| and |\chessboardcolors| in the -% |code-before| of a |\SubMatrix|, we will have to modify the following line, by -% adding a kind of offset. We will have also some other lines to modify. -% \begin{macrocode} \@@_qpoint:n { col - \l_tmpa_tl } \int_compare:nNnTF \l_@@_first_col_int = \l_tmpa_tl { \dim_set:Nn \l_@@_tmpc_dim { \pgf@x - 0.5 \arrayrulewidth } } @@ -10683,28 +10796,76 @@ version 2005/12/01 or later. % \begin{macrocode} \clist_map_inline:Nn \l_@@_rows_tl { - \tl_set:Nn \l_tmpa_tl { ####1 } + \cs_set_nopar:Npn \l_tmpa_tl { ####1 } \tl_if_in:NnTF \l_tmpa_tl { - } { \@@_cut_on_hyphen:w ####1 \q_stop } { \@@_cut_on_hyphen:w ####1 - ####1 \q_stop } - \tl_if_empty:NT \l_tmpa_tl { \tl_set:Nn \l_tmpa_tl { 1 } } - \tl_if_empty:NT \l_tmpb_tl - { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@iRow } } + \tl_if_empty:NTF \l_tmpa_tl + { \cs_set_nopar:Npn \l_tmpa_tl { 1 } } + { + \tl_if_eq:NNT \l_tmpa_tl \c_@@_star_tl + { \cs_set_nopar:Npn \l_tmpa_tl { 1 } } + } + \tl_if_empty:NTF \l_tmpb_tl + { \tl_set:No \l_tmpb_tl { \int_use:N \c@iRow } } + { + \tl_if_eq:NNT \l_tmpb_tl \c_@@_star_tl + { \tl_set:No \l_tmpb_tl { \int_use:N \c@iRow } } + } \int_compare:nNnT \l_tmpb_tl > \g_@@_row_total_int - { \tl_set:Nx \l_tmpb_tl { \int_use:N \g_@@_row_total_int } } + { \tl_set:No \l_tmpb_tl { \int_use:N \g_@@_row_total_int } } % \end{macrocode} % Now, the numbers of both rows are in |\l_tmpa_tl| and |\l_tmpb_tl|. % \begin{macrocode} - \seq_if_in:NxF \l_@@_corners_cells_seq - { \l_tmpa_tl - \l_@@_tmpc_tl } + \cs_if_exist:cF + { @@ _ \l_tmpa_tl _ \l_@@_tmpc_tl _ nocolor } { \@@_qpoint:n { row - \int_eval:n { \l_tmpb_tl + 1 } } \dim_set:Nn \l_tmpb_dim { \pgf@y + 0.5 \arrayrulewidth } \@@_qpoint:n { row - \l_tmpa_tl } \dim_set:Nn \l_@@_tmpd_dim { \pgf@y + 0.5 \arrayrulewidth } - \pgfsetcornersarced { \pgfpoint { #1 } { #1 } } + \pgfpathrectanglecorners + { \pgfpoint \l_@@_tmpc_dim \l_@@_tmpd_dim } + { \pgfpoint \l_tmpa_dim \l_tmpb_dim } + } + } + } + } +% \end{macrocode} +% +% +% Now, the case where the cells will be colored cell by cell (it's mandatory for +% example if the key |corners| is used). +% \begin{macrocode} +\cs_new_protected:Npn \@@_cartesian_path_normal_ii: + { + \@@_expand_clist:NN \l_@@_cols_tl \c@jCol + \@@_expand_clist:NN \l_@@_rows_tl \c@iRow +% \end{macrocode} +% We begin the loop over the columns. +% \begin{macrocode} + \clist_map_inline:Nn \l_@@_cols_tl + { + \@@_qpoint:n { col - ##1 } + \int_compare:nNnTF \l_@@_first_col_int = { ##1 } + { \dim_set:Nn \l_@@_tmpc_dim { \pgf@x - 0.5 \arrayrulewidth } } + { \dim_set:Nn \l_@@_tmpc_dim { \pgf@x + 0.5 \arrayrulewidth } } + \@@_qpoint:n { col - \int_eval:n { ##1 + 1 } } + \dim_set:Nn \l_tmpa_dim { \pgf@x + 0.5 \arrayrulewidth } +% \end{macrocode} +% We begin the loop over the rows. +% \begin{macrocode} + \clist_map_inline:Nn \l_@@_rows_tl + { + \seq_if_in:NnF \l_@@_corners_cells_seq + { ####1 - ##1 } + { + \@@_qpoint:n { row - \int_eval:n { ####1 + 1 } } + \dim_set:Nn \l_tmpb_dim { \pgf@y + 0.5 \arrayrulewidth } + \@@_qpoint:n { row - ####1 } + \dim_set:Nn \l_@@_tmpd_dim { \pgf@y + 0.5 \arrayrulewidth } \cs_if_exist:cF - { @@ _ \l_tmpa_tl _ \l_@@_tmpc_tl _ nocolor } + { @@ _ ####1 _ ##1 _ nocolor } { \pgfpathrectanglecorners { \pgfpoint \l_@@_tmpc_dim \l_@@_tmpd_dim } @@ -10716,12 +10877,14 @@ version 2005/12/01 or later. } % \end{macrocode} % +% +% % \bigskip % The following command corresponds to a radius of the corners equal to $0$~pt. % This command is used by the commands |\@@_rowcolors|, |\@@_columncolor| and % |\@@_rowcolor:n| (used in |\@@_rowcolor|). % \begin{macrocode} -\cs_new_protected:Npn \@@_cartesian_path: { \@@_cartesian_path:n { 0 pt } } +\cs_new_protected:Npn \@@_cartesian_path: { \@@_cartesian_path:n \c_zero_dim } % \end{macrocode} % % @@ -10761,20 +10924,20 @@ version 2005/12/01 or later. \clist_clear:N #1 \clist_map_inline:Nn \l_tmpa_clist { - \tl_set:Nn \l_tmpa_tl { ##1 } + \cs_set_nopar:Npn \l_tmpa_tl { ##1 } \tl_if_in:NnTF \l_tmpa_tl { - } { \@@_cut_on_hyphen:w ##1 \q_stop } { \@@_cut_on_hyphen:w ##1 - ##1 \q_stop } \bool_lazy_or:nnT - { \tl_if_blank_p:V \l_tmpa_tl } - { \str_if_eq_p:Vn \l_tmpa_tl { * } } - { \tl_set:Nn \l_tmpa_tl { 1 } } + { \tl_if_blank_p:o \l_tmpa_tl } + { \str_if_eq_p:on \l_tmpa_tl { * } } + { \cs_set_nopar:Npn \l_tmpa_tl { 1 } } \bool_lazy_or:nnT - { \tl_if_blank_p:V \l_tmpb_tl } - { \str_if_eq_p:Vn \l_tmpb_tl { * } } - { \tl_set:Nx \l_tmpb_tl { \int_use:N #2 } } + { \tl_if_blank_p:o \l_tmpb_tl } + { \str_if_eq_p:on \l_tmpb_tl { * } } + { \tl_set:No \l_tmpb_tl { \int_use:N #2 } } \int_compare:nNnT \l_tmpb_tl > #2 - { \tl_set:Nx \l_tmpb_tl { \int_use:N #2 } } + { \tl_set:No \l_tmpb_tl { \int_use:N #2 } } \int_step_inline:nnn \l_tmpa_tl \l_tmpb_tl { \clist_put_right:Nn #1 { ####1 } } } @@ -11071,7 +11234,6 @@ version 2005/12/01 or later. position .int_set:N = \l_@@_position_int , position .value_required:n = true , start .int_set:N = \l_@@_start_int , - start .initial:n = 1 , end .code:n = \bool_lazy_or:nnTF { \tl_if_empty_p:n { #1 } } @@ -11140,7 +11302,6 @@ version 2005/12/01 or later. % 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} @@ -11157,14 +11318,12 @@ version 2005/12/01 or later. % \begin{macrocode} \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 { \int_eval:n \l_@@_position_int } + \tl_set:No \l_tmpb_tl { \int_use:N \l_@@_position_int } \int_step_variable:nnNn \l_@@_start_int \l_@@_end_int \l_tmpa_tl { @@ -11193,7 +11352,7 @@ version 2005/12/01 or later. { \int_set:Nn \l_@@_local_start_int \l_tmpa_tl } } { - \int_compare:nNnT \l_@@_local_start_int > 0 + \int_compare:nNnT \l_@@_local_start_int > \c_zero_int { \int_set:Nn \l_@@_local_end_int { \l_tmpa_tl - 1 } \@@_vline_ii: @@ -11201,7 +11360,7 @@ version 2005/12/01 or later. } } } - \int_compare:nNnT \l_@@_local_start_int > 0 + \int_compare:nNnT \l_@@_local_start_int > \c_zero_int { \int_set_eq:NN \l_@@_local_end_int \l_@@_end_int \@@_vline_ii: @@ -11225,7 +11384,7 @@ version 2005/12/01 or later. \l_@@_corners_cells_seq { \l_tmpa_tl - \l_tmpb_tl } { - \int_compare:nNnTF \l_tmpb_tl = 1 + \int_compare:nNnTF \l_tmpb_tl = \c_one_int { \bool_set_false:N \g_tmpa_bool } { \seq_if_in:NxT @@ -11278,9 +11437,9 @@ version 2005/12/01 or later. \dim_set_eq:NN \l_@@_tmpc_dim \pgf@y \bool_lazy_all:nT { - { \int_compare_p:nNn \l_@@_multiplicity_int > 1 } + { \int_compare_p:nNn \l_@@_multiplicity_int > \c_one_int } { \cs_if_exist_p:N \CT@drsc@ } - { ! \tl_if_blank_p:V \CT@drsc@ } + { ! \tl_if_blank_p:o \CT@drsc@ } } { \group_begin: @@ -11362,7 +11521,7 @@ version 2005/12/01 or later. \dim_set:Nn \l_tmpb_dim { \pgf@x - 0.5 \l_@@_rule_width_dim } \@@_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 + \exp_args:No \tikzset \l_@@_tikz_rule_tl \use:e { \exp_not:N \draw [ \l_@@_tikz_rule_tl ] } ( \l_tmpb_dim , \l_tmpa_dim ) -- ( \l_tmpb_dim , \l_@@_tmpc_dim ) ; @@ -11379,17 +11538,14 @@ version 2005/12/01 or later. \cs_new_protected:Npn \@@_draw_vlines: { \int_step_inline:nnn + { \bool_lazy_or:nnTF \g_@@_delims_bool \l_@@_except_borders_bool 2 1 } { - \bool_if:nTF { ! \g_@@_delims_bool && ! \l_@@_except_borders_bool } - 1 2 - } - { - \bool_if:nTF { ! \g_@@_delims_bool && ! \l_@@_except_borders_bool } - { \int_eval:n { \c@jCol + 1 } } + \bool_lazy_or:nnTF \g_@@_delims_bool \l_@@_except_borders_bool \c@jCol + { \int_eval:n { \c@jCol + 1 } } } { - \tl_if_eq:NnF \l_@@_vlines_clist { all } + \tl_if_eq:NNF \l_@@_vlines_clist \c_@@_all_tl { \clist_if_in:NnT \l_@@_vlines_clist { ##1 } } { \@@_vline:n { position = ##1 , total-width = \arrayrulewidth } } } @@ -11429,7 +11585,7 @@ version 2005/12/01 or later. % we have found a column corresponding to a rule to draw, we note its number in % |\l_@@_tmpc_tl|. % \begin{macrocode} - \tl_set:Nx \l_tmpa_tl { \int_use:N \l_@@_position_int } + \tl_set:No \l_tmpa_tl { \int_use:N \l_@@_position_int } \int_step_variable:nnNn \l_@@_start_int \l_@@_end_int \l_tmpb_tl { @@ -11458,7 +11614,7 @@ version 2005/12/01 or later. { \int_set:Nn \l_@@_local_start_int \l_tmpb_tl } } { - \int_compare:nNnT \l_@@_local_start_int > 0 + \int_compare:nNnT \l_@@_local_start_int > \c_zero_int { \int_set:Nn \l_@@_local_end_int { \l_tmpb_tl - 1 } \@@_hline_ii: @@ -11466,7 +11622,7 @@ version 2005/12/01 or later. } } } - \int_compare:nNnT \l_@@_local_start_int > 0 + \int_compare:nNnT \l_@@_local_start_int > \c_zero_int { \int_set_eq:NN \l_@@_local_end_int \l_@@_end_int \@@_hline_ii: @@ -11490,7 +11646,7 @@ version 2005/12/01 or later. \l_@@_corners_cells_seq { \l_tmpa_tl - \l_tmpb_tl } { - \int_compare:nNnTF \l_tmpa_tl = 1 + \int_compare:nNnTF \l_tmpa_tl = \c_one_int { \bool_set_false:N \g_tmpa_bool } { \seq_if_in:NxT @@ -11542,9 +11698,9 @@ version 2005/12/01 or later. \dim_set_eq:NN \l_@@_tmpc_dim \pgf@x \bool_lazy_all:nT { - { \int_compare_p:nNn \l_@@_multiplicity_int > 1 } + { \int_compare_p:nNn \l_@@_multiplicity_int > \c_one_int } { \cs_if_exist_p:N \CT@drsc@ } - { ! \tl_if_blank_p:V \CT@drsc@ } + { ! \tl_if_blank_p:o \CT@drsc@ } } { \group_begin: @@ -11634,7 +11790,7 @@ version 2005/12/01 or later. \dim_set_eq:NN \l_@@_y_final_dim \l_@@_y_initial_dim \@@_qpoint:n { col - \int_use:N \l_@@_local_start_int } \dim_set_eq:NN \l_@@_x_initial_dim \pgf@x - \int_compare:nNnT \l_@@_local_start_int = 1 + \int_compare:nNnT \l_@@_local_start_int = \c_one_int { \dim_sub:Nn \l_@@_x_initial_dim \l_@@_left_margin_dim \bool_if:NF \g_@@_delims_bool @@ -11688,7 +11844,7 @@ version 2005/12/01 or later. \dim_set:Nn \l_tmpb_dim { \pgf@y - 0.5 \l_@@_rule_width_dim } \@@_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 + \exp_args:No \tikzset \l_@@_tikz_rule_tl \use:e { \exp_not:N \draw [ \l_@@_tikz_rule_tl ] } ( \l_tmpa_dim , \l_tmpb_dim ) -- ( \l_@@_tmpc_dim , \l_tmpb_dim ) ; @@ -11705,17 +11861,14 @@ version 2005/12/01 or later. \cs_new_protected:Npn \@@_draw_hlines: { \int_step_inline:nnn + { \bool_lazy_or:nnTF \g_@@_delims_bool \l_@@_except_borders_bool 2 1 } { - \bool_if:nTF { ! \g_@@_delims_bool && ! \l_@@_except_borders_bool } - 1 2 - } - { - \bool_if:nTF { ! \g_@@_delims_bool && ! \l_@@_except_borders_bool } - { \int_eval:n { \c@iRow + 1 } } + \bool_lazy_or:nnTF \g_@@_delims_bool \l_@@_except_borders_bool \c@iRow + { \int_eval:n { \c@iRow + 1 } } } { - \tl_if_eq:NnF \l_@@_hlines_clist { all } + \tl_if_eq:NNF \l_@@_hlines_clist \c_@@_all_tl { \clist_if_in:NnT \l_@@_hlines_clist { ##1 } } { \@@_hline:n { position = ##1 , total-width = \arrayrulewidth } } } @@ -11759,7 +11912,7 @@ version 2005/12/01 or later. \cs_set:Npn \@@_Hline_iv:nn #1 #2 { \@@_compute_rule_width:n { multiplicity = #1 , #2 } - \skip_vertical:n { \l_@@_rule_width_dim } + \skip_vertical:N \l_@@_rule_width_dim \tl_gput_right:Nx \g_@@_pre_code_after_tl { \@@_hline:n @@ -11808,7 +11961,7 @@ version 2005/12/01 or later. { \str_if_empty_p:N \l_@@_ccommand_str } } { \@@_error:n { No~letter~and~no~command } } - { \exp_args:NV \@@_custom_line_i:n \l_@@_other_keys_tl } + { \exp_args:No \@@_custom_line_i:n \l_@@_other_keys_tl } } % \end{macrocode} % @@ -11847,12 +12000,11 @@ version 2005/12/01 or later. \bool_if:NT \l_@@_color_bool { \@@_error:n { color~in~custom-line~with~tikz } } } - \bool_if:nT + \bool_if:NT \l_@@_dotted_rule_bool { - \int_compare_p:nNn \l_@@_multiplicity_int > 1 - && \l_@@_dotted_rule_bool + \int_compare:nNnT \l_@@_multiplicity_int > \c_one_int + { \@@_error:n { key~multiplicity~with~dotted } } } - { \@@_error:n { key~multiplicity~with~dotted } } \str_if_empty:NF \l_@@_letter_str { \int_compare:nTF { \str_count:N \l_@@_letter_str != 1 } @@ -11953,7 +12105,7 @@ version 2005/12/01 or later. % |\noalign| (which is in |\Hline|). % \begin{macrocode} \cs_set:cpn { nicematrix - \l_@@_command_str } { \Hline [ #1 ] } - \seq_put_left:NV \l_@@_custom_line_commands_seq \l_@@_command_str + \seq_put_left:No \l_@@_custom_line_commands_seq \l_@@_command_str } % \end{macrocode} % @@ -11983,7 +12135,7 @@ version 2005/12/01 or later. { \@@_c_custom_line_i:nn { #1 , ##1 } { ####1 } } } } - \seq_put_left:NV \l_@@_custom_line_commands_seq \l_@@_ccommand_str + \seq_put_left:No \l_@@_custom_line_commands_seq \l_@@_ccommand_str } % \end{macrocode} % The first argument is the list of key-value pairs characteristic of the line. @@ -12072,14 +12224,17 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_test_hline_in_block:nnnnn #1 #2 #3 #4 #5 { - \bool_lazy_all:nT + \int_compare:nNnT \l_tmpa_tl > { #1 } { - { \int_compare_p:nNn \l_tmpa_tl > { #1 } } - { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } } - { \int_compare_p:nNn \l_tmpb_tl > { #2 - 1 } } - { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } } + \int_compare:nNnT \l_tmpa_tl < { #3 + 1 } + { + \int_compare:nNnT \l_tmpb_tl > { #2 - 1 } + { + \int_compare:nNnT \l_tmpb_tl < { #4 + 1 } + { \bool_gset_false:N \g_tmpa_bool } + } + } } - { \bool_gset_false:N \g_tmpa_bool } } % \end{macrocode} % @@ -12087,46 +12242,53 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_test_vline_in_block:nnnnn #1 #2 #3 #4 #5 { - \bool_lazy_all:nT - { - { \int_compare_p:nNn \l_tmpa_tl > { #1 - 1 } } - { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } } - { \int_compare_p:nNn \l_tmpb_tl > { #2 } } - { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } } + \int_compare:nNnT \l_tmpa_tl > { #1 - 1 } + { + \int_compare:nNnT \l_tmpa_tl < { #3 + 1 } + { + \int_compare:nNnT \l_tmpb_tl > { #2 } + { + \int_compare:nNnT \l_tmpb_tl < { #4 + 1 } + { \bool_gset_false:N \g_tmpa_bool } + } + } } - { \bool_gset_false:N \g_tmpa_bool } } % \end{macrocode} % % \begin{macrocode} \cs_new_protected:Npn \@@_test_hline_in_stroken_block:nnnn #1 #2 #3 #4 { - \bool_lazy_all:nT - { - { - ( \int_compare_p:nNn \l_tmpa_tl = { #1 } ) - || ( \int_compare_p:nNn \l_tmpa_tl = { #3 + 1 } ) - } - { \int_compare_p:nNn \l_tmpb_tl > { #2 - 1 } } - { \int_compare_p:nNn \l_tmpb_tl < { #4 + 1 } } + \int_compare:nNnT \l_tmpb_tl > { #2 - 1 } + { + \int_compare:nNnT \l_tmpb_tl < { #4 + 1 } + { + \int_compare:nNnTF \l_tmpa_tl = { #1 } + { \bool_gset_false:N \g_tmpa_bool } + { + \int_compare:nNnT \l_tmpa_tl = { #3 + 1 } + { \bool_gset_false:N \g_tmpa_bool } + } + } } - { \bool_gset_false:N \g_tmpa_bool } } % \end{macrocode} % % \begin{macrocode} \cs_new_protected:Npn \@@_test_vline_in_stroken_block:nnnn #1 #2 #3 #4 { - \bool_lazy_all:nT + \int_compare:nNnT \l_tmpa_tl > { #1 - 1 } { - { \int_compare_p:nNn \l_tmpa_tl > { #1 - 1 } } - { \int_compare_p:nNn \l_tmpa_tl < { #3 + 1 } } - { - ( \int_compare_p:nNn \l_tmpb_tl = { #2 } ) - || ( \int_compare_p:nNn \l_tmpb_tl = { #4 + 1 } ) - } + \int_compare:nNnT \l_tmpa_tl < { #3 + 1 } + { + \int_compare:nNnTF \l_tmpb_tl = { #2 } + { \bool_gset_false:N \g_tmpa_bool } + { + \int_compare:nNnT \l_tmpb_tl = { #4 + 1 } + { \bool_gset_false:N \g_tmpa_bool } + } + } } - { \bool_gset_false:N \g_tmpa_bool } } % \end{macrocode} % @@ -12301,15 +12463,15 @@ version 2005/12/01 or later. % % % \begin{macrocode} -\cs_new_protected:Npn \@@_test_if_cell_in_block:nnnnnnn #1 #2 #3 #4 #5 #6 #7 +\cs_set_protected:Npn \@@_test_if_cell_in_block:nnnnnnn #1 #2 #3 #4 #5 #6 #7 { - \int_compare:nNnT { #3 } < { \int_eval:n { #1 + 1 } } + \int_compare:nNnF { #3 } > { #1 } { - \int_compare:nNnT { #1 } < { \int_eval:n { #5 + 1 } } + \int_compare:nNnF { #1 } > { #5 } { - \int_compare:nNnT { #4 } < { \int_eval:n { #2 + 1 } } + \int_compare:nNnF { #4 } > { #2 } { - \int_compare:nNnT { #2 } < { \int_eval:n { #6 + 1 } } + \int_compare:nNnF { #2 } > { #6 } { \bool_set_true:N \l_tmpb_bool } } } @@ -12565,7 +12727,7 @@ version 2005/12/01 or later. % Now, we can create the ``medium nodes''. We use a command |\@@_create_nodes:| % because this command will also be used for the creation of the ``large nodes''. % \begin{macrocode} - \tl_set:Nn \l_@@_suffix_tl { -medium } + \cs_set_nopar:Npn \l_@@_suffix_tl { -medium } \@@_create_nodes: \endpgfpicture } @@ -12588,7 +12750,7 @@ version 2005/12/01 or later. \pgf@relevantforpicturesizefalse \@@_computations_for_medium_nodes: \@@_computations_for_large_nodes: - \tl_set:Nn \l_@@_suffix_tl { - large } + \cs_set_nopar:Npn \l_@@_suffix_tl { - large } \@@_create_nodes: \endpgfpicture } @@ -12605,10 +12767,10 @@ version 2005/12/01 or later. % Now, we can create the ``medium nodes''. We use a command |\@@_create_nodes:| % because this command will also be used for the creation of the ``large nodes''. % \begin{macrocode} - \tl_set:Nn \l_@@_suffix_tl { - medium } + \cs_set_nopar:Npn \l_@@_suffix_tl { - medium } \@@_create_nodes: \@@_computations_for_large_nodes: - \tl_set:Nn \l_@@_suffix_tl { - large } + \cs_set_nopar:Npn \l_@@_suffix_tl { - large } \@@_create_nodes: \endpgfpicture } @@ -12622,8 +12784,8 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_computations_for_large_nodes: { - \int_set:Nn \l_@@_first_row_int 1 - \int_set:Nn \l_@@_first_col_int 1 + \int_set_eq:NN \l_@@_first_row_int \c_one_int + \int_set_eq:NN \l_@@_first_col_int \c_one_int % \end{macrocode} % We have to change the values of all the dimensions % \texttt{l_@@_row_\textsl{i}_min_dim}, \texttt{l_@@_row_\textsl{i}_max_dim}, @@ -12777,13 +12939,13 @@ version 2005/12/01 or later. R .value_forbidden:n = true , C .code:n = \str_set:Nn \l_@@_hpos_block_str c , C .value_forbidden:n = true , - t .code:n = \str_set:Nn \l_@@_vpos_of_block_str t , + t .code:n = \str_set:Nn \l_@@_vpos_block_str t , t .value_forbidden:n = true , - T .code:n = \str_set:Nn \l_@@_vpos_of_block_str T , + T .code:n = \str_set:Nn \l_@@_vpos_block_str T , T .value_forbidden:n = true , - b .code:n = \str_set:Nn \l_@@_vpos_of_block_str b , + b .code:n = \str_set:Nn \l_@@_vpos_block_str b , b .value_forbidden:n = true , - B .code:n = \str_set:Nn \l_@@_vpos_of_block_str B , + B .code:n = \str_set:Nn \l_@@_vpos_block_str B , B .value_forbidden:n = true , color .code:n = \@@_color:n { #1 } @@ -12792,8 +12954,9 @@ version 2005/12/01 or later. { \char_set_catcode_other:N ! } { #1 } , color .value_required:n = true , - respect-arraystretch .bool_set:N = \l_@@_respect_arraystretch_bool , - respect-arraystretch .default:n = true + respect-arraystretch .code:n = + \cs_set_eq:NN \@@_reset_arraystretch: \prg_do_nothing: , + respect-arraystretch .value_forbidden:n = true , } % \end{macrocode} % @@ -12819,7 +12982,7 @@ version 2005/12/01 or later. \peek_remove_spaces:n { \tl_if_blank:nTF { #2 } - { \@@_Block_i 1-1 \q_stop } + { \@@_Block_ii:nnnnn \c_one_int \c_one_int } { \int_compare:nNnTF { \char_value_catcode:n { 45 } } = { 13 } \@@_Block_i_czech \@@_Block_i @@ -12882,13 +13045,13 @@ version 2005/12/01 or later. % \medskip % If the block is mono-column. % \begin{macrocode} - \int_compare:nNnTF \l_tmpb_int = 1 + \int_compare:nNnTF \l_tmpb_int = \c_one_int { - \str_if_empty:NTF \l_@@_hpos_cell_str - { \str_set:Nn \l_@@_hpos_block_str c } - { \str_set_eq:NN \l_@@_hpos_block_str \l_@@_hpos_cell_str } + \tl_if_empty:NTF \l_@@_hpos_cell_tl + { \str_set_eq:NN \l_@@_hpos_block_str \c_@@_c_str } + { \str_set:NV \l_@@_hpos_block_str \l_@@_hpos_cell_tl } } - { \str_set:Nn \l_@@_hpos_block_str c } + { \str_set_eq:NN \l_@@_hpos_block_str \c_@@_c_str } % \end{macrocode} % The value of |\l_@@_hpos_block_str| may be modified by the keys of the % command |\Block| that we will analyze now. @@ -12921,9 +13084,9 @@ version 2005/12/01 or later. \bool_if:nTF { ( - \int_compare_p:nNn { \l_tmpa_int } = 1 + \int_compare_p:nNn \l_tmpa_int = \c_one_int || - \int_compare_p:nNn { \l_tmpb_int } = 1 + \int_compare_p:nNn \l_tmpb_int = \c_one_int ) && ! \tl_if_empty_p:n { #5 } % \end{macrocode} @@ -12994,15 +13157,15 @@ version 2005/12/01 or later. % |\documentclass| with |\RequirePackage{expl3}|). % \begin{macrocode} \tl_if_empty:NTF \l_@@_color_tl - { \int_compare:nNnT { #2 } = 1 \set@color } - { \@@_color:V \l_@@_color_tl } + { \int_compare:nNnT { #2 } = \c_one_int \set@color } + { \@@_color:o \l_@@_color_tl } % \end{macrocode} % If the block is mono-row, we use |\g_@@_row_style_tl| even if it has yet been % used in the beginning of the cell where the command |\Block| has been issued % because we want to be able to take into account a potential instruction of % color of the font in |\g_@@_row_style_tl|. % \begin{macrocode} - \int_compare:nNnT { #1 } = 1 + \int_compare:nNnT { #1 } = \c_one_int { \int_if_zero:nTF \c@iRow \l_@@_code_for_first_row_tl @@ -13012,8 +13175,10 @@ version 2005/12/01 or later. } \g_@@_row_style_tl } - \bool_if:NF \l_@@_respect_arraystretch_bool - { \cs_set:Npn \arraystretch { 1 } } +% \end{macrocode} +% The following command will be no-op when |respect-arraystretch| is in force. +% \begin{macrocode} + \@@_reset_arraystretch: \dim_zero:N \extrarowheight % \end{macrocode} % |#4| is the optional argument of the command |\Block|, provided with the @@ -13039,12 +13204,12 @@ version 2005/12/01 or later. { \bool_lazy_all:nTF { - { \int_compare_p:nNn { #2 } = 1 } + { \int_compare_p:nNn { #2 } = \c_one_int } % \end{macrocode} % Remind that, when the column has not a fixed width, the dimension % |\l_@@_col_width_dim| has the conventional value of $-1$~cm. % \begin{macrocode} - { \dim_compare_p:n { \l_@@_col_width_dim >= \c_zero_dim } } + { ! \dim_compare_p:nNn \l_@@_col_width_dim < \c_zero_dim } { ! \g_@@_rotate_bool } } % \end{macrocode} @@ -13055,9 +13220,9 @@ version 2005/12/01 or later. \use:e { \exp_not:N \begin { minipage }% - [ \str_lowercase:V { \l_@@_vpos_of_block_str } ] + [ \str_lowercase:V \l_@@_vpos_block_str ] { \l_@@_col_width_dim } - \str_case:Vn \l_@@_hpos_block_str + \str_case:on \l_@@_hpos_block_str { c \centering r \raggedleft l \raggedright } } #5 @@ -13070,7 +13235,7 @@ version 2005/12/01 or later. \use:e { \exp_not:N \begin { tabular }% - [ \str_lowercase:V { \l_@@_vpos_of_block_str } ] + [ \str_lowercase:V \l_@@_vpos_block_str ] { @ { } \l_@@_hpos_block_str @ { } } } #5 @@ -13086,7 +13251,7 @@ version 2005/12/01 or later. \use:e { \exp_not:N \begin { array }% - [ \str_lowercase:V { \l_@@_vpos_of_block_str } ] + [ \str_lowercase:V \l_@@_vpos_block_str ] { @ { } \l_@@_hpos_block_str @ { } } } #5 @@ -13108,7 +13273,7 @@ version 2005/12/01 or later. % If we are in a mono-column block, we take into account the width of that block % for the width of the column. % \begin{macrocode} - \int_compare:nNnT { #2 } = 1 + \int_compare:nNnT { #2 } = \c_one_int { \dim_gset:Nn \g_@@_blocks_wd_dim { @@ -13129,9 +13294,9 @@ version 2005/12/01 or later. % |b| or |B|.}, we take into account the height and the depth of that block for the % height and the depth of the row. % \begin{macrocode} - \str_if_eq:VnT \l_@@_vpos_of_block_str { c } + \str_if_eq:VnT \l_@@_vpos_block_str { c } { - \int_compare:nNnT { #1 } = 1 + \int_compare:nNnT { #1 } = \c_one_int { \dim_gset:Nn \g_@@_blocks_ht_dim { @@ -13197,7 +13362,7 @@ version 2005/12/01 or later. \bool_if:NTF \g_@@_rotate_c_bool { c } { - \str_case:VnF \l_@@_vpos_of_block_str + \str_case:onF \l_@@_vpos_block_str { b l B l t r T r } { \int_compare:nNnTF \c@iRow = \l_@@_last_row_int r l } } @@ -13264,8 +13429,10 @@ version 2005/12/01 or later. \bool_if:NTF \l_@@_tabular_bool { \group_begin: - \bool_if:NF \l_@@_respect_arraystretch_bool - { \cs_set:Npn \exp_not:N \arraystretch { 1 } } +% \end{macrocode} +% The following command will be no-op when |respect-arraystretch| is in force. +% \begin{macrocode} + \@@_reset_arraystretch: \exp_not:n { \dim_zero:N \extrarowheight @@ -13278,10 +13445,9 @@ version 2005/12/01 or later. % the tabular is the same as the external alignment of the tabular (that is to % say the position of the block in its zone of merged cells). % \begin{macrocode} - % \@@_adjust_hpos_rotate: \use:e { - \exp_not:N \begin { tabular } [ \l_@@_vpos_of_block_str ] + \exp_not:N \begin { tabular } [ \l_@@_vpos_block_str ] { @ { } \l_@@_hpos_block_str @ { } } } #5 @@ -13294,17 +13460,18 @@ version 2005/12/01 or later. % \begin{macrocode} { \group_begin: - \bool_if:NF \l_@@_respect_arraystretch_bool - { \cs_set:Npn \exp_not:N \arraystretch { 1 } } +% \end{macrocode} +% The following will be no-op when |respect-arraystretch| is in force. +% \begin{macrocode} + \@@_reset_arraystretch: \exp_not:n { \dim_zero:N \extrarowheight #4 - % \@@_adjust_hpos_rotate: - \c_math_toggle_token % :n c + \c_math_toggle_token \use:e { - \exp_not:N \begin { array } [ \l_@@_vpos_of_block_str ] + \exp_not:N \begin { array } [ \l_@@_vpos_block_str ] { @ { } \l_@@_hpos_block_str @ { } } } #5 @@ -13376,16 +13543,18 @@ version 2005/12/01 or later. \bool_set_true:N \l_@@_hpos_of_block_cap_bool , C .code:n = \str_set:Nn \l_@@_hpos_block_str c \bool_set_true:N \l_@@_hpos_of_block_cap_bool , - t .code:n = \str_set:Nn \l_@@_vpos_of_block_str t , - T .code:n = \str_set:Nn \l_@@_vpos_of_block_str T , - b .code:n = \str_set:Nn \l_@@_vpos_of_block_str b , - B .code:n = \str_set:Nn \l_@@_vpos_of_block_str B , - v-center .code:n = \str_set:Nn \l_@@_vpos_of_block_str { c } , + t .code:n = \str_set:Nn \l_@@_vpos_block_str t , + T .code:n = \str_set:Nn \l_@@_vpos_block_str T , + b .code:n = \str_set:Nn \l_@@_vpos_block_str b , + B .code:n = \str_set:Nn \l_@@_vpos_block_str B , + v-center .code:n = \str_set:Nn \l_@@_vpos_block_str { c } , v-center .value_forbidden:n = true , name .tl_set:N = \l_@@_block_name_str , name .value_required:n = true , name .initial:n = , - respect-arraystretch .bool_set:N = \l_@@_respect_arraystretch_bool , + respect-arraystretch .code:n = + \cs_set_eq:NN \@@_reset_arraystretch: \prg_do_nothing: , + respect-arraystretch .value_forbidden:n = true , transparent .bool_set:N = \l_@@_transparent_bool , transparent .default:n = true , transparent .initial:n = false , @@ -13435,10 +13604,7 @@ version 2005/12/01 or later. { \bool_lazy_and:nnTF \l_@@_preamble_bool - { - \int_compare_p:n - { \l_@@_last_col_int <= \g_@@_static_num_of_col_int } - } + { \int_compare_p:nNnF \l_@@_last_col_int > \g_@@_static_num_of_col_int } { \msg_error:nnnn { nicematrix } { Block~too~large~2 } { #1 } { #2 } \@@_msg_redirect_name:nn { Block~too~large~2 } { none } @@ -13471,7 +13637,7 @@ version 2005/12/01 or later. % \begin{macrocode} \group_begin: \int_compare:nNnT { #1 } = { #3 } - { \str_set:Nn \l_@@_vpos_of_block_str { t } } + { \str_set:Nn \l_@@_vpos_block_str { t } } \keys_set:nn { NiceMatrix / Block / SecondPass } { #5 } % \end{macrocode} % @@ -13496,28 +13662,28 @@ version 2005/12/01 or later. { \int_use:N \l_@@_last_row_int - \int_use:N \l_@@_last_col_int } } } - \bool_if:nF + \bool_if:NF \l_@@_transparent_bool { - \l_@@_transparent_bool - || ( \l_@@_vlines_block_bool && \l_@@_hlines_block_bool ) - } - { + \bool_lazy_and:nnF \l_@@_vlines_block_bool \l_@@_hlines_block_bool + { % \end{macrocode} % The sequence of the positions of the blocks (excepted the blocks with the key % |hvlines|) will be used when drawing the rules (in fact, there is also the % |\multicolumn| and the |\diagbox| in that sequence). % \begin{macrocode} - \seq_gput_left:Nx \g_@@_pos_of_blocks_seq - { { #1 } { #2 } { #3 } { #4 } { \l_@@_block_name_str } } + \seq_gput_left:Nx \g_@@_pos_of_blocks_seq + { { #1 } { #2 } { #3 } { #4 } { \l_@@_block_name_str } } + } } % \end{macrocode} % % \bigskip % \begin{macrocode} - \bool_lazy_and:nnT - { ! (\tl_if_empty_p:N \l_@@_draw_tl) } - { \l_@@_hlines_block_bool || \l_@@_vlines_block_bool } - { \@@_error:n { hlines~with~color } } + \tl_if_empty:NF \l_@@_draw_tl + { + \bool_lazy_or:nnT \l_@@_hlines_block_bool \l_@@_vlines_block_bool + { \@@_error:n { hlines~with~color } } + } % \end{macrocode} % \bigskip % \begin{macrocode} @@ -13558,7 +13724,7 @@ version 2005/12/01 or later. \tl_set:Nx \l_@@_fill_tl { [ opacity = \l_@@_opacity_tl , - \tl_tail:V \l_@@_fill_tl + \tl_tail:o \l_@@_fill_tl } } { @@ -13569,7 +13735,7 @@ version 2005/12/01 or later. \tl_gput_right:Nx \g_@@_pre_code_before_tl { \exp_not:N \roundedrectanglecolor - \exp_args:NV \tl_if_head_eq_meaning:nNTF \l_@@_fill_tl [ + \exp_args:No \tl_if_head_eq_meaning:nNTF \l_@@_fill_tl [ { \l_@@_fill_tl } { { \l_@@_fill_tl } } { #1 - #2 } @@ -13796,9 +13962,9 @@ version 2005/12/01 or later. % \begin{macrocode} \bool_lazy_any:nTF { - { \str_if_eq_p:Vn \l_@@_vpos_of_block_str { c } } - { \str_if_eq_p:Vn \l_@@_vpos_of_block_str { T } } - { \str_if_eq_p:Vn \l_@@_vpos_of_block_str { B } } + { \str_if_eq_p:on \l_@@_vpos_block_str { c } } + { \str_if_eq_p:on \l_@@_vpos_block_str { T } } + { \str_if_eq_p:on \l_@@_vpos_block_str { B } } } % \end{macrocode} % \medskip @@ -13807,24 +13973,24 @@ version 2005/12/01 or later. % \end{macrocode} % If we are in the first column, we must put the block as if it was with the key~|r|. % \begin{macrocode} - \int_if_zero:nT { #2 } { \str_set:Nn \l_@@_hpos_block_str r } + \int_if_zero:nT { #2 } { \str_set_eq:NN \l_@@_hpos_block_str \c_@@_r_str } % \end{macrocode} % If we are in the last column, we must put the block as if it was with the key~|l|. % \begin{macrocode} \bool_if:nT \g_@@_last_col_found_bool { \int_compare:nNnT { #2 } = \g_@@_col_total_int - { \str_set:Nn \l_@@_hpos_block_str l } + { \str_set_eq:NN \l_@@_hpos_block_str \c_@@_l_str } } % \end{macrocode} % |\l_tmpa_tl| will contain the anchor of the \textsc{pgf} node which will be used. % \begin{macrocode} \tl_set:Nx \l_tmpa_tl { - \str_case:Vn \l_@@_vpos_of_block_str + \str_case:on \l_@@_vpos_block_str { c { - \str_case:Vn \l_@@_hpos_block_str + \str_case:on \l_@@_hpos_block_str { c { center } l { west } @@ -13833,7 +13999,7 @@ version 2005/12/01 or later. } T { - \str_case:Vn \l_@@_hpos_block_str + \str_case:on \l_@@_hpos_block_str { c { north } l { north~west } @@ -13842,7 +14008,7 @@ version 2005/12/01 or later. } B { - \str_case:Vn \l_@@_hpos_block_str + \str_case:on \l_@@_hpos_block_str { c { south} l { south~west } @@ -13866,7 +14032,7 @@ version 2005/12/01 or later. \pgfset { inner~xsep = \c_zero_dim , - inner~ysep = \l_@@_block_ysep_dim + inner~ysep = \c_zero_dim } \pgfnode { rectangle } @@ -13874,7 +14040,7 @@ version 2005/12/01 or later. { \box_use_drop:N \l_@@_cell_box } { } { } } % \end{macrocode} -% End of the case when |\l_@@_vpos_of_block_str| is equal to |c|, |T| or |B|. +% End of the case when |\l_@@_vpos_block_str| is equal to |c|, |T| or |B|. % Now, the other cases. % \begin{macrocode} { @@ -13885,7 +14051,7 @@ version 2005/12/01 or later. { \@@_qpoint:n { - row - \str_if_eq:VnTF \l_@@_vpos_of_block_str { b } { #3 } { #1 } + row - \str_if_eq:onTF \l_@@_vpos_block_str { b } { #3 } { #1 } - base } } @@ -13899,7 +14065,7 @@ version 2005/12/01 or later. \bool_if:NF \l_@@_hpos_of_block_cap_bool { - short } } { - \str_case:Vn \l_@@_hpos_block_str + \str_case:on \l_@@_hpos_block_str { c { center } l { west } @@ -13914,7 +14080,7 @@ version 2005/12/01 or later. \pgfnode { rectangle } { - \str_case:Vn \l_@@_hpos_block_str + \str_case:on \l_@@_hpos_block_str { c { base } l { base~west } @@ -13953,9 +14119,9 @@ version 2005/12/01 or later. % If the user has used the key |color| of the command |\Block| without value, % the color fixed by |\arrayrulecolor| is used. % \begin{macrocode} - \str_if_eq:VnTF \l_@@_draw_tl { default } + \tl_if_eq:NNTF \l_@@_draw_tl \c_@@_default_tl { \CT@arc@ } - { \@@_color:V \l_@@_draw_tl } + { \@@_color:o \l_@@_draw_tl } } \pgfsetcornersarced { @@ -13964,30 +14130,31 @@ version 2005/12/01 or later. { \l_@@_rounded_corners_dim } } \@@_cut_on_hyphen:w #2 \q_stop - \bool_lazy_and:nnT - { \int_compare_p:n { \l_tmpa_tl <= \c@iRow } } - { \int_compare_p:n { \l_tmpb_tl <= \c@jCol } } - { - \@@_qpoint:n { row - \l_tmpa_tl } - \dim_set_eq:NN \l_tmpb_dim \pgf@y - \@@_qpoint:n { col - \l_tmpb_tl } - \dim_set_eq:NN \l_@@_tmpc_dim \pgf@x - \@@_cut_on_hyphen:w #3 \q_stop - \int_compare:nNnT \l_tmpa_tl > \c@iRow - { \tl_set:Nx \l_tmpa_tl { \int_use:N \c@iRow } } - \int_compare:nNnT \l_tmpb_tl > \c@jCol - { \tl_set:Nx \l_tmpb_tl { \int_use:N \c@jCol } } - \@@_qpoint:n { row - \int_eval:n { \l_tmpa_tl + 1 } } - \dim_set_eq:NN \l_tmpa_dim \pgf@y - \@@_qpoint:n { col - \int_eval:n { \l_tmpb_tl + 1 } } - \dim_set_eq:NN \l_@@_tmpd_dim \pgf@x - \pgfsetlinewidth { 1.1 \l_@@_line_width_dim } - \pgfpathrectanglecorners - { \pgfpoint \l_@@_tmpc_dim \l_tmpb_dim } - { \pgfpoint \l_@@_tmpd_dim \l_tmpa_dim } - \dim_compare:nNnTF \l_@@_rounded_corners_dim = \c_zero_dim - { \pgfusepathqstroke } - { \pgfusepath { stroke } } + \int_compare:nNnF \l_tmpa_tl > \c@iRow + { + \int_compare:nNnF \l_tmpb_tl > \c@jCol + { + \@@_qpoint:n { row - \l_tmpa_tl } + \dim_set_eq:NN \l_tmpb_dim \pgf@y + \@@_qpoint:n { col - \l_tmpb_tl } + \dim_set_eq:NN \l_@@_tmpc_dim \pgf@x + \@@_cut_on_hyphen:w #3 \q_stop + \int_compare:nNnT \l_tmpa_tl > \c@iRow + { \tl_set:No \l_tmpa_tl { \int_use:N \c@iRow } } + \int_compare:nNnT \l_tmpb_tl > \c@jCol + { \tl_set:No \l_tmpb_tl { \int_use:N \c@jCol } } + \@@_qpoint:n { row - \int_eval:n { \l_tmpa_tl + 1 } } + \dim_set_eq:NN \l_tmpa_dim \pgf@y + \@@_qpoint:n { col - \int_eval:n { \l_tmpb_tl + 1 } } + \dim_set_eq:NN \l_@@_tmpd_dim \pgf@x + \pgfsetlinewidth { 1.1 \l_@@_line_width_dim } + \pgfpathrectanglecorners + { \pgfpoint \l_@@_tmpc_dim \l_tmpb_dim } + { \pgfpoint \l_@@_tmpd_dim \l_tmpa_dim } + \dim_compare:nNnTF \l_@@_rounded_corners_dim = \c_zero_dim + { \pgfusepathqstroke } + { \pgfusepath { stroke } } + } } \endpgfpicture \group_end: @@ -14311,17 +14478,11 @@ version 2005/12/01 or later. % \begin{macrocode} \group_begin: \keys_set_known:nnN { NiceMatrix / Auto } { #6 } \l_tmpa_tl -% \end{macrocode} -% We nullify the command |\@@_transform_preamble_i:| because we will provide a -% preamble which is yet transformed (by using |\l_@@_columns_type_tl| which is -% yet nicematrix-ready). -% \begin{macrocode} - % \bool_set_false:N \l_@@_preamble_bool \use:e { \exp_not:N \begin { NiceArrayWithDelims } { #1 } { #2 } - { * { #4 } { \exp_not:V \l_@@_columns_type_tl } } - [ \exp_not:V \l_tmpa_tl ] + { * { #4 } { \exp_not:o \l_@@_columns_type_tl } } + [ \exp_not:o \l_tmpa_tl ] } \int_if_zero:nT \l_@@_first_row_int { @@ -14406,7 +14567,7 @@ version 2005/12/01 or later. % array, and it will extend, since it is no longer in |\l_@@_cell_box|. % \begin{macrocode} \cs_new_protected:Npn \@@_dotfill_i: - { \dim_compare:nNnT { \box_wd:N \l_@@_cell_box } = \c_zero_dim \@@_old_dotfill } + { \dim_compare:nNnT { \box_wd:N \l_@@_cell_box } = \c_zero_dim \@@_old_dotfill } % \end{macrocode} % % \bigskip @@ -14497,7 +14658,7 @@ version 2005/12/01 or later. \pgfnode { rectangle } { south~west } { \begin { minipage } { 20 cm } - \@@_math_toggle_token: #5 \@@_math_toggle_token: + \@@_math_toggle: #5 \@@_math_toggle: \end { minipage } } { } @@ -14508,7 +14669,7 @@ version 2005/12/01 or later. { \begin { minipage } { 20 cm } \raggedleft - \@@_math_toggle_token: #6 \@@_math_toggle_token: + \@@_math_toggle: #6 \@@_math_toggle: \end { minipage } } { } @@ -14662,7 +14823,7 @@ version 2005/12/01 or later. % \begin{macrocode} \nullfont \c_math_toggle_token - \@@_color:V \l_@@_delimiters_color_tl + \@@_color:o \l_@@_delimiters_color_tl \bool_if:nTF { #3 } { \left #1 } { \left . } \vcenter { @@ -14820,9 +14981,9 @@ version 2005/12/01 or later. % \begin{macrocode} \hook_gput_code:nnn { begindocument } { . } { - \tl_set:Nn \l_@@_argspec_tl { m m m m O { } E { _ ^ } { { } { } } } + \cs_set_nopar:Npn \l_@@_argspec_tl { m m m m O { } E { _ ^ } { { } { } } } \tl_set_rescan:Nno \l_@@_argspec_tl { } \l_@@_argspec_tl - \exp_args:NNV \NewDocumentCommand \@@_SubMatrix \l_@@_argspec_tl + \exp_args:NNo \NewDocumentCommand \@@_SubMatrix \l_@@_argspec_tl { \peek_remove_spaces:n { @@ -14846,10 +15007,10 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new_protected:Npn \@@_compute_i_j:nnnn #1 #2 #3 #4 { - \tl_set:Nn \l_@@_first_i_tl { #1 } - \tl_set:Nn \l_@@_first_j_tl { #2 } - \tl_set:Nn \l_@@_last_i_tl { #3 } - \tl_set:Nn \l_@@_last_j_tl { #4 } + \cs_set_nopar:Npn \l_@@_first_i_tl { #1 } + \cs_set_nopar:Npn \l_@@_first_j_tl { #2 } + \cs_set_nopar:Npn \l_@@_last_i_tl { #3 } + \cs_set_nopar:Npn \l_@@_last_j_tl { #4 } \tl_if_eq:NnT \l_@@_first_i_tl { last } { \tl_set:NV \l_@@_first_i_tl \c@iRow } \tl_if_eq:NnT \l_@@_first_j_tl { last } @@ -14869,9 +15030,8 @@ version 2005/12/01 or later. % The four following token lists correspond to the position of the |\SubMatrix|. % \begin{macrocode} \@@_compute_i_j:nn { #2 } { #3 } - % added 6.19b \int_compare:nNnT \l_@@_first_i_tl = \l_@@_last_i_tl - { \cs_set:Npn \arraystretch { 1 } } + { \cs_set_nopar:Npn \arraystretch { 1 } } \bool_lazy_or:nnTF { \int_compare_p:nNn \l_@@_last_i_tl > \g_@@_row_total_int } { \int_compare_p:nNn \l_@@_last_j_tl > \g_@@_col_total_int } @@ -14969,7 +15129,7 @@ version 2005/12/01 or later. % \begin{macrocode} \group_begin: \pgfsetlinewidth { 1.1 \arrayrulewidth } - \@@_set_CT@arc@:V \l_@@_rules_color_tl + \@@_set_CT@arc@:o \l_@@_rules_color_tl \CT@arc@ % \end{macrocode} % Now, we draw the potential vertical rules specified in the preamble of the @@ -15000,12 +15160,12 @@ version 2005/12/01 or later. % The last argument of |\int_step_inline:nn| or |\clist_map_inline:Nn| is given % by curryfication. % \begin{macrocode} - \tl_if_eq:NnTF \l_@@_submatrix_vlines_clist { all } + \tl_if_eq:NNTF \l_@@_submatrix_vlines_clist \c_@@_all_tl { \int_step_inline:nn { \l_@@_last_j_tl - \l_@@_first_j_tl } } { \clist_map_inline:Nn \l_@@_submatrix_vlines_clist } { \bool_lazy_and:nnTF - { \int_compare_p:nNn { ##1 } > 0 } + { \int_compare_p:nNn { ##1 } > \c_zero_int } { \int_compare_p:nNn { ##1 } < { \l_@@_last_j_tl - \l_@@_first_j_tl + 1 } } @@ -15025,12 +15185,12 @@ version 2005/12/01 or later. % The last argument of |\int_step_inline:nn| or |\clist_map_inline:Nn| is given % by curryfication. % \begin{macrocode} - \tl_if_eq:NnTF \l_@@_submatrix_hlines_clist { all } + \tl_if_eq:NNTF \l_@@_submatrix_hlines_clist \c_@@_all_tl { \int_step_inline:nn { \l_@@_last_i_tl - \l_@@_first_i_tl } } { \clist_map_inline:Nn \l_@@_submatrix_hlines_clist } { \bool_lazy_and:nnTF - { \int_compare_p:nNn { ##1 } > 0 } + { \int_compare_p:nNn { ##1 } > \c_zero_int } { \int_compare_p:nNn { ##1 } < { \l_@@_last_i_tl - \l_@@_first_i_tl + 1 } } @@ -15243,7 +15403,7 @@ version 2005/12/01 or later. { \nullfont \c_math_toggle_token - \@@_color:V \l_@@_delimiters_color_tl + \@@_color:o \l_@@_delimiters_color_tl \left #1 \vcenter { @@ -15274,7 +15434,7 @@ version 2005/12/01 or later. { \nullfont \c_math_toggle_token - \@@_color:V \l_@@_delimiters_color_tl + \@@_color:o \l_@@_delimiters_color_tl \left . \vcenter { @@ -15433,14 +15593,14 @@ version 2005/12/01 or later. { rectangle } { south } { - \vbox_top:n + \vtop { \group_begin: \everycr { } \halign { \hfil ## \hfil \crcr - \@@_math_toggle_token: #1 \@@_math_toggle_token: \cr + \@@_math_toggle: #1 \@@_math_toggle: \cr \noalign { \skip_vertical:n { 3 pt } \nointerlineskip } \c_math_toggle_token \overbrace @@ -15479,7 +15639,7 @@ version 2005/12/01 or later. { \group_begin: \everycr { } - \vbox:n + \vbox { \halign { @@ -15494,7 +15654,7 @@ version 2005/12/01 or later. \c_math_toggle_token \cr \noalign { \skip_vertical:n { 3 pt } \nointerlineskip } - \@@_math_toggle_token: #1 \@@_math_toggle_token: \cr + \@@_math_toggle: #1 \@@_math_toggle: \cr } } \group_end: @@ -15958,13 +16118,13 @@ version 2005/12/01 or later. % \bigskip % If the user uses too much columns, the command |\@@_error_too_much_cols:| is % triggered. This command raises an error but also tries to give the best -% information to the user in the error message. The command |\seq_if_in:NVTF| is +% information to the user in the error message. The command |\seq_if_in:NoTF| is % not expandable and that's why we can't put it in the error message itself. We % have to do the test before the |\@@_fatal:n|. % \begin{macrocode} \cs_new_protected:Npn \@@_error_too_much_cols: { - \seq_if_in:NVTF \g_@@_types_of_matrix_seq \g_@@_name_env_str + \seq_if_in:NoTF \g_@@_types_of_matrix_seq \g_@@_name_env_str { \int_compare:nNnTF \l_@@_last_col_int = { -2 } { \@@_fatal:n { too~much~cols~for~matrix } } @@ -15986,7 +16146,7 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_new:Npn \@@_message_hdotsfor: { - \tl_if_empty:VF \g_@@_HVdotsfor_lines_tl + \tl_if_empty:oF \g_@@_HVdotsfor_lines_tl { ~Maybe~your~use~of~\token_to_str:N \Hdotsfor\ is~incorrect.} } % \end{macrocode} diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.pdf b/macros/latex/contrib/nicematrix/nicematrix-code.pdf index 5bf3af42b3..d35a38c358 100644 Binary files a/macros/latex/contrib/nicematrix/nicematrix-code.pdf and b/macros/latex/contrib/nicematrix/nicematrix-code.pdf differ diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf index 7ed598c337..a2a0d2e235 100644 Binary files a/macros/latex/contrib/nicematrix/nicematrix-french.pdf and b/macros/latex/contrib/nicematrix/nicematrix-french.pdf differ diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index 1524409d3f..d11b8c8d1c 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -361,7 +361,7 @@ rangée (avec |{tabular}| ou |{array}| de \pkg{array}, il faut utiliser \item un item \smallskip \item \renewcommand{\arraystretch}{1.2} -$\begin{NiceArray}[t]{lcccccc} +$\begin{NiceArray}~emphase#[t]@{lcccccc} \hline n & 0 & 1 & 2 & 3 & 4 & 5 \\ u_n & 1 & 2 & 4 & 8 & 16 & 32 @@ -1400,10 +1400,10 @@ comme non vide par \pkg{nicematrix} avec la commande |\NotEmpty|. \medskip \begin{minipage}{9cm} -Dans l'exemple ci-contre (où B est au centre d'un |\Block| de taille $2\times 2$), +Dans l'exemple ci-contre (où B est au centre d'un |\Block| de taille $2\times2$), on a colorié en bleu clair les quatre coins (vides) du tableau. \end{minipage}\hspace{2cm}% -\begin{NiceTabular}{*{6}{c}}[cell-space-top-limit=3pt] +\begin{NiceTabular}{*{6}{c}}[cell-space-top-limit=3pt,hvlines,rules={color=white,width=0.1pt}] \CodeBefore \rectanglecolor{blue!10}{1-1}{4-2} \rectanglecolor{blue!10}{1-1}{1-4} @@ -1422,7 +1422,6 @@ A & A & A & A & A & A \\ & & & A \\ \end{NiceTabular} - \medskip Quand la clé |corners|\footnote{La clé \texttt{corners} dont on parle là n'a pas de rapport direct avec la clé \texttt{rounded-corners}, @@ -1494,7 +1493,7 @@ dans les coins (cf.~p.~\pageref{color-in-code-before}). La commande p.~\pageref{TikzEveryCell}) tient également compte des coins. -\subsection{La commande \textbackslash diagbox} +\subsubsection{La commande \textbackslash diagbox} \indexcommand{diagbox} @@ -1525,7 +1524,7 @@ Cette commande |\diagbox| peut aussi être utilisée dans un |\Block|. -\subsection{Commandes pour filets personnalisés} +\subsubsection{Commandes pour filets personnalisés} \label{custom-line} \index{command (clé de «custom-line»)} \index{ccommand (clé de «custom-line»)} @@ -6037,7 +6036,7 @@ la dernière case (deuxième rangée et deuxième colonne) est vide. \medskip \item Pour les colonnes de type |p|, |m|, |b|, |V|\footnote{Les colonnes de type - |V| sont fournies par l'extension \pkg{varwidth}: cf.~p.~\pageref{varwidth}} + |V| sont fournies par l'extension \pkg{varwidth}, qui doit être chargée : cf.~p.~\pageref{varwidth}} ou |X|\footnote{Pour les colonnes |X|, voir p.~\pageref{colonne-X}}, la case est vide si (et seulement si) son contenu dans le codage TeX est vide (il n'y a que des espaces entre les deux esperluettes |&|). diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf index 242451d506..144a5986d0 100644 Binary files a/macros/latex/contrib/nicematrix/nicematrix.pdf and b/macros/latex/contrib/nicematrix/nicematrix.pdf differ diff --git a/macros/latex/contrib/nicematrix/nicematrix.tex b/macros/latex/contrib/nicematrix/nicematrix.tex index ec7ed5c96d..71ab7c036d 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.tex +++ b/macros/latex/contrib/nicematrix/nicematrix.tex @@ -1,5 +1,5 @@ % -*- coding: utf-8 ; -*- This file should be compiled with XeLaTeX only -\documentclass[dvipsnames]{article}% dvipsnames is for xcolor (loaded by Tikz, loaded by nicematrix) +\documentclass[dvipsnames]{article}% dvipsnames is for xcolor (loaded by TikZ, loaded by nicematrix) \usepackage{xltxtra} \usepackage{geometry} @@ -168,7 +168,7 @@ a sufficient number of compilations.} \medskip Most features of \pkg{nicematrix} may be used without explicit use of -\textsc{pgf} or Tikz (which, in fact, is not loaded by default). +\textsc{pgf} or TikZ (which, in fact, is not loaded by default). \medskip \indexcommand{NiceMatrixOptions} @@ -552,7 +552,7 @@ only when one of the keys |draw|, |hvlines|, |vlines| and |hlines| is used); the key \Definition{rounded-corners} requires rounded corners (for the frame drawn by |draw| and the shape drawn by |fill|) with a radius equal to the value of that key (the default value is 4~pt\footnote{This value is the -initial value of the \emph{rounded corners} of Tikz.}). +initial value of the \emph{rounded corners} of TikZ.}). \end{itemize} \medskip @@ -570,15 +570,15 @@ borders of the blocks; the value of that key is a (comma-separated) list of elements covered by |left|, |right|, |top| and |bottom|; it's possible, in fact, in the list which is the value of the key |borders|, to add an entry of the form |tikz={|\textsl{list}|}| where \textsl{list} is a list of couples -\textsl{key=value} of Tikz specifying the graphical characteristics of the +\textsl{key=value} of TikZ specifying the graphical characteristics of the lines that will be drawn (for an example, see p.~\pageref{dashed}). \item \index{tikzz@tikz!key of \texttt{\textbackslash Block}} -When the key \Definition{tikz} is used, the Tikz path corresponding of -the rectangle which delimits the block is executed with Tikz\footnote{Tikz +When the key \Definition{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 not, an error will be raised.} by using as options the value of that -key |tikz| (which must be a list of keys allowed for a Tikz path). +key |tikz| (which must be a list of keys allowed for a TikZ path). \colorbox{yellow!50}{\textbf{New 6.24}}\enskip In fact, in the list of the keys provided by the user as value of |tikz|, it's possible to put a key |offset|. @@ -597,8 +597,8 @@ There is also some technical keys: \begin{itemize} \item \index{name!key of \texttt{\textbackslash Block}} -the key \Definition{name} provides a name to the rectangular Tikz node -corresponding to the block; it's possible to use that name with Tikz in the +the key \Definition{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}); \item \index{respect-arraystretch (key of \texttt{\textbackslash Block})} the key \Definition{respect-arraystretch} prevents the setting of @@ -1358,7 +1358,9 @@ to consider that cell as not empty with the key |\NotEmpty|. In the example on the right (where B is in the center of a block of size $2\times2$), we have colored in blue the four (empty) corners of the array. \end{minipage}\hspace{2cm}% -\begin{NiceTabular}{*{6}{c}}[cell-space-top-limit=3pt] +\begin{NiceTabular} + [cell-space-top-limit=3pt,hvlines,rules={color=white,width=0.1pt}] + {*{6}{c}} \CodeBefore \rectanglecolor{blue!10}{1-1}{4-2} \rectanglecolor{blue!10}{1-1}{1-4} @@ -1446,7 +1448,7 @@ the cells which are in the corners (cf.~p.~\pageref{color-in-code-before}). The command |\TikzEveryCell| available in the |\CodeBefore| and the |\CodeAfter| (cf. p.~\pageref{TikzEveryCell}) takes also into account the empty corners. -\subsection{The command \textbackslash diagbox} +\subsubsection{The command \textbackslash diagbox} \indexcommand{diagbox} @@ -1477,7 +1479,7 @@ It's possible to use the command |\diagbox| in a |\Block|. -\subsection{Commands for customized rules} +\subsubsection{Commands for customized rules} \label{custom-line} \index{command (key of ``custom-line'')} @@ -1580,12 +1582,12 @@ Product C & 5 & 4 & 1 \\ \index{tikzz@tikz!key of ``custom-line''} \index{total-width (key of ``custom-line'')} -It's possible to use the key |tikz| (if Tikz is loaded). In that case, the -rule is drawn directly with Tikz by using as parameters the value of the key +It's possible to use the key |tikz| (if TikZ is loaded). In that case, the +rule is drawn directly with TikZ by using as parameters the value of the key |tikz| which must be a list of \textsl{key=value} pairs which may be applied -to a Tikz path. +to a TikZ path. -By default, no space is reserved for the rule that will be drawn with Tikz. It +By default, no space is reserved for the rule that will be drawn with TikZ. It is possible to specify a reservation (horizontal for a vertical rule and vertical for an horizontal one) with the key |total-width|. That value of that key, is, in some ways, the width of the rule that will be drawn @@ -1595,7 +1597,7 @@ rule specified in |tikz|). \bigskip -Here is an example with the key |dotted| of Tikz. +Here is an example with the key |dotted| of TikZ. \begin{BVerbatim}[boxwidth=9cm,baseline=c] \NiceMatrixOptions @@ -1638,7 +1640,7 @@ seven & eight & nine \indexcommand{hdottedline} \indexcommand{cdottedline} -As one can see, the dots of a dotted line of Tikz have the shape of a square, +As one can see, the dots of a dotted line of TikZ have the shape of a square, and not a circle. That's why the extension \pkg{nicematrix} provides in the key |custom-line| a key |dotted| which will draw rounded dots. The initial value of the key |total-width| is, in this case, equal to the diameter of the dots @@ -1799,7 +1801,7 @@ documentation.\footnote{The available keys are |create-cell-nodes|, New commands are available in that |\CodeBefore|: |\cellcolor|, |\rectanglecolor|, |\rowcolor|, |\columncolor|, |\rowcolors|, |\rowlistcolors|, |\chessboardcolors| and |\arraycolor|.\footnote{Remark that, -in the |\CodeBefore|, PGF/Tikz nodes of the form ``\verb+(i-|j)+'' are +in the |\CodeBefore|, PGF/TikZ nodes of the form ``\verb+(i-|j)+'' are also available to indicate the position to the potential rules: cf.~p.~\pageref{nodes-i}.} \label{code-before} @@ -2571,7 +2573,7 @@ is not suppressed (of course, it's possible to suppress this space by setting \bigskip It's possible to give the special value |auto| to the option |columns-width|: all the columns of the array will have a width equal to the widest cell of the -array.\footnote{The result is achieved with only one compilation (but PGF/Tikz +array.\footnote{The result is achieved with only one compilation (but PGF/TikZ will have written informations in the |aux| file and a message requiring a second compilation will appear).}\par\nobreak @@ -2791,7 +2793,7 @@ some very very very long text \bigskip Concerning \pkg{nicematrix}, one of the interests of this type of columns is that, for a cell of a column of type~|V|, -the PGF/Tikz node created by \pkg{nicematrix} for the content of that cell has +the PGF/TikZ node created by \pkg{nicematrix} for the content of that cell has a width adjusted to the content of the cell : cf. p.~\pageref{node-V}. @@ -3452,7 +3454,7 @@ the current font). \textbf{The option \Definition{xdots/line-style}}\par\nobreak \smallskip -It should be pointed that, by default, the lines drawn by Tikz with the +It should be pointed that, by default, the lines drawn by TikZ with the parameter |dotted| are composed of square dots (and not rounded ones).\footnote{The first reason of this behaviour is that the \textsc{pdf} format includes a description for dashed lines. The lines specified with this @@ -3461,7 +3463,7 @@ easy, starting from these dashed lines, to create a line composed by square dots whereas a line of rounded dots needs a specification of each dot in the \textsc{pdf} file. Nevertheless, you can have a look at the following page to see how to have dotted rules with rounded -dots in Tikz:\newline \small +dots in TikZ:\newline \small \url{https://tex.stackexchange.com/questions/52848/tikz-line-with-large-dots}} \begin{BVerbatim}[baseline=c,boxwidth=9cm] @@ -3473,12 +3475,12 @@ dots in Tikz:\newline \small In order to provide lines with rounded dots in the style of those provided by |\ldots| (at least with the \emph{Computer Modern} fonts), the package \pkg{nicematrix} embeds its own system to draw a dotted line (and this system -uses \textsc{pgf} and not Tikz). This style is called |standard| and that's +uses \textsc{pgf} and not TikZ). This style is called |standard| and that's the initial value of the parameter |xdots/line-style|. -However (when Tikz is loaded) it's possible to use for |xdots/line-style| any style -provided by Tikz, that is to say any sequence of options provided by Tikz for -the Tizk pathes (with the exception of ``|color|'', ``|shorten >|'' and +However (when TikZ is loaded) it's possible to use for |xdots/line-style| any style +provided by TikZ, that is to say any sequence of options provided by TikZ for +the TikZ pathes (with the exception of ``|color|'', ``|shorten >|'' and ``|shorten <|''). \medskip @@ -3642,7 +3644,7 @@ its sub-keys.} \medskip -The experienced users may, for instance, use the PGF/Tikz nodes created by +The experienced users may, for instance, use the PGF/TikZ nodes created by \pkg{nicematrix} in the |\CodeAfter|. These nodes are described further beginning on p.~\pageref{PGF-nodes}. @@ -3935,7 +3937,7 @@ c & d & \frac12c+\frac14d \\ \bigskip There is also a key |name| which gives a name to the submatrix created by -|\SubMatrix|. That name is used to create PGF/Tikz nodes: cf +|\SubMatrix|. That name is used to create PGF/TikZ nodes: cf p.~\pageref{node-sub-matrix}. @@ -4134,7 +4136,7 @@ $\begin{pNiceMatrix} \colorbox{yellow!50}{\textbf{New 6.24}}\enskip The command |\TikzEveryCell| execute with TikZ the rectangular path corresponding to each cell of the tabular with parameters of TikZ the argument of |\TikzEveryCell|. That argument must be -a list of \textsl{key=value} pairs which may be applied to a Tikz path. In fact, +a list of \textsl{key=value} pairs which may be applied to a TikZ path. In fact, the command applies to each of the tabular, except those in the exterior rows and columns (cf.~p.~\pageref{exterior}) and those in the empty corners (when the key |corners| is used: cf.~p.~\pageref{corners}). It applies in fact to each @@ -5089,19 +5091,19 @@ rows or one of the exterior columns. If it is used outside an environment of For an example of utilisation, see \url{tex.stackexchange.com/questions/488566} -\section{Use of Tikz with nicematrix} +\section{Use of TikZ with nicematrix} \label{name}\label{PGF-nodes} \index{tikza@TikZ (utilisation with \pkg{nicematrix})} -\index{node@\textbf{Nodes of PGF/Tikz}|(} +\index{node@\textbf{Nodes of PGF/TikZ|}(} \subsection{The nodes corresponding to the contents of the cells} -The package \pkg{nicematrix} creates a PGF/Tikz node\footnote{We recall that Tikz +The package \pkg{nicematrix} creates a PGF/TikZ node\footnote{We recall that TikZ is a layer over PGF. The extension \pkg{nicematrix} loads PGF but does not -load Tikz. We speak of PGF/Tikz nodes to emphase the fact that the PGF nodes -created by \pkg{nicematrix} may be used with PGF but also with Tikz. The final -user will probably prefer to use Tikz rather than PGF.} for each (non-empty) cell +load TikZ. We speak of PGF/TikZ nodes to emphase the fact that the PGF nodes +created by \pkg{nicematrix} may be used with PGF but also with TikZ. The final +user will probably prefer to use TikZ rather than PGF.} for each (non-empty) cell of the considered array. These nodes are used to draw the dotted lines between the cells of the matrix (inter alia). @@ -5139,9 +5141,9 @@ gives a name to the current environment. When the environment has a name, the nodes are accessible with the name ``\textsl{name}-$i$-$j$'' where \textsl{name} is the name given to the array and $i$ and $j$ the numbers of row and column. It's possible to use these nodes with \textsc{pgf} but the final user will -probably prefer to use Tikz (which is a convenient layer upon \textsc{pgf}). -However, one should remind that \pkg{nicematrix} doesn't load Tikz by default. -In the following examples, we assume that Tikz has been loaded. +probably prefer to use TikZ (which is a convenient layer upon \textsc{pgf}). +However, one should remind that \pkg{nicematrix} doesn't load TikZ by default. +In the following examples, we assume that TikZ has been loaded. \bigskip \begin{BVerbatim}[baseline=c,boxwidth=11cm] @@ -5257,7 +5259,7 @@ etc. When the extension \pkg{varwidth} is loaded, the columns of the type |V| defined by \pkg{varwidth} are supported by \pkg{nicematrix}. It may be -interessant to notice that, for a cell of a column of type |V|, the PGF/Tikz +interessant to notice that, for a cell of a column of type |V|, the PGF/TikZ node created by \pkg{nicematrix} for the content of that cell has a width adjusted to the content of the cell. This is in contrast to the case of the columns of type |p|, |m| or |b| for which the nodes have always a width equal @@ -5562,7 +5564,7 @@ Here is an example which uses these nodes in the |\CodeAfter|. \subsection{The nodes which indicate the position of the rules} \label{nodes-i} -The package \pkg{nicematrix} creates a PGF/Tikz node merely called $i$ (with +The package \pkg{nicematrix} creates a PGF/TikZ node merely called $i$ (with the classical prefix) at the intersection of the horizontal rule of number~$i$ and the vertical rule of number~$i$ (more specifically the potential position of those rules because maybe there are not actually drawn). The last node has @@ -5589,8 +5591,8 @@ muguet & dahlia \end{center} \bigskip -If we use Tikz (we remind that \pkg{nicematrix} does not load Tikz by default, -by only \textsc{pgf}, which is a sub-layer of Tikz), we can access, in the +If we use TikZ (we remind that \pkg{nicematrix} does not load TikZ by default, +by only \textsc{pgf}, which is a sub-layer of TikZ), we can access, in the |\CodeAfter| but also in the |\CodeBefore|, to the intersection of the (potential) horizontal rule~$i$ and the (potential) vertical rule~$j$ with the syntax |(|$i$\verb+-|+$j$|)|. @@ -5631,7 +5633,7 @@ syntax |(|$i$\verb+-|+$j$|)|. \bigskip The nodes of the form $i$|.5| may be used, for example to cross a row of a -matrix (if Tikz is loaded). +matrix (if TikZ is loaded). \smallskip \begin{BVerbatim}[boxwidth=11cm,baseline=c] @@ -5665,7 +5667,7 @@ p.~\pageref{sub-matrix}. \smallskip If a command |\SubMatrix| has been used with the key |name| with an expression -such as |name=|\textsl{\ttfamily MyName} three PGF/Tikz nodes are created +such as |name=|\textsl{\ttfamily MyName} three PGF/TikZ nodes are created with the names \textsl{\ttfamily MyName}|-left|, \textsl{\ttfamily MyName} and \textsl{\ttfamily MyName}|-right|. @@ -5694,7 +5696,7 @@ been created with |\SubMatrix\{{2-2}{3-3}\}|). \end{tikzpicture} \end{pNiceMatrix}\] -\index{node@\textbf{Nodes of PGF/Tikz}|)} +\index{node@\textbf{Nodes of PGF/TikZ}|)} \section{API for the developers} @@ -5726,7 +5728,7 @@ used during the next run). \emph{Example} : We want to write a command |\crossbox| to draw a cross in the current cell. This command will take in an optional argument between square brackets for a list of pairs \textsl{key}-\textsl{value} which will be given to -Tikz before the drawing. +TikZ before the drawing. It's possible to program such command |\crossbox| as follows, explicitely using the public variable |\g_nicematrix_code_before_tl|. @@ -5913,10 +5915,10 @@ the last cell (second row and second column) is empty. \medskip \item For the columns of type |p|, |m|, |b|, |V|\footnote{The columns of type -|V| are provided by \pkg{varwidth}: cf.~p.~\pageref{varwidth}.} and -|X|\footnote{See p.~\pageref{X-columns}}, the cell is empty if (and only if) -its content in the TeX code is empty (there is only spaces between the -ampersands |&|). + |V| are provided by \pkg{varwidth}, which must be loaded: + cf.~p.~\pageref{varwidth}.} and |X|\footnote{See p.~\pageref{X-columns}}, the +cell is empty if (and only if) its content in the TeX code is empty (there is +only spaces between the ampersands |&|). \medskip \item For the columns of type |c|, |l|, |r| and |w{...}{...}|, the cell is @@ -5924,7 +5926,7 @@ empty if (and only if) its TeX output has a width equal to zero. \medskip \item \indexcommand{NotEmpty} -A cell containing the command |\NotEmpty| is not empty (and a PGF/Tikz +A cell containing the command |\NotEmpty| is not empty (and a PGF/TikZ node is created in that cell). \medskip @@ -5970,7 +5972,7 @@ environments of \pkg{nicematrix} are not affected). \index{Incompatibilities} The package \pkg{nicematrix} is not compatible with the class \cls{ieeeaccess} -(because that class is not compatible with PGF/Tikz).\footnote{See +(because that class is not compatible with PGF/TikZ).\footnote{See \url{https://tex.stackexchange.com/questions/528975/error-loading-tikz-in-ieeeaccess-class}} \bigskip @@ -6017,17 +6019,17 @@ the colums |S| of \pkg{siunitx}). \section{Examples} -\subsection[{Utilisation of the key 'tikz' of the command \textbackslash -Block}]{Utilisation of the key ``tikz'' of the command \textbackslash Block} +\subsection[{Utilisation of the key 'TikZ' of the command \textbackslash +Block}]{Utilisation of the key ``TikZ'' of the command \textbackslash Block} \label{tikz-key-examples} \index{tikzz@tikz!key of \texttt{\textbackslash Block}|textit} -The key |tikz| of the command |\Block| is available only when Tikz is +The key |TikZ| of the command |\Block| is available only when TikZ is loaded.\footnote{By default, \pkg{nicematrix} only loads \textsc{pgf}, which is -a sub-layer of Tikz.} +a sub-layer of TikZ.} -For the following example, we also need the Tikz library |patterns|. +For the following example, we also need the TikZ library |patterns|. \begin{Verbatim} \usetikzlibrary{patterns} @@ -6414,7 +6416,7 @@ not longer dotted (TikZ should be loaded). \interitem In fact, it's even possible to draw solid lines with the commands |\Cdots|, -|\Vdots|, etc.\footnote{In this document, the Tikz library \pkg{arrows.meta} +|\Vdots|, etc.\footnote{In this document, the TikZ library \pkg{arrows.meta} has been loaded, which impacts the shape of the arrow tips.} \begin{Verbatim} @@ -6483,7 +6485,7 @@ $\begin{pNiceArray}{ccc|cc}[first-row,last-col,margin] \index{tikzz@tikz!key of ``borders'' de \texttt{\textbackslash Block}|textit} In the following example, we use the command |\Block| to draw dashed rules. -For that example, Tikz should be loaded (by |\usepackage{tikz}|). +For that example, TikZ should be loaded (by |\usepackage{tikz}|). \begin{Verbatim} @@ -6895,8 +6897,8 @@ However, it's not possible to do a fine tuning. That's why we describe now a method to highlight a row of the matrix. \medskip -That example and the following ones require Tikz (by default, \pkg{nicematrix} -only loads \textsc{pgf}, which is a sub-layer of Tikz) and the Tikz library +That example and the following ones require TikZ (by default, \pkg{nicematrix} +only loads \textsc{pgf}, which is a sub-layer of TikZ) and the TikZ library |fit|. The following lines in the preamble of your document do the job: \begin{verbatim} \usepackage{tikz} @@ -6904,8 +6906,8 @@ only loads \textsc{pgf}, which is a sub-layer of Tikz) and the Tikz library \end{verbatim} \medskip -We create a rectangular Tikz node which encompasses the nodes of the second -row by using the tools of the Tikz library \pkg{fit}. Those nodes are not +We create a rectangular TikZ node which encompasses the nodes of the second +row by using the tools of the TikZ library \pkg{fit}. Those nodes are not available by default in the |\CodeBefore| (for efficiency). We have to require their creation with the key |create-cell-nodes| of the keyword |\CodeBefore|. @@ -7259,7 +7261,7 @@ New key |rounded-corners| for a whole tabular. \subsection*{Changes between version 6.16 and 6.17} -New PGF/Tikz style |nicematrix/cell-node|. +New PGF/TikZ style |nicematrix/cell-node|. New key |pgf-node-code| @@ -7461,7 +7463,7 @@ New key |rounded-corners| for the command |\Block|. \subsection*{Changes between versions 5.10 and 5.11} It's now possible, in the |code-before| and in the |\CodeAfter|, to use the -syntax \verb+|(i-|j)+ for the Tikz node at the intersection of the (potential) +syntax \verb+|(i-|j)+ for the TikZ node at the intersection of the (potential) horizontal rule number~$i$ and the (potential) vertical rule number~$j$. \subsection*{Changes between versions 5.9 and 5.10} @@ -7473,7 +7475,7 @@ It's possible to provide options (between brackets) to the keyword |\CodeAfter|. \subsection*{Changes between versions 5.8 and 5.9} Correction of a bug: in the previous versions, it was not possible to use the -key |line-style| for the continuous dotted lines when the Tikz library |babel| +key |line-style| for the continuous dotted lines when the TikZ library |babel| was loaded. New key |cell-space-limits|. @@ -7615,8 +7617,8 @@ In the environments without preamble (|{NiceMatrix}|, |{pNiceMatrix}|, etc.), it's possible to use the options |l| (=|L|) or |r| (=|R|) to specify the type of the columns. -The code of \pkg{nicematrix} no longer uses Tikz but only \textsc{pgf}. By -default, Tikz is \emph{not} loaded by \pkg{nicematrix}. +The code of \pkg{nicematrix} no longer uses TikZ but only \textsc{pgf}. By +default, TikZ is \emph{not} loaded by \pkg{nicematrix}. \subsection*{Changes between versions 3.11 and 3.12} @@ -7626,7 +7628,7 @@ Options |vlines|, |hlines| and |hvlines|. Option |baseline| pour |{NiceArray}| (not for the other environments). -The name of the Tikz nodes created by the command |\Block| has changed: when +The name of the TikZ nodes created by the command |\Block| has changed: when the command has been issued in the cell $i$|-|$j$, the name is $i$|-|$j$|-block| and, if the creation of the ``medium nodes'' is required, a node $i$|-|$j$|-block-medium| is created. @@ -7695,7 +7697,7 @@ not executed. Following a discussion on TeX StackExchange\footnote{cf. |tex.stackexchange.com/questions/510841/nicematrix-and-tikz-external-optimize|}, -optimization of Tikz externalization is disabled in the environments of +optimization of TikZ externalization is disabled in the environments of \pkg{nicematrix} when the class \cls{standalone} or the package \pkg{standalone} is used. @@ -7792,10 +7794,10 @@ available in the command |\NiceMatrixOptions|. Following a discussion on TeX StackExchange\footnote{cf. |tex.stackexchange.com/questions/450841/tikz-externalize-and-nicematrix-package|}, -Tikz externalization is now deactivated in the environments of the +TikZ externalization is now deactivated in the environments of the package \pkg{nicematrix}.\footnote{Before this version, there was an error -when using \pkg{nicematrix} with Tikz externalization. In any case, it's not -possible to externalize the Tikz elements constructed by \pkg{nicematrix} +when using \pkg{nicematrix} with TikZ externalization. In any case, it's not +possible to externalize the TikZ elements constructed by \pkg{nicematrix} because they use the options |overlay| and |remember picture|.} \subsection*{Changes between version 2.0 and 2.1} @@ -7841,7 +7843,7 @@ New environment |{NiceArray}| with column types |L|, |C| and |R|. \subsection*{Changes between versions 1.0 and 1.1} -The dotted lines are no longer drawn with Tikz nodes but with Tikz circles +The dotted lines are no longer drawn with TikZ nodes but with TikZ circles (for efficiency). Modification of the code which is now twice faster. -- cgit v1.2.3