texlive[72594] Master/texmf-dist: witharrows (19oct24)
commits+karl at tug.org
commits+karl at tug.org
Sat Oct 19 22:25:32 CEST 2024
Revision: 72594
https://tug.org/svn/texlive?view=revision&revision=72594
Author: karl
Date: 2024-10-19 22:25:31 +0200 (Sat, 19 Oct 2024)
Log Message:
-----------
witharrows (19oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/generic/witharrows/witharrows-french.pdf
trunk/Master/texmf-dist/doc/generic/witharrows/witharrows-french.tex
trunk/Master/texmf-dist/doc/generic/witharrows/witharrows.pdf
trunk/Master/texmf-dist/source/generic/witharrows/witharrows.dtx
trunk/Master/texmf-dist/tex/generic/witharrows/witharrows.sty
trunk/Master/texmf-dist/tex/generic/witharrows/witharrows.tex
Modified: trunk/Master/texmf-dist/doc/generic/witharrows/witharrows-french.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/generic/witharrows/witharrows-french.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/witharrows/witharrows-french.tex 2024-10-19 14:25:00 UTC (rev 72593)
+++ trunk/Master/texmf-dist/doc/generic/witharrows/witharrows-french.tex 2024-10-19 20:25:31 UTC (rev 72594)
@@ -47,6 +47,44 @@
\def\interitem{\vspace{7mm plus 2 mm minus 3mm}}
\def\emphase{\bgroup\color{RoyalPurple}\let\next=}
+
+
+\usepackage{piton}
+\PitonOptions{language = verbatim, detected-commands = {emph,textsl}, splittable = 4}
+\SetPitonStyle{ Number = , Comment = }
+
+\ExplSyntaxOn
+
+\dim_new:N \l__pantigny_width_dim
+
+\keys_define:nn { pantigny }
+ { width .dim_set:N = \l__pantigny_width_dim }
+
+\NewPitonEnvironment { Code } { O { } }
+ {
+ \medskip
+ \char_set_catcode_other:N |
+ \cs_set_eq:NN \emph \emphase
+ \dim_zero:N \l__pantigny_width_dim
+ \keys_set:nn { pantigny } { #1 }
+ \color{gray}
+ \dim_compare:nNnT \l__pantigny_width_dim > \c_zero_dim
+ {
+ \PitonOptions { width = \l__pantigny_width_dim }
+ \begin{minipage}[c]{\l__pantigny_width_dim}
+ }
+ }
+ {
+ \dim_compare:nNnT \l__pantigny_width_dim > \c_zero_dim
+ { \end{minipage} }
+ \medskip
+ }
+
+\ExplSyntaxOff
+
+
+
+
\skip \footins = 2 \bigskipamount
\usepackage[hyperfootnotes = false]{hyperref}
@@ -81,11 +119,11 @@
\begin{abstract}
-L'extension \pkg{witharrows} fournit des environments |{WithArrows}| et
-|{DispWithArrows}| similaires aux environnements |{aligned}| et |{align}| de
-l'\pkg{amsmath} mais avec la possibilité de dessiner des flèches sur le côté droit.
-Ces flèches sont habituellement utilisées pour donner des explications concernant
-le calcul mathématique présenté.
+L'extension \pkg{witharrows} fournit des environments |{WithArrows}| et |{DispWithArrows}|
+similaires aux environnements |{aligned}| et |{align}| de l'extension \pkg{amsmath} mais
+avec la possibilité de dessiner des flèches sur le côté droit. Ces flèches sont
+habituellement utilisées pour donner des explications concernant le calcul mathématique
+présenté.
\end{abstract}
@@ -101,26 +139,28 @@
\medskip
Cette extension peut être utilisée avec |xelatex|, |lualatex|, |pdflatex| mais aussi avec
-le cheminement classique |latex|-|dvips|-|ps2pdf| (ou Adobe Distiller). L'extension
-\pkg{witharrows} charge les extensions \pkg{l3keys2e}, \pkg{tikz}, \pkg{varwidth} ainsi
-que les bibliothèques Tikz \pkg{arrows.meta} et \pkg{bending}. L'utilisateur final n'a
-qu'à charger l'extension \pkg{witharrows} avec l'instruction habituelle :
-|\usepackage{witharrows}|.
+le cheminement classique |latex|-|dvips|-|ps2pdf| (ou Adobe Distiller). \textsl{Néanmoins,
+ le fichier witharrows-french.tex de la présente documentation ne peut être compilé
+ qu'avec LuaLaTeX.} L'extension \pkg{witharrows} charge les extensions \pkg{l3keys2e},
+\pkg{tikz}, \pkg{varwidth} ainsi que les bibliothèques Tikz \pkg{arrows.meta} et
+\pkg{bending}. L'utilisateur final n'a qu'à charger l'extension \pkg{witharrows} avec
+l'instruction habituelle : |\usepackage{witharrows}|.
\medskip
-Les flèches sont tracées avec Tikz et donc \textbf{plusieurs compilations peuvent être nécessaires}.\footnote{Si
- vous utilisez Overleaf, Overleaf effectue automatiquement un nombre de compilations suffisant (en utilisant |latexmk|).}
+Les flèches sont tracées avec Tikz et donc \textbf{plusieurs compilations peuvent être
+ nécessaires}.\footnote{Si vous utilisez Overleaf, Overleaf effectue automatiquement un
+ nombre de compilations suffisant (en utilisant |latexmk|).}
\bigskip
-Cette extension fournit un environnement |{WithArrows}| pour construire des alignements
-d'équations avec des flèches pour les explications sur le côté droit.
+Cette extension fournit un environnement \Definition{\{WithArrows\}} pour construire des
+alignements d'équations avec des flèches pour les explications sur le côté droit.
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = (a+1)^2 ~emphase#\Arrow{on développe}@ \\
+A & = (a+1)^2 \emph{\Arrow{on développe}} \\
& = a^2 + 2a + 1 % <------ ne pas mettre de \\ ici
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = (a+1)^2 \Arrow{on développe} \\
@@ -130,16 +170,16 @@
\medskip
-La flèche a été tracée avec la commande |\Arrow| dans la rangée dont la flèche part. La
-commande |\Arrow| doit être utilisée dans la seconde colonne (le mieux est de la mettre à
-la fin de la ligne comme dans l'exemple précédent).
+La flèche a été tracée avec la commande \DefinitionCommande{Arrow} dans la rangée dont la
+flèche part. La commande |\Arrow| doit être utilisée dans la seconde colonne (le mieux est
+de la mettre à la fin de la ligne comme dans l'exemple précédent).
\medskip
-Comme on le voit, l'environnement |{WithArrows}| est proche de l'environnement |{aligned}|
-de l'\pkg{amsmath}. L'extension \pkg{witharrows} propose aussi un environnement
-|{DispWithArrows}| qui est similaire à l'environnement |{align}| de l'\pkg{amsmath}: cf.
-p. \pageref{DispWithArrows}.
+L'environnement |{WithArrows}| est proche de l'environnement |{aligned}|
+de \pkg{amsmath}. L'extension \pkg{witharrows} propose aussi des environnements
+|{DispWithArrows}| et |{DispWithArrows*}| qui sont similaires aux environnements |{align}|
+et |{align*}| de l'extension \pkg{amsmath}: cf. p.~\pageref{DispWithArrows}.
\section{Options pour la forme des flèches}
@@ -147,18 +187,20 @@
La commande |\Arrow| a plusieurs options. Ces options peuvent être placées entre crochets,
avant, ou après, l'argument obligatoire.
-L'option \Definition{jump} indique le nombre\footnote{Il n'est pas possible de donner une valeur négative à |jump|.
-Voir plus loin (p.~\pageref{Backwards}) la manière de tracer une flèche qui remonte.} de rangées que la flèche doit sauter (la valeur initiale est, bien
-entendu,~$1$).
+\medskip
+L'option \Definition{jump} indique le nombre\footnote{Il n'est pas possible de donner une
+ valeur négative à |jump|. Voir plus loin (p.~\pageref{Backwards}) la manière de tracer
+ une flèche qui remonte.} de rangées que la flèche doit sauter (la valeur initiale est,
+bien entendu,~$1$).
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = \bigl((a+b)+1\bigr)^2 \Arrow[~emphase#jump=2@]{on développe} \\
+A & = \bigl((a+b)+1\bigr)^2 \Arrow[\emph{jump=2}]{on développe} \\
& = (a+b)^2 + 2(a+b) +1 \\
& = a^2 + 2ab + b^2 + 2a + 2b +1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = \bigl((a+b)+1\bigr)^2 \Arrow[jump=1+1]{on développe} \\
@@ -168,13 +210,13 @@
\interitem
Il est possible de faire partir plusieurs flèches d'une même rangée.
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = \bigl((a+b)+1\bigr)^2 ~emphase#\Arrow{}\Arrow{}[jump=2]@ \\
+A & = \bigl((a+b)+1\bigr)^2 \emph{\Arrow{}\Arrow{}[jump=2]} \\
& = (a+b)^2 + 2(a+b) +1 \\
& = a^2 + 2ab + b^2 + 2a + 2b +1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = \bigl((a+b)+1\bigr)^2 \Arrow{}\Arrow{}[jump=2] \\
@@ -185,13 +227,13 @@
\interitem L'option \Definition{xoffset} décale la flèche vers la droite (habituellement,
on ne souhaite pas que les flèches soient collées au texte). La valeur initiale de
|xoffset| est de $3$~mm.
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
A & = \bigl((a+b)+1\bigr)^2
-\Arrow[~emphase#xoffset=1cm@]{avec \texttt{xoffset=1cm}} \\
+\Arrow[\emph{xoffset=1cm}]{avec \texttt{xoffset=1cm}} \\
& = (a+b)^2 + 2(a+b) +1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = \bigl((a+b)+1\bigr)^2
@@ -205,12 +247,12 @@
\Definition{tikz} qui peut être utilisée pour donner à la flèche (en fait, à la commande
|\path| de Tikz) les options proposées par Tikz pour une telle flèche. L'exemple suivant
fournit une flèche en trait épais.
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = (a+1)^2 \Arrow[~emphase#tikz=thick@]{on développe} \\
+A & = (a+1)^2 \Arrow[\emph{tikz=thick}]{on développe} \\
& = a^2 + 2a + 1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = (a+1)^2 \Arrow[tikz=thick]{on développe} \\
@@ -221,12 +263,12 @@
Il est également possible de changer les pointes de flèche. Par exemple, nous pouvons
tracer une flèche qui remonte vers le haut avec l'option Tikz~|<-|.\label{Backwards}
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = (a+1)^2 \Arrow~emphase#[tikz=<-]@{on factorise} \\
+A & = (a+1)^2 \Arrow\emph{[tikz=<-]}{on factorise} \\
& = a^2 + 2a + 1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = (a+1)^2 \Arrow[tikz=<-]{on factorise} \\
@@ -236,12 +278,12 @@
\interitem
Il est aussi possible de supprimer les deux pointes de flèche avec l'option Tikz
«|-|».\par\nobreak
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = (a+1)^2 \Arrow[~emphase#tikz=-@]{très classique} \\
+A & = (a+1)^2 \Arrow[\emph{tikz=-}]{très classique} \\
& = a^2 + 2a + 1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = (a+1)^2 \Arrow[tikz=-]{très classique} \\
@@ -251,12 +293,12 @@
\interitem
Pour avoir des flèches droites et non incurvées, il convient d'utiliser l'option Tikz
«|bend left = 0|».
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = (a+1)^2 \Arrow~emphase#[tikz={bend left=0}]@{on développe} \\
+A & = (a+1)^2 \Arrow\emph{[tikz={bend left=0}]}{on développe} \\
& = a^2 + 2a + 1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = (a+1)^2 \Arrow[tikz={bend left=0}]{on développe} \\
@@ -272,14 +314,14 @@
associé à la flèche.
\newcounter{fnnohyphen} \setcounter{fnnohyphen}{\thefootnote}
%
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
A & = \bigl((a+b)+1\bigr)^2
-\Arrow[jump=2,~emphase#tikz={text width=5.3cm}@]{Nous avons développé...} \\
+\Arrow[jump=2,\emph{tikz={text width=5.3cm}}]{Nous avons développé...} \\
& = (a+b)^2 + 2(a+b) +1 \\
& = a^2 + 2ab + b^2 + 2a + 2b +1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = \bigl((a+b)+1\bigr)^2
@@ -303,12 +345,12 @@
ajoutant |\bfseries| au début du texte, on ne va pas supprimer le |\small| et le
|\itshape| et, par conséquent, on aura un texte en gras, italique et petite taille.
%
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = (a+1)^2 \Arrow{~emphase#\bfseries@ on développe} \\
+A & = (a+1)^2 \Arrow{\emph{\bfseries} on développe} \\
& = a^2 + 2a + 1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = (a+1)^2 \Arrow{\bfseries on développe} \\
@@ -325,12 +367,12 @@
utilise une option |tikz={font={\bfseries}}|, la spécification par défaut constituée par
|\small| et |\itshape| va être écrasée.
%
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = (a+1)^2 \Arrow[~emphase#tikz={font={\bfseries}}@]{on développe} \\
+A & = (a+1)^2 \Arrow[\emph{tikz={font={\bfseries}}}]{on développe} \\
& = a^2 + 2a + 1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = (a+1)^2 \Arrow[tikz={font={\bfseries}}]{on développe} \\
@@ -350,13 +392,13 @@
imbriqués dans un environnement |{WithArrows}| donné (avec des exceptions attendues pour
les options |interline|, |code-before| et |code-after|).}
%
-\begin{Verbatim}
-$\begin{WithArrows}[~emphase#tikz=blue@]
+\begin{Code}
+$\begin{WithArrows}[\emph{tikz=blue}]
A & = \bigl((a+b)+1\bigr)^2 \Arrow{premier développement} \\
& = (a+b)^2 + 2(a+b) +1 \Arrow{second développement} \\
& = a^2 + 2ab + b^2 + 2a + 2b +1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[tikz=blue]
A & = \bigl((a+b)+1\bigr)^2 \Arrow{premier développement} \\
@@ -368,7 +410,7 @@
\interitem
L'environnement |{WithArrows}| a une option \Definition{displaystyle}. Avec cette option,
tous les éléments sont composés en |\displaystyle| (comme dans un environnement
-|{aligned}| de el'\pkg{amsmath}).
+|{aligned}| de l'extension \pkg{amsmath}).
\medskip
Sans l'option |displaystyle|:
@@ -379,8 +421,8 @@
& = \int_0^1 (x^2+2x+1) dx
\Arrow{linéarité de l'intégration} \\
& = \int_0^1 x^2 dx + 2 \int_0^1 x dx + \int_0^1 dx \\
-& = \frac13 + 2\frac12 + 1 \\
-& = \frac73
+& = \frac{1}{3} + 2\frac{1}{2} + 1 \\
+& = \frac{7}{3}
\end{WithArrows}$
\end{Verbatim}
@@ -389,8 +431,8 @@
& = \int_0^1 (x^2+2x+1) dx
\Arrow{linéarité de l'intégration} \\
& = \int_0^1 x^2 dx + 2 \int_0^1 x dx + \int_0^1 dx \\
-& = \frac13 + 2\frac12 + 1 \\
-& = \frac73
+& = \frac{1}{3} + 2\frac{1}{2} + 1 \\
+& = \frac{7}{3}
\end{WithArrows}$
@@ -402,8 +444,8 @@
& = \int_0^1 (x^2+2x+1) dx
\Arrow{linéarité de l'intégration} \\
& = \int_0^1 x^2 dx + 2 \int_0^1 x dx + \int_0^1 dx \\
-& = \frac13 + 2\frac12 + 1 \\
-& = \frac73
+& = \frac{1}{3} + 2\frac{1}{2} + 1 \\
+& = \frac{7}{3}
\end{WithArrows}$
@@ -420,14 +462,14 @@
en bleu et en caractères droits, on peut utiliser l'instruction suivante :
|\tikzset{WithArrows/arrow/.append style = {blue,font = {}}}|.}
-\begin{Verbatim}
-~emphase#\WithArrowsOptions{displaystyle,tikz=blue}@
+\begin{Code}
+\emph{\WithArrowsOptions{displaystyle,tikz=blue}}
$\begin{WithArrows}
\sum_{i=1}^n (x_i+1)^2
& = \sum_{i=1}^n (x_i^2+2x_i+1) \Arrow{par linéarité}\\
& = \sum_{i=1}^n x_i^2 + 2\sum_{i=1}^nx_i+ n
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
\begin{scope}
\WithArrowsOptions{displaystyle,tikz=blue}
@@ -448,16 +490,16 @@
environnement |{WithArrows}|. Si vous voulez l'utiliser dans un tel environnement, il est
possible de changer le nom de la commande |\Arrow| de l'extension \pkg{witharrows} grâce à
une option \Definition{command-name} dédiée. Le nouveau nom de la commande doit être
-fourni à el'option \emph{sans} la contre-oblique.
+fourni à l'option \emph{sans} la contre-oblique.
%
-\begin{Verbatim}
+\begin{Code}
\NewDocumentCommand {\Arrow} {} {\longmapsto}
$\begin{WithArrows}[~emphase#command-name=Explication@]
f & = \bigl(x \Arrow (x+1)^2\bigr)
-~emphase#\Explication{on travaille directement sur les fonctions}@\\
+\emph{\Explication{on travaille directement sur les fonctions}}\\
& = \bigl(x \Arrow x^2+2x+1\bigr)
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
%
\begin{scope}
\NewDocumentCommand {\Arrow} {} {\longmapsto}
@@ -476,12 +518,12 @@
\emph{hooks} (elles sont disponibles uniquement au niveau de l'environnement et ne
s'appliquent pas aux environnements imbriqués).
%
-\begin{Verbatim}
-$\begin{WithArrows}[~emphase#code-before = \color{blue}@]
+\begin{Code}
+$\begin{WithArrows}[\emph{code-before = \color{blue}}]
A & = (a+b)^2 \Arrow{on développe} \\
& = a^2 + 2ab + b^2
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[code-before = \color{blue}]
A & = (a+b)^2 \Arrow{on développe} \\
@@ -492,8 +534,8 @@
Des commandes spéciales sont disponibles dans le |code-after|: une commande
\DefinitionCommande{WithArrowsNbLines} qui indique le nombre de lignes (=rangées) de
l'environnement courant (pour TeX, il s'agit d'une commande et non d'un compteur), une
-forme spéciale de la commande |\Arrow| et la commande |\MultiArrow| : ces commandes sont
-décrites à partir de la page~\pageref{NestedEnv}.
+forme spéciale de la commande |\Arrow| et la commande |\MultiArrow| : ces deux dernières
+commandes sont décrites à partir de la page~\pageref{NestedEnv}.
\section{Nombre et formats des colonnes}
@@ -515,13 +557,13 @@
\bigskip
Par exemple, si on veut seulement une colonne alignée à gauche, on peut utiliser l'option
|format=l|.
-\begin{Verbatim}
-$\begin{WithArrows}[~emphase#format = l@]
+\begin{Code}
+$\begin{WithArrows}[\emph{format = l}]
f(x) \ge g(x) \Arrow{on élève les deux membres au carré} \\
f(x)^2 \ge g(x)^2 \Arrow{on fait tout passer à gauche} \\
f(x)^2 - g(x)^2 \ge 0
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[format = l]
f(x) \ge g(x) \Arrow{on élève les deux membres au carré} \\
@@ -533,8 +575,8 @@
Dans l'exemple suivant, on utilise cinq colonnes toutes centrées (l'environnement
|{DispWithArrows*}| utilisé est présenté p.~\pageref{DispWithArrows}).
-\begin{Verbatim}
-\begin{DispWithArrows*}[~emphase#format = cCcCc@,
+\begin{Code}
+\begin{DispWithArrows*}[\emph{format = cCcCc},
wrap-lines,
interline=1mm]
k & \;\le\; & t & \;\le\; & k+1 \\
@@ -545,7 +587,7 @@
& \le & \int\limits_k^{k+1} \frac{dt}{k} \\
\frac{1}{k+1} & \le & \ln(k+1)-\ln(k) & \le & \frac{1}{k}
\end{DispWithArrows*}
-\end{Verbatim}
+\end{Code}
\begin{DispWithArrows*}[format = cCcCc,
wrap-lines,
interline=1mm]
@@ -562,24 +604,24 @@
\section{Positionnement précis des flèches}
L'environnement |{WithArrows}| construit, lors de la composition du tableau, deux séries
-de nœuds représentés en rouge dans l'exemple suivant.\footnote{L'option |show-nodes| peut
- être utilisée pour visualiser ces nœuds. Les nœuds sont en fait des nœuds Tikz de forme
- rectangulaire et de largeur nulle. Une flèche entre deux nœuds part de l'ancre sud
- (\emph{south anchor}) du premier nœud et arrive à l'ancre nord (\emph{north anchor}) du
- deuxième nœud.}
+de nœuds représentés en rouge dans l'exemple suivant.\footnote{L'option
+ \Definition{show-nodes} peut être utilisée pour visualiser ces nœuds. Les nœuds sont en
+ fait des nœuds Tikz de forme rectangulaire et de largeur nulle. Une flèche entre deux
+ nœuds part de l'ancre sud (\emph{south anchor}) du premier nœud et arrive à l'ancre nord
+ (\emph{north anchor}) du deuxième nœud.}
\smallskip
$\begin{WithArrows}[displaystyle,show-nodes]
I
-& = \int_{\frac{\pi}4}^0 \ln\Bigl(1+\tan\left(\tfrac{\pi}4-u\right)\Bigr)(-d u) \\
-& = \int_0^{\frac{\pi}4} \ln\Bigl(1+\tan\left(\tfrac{\pi}4-u\right)\Bigr)d u \\
-& = \int_0^{\frac{\pi}4}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)\, d u \\
-& =\int_0^{\frac{\pi}4}\ln\left(\frac{1+\tan u+1-\tan u}{1+\tan u}\right) d u \\
-& =\int_0^{\frac{\pi}4} \ln\left(\frac2{1+\tan u}\right)\, d u\\
-& =\int_0^{\frac{\pi}4}\bigl(\ln2-\ln(1+\tan u)\bigr)\, d u \\
-& =\frac{\pi}4\ln2-\int_0^{\frac{\pi}4}\ln(1+\tan u)\, d u \\
-& =\frac{\pi}4\ln2-I
+& = \int_{\frac{\pi}{4}}^0 \ln\Bigl(1+\tan\left(\tfrac{\pi}{4}-u\right)\Bigr)(-d u) \\
+& = \int_0^{\frac{\pi}{4}} \ln\Bigl(1+\tan\left(\tfrac{\pi}{4}-u\right)\Bigr)d u \\
+& = \int_0^{\frac{\pi}{4}}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)\, d u \\
+& =\int_0^{\frac{\pi}{4}}\ln\left(\frac{1+\tan u+1-\tan u}{1+\tan u}\right) d u \\
+& =\int_0^{\frac{\pi}{4}} \ln\left(\frac{2}{1+\tan u}\right)\, d u\\
+& =\int_0^{\frac{\pi}{4}}\bigl(\ln2-\ln(1+\tan u)\bigr)\, d u \\
+& =\frac{\pi}{4}\ln2-\int_0^{\frac{\pi}{4}}\ln(1+\tan u)\, d u \\
+& =\frac{\pi}{4}\ln2-I
\end{WithArrows}$
\bigskip
@@ -605,17 +647,17 @@
Ainsi\enskip
$\begin{WithArrows}[displaystyle]
I
-& = \int_{\frac{\pi}4}^0 \ln\Bigl(1+\tan\left(\tfrac{\pi}4-u\right)\Bigr)(-d u)
+& = \int_{\frac{\pi}{4}}^0 \ln\Bigl(1+\tan\left(\tfrac{\pi}{4}-u\right)\Bigr)(-d u)
\Arrow[lr]{Cette flèche utilise une option \texttt{lr}.}\\
-& = \int_0^{\frac{\pi}4} \ln\Bigl(1+\tan\left(\tfrac{\pi}4-u\right)\Bigr)d u \\
-& = \int_0^{\frac{\pi}4}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)\, d u \\
-& =\int_0^{\frac{\pi}4}\ln\left(\frac{1+\tan u+1-\tan u}{1+\tan u}\right) d u
+& = \int_0^{\frac{\pi}{4}} \ln\Bigl(1+\tan\left(\tfrac{\pi}{4}-u\right)\Bigr)d u \\
+& = \int_0^{\frac{\pi}{4}}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)\, d u \\
+& =\int_0^{\frac{\pi}{4}}\ln\left(\frac{1+\tan u+1-\tan u}{1+\tan u}\right) d u
\Arrow[ll,jump=2,tikz={text width = 5cm}]{Cette flèche utilise une option \texttt{ll}
et une option \texttt{jump} fixée à $2$}\\
-& =\int_0^{\frac{\pi}4} \ln\left(\frac2{1+\tan u}\right)\, d u\\
-& =\int_0^{\frac{\pi}4}\bigl(\ln2-\ln(1+\tan u)\bigr)\, d u \\
-& =\frac{\pi}4\ln2-\int_0^{\frac{\pi}4}\ln(1+\tan u)\, d u \\
-& =\frac{\pi}4\ln2-I
+& =\int_0^{\frac{\pi}{4}} \ln\left(\frac{2}{1+\tan u}\right)\, d u\\
+& =\int_0^{\frac{\pi}{4}}\bigl(\ln2-\ln(1+\tan u)\bigr)\, d u \\
+& =\frac{\pi}{4}\ln2-\int_0^{\frac{\pi}{4}}\ln(1+\tan u)\, d u \\
+& =\frac{\pi}{4}\ln2-I
\end{WithArrows}$
@@ -623,14 +665,14 @@
Il y a aussi une option nommée \Definition{i} (\emph{i} pour \emph{intermédiaire}). Avec cette option, la flèche est
verticale et calée à gauche.
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
(a+b)(a+ib)(a-b)(a-ib)
& = (a+b)(a-b)\cdot(a+ib)(a-ib) \\
-& = (a^2-b^2)(a^2+b^2) \Arrow~emphase#[i]@{parce que $(x-y)(x+y)=x^2-y^2$}\\
+& = (a^2-b^2)(a^2+b^2) \Arrow\emph{[i]}{parce que $(x-y)(x+y)=x^2-y^2$}\\
& = a^4-b^4
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
(a+b)(a+ib)(a-b)(a-ib)
@@ -645,25 +687,25 @@
\emph{toutes} les flèches de l'environnement sont regroupées sur une même verticale calée à gauche.
\label{group}
%
-\begin{Verbatim}[formatcom=\small\color{gray}]
-$\begin{WithArrows}[~emphase#displaystyle,group@]
-2xy'-3y=\sqrt x
-& \Longleftrightarrow 2x(K'y_0+Ky_0')-3Ky_0 = \sqrt x \\
-& \Longleftrightarrow 2xK'y_0 + K(2xy_0'-3y_0) = \sqrt x \\
-& \Longleftrightarrow 2x K'y_0 = \sqrt x \Arrow{...}\\
+\begin{Code}
+$\begin{WithArrows}[\emph{displaystyle,group}]
+2xy'-3y=\sqrt{x}
+& \Longleftrightarrow 2x(K'y_0+Ky_0')-3Ky_0 = \sqrt{x} \\
+& \Longleftrightarrow 2xK'y_0 + K(2xy_0'-3y_0) = \sqrt{x} \\
+& \Longleftrightarrow 2x K'y_0 = \sqrt{x} \Arrow{...}\\
...
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[displaystyle,group]
-2xy'-3y=\sqrt x
-& \Longleftrightarrow 2x(K'y_0+Ky_0')-3Ky_0 = \sqrt x \\
-& \Longleftrightarrow 2xK'y_0 + K(2xy_0'-3y_0) = \sqrt x \\
-& \Longleftrightarrow 2x K'y_0 = \sqrt x \Arrow{on remplace $y_0$ par sa valeur}\\
-& \Longleftrightarrow 2xK'x^{\frac32} = x^{\frac12} \Arrow{simplification par $x$}\\
-& \Longleftrightarrow K' = \tfrac1{2x^2} \Arrow{on primitive}\\
-& \Longleftrightarrow K = -\tfrac1{2x}
+2xy'-3y=\sqrt{x}
+& \Longleftrightarrow 2x(K'y_0+Ky_0')-3Ky_0 = \sqrt{x} \\
+& \Longleftrightarrow 2xK'y_0 + K(2xy_0'-3y_0) = \sqrt{x} \\
+& \Longleftrightarrow 2x K'y_0 = \sqrt{x} \Arrow{on remplace $y_0$ par sa valeur}\\
+& \Longleftrightarrow 2xK'x^{\frac{3}{2}} = x^{\frac{1}{2}} \Arrow{simplification par $x$}\\
+& \Longleftrightarrow K' = \tfrac{1}{2x^2} \Arrow{on primitive}\\
+& \Longleftrightarrow K = -\tfrac{1}{2x}
\end{WithArrows}$
@@ -713,6 +755,7 @@
l'option |new-group| pour la dernière flèche (c'est pourquoi cette dernière flèche n'est
pas alignée avec les premières).
+\bigskip
$\begin{WithArrows}[interline=1mm,groups]
\sum\limits_{k=0}^n\frac{\cos kx}{\cos^k x}
& = \sum\limits_{k=0}^n \frac{\Re (e^{ikx})}{(\cos x)^k}
@@ -727,11 +770,13 @@
\Arrow{réduction au même dénominateur} \\
& = \Re \left(\frac{\frac{\cos^{n+1}x-e^{i(n+1)x}}{\cos^{n+1}x}}{\frac{\cos x-e^{ix}}{\cos x}}\right)
\Arrow{\(\Re(kz) = k\cdot\Re(z)\) lorsque \(k\) est réel} \\
-& = \frac1{\cos^n x}\Re \left(\frac{\cos^{n+1}x-e^{i(n+1)x}}{\cos x-e^{ix}}\right)
+& = \frac{1}{\cos^n x}\Re \left(\frac{\cos^{n+1}x-e^{i(n+1)x}}{\cos x-e^{ix}}\right)
\Arrow[new-group]{forme algébrique des nombres complexes} \\
-& =\frac1{\cos^n x}\Re\left(\frac{\cos^{n+1}x-(\cos(n+1)x+i\sin(n+1)x)}{\cos x-(\cos x+i\sin x)}\right) \\
-& =\frac1{\cos^n x}\Re\left(\frac{(\cos^{n+1}x-\cos(n+1)x)-i\sin(n+1)x}{-i\sin x}\right) \\
-& = \frac1{\cos^nx}\cdot\frac{\sin(n+1)x}{\sin x}
+& =\frac{1}{\cos^n x}
+ \Re\left(\frac{\cos^{n+1}x-(\cos(n+1)x+i\sin(n+1)x)}{\cos x-(\cos x+i\sin x)}\right) \\
+& =\frac{1}{\cos^n x}
+ \Re\left(\frac{(\cos^{n+1}x-\cos(n+1)x)-i\sin(n+1)x}{-i\sin x}\right) \\
+& = \frac{1}{\cos^nx}\cdot\frac{\sin(n+1)x}{\sin x}
\end{WithArrows}$
@@ -770,15 +815,15 @@
\bigskip
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
$\begin{WithArrows}[groups]
-A & = B \Arrow{un}\Arrow[~emphase#o@,jump=3]{direct} \\
+A & = B \Arrow{un}\Arrow[\emph{o},jump=3]{direct} \\
& = C + C \Arrow{deux} \\
& = D + D + D \Arrow{trois} \\
& = E + E \\
& = F + F
\end{WithArrows}$
-\end{BVerbatim}
+\end{Code}
$\begin{WithArrows}[c,groups]
A & = B \Arrow{un}\Arrow[o,jump=3]{direct} \\
& = C + C \Arrow{deux} \\
@@ -794,14 +839,14 @@
type~|o|:\par\nobreak
\bigskip
-\begin{BVerbatim}
+\begin{Code}
$\begin{WithArrows}[groups]
-A & = B \Arrow{un}\Arrow[~emphase#o@,jump=2]{deux}\Arrow[~emphase#o@,jump=3]{trois}\\
+A & = B \Arrow{un}\Arrow[\emph{o},jump=2]{deux}\Arrow[\emph{o},jump=3]{trois}\\
& = C \\
& = D \\
& = E + E + E + E + E + E + E
\end{WithArrows}$
-\end{BVerbatim}
+\end{Code}
\bigskip
@@ -814,8 +859,8 @@
\bigskip
L'espace (horizontal) entre une flèche de type |o| et les flèches immédiatement
-recouvertes est fixé par le paramètre |xoffset-for-o-arrows| que l'on peut régler avec
-|\WithArrowsOptions| (valeur initiale : 2~mm).
+recouvertes est fixé par le paramètre \Definition{xoffset-for-o-arrows} que l'on peut
+régler avec |\WithArrowsOptions| (valeur initiale : 2~mm).
\bigskip
\emph{Remarque} : La lettre |o| a été choisie car c'est la première lettre du mot anglais
@@ -830,16 +875,16 @@
\Definition{up} et \Definition{down}. L'exemple suivant illustre ces types de flèches:
-\begin{Verbatim}
+\begin{Code}
\(\begin{WithArrows}
A & = B
-\Arrow~emphase#[up]@{une flèche de type \texttt{up}} \\
+\Arrow\emph{[up]}{une flèche de type \texttt{up}} \\
& = C + C + C + C + C + C + C + C \\
& = C + C + C + C + C + C + C + C
-\Arrow~emphase#[down]@{une flèche de type \texttt{down}} \\
+\Arrow\emph{[down]}{une flèche de type \texttt{down}} \\
& = E + E
\end{WithArrows}\)
-\end{Verbatim}
+\end{Code}
\bigskip
$\begin{WithArrows}
@@ -876,13 +921,13 @@
\end{itemize}
\vspace{1cm}
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
A & = B
-\Arrow[~emphase#up={width=2cm,radius=0pt}@]{essai} \\
+\Arrow[\emph{up={width=2cm,radius=0pt}}]{essai} \\
& = C + C + C + C + C + C + C + C
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
\medskip
$\begin{WithArrows}
@@ -893,13 +938,13 @@
\vspace{1cm}
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
A & = B
-\Arrow[~emphase#up={width=min}@]{essai} \\
+\Arrow[\emph{up={width=min}}]{essai} \\
& = C + C + C + C + C + C + C + C
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
\medskip
$\begin{WithArrows}
@@ -927,18 +972,19 @@
l'extension \pkg{witharrows} sans l'extension \pkg{amsmath}.}
\interitem
-Comme dans les environnements de l'\pkg{amsmath}, il est possible de changer l'espacement
-entre deux rangées avec l'option de la commande |\\| de fin de ligne (il est aussi
-possible d'utiliser |\\*| mais cela a exactement le même effet que |\\| puisqu'un
-environnement |{WithArrows}| est toujours insécable). Cette option est conçu pour être
+
+Comme dans les environnements de l'extension \pkg{amsmath}, il est possible de changer
+l'espacement entre deux rangées avec l'option de la commande |\\| de fin de ligne (il est
+aussi possible d'utiliser |\\*| mais cela a exactement le même effet que |\\| puisqu'un
+environnement |{WithArrows}| est toujours insécable). Cette option est conçue pour être
utilisée avec des valeurs positives uniquement.
%
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}
-A & = (a+1)^2 \Arrow{on développe} ~emphase#\\[2ex]@
+A & = (a+1)^2 \Arrow{on développe} \emph{\\[2ex]}
& = a^2 + 2a + 1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}
A & = (a+1)^2 \Arrow{on développe} \\*[2ex]
@@ -948,20 +994,20 @@
\interitem
-Dans les environnements de l'\pkg{amsmath} (ou de \pkg{mathtools}), l'espace entre deux
-rangées est fixé par un paramètre appelé |\jot| (il s'agit d'une dimension et non d'un
-ressort). C'est aussi le cas pour l'environnement |{WithArrows}|. Une option
+Dans les environnements de l'extension \pkg{amsmath} (ou de \pkg{mathtools}), l'espace
+entre deux rangées est fixé par un paramètre appelé |\jot| (il s'agit d'une dimension et
+non d'un ressort). C'est aussi le cas pour l'environnement |{WithArrows}|. Une option
\Definition{jot} a été ajoutée à l'environnement |{WithArrows}| dans le but de changer ce
-paramètre |\jot| pour un environnement donné.\footnote{Il est aussi possible de changer |\jot| avec
- l'environnement |{spreadlines}| de \pkg{mathtools}.}
+paramètre |\jot| pour un environnement donné.\footnote{Il est aussi possible de changer
+ |\jot| avec l'environnement |{spreadlines}| de \pkg{mathtools}.}
%
-\begin{Verbatim}
-$\begin{WithArrows}[displaystyle,~emphase#jot=2ex@]
+\begin{Code}
+$\begin{WithArrows}[displaystyle,\emph{jot=2ex}]
F & = \frac{1}{2}G \Arrow{on développe}\\
& = H + \frac{1}{2}K \Arrow{on continue}\\
& = K
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[displaystyle,jot=2ex]
@@ -975,8 +1021,8 @@
Néanmoins, cette nouvelle valeur de |\jot| sera aussi utilisée dans les nouveaux
alignements inclus dans l'environnement~|{WithArrows}|:
%
-\begin{Verbatim}
-$\begin{WithArrows}[jot=2ex]
+\begin{Code}
+$\begin{WithArrows}[\emph{jot=2ex}]
\varphi(x,y) = 0 & \Leftrightarrow (x+y)^2 + (x+2y)^2 = 0
\Arrow{$x$ et $y$ sont réels}\\
& \Leftrightarrow \left\{
@@ -986,7 +1032,7 @@
\end{aligned}
\right.
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[jot=2ex]
@@ -1005,8 +1051,8 @@
\Definition{interline} est fournie. Il est possible d'utiliser un ressort (\emph{skip})
pour cette option.
%
-\begin{Verbatim}
-$\begin{WithArrows}[~emphase#interline=2ex@]
+\begin{Code}
+$\begin{WithArrows}[\emph{interline=2ex}]
\varphi(x,y) = 0 & \Leftrightarrow (x+y)^2 + (x+2y)^2 = 0
\Arrow{$x$ et $y$ sont réels}\\
& \Leftrightarrow \left\{
@@ -1016,7 +1062,7 @@
\end{aligned}
\right.
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[interline=2ex]
@@ -1055,14 +1101,15 @@
La valeur |c| peut être utile, par exemple, si on souhaite mettre une accolade :
\smallskip
+% Dans le code suivant, on ne peut utiliser {Code} avec \emph{} à cause du \{...
\begin{Verbatim}
-On pose\enskip $~emphase#\left\{@
+On pose\enskip $~emphase#{\left\{@
\begin{WithArrows}[~emphase#c@]
f(x) & = 3x^3+2x^2-x+4
\Arrow[tikz=-]{les deux sont des polynômes}\\
g(x) & = 5x^2-5x+6
\end{WithArrows}
-~emphase#\right.@$
+~emphase#\right.@
\end{Verbatim}
@@ -1080,7 +1127,8 @@
Là aussi, il est possible de changer ce comportement avec |\WithArrowsOptions|:
-\quad |\WithArrowsOptions{displaystyle}|.
+\smallskip
+|\WithArrowsOptions{displaystyle}|.
\smallskip
@@ -1091,7 +1139,7 @@
\begin{aligned}
\sum_{i=1}^n (x_i+1)^2
& = \sum_{i=1}^n (x_i^2 + 2x_i+1) \\
-& = \sum_{i=1}^n x_i^2 + 2 \sum_{i=1}^nx_i + n
+& = \sum_{i=1}^n x_i^2 + 2 \sum_{i=1}^n x_i + n
\end{aligned}
\right.$
@@ -1098,9 +1146,7 @@
\medskip
L'exemple suivant est composé avec |{WithArrows}[c,displaystyle]|. Les résultats
-sont parfaitement identiques.\footnote{Dans les versions de l'\pkg{amsmath} antérieures au
-5~novembre~2016, un espace fin était ajouté sur la gauche de l'environnement |{aligned}|.
-Les versions plus récentes n'ajoutent pas d'espace et |{WithArrows}| non plus.}\par\nobreak
+sont parfaitement identiques.\par\nobreak
\smallskip
$\left\{
@@ -1107,7 +1153,7 @@
\begin{WithArrows}[c,displaystyle]
\sum_{i=1}^n (x_i+1)^2
& = \sum_{i=1}^n (x_i^2 + 2x_i+1) \\
-& = \sum_{i=1}^n x_i^2 + 2 \sum_{i=1}^nx_i + n
+& = \sum_{i=1}^n x_i^2 + 2 \sum_{i=1}^n x_i + n
\end{WithArrows}
\right.$
@@ -1121,23 +1167,23 @@
exceptions tout à fait attendues pour |interline|, |code-before| et |code-after|). La commande
|\Arrow| peut être utilisée dans chaque environnement |{WithArrows}|.
-\begin{Verbatim}[formatcom=\small\color{gray}]
-$~emphase#\begin{WithArrows}@
+\begin{Code}
+$\emph{\begin{WithArrows}}
\varphi(x,y)=0
& \Leftrightarrow (x+2y)^2+(2x+4y)^2 = 0 \Arrow{les nombres sont réels}\\
& \Leftrightarrow
- \left\{~emphase#\begin{WithArrows}@[c]
+ \left\{\emph{\begin{WithArrows}}[c]
x+2y & = 0 \\
2x+4y & = 0
- ~emphase#\end{WithArrows}@\right. \\
+ \emph{\end{WithArrows}}\right. \\
& \Leftrightarrow
- \left\{~emphase#\begin{WithArrows}@[c]
+ \left\{\emph{\begin{WithArrows}}[c]
x+2y & = 0 \Arrow[tikz=-]{la même équation}\\
x+2y & = 0
- ~emphase#\end{WithArrows}@\right. \\
+ \emph{\end{WithArrows}}\right. \\
& \Leftrightarrow x+2y=0
-~emphase#\end{WithArrows}@$
-\end{Verbatim}
+\emph{\end{WithArrows}}$
+\end{Code}
$\begin{WithArrows}
\varphi(x,y)=0
@@ -1223,13 +1269,13 @@
sous-environnement \no $2$ (et, par conséquent, la spécification est |2-2|). Nous pouvons
tracer la flèche avec une commande |\Arrow| dans le |code-after| de la manière suivante :
-\begin{Verbatim}
-$\begin{WithArrows}[~emphase#code-after = \Arrow{1-2}{2-2}{division par $2$}@ ]
+\begin{Code}
+$\begin{WithArrows}[\emph{code-after = \Arrow{1-2}{2-2}{division par $2$}}]
\varphi(x,y)=0
& \Leftrightarrow (x+2y)^2+(2x+4y)^2 = 0 \\
.........
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[code-after = \Arrow{1-2}{2-2}{division par $2$} ]
\varphi(x,y)=0
@@ -1258,13 +1304,13 @@
en compte contrairement à ce qui se passe avec l'option |i|. Pour le moment, l'option |i|
n'est pas disponible pour la commande~|\Arrow| dans le |code-after|. Néanmoins, il est
toujours possible de déplacer une flèche avec |xoffset| (ou |xshift| de Tikz).
-\begin{Verbatim}
-$\begin{WithArrows}[code-after=\Arrow~emphase#[v]@{1-2}{2-2}{division by $2$}]
+\begin{Code}
+$\begin{WithArrows}[code-after=\Arrow\emph{[v]}{1-2}{2-2}{division by $2$}]
\varphi(x,y)=0
& \Leftrightarrow (x+2y)^2+(2x+4y)^2 = 0 \\
.........
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[code-after = \Arrow[v]{1-2}{2-2}{division par $2$} ]
\varphi(x,y)=0
@@ -1290,9 +1336,9 @@
|\MultiArrow|. La syntaxe utilisée pour décrire cette liste est celle de la commande
|\foreach| de \pkg{pgffor}.
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}[tikz = rounded corners,
- code-after = {~emphase#\MultiArrow{1,...,4}{text}@} ]
+ code-after = {\emph{\MultiArrow{1,...,4}{text}}} ]
A & = B \\
& = C \\
& = D \\
@@ -1299,7 +1345,7 @@
& = E \\
& = F
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[tikz = rounded corners,
@@ -1329,7 +1375,7 @@
\smallskip
À titre d'illustration, nous donnons un exemple d'environnements |{WithArrows}| imbriqués
et, pour chaque nœud de droite, le nom de ce nœud.\footnote{Il existe une option
- |show-node-names| pour faire afficher les noms de ces nœuds.}
+ \Definition{show-node-names} pour faire afficher les noms de ces nœuds.}
\medskip
@@ -1440,14 +1486,14 @@
Dans l'exemple suivant, on crée des environnements |{WithArrows}| nommés «|premier|» et
«|second|» et on dessine une flèche entre un nœud du premier et un nœud du second.
-\begin{Verbatim}
-$\begin{WithArrows}[~emphase#name=premier@]
+\begin{Code}
+$\begin{WithArrows}[\emph{name=premier}]
A & = B \\
& = C
\end{WithArrows}$
\bigskip
-$\begin{WithArrows}[~emphase#name=second@]
+$\begin{WithArrows}[\emph{name=second}]
A' & = B' \\
& = C'
\end{WithArrows}$
@@ -1454,10 +1500,10 @@
\begin{tikzpicture}[remember picture,overlay]
\draw [WithArrows/arrow]
- ([xshift=3mm]~emphase#premier at -1-r.south)
- to ([xshift=3mm]~emphase#second at -1-r.north) ;
+ ([xshift=3mm]\emph{premier}-1-r.south)
+ to ([xshift=3mm]\emph{second}-1-r.north) ;
\end{tikzpicture}
-\end{Verbatim}
+\end{Code}
\begin{center}
@@ -1483,19 +1529,19 @@
\label{DispWithArrows}
Comme dit précédemment, l'environnement |{WithArrows}| présente des similitudes avec
-l'environnement |{aligned}| de l'\pkg{amsmath} (et de |mathtools|). L'extension
+l'environnement |{aligned}| de l'extension \pkg{amsmath} (et de |mathtools|). L'extension
\pkg{witharrows} fournit aussi un environnement \Definition{\{DispWithArrows\}} qui est
-similaire aux environnements |{align}| et |{flalign}| de l'\pkg{amsmath}.
+similaire aux environnements |{align}| et |{flalign}| de l'extension \pkg{amsmath}.
\medskip
L'environnement |{DispWithArrows}| doit être utilisé \emph{hors} du mode mathématique.
Comme |{align}|, il doit être utilisé en mode horizontal.
-\begin{Verbatim}
-\begin{~emphase#DispWithArrows@}
+\begin{Code}
+\begin{\emph{DispWithArrows}}
A & = (a+1)^2 \Arrow{on développe} \\
& = a^2 + 2a + 1
-\end{~emphase#DispWithArrows@}
-\end{Verbatim}
+\end{\emph{DispWithArrows}}
+\end{Code}
\begin{DispWithArrows}
A & = (a+1)^2 \Arrow{on développe} \\
& = a^2 + 2a + 1
@@ -1502,22 +1548,22 @@
\end{DispWithArrows}
\medskip
-Il est possible d'utiliser la commande \DefinitionCommande{notag} (ou |\nonumber|) pour
-supprimer un numéro d'équation.
+Il est possible d'utiliser la commande \DefinitionCommande{notag} (ou
+\DefinitionCommande{nonumber}) pour supprimer un numéro d'équation.
-Il est possible d'utiliser la commande \DefinitionCommande{tag} pour placer une étiquette
-spéciale (par ex. $\star$).
+Il est possible d'utiliser la commande \DefinitionCommande{tag} pour placer une étiquette
+spéciale (par ex. $\star$).
-Il est aussi possible de placer un label pour une ligne de l'environnement avec la commande
-\DefinitionCommande{label}.
+Il est aussi possible de placer un label pour une ligne de l'environnement avec la
+commande \DefinitionCommande{label}.
Ces commandes doivent être utilisées dans la dernière colonne de l'environnement.
-\begin{Verbatim}
+\begin{Code}
\begin{DispWithArrows}
-A & = (a+1)^2 \Arrow{on développe} ~emphase#\notag@ \\
- & = a^2 + 2a + 1 ~emphase#\tag{$\star$} \label{mon-équation}@
+A & = (a+1)^2 \Arrow{on développe} \emph{\notag} \\
+ & = a^2 + 2a + 1 \emph{\tag{$\star$} \label{mon-équation}}
\end{DispWithArrows}
-\end{Verbatim}
+\end{Code}
\begin{DispWithArrows}
A & = (a+1)^2 \Arrow{on développe} \notag \\
& = a^2 + 2a + 1 \tag{$\star$} \label{mon-équation}
@@ -1532,12 +1578,12 @@
mettre le symbole |\square| de \pkg{amssymb}. Ce symbole est souvent utilisé pour marquer
la fin d'une démonstration.\footnote{Signalons que l'environnement |{DispWithArrows}| est
compatible avec la commande |\qedhere| de \pkg{amsthm}.}
-\begin{Verbatim}
+\begin{Code}
\begin{DispWithArrows}
A & = (a+1)^2 \Arrow{on développe} \notag \\
- & = a^2 + 2a + 1 ~emphase#\tag*{$\square$}@
+ & = a^2 + 2a + 1 \emph{\tag*{$\square$}}
\end{DispWithArrows}
-\end{Verbatim}
+\end{Code}
\begin{DispWithArrows}
A & = (a+1)^2 \Arrow{on développe} \notag \\
& = a^2 + 2a + 1 \tag*{$\square$}
@@ -1545,18 +1591,18 @@
\medskip
Il est également possible de supprimer tous les numéros d'équations avec l'option
-booléenne \Definition{notag} (ou |nonumber|), au niveau global ou bien au niveau d'un
+booléenne \Definition{notag} (ou \Definition{nonumber}), au niveau global ou bien au niveau d'un
environnement.
Enfin, il existe aussi un environnement \Definition{\{DispWithArrows*\}} qui supprime tous
les numéros.\footnote{Même dans ce cas, il est possible de mettre une étiquette
manuellement avec la commande |\tag|.}
-\begin{Verbatim}
-\begin{~emphase#DispWithArrows*@}
+\begin{Code}
+\begin{\emph{DispWithArrows*}}
A & = (a+1)^2 \Arrow{on développe} \\
& = a^2 + 2a + 1
-\end{~emphase#DispWithArrows*@}
-\end{Verbatim}
+\end{\emph{DispWithArrows*}}
+\end{Code}
\begin{DispWithArrows*}
A & = (a+1)^2 \Arrow{on développe} \\
& = a^2 + 2a + 1
@@ -1569,13 +1615,13 @@
numérotage des équations). Par exemple, avec l'option |tagged-lines = {first,3,last}|,
seulement la première, la troisième et la dernière lignes seront numérotées. Il y a aussi
une valeur spéciale |all| qui signifie que toutes les lignes doivent être numérotées.
-\begin{Verbatim}
-\begin{DispWithArrows}[~emphase#tagged-lines = last@]
+\begin{Code}
+\begin{DispWithArrows}[\emph{tagged-lines = last}]
A & = A_1 \Arrow{première étape} \\
& = A_2 \Arrow{deuxième étape} \\
& = A_3
\end{DispWithArrows}
-\end{Verbatim}
+\end{Code}
\begin{DispWithArrows}[tagged-lines = last]
A & = A_1 \Arrow{première étape} \\
& = A_2 \Arrow{deuxième étape} \\
@@ -1589,12 +1635,12 @@
|\mathindent| de LaTeX). La valeur initiale pour cette option est de 25~pt. On peut y
mettre comme valeur un ressort (= \emph{skip} = \emph{glue}).
-\begin{Verbatim}
-\begin{DispWithArrows}[~emphase#fleqn,mathindent = 1cm@]
+\begin{Code}
+\begin{DispWithArrows}[\emph{fleqn,mathindent = 1cm}]
A & = (a+1)^2 \Arrow{on développe} \\
& = a^2 + 2a + 1
\end{DispWithArrows}
-\end{Verbatim}
+\end{Code}
\begin{DispWithArrows}[fleqn,mathindent = 1cm]
A & = (a+1)^2 \Arrow{on développe} \\
& = a^2 + 2a + 1
@@ -1629,8 +1675,8 @@
|\WithArrowsOptions|. Chacun des environnements suivants sera alors sous-numéroté (dans la
portée de la commande |WithArrowsOptions|).
-\begin{Verbatim}
-~emphase#\WithArrowsOptions{subequations}@
+\begin{Code}
+\emph{\WithArrowsOptions{subequations}}
Premier environnement.
\begin{DispWithArrows}
A & = B \\
@@ -1641,7 +1687,7 @@
D & = E \\
& = F
\end{DispWithArrows}
-\end{Verbatim}
+\end{Code}
%
\begin{scope}
\WithArrowsOptions{subequations}
@@ -1660,21 +1706,21 @@
\bigskip
S'il n'y a pas suffisamment de place pour faire appraraître le numéro d'équation à la fin
de la ligne, il n'y a pas de positionnement automatique de ce numéro sur la ligne suivante
-(comme dans les environnements de l'\pkg{amsmath}) : il y aura surimpression de texte.
+(comme dans les environnements de l'extension \pkg{amsmath}) : il y aura surimpression de texte.
Néanmoins, dans |{DispWithArrows}|, l'utilisateur peut utiliser la commande
\DefinitionCommande{tagnextline} pour demander manuellement la composition du numéro sur
la ligne suivante.
-\begin{Verbatim}
+\begin{Code}
\begin{DispWithArrows}[displaystyle]
S_{2(p+1)}
& =\sum_{k=1}^{2(p+1)} (-1)^k k^2 \\
& \smash[b]{=\sum_{k=1}^{2p}(-1)^kk²
- +(-1)^{2p+1}(2p+1)^2+(-1)^{2p+2}(2p+2)^2} ~emphase#\tagnextline@ \\
+ +(-1)^{2p+1}(2p+1)^2+(-1)^{2p+2}(2p+2)^2} \emph{\tagnextline} \\
&= S_{2p}-(2p+1)^2+(2p+2)^2\\
&=p(2p+1)-(2p+1)^2+(2p+2)^2\\
&= 2p^2+5p+3
\end{DispWithArrows}
-\end{Verbatim}
+\end{Code}
\begin{center}
\color{gray}\vrule%
\begin{minipage}{275pt}\color{black}
@@ -1698,25 +1744,25 @@
option \Definition{wrap-lines}. Avec cette option, les lignes de l'étiquette sont
automatiquement coupées à droite.
-\begin{Verbatim}
-\begin{DispWithArrows*}[displaystyle,~emphase#wrap-lines@]
+\begin{Code}
+\begin{DispWithArrows*}[displaystyle,\emph{wrap-lines}]
S_n
-& = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
-\Arrow{somme des termes d'une suite géométrique de raison $e^{i\frac{2\pi}n}$}\\
-& = \frac1n \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}
+& = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+\Arrow{somme des termes d'une suite géométrique de raison $e^{i\frac{2\pi}{n}}$}\\
+& = \frac{1}{n} \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}
{1-e^{i\frac{\pi}{2n}}}\right)
\Arrow{cette ligne de texte a été coupée automatiquement} \\
-& = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+& = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
\end{DispWithArrows*}
-\end{Verbatim}
+\end{Code}
\begin{DispWithArrows*}[displaystyle,wrap-lines]
S_n
-& = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
-\Arrow{somme des termes d'une suite géométrique de raison $e^{i\frac{2\pi}n}$}\\
-& = \frac1n \Re \left(
+& = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+\Arrow{somme des termes d'une suite géométrique de raison $e^{i\frac{2\pi}{n}}$}\\
+& = \frac{1}{n} \Re \left(
\frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}} \right)
\Arrow{cette ligne de texte a été coupée automatiquement} \\
-& = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+& = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
\end{DispWithArrows*}
\bigskip
@@ -1734,50 +1780,55 @@
|standard-behaviour-with-items|.}
\medskip
-Voici un exemple où, avec |{DispWithArrows}|, on peut insérer l'équation dans un environnement
-|{enumerate}| tout en utilisant l'option |wrap-lines|.
+Voici un exemple où, avec |{DispWithArrows}|, on peut insérer l'équation dans un
+environnement |{enumerate}| tout en utilisant l'option |wrap-lines|.
-\begin{Verbatim}
-~emphase#\begin{enumerate}@
-~emphase#\item @
+\smallskip
+\begingroup
+\small
+\begin{Code}
+\emph{\begin{enumerate}
+\item }
\begin{DispWithArrows}%
[displaystyle, wrap-lines, tagged-lines = last, fleqn, mathindent = 0 pt]
S_n
-& = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+& = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
\Arrow{on utilise la formule pour la somme de termes d'une suite géométrique de raison
$e^{i\frac{2\pi}n}$} \\
-& = \frac1n \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}
+& = \frac{1}{n} \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}
{1-e^{i\frac{\pi}{2n}}}\right)
-\Arrow{$\bigl(e^{i\frac{\pi}{2n}}\bigr)^n = e^{i\frac{\pi}2}=i$} \\
-& = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+\Arrow{$\bigl(e^{i\frac{\pi}{2n}}\bigr)^n = e^{i\frac{\pi}{2}}=i$} \\
+& = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
\end{DispWithArrows}
-~emphase#\end{enumerate}@
-\end{Verbatim}
+\emph{\end{enumerate}}
+\end{Code}
+\endgroup
\begin{enumerate}
\item
-\begin{DispWithArrows}[displaystyle, wrap-lines, tagged-lines = last, fleqn, mathindent = 0 pt]
+\begin{DispWithArrows}%
+ [displaystyle, wrap-lines, tagged-lines = last, fleqn, mathindent = 0 pt]
S_n
-& = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
-\Arrow{on utilise la formule pour la somme de termes d'une suite géométrique de raison
+& = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+\Arrow{on utilise la formule pour la somme de termes d'une suite géométrique de raison
$e^{i\frac{2\pi}n}$}\\
-& = \frac1n \Re \left(
+& = \frac{1}{n} \Re \left(
\frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}} \right)
-\Arrow{$\bigl(e^{i\frac{\pi}{2n}}\bigr)^n = e^{i\frac{\pi}2}=i$} \\
-& = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+\Arrow{$\bigl(e^{i\frac{\pi}{2n}}\bigr)^n = e^{i\frac{\pi}{2}}=i$} \\
+& = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
\end{DispWithArrows}
\end{enumerate}
-\vspace{1cm}
+\vspace{1cm}
L'environnement |{DispWithArrows}| est similaire à l'environnement |{align}| de
-l'\pkg{amsmath}. Néanmoins, |{DispWithArrows}| n'est pas construit en utilisant |{align}|
-(en fait, il est possible d'utiliser \pkg{witharrows} sans \pkg{amsmath}).
+l'extension \pkg{amsmath}. Néanmoins, |{DispWithArrows}| n'est pas construit en utilisant
+|{align}| (en fait, il est possible d'utiliser \pkg{witharrows} sans \pkg{amsmath}).
Il y a quelques différences entre |{DispWithArrows}| et |{align}|.
\begin{itemize}
\item L'environnement |{DispWithArrows}| ne peut pas être inséré dans un environment
-|{gather}| de l'\pkg{amsmath}.
+|{gather}| de l'extension \pkg{amsmath}.
\item Un environment |{DispWithArrows}| est toujours insécable (même avec
-|\allowdisplaybreaks| de l'\pkg{amsmath}).
+|\allowdisplaybreaks| de l'extension \pkg{amsmath}).
\item Les commandes |\label|, |\tag|, |\notag| et |\nonumber| ne sont autorisées
que dans la dernière colonne.
\item Après un |\item| d'une liste LaTeX, aucun espace vertical n'est ajouté (cela peut être
@@ -1818,7 +1869,7 @@
\bigskip
On peut alors faire des constructions avec distinctions de cas, comme dans l'exemple
-suivant.\footnote{L'environnement |{cases}| de l'\pkg{amsmath} permet de réaliser de
+suivant.\footnote{L'environnement |{cases}| de l'extension \pkg{amsmath} permet de réaliser de
telles distinctions de cas mais on ne peut pas utiliser la numérotation automatique des
équations. L'environnement |{numcases}| de l'extension \pkg{cases} (de Donald Arseneau)
permet d'utiliser ces numéros d'équations, mais, bien entendu, il n'y a pas de
@@ -1828,14 +1879,14 @@
\medskip
-\begin{BVerbatim}
-\begin{DispWithArrows}~emphase#< \binom{n}{p} = >@[format = ll,fleqn,displaystyle]
+\begin{Code}
+\begin{DispWithArrows}\emph{< \binom{n}{p} = >}[format = ll,fleqn,displaystyle]
0 & \quad \text{si } p > n
\Arrow{ce cas peut en fait rentrer\\ dans le suivant} \\
\frac{n(n-1)\cdots(n-p+1)}{p!} & \quad \text{si } 0 \leq p \leq n \\
0 & \quad \text{si } p < 0
\end{DispWithArrows}
-\end{BVerbatim}
+\end{Code}
%
\begin{DispWithArrows}< \binom{n}{p} = >[format = ll,fleqn,displaystyle]
0 & \quad \text{si } p > n
@@ -1848,14 +1899,14 @@
Dans l'exemple suivant, on sous-numérote les équations d'un système avec l'option
|subequations| (disponible quand l'|amsmath| est chargé).
-\begin{Verbatim}
-\begin{DispWithArrows}~emphase#< \label{système} \ref*{système} \Leftrightarrow >@%
+\begin{Code}
+\begin{DispWithArrows}\emph{< \label{système} \ref*{système} \Leftrightarrow >}%
[format = l, subequations]
x+y+z = -3 \Arrow[tikz=-,jump=2]{3 equations} \\
xy+xz+yz=-2 \\
xyz = -15 \label{dernière-équation}
\end{DispWithArrows}
-\end{Verbatim}
+\end{Code}
%
\begin{DispWithArrows}< \label{système} \ref*{système} \Leftrightarrow >%
[format = l, subequations]
@@ -1875,7 +1926,7 @@
On peut souhaiter remplacer l'accolade gauche par un autre délimiteur extensible (gauche).
On peut le faire avec l'option \Definition{replace-left-brace-by}. Par exemple,
«|replace-left-brace-by = [\enskip|» va composer avec un crochet et ajouter aussi un
-espace de 1~em après le crochet.
+espace de 0.5~em après le crochet.
\bigskip
\section{Fonctionnalités avancées}
@@ -1887,11 +1938,12 @@
\smallskip
Si l'extension \pkg{witharrows} est utilisée avec Beamer, la commande |\Arrow| accepte un
argument entre chevrons (après l'argument optionnel entre crochets) pour indiquer les
-«overlays» concernés.
+«\emph{overlays}» concernés (en interne, \pkg{witharrows} utilise simplement la commande
+|\only| de Beamer).
-\begin{Verbatim}
-\Arrow[jump=2]~emphase#<3->@{Exemple}
-\end{Verbatim}
+\begin{Code}
+\Arrow[jump=2]\emph{<3->}{Exemple}
+\end{Code}
\subsection{Utilisation avec plain-TeX}
\label{plain-TeX}
@@ -1953,23 +2005,23 @@
\bigskip
Dans l'exemple suivant, nous remplaçons le chemin par défaut par un chemin avec trois
segments (et un nœud recouvrant le deuxième segment).
-\begin{Verbatim}
+\begin{Code}
\begin{WithArrows}[format=c,ygap=5pt,interline=4mm,
- ~emphase#tikz-code = {\draw[rounded corners]@
- ~emphase# (~#1) -- ([xshift=5mm]~#1)@
- ~emphase# -- node[circle,@
- ~emphase# draw,@
- ~emphase# auto = false,@
- ~emphase# fill = gray!50,@
- ~emphase# inner sep = 1pt] {\tiny ~#3}@
- ~emphase# ([xshift=5mm]~#2)@
- ~emphase# -- (~#2) ; }@]
+ \emph{tikz-code = {\draw[rounded corners]
+ (#1) -- ([xshift=5mm]#1)
+ -- node[circle,
+ draw,
+ auto = false,
+ fill = gray!50,
+ inner sep = 1pt] {\tiny #3}
+ ([xshift=5mm]#2)
+ -- (#2) ; }}]
3 (2x+4) = 6 \Arrow{$\div 3$} \\
2x+4 = 2 \Arrow{$-4$} \\
2x = -2 \Arrow{$\div 2$} \\
x = -1
\end{WithArrows}
-\end{Verbatim}
+\end{Code}
\[\begin{WithArrows}[format=c,
@@ -2051,8 +2103,8 @@
environnement |{WithArrows}| individuel) le débord vers la droite est pris en compte dans
le calcul des dimensions de la boîte englobante.
-\begin{Verbatim}
-$\left\{\begin{WithArrows}[c,format = rCrCl,~emphase#right-overlap=false@]
+\begin{Code}
+$\left\{\begin{WithArrows}[c,format = rCrCl,\emph{right-overlap=false}]
2x & + & 3y & = & 5 \Arrow{on ajoute $L_1$ à $L_2$}\\
-2x & - & 5y & = & 2
\end{WithArrows}\right.$\quad
@@ -2060,7 +2112,7 @@
2x & + & 3y & = & 5 \\
& - & 2y & = & 7
\end{WithArrows}\right.$
-\end{Verbatim}
+\end{Code}
\medskip
$\left\{\begin{WithArrows}[c,format = rCrCl,right-overlap=false]
@@ -2125,12 +2177,12 @@
\bigskip
Voici par exemple le comportement sans le mécanisme de |start-adjust| et
|end-adjust| :
-\begin{Verbatim}
-$\begin{WithArrows}~emphase#[start-adjust=0pt, end-adjust=0pt]@
+\begin{Code}
+$\begin{WithArrows}\emph{[start-adjust=0pt, end-adjust=0pt]}
A & = (a+1)^2 \Arrow{on développe} \\
& = a^2 + 2a + 1
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
$\begin{WithArrows}[start-adjust=0pt, end-adjust=0pt]
A & = (a+1)^2 \Arrow{on développe} \\
@@ -2161,8 +2213,8 @@
initiale de ce paramètre est égale à~$2$~cm.
Dans l'exemple suivant, la valeur de |max-length-of-arrow| a été fixée à $1.5$~cm.
-\begin{Verbatim}
-\[\begin{WithArrows}[~emphase#max-length-of-arrow = 1.5cm@]
+\begin{Code}
+\[\begin{WithArrows}[\emph{max-length-of-arrow = 1.5cm}]
A
& =
\begin{vmatrix}
@@ -2187,7 +2239,7 @@
0 & e-a & e^2-a^2 & e^3-a^3 & e^4-a^4
\end{vmatrix}
\end{WithArrows}\]
-\end{Verbatim}
+\end{Code}
\bigskip
@@ -2328,30 +2380,30 @@
souvenir que la commande |\MoveEqLeft| a aussi la valeur d'une esperluette (|&|). Il faut
en tenir compte pour le positionnement d'une éventuelle commande |\Arrow|.
-
-%
-\begin{Verbatim}[formatcom=\small\color{gray}]
+\begingroup
+\small
+\begin{Code}
$\begin{WithArrows}[interline=0.5ex]
-~emphase#\MoveEqLeft@ \arccos(x) = \arcsin \frac45 + \arcsin \frac5{13}
-\Arrow{parce que les deux sont dans $[-\frac{\pi}2,\frac{\pi}2]$} \\
-& \Leftrightarrow x = \sin\left(\arcsin\frac45 + \arcsin\frac5{13}\right) \\
-& \Leftrightarrow x = \frac45\cos\arcsin\frac5{13} + \frac5{13} \cos\arcsin\frac45
+\emph{\MoveEqLeft} \arccos(x) = \arcsin \frac{4}{5} + \arcsin \frac{5}{13}
+\Arrow{parce que les deux sont dans $[-\frac{\pi}{2},\frac{\pi}{2}]$} \\
+& \Leftrightarrow x = \sin\left(\arcsin\frac{4}{5} + \arcsin\frac{5}{13}\right) \\
+& \Leftrightarrow x = \frac{4}{5}\cos\arcsin\frac{5}{13}+\frac{5}{13}\cos\arcsin\frac{4}{5}
\Arrow{$\forall x \in [-1,1], \cos(\arcsin x) = \sqrt{1-x^2}$} \\
-& \Leftrightarrow x = \frac45\sqrt{1-\bigl(\frac5{13}\bigr)^2}
-+ \frac5{13}\sqrt{1-\bigl(\frac45\bigr)^2}
+& \Leftrightarrow x = \frac{4}{5}\sqrt{1-\bigl(\frac{5}{13}\bigr)^2}
++ \frac{5}{13}\sqrt{1-\bigl(\frac{4}{5}\bigr)^2}
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
+\endgroup
-
\medskip
$\begin{WithArrows}[interline=0.5ex]
-\MoveEqLeft \arccos(x) = \arcsin \frac45 + \arcsin \frac5{13}
-\Arrow{parce que les deux sont dans \([-\frac{\pi}2,\frac{\pi}2]\)} \\
-& \Leftrightarrow x = \sin\left(\arcsin\frac45 + \arcsin\frac5{13}\right) \\
-& \Leftrightarrow x = \frac45\cos\arcsin\frac5{13} + \frac5{13} \cos\arcsin\frac45
+\MoveEqLeft \arccos(x) = \arcsin \frac{4}{5} + \arcsin \frac{5}{13}
+\Arrow{parce que les deux sont dans \([-\frac{\pi}{2},\frac{\pi}{2}]\)} \\
+& \Leftrightarrow x = \sin\left(\arcsin\frac{4}{5} + \arcsin\frac{5}{13}\right) \\
+& \Leftrightarrow x = \frac{4}{5}\cos\arcsin\frac{5}{13} + \frac{5}{13} \cos\arcsin\frac{4}{5}
\Arrow{\(\forall x \in [-1,1], \cos(\arcsin x) = \sqrt{1-x^2}\)} \\
-& \Leftrightarrow x = \frac45\sqrt{1-\bigl(\frac5{13}\bigr)^2}
-+ \frac5{13}\sqrt{1-\bigl(\frac45\bigr)^2}
+& \Leftrightarrow x = \frac{4}{5}\sqrt{1-\bigl(\frac{5}{13}\bigr)^2}
++ \frac{5}{13}\sqrt{1-\bigl(\frac{4}{5}\bigr)^2}
\end{WithArrows}$
@@ -2363,13 +2415,13 @@
l'une de l'autre.
\bigskip
-\begin{Verbatim}
+\begin{Code}
\NewDocumentCommand \DoubleArrow { O {} m m }
{
- \Arrow[tikz=->,~#1]{~#2}%
- \Arrow[o,tikz=<-,~#1]{~#3}
+ \Arrow[tikz=->,#1]{#2}%
+ \Arrow[o,tikz=<-,#1]{#3}
}
-\end{Verbatim}
+\end{Code}
\NewDocumentCommand \DoubleArrow { O {} m m }
@@ -2382,12 +2434,12 @@
\bigskip
Exemple d'utilisation :
-\begin{Verbatim}
+\begin{Code}
$\begin{WithArrows}[groups]
A & = (a+b)^2 \DoubleArrow[tikz={font=\bfseries}]{développement}{factorisation} \\
& = a^2 + 2ab+b^2
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
\bigskip
$\begin{WithArrows}[groups]
@@ -2404,22 +2456,22 @@
Il est possible de changer la forme des étiquettes, qui sont des nœuds Tikz, en
modifiant la clé «|every node|» de Tikz.
-\begin{Verbatim}
+\begin{Code}
\begin{WithArrows}%
[format = c,
interline = 4mm,
- tikz = {~emphase#every node/.style = {circle,@
- ~emphase# draw,@
- ~emphase# auto = false,@
- ~emphase# fill = gray!50,@
- ~emphase# inner sep = 1pt,@
- ~emphase# font = \tiny}@}]
+ tikz = {\emph{every node/.style = {circle,
+ draw,
+ auto = false,
+ fill = gray!50,
+ inner sep = 1pt,
+ font = \tiny}}}]
3 (2x+4) = 6 \Arrow{$\div 3$} \\
2x+4 = 2 \Arrow{$-4$} \\
2x = -2 \Arrow{$\div 2$} \\
2x = -1
\end{WithArrows}
-\end{Verbatim}
+\end{Code}
\[\begin{WithArrows}[%
format = c,
@@ -2458,18 +2510,18 @@
instructions |\path| : la première instruction trace la flèche elle-même et la seconde
place l'étiquette dans un nœud Tikz dans le rectangle délimité par la flèche.
-\begin{Verbatim}
+\begin{Code}
\begin{DispWithArrows*}%
[displaystyle,
ygap = 2mm,
ystart = 0mm,
- ~emphase#tikz-code = {\draw (~#1) -- ++(4.5cm,0) |- (~#2) ;@
- ~emphase# \path (~#1) -- (~#2) @
- ~emphase# node[text width = 4.2cm, right, midway] {~#3} ;}@]
+ \emph{tikz-code = {\draw (#1) -- ++(4.5cm,0) |- (#2) ;
+ \path (#1) -- (#2)
+ node[text width = 4.2cm, right, midway] {#3} ;}}]
S_n
-& = \frac1n \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}2\cdot\tfrac kn\bigr)
+& = \frac{1}{n} \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}{2}\cdot\tfrac{k}{n}\bigr)
...........
-\end{Verbatim}
+\end{Code}
\bigskip
@@ -2481,16 +2533,16 @@
\path (#1) -- (#2)
node[text width = 4.2cm, right, midway] {#3} ;}]
S_n
-& = \frac1n \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}2\cdot\tfrac kn\bigr)
+& = \frac{1}{n} \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}{2}\cdot\tfrac kn\bigr)
\Arrow{$\cos x = \Re(e^{ix})$}\\
-& = \frac1n\sum_{k=0}^{n-1} \Re\left(e^{i\frac{k\pi}{2n}}\right)
+& = \frac{1}{n} \sum_{k=0}^{n-1} \Re\left(e^{i\frac{k\pi}{2n}}\right)
\Arrow{$\Re(z+z')=\Re(z)+\Re(z')$}\\
-& = \frac1n \Re\left(\sum_{k=0}^{n-1} e^{i\frac{k\pi}{2n}}\right)
+& = \frac{1}{n} \Re\left(\sum_{k=0}^{n-1} e^{i\frac{k\pi}{2n}}\right)
\Arrow{$\exp$ est un morphisme pour $\times$ et $+$} \\
-& = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+& = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
\Arrow{somme de termes d'une suite géométrique de raison $e^{i\frac{2\pi}n}$}\\
-& = \frac1n \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}}\right)\\
-& = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+& = \frac{1}{n} \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}}\right)\\
+& = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
\end{DispWithArrows*}
\bigskip
@@ -2505,26 +2557,26 @@
commande et non d'une dimension). Pour la lisibilité, nous avons utilisé un style de
\pkg{witharrows}. Cet exemple nécessite l'extension Tikz \pkg{calc}.
-\begin{Verbatim}
+\begin{Code}
\WithArrowsNewStyle{MonStyle}
{displaystyle,
ygap = 2mm,
xoffset = 0pt,
ystart = 0mm,
- tikz-code = {\path let \p1 = (~#~#1)
- in (~#~#1)
+ tikz-code = {\path let \p1 = (#1)
+ in (#1)
-- node [anchor = west,
- text width = {~emphase#\WithArrowsRightX@ - \x1 - 0.5 em}]
- {~#~#3}
- (~#~#2) ;
- \draw let \p1 = (~#~#1)
- in (~#~#1) -- ++(~emphase#\WithArrowsRightX@ - \x1,0) |- (~#~#2) ; }}
-\end{Verbatim}
+ text width = {\emph{\WithArrowsRightX} - \x1 - 0.5 em}]
+ {#3}
+ (#2) ;
+ \draw let \p1 = (#1)
+ in (#1) -- ++(\emph{\WithArrowsRightX} - \x1,0) |- (#2) ; }}
+\end{Code}
\begin{Verbatim}
\begin{DispWithArrows}[MonStyle]
S_n
- & = \frac1n \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}2\cdot\tfrac kn\bigr)
+ & = \frac{1}{n} \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}{2}\cdot\tfrac{k}{n}\bigr)
\Arrow{$\cos x = \Re(e^{ix})$}\\
...........
\end{Verbatim}
@@ -2534,26 +2586,26 @@
ygap = 2mm,
xoffset = 0pt,
ystart = 0mm,
- tikz-code = {\path let \p1 = (##1)
- in (##1)
+ tikz-code = {\path let \p1 = (#1)
+ in (#1)
-- node [anchor = west,
- text width = {\WithArrowsRightX - \x1 - 0.5 em}] {##3}
- (##2) ;
- \draw let \p1 = (##1)
- in (##1) -- ++(\WithArrowsRightX - \x1,0) |- (##2) ; }}
+ text width = {\WithArrowsRightX - \x1 - 0.5 em}] {#3}
+ (#2) ;
+ \draw let \p1 = (#1)
+ in (#1) -- ++(\WithArrowsRightX - \x1,0) |- (#2) ; }}
\begin{DispWithArrows}[MonStyle]
S_n
-& = \frac1n \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}2\cdot\tfrac kn\bigr)
+& = \frac{1}{n} \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}{2}\cdot\tfrac{k}{n}\bigr)
\Arrow{$\cos x = \Re(e^{ix})$}\\
-& = \frac1n\sum_{k=0}^{n-1} \Re\left(e^{i\frac{k\pi}{2n}}\right)
+& = \frac{1}{n} \sum_{k=0}^{n-1} \Re\left(e^{i\frac{k\pi}{2n}}\right)
\Arrow{$\Re(z+z')=\Re(z)+\Re(z')$}\\
-& = \frac1n \Re\left(\sum_{k=0}^{n-1} e^{i\frac{k\pi}{2n}}\right)
+& = \frac{1}{n} \Re\left(\sum_{k=0}^{n-1} e^{i\frac{k\pi}{2n}}\right)
\Arrow{$\exp$ est un morphisme pour $\times$ et $+$} \\
-& = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+& = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
\Arrow{somme de termes d'une suite géométrique $e^{i\frac{2\pi}n}$}\\
-& = \frac1n \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}}\right)\\
-& = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+& = \frac{1}{n} \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}}\right)\\
+& = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
\end{DispWithArrows}
@@ -2566,23 +2618,23 @@
\pkg{calc} de Tikz.
-\begin{Verbatim}
+\begin{Code}
\begin{WithArrows}[ll,interline=5mm,xoffset=5mm,
- ~emphase#tikz-code = {\draw[rounded corners,@
- ~emphase# every node/.style = {circle,@
- ~emphase# draw,@
- ~emphase# auto = false,@
- ~emphase# inner sep = 1pt,@
- ~emphase# fill = gray!50,@
- ~emphase# font = \tiny }]@
- ~emphase# let \p1 = (~#1),@
- ~emphase# \p2 = (~#2)@
- ~emphase# and \ifdim \x1 > \x2@
- ~emphase# (\p1) -- node {~#3} (\x1,\y2) -- (\p2)@
- ~emphase# \else@
- ~emphase# (\p1) -- (\x2,\y1) -- node {~#3} (\p2)@
- ~emphase# \fi ;}@]
-E & \Longleftrightarrow \frac{(x+4)}3 + \frac{5x+3}5 = 7
+ \emph{tikz-code = {\draw[rounded corners,
+ every node/.style = {circle,
+ draw,
+ auto = false,
+ inner sep = 1pt,
+ fill = gray!50,
+ font = \tiny }]
+ let \p1 = (#1),
+ \p2 = (#2)
+ and \ifdim \x1 > \x2
+ (\p1) -- node {#3} (\x1,\y2) -- (\p2)
+ \else
+ (\p1) -- (\x2,\y1) -- node {#3} (\p2)
+ \fi ;}}]
+E & \Longleftrightarrow \frac{(x+4)}{3} + \frac{5x+3}{5} = 7
\Arrow{$\times 15$}\\
& \Longleftrightarrow 5(x+4) + 3(5x+3) = 105 \\
& \Longleftrightarrow 5x+20 + 15x+9 = 105 \\
@@ -2592,7 +2644,7 @@
\Arrow{$\div 20$}\\
& \Longleftrightarrow x = \frac{38}{10}
\end{WithArrows}
-\end{Verbatim}
+\end{Code}
\[\begin{WithArrows}[ll,interline=5mm,xoffset=5mm,
@@ -2610,7 +2662,7 @@
\else
(\p1) -- (\x2,\y1) -- node {#3} (\p2)
\fi ;}]
-E & \Longleftrightarrow \frac{(x+4)}3 + \frac{5x+3}5 = 7
+E & \Longleftrightarrow \frac{(x+4)}{3} + \frac{5x+3}{5} = 7
\Arrow{$\times 15$}\\
& \Longleftrightarrow 5(x+4) + 3(5x+3) = 105 \\
& \Longleftrightarrow 5x+20 + 15x+9 = 105 \\
@@ -2643,9 +2695,9 @@
d'une commande et non d'un compteur).
-\bigskip
-\begin{Verbatim}
-$\begin{WithArrows}[~emphase#code-after = \NumberedLoop@]
+\medskip
+\begin{Code}
+$\begin{WithArrows}[\emph{code-after = \NumberedLoop}]
a.\;& f \text{ est continue sur } E \\
b.\;& f \text{ est continue en } 0 \\
c.\;& f \text{ est bornée sur la sphère unité} \\
@@ -2652,7 +2704,7 @@
d.\;& \exists K > 0\quad \forall x \in E\quad \|f(x)\| \le K \|x\| \\
e.\;& f \text{ est lipschitzienne}
\end{WithArrows}$
-\end{Verbatim}
+\end{Code}
\bigskip
\begin{scope}
@@ -2678,9 +2730,9 @@
exemple, les numéros entre parenthèses, le moyen le plus rapide est de changer la valeur de
|tikz-code|:
-\begin{Verbatim}
-tikz-code = {\draw (~#1) to node {\footnotesize (~#3)} (~#2) ;}
-\end{Verbatim}
+\begin{Code}
+tikz-code = {\draw (#1) to node {\footnotesize (#3)} (#2) ;}
+\end{Code}
\WithArrowsOptions{tikz-code = {\draw (#1) to node {\footnotesize (#3)} (#2) ;}}
Modified: trunk/Master/texmf-dist/doc/generic/witharrows/witharrows.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/generic/witharrows/witharrows.dtx
===================================================================
--- trunk/Master/texmf-dist/source/generic/witharrows/witharrows.dtx 2024-10-19 14:25:00 UTC (rev 72593)
+++ trunk/Master/texmf-dist/source/generic/witharrows/witharrows.dtx 2024-10-19 20:25:31 UTC (rev 72594)
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{2.9}
-\def\myfiledate{2024/10/05}
+\def\myfileversion{2.9a}
+\def\myfiledate{2024/10/19}
%
%
%<*batchfile>
@@ -47,10 +47,10 @@
%<*driver>
\documentclass[dvipsnames]{l3doc}% dvipsnames is for xcolor (loaded by Tikz)
\VerbatimFootnotes
-\usepackage{xltxtra}
-\usepackage[xetex]{geometry}
+\usepackage{geometry}
\geometry{left=2.8cm,right=2.8cm,top=2.5cm,bottom=2.5cm,papersize={21cm,29.7cm}}
\usepackage[hyperfootnotes=false]{footnotehyper}
+\usepackage{fontspec}
\usepackage[footnotehyper]{witharrows}
\usetikzlibrary{calc}
\usepackage{mathtools}
@@ -68,6 +68,51 @@
{{\setlength{\fboxsep}{1pt}\colorbox{gray!20}{\ttfamily
\vphantom{gl}\textbackslash #1}}}
+
+\usepackage{piton}
+\PitonOptions
+ {
+ language = verbatim ,
+ detected-commands = {emph,textsl} ,
+ splittable = 4
+ }
+
+\SetPitonStyle{ Number = , Comment = }
+
+\ExplSyntaxOn
+
+\dim_new:N \l__pantigny_width_dim
+
+\keys_define:nn { pantigny }
+ { width .dim_set:N = \l__pantigny_width_dim }
+
+\NewPitonEnvironment { Code } { O { } }
+ {
+ \medskip
+ \char_set_catcode_other:N |
+ \cs_set_eq:NN \emph \emphase
+ \dim_zero:N \l__pantigny_width_dim
+ \keys_set:nn { pantigny } { #1 }
+ \color{gray}
+ \PitonOptions { gobble = 2 }
+ \dim_compare:nNnT \l__pantigny_width_dim > \c_zero_dim
+ {
+ \PitonOptions { width = \l__pantigny_width_dim }
+ \begin{minipage}[c]{\l__pantigny_width_dim}
+ }
+ }
+ {
+ \dim_compare:nNnT \l__pantigny_width_dim > \c_zero_dim
+ { \end{minipage} }
+ \medskip
+ }
+
+\ExplSyntaxOff
+
+
+
+
+
\def\interitem{\vspace{7mm plus 2 mm minus 3mm}}
\def\emphase{\bgroup\color{RoyalPurple}\let\next=}
\fvset{commandchars=\~\#\@,formatcom={\color{gray}}}
@@ -81,9 +126,10 @@
%</driver>
% \fi
% \VerbatimFootnotes
-% \title{The package \pkg{witharrows} for plain-TeX and LaTeX\thanks{This document corresponds to the
-% version~\myfileversion\space of \pkg{witharrows}, at the date
-% of~\myfiledate.}} \author{F. Pantigny \\ \texttt{fpantigny at wanadoo.fr}}
+% \title{The package \pkg{witharrows} for plain-TeX and LaTeX\thanks{This
+% document corresponds to the version~\myfileversion\space of \pkg{witharrows},
+% at the date of~\myfiledate.}} \author{F. Pantigny \\
+% \texttt{fpantigny at wanadoo.fr}}
%
% \maketitle
%
@@ -119,11 +165,14 @@
% follows, we describe the LaTeX package.
%
% \medskip
+
% This package can be used with |xelatex|, |lualatex|, |pdflatex| but also by
-% the classical workflow |latex|-|dvips|-|ps2pdf| (or Adobe Distiller). This
-% package loads the packages \pkg{l3keys2e}, \pkg{varwidth}, \pkg{tikz} and the
-% Tikz libraries \pkg{arrows.meta} and \pkg{bending}. The final user only has to
-% load the package with the classical instruction: |\usepackage{witharrows}|.
+% the classical workflow |latex|-|dvips|-|ps2pdf| (or Adobe Distiller).
+% \textsl{However, the file witharrows.dtx of the present documentation should
+% be compiled with LuaLaTeX.} This package loads the packages \pkg{l3keys2e},
+% \pkg{varwidth}, \pkg{tikz} and the Tikz libraries \pkg{arrows.meta} and
+% \pkg{bending}. The final user only has to load the package with the classical
+% instruction: |\usepackage{witharrows}|.
%
% \medskip
% The arrows are drawn with Tikz and that's why \textbf{several compilations may
@@ -131,15 +180,15 @@
% a number compilations sufficient (by using |latexmk|).}
%
% \bigskip
-% This package provides an environment |{WithArrows}| to construct alignments of
-% equations with arrows for the explanations on the right side:
+% This package provides an environment \Definition{\{WithArrows\}} to construct
+% alignments of equations with arrows for the explanations on the right side:
%
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = (a+1)^2 ~emphase#\Arrow{we expand}@ \\
+% A & = (a+1)^2 \emph{\Arrow{we expand}} \\
% & = a^2 + 2a + 1 % <------- don't put \\ here
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = (a+1)^2 \Arrow{we expand} \\
@@ -149,16 +198,17 @@
%
%
% \medskip
-% The arrow has been drawn with the command |\Arrow| on the row from which it
-% starts. The command |\Arrow| must be used in the second column (the best way
-% is to put it at the end of the second cell of the row as in the previous
-% example).
+% The arrow has been drawn with the command \DefinitionCommand{Arrow} on the row
+% from which it starts. The command |\Arrow| must be used in the second column
+% (the best way is to put it at the end of the second cell of the row as in the
+% previous example).
%
% \medskip
% The environment |{WithArrows}| bears similarities with the environment
% |{aligned}| of \pkg{amsmath} (and |mathtools|). The extension \pkg{witharrows}
-% also provides an environment |{DispWithArrows}| which is similar to the
-% environment |{align}| of \pkg{amsmath}: cf. p. \pageref{DispWithArrows}.
+% also provides two environments |{DispWithArrows}| and |{DispWithArrows*}|
+% which are similar to the environments |{align}| and |{align*}| of the package
+% \pkg{amsmath}: cf. p. \pageref{DispWithArrows}.
%
%
% \section{Options for the shape of the arrows}
@@ -166,6 +216,7 @@
% The command |\Arrow| has several options. These options can be put between
% square brackets, before, or after the mandatory argument.
%
+% \medskip
% The option \Definition{jump} gives the number\footnote{It's not possible to
% give a non-positive value to |jump|. See below (p.~\pageref{Backwards}) the
% way to draw an arrow which goes backwards.} of rows the arrow must jump (the
@@ -172,13 +223,13 @@
% default value is, of course,~$1$).
%
%
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = \bigl((a+b)+1\bigr)^2 \Arrow[~emphase#jump=2@]{we expand} \\
+% A & = \bigl((a+b)+1\bigr)^2 \Arrow[\emph{jump=2}]{we expand} \\
% & = (a+b)^2 + 2(a+b) +1 \\
% & = a^2 + 2ab + b^2 + 2a + 2b +1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = \bigl((a+b)+1\bigr)^2 \Arrow[jump=1+1]{we expand} \\
@@ -188,13 +239,13 @@
%
% \interitem
% It's possible to put several arrows starting from the same row.
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = \bigl((a+b)+1\bigr)^2 ~emphase#\Arrow{}\Arrow{}[jump=2]@ \\
+% A & = \bigl((a+b)+1\bigr)^2 \emph{\Arrow{}\Arrow{}[jump=2]} \\
% & = (a+b)^2 + 2(a+b) +1 \\
% & = a^2 + 2ab + b^2 + 2a + 2b +1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = \bigl((a+b)+1\bigr)^2 \Arrow{}\Arrow{}[jump=2] \\
@@ -206,13 +257,13 @@
% The option \Definition{xoffset} shifts the arrow to the right (we usually
% don't want the arrows to be stucked on the text). The initial value of
% |xoffset| is $3$~mm.
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
% A & = \bigl((a+b)+1\bigr)^2
-% \Arrow[~emphase#xoffset=1cm@]{with \texttt{xoffset=1cm}} \\
+% \Arrow[\emph{xoffset=1cm}]{with \texttt{xoffset=1cm}} \\
% & = (a+b)^2 + 2(a+b) +1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = \bigl((a+b)+1\bigr)^2
@@ -226,12 +277,12 @@
% \Definition{tikz} which can be used to give to the arrow (in fact, the command
% |\path| of Tikz) the options proposed by Tikz for such an arrow. The following
% example gives an thick arrow.
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = (a+1)^2 \Arrow[~emphase#tikz=thick@]{we expand} \\
+% A & = (a+1)^2 \Arrow[\emph{tikz=thick}]{we expand} \\
% & = a^2 + 2a + 1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = (a+1)^2 \Arrow[tikz=thick]{we expand} \\
@@ -243,12 +294,12 @@
% which goes backwards with the Tikz option~|<-|.
% \label{Backwards}
%
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = (a+1)^2 \Arrow~emphase#[tikz=<-]@{we factorize} \\
+% A & = (a+1)^2 \Arrow\emph{[tikz=<-]}{we factorize} \\
% & = a^2 + 2a + 1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = (a+1)^2 \Arrow[tikz=<-]{we factorize} \\
@@ -258,12 +309,12 @@
% \interitem
% It's also possible to suppress both tips of the arrow with the Tikz option
% ``|-|''.
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = (a+1)^2 \Arrow[~emphase#tikz=-@]{very classical} \\
+% A & = (a+1)^2 \Arrow[\emph{tikz=-}]{very classical} \\
% & = a^2 + 2a + 1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = (a+1)^2 \Arrow[tikz=-]{very classical} \\
@@ -273,12 +324,12 @@
% \interitem
% In order to have straight arrows instead of curved ones, we must use the Tikz
% option ``|bend left = 0|''.
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = (a+1)^2 \Arrow~emphase#[tikz={bend left=0}]@{we expand} \\
+% A & = (a+1)^2 \Arrow\emph{[tikz={bend left=0}]}{we expand} \\
% & = a^2 + 2a + 1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = (a+1)^2 \Arrow[tikz={bend left=0}]{we expand} \\
@@ -296,14 +347,14 @@
% \setcounter{fnnohyphen}{\thefootnote}
%
% %
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
% A & = \bigl((a+b)+1\bigr)^2
-% \Arrow[jump=2,~emphase#tikz={text width=5.3cm}@]{We have done...} \\
+% \Arrow[jump=2,\emph{tikz={text width=5.3cm}}]{We have done...} \\
% & = (a+b)^2 + 2(a+b) +1 \\
% & = a^2 + 2ab + b^2 + 2a + 2b +1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = \bigl((a+b)+1\bigr)^2
@@ -328,12 +379,12 @@
% beginning of the text, we won't suppress the |\small| and the |\itshape| and
% we will consequently have a text in a bold, italic and small font.
% %
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = (a+1)^2 \Arrow{~emphase#\bfseries@ we expand} \\
+% A & = (a+1)^2 \Arrow{\emph{\bfseries} we expand} \\
% & = a^2 + 2a + 1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = (a+1)^2 \Arrow{\bfseries we expand} \\
@@ -351,12 +402,12 @@
% use the option |tikz={font={\bfseries}}|, the default specification of
% |\small| and |\itshape| will be overwritten.
% %
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = (a+1)^2 \Arrow[~emphase#tikz={font={\bfseries}}@]{we expand} \\
+% A & = (a+1)^2 \Arrow[\emph{tikz={font={\bfseries}}}]{we expand} \\
% & = a^2 + 2a + 1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = (a+1)^2 \Arrow[tikz={font={\bfseries}}]{we expand} \\
@@ -376,13 +427,13 @@
% nested environments |{WithArrows}| (with the logical exceptions of
% |interline|, |code-before| and |code-after|).}
% %
-% \begin{Verbatim}
-% $\begin{WithArrows}[~emphase#tikz=blue@]
+% \begin{Code}
+% $\begin{WithArrows}[\emph{tikz=blue}]
% A & = \bigl((a+b)+1\bigr)^2 \Arrow{first expansion.} \\
% & = (a+b)^2 + 2(a+b) +1 \Arrow{second expansion.} \\
% & = a^2 + 2ab + b^2 + 2a + 2b +1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}[tikz=blue]
% A & = \bigl((a+b)+1\bigr)^2 \Arrow{first expansion.} \\
@@ -405,8 +456,8 @@
% & = \int_0^1 (x^2+2x+1) dx
% \Arrow{linearity of integration} \\
% & = \int_0^1 x^2 dx + 2 \int_0^1 x dx + \int_0^1 dx \\
-% & = \frac13 + 2\frac12 + 1 \\
-% & = \frac73
+% & = \frac{1}{3} + 2\frac{1}{2} + 1 \\
+% & = \frac{7}{3}
% \end{WithArrows}$
% \end{Verbatim}
%
@@ -415,8 +466,8 @@
% & = \int_0^1 (x^2+2x+1) dx
% \Arrow{linearity of integration} \\
% & = \int_0^1 x^2 dx + 2 \int_0^1 x dx + \int_0^1 dx \\
-% & = \frac13 + 2\frac12 + 1 \\
-% & = \frac73
+% & = \frac{1}{3} + 2\frac{1}{2} + 1 \\
+% & = \frac{7}{3}
% \end{WithArrows}$
%
%
@@ -428,8 +479,8 @@
% & = \int_0^1 (x^2+2x+1) dx
% \Arrow{linearity of integration} \\
% & = \int_0^1 x^2 dx + 2 \int_0^1 x dx + \int_0^1 dx \\
-% & = \frac13 + 2\frac12 + 1 \\
-% & = \frac73
+% & = \frac{1}{3} + 2\frac{1}{2} + 1 \\
+% & = \frac{7}{3}
% \end{WithArrows}$
%
%
@@ -444,16 +495,17 @@
% configure \pkg{witharrows} by modifying the Tikz style |WithArrows/arrow|
% which is the style used by \pkg{witharrows} when drawing an arrow. For
% example, to have the labels in blue with roman (upright) types, one can use
-% the following instruction: |\tikzset{WithArrows/arrow/.append style = {blue,font = {}}}|.}
+% the following instruction:
+% |\tikzset{WithArrows/arrow/.append style = {blue,font = {}}}|.}
%
-% \begin{Verbatim}
-% ~emphase#\WithArrowsOptions{displaystyle,tikz=blue}@
+% \begin{Code}
+% \emph{\WithArrowsOptions{displaystyle,tikz=blue}}
% $\begin{WithArrows}
% \sum_{i=1}^n (x_i+1)^2
% & = \sum_{i=1}^n (x_i^2+2x_i+1) \Arrow{by linearity}\\
% & = \sum_{i=1}^n x_i^2 + 2\sum_{i=1}^nx_i+ n
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% \begin{scope}
% \WithArrowsOptions{displaystyle,tikz=blue}
@@ -477,14 +529,14 @@
% purpose. The new name of the command must be given to the option
% \emph{without} the leading backslash.
% %
-% \begin{Verbatim}
+% \begin{Code}
% \NewDocumentCommand {\Arrow} {} {\longmapsto}
-% $\begin{WithArrows}[~emphase#command-name=Explanation@]
+% $\begin{WithArrows}[\emph{command-name=Explanation}]
% f & = \bigl(x \Arrow (x+1)^2\bigr)
-% ~emphase#\Explanation{we work directly on fonctions}@\\
+% \emph{\Explanation{we work directly on fonctions}}\\
% & = \bigl(x \Arrow x^2+2x+1\bigr)
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
% %
% \begin{scope}
% \NewDocumentCommand {\Arrow} {} {\longmapsto}
@@ -503,12 +555,12 @@
% are not designed to be hooks (they are available only at the environment level
% and they do not apply to the nested environments).
% %
-% \begin{Verbatim}
-% $\begin{WithArrows}[~emphase#code-before = \color{blue}@]
+% \begin{Code}
+% $\begin{WithArrows}[\emph{code-before = \color{blue}}]
% A & = (a+b)^2 \Arrow{we expand} \\
% & = a^2 + 2ab + b^2
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}[code-before = \color{blue}]
% A & = (a+b)^2 \Arrow{we expand} \\
@@ -519,8 +571,8 @@
% Special commands are available in |code-after|: a command
% \DefinitionCommand{WithArrowsNbLines} which gives the number of lines (=rows)
% of the current environment (this is a command and not a counter), a special
-% form of the command |\Arrow| and the command |\MultiArrow|: these commands are
-% described in the section concerning the nested environments,
+% form of the command |\Arrow| and the command |\MultiArrow|: the latter two
+% commands are described in the section concerning the nested environments,
% p.~\pageref{NestedEnv}.
%
% \interitem
@@ -542,14 +594,15 @@
% The initial value of the parameter |format| is, in fact, |rL|.
%
% \bigskip
-% For exemple, if we want only one column left-aligned, we use the option |format=l|.
-% \begin{Verbatim}
-% $\begin{WithArrows}[~emphase#format = l@]
+% For exemple, if we want only one column left-aligned, we use the option
+% |format=l|.
+% \begin{Code}
+% $\begin{WithArrows}\emph{[format = l]}
% f(x) \ge g(x) \Arrow{by squaring both sides} \\
% f(x)^2 \ge g(x)^2 \Arrow{by moving to left side} \\
% f(x)^2 - g(x)^2 \ge 0
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}[format = l]
% f(x) \ge g(x) \Arrow{by squaring both sides} \\
@@ -561,8 +614,8 @@
% In the following example, we use five columns all centered (the environment
% |{DispWithArrows*}| is presented p.~\pageref{DispWithArrows}).
%
-% \begin{Verbatim}
-% \begin{DispWithArrows*}[~emphase#format = cCcCc@,
+% \begin{Code}
+% \begin{DispWithArrows*}[\emph{format = cCcCc},
% wrap-lines,
% interline=1mm]
% k & \;\le\; & t & \;\le\; & k+1 \\
@@ -573,7 +626,7 @@
% & \le & \int\limits_k^{k+1} \frac{dt}{k} \\
% \frac{1}{k+1} & \le & \ln(k+1)-\ln(k) & \le & \frac{1}{k}
% \end{DispWithArrows*}
-% \end{Verbatim}
+% \end{Code}
% \begin{DispWithArrows*}[format = cCcCc,
% wrap-lines,
% interline=1mm]
@@ -593,22 +646,22 @@
%
% The environment |{WithArrows}| defines, during the composition of the array,
% two series of nodes materialized in red in the following example.\footnote{The
-% option |show-nodes| can be used to materialize the nodes. The nodes are in
-% fact Tikz nodes of shape ``rectangle'', but with zero width. An arrow between
-% two nodes starts at the \emph{south} anchor of the first node and arrives at
-% the \emph{north} anchor of the second node.}
+% option \Definition{show-nodes} can be used to materialize the nodes. The nodes
+% are in fact Tikz nodes of shape ``rectangle'', but with zero width. An arrow
+% between two nodes starts at the \emph{south} anchor of the first node and
+% arrives at the \emph{north} anchor of the second node.}
%
% \smallskip
% $\begin{WithArrows}[displaystyle,show-nodes]
% I
-% & = \int_{\frac{\pi}4}^0 \ln\Bigl(1+\tan\left(\tfrac{\pi}4-u\right)\Bigr)(-d u) \\
-% & = \int_0^{\frac{\pi}4} \ln\Bigl(1+\tan\left(\tfrac{\pi}4-u\right)\Bigr)d u \\
-% & = \int_0^{\frac{\pi}4}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)\, d u \\
-% & =\int_0^{\frac{\pi}4}\ln\left(\frac{1+\tan u+1-\tan u}{1+\tan u}\right) d u \\
-% & =\int_0^{\frac{\pi}4} \ln\left(\frac2{1+\tan u}\right)\, d u\\
-% & =\int_0^{\frac{\pi}4}\bigl(\ln2-\ln(1+\tan u)\bigr)\, d u \\
-% & =\frac{\pi}4\ln2-\int_0^{\frac{\pi}4}\ln(1+\tan u)\, d u \\
-% & =\frac{\pi}4\ln2-I
+% & = \int_{\frac{\pi}{4}}^0 \ln\Bigl(1+\tan\left(\tfrac{\pi}{4}-u\right)\Bigr)(-d u) \\
+% & = \int_0^{\frac{\pi}{4}} \ln\Bigl(1+\tan\left(\tfrac{\pi}{4}-u\right)\Bigr)d u \\
+% & = \int_0^{\frac{\pi}{4}}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)\, d u \\
+% & =\int_0^{\frac{\pi}{4}}\ln\left(\frac{1+\tan u+1-\tan u}{1+\tan u}\right) d u \\
+% & =\int_0^{\frac{\pi}{4}} \ln\left(\frac{2}{1+\tan u}\right)\, d u\\
+% & =\int_0^{\frac{\pi}{4}}\bigl(\ln2-\ln(1+\tan u)\bigr)\, d u \\
+% & =\frac{\pi}{4}\ln2-\int_0^{\frac{\pi}{4}}\ln(1+\tan u)\, d u \\
+% & =\frac{\pi}{4}\ln2-I
% \end{WithArrows}$
%
% \bigskip
@@ -631,17 +684,17 @@
% Therefore
% $\begin{WithArrows}[displaystyle]
% I
-% & = \int_{\frac{\pi}4}^0 \ln\Bigl(1+\tan\left(\tfrac{\pi}4-u\right)\Bigr)(-d u)
+% & = \int_{\frac{\pi}{4}}^0 \ln\Bigl(1+\tan\left(\tfrac{\pi}{4}-u\right)\Bigr)(-d u)
% \Arrow[lr]{This arrow uses the |lr| option.}\\
-% & = \int_0^{\frac{\pi}4} \ln\Bigl(1+\tan\left(\tfrac{\pi}4-u\right)\Bigr)d u \\
-% & = \int_0^{\frac{\pi}4}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)\, d u \\
-% & =\int_0^{\frac{\pi}4}\ln\left(\frac{1+\tan u+1-\tan u}{1+\tan u}\right) d u
+% & = \int_0^{\frac{\pi}{4}} \ln\Bigl(1+\tan\left(\tfrac{\pi}{4}-u\right)\Bigr)d u \\
+% & = \int_0^{\frac{\pi}{4}}\ln\left(1+\frac{1-\tan u}{1+\tan u}\right)\, d u \\
+% & =\int_0^{\frac{\pi}{4}}\ln\left(\frac{1+\tan u+1-\tan u}{1+\tan u}\right) d u
% \Arrow[ll,jump=2,tikz={text width = 5cm}]{This arrow uses a |ll| option
% and a |jump| equal to $2$}\\
-% & =\int_0^{\frac{\pi}4} \ln\left(\frac2{1+\tan u}\right)\, d u\\
-% & =\int_0^{\frac{\pi}4}\bigl(\ln2-\ln(1+\tan u)\bigr)\, d u \\
-% & =\frac{\pi}4\ln2-\int_0^{\frac{\pi}4}\ln(1+\tan u)\, d u \\
-% & =\frac{\pi}4\ln2-I
+% & =\int_0^{\frac{\pi}{4}} \ln\left(\frac{2}{1+\tan u}\right)\, d u\\
+% & =\int_0^{\frac{\pi}{4}}\bigl(\ln2-\ln(1+\tan u)\bigr)\, d u \\
+% & =\frac{\pi}{4}\ln2-\int_0^{\frac{\pi}{4}}\ln(1+\tan u)\, d u \\
+% & =\frac{\pi}{4}\ln2-I
% \end{WithArrows}$
%
%
@@ -651,14 +704,14 @@
% \emph{intermediate}). With this option, the arrow is vertical and at the
% leftmost position.
%
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
% (a+b)(a+ib)(a-b)(a-ib)
% & = (a+b)(a-b)\cdot(a+ib)(a-ib) \\
-% & = (a^2-b^2)(a^2+b^2) \Arrow~emphase#[i]@{because $(x-y)(x+y)=x^2-y^2$}\\
+% & = (a^2-b^2)(a^2+b^2) \Arrow\emph{[i]}{because $(x-y)(x+y)=x^2-y^2$}\\
% & = a^4-b^4
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% (a+b)(a+ib)(a-b)(a-ib)
@@ -674,25 +727,27 @@
% vertical line and at a leftmost position.
% \label{group}
% %
-% \begin{Verbatim}[formatcom=\small\color{gray}]
-% $\begin{WithArrows}[~emphase#displaystyle,group@]
-% 2xy'-3y=\sqrt x
-% & \Longleftrightarrow 2x(K'y_0+Ky_0')-3Ky_0 = \sqrt x \\
-% & \Longleftrightarrow 2xK'y_0 + K(2xy_0'-3y_0) = \sqrt x \\
-% & \Longleftrightarrow 2x K'y_0 = \sqrt x \Arrow{...}\\
+% \begin{Code}
+% $\begin{WithArrows}[\emph{displaystyle,group}]
+% 2xy'-3y=\sqrt{x}
+% & \Longleftrightarrow 2x(K'y_0+Ky_0')-3Ky_0 = \sqrt{x} \\
+% & \Longleftrightarrow 2xK'y_0 + K(2xy_0'-3y_0) = \sqrt{x} \\
+% & \Longleftrightarrow 2x K'y_0 = \sqrt{x} \Arrow{...}\\
% ...
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
%
% $\begin{WithArrows}[displaystyle,group]
-% 2xy'-3y=\sqrt x
-% & \Longleftrightarrow 2x(K'y_0+Ky_0')-3Ky_0 = \sqrt x \\
-% & \Longleftrightarrow 2xK'y_0 + K(2xy_0'-3y_0) = \sqrt x \\
-% & \Longleftrightarrow 2x K'y_0 = \sqrt x \Arrow{we replace $y_0$ by its value}\\
-% & \Longleftrightarrow 2xK'x^{\frac32} = x^{\frac12} \Arrow{simplification of the $x$}\\
-% & \Longleftrightarrow K' = \tfrac1{2x^2} \Arrow{antiderivation}\\
-% & \Longleftrightarrow K = -\tfrac1{2x}
+% 2xy'-3y=\sqrt{x}
+% & \Longleftrightarrow 2x(K'y_0+Ky_0')-3Ky_0 = \sqrt{x} \\
+% & \Longleftrightarrow 2xK'y_0 + K(2xy_0'-3y_0) = \sqrt{x} \\
+% & \Longleftrightarrow 2x K'y_0 = \sqrt{x}
+% \Arrow{we replace $y_0$ by its value}\\
+% & \Longleftrightarrow 2xK'x^{\frac{3}{2}} = x^{\frac{1}{2}}
+% \Arrow{simplification of the $x$}\\
+% & \Longleftrightarrow K' = \tfrac{1}{2x^2} \Arrow{antiderivation} \\
+% & \Longleftrightarrow K = -\tfrac{1}{2x}
% \end{WithArrows}$
%
%
@@ -738,6 +793,7 @@
% and the option |new-group| for the last arrow (that's why the last arrow is not
% aligned with the others).
%
+% \bigskip
% $\begin{WithArrows}[interline=1mm,groups]
% \sum\limits_{k=0}^n\frac{\cos kx}{\cos^k x}
% & = \sum\limits_{k=0}^n \frac{\Re (e^{ikx})}{(\cos x)^k}
@@ -776,7 +832,8 @@
% \le f_b \le f_a$. We will also say that the arrow $a$ is \emph{over} the arrow~$b$.
%
% \bigskip
-% \parbox{8cm}{In the exemple on the right, the red arrow covers the blue one.}\hspace{3cm}
+% \parbox{8cm}{In the exemple on the right, the red arrow covers the blue
+% one.}\hspace{3cm}
% $\begin{WithArrows}[c]
% A & = B \Arrow[tikz=red,jump=3]{}\\
% & = C \Arrow[tikz=blue]{}\\
@@ -785,8 +842,9 @@
% \end{WithArrows}$
%
% \medskip
-% On the local level, there exists a key \Definition{o}. This key is available only when
-% the option |group| or the option |groups| is in force (cf.~p.~\pageref{group}).
+% On the local level, there exists a key \Definition{o}. This key is available
+% only when the option |group| or the option |groups| is in force
+% (cf.~p.~\pageref{group}).
%
% An arrow of type |o| is drawn with an horizontal shift (such as those set by
% |xoffset|) automatically computed by taking into account the arrows covered by
@@ -795,15 +853,15 @@
% taken into account in the computation of the value of |xoffset|.}
%
% \bigskip
-% \begin{BVerbatim}[boxwidth=10cm,baseline=c]
+% \begin{Code}[width=10cm]
% $\begin{WithArrows}[groups]
-% A & = B \Arrow{one}\Arrow[~emphase#o@,jump=3]{direct} \\
+% A & = B \Arrow{one}\Arrow[\emph{o},jump=3]{direct} \\
% & = C + C \Arrow{two} \\
% & = D + D + D \Arrow{three} \\
% & = E + E \\
% & = F + F
% \end{WithArrows}$
-% \end{BVerbatim}
+% \end{Code}
% $\begin{WithArrows}[c,groups]
% A & = B \Arrow{one}\Arrow[o,jump=3]{direct} \\
% & = C + C \Arrow{two} \\
@@ -814,17 +872,18 @@
%
%
% \interitem
-% Arrows of type |o| may themselves be covered by other arrows of type~|o|.\par\nobreak
+% Arrows of type |o| may themselves be covered by other arrows of
+% type~|o|.\par\nobreak
%
% \bigskip
-% \begin{BVerbatim}
+% \begin{Code}
% $\begin{WithArrows}[groups]
-% A & = B \Arrow{one}\Arrow[~emphase#o@,jump=2]{two}\Arrow[~emphase#o@,jump=3]{three}\\
+% A & = B \Arrow{one}\Arrow[\emph{o},jump=2]{two}\Arrow[\emph{o},jump=3]{three}\\
% & = C \\
% & = D \\
% & = E + E + E + E + E + E + E
% \end{WithArrows}$
-% \end{BVerbatim}
+% \end{Code}
%
%
% \bigskip
@@ -837,8 +896,8 @@
%
% \bigskip
% The horizontal space between an arrow of type |o| and the arrows immediately
-% covered is fixed by the dimension |xoffset-for-o-arrows| which can be set
-% which the command |\WithArrowsOptions| (initial value: 2~mm).
+% covered is fixed by the dimension \Definition{xoffset-for-o-arrows} which can
+% be set with the command |\WithArrowsOptions| (initial value: 2~mm).
%
%
% \interitem
@@ -848,19 +907,19 @@
%
% \label{up-and-down}
% At the local level, there are also two options for individual arrows, called
-% \Definition{up} and \Definition{down}. The following example illustrates these types of
-% arrows:
+% \Definition{up} and \Definition{down}. The following example illustrates these
+% types of arrows:
%
-% \begin{Verbatim}
+% \begin{Code}
% \(\begin{WithArrows}
% A & = B
-% \Arrow~emphase#[up]@{an arrow of type \texttt{up}} \\
+% \Arrow\emph{[up]}{an arrow of type \texttt{up}} \\
% & = C + C + C + C + C + C + C + C \\
% & = C + C + C + C + C + C + C + C
-% \Arrow~emphase#[down]@{an arrow of type \texttt{down}} \\
+% \Arrow\emph{[down]}{an arrow of type \texttt{down}} \\
% & = E + E
% \end{WithArrows}\)
-% \end{Verbatim}
+% \end{Code}
%
% \vspace{1cm}
% \(\begin{WithArrows}
@@ -884,26 +943,27 @@
% \item The key \Definition{radius} is the radius of the rounded corner of the
% arrow.\footnote{The initial value of this parameter is $4$~pt, which is the
% default value of the ``|rounded corners|'' of Tikz.}
-% \item The key \Definition{width} is the width of the (horizontal part of) the arrow:
+% \item The key \Definition{width} is the width of the (horizontal part of) the
+% arrow:
% \begin{itemize}
-% \item with the value |max|, the width of the arrow is ajusted with respect of
-% the position of the nodes (that's the behaviour by default of the arrows |up|
-% and |down| as shown in the previous example);
+% \item with the value \Definition{max}, the width of the arrow is ajusted with
+% respect of the position of the nodes (that's the behaviour by default of the
+% arrows |up| and |down| as shown in the previous example);
% \item with a numerical value, the width of the arrow is directly fixed to that
% numerical value;
-% \item with the value |min|, the width of the arrow is adjusted with respect to
-% the contents of the label of the arrow.
+% \item with the value \Definition{min}, the width of the arrow is adjusted with
+% respect to the contents of the label of the arrow.
% \end{itemize}
% \end{itemize}
%
% \vspace{1cm}
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
% A & = B
-% \Arrow[~emphase#up={radius=0pt,width=2cm}@]{we try} \\
+% \Arrow[\emph{up={radius=0pt,width=2cm}}]{we try} \\
% & = C + C + C + C + C + C + C + C
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% \medskip
% $\begin{WithArrows}
@@ -914,13 +974,13 @@
%
%
% \vspace{1cm}
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
% A & = B
-% \Arrow[~emphase#up={width=min}@]{we try} \\
+% \Arrow[\emph{up={width=min}}]{we try} \\
% & = C + C + C + C + C + C + C + C
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% \medskip
% $\begin{WithArrows}
@@ -955,12 +1015,12 @@
% since an environment |{WithArrows}| is always unbreakable). This option is
% designed to be used with positive values only.
% %
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}
-% A & = (a+1)^2 \Arrow{we expand} ~emphase#\\[2ex]@
+% A & = (a+1)^2 \Arrow{we expand} \emph{\\[2ex]}
% & = a^2 + 2a + 1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}
% A & = (a+1)^2 \Arrow{we expand} \\*[2ex]
@@ -972,23 +1032,24 @@
% \interitem
% In the environments of \pkg{amsmath} (or \pkg{mathtools}), the spacing between
% rows is fixed by a parameter called |\jot| (it's a dimension and not a skip).
-% That's also the case for the environment |{WithArrows}|. An option \Definition{jot} has
-% been given to the environment |{WithArrows}| in order to change the value of
-% this parameter |\jot| for a given environment.\footnote{It's also possible to
-% change |\jot| with the environment |{spreadlines}| of \pkg{mathtools}.}
+% That's also the case for the environment |{WithArrows}|. An option
+% \Definition{jot} has been given to the environment |{WithArrows}| in order to
+% change the value of this parameter |\jot| for a given
+% environment.\footnote{It's also possible to change |\jot| with the environment
+% |{spreadlines}| of \pkg{mathtools}.}
% %
-% \begin{Verbatim}
-% $\begin{WithArrows}[displaystyle,~emphase#jot=2ex@]
-% F & = \frac12G \Arrow{we expand}\\
-% & = H + \frac12K \Arrow{we go on}\\
+% \begin{Code}
+% $\begin{WithArrows}[displaystyle,\emph{jot=2ex}]
+% F & = \frac{1}{2}G \Arrow{we expand}\\
+% & = H + \frac{1}{2}K \Arrow{we go on}\\
% & = K
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
%
% $\begin{WithArrows}[displaystyle,jot=2ex]
-% F & = \frac12G \Arrow{we expand}\\
-% & = H + \frac12K \Arrow{we go on}\\
+% F & = \frac{1}{2}G \Arrow{we expand}\\
+% & = H + \frac{1}{2}K \Arrow{we go on}\\
% & = K
% \end{WithArrows}$
%
@@ -997,8 +1058,8 @@
% However, this new value of |\jot| will also be used in other alignments
% included in the environment~|{WithArrows}|:
% %
-% \begin{Verbatim}
-% $\begin{WithArrows}[jot=2ex]
+% \begin{Code}
+% $\begin{WithArrows}[\emph{jot=2ex}]
% \varphi(x,y) = 0 & \Leftrightarrow (x+y)^2 + (x+2y)^2 = 0
% \Arrow{$x$ and $y$ are real}\\
% & \Leftrightarrow \left\{
@@ -1008,7 +1069,7 @@
% \end{aligned}
% \right.
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
%
% $\begin{WithArrows}[jot=2ex]
@@ -1026,8 +1087,8 @@
% Maybe this doesn't correspond to the desired outcome. That's why an option
% \Definition{interline} is proposed. It's possible to use a skip (=glue) for
% this option.
-% \begin{Verbatim}
-% $\begin{WithArrows}[~emphase#interline=2ex@]
+% \begin{Code}
+% $\begin{WithArrows}[\emph{interline=2ex}]
% \varphi(x,y) = 0 & \Leftrightarrow (x+y)^2 + (x+2y)^2 = 0
% \Arrow{$x$ and $y$ are real}\\
% & \Leftrightarrow \left\{
@@ -1037,7 +1098,7 @@
% \end{aligned}
% \right.
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
%
% $\begin{WithArrows}[interline=2ex]
@@ -1103,7 +1164,8 @@
%
% Once again, it's possible to change this behaviour with |\WithArrowsOptions|:
%
-% \quad |\WithArrowsOptions{displaystyle}|.
+% \smallskip
+% |\WithArrowsOptions{displaystyle}|.
%
%
% \smallskip
@@ -1121,10 +1183,7 @@
%
% \medskip
% The following is composed with |{WithArrows}[c,displaystyle]|. The results are
-% strictly identical.\footnote{In versions of \pkg{amsmath} older than the
-% 5~nov.~2016, a thin space was added on the left of an environment |{aligned}|.
-% The new versions do not add this space and neither do
-% |{WithArrows}|.}\par\nobreak
+% strictly identical.\par\nobreak
%
% \smallskip
% $\left\{
@@ -1146,23 +1205,23 @@
% exceptions for |interline|, |code-before| and |code-after|). The command
% |\Arrow| can be used as usual in each environment |{WithArrows}|.
%
-% \begin{Verbatim}[formatcom=\small\color{gray}]
-% $~emphase#\begin{WithArrows}@
+% \begin{Code}
+% $\emph{\begin{WithArrows}}
% \varphi(x,y)=0
% & \Leftrightarrow (x+2y)^2+(2x+4y)^2 = 0 \Arrow{the numbers are real}\\
% & \Leftrightarrow
-% \left\{~emphase#\begin{WithArrows}@[c]
+% \left\{\emph{\begin{WithArrows}}[c]
% x+2y & = 0 \\
% 2x+4y & = 0
-% ~emphase#\end{WithArrows}@\right. \\
+% \emph{\end{WithArrows}}\right. \\
% & \Leftrightarrow
-% \left\{~emphase#\begin{WithArrows}@[c]
+% \left\{\emph{\begin{WithArrows}}[c]
% x+2y & = 0 \Arrow[tikz=-]{the same equation}\\
% x+2y & = 0
-% ~emphase#\end{WithArrows}@\right. \\
+% \emph{\end{WithArrows}}\right. \\
% & \Leftrightarrow x+2y=0
-% ~emphase#\end{WithArrows}@$
-% \end{Verbatim}
+% \emph{\end{WithArrows}}$
+% \end{Code}
%
% $\begin{WithArrows}
% \varphi(x,y)=0
@@ -1182,7 +1241,8 @@
%
% \bigskip
% However, one may want to draw an arrow between rows that are not in the same
-% environment. For example, one may want to draw the following arrow :\par\nobreak
+% environment. For example, one may want to draw the following arrow
+% :\par\nobreak
%
% \bigskip
% $\begin{WithArrows}[code-after = \Arrow[v]{1-2}{2-2}{division by $2$} ]
@@ -1247,13 +1307,13 @@
% number~$1$ (and therefore, the specification is |1-2|) and ends in the row~$2$
% of the sub-environment number~$2$ (and therefore, the specification is |2-2|).
% We can draw the arrow with the following command |\Arrow| in |code-after| :
-% \begin{Verbatim}
-% $\begin{WithArrows}[~emphase#code-after = \Arrow{1-2}{2-2}{division by $2$}@ ]
+% \begin{Code}
+% $\begin{WithArrows}[\emph{code-after = \Arrow{1-2}{2-2}{division by $2$}}]
% \varphi(x,y)=0
% & \Leftrightarrow (x+2y)^2+(2x+4y)^2 = 0 \\
% .........
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}[code-after = \Arrow{1-2}{2-2}{division by $2$} ]
% \varphi(x,y)=0
@@ -1282,13 +1342,13 @@
% account unlike with the option |i|. Currently, the option |i| is not available
% for the command~|\Arrow| in |code-after|. However, it's always possible to
% translate an arrow with |xoffset| (or |xshift| of Tikz).
-% \begin{Verbatim}
-% $\begin{WithArrows}[code-after=\Arrow~emphase#[v]@{1-2}{2-2}{division by $2$}]
+% \begin{Code}
+% $\begin{WithArrows}[code-after=\Arrow\emph{[v]}{1-2}{2-2}{division by $2$}]
% \varphi(x,y)=0
% & \Leftrightarrow (x+2y)^2+(2x+4y)^2 = 0 \\
% .........
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}[code-after = \Arrow[v]{1-2}{2-2}{division by $2$} ]
% \varphi(x,y)=0
@@ -1315,9 +1375,9 @@
% with the syntax of the list in a |\foreach| command of \pkg{pgffor}.
%
%
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}[tikz = rounded corners,
-% code-after = {~emphase#\MultiArrow{1,...,4}{text}@} ]
+% code-after = {\emph{\MultiArrow{1,...,4}{text}}} ]
% A & = B \\
% & = C \\
% & = D \\
@@ -1324,7 +1384,7 @@
% & = E \\
% & = F
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
%
% $\begin{WithArrows}[tikz = rounded corners,
@@ -1355,8 +1415,8 @@
% \smallskip
% For illustrative purposes, we give an example of nested environments
% |{WithArrows}|, and, for each ``right node'', the name of that
-% node.\footnote{There is an option |show-node-names| to show the names of these
-% nodes.}
+% node.\footnote{There is an option \Definition{show-node-names} to show the
+% names of these nodes.}
%
% \medskip
% \[\begin{WithArrows}[show-nodes,show-node-names]
@@ -1411,8 +1471,9 @@
% tip of the arrow (loaded by |WithArrows/arrow|).
% \end{itemize}
%
-% For example, we can draw an arrow from \texttt{wa-\WithArrowsLastEnv-2-1-2-r.south}
-% to \texttt{wa-\WithArrowsLastEnv-3-2-r.north} with the following Tikz command.
+% For example, we can draw an arrow from
+% \texttt{wa-\WithArrowsLastEnv-2-1-2-r.south} to
+% \texttt{wa-\WithArrowsLastEnv-3-2-r.north} with the following Tikz command.
%
% \begin{Verbatim}
% \begin{tikzpicture}[remember picture,overlay]
@@ -1467,14 +1528,14 @@
% ``|first|'' and ``|second|'' and we draw a line between a node of the first
% and a node of the second.
%
-% \begin{Verbatim}
-% $\begin{WithArrows}[~emphase#name=first@]
+% \begin{Code}
+% $\begin{WithArrows}[\emph{first}]
% A & = B \\
% & = C
% \end{WithArrows}$
%
% \bigskip
-% $\begin{WithArrows}[~emphase#name=second@]
+% $\begin{WithArrows}[\emph{second}]
% A' & = B' \\
% & = C'
% \end{WithArrows}$
@@ -1481,10 +1542,10 @@
%
% \begin{tikzpicture}[remember picture,overlay]
% \draw [WithArrows/arrow]
-% ([xshift=3mm]~emphase#first at -1-r.south)
-% to ([xshift=3mm]~emphase#second at -1-r.north) ;
+% ([xshift=3mm]\emph{first}-1-r.south)
+% to ([xshift=3mm]\emph{second}-1-r.north) ;
% \end{tikzpicture}
-% \end{Verbatim}
+% \end{Code}
%
%
% \begin{center}
@@ -1518,12 +1579,12 @@
% \medskip
% The environment |{DispWithArrows}| must be used \emph{outside} math mode. Like
% |{align}|, it should be used in horizontal mode.
-% \begin{Verbatim}
-% \begin{~emphase#DispWithArrows@}
+% \begin{Code}
+% \emph{\begin{DispWithArrows}}
% A & = (a+1)^2 \Arrow{we expand} \\
% & = a^2 + 2a + 1
-% \end{~emphase#DispWithArrows@}
-% \end{Verbatim}
+% \emph{\end{DispWithArrows}}
+% \end{Code}
% \begin{DispWithArrows}
% A & = (a+1)^2 \Arrow{we expand} \\
% & = a^2 + 2a + 1
@@ -1530,8 +1591,8 @@
% \end{DispWithArrows}
%
% \medskip
-% It's possible to use the command \DefinitionCommand{notag} (or |\nonumber|) to
-% suppress a tag.
+% It's possible to use the command \DefinitionCommand{notag} (or
+% \DefinitionCommand{nonumber}) to suppress a tag.
%
% It's possible to use the command \DefinitionCommand{tag} to put a special tag
% (e.g. $\star$).
@@ -1540,12 +1601,12 @@
% \DefinitionCommand{label}.
%
% These commands must be in the second column of the environment.
-% \begin{Verbatim}
+% \begin{Code}
% \begin{DispWithArrows}
-% A & = (a+1)^2 \Arrow{we expand} ~emphase#\notag@ \\
-% & = a^2 + 2a + 1 ~emphase#\tag{$\star$} \label{my-equation}@
+% A & = (a+1)^2 \Arrow{we expand} \emph{\notag} \\
+% & = a^2 + 2a + 1 \emph{\tag{$\star$} \label{my-equation}}
% \end{DispWithArrows}
-% \end{Verbatim}
+% \end{Code}
% \begin{DispWithArrows}
% A & = (a+1)^2 \Arrow{we expand} \notag \\
% & = a^2 + 2a + 1 \tag{$\star$} \label{my-equation}
@@ -1561,12 +1622,12 @@
% \pkg{amssymb}. This symbol is often used to mark the end of a
% proof.\footnote{Notice that the environment |{DispWithArrows}| is compatible
% with the command |\qedhere| of \pkg{amsthm}.}
-% \begin{Verbatim}
+% \begin{Code}
% \begin{DispWithArrows}
% A & = (a+1)^2 \Arrow{we expand} \notag \\
-% & = a^2 + 2a + 1 ~emphase#\tag*{$\square$}@
+% & = a^2 + 2a + 1 \emph{\tag*{$\square$}}
% \end{DispWithArrows}
-% \end{Verbatim}
+% \end{Code}
% \begin{DispWithArrows}
% A & = (a+1)^2 \Arrow{we expand} \notag \\
% & = a^2 + 2a + 1 \tag*{$\square$}
@@ -1574,16 +1635,17 @@
%
% \medskip
% It's also possible to suppress all the autogenerated numbers with the boolean
-% option \Definition{notag} (or |nonumber|), at the global or environment level. There is
-% also an environment |{DispWithArrows*}| which suppresses all these
-% numbers.\footnote{Even in this case, it's possible to put a ``manual tag''
+% option \Definition{notag} (or \Definition{nonumber}), at the global or
+% environment level. There is also an environment
+% \Definition{\{DispWithArrows*\}} which suppresses all these
+% numbers.\footnote{Even in this case, it's possible to put a ``manual tag''
% with the command |\tag|.}
-% \begin{Verbatim}
-% \begin{~emphase#DispWithArrows*@}
+% \begin{Code}
+% \emph{\begin{DispWithArrows*}}
% A & = (a+1)^2 \Arrow{we expand} \\
% & = a^2 + 2a + 1
-% \end{~emphase#DispWithArrows*@}
-% \end{Verbatim}
+% \emph{\end{DispWithArrows*}}
+% \end{Code}
% \begin{DispWithArrows*}
% A & = (a+1)^2 \Arrow{we expand} \\
% & = a^2 + 2a + 1
@@ -1596,13 +1658,13 @@
% |tagged-lines = {first,3,last}|, only the first, the third and the last line
% of the environment will be tagged. There is also the special value |all| which
% means that all the lines will be tagged.
-% \begin{Verbatim}
-% \begin{DispWithArrows}[~emphase#tagged-lines = last@]
+% \begin{Code}
+% \begin{DispWithArrows}[tagged-lines = last]
% A & = A_1 \Arrow{first stage} \\
% & = A_2 \Arrow{second stage} \\
% & = A_3
% \end{DispWithArrows}
-% \end{Verbatim}
+% \end{Code}
% \begin{DispWithArrows}[tagged-lines = last]
% A & = A_1 \Arrow{first stage} \\
% & = A_2 \Arrow{second stage} \\
@@ -1611,18 +1673,18 @@
%
% \bigskip
% With the option \Definition{fleqn}, the environment is composed flush left (in
-% a way similar to the option |fleqn| of the standard classes of LaTeX). In this case,
-% the left margin can be controlled with the option \Definition{mathindent} (with a name
-% inspired by the parameter |\mathindent| of standard LaTeX. The initial value
-% of this parameter is 25~pt. It's possible to use as value for that key a \emph{skip}
-% (=\emph{glue}).
+% a way similar to the option |fleqn| of the standard classes of LaTeX). In this
+% case, the left margin can be controlled with the option
+% \Definition{mathindent} (with a name inspired by the parameter |\mathindent|
+% of standard LaTeX. The initial value of this parameter is 25~pt. It's possible
+% to use as value for that key a \emph{skip} (=\emph{glue}).
%
-% \begin{Verbatim}
-% \begin{DispWithArrows}[~emphase#fleqn,mathindent = 1cm@]
+% \begin{Code}
+% \begin{DispWithArrows}\emph{[fleqn,mathindent = 1cm]}
% A & = (a+1)^2 \Arrow{we expand} \\
% & = a^2 + 2a + 1
% \end{DispWithArrows}
-% \end{Verbatim}
+% \end{Code}
% \begin{DispWithArrows}[fleqn,mathindent = 1cm]
% A & = (a+1)^2 \Arrow{we expand} \\
% & = a^2 + 2a + 1
@@ -1654,8 +1716,8 @@
% In the following example, the key |{subequations}| is fixed by the command
% |\WithArrowsOptions|. Each environment |{DispWithArrows}| will be subnumerated
% (in the scope of |\WithArrowsOptions|)
-% \begin{Verbatim}
-% ~emphase#\WithArrowsOptions{subequations}@
+% \begin{Code}
+% \emph{\WithArrowsOptions{subequations}}
% First environment.
% \begin{DispWithArrows}
% A & = B \\
@@ -1666,7 +1728,7 @@
% D & = E \\
% & = F
% \end{DispWithArrows}
-% \end{Verbatim}
+% \end{Code}
% %
% \begin{scope}
% \WithArrowsOptions{subequations}
@@ -1688,17 +1750,17 @@
% \pkg{amsmath}). However, in |{DispWithArrows}|, the user can use the command
% \DefinitionCommand{tagnextline} to manually require the composition of the tag
% on the following line.
-% \begin{Verbatim}
+% \begin{Code}
% \begin{DispWithArrows}[displaystyle]
% S_{2(p+1)}
% & =\sum_{k=1}^{2(p+1)} (-1)^k k^2 \\
% & \smash[b]{=\sum_{k=1}^{2p}(-1)^kk
-% +(-1)^{2p+1}(2p+1)^2+(-1)^{2p+2}(2p+2)^2} ~emphase#\tagnextline@ \\
+% +(-1)^{2p+1}(2p+1)^2+(-1)^{2p+2}(2p+2)^2} \emph{\tagnextline} \\
% &= S_{2p}-(2p+1)^2+(2p+2)^2\\
% &=p(2p+1)-(2p+1)^2+(2p+2)^2\\
% &= 2p^2+5p+3
% \end{DispWithArrows}
-% \end{Verbatim}
+% \end{Code}
% \begin{center}
% \color{gray}\vrule%
% \begin{minipage}{275pt}\color{black}
@@ -1719,29 +1781,29 @@
%
% \bigskip
% The environments |{DispWithArrows}| and |{DispWithArrows*}| provide an option
-% \Definition{wrap-lines}. With this option, the lines of the label are
+% \Definition{wrap-lines}. With this option, the lines of the labels are
% automatically wrapped on the
% right.\footnotemark[\thefnnohyphen]\label{wrap-lines}
%
-% \begin{Verbatim}
-% \begin{DispWithArrows*}[displaystyle,~emphase#wrap-lines@]
+% \begin{Code}
+% \begin{DispWithArrows*}\emph{[displaystyle,wrap-lines]}
% S_n
-% & = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+% & = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
% \Arrow{sum of terms of a geometric progression of ratio $e^{i\frac{2\pi}n}$}\\
-% & = \frac1n \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}
+% & = \frac{1}{n} \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}
% {1-e^{i\frac{\pi}{2n}}}\right)
% \Arrow{This line has been wrapped automatically.} \\
-% & = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+% & = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
% \end{DispWithArrows*}
-% \end{Verbatim}
+% \end{Code}
% \begin{DispWithArrows*}[displaystyle,wrap-lines]
% S_n
-% & = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+% & = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
% \Arrow{sum of terms of a geometric progression of ratio $e^{i\frac{2\pi}n}$}\\
-% & = \frac1n \Re \left(
+% & = \frac{1}{n} \Re \left(
% \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}} \right)
% \Arrow{This line has been wrapped automatically.} \\
-% & = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+% & = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
% \end{DispWithArrows*}
%
% \bigskip
@@ -1761,33 +1823,33 @@
% Here is an example. The use of |{DispWithArrows}| gives the ability to tag an
% equation (and also to use |wrap-lines|).
%
-% \begin{Verbatim}
-% ~emphase#\begin{enumerate}@
-% ~emphase#\item @
+% \begin{Code}
+% \emph{\begin{enumerate}
+% \item }
% \begin{DispWithArrows}%
% [displaystyle, wrap-lines, tagged-lines = last, fleqn, mathindent = 0 pt]
% S_n
-% & = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+% & = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
% \Arrow{we use the formula for a sum of terms of a geometric progression of
% ratio $e^{i\frac{2\pi}n}$}\\
-% & = \frac1n \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}
+% & = \frac{1}{n} \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}
% {1-e^{i\frac{\pi}{2n}}}\right)
-% \Arrow{$\bigl(e^{i\frac{\pi}{2n}}\bigr)^n = e^{i\frac{\pi}2}=i$} \\
-% & = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+% \Arrow{$\bigl(e^{i\frac{\pi}{2n}}\bigr)^n = e^{i\frac{\pi}{2}}=i$} \\
+% & = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
% \end{DispWithArrows}
-% ~emphase#\end{enumerate}@
-% \end{Verbatim}
+% \emph{\end{enumerate}}
+% \end{Code}
% \begin{enumerate}
% \item
% \begin{DispWithArrows}[displaystyle, wrap-lines, tagged-lines = last, fleqn, mathindent = 0 pt]
% S_n
-% & = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+% & = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
% \Arrow{we use the formula for a sum of terms of a geometric progression of
% ratio $e^{i\frac{2\pi}n}$}\\
-% & = \frac1n \Re \left(
+% & = \frac{1}{n} \Re \left(
% \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}} \right)
-% \Arrow{$\bigl(e^{i\frac{\pi}{2n}}\bigr)^n = e^{i\frac{\pi}2}=i$} \\
-% & = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+% \Arrow{$\bigl(e^{i\frac{\pi}{2n}}\bigr)^n = e^{i\frac{\pi}{2}}=i$} \\
+% & = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
% \end{DispWithArrows}
% \end{enumerate}
%
@@ -1852,14 +1914,14 @@
%
% \medskip
%
-% \begin{BVerbatim}
-% \begin{DispWithArrows}~emphase#< \binom{n}{p} = >@[format = ll,fleqn,displaystyle]
+% \begin{Code}
+% \begin{DispWithArrows}\emph{< \binom{n}{p} = >}[format = ll,fleqn,displaystyle]
% 0 & \quad \text{if } p > n
% \Arrow{if fact, it's a special case\\ of the following one} \\
% \frac{n(n-1)\cdots(n-p+1)}{p!} & \quad \text{if } 0 \leq p \leq n \\
% 0 & \quad \text{if } p < 0
% \end{DispWithArrows}
-% \end{BVerbatim}
+% \end{Code}
% %
% \begin{DispWithArrows}< \binom{n}{p} = >[format = ll,fleqn,displaystyle]
% 0 & \quad \text{if } p > n
@@ -1872,14 +1934,14 @@
% In the following example, we subnumerate the equations with the option
% |subequations| (available when the package \pkg{amsmath} is loaded).
%
-% \begin{Verbatim}
-% \begin{DispWithArrows}~emphase#< \label{system} \ref*{system} \Leftrightarrow >@[
+% \begin{Code}
+% \begin{DispWithArrows}\emph{< \label{system} \ref*{system} \Leftrightarrow >}[
% format = l, subequations ]
% x+y+z = -3 \Arrow[tikz=-,jump=2]{3 equations} \\
% xy+xz+yz=-2 \\
% xyz = -15 \label{last-equation}
% \end{DispWithArrows}
-% \end{Verbatim}
+% \end{Code}
% %
% \begin{DispWithArrows}< \label{system} \ref*{system} \Leftrightarrow >[
% format = l, subequations]
@@ -1900,8 +1962,8 @@
% \bigskip
% With the option \Definition{replace-left-brace-by}, it's possible to replace the
% left curly brace by another extensible delimiter. For example,
-% ``|replace-left-brace-by = [\enskip|'' will compose with a bracket and add also a
-% |\enskip| after this bracket.
+% ``|replace-left-brace-by = [\enskip|'' will compose with a bracket and add
+% also a |\enskip| after this bracket.
%
% \interitem
% \section{Advanced features}
@@ -1913,11 +1975,12 @@
% \smallskip
% If \pkg{witharrows} is used with Beamer, the command |\Arrow| takes in as
% argument between angular brackets (after the optional argument in square
-% brackets) to specify the overlays which are implied.
+% brackets) to specify the \emph{overlays} which are implied (internally,
+% \pkg{witharrows} merely uses the command |\only| of Beamer).
%
-% \begin{Verbatim}
-% \Arrow[jump=2]~emphase#<3->@{Example}
-% \end{Verbatim}
+% \begin{Code}
+% \Arrow[jump=2]\emph{<3->}{Example}
+% \end{Code}
%
% \subsection{Use with plain-TeX}
% \label{plain-TeX}
@@ -1977,23 +2040,23 @@
% \bigskip
% In the following example, we replace this default path by a path with three
% segments (and the node overwriting the second segment).
-% \begin{Verbatim}
+% \begin{Code}
% \begin{WithArrows}[format=c,ygap=5pt,interline=4mm,
-% ~emphase#tikz-code = {\draw[rounded corners]@
-% ~emphase# (~#1) -- ([xshift=5mm]~#1)@
-% ~emphase# -- node[circle,@
-% ~emphase# draw,@
-% ~emphase# auto = false,@
-% ~emphase# fill = gray!50,@
-% ~emphase# inner sep = 1pt] {\tiny ~#3}@
-% ~emphase# ([xshift=5mm]~#2)@
-% ~emphase# -- (~#2) ; }@]
+% \emph{tikz-code = {\draw[rounded corners]
+% (#1) -- ([xshift=5mm]#1)
+% -- node[circle,
+% draw,
+% auto = false,
+% fill = gray!50,
+% inner sep = 1pt] {\tiny #3}
+% ([xshift=5mm]#2)
+% -- (#2) ; }}]
% 3 (2x+4) = 6 \Arrow{$\div 3$} \\
% 2x+4 = 2 \Arrow{$-4$} \\
% 2x = -2 \Arrow{$\div 2$} \\
% x = -1
% \end{WithArrows}
-% \end{Verbatim}
+% \end{Code}
%
%
% \[\begin{WithArrows}[format=c,
@@ -2077,8 +2140,8 @@
% right is taken into account in the dimensions of the encompassing box.
%
%
-% \begin{Verbatim}
-% $\left\{\begin{WithArrows}[c,format = rCrCl,~emphase#right-overlap=false@]
+% \begin{Code}
+% $\left\{\begin{WithArrows}[c,format = rCrCl,\emph{right-overlap=false}]
% 2x & + & 3y & = & 5 \Arrow{we add $L_1$ to $L_2$}\\
% -2x & - & 5y & = & 2
% \end{WithArrows}\right.$\quad
@@ -2086,7 +2149,7 @@
% 2x & + & 3y & = & 5 \\
% & - & 2y & = & 7
% \end{WithArrows}\right.$
-% \end{Verbatim}
+% \end{Code}
%
% \medskip
% $\left\{\begin{WithArrows}[c,format = rCrCl,right-overlap=false]
@@ -2099,7 +2162,8 @@
% \end{WithArrows}\right.$
%
% \bigskip
-% The tuning |right-overlap = false| may also be useful in conjunction with the class |standalone|.
+% The tuning |right-overlap = false| may also be useful in conjunction with the
+% class |standalone|.
%
%
% \bigskip
@@ -2122,7 +2186,9 @@
%
% \bigskip
% $\begin{WithArrows}[interline=1mm, adjust = 0pt]
-% (\cos x + \sin x)^2 & = \cos^2 x +2 \cos x \sin x + \sin^2 x\Arrow{}\tikz[remember picture] \coordinate (A) ; \\
+% (\cos x + \sin x)^2 &
+% = \cos^2 x +2 \cos x \sin x
+% + \sin^2 x\Arrow{}\tikz[remember picture] \coordinate (A) ; \\
% & = \cos^2x + \sin^2x + 2\sin x\cos x \Arrow{} \\
% & = 1 + \sin(2x)
% \end{WithArrows}$
@@ -2151,12 +2217,12 @@
% \bigskip
% Here is for example the behaviour without the mechanism of |start-adjust| and
% |end-adjust|:
-% % \begin{Verbatim}
-% $\begin{WithArrows}~emphase#[start-adjust=0pt, end-adjust=0pt]@
+% \begin{Code}
+% $\begin{WithArrows}\emph{[start-adjust=0pt, end-adjust=0pt]}
% A & = (a+1)^2 \Arrow{we expand} \\
% & = a^2 + 2a + 1
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% $\begin{WithArrows}[start-adjust=0pt, end-adjust=0pt]
% A & = (a+1)^2 \Arrow{we expand} \\
@@ -2189,8 +2255,8 @@
%
% In the following example, the value of |max-length-of-arrow| has been fixed to
% $1.5$~cm.
-% \begin{Verbatim}
-% \[\begin{WithArrows}[~emphase#max-length-of-arrow = 1.5cm@]
+% \begin{Code}
+% \[\begin{WithArrows}[\emph{max-length-of-arrow = 1.5cm}]
% A
% & =
% \begin{vmatrix}
@@ -2215,7 +2281,7 @@
% 0 & e-a & e^2-a^2 & e^3-a^3 & e^4-a^4
% \end{vmatrix}
% \end{WithArrows}\]
-% \end{Verbatim}
+% \end{Code}
%
%
% \bigskip
@@ -2359,29 +2425,33 @@
% placement of an eventual command |\Arrow|.
%
%
-%
-% \begin{Verbatim}[formatcom=\small\color{gray}]
+% \begingroup
+% \small
+% \begin{Code}
% $\begin{WithArrows}[interline=0.5ex]
-% ~emphase#\MoveEqLeft@ \arccos(x) = \arcsin \frac45 + \arcsin \frac5{13}
-% \Arrow{because both are in $[-\frac{\pi}2,\frac{\pi}2]$} \\
-% & \Leftrightarrow x = \sin\left(\arcsin\frac45 + \arcsin\frac5{13}\right) \\
-% & \Leftrightarrow x = \frac45\cos\arcsin\frac5{13} + \frac5{13} \cos\arcsin\frac45
+% \emph{\MoveEqLeft} \arccos(x) = \arcsin \frac{4}{5} + \arcsin \frac{5}{13}
+% \Arrow{because both are in $[-\frac{\pi}{2},\frac{\pi}{2}]$} \\
+% & \Leftrightarrow x = \sin\left(\arcsin\frac{4}{5} + \arcsin\frac{5}{13}\right) \\
+% & \Leftrightarrow x
+% = \frac{4}{5}\cos\arcsin\frac{5}{13}+\frac{5}{13}\cos\arcsin\frac{4}{5}
% \Arrow{$\forall x \in [-1,1], \cos(\arcsin x) = \sqrt{1-x^2}$} \\
-% & \Leftrightarrow x = \frac45\sqrt{1-\bigl(\frac5{13}\bigr)^2}
-% + \frac5{13}\sqrt{1-\bigl(\frac45\bigr)^2}
+% & \Leftrightarrow x = \frac{4}{5}\sqrt{1-\bigl(\frac{5}{13}\bigr)^2}
+% + \frac{5}{13}\sqrt{1-\bigl(\frac{4}{5}\bigr)^2}
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
+% \endgroup
%
%
% \medskip
% $\begin{WithArrows}[interline=0.5ex]
-% \MoveEqLeft \arccos(x) = \arcsin \frac45 + \arcsin \frac5{13}
-% \Arrow{because both are in $[-\frac{\pi}2,\frac{\pi}2]$} \\
-% & \Leftrightarrow x = \sin\left(\arcsin\frac45 + \arcsin\frac5{13}\right) \\
-% & \Leftrightarrow x = \frac45\cos\arcsin\frac5{13} + \frac5{13} \cos\arcsin\frac45
+% \MoveEqLeft \arccos(x) = \arcsin \frac{4}{5} + \arcsin \frac{5}{13}
+% \Arrow{because both are in $[-\frac{\pi}{2},\frac{\pi}{2}]$} \\
+% & \Leftrightarrow x = \sin\left(\arcsin\frac{4}{5} + \arcsin\frac{5}{13}\right) \\
+% & \Leftrightarrow x
+% = \frac{4}{5}\cos\arcsin\frac{5}{13} + \frac{5}{13} \cos\arcsin\frac{4}{5}
% \Arrow{$\forall x \in [-1,1], \cos(\arcsin x) = \sqrt{1-x^2}$} \\
-% & \Leftrightarrow x = \frac45\sqrt{1-\bigl(\frac5{13}\bigr)^2}
-% + \frac5{13}\sqrt{1-\bigl(\frac45\bigr)^2}
+% & \Leftrightarrow x = \frac{4}{5}\sqrt{1-\bigl(\frac{5}{13}\bigr)^2}
+% + \frac{5}{13}\sqrt{1-\bigl(\frac{4}{5}\bigr)^2}
% \end{WithArrows}$
%
%
@@ -2393,13 +2463,13 @@
% directions.
%
% \bigskip
-% \begin{Verbatim}
+% \begin{Code}
% \NewDocumentCommand \DoubleArrow { O {} m m }
% {
-% \Arrow[tikz=->,~#1]{~#2}%
-% \Arrow[o,tikz=<-,~#1]{~#3}
+% \Arrow[tikz=->,#1]{#2}%
+% \Arrow[o,tikz=<-,#1]{#3}
% }
-% \end{Verbatim}
+% \end{Code}
%
%
% \NewDocumentCommand \DoubleArrow { O {} m m }
@@ -2412,12 +2482,12 @@
% \bigskip
% Example of use:
%
-% \begin{Verbatim}
+% \begin{Code}
% $\begin{WithArrows}[groups]
-% A & = (a+b)^2 \DoubleArrow[tikz={font=\bfseries}]{expansion}{factorization} \\
+% A & = (a+b)^2 \emph{\DoubleArrow[tikz={font=\bfseries}]{expansion}{factorization}} \\
% & = a^2 + 2ab+b^2
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% \bigskip
% $\begin{WithArrows}[groups]
@@ -2434,22 +2504,22 @@
% It's possible to change the shape of the labels, which are Tikz nodes, by
% modifying the key ``|every node|'' of Tikz.
%
-% \begin{Verbatim}
+% \begin{Code}
% \begin{WithArrows}%
% [format = c,
% interline = 4mm,
-% tikz = {~emphase#every node/.style = {circle,@
-% ~emphase# draw,@
-% ~emphase# auto = false,@
-% ~emphase# fill = gray!50,@
-% ~emphase# inner sep = 1pt,@
-% ~emphase# font = \tiny}@}]
+% tikz = {\emph{every node/.style = {circle,
+% draw,
+% auto = false,
+% fill = gray!50,
+% inner sep = 1pt,
+% font = \tiny}}}]
% 3 (2x+4) = 6 \Arrow{$\div 3$} \\
% 2x+4 = 2 \Arrow{$-4$} \\
% 2x = -2 \Arrow{$\div 2$} \\
% 2x = -1
% \end{WithArrows}
-% \end{Verbatim}
+% \end{Code}
%
% \[\begin{WithArrows}[%
% format = c,
@@ -2488,18 +2558,18 @@
% instructions |\path| : the first instruction draws the arrow itself and the
% second puts the label in a Tikz node in the rectangle delimited by the arrow.
%
-% \begin{Verbatim}
+% \begin{Code}
% \begin{DispWithArrows*}%
% [displaystyle,
% ygap = 2mm,
% ystart = 0mm,
-% ~emphase#tikz-code = {\draw (~#1) -- ++(4.5cm,0) |- (~#2) ;@
-% ~emphase# \path (~#1) -- (~#2) @
-% ~emphase# node[text width = 4.2cm, right, midway] {~#3} ;}@]
+% \emph{tikz-code = {\draw (#1) -- ++(4.5cm,0) |- (#2) ;
+% \path (#1) -- (#2)
+% node[text width = 4.2cm, right, midway] {#3} ;}}]
% S_n
-% & = \frac1n \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}2\cdot\tfrac kn\bigr)
+% & = \frac{1}{n} \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}{2}\cdot\tfrac{k}{n}\bigr)
% ...........
-% \end{Verbatim}
+% \end{Code}
%
%
% \bigskip
@@ -2511,16 +2581,16 @@
% \path (#1) -- (#2)
% node[text width = 4.2cm, right, midway] {#3} ;}]
% S_n
-% & = \frac1n \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}2\cdot\tfrac kn\bigr)
+% & = \frac{1}{n} \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}{2}\cdot\tfrac{k}{n}\bigr)
% \Arrow{$\cos x = \Re(e^{ix})$}\\
-% & = \frac1n\sum_{k=0}^{n-1} \Re\left(e^{i\frac{k\pi}{2n}}\right)
+% & = \frac{1}{n} \sum_{k=0}^{n-1} \Re\left(e^{i\frac{k\pi}{2n}}\right)
% \Arrow{$\Re(z+z')=\Re(z)+\Re(z')$}\\
-% & = \frac1n \Re\left(\sum_{k=0}^{n-1} e^{i\frac{k\pi}{2n}}\right)
+% & = \frac{1}{n} \Re\left(\sum_{k=0}^{n-1} e^{i\frac{k\pi}{2n}}\right)
% \Arrow{$\exp$ is a morphism for $\times$ and $+$} \\
-% & = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
-% \Arrow{sum of terms of a geometric progression of ratio $e^{i\frac{2\pi}n}$}\\
-% & = \frac1n \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}}\right)\\
-% & = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+% & = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+% \Arrow{sum of terms of a geometric progression of ratio $e^{i\frac{2\pi}{n}}$}\\
+% & = \frac{1}{n} \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}}\right)\\
+% & = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
% \end{DispWithArrows*}
%
% \bigskip
@@ -2535,29 +2605,29 @@
% composition box (it's a TeX command and not a dimension). For lisibility, we
% use a style. This example requires the Tikz library \pkg{calc}.
%
-% \begin{Verbatim}
+% \begin{Code}
% \WithArrowsNewStyle{MyStyle}
% {displaystyle,
% ygap = 2mm,
% xoffset = 0pt,
% ystart = 0mm,
-% tikz-code = {\path let \p1 = (~#~#1)
-% in (~#~#1)
+% tikz-code = {\path let \p1 = (#1)
+% in (#1)
% -- node [anchor = west,
-% text width = {~emphase#\WithArrowsRightX@ - \x1 - 0.5 em}]
-% {~#~#3}
-% (~#~#2) ;
-% \draw let \p1 = (~#~#1)
-% in (~#~#1) -- ++(~emphase#\WithArrowsRightX@ - \x1,0) |- (~#~#2) ; }}
-% \end{Verbatim}
+% text width = {\emph{\WithArrowsRightX} - \x1 - 0.5 em}]
+% {#3}
+% (#2) ;
+% \draw let \p1 = (#1)
+% in (#1) -- ++(\emph{\WithArrowsRightX} - \x1,0) |- (#2) ; }}
+% \end{Code}
%
-% \begin{Verbatim}
+% \begin{Code}
%\begin{DispWithArrows}[MyStyle]
% S_n
-% & = \frac1n \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}2\cdot\tfrac kn\bigr)
+% & = \frac{1}{n} \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}{2}\cdot\tfrac{k}{n}\bigr)
% \Arrow{$\cos x = \Re(e^{ix})$}\\
% ...........
-% \end{Verbatim}
+% \end{Code}
%
% \WithArrowsNewStyle{MyStyle}
% {displaystyle,
@@ -2564,26 +2634,27 @@
% ygap = 2mm,
% xoffset = 0pt,
% ystart = 0mm,
-% tikz-code = {\path let \p1 = (##1)
-% in (##1)
+% tikz-code = {\path let \p1 = (#1)
+% in (#1)
% -- node [anchor = west,
-% text width = {\WithArrowsRightX - \x1 - 0.5 em}] {##3}
-% (##2) ;
-% \draw let \p1 = (##1)
-% in (##1) -- ++(\WithArrowsRightX - \x1,0) |- (##2) ; }}
+% text width = {\WithArrowsRightX - \x1 - 0.5 em}] {#3}
+% (#2) ;
+% \draw let \p1 = (#1)
+% in (#1) -- ++(\WithArrowsRightX - \x1,0) |- (#2) ; }}
%
%\begin{DispWithArrows}[MyStyle]
% S_n
-% & = \frac1n \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}2\cdot\tfrac kn\bigr)
+% & = \frac{1}{n} \sum_{k=0}^{n-1}\cos\bigl(\tfrac{\pi}{2}\cdot\tfrac{k}{n}\bigr)
% \Arrow{$\cos x = \Re(e^{ix})$}\\
-% & = \frac1n\sum_{k=0}^{n-1} \Re\left(e^{i\frac{k\pi}{2n}}\right)
+% & = \frac{1}{n} \sum_{k=0}^{n-1} \Re\left(e^{i\frac{k\pi}{2n}}\right)
% \Arrow{$\Re(z+z')=\Re(z)+\Re(z')$}\\
-% & = \frac1n \Re\left(\sum_{k=0}^{n-1} e^{i\frac{k\pi}{2n}}\right)
+% & = \frac{1}{n} \Re\left(\sum_{k=0}^{n-1} e^{i\frac{k\pi}{2n}}\right)
% \Arrow{$\exp$ is a morphism for $\times$ and $+$} \\
-% & = \frac1n \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
-% \Arrow{sum of terms of a geometric progression of ratio $e^{i\frac{2\pi}n}$}\\
-% & = \frac1n \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}}\right)\\
-% & = \frac1n \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
+% & = \frac{1}{n} \Re \left(\sum_{k=0}^{n-1}\bigl(e^{i\frac{\pi}{2n}}\bigr)^k\right)
+% \Arrow{sum of terms of a geometric progression of ratio $e^{i\frac{2\pi}{n}}$}\\
+% & = \frac{1}{n}
+% \Re \left( \frac{1-\bigl(e^{i\frac{\pi}{2n}}\bigr)^n}{1-e^{i\frac{\pi}{2n}}}\right)\\
+% & = \frac{1}{n} \Re \left(\frac{1-i}{1-e^{i\frac{\pi}{2n}}}\right)
% \end{DispWithArrows}
%
%
@@ -2595,23 +2666,23 @@
% the start row is longer than the end row or not. This example requires the
% Tikz library \pkg{calc}.
%
-% \begin{Verbatim}
+% \begin{Code}
% \begin{WithArrows}[ll,interline=5mm,xoffset=5mm,
-% ~emphase#tikz-code = {\draw[rounded corners,@
-% ~emphase# every node/.style = {circle,@
-% ~emphase# draw,@
-% ~emphase# auto = false,@
-% ~emphase# inner sep = 1pt,@
-% ~emphase# fill = gray!50,@
-% ~emphase# font = \tiny }]@
-% ~emphase# let \p1 = (~#1),@
-% ~emphase# \p2 = (~#2)@
-% ~emphase# in \ifdim \x1 > \x2@
-% ~emphase# (\p1) -- node {~#3} (\x1,\y2) -- (\p2)@
-% ~emphase# \else@
-% ~emphase# (\p1) -- (\x2,\y1) -- node {~#3} (\p2)@
-% ~emphase# \fi ;}@]
-% E & \Longleftrightarrow \frac{(x+4)}3 + \frac{5x+3}5 = 7
+% \emph{tikz-code = {\draw[rounded corners,
+% every node/.style = {circle,
+% draw,
+% auto = false,
+% inner sep = 1pt,
+% fill = gray!50,
+% font = \tiny }]
+% let \p1 = (~#1),
+% \p2 = (~#2)
+% in \ifdim \x1 > \x2
+% (\p1) -- node {~#3} (\x1,\y2) -- (\p2)
+% \else
+% (\p1) -- (\x2,\y1) -- node {~#3} (\p2)
+% \fi ;}}]
+% E & \Longleftrightarrow \frac{(x+4)}{3} + \frac{5x+3}{5} = 7
% \Arrow{$\times 15$}\\
% & \Longleftrightarrow 5(x+4) + 3(5x+3) = 105 \\
% & \Longleftrightarrow 5x+20 + 15x+9 = 105 \\
@@ -2621,7 +2692,7 @@
% \Arrow{$\div 20$}\\
% & \Longleftrightarrow x = \frac{38}{10}
% \end{WithArrows}
-% \end{Verbatim}
+% \end{Code}
%
%
% \[\begin{WithArrows}[ll,interline=5mm,xoffset=5mm,
@@ -2639,7 +2710,7 @@
% \else
% (\p1) -- (\x2,\y1) -- node {#3} (\p2)
% \fi ;}]
-% E & \Longleftrightarrow \frac{(x+4)}3 + \frac{5x+3}5 = 7
+% E & \Longleftrightarrow \frac{(x+4)}{3} + \frac{5x+3}{5} = 7
% \Arrow{$\times 15$}\\
% & \Longleftrightarrow 5(x+4) + 3(5x+3) = 105 \\
% & \Longleftrightarrow 5x+20 + 15x+9 = 105 \\
@@ -2674,8 +2745,8 @@
%
%
% \bigskip
-% \begin{Verbatim}
-% $\begin{WithArrows}[~emphase#code-after = \NumberedLoop@]
+% \begin{Code}
+% $\begin{WithArrows}[\emph{code-after = \NumberedLoop}]
% a.\;& f \text{ est continuous on } E \\
% b.\;& f \text{ est continuous in } 0 \\
% c.\;& f \text{ is bounded on the unit sphere} \\
@@ -2682,7 +2753,7 @@
% d.\;& \exists K > 0\quad \forall x \in E\quad \|f(x)\| \le K \|x\| \\
% e.\;& f \text{ is lipschitzian}
% \end{WithArrows}$
-% \end{Verbatim}
+% \end{Code}
%
% \bigskip
% \begin{scope}
@@ -2708,9 +2779,9 @@
% example, numbers in round brackets, the best way is to change the value of
% |tikz-code|:
%
-% \begin{Verbatim}
-% tikz-code = {\draw (~#1) to node {\footnotesize (~#3)} (~#2) ;}
-% \end{Verbatim}
+% \begin{Code}
+% tikz-code = {\draw (#1) to node {\footnotesize (#3)} (#2) ;}
+% \end{Code}
%
% \WithArrowsOptions{tikz-code = {\draw (#1) to node {\footnotesize (#3)} (#2) ;}}
%
@@ -2782,6 +2853,17 @@
%</plain-TeX>
% \end{macrocode}
%
+%
+% \begin{macrocode}
+%<*LaTeX>
+\ProvideDocumentCommand{\IfPackageLoadedT}{mm}
+ {\IfPackageLoadedTF{#1}{#2}{}}
+\ProvideDocumentCommand{\IfPackageLoadedF}{mm}
+ {\IfPackageLoadedTF{#1}{}{#2}}
+%</LaTeX>
+% \end{macrocode}
+%
+%
% \bigskip
% \subsection{The packages footnote and footnotehyper}
%
@@ -2864,8 +2946,7 @@
beamer .bool_gset:N = \g_@@_beamer_bool ,
beamer .default:n = true ,
beamer .usage:n = load ,
- unknown .code:n =
- \@@_fatal:n { Option~unknown~for~package }
+ unknown .code:n = \@@_fatal:n { Option~unknown~for~package }
}
% \end{macrocode}
%
@@ -2886,8 +2967,8 @@
% \end{macrocode}
%
% \begin{macrocode}
-\IfClassLoadedTF { beamer } { \bool_gset_true:N \g_@@_beamer_bool } { }
-\IfPackageLoadedTF { beamerarticle } { \bool_gset_true:N \g_@@_beamer_bool } { }
+\IfClassLoadedT { beamer } { \bool_gset_true:N \g_@@_beamer_bool }
+\IfPackageLoadedT { beamerarticle } { \bool_gset_true:N \g_@@_beamer_bool }
% \end{macrocode}
%
% \medskip
@@ -3034,6 +3115,9 @@
%
% \begin{macrocode}
\cs_generate_variant:Nn \seq_set_split:Nnn { N e e }
+\cs_generate_variant:Nn \keys_precompile:nnN { n n c }
+\prg_generate_conditional_variant:Nnn \tl_if_novalue:n { o } { F }
+\exp_args_generate:n { N N N n o }
% \end{macrocode}
%
%
@@ -3053,13 +3137,13 @@
% \end{macrocode}
%
% \bigskip
-% The following command creates a sequence of strings (|str|) from a |clist|.
+% The following command creates a sequence of strings (|str|) from a |clist|.
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_seq_of_str_from_clist:Nn #1 #2
{
\seq_set_from_clist:Nn #1 { #2 }
- \seq_set_map_x:NNn #1 #1 { \tl_to_str:n { ##1 } }
+ \seq_set_map_e:NNn #1 #1 { \tl_to_str:n { ##1 } }
}
% \end{macrocode}
%
@@ -3080,7 +3164,7 @@
% \end{macrocode}
% The string |\l_tmpa_str| will contains the \emph{type} of the variable.
% \begin{macrocode}
- \str_set:Nx \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
+ \str_set:Ne \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
\use:c { \l_tmpa_str _if_exist:cF }
{ g _\seq_use:Nnnn \l_tmpa_seq _ _ _ }
{
@@ -3102,7 +3186,7 @@
{ \char_generate:nn { `_ } { 12 } }
{ \cs_to_str:N #1 }
\seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
- \str_set:Nx \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
+ \str_set:Ne \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
\use:c { \l_tmpa_str _set_eq:Nc }
#1 { g_\seq_use:Nnnn \l_tmpa_seq _ _ _ }
}
@@ -3299,7 +3383,7 @@
% \begin{tabular}{l}
% \begin{tabular}{@{}l*8c@{}}
% \toprule
-% option & |lr| & |ll| & |rl| & |rr| & |v| & |i| & |groups| & |group| \\
+% option & |lr| & |ll| & |rl| & |rr| & |v| & |i| & |groups| & |group| \\
% \midrule
% |\l_@@_pos_arrow_int| & $0$ & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ \\
% \bottomrule
@@ -3392,7 +3476,7 @@
% be |Explanation|, this string will contain ``|\Arrow alias \Explanation|''.
% \begin{macrocode}
\str_new:N \l_@@_string_Arrow_for_msg_str
-\str_set:Nx \l_@@_string_Arrow_for_msg_str { \token_to_str:N \Arrow }
+\str_set:Ne \l_@@_string_Arrow_for_msg_str { \token_to_str:N \Arrow }
% \end{macrocode}
%
% \bigskip
@@ -3561,7 +3645,7 @@
more-columns .value_forbidden:n = true ,
command-name .code:n =
\str_set:Nn \l_@@_command_name_str { #1 }
- \str_set:Nx \l_@@_string_Arrow_for_msg_str
+ \str_set:Ne \l_@@_string_Arrow_for_msg_str
{ \c_backslash_str Arrow~alias~\c_backslash_str #1 } ,
command-name .value_required:n = true ,
tikz-code .tl_set:N = \l_@@_tikz_code_tl ,
@@ -3581,7 +3665,7 @@
\int_set:Nn \l_@@_pos_arrow_int 7
}
{ \@@_error:n { Incompatible~options } } ,
- group .value_forbidden:n = true ,
+ group .value_forbidden:n = true ,
groups .code:n =
\str_if_empty:NTF \l_@@_previous_key_str
{
@@ -3594,7 +3678,6 @@
{ \@@_error:n { Incompatible~options } } ,
groups .value_forbidden:n = true ,
tikz .code:n = \tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .initial:n = \c_empty_tl ,
tikz .value_required:n = true ,
rr .code:n = \@@_fix_pos_option:n 3 ,
rr .value_forbidden:n = true ,
@@ -3668,8 +3751,8 @@
\AtBeginDocument
{
\bool_set_false:N \l_tmpa_bool
- \IfPackageLoadedTF { amsmath } { \bool_set_true:N \l_tmpa_bool } { }
- \IfPackageLoadedTF { unicode-math } { \bool_set_true:N \l_tmpa_bool } { }
+ \IfPackageLoadedT { amsmath } { \bool_set_true:N \l_tmpa_bool }
+ \IfPackageLoadedT { unicode-math } { \bool_set_true:N \l_tmpa_bool }
\bool_if:NT \l_tmpa_bool
{ \clist_put_right:Nn \c_@@_ext_delimiters_clist { \lvert, \lVert } }
}
@@ -3729,7 +3812,7 @@
wrap-lines .default:n = true ,
replace-left-brace-by .code:n =
{
- \tl_set:Nx \l_tmpa_tl { \tl_head:n { #1 } }
+ \tl_set:Ne \l_tmpa_tl { \tl_head:n { #1 } }
\clist_if_in:NoTF
\c_@@_ext_delimiters_clist
\l_tmpa_tl
@@ -4057,7 +4140,6 @@
tikz-code .tl_set:N = \l_@@_tikz_code_tl ,
tikz-code .initial:n = \draw~(#1)~to~node{#3}~(#2)~; ,
tikz .code:n = \tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .initial:n = \c_empty_tl ,
rr .code:n = \@@_fix_pos_arrow:n 3 ,
ll .code:n = \@@_fix_pos_arrow:n 1 ,
rl .code:n = \@@_fix_pos_arrow:n 2 ,
@@ -4205,7 +4287,7 @@
% \item The ``status'' of the arrow, with 4 possible values: empty,
% |independent|, |new-group| or |over|.
% \begin{macrocode}
- \prop_put:NnV \l_tmpa_prop { status } \l_@@_status_arrow_str
+ \prop_put:Nno \l_tmpa_prop { status } \l_@@_status_arrow_str
% \end{macrocode}
%
% \item The options of the arrow (it's a token list):
@@ -4221,7 +4303,7 @@
% \item The number of the line where the command |\Arrow| is issued in the TeX
% source (as of now, this is only useful for some error messages).
% \begin{macrocode}
- \prop_put:Nnx \l_tmpa_prop { input-line } \msg_line_number:
+ \prop_put:Nne \l_tmpa_prop { input-line } \msg_line_number:
% \end{macrocode}
%
% \item The total width of the arrow (with the label)... but we don't know it
@@ -4347,10 +4429,10 @@
% command |\omit| in a cell of the |\halign| (it should be forbidden).
% For example, in the part of the preamble concerning the third column (if there
% is a third column in the environment), we will have the following instructions :
-% \begin{Verbatim}
-% \int_gincr:N \g_~@~@_col_int
-% \int_set:Nn \g_~@~@_static_col_int 3
-% \end{Verbatim}
+% \begin{Code}
+% \int_gincr:N \g_@@_col_int
+% \int_set:Nn \g_@@_static_col_int 3
+% \end{Code}
% The counter |\g_@@_col_int| is incremented dynamically and the second is
% static. If the user has used a command |\omit|, the dynamic incrementation is
% not done in the cell and, at the end of the row, the difference between the
@@ -4373,7 +4455,7 @@
\seq_set_eq:NN \l_tmpa_seq \g_@@_position_in_the_tree_seq
\seq_pop_right:NN \l_tmpa_seq \l_tmpa_tl
\str_clear_new:N \l_@@_prefix_str
- \str_set:Nx \l_@@_prefix_str { \seq_use:Nnnn \l_tmpa_seq - - - }
+ \str_set:Ne \l_@@_prefix_str { \seq_use:Nnnn \l_tmpa_seq - - - }
% \end{macrocode}
%
% \bigskip
@@ -4623,7 +4705,7 @@
% The command |\@@_set_qedhere:| will do a redefinition of |\qedhere| in each
% cell of the last column.
% \begin{macrocode}
- \IfPackageLoadedTF { amsmath } { \@@_set_qedhere: } { }
+ \IfPackageLoadedT { amsmath } { \@@_set_qedhere: }
}
%</LaTeX>
}
@@ -4847,7 +4929,7 @@
\hbox_set_end:
\@@_post_halign:
% \end{macrocode}
-% We want to add white space on the right side of the box in order to take into
+% We want to add white space on the right side of the box in order to take into
% account the arrows and their labels.
% \begin{macrocode}
\bool_if:NF \l_@@_right_overlap_bool
@@ -4951,7 +5033,7 @@
% \begin{macrocode}
\seq_gpop_right:NN \g_@@_position_in_the_tree_seq \l_tmpa_tl
\seq_gpop_right:NN \g_@@_position_in_the_tree_seq \l_tmpa_tl
- \seq_gput_right:Nx \g_@@_position_in_the_tree_seq
+ \seq_gput_right:Ne \g_@@_position_in_the_tree_seq
{ \int_eval:n { \l_tmpa_tl + 1 } }
% \end{macrocode}
%
@@ -5018,7 +5100,7 @@
%
% \bigskip
% Now, we test if the next token is the token |\end|. Indeed, we want to test if
-% the following tokens are |\end{WithArrows}| (or |\end{DispWithArrows}|, etc).
+% the following tokens are |\end{WithArrows}| (or |\end{Code}|, etc).
% In this case, we raise an error because the user must not put "\\" at the end
% of its alignment.
% \begin{macrocode}
@@ -5083,7 +5165,7 @@
% line. We use a global variable because we will use it in the \emph{next} cell
% (after the |&|).
% \begin{macrocode}
- \cs_gset:Npx \g_tmpa_tl
+ \cs_gset:Npe \g_tmpa_tl
{ \tl_if_empty:NTF \l_@@_tag_tl \theequation \l_@@_tag_tl }
% \end{macrocode}
% It's possible to put several labels for the same line (it's not possible in
@@ -5099,18 +5181,17 @@
%
% First an action which is in the definition of |\refstepcounter|.
% \begin{macrocode}
- \cs_set:Npx \@currentlabel { \p at equation \g_tmpa_tl }
+ \cs_set:Npe \@currentlabel { \p at equation \g_tmpa_tl }
% \end{macrocode}
% Then, an action done by \pkg{hyperref} in its redefinition of
% |\refstepcounter|.
% \begin{macrocode}
- \IfPackageLoadedTF { hyperref }
+ \IfPackageLoadedT { hyperref }
{
% the following line is probably pointless (2022/05/16)
% \str_set:Nn \This at name { equation }
\hyper at refstepcounter { equation }
}
- { }
% \end{macrocode}
% Then, an action done by \pkg{cleveref} in its redefinition of
% |\refstepcounter|. The package \pkg{cleveref} creates in the |aux| file a
@@ -5117,7 +5198,7 @@
% command |\cref at currentlabel| similar to |\@currentlabel| but with more
% informations.
% \begin{macrocode}
- \IfPackageLoadedTF { cleveref }
+ \IfPackageLoadedT { cleveref }
{
\cref at constructprefix { equation } \cref at result
\protected at edef \cref at currentlabel
@@ -5131,7 +5212,6 @@
\p at equation \g_tmpa_tl
}
}
- { }
% \end{macrocode}
% Now, we can issue the command |\label| (some packages may have redefined
% |\label|, for example \pkg{typedref}) for each item in the sequence of the
@@ -5271,8 +5351,8 @@
%
%
% \bigskip
-% The boolean |\l_@@_in_label_or_minipage_bool| will be raised if we are just after a |\item|
-% of a list of LaTeX or at the beginning of a |{minipage}|.
+% The boolean |\l_@@_in_label_or_minipage_bool| will be raised if we are just
+% after a |\item| of a list of LaTeX or at the beginning of a |{minipage}|.
% \begin{macrocode}
%<*LaTeX>
\bool_new:N \l_@@_in_label_or_minipage_bool
@@ -5313,7 +5393,7 @@
% |\item| of a LaTeX list and an environment |{DispWithArrows}| except with the
% option |standard-behaviour-with-items| stored in the boolean
% |\l_@@_sbwi_bool|. We have to know if we are just after an |\item| and this
-% information will be stored in |\l_@@_in_label_or_minipage_bool|. We have to do
+% information will be stored in |\l_@@_in_label_or_minipage_bool|. We have to do
% this test quicky after the beginning of the environment (in particular,
% because it must be done before the execution of the
% |code-before|\footnote{The |code-before| is not meant to contains typesetting
@@ -5339,7 +5419,7 @@
% environment).
% \begin{macrocode}
%<*LaTeX>
- \IfPackageLoadedTF { mathtools }
+ \IfPackageLoadedT { mathtools }
{
\MH_if_boolean:nT { show_only_refs }
{
@@ -5352,7 +5432,6 @@
\MH_set_boolean_T:n { show_only_refs }
}
}
- { }
% \end{macrocode}
%
% An action done by \pkg{typedref} in its redefinition of |\refstepcounter|. The
@@ -5359,17 +5438,16 @@
% command |\sr at name| is a prefix added to the name of the label by the
% redefinition of |\label| done by \pkg{typedref}.
% \begin{macrocode}
- \IfPackageLoadedTF { typedref }
+ \IfPackageLoadedT { typedref }
{ \str_set:Nn \sr at name { equation } }
- { }
% \end{macrocode}
%
% The command |\intertext@| is a command of \pkg{amsmath} which loads the
% definition of |\intertext|.
% \begin{macrocode}
- \IfPackageLoadedTF { amsmath } { \intertext@ } { }
+ \IfPackageLoadedT { amsmath } { \intertext@ }
%</LaTeX>
- \exp_args:No \tl_if_novalue:nF { #1 }
+ \tl_if_novalue:oF { #1 }
{ \cs_set_nopar:Npn \l_@@_left_brace_tl { #1 } }
\@@_pre_halign:n { #2 }
% \end{macrocode}
@@ -5391,7 +5469,8 @@
\hbox_set:Nn \l_tmpa_box
{
% \end{macrocode}
-% Even if the default value of |\nulldelimiterspace| is 1.2~pt, we take it into account.
+% Even if the default value of |\nulldelimiterspace| is 1.2~pt, we take it into
+% account.
% \begin{macrocode}
\group_begin:
\dim_zero:N \nulldelimiterspace
@@ -5455,7 +5534,7 @@
%<*LaTeX>
\bool_if:NTF \l_@@_in_label_or_minipage_bool
{
- \noindent % added in v. 2.6d
+ \noindent
\c_math_toggle_token
}
{
@@ -5637,9 +5716,8 @@
% the environment).
% \begin{macrocode}
%<*LaTeX>
- \IfPackageLoadedTF { mathtools }
+ \IfPackageLoadedT { mathtools }
{ \MH_if_boolean:nT { show_only_refs } \MT_showonlyrefs_true: }
- { }
\bool_if:NTF \l_@@_in_label_or_minipage_bool
{
\c_math_toggle_token
@@ -5732,8 +5810,8 @@
%
% \bigskip
% The command |\@@_tag| will be linked to |\tag| in |{WithArrows}| and
-% |{DispWithArrows}|. We do the definition with |\NewDocumentCommand| because this
-% command has a starred version.
+% |{DispWithArrows}|. We do the definition with |\NewDocumentCommand| because
+% this command has a starred version.
% \begin{macrocode}
\NewDocumentCommand \@@_tag { s m }
{
@@ -5742,7 +5820,7 @@
\tl_if_empty:NF \l_@@_tag_tl
{ \@@_error:nn { Multiple~tags } { #2 } }
\clist_set:Nn \l_@@_tags_clist { all }
- \IfPackageLoadedTF { mathtools }
+ \IfPackageLoadedT { mathtools }
{
\MH_if_boolean:nT { show_only_refs }
{
@@ -5750,7 +5828,6 @@
{ \clist_clear:N \l_@@_tags_clist }
}
}
- { }
\tl_set:Nn \l_@@_tag_tl { #2 }
\bool_set:Nn \l_@@_tag_star_bool { #1 }
% \end{macrocode}
@@ -5762,8 +5839,7 @@
% \begin{macrocode}
\bool_if:nT { #1 }
{
- \IfPackageLoadedTF { amsmath }
- { }
+ \IfPackageLoadedF { amsmath }
{ \@@_error:n { tag*~without~amsmath } }
}
}
@@ -5788,7 +5864,7 @@
{ \@@_error:n { Multiple~labels } }
}
\seq_put_right:Nn \l_@@_labels_seq { #1 }
- \IfPackageLoadedTF { mathtools }
+ \IfPackageLoadedT { mathtools }
{
\MH_if_boolean:nT { show_only_refs }
{
@@ -5797,14 +5873,12 @@
{ \clist_clear:N \l_@@_tags_clist }
}
}
- { }
- \IfPackageLoadedTF { autonum }
+ \IfPackageLoadedT { autonum }
{
\cs_if_exist:cTF { autonum@#1Referenced }
{ \clist_set:Nn \l_@@_tags_clist { all } }
{ \clist_clear:N \l_@@_tags_clist }
}
- { }
}
}
% \end{macrocode}
@@ -6028,7 +6102,7 @@
}
{ \bool_not_p:n { \int_compare_p:nNn \l_@@_pos_arrow_int = 7 } }
}
- { \str_if_eq_p:Vn \l_@@_status_arrow_str { new-group } }
+ { \str_if_eq_p:on \l_@@_status_arrow_str { new-group } }
}
{
\int_if_zero:nF \l_@@_first_arrow_of_group_int
@@ -6084,7 +6158,7 @@
% If the arrow is independent, we don't take into account that arrow for the
% detection of the end of the group.
% \begin{macrocode}
- \str_if_eq:VnF \l_@@_status_arrow_str { independent }
+ \str_if_eq:onF \l_@@_status_arrow_str { independent }
{
% \end{macrocode}
% If the arrow is not independent, the arrow belongs to the current group and we
@@ -6122,14 +6196,6 @@
% \end{macrocode}
%
%
-% \bigskip
-% The following code is necessary because we will have to expand an argument
-% exactly 3 times.
-% \begin{macrocode}
-\cs_generate_variant:Nn \keys_set:nn { n o }
-\cs_new_protected:Npn \@@_keys_set:
- { \keys_set_known:no { WithArrows / Arrow / SecondPass } }
-% \end{macrocode}
%
% \bigskip
% The macro |\@@_draw_arrows:nn| draws all the arrows whose numbers are between
@@ -6200,6 +6266,7 @@
}
% \end{macrocode}
%
+%
% \bigskip
% The first |\group_begin:| is for the options of the arrows (but we remind that
% the options |ll|, |rr|, |rl|, |lr|, |i| and |jump| have already been extracted
@@ -6211,19 +6278,26 @@
% \end{macrocode}
%
% \bigskip
-% We process the options of the current arrow. The second argument of
-% |\keys_set:nn| must be expanded exactly three times. An x-expansion is not
-% possible because there can be tokens like |\bfseries| in the option |font| of
-% the option |tikz|. This expansion is a bit tricky.
+% We process the options of the current arrow.
% \begin{macrocode}
\prop_get:cnN
{ g_@@_arrow _\l_@@_prefix_str _ \int_use:N \l_@@_arrow_int _ prop }
- { options } \l_tmpa_tl
+ { options }
+ \l_tmpa_tl
\str_clear_new:N \l_@@_previous_key_str
- \exp_args:NNo \exp_args:No
- \@@_keys_set: { \l_tmpa_tl , tikz = { xshift = \l_@@_xoffset_dim } }
% \end{macrocode}
%
+% We will expand the second argument of |\keys_set_known:nn| exactly three
+% times. Maybe that an e-expansion would be possible but, in the past, there
+% were problems with fragile commands such as |\bfseries| in the option
+% |font| of the option |tikz| (it seems that this no longer the case).
+% \begin{macrocode}
+ \exp_args:NNNno \exp_args:NNno \exp_args:Nno
+ \keys_set_known:nn
+ { WithArrows / Arrow / SecondPass }
+ { \l_tmpa_tl , tikz = { xshift = \l_@@_xoffset_dim } }
+% \end{macrocode}
+%
% We create two booleans to indicate the position of the initial node and final
% node of the arrow in cases of options |rr|, |rl|, |lr| or |ll|:
% \begin{macrocode}
@@ -6275,9 +6349,9 @@
% the point will perhaps have another
% $x$-value --- but always the same $y$-value). Idem for |\l_@@_final_tl|.
% \begin{macrocode}
- \tl_set:Nx \l_@@_initial_tl
+ \tl_set:Ne \l_@@_initial_tl
{ \int_use:N \l_@@_initial_int - \bool_if:NTF \l_@@_initial_r_bool rl }
- \tl_set:Nx \l_@@_final_tl
+ \tl_set:Ne \l_@@_final_tl
{ \int_use:N \l_@@_final_int - \bool_if:NTF \l_@@_final_r_bool rl }
% \end{macrocode}
%
@@ -6300,11 +6374,11 @@
% done in the following |{tikzpicture}| because of the command |\seq_if_in:NnTF|
% which is \emph{not} expandable.
% \begin{macrocode}
- \seq_if_in:NxTF \l_@@_first_arrows_seq
+ \seq_if_in:NeTF \l_@@_first_arrows_seq
{ \int_use:N \l_@@_arrow_int }
{ \bool_set_true:N \l_tmpa_bool }
{ \bool_set_false:N \l_tmpa_bool }
- \seq_if_in:NxTF \l_@@_last_arrows_seq
+ \seq_if_in:NeTF \l_@@_last_arrows_seq
{ \int_use:N \l_@@_arrow_int }
{ \bool_set_true:N \l_tmpb_bool }
{ \bool_set_false:N \l_tmpb_bool }
@@ -6349,7 +6423,7 @@
}
{ \int_compare_p:nNn { \l_@@_final_int - \l_@@_initial_int } = 1 }
{
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{
\int_compare:nNnTF \l_@@_pos_arrow_int < 5
{ \dim_use:N \g_@@_x_initial_dim }
@@ -6360,7 +6434,7 @@
+ 0.5 \l_@@_max_length_of_arrow_dim
}
}
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{
\int_compare:nNnTF \l_@@_pos_arrow_int < 5
{ \dim_use:N \g_@@_x_final_dim }
@@ -6373,7 +6447,7 @@
}
}
{
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{
\int_compare:nNnTF \l_@@_pos_arrow_int < 5
{ \dim_use:N \g_@@_x_initial_dim }
@@ -6382,7 +6456,7 @@
{ \dim_eval:n { \g_@@_y_initial_dim + \l_@@_start_adjust_dim } }
{ \dim_use:N \g_@@_y_initial_dim }
}
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{
\int_compare:nNnTF \l_@@_pos_arrow_int < 5
{ \dim_use:N \g_@@_x_final_dim }
@@ -6448,12 +6522,13 @@
% The function |@@_tmpa:nnn| will draw the arrow. It's merely an environment
% |{tikzpicture}|. However, the Tikz instruction in this environment must be
% inserted from |\l_@@_tikz_code_tl| with the markers |#1|, |#2| and |#3|.
-% That's why we create a function |\@@_def_function_tmpa:n| which will create
-% the function |\@@_tmpa:nnn|.
+% That's why we create a function |\@@_def_function_arrow:n| which will create
+% the function |\@@_arrow:nnn|.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_def_function_tmpa:n #1
+\cs_generate_variant:Nn \@@_def_function_arrow:n { o }
+\cs_new_protected:Npn \@@_def_function_arrow:n #1
{
- \cs_set:Npn \@@_tmpa:nnn ##1 ##2 ##3
+ \cs_set:Npn \@@_arrow:nnn ##1 ##2 ##3
{
%<*LaTeX>
\begin{tikzpicture}
@@ -6512,8 +6587,9 @@
%
% \medskip
% When we draw the arrow (with |\@@_draw_arrow:nnn|), we first create the
-% function |\@@_tmpa:nnn| and, then, we use the function |\@@_tmpa:nnn| :
+% function |\@@_arrow:nnn| and, then, we use the function |\@@_arrow:nnn| :
% \begin{macrocode}
+\cs_generate_variant:Nn \@@_draw_arrow:nnn { n n o }
\cs_new_protected:Npn \@@_draw_arrow:nnn #1 #2 #3
{
% \end{macrocode}
@@ -6529,10 +6605,9 @@
% \medskip
% Now, the main lines of this function |\@@_draw_arrow:nnn|.
% \begin{macrocode}
- \exp_args:No \@@_def_function_tmpa:n \l_@@_tikz_code_tl
- \@@_tmpa:nnn { #1 } { #2 } { #3 }
+ \@@_def_function_arrow:o \l_@@_tikz_code_tl
+ \@@_arrow:nnn { #1 } { #2 } { #3 }
}
-\cs_generate_variant:Nn \@@_draw_arrow:nnn { n n o }
% \end{macrocode}
%
% \bigskip
@@ -6541,7 +6616,7 @@
% \begin{macrocode}
\tl_const:Nn \c_@@_tikz_code_wrap_lines_tl
{
- \pgfset { inner~sep = 0pt}
+ \pgfset { inner~sep = 0pt }
% \end{macrocode}
% First, we draw the arrow without the label.
% \begin{macrocode}
@@ -6556,7 +6631,7 @@
% Here is the use of |\g_@@_right_x_dim| which has been computed previously with
% the |v|-nodes.
% \begin{macrocode}
- \dim_set:Nn \l_tmpa_dim { \g_@@_right_x_dim - \pgf at x - 0.3333 ex }
+ \dim_set:Nn \l_tmpa_dim { \g_@@_right_x_dim - \pgf at x - 0.33333 em }
% \end{macrocode}
% We retrieve in |\g_tmpa_tl| the current value of the Tikz parameter
% ``|text width|''.\footnote{In fact, it's not the current value of
@@ -6564,7 +6639,7 @@
% provided by \pkg{witharrows}. These options are given to Tikz in a
% ``|every path|''. That's why we have to retrieve it in a path.}
% \begin{macrocode}
- \path \pgfextra { \tl_gset:Nx \g_tmpa_tl \tikz at text@width } ;
+ \path \pgfextra { \tl_gset:Ne \g_tmpa_tl \tikz at text@width } ;
% \end{macrocode}
% Maybe the current value of the parameter ``|text width|'' is shorter than
% |\l_tmpa_dim|. In this case, we must use ``|text width|'' (we update
@@ -6585,7 +6660,7 @@
%<*LaTeX>
node [ anchor = west ]
{
- \skip_horizontal:n { 0.3333 ex }
+ \skip_horizontal:n { 0.33333 em }
\begin { minipage } { \l_tmpa_dim }
\tikz at text@action
\pgfkeysgetvalue { / tikz / node~halign~header } \l_tmpa_tl
@@ -6605,7 +6680,7 @@
%</LaTeX>
%<*plain-TeX>
node [ anchor = west , text~width = \dim_use:N \l_tmpa_dim ]
- { #3 } ;
+ { \skip_horizontal:n { 0.33333 em } #3 } ;
%</plain-TeX>
}
}
@@ -6662,7 +6737,7 @@
%
%
% The second point ensures the expected output in situations such as in the
-% following example :
+% following example:
%
% \bigskip
% \begin{BVerbatim}[boxwidth=6cm,baseline=c]
@@ -6776,7 +6851,7 @@
% computed the \emph{width} of the arrows and that's why our arrow of type~|o|
% will be positionned only relatively to the current group.
% \begin{macrocode}
- { \str_if_eq_p:Vn \l_@@_status_arrow_str { independent } }
+ { \str_if_eq_p:on \l_@@_status_arrow_str { independent } }
}
{
% \end{macrocode}
@@ -6844,22 +6919,22 @@
{
tikz .code:n =
\tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .value_required:n = true ,
- rr .value_forbidden:n = true ,
- rr .code:n = \@@_fix_pos_option:n 0 ,
- ll .value_forbidden:n = true,
- ll .code:n = \@@_fix_pos_option:n 1 ,
- rl .value_forbidden:n = true ,
- rl .code:n = \@@_fix_pos_option:n 2 ,
- lr .value_forbidden:n = true ,
- lr .code:n = \@@_fix_pos_option:n 3 ,
- v .value_forbidden:n = true ,
- v .code:n = \@@_fix_pos_option:n 4 ,
+ tikz .value_required:n = true ,
+ rr .value_forbidden:n = true ,
+ rr .code:n = \@@_fix_pos_option:n 0 ,
+ ll .value_forbidden:n = true,
+ ll .code:n = \@@_fix_pos_option:n 1 ,
+ rl .value_forbidden:n = true ,
+ rl .code:n = \@@_fix_pos_option:n 2 ,
+ lr .value_forbidden:n = true ,
+ lr .code:n = \@@_fix_pos_option:n 3 ,
+ v .value_forbidden:n = true ,
+ v .code:n = \@@_fix_pos_option:n 4 ,
tikz-code .tl_set:N = \l_@@_tikz_code_tl ,
tikz-code .value_required:n = true ,
- xoffset .dim_set:N = \l_@@_xoffset_dim ,
- xoffset .value_required:n = true ,
- unknown .code:n =
+ xoffset .dim_set:N = \l_@@_xoffset_dim ,
+ xoffset .value_required:n = true ,
+ unknown .code:n =
\@@_sort_seq:N \l_@@_options_Arrow_code_after_seq
\@@_error:n { Unknown~option~Arrow~in~code-after }
}
@@ -6940,9 +7015,9 @@
{ north }
\dim_set:Nn \l_tmpa_dim
{ \dim_max:nn \l_tmpa_dim \pgf at x }
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{ \dim_use:N \l_tmpa_dim , \dim_use:N \l_tmpb_dim }
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{ \dim_use:N \l_tmpa_dim , \dim_use:N \pgf at y }
\endpgfpicture
}
@@ -6955,7 +7030,7 @@
#2 - \bool_if:NTF \l_@@_initial_r_bool r l
}
{ south }
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{ \dim_use:N \pgf at x , \dim_use:N \pgf at y }
\pgfpointanchor
{
@@ -6963,7 +7038,7 @@
#3 - \bool_if:NTF \l_@@_final_r_bool r l
}
{ north }
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{ \dim_use:N \pgf at x , \dim_use:N \pgf at y }
\endpgfpicture
}
@@ -7012,7 +7087,7 @@
{
\cs_if_free:cTF { pgf at sh@ns at wa - \l_@@_prefix_str - \x - l }
{ \@@_error:ne { Wrong~line~specification~in~MultiArrow } \x }
- { \clist_gput_right:Nx \g_tmpa_clist \x }
+ { \clist_gput_right:Ne \g_tmpa_clist \x }
}
% \end{macrocode}
% We sort the list |\g_tmpa_clist| because we want to extract the minimum and
@@ -7047,7 +7122,7 @@
% the last teeth of the rak can't be drawn the same way as the others (think,
% for example, to the case of the option ``|rounded corners|'' is used).
% \begin{macrocode}
- \exp_args:NV \@@_MultiArrow_i:n \g_tmpa_clist
+ \exp_args:No \@@_MultiArrow_i:n \g_tmpa_clist
% \end{macrocode}
%
% Now, we draw the rest of the structure.
@@ -7069,7 +7144,7 @@
-- ([xshift = \l_@@_xoffset_dim]\l_tmpb_tl-r.south) ;
\pgfpointanchor { wa - \l_@@_prefix_str - @@_label } { west }
\dim_set:Nn \l_tmpa_dim { 20 cm }
- \path \pgfextra { \tl_gset:Nx \g_tmpa_tl \tikz at text@width } ;
+ \path \pgfextra { \tl_gset:Ne \g_tmpa_tl \tikz at text@width } ;
\tl_if_empty:NF \g_tmpa_tl { \dim_set:Nn \l_tmpa_dim \g_tmpa_tl }
\bool_lazy_and:nnT \l_@@_wrap_lines_bool \l_@@_in_DispWithArrows_bool
{
@@ -7579,8 +7654,8 @@
Normally,~we~can't~use~the~command~\token_to_str:N\label\
twice~in~a~line~of~the~environment~\{\l_@@_type_env_str\}. \\
However,~you~can~go~on.~
- \IfPackageLoadedTF { showlabels }
- { However,~only~the~last~label~will~be~shown~by~showlabels.~ } { }
+ \IfPackageLoadedT { showlabels }
+ { However,~only~the~last~label~will~be~shown~by~showlabels.~ }
If~you~don't~want~to~see~this~message~again,~you~can~use~the~option~
'allow-multiple-labels'~at~the~global~or~environment~level.
}
@@ -7684,17 +7759,18 @@
\keyval_parse:NNn \@@_valid_key:n \@@_valid_key:nn { #2 }
\seq_if_empty:NTF \l_tmpa_seq
{
- \seq_put_right:Nx \l_@@_options_WithArrows_seq
+ \seq_put_right:Ne \l_@@_options_WithArrows_seq
{ \tl_to_str:n { #1 } }
- \seq_put_right:Nx \l_@@_options_DispWithArrows_seq
+ \seq_put_right:Ne \l_@@_options_DispWithArrows_seq
{ \tl_to_str:n { #1 } }
- \seq_put_right:Nx \l_@@_options_WithArrowsOptions_seq
+ \seq_put_right:Ne \l_@@_options_WithArrowsOptions_seq
{ \tl_to_str:N { #1 } }
- \keys_precompile:nnN
+ \keys_precompile:nnc
{ WithArrows / WithArrowsOptions }
{ #2 }
- \l_tmpa_tl
- \@@_key_define:nV { #1 } \l_tmpa_tl
+ { @@ _ style _ #1 _ tl }
+ \keys_define:nn { WithArrows / Global }
+ { #1 .code:n = \use:c { @@ _ style _ #1 _ tl } }
}
{ \@@_error:nn { Impossible~style } { #1 } }
}
@@ -7725,15 +7801,9 @@
% \end{macrocode}
%
% \begin{macrocode}
-\cs_new_protected:Npn \@@_key_define:nn #1 #2
- { \keys_define:nn { WithArrows / Global } { #1 .code:n = #2 } }
-\cs_generate_variant:Nn \@@_key_define:nn { n V }
-% \end{macrocode}
-%
-% \begin{macrocode}
\@@_msg_new:nn { Key~already~defined }
{
- Key~already~define.\\
+ Key~already~defined.\\
The~key~'#1'~is~already~defined. \\
If~you~go~on,~your~instruction~\token_to_str:N\WithArrowsNewStyle\
will~be~ignored.
@@ -7813,7 +7883,7 @@
{
\dim_set:Nn \l_tmpa_dim { \x2 - \x1 }
\begin { varwidth } \l_tmpa_dim
-% \end{macrocode}a
+% \end{macrocode}
% |\narrowragged| is a command of the package \pkg{varwidth}.
% \begin{macrocode}
\narrowragged
@@ -8038,9 +8108,9 @@
\str_if_empty:NT \l_@@_previous_key_str
{
\str_set:Nn \l_@@_previous_key_str { up }
- \cs_if_exist:cTF { tikz at library@calc at loaded }
+ \cs_if_exist:NTF \tikz at library@calc at loaded
{
- \keys_set:nV { WithArrows / up-and-down } \l_keys_value_tl
+ \keys_set:no { WithArrows / up-and-down } \l_keys_value_tl
\int_set:Nn \l_@@_pos_arrow_int 1
% \end{macrocode}
% We have to set |\l_@@_wrap_lines_bool| to |false| because, otherwise, if the
@@ -8059,9 +8129,9 @@
\str_if_empty:NT \l_@@_previous_key_str
{
\str_set:Nn \l_@@_previous_key_str { down }
- \cs_if_exist:cTF { tikz at library@calc at loaded }
+ \cs_if_exist:NTF \tikz at library@calc at loaded
{
- \keys_set:nV { WithArrows / up-and-down } \l_keys_value_tl
+ \keys_set:no { WithArrows / up-and-down } \l_keys_value_tl
\int_set:Nn \l_@@_pos_arrow_int 1
\bool_set_false:N \l_@@_wrap_lines_bool
\tl_set_eq:NN \l_@@_tikz_code_tl \c_@@_tikz_code_down_tl
Modified: trunk/Master/texmf-dist/tex/generic/witharrows/witharrows.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/witharrows/witharrows.sty 2024-10-19 14:25:00 UTC (rev 72593)
+++ trunk/Master/texmf-dist/tex/generic/witharrows/witharrows.sty 2024-10-19 20:25:31 UTC (rev 72594)
@@ -18,8 +18,9 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-\def\myfileversion{2.9}
-\def\myfiledate{2024/10/05}
+\def\myfileversion{2.9a}
+\def\myfiledate{2024/10/19}
+
\RequirePackage{tikz}
\usetikzlibrary{arrows.meta}
\usepgfmodule{bending} % https://texnique.fr/osqa/questions/12199
@@ -30,6 +31,10 @@
{\myfileversion}
{Draws arrows for explanations on the right}
\RequirePackage { varwidth }
+\ProvideDocumentCommand{\IfPackageLoadedT}{mm}
+ {\IfPackageLoadedTF{#1}{#2}{}}
+\ProvideDocumentCommand{\IfPackageLoadedF}{mm}
+ {\IfPackageLoadedTF{#1}{}{#2}}
\bool_new:N \c__witharrows_footnotehyper_bool
\bool_new:N \c__witharrows_footnote_bool
\cs_new_protected:Npn \__witharrows_msg_new:nn { \msg_new:nnn { witharrows } }
@@ -63,8 +68,7 @@
beamer .bool_gset:N = \g__witharrows_beamer_bool ,
beamer .default:n = true ,
beamer .usage:n = load ,
- unknown .code:n =
- \__witharrows_fatal:n { Option~unknown~for~package }
+ unknown .code:n = \__witharrows_fatal:n { Option~unknown~for~package }
}
\__witharrows_msg_new:nn { Option~unknown~for~package }
{
@@ -73,8 +77,8 @@
\token_to_str:N\WithArrowsOptions.
}
\ProcessKeysOptions { WithArrows / package }
-\IfClassLoadedTF { beamer } { \bool_gset_true:N \g__witharrows_beamer_bool } { }
-\IfPackageLoadedTF { beamerarticle } { \bool_gset_true:N \g__witharrows_beamer_bool } { }
+\IfClassLoadedT { beamer } { \bool_gset_true:N \g__witharrows_beamer_bool }
+\IfPackageLoadedT { beamerarticle } { \bool_gset_true:N \g__witharrows_beamer_bool }
\__witharrows_msg_new:nn { footnote~with~footnotehyper~package }
{
Footnote~forbidden.\\
@@ -138,6 +142,9 @@
\cs_new_protected:Npn \__witharrows_collect_options:nnw #1#2[#3]
{ \__witharrows_collect_options:nn { #1 } { #2 , #3 } }
\cs_generate_variant:Nn \seq_set_split:Nnn { N e e }
+\cs_generate_variant:Nn \keys_precompile:nnN { n n c }
+\prg_generate_conditional_variant:Nnn \tl_if_novalue:n { o } { F }
+\exp_args_generate:n { N N N n o }
\cs_new_protected:Npn \__witharrows_sort_seq:N #1
{
\seq_sort:Nn #1
@@ -151,7 +158,7 @@
\cs_new_protected:Npn \__witharrows_set_seq_of_str_from_clist:Nn #1 #2
{
\seq_set_from_clist:Nn #1 { #2 }
- \seq_set_map_x:NNn #1 #1 { \tl_to_str:n { ##1 } }
+ \seq_set_map_e:NNn #1 #1 { \tl_to_str:n { ##1 } }
}
\cs_new_protected:Npn \__witharrows_save:N #1
{
@@ -159,7 +166,7 @@
{ \char_generate:nn { `_ } { 12 } }
{ \cs_to_str:N #1 }
\seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
- \str_set:Nx \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
+ \str_set:Ne \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
\use:c { \l_tmpa_str _if_exist:cF }
{ g _\seq_use:Nnnn \l_tmpa_seq _ _ _ }
{
@@ -175,7 +182,7 @@
{ \char_generate:nn { `_ } { 12 } }
{ \cs_to_str:N #1 }
\seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
- \str_set:Nx \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
+ \str_set:Ne \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
\use:c { \l_tmpa_str _set_eq:Nc }
#1 { g_\seq_use:Nnnn \l_tmpa_seq _ _ _ }
}
@@ -272,7 +279,7 @@
\str_new:N \l__witharrows_command_name_str
\str_set:Nn \l__witharrows_command_name_str { Arrow }
\str_new:N \l__witharrows_string_Arrow_for_msg_str
-\str_set:Nx \l__witharrows_string_Arrow_for_msg_str { \token_to_str:N \Arrow }
+\str_set:Ne \l__witharrows_string_Arrow_for_msg_str { \token_to_str:N \Arrow }
\seq_new:N \g__witharrows_names_seq
\bool_new:N \l__witharrows_sbwi_bool
\bool_new:N \l__witharrows_tag_star_bool
@@ -323,7 +330,7 @@
more-columns .value_forbidden:n = true ,
command-name .code:n =
\str_set:Nn \l__witharrows_command_name_str { #1 }
- \str_set:Nx \l__witharrows_string_Arrow_for_msg_str
+ \str_set:Ne \l__witharrows_string_Arrow_for_msg_str
{ \c_backslash_str Arrow~alias~\c_backslash_str #1 } ,
command-name .value_required:n = true ,
tikz-code .tl_set:N = \l__witharrows_tikz_code_tl ,
@@ -343,7 +350,7 @@
\int_set:Nn \l__witharrows_pos_arrow_int 7
}
{ \__witharrows_error:n { Incompatible~options } } ,
- group .value_forbidden:n = true ,
+ group .value_forbidden:n = true ,
groups .code:n =
\str_if_empty:NTF \l__witharrows_previous_key_str
{
@@ -356,7 +363,6 @@
{ \__witharrows_error:n { Incompatible~options } } ,
groups .value_forbidden:n = true ,
tikz .code:n = \tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .initial:n = \c_empty_tl ,
tikz .value_required:n = true ,
rr .code:n = \__witharrows_fix_pos_option:n 3 ,
rr .value_forbidden:n = true ,
@@ -408,8 +414,8 @@
\AtBeginDocument
{
\bool_set_false:N \l_tmpa_bool
- \IfPackageLoadedTF { amsmath } { \bool_set_true:N \l_tmpa_bool } { }
- \IfPackageLoadedTF { unicode-math } { \bool_set_true:N \l_tmpa_bool } { }
+ \IfPackageLoadedT { amsmath } { \bool_set_true:N \l_tmpa_bool }
+ \IfPackageLoadedT { unicode-math } { \bool_set_true:N \l_tmpa_bool }
\bool_if:NT \l_tmpa_bool
{ \clist_put_right:Nn \c__witharrows_ext_delimiters_clist { \lvert, \lVert } }
}
@@ -453,7 +459,7 @@
wrap-lines .default:n = true ,
replace-left-brace-by .code:n =
{
- \tl_set:Nx \l_tmpa_tl { \tl_head:n { #1 } }
+ \tl_set:Ne \l_tmpa_tl { \tl_head:n { #1 } }
\clist_if_in:NoTF
\c__witharrows_ext_delimiters_clist
\l_tmpa_tl
@@ -660,7 +666,6 @@
tikz-code .tl_set:N = \l__witharrows_tikz_code_tl ,
tikz-code .initial:n = \draw~(#1)~to~node{#3}~(#2)~; ,
tikz .code:n = \tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .initial:n = \c_empty_tl ,
rr .code:n = \__witharrows_fix_pos_arrow:n 3 ,
ll .code:n = \__witharrows_fix_pos_arrow:n 1 ,
rl .code:n = \__witharrows_fix_pos_arrow:n 2 ,
@@ -711,10 +716,10 @@
\prop_put:NnV \l_tmpa_prop { initial } \g__witharrows_line_int
\int_set:Nn \l_tmpa_int { \g__witharrows_line_int + \l__witharrows_jump_int }
\prop_put:NnV \l_tmpa_prop { final } \l_tmpa_int
- \prop_put:NnV \l_tmpa_prop { status } \l__witharrows_status_arrow_str
+ \prop_put:Nno \l_tmpa_prop { status } \l__witharrows_status_arrow_str
\prop_put:Nnn \l_tmpa_prop { options } { #1 , #3 }
\prop_put:Nnn \l_tmpa_prop { label } { #2 }
- \prop_put:Nnx \l_tmpa_prop { input-line } \msg_line_number:
+ \prop_put:Nne \l_tmpa_prop { input-line } \msg_line_number:
\prop_put:Nnn \l_tmpa_prop { width } { 0 pt }
\prop_gclear_new:c
{ g__witharrows_arrow _ \l__witharrows_prefix_str _ \int_use:N \g__witharrows_arrow_int _ prop }
@@ -747,7 +752,7 @@
\seq_set_eq:NN \l_tmpa_seq \g__witharrows_position_in_the_tree_seq
\seq_pop_right:NN \l_tmpa_seq \l_tmpa_tl
\str_clear_new:N \l__witharrows_prefix_str
- \str_set:Nx \l__witharrows_prefix_str { \seq_use:Nnnn \l_tmpa_seq - - - }
+ \str_set:Ne \l__witharrows_prefix_str { \seq_use:Nnnn \l_tmpa_seq - - - }
\cs_set_eq:NN \\ \__witharrows_cr:
\dim_zero:N \mathsurround
\int_zero_new:N \l__witharrows_initial_int
@@ -803,7 +808,7 @@
\bool_if:NT \l__witharrows_in_DispWithArrows_bool
{
\__witharrows_test_if_to_tag:
- \IfPackageLoadedTF { amsmath } { \__witharrows_set_qedhere: } { }
+ \IfPackageLoadedT { amsmath } { \__witharrows_set_qedhere: }
}
}
\str_if_eq:onT \l__witharrows_type_col_str { c } \hfil
@@ -951,7 +956,7 @@
\group_end:
\seq_gpop_right:NN \g__witharrows_position_in_the_tree_seq \l_tmpa_tl
\seq_gpop_right:NN \g__witharrows_position_in_the_tree_seq \l_tmpa_tl
- \seq_gput_right:Nx \g__witharrows_position_in_the_tree_seq
+ \seq_gput_right:Ne \g__witharrows_position_in_the_tree_seq
{ \int_eval:n { \l_tmpa_tl + 1 } }
\int_compare:nNnT { \seq_count:N \g__witharrows_position_in_the_tree_seq } = 1
{ \int_gincr:N \g__witharrows_last_env_int }
@@ -995,19 +1000,18 @@
\clist_if_in:NnTF \l__witharrows_tags_clist { all }
{
\tl_if_empty:NT \l__witharrows_tag_tl { \int_gincr:N \c at equation }
- \cs_gset:Npx \g_tmpa_tl
+ \cs_gset:Npe \g_tmpa_tl
{ \tl_if_empty:NTF \l__witharrows_tag_tl \theequation \l__witharrows_tag_tl }
\seq_if_empty:NF \l__witharrows_labels_seq
{
- \cs_set:Npx \@currentlabel { \p at equation \g_tmpa_tl }
- \IfPackageLoadedTF { hyperref }
+ \cs_set:Npe \@currentlabel { \p at equation \g_tmpa_tl }
+ \IfPackageLoadedT { hyperref }
{
% the following line is probably pointless (2022/05/16)
% \str_set:Nn \This at name { equation }
\hyper at refstepcounter { equation }
}
- { }
- \IfPackageLoadedTF { cleveref }
+ \IfPackageLoadedT { cleveref }
{
\cref at constructprefix { equation } \cref at result
\protected at edef \cref at currentlabel
@@ -1021,7 +1025,6 @@
\p at equation \g_tmpa_tl
}
}
- { }
\seq_map_function:NN \l__witharrows_labels_seq \__witharrows_old_label
}
\__witharrows_save:N \l__witharrows_tag_star_bool
@@ -1113,7 +1116,7 @@
\legacy_if:nT { @minipage }
{ \bool_set_true:N \l__witharrows_in_label_or_minipage_bool }
}
- \IfPackageLoadedTF { mathtools }
+ \IfPackageLoadedT { mathtools }
{
\MH_if_boolean:nT { show_only_refs }
{
@@ -1121,12 +1124,10 @@
\MH_set_boolean_T:n { show_only_refs }
}
}
- { }
- \IfPackageLoadedTF { typedref }
+ \IfPackageLoadedT { typedref }
{ \str_set:Nn \sr at name { equation } }
- { }
- \IfPackageLoadedTF { amsmath } { \intertext@ } { }
- \exp_args:No \tl_if_novalue:nF { #1 }
+ \IfPackageLoadedT { amsmath } { \intertext@ }
+ \tl_if_novalue:oF { #1 }
{ \cs_set_nopar:Npn \l__witharrows_left_brace_tl { #1 } }
\__witharrows_pre_halign:n { #2 }
\bool_if:NT \l__witharrows_subequations_bool { \begin { subequations } }
@@ -1164,7 +1165,7 @@
\fi:
\bool_if:NTF \l__witharrows_in_label_or_minipage_bool
{
- \noindent % added in v. 2.6d
+ \noindent
\c_math_toggle_token
}
{
@@ -1262,9 +1263,8 @@
}
\endpgfpicture
\__witharrows_post_halign:
- \IfPackageLoadedTF { mathtools }
+ \IfPackageLoadedT { mathtools }
{ \MH_if_boolean:nT { show_only_refs } \MT_showonlyrefs_true: }
- { }
\bool_if:NTF \l__witharrows_in_label_or_minipage_bool
{
\c_math_toggle_token
@@ -1302,7 +1302,7 @@
\tl_if_empty:NF \l__witharrows_tag_tl
{ \__witharrows_error:nn { Multiple~tags } { #2 } }
\clist_set:Nn \l__witharrows_tags_clist { all }
- \IfPackageLoadedTF { mathtools }
+ \IfPackageLoadedT { mathtools }
{
\MH_if_boolean:nT { show_only_refs }
{
@@ -1310,13 +1310,11 @@
{ \clist_clear:N \l__witharrows_tags_clist }
}
}
- { }
\tl_set:Nn \l__witharrows_tag_tl { #2 }
\bool_set:Nn \l__witharrows_tag_star_bool { #1 }
\bool_if:nT { #1 }
{
- \IfPackageLoadedTF { amsmath }
- { }
+ \IfPackageLoadedF { amsmath }
{ \__witharrows_error:n { tag*~without~amsmath } }
}
}
@@ -1332,7 +1330,7 @@
{ \__witharrows_error:n { Multiple~labels } }
}
\seq_put_right:Nn \l__witharrows_labels_seq { #1 }
- \IfPackageLoadedTF { mathtools }
+ \IfPackageLoadedT { mathtools }
{
\MH_if_boolean:nT { show_only_refs }
{
@@ -1341,14 +1339,12 @@
{ \clist_clear:N \l__witharrows_tags_clist }
}
}
- { }
- \IfPackageLoadedTF { autonum }
+ \IfPackageLoadedT { autonum }
{
\cs_if_exist:cTF { autonum@#1Referenced }
{ \clist_set:Nn \l__witharrows_tags_clist { all } }
{ \clist_clear:N \l__witharrows_tags_clist }
}
- { }
}
}
\cs_new_protected:Npn \__witharrows_tagnextline:
@@ -1429,7 +1425,7 @@
}
{ \bool_not_p:n { \int_compare_p:nNn \l__witharrows_pos_arrow_int = 7 } }
}
- { \str_if_eq_p:Vn \l__witharrows_status_arrow_str { new-group } }
+ { \str_if_eq_p:on \l__witharrows_status_arrow_str { new-group } }
}
{
\int_if_zero:nF \l__witharrows_first_arrow_of_group_int
@@ -1454,7 +1450,7 @@
{ \dim_set:Nn \l__witharrows_x_dim { - \c_max_dim } }
}
{
- \str_if_eq:VnF \l__witharrows_status_arrow_str { independent }
+ \str_if_eq:onF \l__witharrows_status_arrow_str { independent }
{
\int_compare:nNnT \l__witharrows_initial_int = \l__witharrows_first_line_of_group_int
{ \seq_put_left:NV \l__witharrows_first_arrows_seq \l__witharrows_arrow_int }
@@ -1476,9 +1472,6 @@
{ \__witharrows_update_x:nn \l__witharrows_initial_int \l__witharrows_final_int }
}
}
-\cs_generate_variant:Nn \keys_set:nn { n o }
-\cs_new_protected:Npn \__witharrows_keys_set:
- { \keys_set_known:no { WithArrows / Arrow / SecondPass } }
\cs_new_protected:Npn \__witharrows_draw_arrows:nn #1 #2
{
\group_begin:
@@ -1516,10 +1509,13 @@
\group_begin:
\prop_get:cnN
{ g__witharrows_arrow _\l__witharrows_prefix_str _ \int_use:N \l__witharrows_arrow_int _ prop }
- { options } \l_tmpa_tl
+ { options }
+ \l_tmpa_tl
\str_clear_new:N \l__witharrows_previous_key_str
- \exp_args:NNo \exp_args:No
- \__witharrows_keys_set: { \l_tmpa_tl , tikz = { xshift = \l__witharrows_xoffset_dim } }
+ \exp_args:NNNno \exp_args:NNno \exp_args:Nno
+ \keys_set_known:nn
+ { WithArrows / Arrow / SecondPass }
+ { \l_tmpa_tl , tikz = { xshift = \l__witharrows_xoffset_dim } }
\bool_set_false:N \l__witharrows_initial_r_bool
\bool_set_false:N \l__witharrows_final_r_bool
\int_case:nn \l__witharrows_pos_arrow_int
@@ -1537,19 +1533,19 @@
\dim_set:Nn \l__witharrows_x_dim { - \c_max_dim }
\__witharrows_update_x:nn \l__witharrows_initial_int \l__witharrows_final_int
}
- \tl_set:Nx \l__witharrows_initial_tl
+ \tl_set:Ne \l__witharrows_initial_tl
{ \int_use:N \l__witharrows_initial_int - \bool_if:NTF \l__witharrows_initial_r_bool rl }
- \tl_set:Nx \l__witharrows_final_tl
+ \tl_set:Ne \l__witharrows_final_tl
{ \int_use:N \l__witharrows_final_int - \bool_if:NTF \l__witharrows_final_r_bool rl }
\prop_get:cnN
{ g__witharrows_arrow _ \l__witharrows_prefix_str _ \int_use:N \l__witharrows_arrow_int _ prop }
{ label }
\l_tmpa_tl
- \seq_if_in:NxTF \l__witharrows_first_arrows_seq
+ \seq_if_in:NeTF \l__witharrows_first_arrows_seq
{ \int_use:N \l__witharrows_arrow_int }
{ \bool_set_true:N \l_tmpa_bool }
{ \bool_set_false:N \l_tmpa_bool }
- \seq_if_in:NxTF \l__witharrows_last_arrows_seq
+ \seq_if_in:NeTF \l__witharrows_last_arrows_seq
{ \int_use:N \l__witharrows_arrow_int }
{ \bool_set_true:N \l_tmpb_bool }
{ \bool_set_false:N \l_tmpb_bool }
@@ -1578,7 +1574,7 @@
}
{ \int_compare_p:nNn { \l__witharrows_final_int - \l__witharrows_initial_int } = 1 }
{
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{
\int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
{ \dim_use:N \g__witharrows_x_initial_dim }
@@ -1589,7 +1585,7 @@
+ 0.5 \l__witharrows_max_length_of_arrow_dim
}
}
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{
\int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
{ \dim_use:N \g__witharrows_x_final_dim }
@@ -1602,7 +1598,7 @@
}
}
{
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{
\int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
{ \dim_use:N \g__witharrows_x_initial_dim }
@@ -1611,7 +1607,7 @@
{ \dim_eval:n { \g__witharrows_y_initial_dim + \l__witharrows_start_adjust_dim } }
{ \dim_use:N \g__witharrows_y_initial_dim }
}
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{
\int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
{ \dim_use:N \g__witharrows_x_final_dim }
@@ -1643,9 +1639,10 @@
\__witharrows_draw_arrow:nno \g_tmpa_tl \g_tmpb_tl \l_tmpa_tl
\group_end:
}
-\cs_new_protected:Npn \__witharrows_def_function_tmpa:n #1
+\cs_generate_variant:Nn \__witharrows_def_function_arrow:n { o }
+\cs_new_protected:Npn \__witharrows_def_function_arrow:n #1
{
- \cs_set:Npn \__witharrows_tmpa:nnn ##1 ##2 ##3
+ \cs_set:Npn \__witharrows_arrow:nnn ##1 ##2 ##3
{
\begin{tikzpicture}
[ __witharrows_standard_arrow ]
@@ -1678,21 +1675,21 @@
\end{tikzpicture}
}
}
+\cs_generate_variant:Nn \__witharrows_draw_arrow:nnn { n n o }
\cs_new_protected:Npn \__witharrows_draw_arrow:nnn #1 #2 #3
{
\bool_lazy_and:nnT \l__witharrows_wrap_lines_bool \l__witharrows_in_DispWithArrows_bool
{ \tl_set_eq:NN \l__witharrows_tikz_code_tl \c__witharrows_tikz_code_wrap_lines_tl }
- \exp_args:No \__witharrows_def_function_tmpa:n \l__witharrows_tikz_code_tl
- \__witharrows_tmpa:nnn { #1 } { #2 } { #3 }
+ \__witharrows_def_function_arrow:o \l__witharrows_tikz_code_tl
+ \__witharrows_arrow:nnn { #1 } { #2 } { #3 }
}
-\cs_generate_variant:Nn \__witharrows_draw_arrow:nnn { n n o }
\tl_const:Nn \c__witharrows_tikz_code_wrap_lines_tl
{
- \pgfset { inner~sep = 0pt}
+ \pgfset { inner~sep = 0pt }
\draw ( #1 ) to node ( __witharrows_label ) { } ( #2 ) ;
\pgfpointanchor { wa - \l__witharrows_prefix_str - __witharrows_label } { west }
- \dim_set:Nn \l_tmpa_dim { \g__witharrows_right_x_dim - \pgf at x - 0.3333 ex }
- \path \pgfextra { \tl_gset:Nx \g_tmpa_tl \tikz at text@width } ;
+ \dim_set:Nn \l_tmpa_dim { \g__witharrows_right_x_dim - \pgf at x - 0.33333 em }
+ \path \pgfextra { \tl_gset:Ne \g_tmpa_tl \tikz at text@width } ;
\tl_if_empty:NF \g_tmpa_tl
{
\dim_set:Nn \l_tmpb_dim \g_tmpa_tl
@@ -1704,7 +1701,7 @@
\path ( __witharrows_label.west )
node [ anchor = west ]
{
- \skip_horizontal:n { 0.3333 ex }
+ \skip_horizontal:n { 0.33333 em }
\begin { minipage } { \l_tmpa_dim }
\tikz at text@action
\pgfkeysgetvalue { / tikz / node~halign~header } \l_tmpa_tl
@@ -1797,7 +1794,7 @@
{ \int_compare_p:n { ##1 = ####1 } }
{ \int_compare_p:nNn \l__witharrows_initial_int > \l_tmpa_tl }
{ \int_compare_p:nNn \l_tmpb_tl > \l__witharrows_final_int }
- { \str_if_eq_p:Vn \l__witharrows_status_arrow_str { independent } }
+ { \str_if_eq_p:on \l__witharrows_status_arrow_str { independent } }
}
{
\bool_gset_true:N \g_tmpa_bool
@@ -1825,22 +1822,22 @@
{
tikz .code:n =
\tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .value_required:n = true ,
- rr .value_forbidden:n = true ,
- rr .code:n = \__witharrows_fix_pos_option:n 0 ,
- ll .value_forbidden:n = true,
- ll .code:n = \__witharrows_fix_pos_option:n 1 ,
- rl .value_forbidden:n = true ,
- rl .code:n = \__witharrows_fix_pos_option:n 2 ,
- lr .value_forbidden:n = true ,
- lr .code:n = \__witharrows_fix_pos_option:n 3 ,
- v .value_forbidden:n = true ,
- v .code:n = \__witharrows_fix_pos_option:n 4 ,
+ tikz .value_required:n = true ,
+ rr .value_forbidden:n = true ,
+ rr .code:n = \__witharrows_fix_pos_option:n 0 ,
+ ll .value_forbidden:n = true,
+ ll .code:n = \__witharrows_fix_pos_option:n 1 ,
+ rl .value_forbidden:n = true ,
+ rl .code:n = \__witharrows_fix_pos_option:n 2 ,
+ lr .value_forbidden:n = true ,
+ lr .code:n = \__witharrows_fix_pos_option:n 3 ,
+ v .value_forbidden:n = true ,
+ v .code:n = \__witharrows_fix_pos_option:n 4 ,
tikz-code .tl_set:N = \l__witharrows_tikz_code_tl ,
tikz-code .value_required:n = true ,
- xoffset .dim_set:N = \l__witharrows_xoffset_dim ,
- xoffset .value_required:n = true ,
- unknown .code:n =
+ xoffset .dim_set:N = \l__witharrows_xoffset_dim ,
+ xoffset .value_required:n = true ,
+ unknown .code:n =
\__witharrows_sort_seq:N \l__witharrows_options_Arrow_code_after_seq
\__witharrows_error:n { Unknown~option~Arrow~in~code-after }
}
@@ -1887,9 +1884,9 @@
{ north }
\dim_set:Nn \l_tmpa_dim
{ \dim_max:nn \l_tmpa_dim \pgf at x }
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{ \dim_use:N \l_tmpa_dim , \dim_use:N \l_tmpb_dim }
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{ \dim_use:N \l_tmpa_dim , \dim_use:N \pgf at y }
\endpgfpicture
}
@@ -1902,7 +1899,7 @@
#2 - \bool_if:NTF \l__witharrows_initial_r_bool r l
}
{ south }
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{ \dim_use:N \pgf at x , \dim_use:N \pgf at y }
\pgfpointanchor
{
@@ -1910,7 +1907,7 @@
#3 - \bool_if:NTF \l__witharrows_final_r_bool r l
}
{ north }
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{ \dim_use:N \pgf at x , \dim_use:N \pgf at y }
\endpgfpicture
}
@@ -1935,7 +1932,7 @@
{
\cs_if_free:cTF { pgf at sh@ns at wa - \l__witharrows_prefix_str - \x - l }
{ \__witharrows_error:ne { Wrong~line~specification~in~MultiArrow } \x }
- { \clist_gput_right:Nx \g_tmpa_clist \x }
+ { \clist_gput_right:Ne \g_tmpa_clist \x }
}
\int_compare:nTF { \clist_count:N \g_tmpa_clist < 2 }
{ \__witharrows_error:n { Too~small~specification~for~MultiArrow } }
@@ -1949,7 +1946,7 @@
\clist_pop:NN \g_tmpa_clist \l_tmpa_tl
\clist_reverse:N \g_tmpa_clist
\clist_pop:NN \g_tmpa_clist \l_tmpb_tl
- \exp_args:NV \__witharrows_MultiArrow_i:n \g_tmpa_clist
+ \exp_args:No \__witharrows_MultiArrow_i:n \g_tmpa_clist
\begin { tikzpicture }
[
__witharrows_standard ,
@@ -1962,7 +1959,7 @@
-- ([xshift = \l__witharrows_xoffset_dim]\l_tmpb_tl-r.south) ;
\pgfpointanchor { wa - \l__witharrows_prefix_str - __witharrows_label } { west }
\dim_set:Nn \l_tmpa_dim { 20 cm }
- \path \pgfextra { \tl_gset:Nx \g_tmpa_tl \tikz at text@width } ;
+ \path \pgfextra { \tl_gset:Ne \g_tmpa_tl \tikz at text@width } ;
\tl_if_empty:NF \g_tmpa_tl { \dim_set:Nn \l_tmpa_dim \g_tmpa_tl }
\bool_lazy_and:nnT \l__witharrows_wrap_lines_bool \l__witharrows_in_DispWithArrows_bool
{
@@ -2324,8 +2321,8 @@
Normally,~we~can't~use~the~command~\token_to_str:N\label\
twice~in~a~line~of~the~environment~\{\l__witharrows_type_env_str\}. \\
However,~you~can~go~on.~
- \IfPackageLoadedTF { showlabels }
- { However,~only~the~last~label~will~be~shown~by~showlabels.~ } { }
+ \IfPackageLoadedT { showlabels }
+ { However,~only~the~last~label~will~be~shown~by~showlabels.~ }
If~you~don't~want~to~see~this~message~again,~you~can~use~the~option~
'allow-multiple-labels'~at~the~global~or~environment~level.
}
@@ -2388,17 +2385,18 @@
\keyval_parse:NNn \__witharrows_valid_key:n \__witharrows_valid_key:nn { #2 }
\seq_if_empty:NTF \l_tmpa_seq
{
- \seq_put_right:Nx \l__witharrows_options_WithArrows_seq
+ \seq_put_right:Ne \l__witharrows_options_WithArrows_seq
{ \tl_to_str:n { #1 } }
- \seq_put_right:Nx \l__witharrows_options_DispWithArrows_seq
+ \seq_put_right:Ne \l__witharrows_options_DispWithArrows_seq
{ \tl_to_str:n { #1 } }
- \seq_put_right:Nx \l__witharrows_options_WithArrowsOptions_seq
+ \seq_put_right:Ne \l__witharrows_options_WithArrowsOptions_seq
{ \tl_to_str:N { #1 } }
- \keys_precompile:nnN
+ \keys_precompile:nnc
{ WithArrows / WithArrowsOptions }
{ #2 }
- \l_tmpa_tl
- \__witharrows_key_define:nV { #1 } \l_tmpa_tl
+ { __witharrows _ style _ #1 _ tl }
+ \keys_define:nn { WithArrows / Global }
+ { #1 .code:n = \use:c { __witharrows _ style _ #1 _ tl } }
}
{ \__witharrows_error:nn { Impossible~style } { #1 } }
}
@@ -2420,12 +2418,9 @@
\keys_if_exist:nnF { WithArrows / Global } { #1 }
{ \seq_put_right:Nn \l_tmpa_seq { #1 } }
}
-\cs_new_protected:Npn \__witharrows_key_define:nn #1 #2
- { \keys_define:nn { WithArrows / Global } { #1 .code:n = #2 } }
-\cs_generate_variant:Nn \__witharrows_key_define:nn { n V }
\__witharrows_msg_new:nn { Key~already~defined }
{
- Key~already~define.\\
+ Key~already~defined.\\
The~key~'#1'~is~already~defined. \\
If~you~go~on,~your~instruction~\token_to_str:N\WithArrowsNewStyle\
will~be~ignored.
@@ -2556,9 +2551,9 @@
\str_if_empty:NT \l__witharrows_previous_key_str
{
\str_set:Nn \l__witharrows_previous_key_str { up }
- \cs_if_exist:cTF { tikz at library@calc at loaded }
+ \cs_if_exist:NTF \tikz at library@calc at loaded
{
- \keys_set:nV { WithArrows / up-and-down } \l_keys_value_tl
+ \keys_set:no { WithArrows / up-and-down } \l_keys_value_tl
\int_set:Nn \l__witharrows_pos_arrow_int 1
\bool_set_false:N \l__witharrows_wrap_lines_bool
\tl_set_eq:NN \l__witharrows_tikz_code_tl \c__witharrows_tikz_code_up_tl
@@ -2569,9 +2564,9 @@
\str_if_empty:NT \l__witharrows_previous_key_str
{
\str_set:Nn \l__witharrows_previous_key_str { down }
- \cs_if_exist:cTF { tikz at library@calc at loaded }
+ \cs_if_exist:NTF \tikz at library@calc at loaded
{
- \keys_set:nV { WithArrows / up-and-down } \l_keys_value_tl
+ \keys_set:no { WithArrows / up-and-down } \l_keys_value_tl
\int_set:Nn \l__witharrows_pos_arrow_int 1
\bool_set_false:N \l__witharrows_wrap_lines_bool
\tl_set_eq:NN \l__witharrows_tikz_code_tl \c__witharrows_tikz_code_down_tl
Modified: trunk/Master/texmf-dist/tex/generic/witharrows/witharrows.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/witharrows/witharrows.tex 2024-10-19 14:25:00 UTC (rev 72593)
+++ trunk/Master/texmf-dist/tex/generic/witharrows/witharrows.tex 2024-10-19 20:25:31 UTC (rev 72594)
@@ -18,8 +18,9 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-\def\myfileversion{2.9}
-\def\myfiledate{2024/10/05}
+\def\myfileversion{2.9a}
+\def\myfiledate{2024/10/19}
+
\input tikz.tex
\input expl3-generic.tex
\usetikzlibrary{arrows.meta}
@@ -49,6 +50,9 @@
}
\bool_new:N \g__witharrows_beamer_bool
\cs_generate_variant:Nn \seq_set_split:Nnn { N e e }
+\cs_generate_variant:Nn \keys_precompile:nnN { n n c }
+\prg_generate_conditional_variant:Nnn \tl_if_novalue:n { o } { F }
+\exp_args_generate:n { N N N n o }
\cs_new_protected:Npn \__witharrows_sort_seq:N #1
{
\seq_sort:Nn #1
@@ -62,7 +66,7 @@
\cs_new_protected:Npn \__witharrows_set_seq_of_str_from_clist:Nn #1 #2
{
\seq_set_from_clist:Nn #1 { #2 }
- \seq_set_map_x:NNn #1 #1 { \tl_to_str:n { ##1 } }
+ \seq_set_map_e:NNn #1 #1 { \tl_to_str:n { ##1 } }
}
\cs_new_protected:Npn \__witharrows_save:N #1
{
@@ -70,7 +74,7 @@
{ \char_generate:nn { `_ } { 12 } }
{ \cs_to_str:N #1 }
\seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
- \str_set:Nx \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
+ \str_set:Ne \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
\use:c { \l_tmpa_str _if_exist:cF }
{ g _\seq_use:Nnnn \l_tmpa_seq _ _ _ }
{
@@ -86,7 +90,7 @@
{ \char_generate:nn { `_ } { 12 } }
{ \cs_to_str:N #1 }
\seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
- \str_set:Nx \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
+ \str_set:Ne \l_tmpa_str { \seq_item:Nn \l_tmpa_seq { -1 } }
\use:c { \l_tmpa_str _set_eq:Nc }
#1 { g_\seq_use:Nnnn \l_tmpa_seq _ _ _ }
}
@@ -165,7 +169,7 @@
\str_new:N \l__witharrows_command_name_str
\str_set:Nn \l__witharrows_command_name_str { Arrow }
\str_new:N \l__witharrows_string_Arrow_for_msg_str
-\str_set:Nx \l__witharrows_string_Arrow_for_msg_str { \token_to_str:N \Arrow }
+\str_set:Ne \l__witharrows_string_Arrow_for_msg_str { \token_to_str:N \Arrow }
\seq_new:N \g__witharrows_names_seq
\bool_new:N \l__witharrows_in_first_columns_bool
\bool_new:N \l__witharrows_new_group_bool
@@ -211,7 +215,7 @@
more-columns .value_forbidden:n = true ,
command-name .code:n =
\str_set:Nn \l__witharrows_command_name_str { #1 }
- \str_set:Nx \l__witharrows_string_Arrow_for_msg_str
+ \str_set:Ne \l__witharrows_string_Arrow_for_msg_str
{ \c_backslash_str Arrow~alias~\c_backslash_str #1 } ,
command-name .value_required:n = true ,
tikz-code .tl_set:N = \l__witharrows_tikz_code_tl ,
@@ -231,7 +235,7 @@
\int_set:Nn \l__witharrows_pos_arrow_int 7
}
{ \__witharrows_error:n { Incompatible~options } } ,
- group .value_forbidden:n = true ,
+ group .value_forbidden:n = true ,
groups .code:n =
\str_if_empty:NTF \l__witharrows_previous_key_str
{
@@ -244,7 +248,6 @@
{ \__witharrows_error:n { Incompatible~options } } ,
groups .value_forbidden:n = true ,
tikz .code:n = \tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .initial:n = \c_empty_tl ,
tikz .value_required:n = true ,
rr .code:n = \__witharrows_fix_pos_option:n 3 ,
rr .value_forbidden:n = true ,
@@ -304,7 +307,7 @@
wrap-lines .default:n = true ,
replace-left-brace-by .code:n =
{
- \tl_set:Nx \l_tmpa_tl { \tl_head:n { #1 } }
+ \tl_set:Ne \l_tmpa_tl { \tl_head:n { #1 } }
\clist_if_in:NoTF
\c__witharrows_ext_delimiters_clist
\l_tmpa_tl
@@ -506,7 +509,6 @@
tikz-code .tl_set:N = \l__witharrows_tikz_code_tl ,
tikz-code .initial:n = \draw~(#1)~to~node{#3}~(#2)~; ,
tikz .code:n = \tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .initial:n = \c_empty_tl ,
rr .code:n = \__witharrows_fix_pos_arrow:n 3 ,
ll .code:n = \__witharrows_fix_pos_arrow:n 1 ,
rl .code:n = \__witharrows_fix_pos_arrow:n 2 ,
@@ -554,10 +556,10 @@
\prop_put:NnV \l_tmpa_prop { initial } \g__witharrows_line_int
\int_set:Nn \l_tmpa_int { \g__witharrows_line_int + \l__witharrows_jump_int }
\prop_put:NnV \l_tmpa_prop { final } \l_tmpa_int
- \prop_put:NnV \l_tmpa_prop { status } \l__witharrows_status_arrow_str
+ \prop_put:Nno \l_tmpa_prop { status } \l__witharrows_status_arrow_str
\prop_put:Nnn \l_tmpa_prop { options } { #1 , #3 }
\prop_put:Nnn \l_tmpa_prop { label } { #2 }
- \prop_put:Nnx \l_tmpa_prop { input-line } \msg_line_number:
+ \prop_put:Nne \l_tmpa_prop { input-line } \msg_line_number:
\prop_put:Nnn \l_tmpa_prop { width } { 0 pt }
\prop_gclear_new:c
{ g__witharrows_arrow _ \l__witharrows_prefix_str _ \int_use:N \g__witharrows_arrow_int _ prop }
@@ -588,7 +590,7 @@
\seq_set_eq:NN \l_tmpa_seq \g__witharrows_position_in_the_tree_seq
\seq_pop_right:NN \l_tmpa_seq \l_tmpa_tl
\str_clear_new:N \l__witharrows_prefix_str
- \str_set:Nx \l__witharrows_prefix_str { \seq_use:Nnnn \l_tmpa_seq - - - }
+ \str_set:Ne \l__witharrows_prefix_str { \seq_use:Nnnn \l_tmpa_seq - - - }
\cs_set_eq:NN \\ \__witharrows_cr:
\dim_zero:N \mathsurround
\int_zero_new:N \l__witharrows_initial_int
@@ -788,7 +790,7 @@
\group_end:
\seq_gpop_right:NN \g__witharrows_position_in_the_tree_seq \l_tmpa_tl
\seq_gpop_right:NN \g__witharrows_position_in_the_tree_seq \l_tmpa_tl
- \seq_gput_right:Nx \g__witharrows_position_in_the_tree_seq
+ \seq_gput_right:Ne \g__witharrows_position_in_the_tree_seq
{ \int_eval:n { \l_tmpa_tl + 1 } }
\int_compare:nNnT { \seq_count:N \g__witharrows_position_in_the_tree_seq } = 1
{ \int_gincr:N \g__witharrows_last_env_int }
@@ -855,7 +857,7 @@
\bool_set_true:N \l__witharrows_in_DispWithArrows_bool
\str_clear_new:N \l__witharrows_type_env_str
\str_set:Nn \l__witharrows_type_env_str { DispWithArrows }
- \exp_args:No \tl_if_novalue:nF { #1 }
+ \tl_if_novalue:oF { #1 }
{ \cs_set_nopar:Npn \l__witharrows_left_brace_tl { #1 } }
\__witharrows_pre_halign:n { #2 }
\tl_if_eq:NNF \l__witharrows_left_brace_tl \c_novalue_tl
@@ -1055,7 +1057,7 @@
}
{ \bool_not_p:n { \int_compare_p:nNn \l__witharrows_pos_arrow_int = 7 } }
}
- { \str_if_eq_p:Vn \l__witharrows_status_arrow_str { new-group } }
+ { \str_if_eq_p:on \l__witharrows_status_arrow_str { new-group } }
}
{
\int_if_zero:nF \l__witharrows_first_arrow_of_group_int
@@ -1080,7 +1082,7 @@
{ \dim_set:Nn \l__witharrows_x_dim { - \c_max_dim } }
}
{
- \str_if_eq:VnF \l__witharrows_status_arrow_str { independent }
+ \str_if_eq:onF \l__witharrows_status_arrow_str { independent }
{
\int_compare:nNnT \l__witharrows_initial_int = \l__witharrows_first_line_of_group_int
{ \seq_put_left:NV \l__witharrows_first_arrows_seq \l__witharrows_arrow_int }
@@ -1102,9 +1104,6 @@
{ \__witharrows_update_x:nn \l__witharrows_initial_int \l__witharrows_final_int }
}
}
-\cs_generate_variant:Nn \keys_set:nn { n o }
-\cs_new_protected:Npn \__witharrows_keys_set:
- { \keys_set_known:no { WithArrows / Arrow / SecondPass } }
\cs_new_protected:Npn \__witharrows_draw_arrows:nn #1 #2
{
\group_begin:
@@ -1142,10 +1141,13 @@
\group_begin:
\prop_get:cnN
{ g__witharrows_arrow _\l__witharrows_prefix_str _ \int_use:N \l__witharrows_arrow_int _ prop }
- { options } \l_tmpa_tl
+ { options }
+ \l_tmpa_tl
\str_clear_new:N \l__witharrows_previous_key_str
- \exp_args:NNo \exp_args:No
- \__witharrows_keys_set: { \l_tmpa_tl , tikz = { xshift = \l__witharrows_xoffset_dim } }
+ \exp_args:NNNno \exp_args:NNno \exp_args:Nno
+ \keys_set_known:nn
+ { WithArrows / Arrow / SecondPass }
+ { \l_tmpa_tl , tikz = { xshift = \l__witharrows_xoffset_dim } }
\bool_set_false:N \l__witharrows_initial_r_bool
\bool_set_false:N \l__witharrows_final_r_bool
\int_case:nn \l__witharrows_pos_arrow_int
@@ -1163,19 +1165,19 @@
\dim_set:Nn \l__witharrows_x_dim { - \c_max_dim }
\__witharrows_update_x:nn \l__witharrows_initial_int \l__witharrows_final_int
}
- \tl_set:Nx \l__witharrows_initial_tl
+ \tl_set:Ne \l__witharrows_initial_tl
{ \int_use:N \l__witharrows_initial_int - \bool_if:NTF \l__witharrows_initial_r_bool rl }
- \tl_set:Nx \l__witharrows_final_tl
+ \tl_set:Ne \l__witharrows_final_tl
{ \int_use:N \l__witharrows_final_int - \bool_if:NTF \l__witharrows_final_r_bool rl }
\prop_get:cnN
{ g__witharrows_arrow _ \l__witharrows_prefix_str _ \int_use:N \l__witharrows_arrow_int _ prop }
{ label }
\l_tmpa_tl
- \seq_if_in:NxTF \l__witharrows_first_arrows_seq
+ \seq_if_in:NeTF \l__witharrows_first_arrows_seq
{ \int_use:N \l__witharrows_arrow_int }
{ \bool_set_true:N \l_tmpa_bool }
{ \bool_set_false:N \l_tmpa_bool }
- \seq_if_in:NxTF \l__witharrows_last_arrows_seq
+ \seq_if_in:NeTF \l__witharrows_last_arrows_seq
{ \int_use:N \l__witharrows_arrow_int }
{ \bool_set_true:N \l_tmpb_bool }
{ \bool_set_false:N \l_tmpb_bool }
@@ -1204,7 +1206,7 @@
}
{ \int_compare_p:nNn { \l__witharrows_final_int - \l__witharrows_initial_int } = 1 }
{
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{
\int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
{ \dim_use:N \g__witharrows_x_initial_dim }
@@ -1215,7 +1217,7 @@
+ 0.5 \l__witharrows_max_length_of_arrow_dim
}
}
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{
\int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
{ \dim_use:N \g__witharrows_x_final_dim }
@@ -1228,7 +1230,7 @@
}
}
{
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{
\int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
{ \dim_use:N \g__witharrows_x_initial_dim }
@@ -1237,7 +1239,7 @@
{ \dim_eval:n { \g__witharrows_y_initial_dim + \l__witharrows_start_adjust_dim } }
{ \dim_use:N \g__witharrows_y_initial_dim }
}
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{
\int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
{ \dim_use:N \g__witharrows_x_final_dim }
@@ -1269,9 +1271,10 @@
\__witharrows_draw_arrow:nno \g_tmpa_tl \g_tmpb_tl \l_tmpa_tl
\group_end:
}
-\cs_new_protected:Npn \__witharrows_def_function_tmpa:n #1
+\cs_generate_variant:Nn \__witharrows_def_function_arrow:n { o }
+\cs_new_protected:Npn \__witharrows_def_function_arrow:n #1
{
- \cs_set:Npn \__witharrows_tmpa:nnn ##1 ##2 ##3
+ \cs_set:Npn \__witharrows_arrow:nnn ##1 ##2 ##3
{
\tikzpicture
[ __witharrows_standard_arrow ]
@@ -1304,21 +1307,21 @@
\endtikzpicture
}
}
+\cs_generate_variant:Nn \__witharrows_draw_arrow:nnn { n n o }
\cs_new_protected:Npn \__witharrows_draw_arrow:nnn #1 #2 #3
{
\bool_lazy_and:nnT \l__witharrows_wrap_lines_bool \l__witharrows_in_DispWithArrows_bool
{ \tl_set_eq:NN \l__witharrows_tikz_code_tl \c__witharrows_tikz_code_wrap_lines_tl }
- \exp_args:No \__witharrows_def_function_tmpa:n \l__witharrows_tikz_code_tl
- \__witharrows_tmpa:nnn { #1 } { #2 } { #3 }
+ \__witharrows_def_function_arrow:o \l__witharrows_tikz_code_tl
+ \__witharrows_arrow:nnn { #1 } { #2 } { #3 }
}
-\cs_generate_variant:Nn \__witharrows_draw_arrow:nnn { n n o }
\tl_const:Nn \c__witharrows_tikz_code_wrap_lines_tl
{
- \pgfset { inner~sep = 0pt}
+ \pgfset { inner~sep = 0pt }
\draw ( #1 ) to node ( __witharrows_label ) { } ( #2 ) ;
\pgfpointanchor { wa - \l__witharrows_prefix_str - __witharrows_label } { west }
- \dim_set:Nn \l_tmpa_dim { \g__witharrows_right_x_dim - \pgf at x - 0.3333 ex }
- \path \pgfextra { \tl_gset:Nx \g_tmpa_tl \tikz at text@width } ;
+ \dim_set:Nn \l_tmpa_dim { \g__witharrows_right_x_dim - \pgf at x - 0.33333 em }
+ \path \pgfextra { \tl_gset:Ne \g_tmpa_tl \tikz at text@width } ;
\tl_if_empty:NF \g_tmpa_tl
{
\dim_set:Nn \l_tmpb_dim \g_tmpa_tl
@@ -1329,7 +1332,7 @@
{
\path ( __witharrows_label.west )
node [ anchor = west , text~width = \dim_use:N \l_tmpa_dim ]
- { #3 } ;
+ { \skip_horizontal:n { 0.33333 em } #3 } ;
}
}
\cs_new_protected:Npn \__witharrows_update_x:nn #1 #2
@@ -1406,7 +1409,7 @@
{ \int_compare_p:n { ##1 = ####1 } }
{ \int_compare_p:nNn \l__witharrows_initial_int > \l_tmpa_tl }
{ \int_compare_p:nNn \l_tmpb_tl > \l__witharrows_final_int }
- { \str_if_eq_p:Vn \l__witharrows_status_arrow_str { independent } }
+ { \str_if_eq_p:on \l__witharrows_status_arrow_str { independent } }
}
{
\bool_gset_true:N \g_tmpa_bool
@@ -1433,22 +1436,22 @@
{
tikz .code:n =
\tikzset { WithArrows / arrow / .append~style = { #1 } } ,
- tikz .value_required:n = true ,
- rr .value_forbidden:n = true ,
- rr .code:n = \__witharrows_fix_pos_option:n 0 ,
- ll .value_forbidden:n = true,
- ll .code:n = \__witharrows_fix_pos_option:n 1 ,
- rl .value_forbidden:n = true ,
- rl .code:n = \__witharrows_fix_pos_option:n 2 ,
- lr .value_forbidden:n = true ,
- lr .code:n = \__witharrows_fix_pos_option:n 3 ,
- v .value_forbidden:n = true ,
- v .code:n = \__witharrows_fix_pos_option:n 4 ,
+ tikz .value_required:n = true ,
+ rr .value_forbidden:n = true ,
+ rr .code:n = \__witharrows_fix_pos_option:n 0 ,
+ ll .value_forbidden:n = true,
+ ll .code:n = \__witharrows_fix_pos_option:n 1 ,
+ rl .value_forbidden:n = true ,
+ rl .code:n = \__witharrows_fix_pos_option:n 2 ,
+ lr .value_forbidden:n = true ,
+ lr .code:n = \__witharrows_fix_pos_option:n 3 ,
+ v .value_forbidden:n = true ,
+ v .code:n = \__witharrows_fix_pos_option:n 4 ,
tikz-code .tl_set:N = \l__witharrows_tikz_code_tl ,
tikz-code .value_required:n = true ,
- xoffset .dim_set:N = \l__witharrows_xoffset_dim ,
- xoffset .value_required:n = true ,
- unknown .code:n =
+ xoffset .dim_set:N = \l__witharrows_xoffset_dim ,
+ xoffset .value_required:n = true ,
+ unknown .code:n =
\__witharrows_sort_seq:N \l__witharrows_options_Arrow_code_after_seq
\__witharrows_error:n { Unknown~option~Arrow~in~code-after }
}
@@ -1507,9 +1510,9 @@
{ north }
\dim_set:Nn \l_tmpa_dim
{ \dim_max:nn \l_tmpa_dim \pgf at x }
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{ \dim_use:N \l_tmpa_dim , \dim_use:N \l_tmpb_dim }
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{ \dim_use:N \l_tmpa_dim , \dim_use:N \pgf at y }
\endpgfpicture
}
@@ -1522,7 +1525,7 @@
#2 - \bool_if:NTF \l__witharrows_initial_r_bool r l
}
{ south }
- \tl_gset:Nx \g_tmpa_tl
+ \tl_gset:Ne \g_tmpa_tl
{ \dim_use:N \pgf at x , \dim_use:N \pgf at y }
\pgfpointanchor
{
@@ -1530,7 +1533,7 @@
#3 - \bool_if:NTF \l__witharrows_final_r_bool r l
}
{ north }
- \tl_gset:Nx \g_tmpb_tl
+ \tl_gset:Ne \g_tmpb_tl
{ \dim_use:N \pgf at x , \dim_use:N \pgf at y }
\endpgfpicture
}
@@ -1555,7 +1558,7 @@
{
\cs_if_free:cTF { pgf at sh@ns at wa - \l__witharrows_prefix_str - \x - l }
{ \__witharrows_error:ne { Wrong~line~specification~in~MultiArrow } \x }
- { \clist_gput_right:Nx \g_tmpa_clist \x }
+ { \clist_gput_right:Ne \g_tmpa_clist \x }
}
\int_compare:nTF { \clist_count:N \g_tmpa_clist < 2 }
{ \__witharrows_error:n { Too~small~specification~for~MultiArrow } }
@@ -1569,7 +1572,7 @@
\clist_pop:NN \g_tmpa_clist \l_tmpa_tl
\clist_reverse:N \g_tmpa_clist
\clist_pop:NN \g_tmpa_clist \l_tmpb_tl
- \exp_args:NV \__witharrows_MultiArrow_i:n \g_tmpa_clist
+ \exp_args:No \__witharrows_MultiArrow_i:n \g_tmpa_clist
\tikzpicture
[
__witharrows_standard ,
@@ -1582,7 +1585,7 @@
-- ([xshift = \l__witharrows_xoffset_dim]\l_tmpb_tl-r.south) ;
\pgfpointanchor { wa - \l__witharrows_prefix_str - __witharrows_label } { west }
\dim_set:Nn \l_tmpa_dim { 20 cm }
- \path \pgfextra { \tl_gset:Nx \g_tmpa_tl \tikz at text@width } ;
+ \path \pgfextra { \tl_gset:Ne \g_tmpa_tl \tikz at text@width } ;
\tl_if_empty:NF \g_tmpa_tl { \dim_set:Nn \l_tmpa_dim \g_tmpa_tl }
\bool_lazy_and:nnT \l__witharrows_wrap_lines_bool \l__witharrows_in_DispWithArrows_bool
{
@@ -1957,17 +1960,18 @@
\keyval_parse:NNn \__witharrows_valid_key:n \__witharrows_valid_key:nn { #2 }
\seq_if_empty:NTF \l_tmpa_seq
{
- \seq_put_right:Nx \l__witharrows_options_WithArrows_seq
+ \seq_put_right:Ne \l__witharrows_options_WithArrows_seq
{ \tl_to_str:n { #1 } }
- \seq_put_right:Nx \l__witharrows_options_DispWithArrows_seq
+ \seq_put_right:Ne \l__witharrows_options_DispWithArrows_seq
{ \tl_to_str:n { #1 } }
- \seq_put_right:Nx \l__witharrows_options_WithArrowsOptions_seq
+ \seq_put_right:Ne \l__witharrows_options_WithArrowsOptions_seq
{ \tl_to_str:N { #1 } }
- \keys_precompile:nnN
+ \keys_precompile:nnc
{ WithArrows / WithArrowsOptions }
{ #2 }
- \l_tmpa_tl
- \__witharrows_key_define:nV { #1 } \l_tmpa_tl
+ { __witharrows _ style _ #1 _ tl }
+ \keys_define:nn { WithArrows / Global }
+ { #1 .code:n = \use:c { __witharrows _ style _ #1 _ tl } }
}
{ \__witharrows_error:nn { Impossible~style } { #1 } }
}
@@ -1989,12 +1993,9 @@
\keys_if_exist:nnF { WithArrows / Global } { #1 }
{ \seq_put_right:Nn \l_tmpa_seq { #1 } }
}
-\cs_new_protected:Npn \__witharrows_key_define:nn #1 #2
- { \keys_define:nn { WithArrows / Global } { #1 .code:n = #2 } }
-\cs_generate_variant:Nn \__witharrows_key_define:nn { n V }
\__witharrows_msg_new:nn { Key~already~defined }
{
- Key~already~define.\\
+ Key~already~defined.\\
The~key~'#1'~is~already~defined. \\
If~you~go~on,~your~instruction~\token_to_str:N\WithArrowsNewStyle\
will~be~ignored.
@@ -2105,9 +2106,9 @@
\str_if_empty:NT \l__witharrows_previous_key_str
{
\str_set:Nn \l__witharrows_previous_key_str { up }
- \cs_if_exist:cTF { tikz at library@calc at loaded }
+ \cs_if_exist:NTF \tikz at library@calc at loaded
{
- \keys_set:nV { WithArrows / up-and-down } \l_keys_value_tl
+ \keys_set:no { WithArrows / up-and-down } \l_keys_value_tl
\int_set:Nn \l__witharrows_pos_arrow_int 1
\bool_set_false:N \l__witharrows_wrap_lines_bool
\tl_set_eq:NN \l__witharrows_tikz_code_tl \c__witharrows_tikz_code_up_tl
@@ -2118,9 +2119,9 @@
\str_if_empty:NT \l__witharrows_previous_key_str
{
\str_set:Nn \l__witharrows_previous_key_str { down }
- \cs_if_exist:cTF { tikz at library@calc at loaded }
+ \cs_if_exist:NTF \tikz at library@calc at loaded
{
- \keys_set:nV { WithArrows / up-and-down } \l_keys_value_tl
+ \keys_set:no { WithArrows / up-and-down } \l_keys_value_tl
\int_set:Nn \l__witharrows_pos_arrow_int 1
\bool_set_false:N \l__witharrows_wrap_lines_bool
\tl_set_eq:NN \l__witharrows_tikz_code_tl \c__witharrows_tikz_code_down_tl
More information about the tex-live-commits
mailing list.