summaryrefslogtreecommitdiff
path: root/macros/generic/witharrows/witharrows.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-09 03:03:16 +0000
committerNorbert Preining <norbert@preining.info>2020-09-09 03:03:16 +0000
commit4b315627efc5a6beb1e6c6ec7a98779f215c75eb (patch)
treecf65539a3758192b9bfbaea63d1962f28ec32a3e /macros/generic/witharrows/witharrows.dtx
parentbc2d0660f4f460b55009ab4e525f2a0e4cde6187 (diff)
CTAN sync 202009090303
Diffstat (limited to 'macros/generic/witharrows/witharrows.dtx')
-rw-r--r--macros/generic/witharrows/witharrows.dtx97
1 files changed, 69 insertions, 28 deletions
diff --git a/macros/generic/witharrows/witharrows.dtx b/macros/generic/witharrows/witharrows.dtx
index b32e5f62d8..79f46f5d69 100644
--- a/macros/generic/witharrows/witharrows.dtx
+++ b/macros/generic/witharrows/witharrows.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{2.5.1}
-\def\myfiledate{2020/07/28}
+\def\myfileversion{2.6}
+\def\myfiledate{2020/09/08}
%
%
%<*batchfile>
@@ -505,8 +505,18 @@ version 2005/12/01 or later.
% So far, we have used the environment |{WithArrows}| with two columns. However,
% it's possible to use the environment with an arbitrary number of columns with
% the option |format|. The value given to this option is like the preamble of an
-% environment |{array}|, that is to say a sequence of letters |r|, |c| and |l|.
-% The initial value of the option |format| is, in fact, |rl|.
+% environment |{array}|, that is to say a sequence of letters |r|, |c| and |l|,
+% but also |R|, |C| and |L|.
+%
+% \smallskip
+% \colorbox{yellow!50}{\textbf{New 2.6}}\enskip
+% The letters |R|, |C| and |L| add empty groups |{}| which provide correct
+% spaces when these columns contain symbols with the type |\mathrel| (such as
+% $=$, $\leq$, etc.) or |\mathbin| (such as $+$, $\times$, etc.). This system is
+% inspired by the environment |{IEEEeqnarray}| of the package \pkg{IEEEtrantools}.
+%
+% \smallskip
+% 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|.
@@ -529,7 +539,7 @@ version 2005/12/01 or later.
% |{DispWithArrows*}| is presented p.~\pageref{DispWithArrows}).
%
% \begin{Verbatim}
-% \begin{DispWithArrows*}[~emphase#format = ccccc@,
+% \begin{DispWithArrows*}[~emphase#format = cCcCc@,
% wrap-lines,
% tikz = {align = flush left},
% interline=1mm]
@@ -542,7 +552,7 @@ version 2005/12/01 or later.
% \frac{1}{k+1} & \le & \ln(k+1)-\ln(k) & \le & \frac{1}{k}
% \end{DispWithArrows*}
% \end{Verbatim}
-% \begin{DispWithArrows*}[format = ccccc,
+% \begin{DispWithArrows*}[format = cCcCc,
% wrap-lines,
% tikz = {align = flush left},
% interline=1mm]
@@ -1870,7 +1880,7 @@ version 2005/12/01 or later.
% \interitem
% \section{Advanced features}
%
-% \subsection{Utilisation with plain-TeX}
+% \subsection{Use with plain-TeX}
% \label{plain-TeX}
%
% The extension \pkg{witharrows} can be used with plain-TeX. In this case, the
@@ -2300,7 +2310,7 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% Example of utilisation:
+% Example of use:
%
% \begin{Verbatim}
% $\begin{WithArrows}[groups]
@@ -2917,14 +2927,29 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% The following command creates a sequence of strings (|str|) from a |clist|. Be
-% careful: we use |\seq_set_map:NNn| and the name of that function will maybe
-% change to |\eq_set_map_x:NNn|.
+% The following command creates a sequence of strings (|str|) from a |clist|.
+%
+%
+% The following command converts all the elements of a sequence (which are token
+% lists) into strings.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_convert_to_str_seq:N #1
+ {
+ \seq_clear:N \l_tmpa_seq
+ \seq_map_inline:Nn #1
+ {
+ \seq_put_left:Nx \l_tmpa_seq { \tl_to_str:n { ##1 } }
+ }
+ \seq_set_eq:NN #1 \l_tmpa_seq
+ }
+% \end{macrocode}
+%
+% 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:NNn #1 #1 { \tl_to_str:n { ##1 } }
+ \@@_convert_to_str_seq:N #1
}
% \end{macrocode}
%
@@ -3192,7 +3217,7 @@ version 2005/12/01 or later.
% We will also use a ``static'' version of the counter of columns, called
% |\g_@@_static_col_int|. The value will be set directly in each cell of the
% array by an instruction in the template of the |\halign|. The aim of this
-% programmation is to try to detect some utilisation of |\omit| (which should be
+% programmation is to try to detect some use of |\omit| (which should be
% forbidden) in the cells of the |\halign|.
% \begin{macrocode}
\seq_new:N \g_@@_static_col_int_seq
@@ -3618,7 +3643,7 @@ version 2005/12/01 or later.
\tl_if_empty:nTF { #1 }
{ \@@_error:n { Invalid~option~format } }
{
- \regex_match:nnTF { \A[rcl]*\Z } { #1 }
+ \regex_match:nnTF { \A[rclRCL]*\Z } { #1 }
{ \tl_set:Nn \l_@@_format_str { #1 } }
{ \@@_error:n { Invalid~option~format } }
} ,
@@ -4162,7 +4187,7 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% In the preamble of the |\halign|, there will be \emph{two} counters of the
-% columns. The aim of this programmation is to detect the utilisation of a
+% columns. The aim of this programmation is to detect the use of a
% 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 :
@@ -4223,7 +4248,7 @@ version 2005/12/01 or later.
% The string |\l_@@_format_str| corresponds to the option |format|. Now, we set
% the initial value for this option.
% \begin{macrocode}
- \str_set:Nn \l_@@_format_str { rl }
+ \str_set:Nn \l_@@_format_str { rL }
% \end{macrocode}
%
%
@@ -4370,8 +4395,8 @@ version 2005/12/01 or later.
% stream of TeX. That means that the part of the preamble concerning the last
% cell will be constructed first.
% \item The function |\@@_construct_halign:| is recursive in order to treat
-% succesively all the letters of the preamble.
-% \item Each part of the preamble is created with a |\use:x| function. This
+% successively all the letters of the preamble.
+% \item Each part of the preamble is created with a |\use:e| function. This
% expansion of the preamble gives the ability of controlling which parts of the
% code will be expanded during the construction of the preamble (other parts
% will be expanded and executed only during the execution of the |\halign|).
@@ -4386,18 +4411,18 @@ version 2005/12/01 or later.
\seq_pop_right:NNTF \l_@@_format_seq \l_@@_type_col_str
{
% \end{macrocode}
-% Here is the |\use:x| which is fundamental: it will really construct the part
+% Here is the |\use:e| which is fundamental: it will really construct the part
% of the preamble corresponding to a column by expanding only some parts of the
% following code.
% \begin{macrocode}
- \use:x
+ \use:e
{
% \end{macrocode}
% Before the recursive call of |\@@_construct_halign:|, we decrease the integer
% |\g_@@_col_bool|. But, during the construction of the column which is
% constructed first (that is to say which is the last column of the |\halign|),
% it is \emph{not} lowered because |\int_decr:N|, which is protected, won't be
-% expanded by the |\use:x|.
+% expanded by the |\use:e|.
%
% We begin the construction of a generic column.
% \begin{macrocode}
@@ -4409,7 +4434,7 @@ version 2005/12/01 or later.
% We redefine the command |\Arrow| (or the name given to the corresponding
% command by the option |command-name|) in each cell of the last column.
% The braces around |\l_@@_command_name_str| are mandatory because
-% |\l_@@_command_name_str| will be expanded by the |\use:x| and the command
+% |\l_@@_command_name_str| will be expanded by the |\use:e| and the command
% |\cs_set_eq:cN| must still be efficient during the execution of the |\halign|.
% \begin{macrocode}
\cs_set_eq:cN { \l_@@_command_name_str } \@@_Arrow
@@ -4432,18 +4457,21 @@ version 2005/12/01 or later.
%</LaTeX>
}
\str_if_eq:VnT \l_@@_type_col_str { c } \hfil
+ \str_if_eq:VnT \l_@@_type_col_str { C } \hfil
\str_if_eq:VnT \l_@@_type_col_str { r } \hfill
+ \str_if_eq:VnT \l_@@_type_col_str { R } \hfill
\int_gincr:N \g_@@_col_int
\int_gset:Nn \g_@@_static_col_int { \int_use:N \g_@@_col_int }
\c_math_toggle_token
- {
- { }
- \bool_if:NT \l_@@_displaystyle_bool \displaystyle
- ####
- }
+ \str_if_eq:VnT \l_@@_type_col_str { C } { { } }
+ \str_if_eq:VnT \l_@@_type_col_str { L } { { } }
+ \bool_if:NT \l_@@_displaystyle_bool \displaystyle
+ ##
+ \str_if_eq:VnT \l_@@_type_col_str { C } { { } }
+ \str_if_eq:VnT \l_@@_type_col_str { R } { { } }
\c_math_toggle_token
\int_compare:nNnTF \g_@@_col_int = \l_@@_nb_cols_int
- { \@@_construct_nodes: }
+ \@@_construct_nodes:
{
% \end{macrocode}
% The following glue (|\hfil|) will be added only if we are not in the last cell
@@ -4451,7 +4479,9 @@ version 2005/12/01 or later.
% |\@@_construct_nodes:|).
% \begin{macrocode}
\str_if_eq:VnT \l_@@_type_col_str { l } \hfil
+ \str_if_eq:VnT \l_@@_type_col_str { L } \hfil
\str_if_eq:VnT \l_@@_type_col_str { c } \hfil
+ \str_if_eq:VnT \l_@@_type_col_str { C } \hfil
\bool_if:NT \l_@@_in_DispWithArrows_bool { \tabskip = \c_zero_skip }
&
}
@@ -7681,6 +7711,13 @@ version 2005/12/01 or later.
%
% \section{History}
%
+% The successive versions of the file |witharrows.sty| provided by TeXLive are available on the
+% \textsc{svn} server of TeXLive:
+%
+% {
+% \small
+% \url{https:www.tug.org/svn/texlive/trunk/Master/texmf-dist/tex/latex/witharrows/witharrows.sty}
+% }
% \subsection*{Changes between versions 1.0 and 1.1}
%
% Option for the command |\\| and option |interline|
@@ -7887,6 +7924,10 @@ version 2005/12/01 or later.
%
% Correction of the erroneous programmation of the nodes aliases.
%
+% \subsection*{Changes between 2.5.1 and 2.6}
+%
+% The key |format| now support the letters |R|, |C| and |L|.
+%
% \PrintIndex
%
% \tableofcontents