diff options
author | Karl Berry <karl@freefriends.org> | 2021-08-23 20:51:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-08-23 20:51:12 +0000 |
commit | fc376d725a42d32a76b301bea7c6731bbac45141 (patch) | |
tree | 80711da8e7a7576a1d9585ea2801e867d0312585 /Master | |
parent | f58a5b400a2f0cc8eacf8e853529a0bf462b2aff (diff) |
cascade (23aug21)
git-svn-id: svn://tug.org/texlive/trunk@60310 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/cascade/README.md | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/cascade/cascade-french.pdf | bin | 65039 -> 70833 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/cascade/cascade-french.tex | 68 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/cascade/cascade.pdf | bin | 108503 -> 119231 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/cascade/cascade.dtx | 204 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/cascade/cascade.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/cascade/cascade.sty | 108 |
7 files changed, 313 insertions, 74 deletions
diff --git a/Master/texmf-dist/doc/latex/cascade/README.md b/Master/texmf-dist/doc/latex/cascade/README.md index a124aabb105..051fe2c0a7f 100644 --- a/Master/texmf-dist/doc/latex/cascade/README.md +++ b/Master/texmf-dist/doc/latex/cascade/README.md @@ -9,8 +9,7 @@ The LaTeX extension `cascade` is distributed under the LPPL 1.3 license. ## Presentation - -The LaTeX package `cascade` provides a command `\Cascade` to do contructions to present mathematical +The LaTeX package `cascade` provides a command `\Cascade` to do constructions to present mathematical demonstrations with successive braces for the deductions. diff --git a/Master/texmf-dist/doc/latex/cascade/cascade-french.pdf b/Master/texmf-dist/doc/latex/cascade/cascade-french.pdf Binary files differindex 223217e4a6f..964587adc6a 100644 --- a/Master/texmf-dist/doc/latex/cascade/cascade-french.pdf +++ b/Master/texmf-dist/doc/latex/cascade/cascade-french.pdf diff --git a/Master/texmf-dist/doc/latex/cascade/cascade-french.tex b/Master/texmf-dist/doc/latex/cascade/cascade-french.tex index bc0115099c8..5e265435b8e 100644 --- a/Master/texmf-dist/doc/latex/cascade/cascade-french.tex +++ b/Master/texmf-dist/doc/latex/cascade/cascade-french.tex @@ -66,38 +66,39 @@ \title{L'extension LaTeX \pkg{cascade}\thanks{Ce document correspond à la -version~\myfileversion\space of \pkg{cascade}, à la date du~\myfiledate.}} +version~\myfileversion\space de \pkg{cascade}, à la date du~\myfiledate.}} \author{F. Pantigny \\ \texttt{fpantigny@wanadoo.fr}} \maketitle \begin{abstract} -L'extension LaTeX \pkg{cascade} fournit une commande |\Cascade| pour faire des -constructions qui présentent des démonstrations mathématiques avec des accolades -enchaînées pour les déductions. +L'extension LaTeX \pkg{cascade} fournit une commande |\Cascade| pour faire des constructions qui présentent des +démonstrations mathématiques avec des accolades enchaînées pour les déductions. L'extension \pkg{cascade} fournit +également une commande |\Edacsac| (\emph{cascade} à l'envers) qui construit une structure similaire mais avec des +accolades allant dans l'autre sens. \end{abstract} \vspace{1cm} -\section{Présentation} +\section{La commande \textbackslash Cascade} L'extension \pkg{cascade} fournit une commande |\Cascade| qui permet des constructions comme la suivante, où la taille de l'accolade de droite est calculée sur seulement une partie des éléments LaTeX composés à gauche. \begin{center} -\Cascade{$\det(A) = \begin{vmatrix}3&4\\ -1&7\end{vmatrix}\neq 0$}% - {et, par conséquent, $A$ est inversible}% - {}% +\Cascade{$\det(A) = \begin{vmatrix}3&4\\ -1&7\end{vmatrix}\neq 0$} + {et, par conséquent, $A$ est inversible} + {} {or $AX=Y$} donc, $X = A^{-1}Y$ \end{center} \medskip \begin{Verbatim} -~emphase#\Cascade@{$\det(A) = \begin{vmatrix}3&4\\ -1&7\end{vmatrix}\neq 0$}% - {et, par conséquent, $A$ est inversible}% - {}% +~emphase#\Cascade@{$\det(A) = \begin{vmatrix}3&4\\ -1&7\end{vmatrix}\neq 0$} + {et, par conséquent, $A$ est inversible} + {} {or $AX=Y$} donc, $X = A^{-1}Y$ \end{Verbatim} @@ -244,14 +245,47 @@ Ces options peuvent être fixées au niveau du document avec la commande |\CascadeOptions|. Dans ce cas, la portée de ces déclarations est le groupe TeX courant (ces déclarations sont, comme on dit parfois «semi-globales»). +\bigskip +\section{La commande \textbackslash Edacsac} + +La commande |\Edacsac| (\textsl{cascade} écrit à l'envers) est similaire à la commande |\Cascade| mais avec des +accolades dans l'autre sens. La clé~|t| n'est pas disponible dans cette commande. + +\begin{Verbatim} +Singularity +~emphase#\Edacsac@ + {elementary} + { + ~emphase#\Edacsac@ + {non-degenerate elementary} + {~emphase#\ShortEdacsac@{hyperbolic}{non-hyperbolic}} + {degenerate elementary} + {} + } + {non-elementary} + {~emphase#\ShortEdacsac@{Nilpotent}{Higher order}} +\end{Verbatim} + + +Singularity +\Edacsac + {elementary} + { + \Edacsac + {non-degenerate elementary} + {\ShortEdacsac{hyperbolic}{non-hyperbolic}} + {degenerate elementary} + {} + } + {non-elementary} + {\ShortEdacsac{nilpotent}{higher order}} \bigskip \section{Remarque technique} -L'extension |\Cascade| est conçue pour fournir par défaut des résultats similaires -à ceux fournis par les environnements de l'\pkg{amsmath} (et de -\pkg{mathtools}), en particulier |{aligned}|. +Les commandes de \pkg{cascade} sont conçues pour fournir par défaut des résultats similaires à ceux fournis par les +environnements de l'\pkg{amsmath} (et de \pkg{mathtools}), en particulier |{aligned}|. \bigskip @@ -278,7 +312,7 @@ L'extension \pkg{cascade} construit les accolades avec la paire habituelle |\left|-|\right| de TeX. Néanmoins, les délimiteurs extensibles, en TeX, ne peuvent pas prendre toutes les tailles. On donne, dans l'exemple suivant, les accolades obtenues en entourant des filets verticaux de $6$~mm à $17$~mm (le code -est en |expl3|). +utilise la couche programmative de LaTeX3). \begin{Verbatim} \int_step_inline:nnnn 6 1 {17} { $\left.\hbox{\vrule height ~#1 mm}\right\}$\quad } @@ -298,10 +332,6 @@ Le document |cascade.pdf| (fourni avec l'extension \pkg{cascade}) contient une t documentation ici présente, ainsi que le code source commenté et un historique des versions. - - - - \end{document} diff --git a/Master/texmf-dist/doc/latex/cascade/cascade.pdf b/Master/texmf-dist/doc/latex/cascade/cascade.pdf Binary files differindex b500b161715..98e5437c284 100644 --- a/Master/texmf-dist/doc/latex/cascade/cascade.pdf +++ b/Master/texmf-dist/doc/latex/cascade/cascade.pdf diff --git a/Master/texmf-dist/source/latex/cascade/cascade.dtx b/Master/texmf-dist/source/latex/cascade/cascade.dtx index 33aaa5b8a93..3112dab3142 100644 --- a/Master/texmf-dist/source/latex/cascade/cascade.dtx +++ b/Master/texmf-dist/source/latex/cascade/cascade.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2018-2020 by F. Pantigny +% Copyright (C) 2018-2021 by F. Pantigny % ----------------------------------- % % This file may be distributed and/or modified under the @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{1.1} -\def\myfiledate{2020/07/05} +\def\myfileversion{1.2} +\def\myfiledate{2021/08/23} % % %<*batchfile> @@ -26,7 +26,7 @@ \usedir{tex/latex/cascade} \preamble -Copyright (C) 2018-2020 by F. Pantigny +Copyright (C) 2018-2021 by F. Pantigny ----------------------------------- This file may be distributed and/or modified under the @@ -106,30 +106,32 @@ version 2005/12/01 or later. % \begin{abstract} % The LaTeX package \pkg{cascade} provides a command |\Cascade| to do % constructions to present mathematical demonstrations with successive braces -% for the deductions. +% for the deductions. The package \pkg{cascade} provides also a command +% |\Edacsac| which creates similar structures but with +% braces going backwards. % \end{abstract} % % % % \vspace{1cm} -% \section{Presentation} +% \section{The command \textbackslash Cascade} % % The package \pkg{cascade} provides a command |\Cascade| which allows % constructions like the following where the size of the right brace is computed % on only a part of the LaTeX elements composed on the left. % \begin{center} -% \Cascade{$\det(A) = \begin{vmatrix}3&4\\ -1&7\end{vmatrix}\neq 0$}% -% {and, therefore, $A$ is inversible}% -% {}% +% \Cascade{$\det(A) = \begin{vmatrix}3&4\\ -1&7\end{vmatrix}\neq 0$} +% {and, therefore, $A$ is inversible} +% {} % {yet $AX=Y$} % hence, $X = A^{-1}Y$ % \end{center} % % \medskip % \begin{Verbatim} -% ~emphase#\Cascade@{$\det(A) = \begin{vmatrix}3&4\\ -1&7\end{vmatrix}\neq 0$}% -% {and, therefore, $A$ is inversible}% -% {}% +% ~emphase#\Cascade@{$\det(A) = \begin{vmatrix}3&4\\ -1&7\end{vmatrix}\neq 0$} +% {and, therefore, $A$ is inversible} +% {} % {yet $AX=Y$} % hence, $X = A^{-1}Y$ % \end{Verbatim} @@ -272,13 +274,49 @@ version 2005/12/01 or later. % |\CascadeOptions|. In this case, the scope of the declarations is the current % TeX group (these declarations are ``semi-global''). % +% \bigskip +% \section{The command \textbackslash Edacsac} +% +% The command |\Edacsac| (\textsl{cascade} written in reverse) is similar to the +% command |\Cascade| but with braces going backwards. The key |t| is not available in that command. +% +% \begin{Verbatim} +% Singularity +% ~emphase#\Edacsac@ +% {elementary} +% { +% ~emphase#\Edacsac@ +% {non-degenerate elementary} +% {~emphase#\ShortEdacsac@{hyperbolic}{non-hyperbolic}} +% {degenerate elementary} +% {} +% } +% {non-elementary} +% {~emphase#\ShortEdacsac@{Nilpotent}{Higher order}} +% \end{Verbatim} +% +% +% Singularity +% \Edacsac +% {elementary} +% { +% \Edacsac +% {non-degenerate elementary} +% {\ShortEdacsac{hyperbolic}{non-hyperbolic}} +% {degenerate elementary} +% {} +% } +% {non-elementary} +% {\ShortEdacsac{nilpotent}{higher order}} +% +% % % \bigskip % \section{Technical remark} % -% The package |\Cascade| is designed to provide by default results similar to the -% those given by the environments of \pkg{amsmath} --- and \pkg{mathtools} --- -% especially |{aligned}|. +% The package \pkg{cascade} is designed to provide by default results similar to +% the those given by the environments of \pkg{amsmath} --- and \pkg{mathtools} +% --- especially |{aligned}|. % % \bigskip % \begin{BVerbatim}[baseline=c,boxwidth=10cm] @@ -303,7 +341,8 @@ version 2005/12/01 or later. % The package \pkg{cascade} constructs the braces with the classical pair % |\left|-|\right| of TeX. However, the extensible delimiters, in TeX, cannot % take all sizes. We give, in the following example, the braces obtained when -% surrounding vertical rules from $6$~mm to $17$~mm (the code is in |expl3|). +% surrounding vertical rules from $6$~mm to $17$~mm (the code uses the L3 +% programming layer). % % \begin{Verbatim} % \int_step_inline:nnnn 6 1 {17} { $\left.\hbox{\vrule height ~#1 mm}\right\}$\quad } @@ -330,10 +369,6 @@ version 2005/12/01 or later. {Easy presentation of demonstrations in cascades} % \end{macrocode} % -% \interitem -% \begin{macrocode} -\RequirePackage{xparse} -% \end{macrocode} % % \interitem % \iffalse @@ -404,7 +439,7 @@ version 2005/12/01 or later. %% %% This set of options will be used by \Cascade and \ShortCascade % \fi -% The set of keys |cascade/command| will be used for the commands |\Cascade|. +% The set of keys |cascade/command| will be used by the command |\Cascade|. % \begin{macrocode} \keys_define:nn { cascade / command } { @@ -461,6 +496,19 @@ version 2005/12/01 or later. space-between .value_required:n = true } % \end{macrocode} +% +% \medskip +% \begin{macrocode} +\cs_new_protected:Npn \@@_initialisation: + { + \box_clear_new:N \l_@@_box_one + \box_clear_new:N \l_@@_box_two + \box_clear_new:N \l_@@_box_three + \box_clear_new:N \l_@@_box_four + \dim_zero_new:N \l_@@_top_dim + \dim_zero_new:N \l_@@_bottom_dim + } +% \end{macrocode} % % \medskip % \DescribeMacro{\CascadeOptions} @@ -484,7 +532,7 @@ version 2005/12/01 or later. \NewDocumentCommand \Cascade { O { } m m m m D < > { } } { \if_mode_math: - \msg_error:nn { cascade } { Cascade~in~math~mode } + \msg_error:nn { cascade } { math~mode } \fi: \mode_leave_vertical: % \end{macrocode} @@ -500,10 +548,7 @@ version 2005/12/01 or later. \spread@equation \dim_set_eq:NN \l_@@_interline_dim \l_@@_interline_all_dim \keys_set:nn { cascade / command } { #1 } - \box_clear_new:N \l_@@_box_one - \box_clear_new:N \l_@@_box_two - \box_clear_new:N \l_@@_box_three - \box_clear_new:N \l_@@_box_four + \@@_initialisation: \hbox_set:Nn \l_@@_box_one { \bool_set_true:N \l_@@_first_argument_bool @@ -524,7 +569,6 @@ version 2005/12/01 or later. % The dimension |\l_@@_top_dim| is the space that we will have to add before the % main construction to make up for the ``|\smash[t]|'' of the box |#1|. % \begin{macrocode} - \dim_zero_new:N \l_@@_top_dim \dim_set:Nn \l_@@_top_dim { \dim_max:nn @@ -535,7 +579,6 @@ version 2005/12/01 or later. % The dimension |\l_@@_bottom_dim| is the space that we will have to add after % the main construction to make up for the ``|\smash[b]|'' of the box |#3|. % \begin{macrocode} - \dim_zero_new:N \l_@@_bottom_dim \dim_set:Nn \l_@@_bottom_dim { \dim_max:nn @@ -565,6 +608,10 @@ version 2005/12/01 or later. % \begin{macrocode} \bool_if:NT \l_@@_first_argument_bool { +% \end{macrocode} +% Here, you should use |\box_ht_plus_dp:N| when TeXLive 2021 will be available +% on Overleaf. +% \begin{macrocode} \dim_set:Nn \l_tmpa_dim { \box_ht:N \l_tmpb_box + \box_dp:N \l_tmpb_box } \l_tmpa_dim = 0.5\l_tmpa_dim @@ -575,7 +622,7 @@ version 2005/12/01 or later. } % \end{macrocode} % \begin{macrocode} - \hbox:n + \hbox { \c_math_toggle_token \left . @@ -625,7 +672,7 @@ version 2005/12/01 or later. \halign { \hfil ## \cr - \hbox:n + \hbox { \tl_if_empty:nF { #1 } { @@ -637,7 +684,7 @@ version 2005/12/01 or later. } \cr \noalign { \skip_vertical:n \l_@@_interline_dim } - \hbox:n + \hbox { \tl_if_empty:nF { #2 } { @@ -654,15 +701,92 @@ version 2005/12/01 or later. } } % \end{macrocode} +% +% \bigskip +% The command |\Edacsac|. The code is simpler because we don't need the +% |\halign| and we don't have the key |t|. +% +% \begin{macrocode} +\NewDocumentCommand \Edacsac { O { } m m m m } + { + \if_mode_math: + \msg_error:nn { cascade } { math~mode } + \fi: + \mode_leave_vertical: + \group_begin: + \spread@equation + \dim_set_eq:NN \l_@@_interline_dim \l_@@_interline_all_dim + \keys_set:nn { cascade / command } { #1 } + \@@_initialisation: + \hbox_set:Nn \l_@@_box_one { #2 } + \hbox_set:Nn \l_@@_box_two { #3 } + \hbox_set:Nn \l_@@_box_three { #4 } + \hbox_set:Nn \l_@@_box_four { #5 } + \dim_set:Nn \l_@@_top_dim + { + \dim_max:nn + \c_zero_dim + { \box_ht:N \l_@@_box_two - \box_ht:N \l_@@_box_one } + } + \dim_set:Nn \l_@@_bottom_dim + { + \dim_max:nn + \c_zero_dim + { \box_dp:N \l_@@_box_four - \box_dp:N \l_@@_box_three } + } + \box_set_ht:Nn \l_@@_box_two \c_zero_dim + \box_set_dp:Nn \l_@@_box_four \c_zero_dim + \vbox + { + \skip_vertical:N \l_@@_top_dim + \vtop + { + \hbox + { + \c_math_toggle_token + \left \{ + \vcenter + { + \hbox + { + \tl_if_empty:nF { #2 } + { + \box_use_drop:N \l_@@_box_one + \skip_horizontal:n \l_@@_space_between_dim + } + \box_use_drop:N \l_@@_box_two + \strut + } + \skip_vertical:N \l_@@_interline_dim + \hbox + { + \tl_if_empty:nF { #4 } + { + \box_use_drop:N \l_@@_box_three + \skip_horizontal:n \l_@@_space_between_dim + } + \box_use_drop:N \l_@@_box_four + \strut + } + } + \right . + \c_math_toggle_token + } + \skip_vertical:N \l_@@_bottom_dim + } + } + \group_end: +} +% \end{macrocode} +% % % \bigskip % \begin{macrocode} \msg_new:nnn { cascade } - { Cascade~in~math~mode } + { math~mode } { - The~commands~\token_to_str:N \Cascade\ - and~\token_to_str:N \ShortCascade\ + The~commands~of~the~extension~'cascade'~ should~be~used~in~text~mode~only.~However,~you~can~ go~on~for~this~time. } @@ -688,6 +812,15 @@ version 2005/12/01 or later. { \Cascade [ #1 ] { } { #2 } { } { #3 } } % \end{macrocode} % +% \bigskip +% \DescribeMacro{\ShortEdacsac} +% Idem for |\ShortEdacsac| +% \begin{macrocode} +\NewDocumentCommand \ShortEdacsac { O { } m m } + { \Edacsac [ #1 ] { #2 } { } { #3 } { } } +% \end{macrocode} +% +% % \vspace{1cm} % \section{History} % @@ -695,7 +828,10 @@ version 2005/12/01 or later. % % New option |t|. % +% \subsection*{Changes between versions 1.0 and 1.1} % +% New commands |\Edacsac| and |\ShortEdacsac|. +% % % \PrintIndex % \tableofcontents diff --git a/Master/texmf-dist/source/latex/cascade/cascade.ins b/Master/texmf-dist/source/latex/cascade/cascade.ins index 6f7ebb3ff9a..db89312250c 100644 --- a/Master/texmf-dist/source/latex/cascade/cascade.ins +++ b/Master/texmf-dist/source/latex/cascade/cascade.ins @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2018 by F. Pantigny +%% Copyright (C) 2018-2021 by F. Pantigny %% %% %% This file may be distributed and/or modified under the @@ -17,7 +17,7 @@ \usedir{tex/latex/cascade} \preamble -Copyright (C) 2018 by F. Pantigny +Copyright (C) 2018-2021 by F. Pantigny This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either diff --git a/Master/texmf-dist/tex/latex/cascade/cascade.sty b/Master/texmf-dist/tex/latex/cascade/cascade.sty index 4e776bddad2..2af9af477d3 100644 --- a/Master/texmf-dist/tex/latex/cascade/cascade.sty +++ b/Master/texmf-dist/tex/latex/cascade/cascade.sty @@ -6,7 +6,7 @@ %% %% cascade.dtx (with options: `package') %% -%% Copyright (C) 2018 by F. Pantigny +%% Copyright (C) 2018-2021 by F. Pantigny %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -18,15 +18,14 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2005/12/01 or later. %% -\def\myfileversion{1.1} -\def\myfiledate{2020/07/05} +\def\myfileversion{1.2} +\def\myfiledate{2021/08/23} \RequirePackage{l3keys2e} \ProvidesExplPackage {cascade} {\myfiledate} {\myfileversion} {Easy presentation of demonstrations in cascades} -\RequirePackage{xparse} %% %% The following macro is the same as the macro of amsmath \cs_if_free:NT \spread@equation @@ -76,6 +75,15 @@ space-between .dim_set:N = \l__cascade_space_between_dim , space-between .value_required:n = true } +\cs_new_protected:Npn \__cascade_initialisation: + { + \box_clear_new:N \l__cascade_box_one + \box_clear_new:N \l__cascade_box_two + \box_clear_new:N \l__cascade_box_three + \box_clear_new:N \l__cascade_box_four + \dim_zero_new:N \l__cascade_top_dim + \dim_zero_new:N \l__cascade_bottom_dim + } \NewDocumentCommand \CascadeOptions { m } { \keys_set:nn { cascade / global } { #1 } } %% @@ -83,7 +91,7 @@ \NewDocumentCommand \Cascade { O { } m m m m D < > { } } { \if_mode_math: - \msg_error:nn { cascade } { Cascade~in~math~mode } + \msg_error:nn { cascade } { math~mode } \fi: \mode_leave_vertical: \bool_if:NF \l__cascade_nested_command_bool @@ -96,10 +104,7 @@ \spread@equation \dim_set_eq:NN \l__cascade_interline_dim \l__cascade_interline_all_dim \keys_set:nn { cascade / command } { #1 } - \box_clear_new:N \l__cascade_box_one - \box_clear_new:N \l__cascade_box_two - \box_clear_new:N \l__cascade_box_three - \box_clear_new:N \l__cascade_box_four + \__cascade_initialisation: \hbox_set:Nn \l__cascade_box_one { \bool_set_true:N \l__cascade_first_argument_bool @@ -114,14 +119,12 @@ #4 } \hbox_set:Nn \l__cascade_box_four { #5 } - \dim_zero_new:N \l__cascade_top_dim \dim_set:Nn \l__cascade_top_dim { \dim_max:nn \c_zero_dim { \box_ht:N \l__cascade_box_one - \box_ht:N \l__cascade_box_two } } - \dim_zero_new:N \l__cascade_bottom_dim \dim_set:Nn \l__cascade_bottom_dim { \dim_max:nn @@ -146,7 +149,7 @@ { \dim_max:nn { \box_ht:N \l__cascade_box_two } { \box_ht:N \strutbox } } \dim_gadd:Nn \g__cascade_yoffset_dim \l_tmpa_dim } - \hbox:n + \hbox { \c_math_toggle_token \left . @@ -187,7 +190,7 @@ \halign { \hfil ## \cr - \hbox:n + \hbox { \tl_if_empty:nF { #1 } { @@ -199,7 +202,7 @@ } \cr \noalign { \skip_vertical:n \l__cascade_interline_dim } - \hbox:n + \hbox { \tl_if_empty:nF { #2 } { @@ -215,12 +218,81 @@ \c_math_toggle_token } } +\NewDocumentCommand \Edacsac { O { } m m m m } + { + \if_mode_math: + \msg_error:nn { cascade } { math~mode } + \fi: + \mode_leave_vertical: + \group_begin: + \spread@equation + \dim_set_eq:NN \l__cascade_interline_dim \l__cascade_interline_all_dim + \keys_set:nn { cascade / command } { #1 } + \__cascade_initialisation: + \hbox_set:Nn \l__cascade_box_one { #2 } + \hbox_set:Nn \l__cascade_box_two { #3 } + \hbox_set:Nn \l__cascade_box_three { #4 } + \hbox_set:Nn \l__cascade_box_four { #5 } + \dim_set:Nn \l__cascade_top_dim + { + \dim_max:nn + \c_zero_dim + { \box_ht:N \l__cascade_box_two - \box_ht:N \l__cascade_box_one } + } + \dim_set:Nn \l__cascade_bottom_dim + { + \dim_max:nn + \c_zero_dim + { \box_dp:N \l__cascade_box_four - \box_dp:N \l__cascade_box_three } + } + \box_set_ht:Nn \l__cascade_box_two \c_zero_dim + \box_set_dp:Nn \l__cascade_box_four \c_zero_dim + \vbox + { + \skip_vertical:N \l__cascade_top_dim + \vtop + { + \hbox + { + \c_math_toggle_token + \left \{ + \vcenter + { + \hbox + { + \tl_if_empty:nF { #2 } + { + \box_use_drop:N \l__cascade_box_one + \skip_horizontal:n \l__cascade_space_between_dim + } + \box_use_drop:N \l__cascade_box_two + \strut + } + \skip_vertical:N \l__cascade_interline_dim + \hbox + { + \tl_if_empty:nF { #4 } + { + \box_use_drop:N \l__cascade_box_three + \skip_horizontal:n \l__cascade_space_between_dim + } + \box_use_drop:N \l__cascade_box_four + \strut + } + } + \right . + \c_math_toggle_token + } + \skip_vertical:N \l__cascade_bottom_dim + } + } + \group_end: +} \msg_new:nnn { cascade } - { Cascade~in~math~mode } + { math~mode } { - The~commands~\token_to_str:N \Cascade\ - and~\token_to_str:N \ShortCascade\ + The~commands~of~the~extension~'cascade'~ should~be~used~in~text~mode~only.~However,~you~can~ go~on~for~this~time. } @@ -234,6 +306,8 @@ } \NewDocumentCommand \ShortCascade { O { } m m } { \Cascade [ #1 ] { } { #2 } { } { #3 } } +\NewDocumentCommand \ShortEdacsac { O { } m m } + { \Edacsac [ #1 ] { #2 } { } { #3 } { } } \endinput %% |