diff options
author | Karl Berry <karl@freefriends.org> | 2017-06-06 21:53:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-06-06 21:53:26 +0000 |
commit | af4a841a3ac56bc89bf08019c254921b327d2af7 (patch) | |
tree | af2e36895b67aca097b7227d1e145f1822463c1c /Master/texmf-dist | |
parent | d036e1b1dc4d59e9ce15b37af93ae0b55a50520c (diff) |
mathtools (24may17)
git-svn-id: svn://tug.org/texlive/trunk@44504 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/mathtools/README | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mathtools/empheq.pdf | bin | 311054 -> 311449 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/mathtools/mathtools.pdf | bin | 435348 -> 436483 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf | bin | 233589 -> 235863 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/mathtools/empheq.dtx | 679 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mathtools/mathtools.dtx | 842 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mathtools/mhsetup.dtx | 113 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mathtools/empheq.sty | 585 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mathtools/mathtools.sty | 461 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mathtools/mhsetup.sty | 66 |
10 files changed, 1541 insertions, 1213 deletions
diff --git a/Master/texmf-dist/doc/latex/mathtools/README b/Master/texmf-dist/doc/latex/mathtools/README index 7672ed28b76..3528dc78a89 100644 --- a/Master/texmf-dist/doc/latex/mathtools/README +++ b/Master/texmf-dist/doc/latex/mathtools/README @@ -39,6 +39,7 @@ of amsmath and standard LaTeX. It provides: gathered environments. -- Math versions of \makebox, \llap, \rlap etc. -- Cramped math styles. + -- Macro generators. -- and more... mathtools requires mhsetup. @@ -63,8 +64,9 @@ mhsetup ======= The mhsetup package defines various programming tools needed by -both empheq and mathtools. In the future, most of these tools will -probably be an integral part of LaTeX3. +both empheq and mathtools. The syntax is the same as for expl3, +but there is no code overlap (anymore as of May 2017). +In the future, most of these tools will probably be an integral part of LaTeX3 (they were). BUG REPORTS @@ -79,4 +81,4 @@ The bundle is maintained by: Please report bugs to daleif@math.au.dk =========== -This README file was last revised 2015/05/11. +This README file was last revised 2017/05/24. diff --git a/Master/texmf-dist/doc/latex/mathtools/empheq.pdf b/Master/texmf-dist/doc/latex/mathtools/empheq.pdf Binary files differindex 6ec5bc00954..d959291a249 100644 --- a/Master/texmf-dist/doc/latex/mathtools/empheq.pdf +++ b/Master/texmf-dist/doc/latex/mathtools/empheq.pdf diff --git a/Master/texmf-dist/doc/latex/mathtools/mathtools.pdf b/Master/texmf-dist/doc/latex/mathtools/mathtools.pdf Binary files differindex 416e3b99270..8ead190b35e 100644 --- a/Master/texmf-dist/doc/latex/mathtools/mathtools.pdf +++ b/Master/texmf-dist/doc/latex/mathtools/mathtools.pdf diff --git a/Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf b/Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf Binary files differindex 526bffdf54b..6f1be1cc650 100644 --- a/Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf +++ b/Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf diff --git a/Master/texmf-dist/source/latex/mathtools/empheq.dtx b/Master/texmf-dist/source/latex/mathtools/empheq.dtx index e2230abff6e..45dace201f8 100644 --- a/Master/texmf-dist/source/latex/mathtools/empheq.dtx +++ b/Master/texmf-dist/source/latex/mathtools/empheq.dtx @@ -68,7 +68,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: empheq 2014/08/04 v2.14 empheq} +\Msg{* Package: empheq 2017/03/31 v2.15 empheq} \Msg{************************************************************************} \keepsilent @@ -131,7 +131,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{empheq.drv}% - [2014/08/04 v2.14 Emphasizing equations] + [2017/03/31 v2.15 Emphasizing equations] \documentclass{ltxdoc} \usepackage{mathpazo} \usepackage[overload]{empheq} @@ -324,6 +324,9 @@ and the derived files \end{document} %</driver> % \fi +% \changes{v2.15}{2017/03/31}{Fixed a bug in relation to the AMS +% classes and completed prefixing macros belonging to \pkg{mhsetup} +% and \pkg{empheq}} % \changes{v2.14}{2014/07/16}{Updated maintenance and contact info} % % \changes{v2.11}{2004/08/03}{Removed interface to the obsolete empheq @@ -370,7 +373,7 @@ and the derived files % \maketitle % % \begin{abstract} -% The \pkg{empheq} package can best be described as a visual markup +% \noindent The \pkg{empheq} package can best be described as a visual markup % extension to \pkg{amsmath}. In short it offers a)~a multi line % equivalent of \cs{boxed} from \pkg{amsmath} and b)~a way to % produce arbitrary delimiters that span entire math displays. @@ -641,7 +644,8 @@ and the derived files % Now we've seen some of the things that work in the \env{empheq} % environment but we also have to take note of what won't work. As % this package provides a way to box multi line math displays it can -% come as no surprise that using either \cs{intertext} or +% come as no surprise that using either \cs{intertext}\footnote{And +% thus also \cs{shortintertext} (\pkg{mathtools}).} or % \cs{displaybreak} inside the \env{empheq} environment makes no % sense. Should you however happen to try them anyway, you'll % experience that \cs{intertext} issues an error message and @@ -650,8 +654,13 @@ and the derived files % from what you expect, and that is not the case (so much at least) % with \cs{displaybreak}. But of course, you'll never see either % message because you read the manual! -% -% +% \begin{codesyntax} +% Very long lines +% \end{codesyntax} +% The standard \AmS\ environments will move the equation number if a +% line gets too close to it. Due to implementation, this feature is +% \emph{not} carried correctly to the \env{empheq} environments, so keep +% equation lines short then applying \env{empheq} to them. % % \subsection{Special delimiters} % @@ -1411,7 +1420,7 @@ and the derived files % % \section{A few short notes} % -% \subsection{About $\cs{eqref}$} +% \subsection{About \texorpdfstring{$\cs{eqref}$}{\textbackslash eqref}} % % Internally \env{empheq} separate the displayed math from % the corresponding equation numbers such that we can add special @@ -1438,7 +1447,8 @@ and the derived files % % % -% \subsection{About changes to $\cs{baselineskip}$} +% \subsection{About changes to +% \texorpdfstring{$\cs{baselineskip}$}{\textbackslash baselineskip}} % % Users should never mess with \cs{baselineskip} directly, it is not % the correct manner to get double spacing. Have a look at say the @@ -1729,10 +1739,11 @@ and the derived files % \begin{macrocode} %<*package> \ProvidesPackage{empheq}% - [2014/07/16 v2.14 Emphasizing equations] + [2017/03/31 v2.15 Emphasizing equations] % \end{macrocode} +% \changes{v2.15}{2017/03/31}{Bumped required mhsetup release} % \begin{macrocode} -\RequirePackage{mhsetup}[2004/10/10] +\RequirePackage{mhsetup}[2017/03/31] \MHInternalSyntaxOn % \end{macrocode} % @@ -1787,9 +1798,10 @@ and the derived files % course. Since v2.10 that is now taken care of in the % \pkg{mathtools} package which'll pass on the options to % \pkg{amsmath}. +% \changes{v2.15}{2017/03/31}{Bumped required mathtools release} % \begin{macrocode} \MHInternalSyntaxOff -\RequirePackage{mathtools}[2004/10/10] +\RequirePackage{mathtools}[2017/03/31] % \end{macrocode} % Activate the internal syntax. % \begin{macrocode} @@ -1839,22 +1851,23 @@ and the derived files % \end{enumerate} % \end{multicols} % +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \newcount\l_EQ_equationtype_int \newcount\l_EQ_alignmentmode_int \if@fleqn \iftagsleft@ \l_EQ_alignmentmode_int=4 - \else: + \MH_else: \l_EQ_alignmentmode_int=\thr@@ - \fi: -\else: + \MH_fi: +\MH_else: \iftagsleft@ \l_EQ_alignmentmode_int=\tw@ - \else: + \MH_else: \l_EQ_alignmentmode_int=\@ne - \fi: -\fi: + \MH_fi: +\MH_fi: % \end{macrocode} % \end{macro} % \end{macro} @@ -1982,17 +1995,19 @@ and the derived files % If the user didn't specify the mandatory argument we will catch it % because \cs{l_EQ_equationtype_int} is zero. An error is % issued\label{ZeroCheckpoint}. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix, twice} % \begin{macrocode} - \if_num:w \l_EQ_equationtype_int=\z@ %ZeroCheckpoint + \MH_if_num:w \l_EQ_equationtype_int=\z@ %ZeroCheckpoint \EQ_upgrade_error: - \else: + \MH_else: % \end{macrocode} % Those that read the manual get the reward here: The package will % actually work! +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \EQ_post_process: \ignorespacesafterend - \fi:} + \MH_fi:} % \end{macrocode} % \end{environment} % \end{macro} @@ -2031,9 +2046,9 @@ and the derived files } \ifodd \l_EQ_alignmentmode_int \setkeys{\MT_options_name:}{multlined-pos=b} - \else: + \MH_else: \setkeys{\MT_options_name:}{multlined-pos=t} - \fi: + \MH_fi: \g@addto@macro\EQ_complete_mathdisplay:{ \begin{MTmultlined}\relax} } @@ -2103,47 +2118,49 @@ and the derived files % \end{macrocode} % Call the appropriate \cs{find_displaywidth_}\meta{num}\texttt{:} % which extracts the display width (\cs{l_EQ_displaywidth_dim}). +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} - \@nameuse{find_displaywidth_ + \@nameuse{EQ_find_displaywidth_ \romannumeral\l_EQ_equationtype_int\EQ_next: :} \MH_addtolength:dn \l_EQ_totalwidth_dim{\l_EQ_displaywidth_dim} % \end{macrocode} % We save the math display in a box of the correct size. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \savebox\EQ_mathdisplay_box[\l_EQ_totalwidth_dim][c]{% $\EQ_left_side: \EQ_innerbox:{% - \if_case:w \l_EQ_alignmentmode_int\or: + \MH_if_case:w \l_EQ_alignmentmode_int\MH_or: % \end{macrocode} % If the equation is centered we make the box centered % \begin{macrocode} \makebox[\l_EQ_displaywidth_dim][c] {\usebox{\EQ_mathdisplay_box}}% - \or: + \MH_or: \makebox[\l_EQ_displaywidth_dim][c] {\usebox{\EQ_mathdisplay_box}}% - \or: + \MH_or: % \end{macrocode} % Else we set it in a left aligned box and take care of the % \cs{@mathmargin} unless we're in \env{flalign} or \env{flalign*}. % \begin{macrocode} \makebox[\l_EQ_displaywidth_dim][l]{% - \if_num:w \l_EQ_equationtype_int=5 \else: - \if_num:w \l_EQ_equationtype_int=6 \else: + \MH_if_num:w \l_EQ_equationtype_int=5 \MH_else: + \MH_if_num:w \l_EQ_equationtype_int=6 \MH_else: \kern-\@mathmargin - \fi: - \fi: + \MH_fi: + \MH_fi: \usebox{\EQ_mathdisplay_box}}% - \or: + \MH_or: \makebox[\l_EQ_displaywidth_dim][l]{% - \if_num:w \l_EQ_equationtype_int=5 \else: - \if_num:w \l_EQ_equationtype_int=6 \else: + \MH_if_num:w \l_EQ_equationtype_int=5 \MH_else: + \MH_if_num:w \l_EQ_equationtype_int=6 \MH_else: \kern-\@mathmargin - \fi: - \fi: + \MH_fi: + \MH_fi: \usebox{\EQ_mathdisplay_box}}% - \fi:}% + \MH_fi:}% \EQ_right_side:$}% % \end{macrocode} % Then we're ready for typesetting. We just use an ordinary @@ -2162,20 +2179,22 @@ and the derived files % properly, so we make sure there is a tag before we try to typeset % it. Also make sure that the boolean |show_manual_tags| is true % just for this tag. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_set_boolean_T:n {show_manual_tags} % \end{macrocode} % Set the tag in a left aligned box when in \mode{leqno} mode and % right aligned when in \mode{reqno} mode. -% \begin{macrocode} - \if_case:w \l_EQ_alignmentmode_int - \or: \EQ_place_tag:N r %#1 - \or: \EQ_place_tag:N l %#2 - \or: \EQ_place_tag:N r %#3 - \or: \EQ_place_tag:N l %#4 - \fi: - \fi: +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} +% \begin{macrocode} + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: \EQ_place_tag:N r %#1 + \MH_or: \EQ_place_tag:N l %#2 + \MH_or: \EQ_place_tag:N r %#3 + \MH_or: \EQ_place_tag:N l %#4 + \MH_fi: + \MH_fi: \end{AmSequation*} % \end{macrocode} % \changes{v2.11}{2004/08/03}{Use raw \TeX{} commands to speed it up} @@ -2239,12 +2258,18 @@ and the derived files % \end{macro} % \begin{macro}{\EQ_intertext:} % Then we issue a suitable error message. +% \changes{v2.15}{2017/03/31}{Extended to also include \cs{shortintertext}} % \begin{macrocode} \def\EQ_intertext:{% \def\intertext##1{\PackageError{empheq}{% You~cannot~use~\string\intertext\space inside~the~`empheq' \MessageBreak - environment,~as~`empheq'~creates~an~unbreakable~box}\@eha}} + environment,~as~`empheq'~creates~an~unbreakable~box}\@eha} + \def\shortintertext##1{\PackageError{empheq}{% + You~cannot~use~\string\shortintertext\space inside~the~`empheq' + \MessageBreak + environment,~as~`empheq'~creates~an~unbreakable~box}\@eha} +} \def\EQ_displaybreak:{% \def\dspbrk@[##1]{\PackageWarning{empheq}{% You~cannot~use~\string\displaybreak\space inside~the~`empheq'% @@ -2278,7 +2303,7 @@ and the derived files % \subsubsection{Separating Tags and Display} % % \begin{macro}{\EQ_typeset_tags:} -% Typesetting the tags without the display. +% Typesetting the tags without the display. % \begin{macrocode} \def\EQ_typeset_tags:{% \sbox\EQ_tag_box{% @@ -2291,6 +2316,15 @@ and the derived files % \begin{macrocode} \EQ_prevent_vertical_space: % \end{macrocode} +% The AMS classes sets \cs{displaywidth} equal to \cs{columnwidth} in +% \cs{everydisplay}. This is bad for us as then the reqno equation +% numbers are not typeset at the right edge of the parbox we are +% in. Simplest solution: Locally reset \cs{columnwidth}. +% \changes{v2.15}{2017/03/28}{Resetting \cs{columnwidth} as a fix for +% a setting in AMS classes} +% \begin{macrocode} + \columnwidth\linewidth +% \end{macrocode} % Support for \pkg{ntheorem}. This package patches \cs{endgather} % and \cs{endalign} with the commands \cs{TagsPlusEndmarks} and % \cs{RestoreTags} but we do not want them disturbing our output so @@ -2326,38 +2360,40 @@ and the derived files % case of extremely big tag height} % % For adjusting vertical spacing in the display. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \def\EQ_predisplay_adjustment:{% - \if_dim:w \g_EQ_toprow_height_dim<\baselineskip + \MH_if_dim:w \g_EQ_toprow_height_dim<\baselineskip \vskip\g_EQ_toprow_height_dim \vskip-\baselineskip - \else: + \MH_else: \vskip-\normallineskip - \fi: - \if_dim:w \g_EQ_toptag_height_dim>\g_EQ_toprow_height_dim - \if_dim:w \g_EQ_toptag_height_dim>\baselineskip + \MH_fi: + \MH_if_dim:w \g_EQ_toptag_height_dim>\g_EQ_toprow_height_dim + \MH_if_dim:w \g_EQ_toptag_height_dim>\baselineskip \vskip-\g_EQ_toptag_height_dim \vskip\baselineskip \vskip-\normallineskip - \fi: - \fi:} + \MH_fi: + \MH_fi:} % \end{macrocode} % \end{macro} % \begin{macro}{\EQ_postdisplay_adjustment:} % \changes{v1.05c}{2004/02/25}{Added \cs{EQ_postdisplay_adjustment:}} % Name says it all. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\EQ_postdisplay_adjustment:{% - \if_dim:w \g_EQ_bottomrow_depth_dim<\dp\strutbox + \MH_if_dim:w \g_EQ_bottomrow_depth_dim<\dp\strutbox \vskip\g_EQ_bottomrow_depth_dim \vskip-\dp\strutbox - \fi: - \if_dim:w \g_EQ_bottomtag_depth_dim>\g_EQ_bottomrow_depth_dim - \if_dim:w \g_EQ_bottomtag_depth_dim>\dp\strutbox + \MH_fi: + \MH_if_dim:w \g_EQ_bottomtag_depth_dim>\g_EQ_bottomrow_depth_dim + \MH_if_dim:w \g_EQ_bottomtag_depth_dim>\dp\strutbox \vskip-\g_EQ_bottomtag_depth_dim \vskip\dp\strutbox - \fi: - \fi:} + \MH_fi: + \MH_fi:} % \end{macrocode} % \end{macro} % \begin{macro}{\EQ_typeset_display:} @@ -2417,12 +2453,13 @@ and the derived files % need to use a \cs{vphantom} of the tag as it may be taller than % the line of math it is attached to (say, if you are using node % connectors from \pkg{pstricks} or some other weird stuff). +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\EQ_maketag:Nn #1#2{% \setboxz@h{#2}% - \if_num:w \row@=\@ne + \MH_if_num:w \row@=\@ne \global \g_EQ_toptag_height_dim = \ht\z@ - \fi: + \MH_fi: % \end{macrocode} % Similarly the depth of the last row is determined by measuring the % depth of box zero for each row and then using the last of the @@ -2433,12 +2470,13 @@ and the derived files % \changes{v2.11}{2004/08/03}{Added a check for being in the last row.} % Save the row number for later as the \opt{ntheorem} option will need % it. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \xdef\g_EQ_latest_nonzerodepth_row_fint{\number\row@} \@tempdima=\wd\z@ - \if_dim:w \@tempdima > \g_EQ_widesttag_dim + \MH_if_dim:w \@tempdima > \g_EQ_widesttag_dim \global \g_EQ_widesttag_dim = \@tempdima - \fi: + \MH_fi: #1{#2}% } % \end{macrocode} @@ -2449,13 +2487,14 @@ and the derived files % Box zero (\cs{z@}) contains the entire line of math in a % \env{gather}, so instead of typesetting it we typeset the phantom % of it and call \cs{EQ_measure_gather:}. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \def\EQ_set_gather_field:{% \iftagsleft@ \global\lineht@\ht\z@ - \else: + \MH_else: \global\lineht@\dp\z@ - \fi: + \MH_fi: \kern\eqnshift@ %\boxz@ % Original amsmath version \EQ_measure_gather: @@ -2468,11 +2507,12 @@ and the derived files % fairly easy. If \cs{row@} is equal to one, we're in the first % line, and the height of the top row is simply given by the height % of box zero. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\EQ_measure_gather:{% - \if_num:w \row@=\@ne + \MH_if_num:w \row@=\@ne \g_EQ_toprow_height_dim=\ht\z@ - \fi: + \MH_fi: % \end{macrocode} % Similarly the depth of the last row is determined by measuring the % depth of box zero for each row and then using the last of the @@ -2490,18 +2530,19 @@ and the derived files % we have to stop the underlying \cs{start@align} from going over % the measuring phase twice. That's when the conditional % \bool{continue_measuring} comes into the picture. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \def\EQ_set_align_field:{% \column@plus \iftagsleft@ - \if_dim:w \ht\z@>\lineht@ + \MH_if_dim:w \ht\z@>\lineht@ \global\lineht@\ht\z@ - \fi: - \else: - \if_dim:w \dp\z@>\lineht@ + \MH_fi: + \MH_else: + \MH_if_dim:w \dp\z@>\lineht@ \global\lineht@\dp\z@ - \fi: - \fi: + \MH_fi: + \MH_fi: %\boxz@ % Original amsmath version \MH_if_boolean:nT {continue_measuring}{ \EQ_measure_align: } \phantom{\boxz@}} @@ -2510,37 +2551,38 @@ and the derived files % \begin{macro}{\EQ_measure_align:} % We have to measure every single field of the \cs{align@} \ldots\@ % Oh well, here it comes: +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \newcount\g_EQ_temprow_int \MH_new_boolean:n {still_in_samerow} \MH_new_boolean:n {continue_measuring} \def\EQ_measure_align:{% - \if_num:w \g_EQ_temprow_int=\row@ + \MH_if_num:w \g_EQ_temprow_int=\row@ \MH_set_boolean_T:n {still_in_samerow} - \else: - \if_num:w \g_EQ_temprow_int>\row@ + \MH_else: + \MH_if_num:w \g_EQ_temprow_int>\row@ \global\MH_set_boolean_F:n {continue_measuring} - \fi: + \MH_fi: \MH_set_boolean_F:n {still_in_samerow} \global\@tempdimc=\@tempdimb \global\@tempdimb=\g_EQ_bottomrow_depth_dim - \fi: + \MH_fi: \MH_if_boolean:nTF {continue_measuring}{ \global\g_EQ_temprow_int=\row@ \@tempcnta=\row@ - \if_num:w \@tempcnta=\z@ + \MH_if_num:w \@tempcnta=\z@ \@tempdima=\g_EQ_toprow_height_dim \g_EQ_toprow_height_dim=\ht\z@\relax - \if_dim:w \g_EQ_toprow_height_dim<\@tempdima + \MH_if_dim:w \g_EQ_toprow_height_dim<\@tempdima \g_EQ_toprow_height_dim\@tempdima - \fi: - \fi: + \MH_fi: + \MH_fi: \MH_if_boolean:nTF {still_in_samerow}{ \@tempdima=\g_EQ_bottomrow_depth_dim \g_EQ_bottomrow_depth_dim=\dp\z@\relax - \if_dim:w \g_EQ_bottomrow_depth_dim<\@tempdima + \MH_if_dim:w \g_EQ_bottomrow_depth_dim<\@tempdima \g_EQ_bottomrow_depth_dim\@tempdima - \fi: + \MH_fi: }{ \g_EQ_bottomrow_depth_dim\dp\z@\relax } @@ -2571,38 +2613,40 @@ and the derived files % right. Remember we have separated the tags and the math display % but we would still like to have them line up as they should! We do % it all inside a group so we can use the scratch dimensions safely. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \def\EQ_vertical_tag_adjustment:n #1{{% \@tempdima\z@\@tempdimb\z@ \@tempdimc=\dp\strutbox - \if_dim:w \g_EQ_toprow_height_dim<\baselineskip + \MH_if_dim:w \g_EQ_toprow_height_dim<\baselineskip \MH_setlength:dn \@tempdima{\g_EQ_toprow_height_dim-\baselineskip} - \else: + \MH_else: \MH_setlength:dn \@tempdima{-\normallineskip} - \fi: - \if_dim:w \g_EQ_toptag_height_dim>\g_EQ_toprow_height_dim - \if_dim:w \g_EQ_toptag_height_dim>\baselineskip + \MH_fi: + \MH_if_dim:w \g_EQ_toptag_height_dim>\g_EQ_toprow_height_dim + \MH_if_dim:w \g_EQ_toptag_height_dim>\baselineskip \MH_addtolength:dn \@tempdima {-\g_EQ_toptag_height_dim+\baselineskip-\normallineskip} - \fi: - \fi: - \if_dim:w \g_EQ_bottomrow_depth_dim<\@tempdimc + \MH_fi: + \MH_fi: + \MH_if_dim:w \g_EQ_bottomrow_depth_dim<\@tempdimc \MH_setlength:dn \@tempdimb {\g_EQ_bottomrow_depth_dim-\@tempdimc} - \fi: + \MH_fi: % \end{macrocode} % \changes{v2.00}{2004/04/14}{Fixed minor bug} % If the last condition is fulfilled we also need to cancel the % first condition. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} - \if_dim:w \g_EQ_bottomtag_depth_dim>\g_EQ_bottomrow_depth_dim - \if_dim:w \g_EQ_bottomtag_depth_dim<\@tempdimc - \else: + \MH_if_dim:w \g_EQ_bottomtag_depth_dim>\g_EQ_bottomrow_depth_dim + \MH_if_dim:w \g_EQ_bottomtag_depth_dim<\@tempdimc + \MH_else: \MH_addtolength:dn \@tempdimb {-\g_EQ_bottomtag_depth_dim+\@tempdimc} - \fi: - \fi: + \MH_fi: + \MH_fi: \raisebox{-0.5\@tempdima+0.5\@tempdimb}{#1}}}% % \end{macrocode} % \end{macro} @@ -2613,7 +2657,7 @@ and the derived files % env}\marg{arabic num}\texttt{:} % \item[]|\def\EQ_modify_linewidth_|\meta{roman num}\texttt{:}\\ % \hspace*{2em}\marg{Optionally alter \cs{l_EQ_temp_linewidth_dim}} -% \item[]|\def\find_displaywidth_|\meta{roman num}\texttt{:}\\ +% \item[]|\def\EQ_find_displaywidth_|\meta{roman num}\texttt{:}\\ % \hspace*{2em}\marg{Set \cs{l_EQ_displaywidth_dim}} % \item[]|\def\EQ_place_display_|\meta{roman num}\texttt{:}\\ % \hspace*{2em}\marg{Make use of \cs{EQ_use_mathdisplay:}} @@ -2673,32 +2717,35 @@ and the derived files % \end{macrocode} % If $\cs{maxfields@}=2$ we're in a single column \env{align} and % thus there is no flexible space. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} - \if_num:w \maxfields@=\tw@ - \else: + \MH_if_num:w \maxfields@=\tw@ + \MH_else: % \end{macrocode} % But if there is any flexible space we would very much like to % adjust it because we add material to the right and left of the % math display. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} \setlength{\l_EQ_temp_linewidth_dim}{% \linewidth-\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% - \fi:} + \MH_fi:} \def\EQ_modify_linewidth_ii:{\EQ_modify_linewidth_i:} -\def\find_displaywidth_i:{% +\def\EQ_find_displaywidth_i:{% \MH_setlength:dn \l_EQ_displaywidth_dim {\l_EQ_temp_linewidth_dim-\alignsep@} - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\alignsep@}% - \or: % #2: + \MH_or: % #2: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\alignsep@}% - \or: % #3: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \fi:} -\def\find_displaywidth_ii:{\find_displaywidth_i:} + \MH_fi:} +\def\EQ_find_displaywidth_ii:{\EQ_find_displaywidth_i:} \def\EQ_place_display_i: {\EQ_use_mathdisplay:} \def\EQ_place_display_ii:{\EQ_place_display_i:} % \end{macrocode} @@ -2706,20 +2753,22 @@ and the derived files % \subsection{The \env{gather} Family} % This is a gem. Notice how easy it is once we got the framework for % it. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} \EQ_new_equationtype:nnn {EmphEqEnv}{gather}{3} \EQ_new_equationtype:nnn {EmphEqEnv}{gather*}{4} \def\EQ_modify_linewidth_iii:{} \def\EQ_modify_linewidth_iv:{\EQ_modify_linewidth_iii:} -\def\find_displaywidth_iii:{% +\def\EQ_find_displaywidth_iii:{% \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% - \if_case:w \l_EQ_alignmentmode_int \or: \or: % #1 & #2: - \or: % #3: + \MH_if_case:w \l_EQ_alignmentmode_int \MH_or: \MH_or: % #1 & #2: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \fi:} -\def\find_displaywidth_iv:{\find_displaywidth_iii:} + \MH_fi:} +\def\EQ_find_displaywidth_iv:{\EQ_find_displaywidth_iii:} \def\EQ_place_display_iii:{\EQ_use_mathdisplay:} \def\EQ_place_display_iv: {\EQ_place_display_iii:} % \end{macrocode} @@ -2770,35 +2819,37 @@ and the derived files % two cases. I made this choice because we need these adjustments % inside the adjustments for \env{flalign} and that makes it % incredibly difficult to see what happens. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\EQ_multline_modify_linewidth_tag:{% - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{% -\g_EQ_widesttag_dim-\multlinetaggap-\multlinegap}% - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{% -\g_EQ_widesttag_dim-\multlinetaggap-\multlinegap}% - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{% -\@mathmargin-\g_EQ_widesttag_dim-\multlinetaggap}% - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% - \fi: + \MH_fi: } \def\EQ_multline_modify_linewidth_notag:{% - \if_case:w \l_EQ_alignmentmode_int\or: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-2\multlinegap} - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-2\multlinegap} - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% - \fi: + \MH_fi: } % \end{macrocode} % \end{macro} @@ -2817,6 +2868,8 @@ and the derived files \MH_if_boolean:nTF {good_mult}{ % \end{macrocode} % The good: +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline}{gather} {\MH_set_boolean_T:n {outer_mult}} @@ -2825,51 +2878,51 @@ and the derived files \def\EQ_modify_linewidth_iii_mult:{ \setlength{\l_EQ_temp_linewidth_dim}{% \linewidth-\widthof{\EQ_outerbox:{}}}% - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \EQ_multline_modify_linewidth_tag: - \else: + \MH_else: \EQ_multline_modify_linewidth_notag: - \fi: + \MH_fi: \MH_setlength:dn \l_MT_multwidth_dim{\l_EQ_temp_linewidth_dim} } \def\EQ_modify_linewidth_iv_mult:{\EQ_modify_linewidth_iii_mult:} -\def\find_displaywidth_iii_mult:{% +\def\EQ_find_displaywidth_iii_mult:{% \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% - \if_case:w \l_EQ_alignmentmode_int \or: \or: % #1 & #2: - \or: % #3: + \MH_if_case:w \l_EQ_alignmentmode_int \MH_or: \MH_or: % #1 & #2: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \fi:} -\def\find_displaywidth_iv_mult:{\find_displaywidth_iii_mult:} + \MH_fi:} +\def\EQ_find_displaywidth_iv_mult:{\EQ_find_displaywidth_iii_mult:} \def\EQ_place_display_iii_mult:{ - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \abovedisplayshortskip=\abovedisplayskip \rlap{ \kern-.5\linewidth \kern\multlinegap \EQ_use_mathdisplay: } - \else: + \MH_else: \EQ_use_mathdisplay: - \fi: - \or: % #2: - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_fi: + \MH_or: % #2: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \llap{ \EQ_use_mathdisplay: \kern-.5\linewidth \kern\multlinegap }% - \else: + \MH_else: \EQ_use_mathdisplay: - \fi: - \or: % #3: + \MH_fi: + \MH_or: % #3: \EQ_use_mathdisplay: - \or: % #4: + \MH_or: % #4: \EQ_use_mathdisplay: - \fi: + \MH_fi: } \def\EQ_place_display_iv_mult: {\EQ_place_display_iii_mult:} % \end{macrocode} @@ -2891,9 +2944,10 @@ and the derived files % \end{verbatim} % If you scroll past this error it will be typeset correctly, but % how many users can fix this by themselves? +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \hskip1sp#2#3{{}#5}#4% - \if:w *#1\relax\else:\notag\fi:} + \MH_if:w *#1\relax\MH_else:\notag\MH_fi:} % \end{macrocode} % \end{macro} % \end{macro} @@ -2958,21 +3012,22 @@ and the derived files % \begin{macro}{\multlast} % If we're using the \mode{leqno} option, the equation number should % be placed in the first line. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\multfirst{% \MH_if_boolean:nTF {multlined}{ \def\EQ_next:{\EQ_multlined_left:n }% }{ - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \def\EQ_next:{\multleft}% - \or: % #2: + \MH_or: % #2: \def\EQ_next:{\multleft*}% - \or: % #3: + \MH_or: % #3: \def\EQ_next:{\multleft}% - \or: % #4: + \MH_or: % #4: \def\EQ_next:{\multleft*}% - \fi: + \MH_fi: } \EQ_next:} % \end{macrocode} @@ -2990,21 +3045,22 @@ and the derived files % \end{macrocode} % If we're using the \mode{reqno} option, the equation number % should be placed in the last line. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\multlast{% \MH_if_boolean:nTF {multlined}{ \def\EQ_next:{\EQ_multlined_right:n }% }{ - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \def\EQ_next:{\multright*}% - \or: % #2: + \MH_or: % #2: \def\EQ_next:{\multright}% - \or: % #3: + \MH_or: % #3: \def\EQ_next:{\multright*}% - \or: % #4: + \MH_or: % #4: \def\EQ_next:{\multright}% - \fi: + \MH_fi: } \EQ_next:} % \end{macrocode} @@ -3052,17 +3108,18 @@ and the derived files % \cs{EQ_multlined_III:w}, which sets \cs{multlinewidth} if % specified and calls \cs{start@aligned} (an \env{alignedat} with % three columns). -% \begin{macrocode} - \if:w t#1\relax \EQ_multlined_III:nn {#1}{#2}% - \else: - \if:w b#1\relax \EQ_multlined_III:nn {#1}{#2}% - \else: - \if:w c#1\relax \EQ_multlined_III:nn {#1}{#2}% - \else: +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} +% \begin{macrocode} + \MH_if:w t#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_else: + \MH_if:w b#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_else: + \MH_if:w c#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_else: \EQ_multlined_III:nn {#2}{#1}% - \fi: - \fi: - \fi: + \MH_fi: + \MH_fi: + \MH_fi: \mkern-\thinmuskip \EQ_next:} \def\EQ_multlined_III:nn #1#2{% @@ -3096,45 +3153,47 @@ and the derived files % \end{macrocode} % % \subsubsection{The Code for \env{flalign} \& \env{multline}} +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} \EQ_new_equationtype:nnn {EmphEqEnv}{flalign}{5} \EQ_new_equationtype:nnn {EmphEqEnv}{flalign*}{6} \def\EQ_modify_linewidth_v:{% \setlength{\l_EQ_temp_linewidth_dim}{% \linewidth-\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ \EQ_multline_modify_linewidth_tag: }{ - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \MH_addtolength:dn \l_EQ_temp_linewidth_dim {-\g_EQ_widesttag_dim-\mintagsep} - \or: % #2: + \MH_or: % #2: \MH_addtolength:dn \l_EQ_temp_linewidth_dim {-\g_EQ_widesttag_dim-\mintagsep}% - \or: % #3: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_temp_linewidth_dim {-\g_EQ_widesttag_dim-\mintagsep} - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_temp_linewidth_dim {-\@mathmargin} - \fi: + \MH_fi: } - \else: + \MH_else: \MH_if_boolean:nT {multline}{ \EQ_multline_modify_linewidth_notag: } - \fi:} + \MH_fi:} \def\EQ_modify_linewidth_vi:{\EQ_modify_linewidth_v:} -\def\find_displaywidth_v:{% +\def\EQ_find_displaywidth_v:{% \MH_setlength:dn \l_EQ_displaywidth_dim{\l_EQ_temp_linewidth_dim}} -\def\find_displaywidth_vi:{\find_displaywidth_v:} +\def\EQ_find_displaywidth_vi:{\EQ_find_displaywidth_v:} \def\EQ_place_display_v:{% - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ \rlap{\kern\multlinegap \kern-.5\linewidth \EQ_use_mathdisplay: @@ -3142,11 +3201,11 @@ and the derived files }{ \rlap{\kern-.5\linewidth\EQ_use_mathdisplay:}% } - \else: + \MH_else: \EQ_use_mathdisplay: - \fi: - \or: % #2: - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_fi: + \MH_or: % #2: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ \llap{\kern-\mintagsep \kern\multlinetaggap \EQ_use_mathdisplay: @@ -3154,19 +3213,19 @@ and the derived files }{ \llap{\EQ_use_mathdisplay:\kern-.5\linewidth}% } - \else: + \MH_else: \EQ_use_mathdisplay: - \fi: - \or: % #3: + \MH_fi: + \MH_or: % #3: \MH_if_boolean:nF {multline}{ \kern-\multlinetaggap } \EQ_use_mathdisplay: - \or: % #4: - \if_dim:w \g_EQ_widesttag_dim>\z@ - \else: + \MH_or: % #4: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_else: \MH_if_boolean:nF {multline}{ \kern-\@mathmargin } - \fi: + \MH_fi: \EQ_use_mathdisplay: - \fi: + \MH_fi: \MH_set_boolean_F:n {multline}} \def\EQ_place_display_vi:{\EQ_place_display_v:} % \end{macrocode} @@ -3174,22 +3233,24 @@ and the derived files % \subsection{The \env{alignat} Family} % This is just as easy as \env{gather}. Actually only one line is % different from \env{gather}! +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} \EQ_new_equationtype_arg:nnn {EmphEqEnv}{alignat}{7} \EQ_new_equationtype_arg:nnn {EmphEqEnv}{alignat*}{8} \def\EQ_modify_linewidth_vii:{} \def\EQ_modify_linewidth_viii:{\EQ_modify_linewidth_vii:} -\def\find_displaywidth_vii:{% +\def\EQ_find_displaywidth_vii:{% \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: - \or: % #2: - \or: % #3: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \MH_or: % #2: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\eqnshift@}% - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \fi:} -\def\find_displaywidth_viii:{\find_displaywidth_vii:} + \MH_fi:} +\def\EQ_find_displaywidth_viii:{\EQ_find_displaywidth_vii:} \def\EQ_place_display_vii:{\EQ_use_mathdisplay:} \def\EQ_place_display_viii:{\EQ_place_display_vii:} % \end{macrocode} @@ -3701,7 +3762,7 @@ and the derived files % Although \pkg{ntheorem} provides a lot of useful features it % does however ruin things in the \pkg{amsmath} environments, % because of the alternative syntax of its \cs{label} command. -% \begin{macro}{\default_raisetag} +% \begin{macro}{\EQ_default_raisetag} % \begin{macro}{\raisetag} % \begin{macro}{\raise@tag} % \changes{v1.06}{2004/03/13}{Fixed \pkg{amsmath} bug \# 3624} @@ -3709,13 +3770,15 @@ and the derived files % \url{http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=amslatex/3624}} % in \pkg{amsmath} that could cause tags to cross page boundaries % without warning. The \cs{nobreak} is the addition. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} -\def\default_raisetag:{\nobreak} +\def\EQ_default_raisetag:{\nobreak} \def\raisetag#1{ \skip@#1\relax - \xdef\raise@tag{\default_raisetag: - \vskip\iftagsleft@\else:-\fi:\the\skip@\relax}} -\MH_let:NwN\raise@tag\default_raisetag: + \xdef\raise@tag{\EQ_default_raisetag: + \vskip\iftagsleft@\MH_else:-\MH_fi:\the\skip@\relax}} +\MH_let:NwN\raise@tag\EQ_default_raisetag: % \end{macrocode} % \end{macro} % \end{macro} @@ -3723,10 +3786,11 @@ and the derived files % \begin{macro}{\displ@y@} % Patch it so that it doesn't set \cs{raise@tag} to \cs{@empty} % globally. +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} \def\displ@y@{\@display@init{% \global\column@\z@ \global\dspbrk@lvl\m@ne - \global\tag@false \global\MH_let:NwN\raise@tag\default_raisetag: + \global\tag@false \global\MH_let:NwN\raise@tag\EQ_default_raisetag: }} % \end{macrocode} % \end{macro} @@ -3757,18 +3821,20 @@ and the derived files \everycr{\noalign{\global\tag@false % \end{macrocode} % The patch for \cs{raisetag}. +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} - \global\MH_let:NwN\raise@tag\default_raisetag: + \global\MH_let:NwN\raise@tag\EQ_default_raisetag: \global\column@\z@}}% % \end{macrocode} % The patch for \cs{label}. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \MH_let:NwN\label\MT_gobblelabel:w \halign{% \setboxz@h{$\m@th\displaystyle{##}$}% - \if_dim:w \wdz@>\totwidth@ + \MH_if_dim:w \wdz@>\totwidth@ \global\totwidth@\wdz@ - \fi: + \MH_fi: &\setboxz@h{\strut@{##}}% \savetaglength@ \crcr @@ -3779,14 +3845,14 @@ and the derived files \restorecounters@ \if@fleqn \global\advance\totwidth@\@mathmargin - \fi: + \MH_fi: \iftagsleft@ - \if_dim:w \totwidth@>\displaywidth + \MH_if_dim:w \totwidth@>\displaywidth \global\MH_let:NwN\gdisplaywidth@\totwidth@ - \else: + \MH_else: \global\MH_let:NwN\gdisplaywidth@\displaywidth - \fi: - \fi: + \MH_fi: + \MH_fi: \endgroup } % \end{macrocode} @@ -3808,11 +3874,13 @@ and the derived files \everycr{\noalign{\global\tag@false % \end{macrocode} % The patch for \cs{raisetag}. +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} - \global\MH_let:NwN\raise@tag\default_raisetag: + \global\MH_let:NwN\raise@tag\EQ_default_raisetag: \global\column@\z@}}% % \end{macrocode} % The patch. +% \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} \MH_let:NwN\label\MT_gobblelabel:w \global\row@\z@ @@ -3827,43 +3895,43 @@ and the derived files \restorecounters@ \ifodd\maxfields@ \global\advance\maxfields@\@ne - \fi: - \if_num:w \xatlevel@=\tw@ - \if_num:w \maxfields@<\thr@@ + \MH_fi: + \MH_if_num:w \xatlevel@=\tw@ + \MH_if_num:w \maxfields@<\thr@@ \MH_let:NwN\xatlevel@\z@ - \fi: - \fi: + \MH_fi: + \MH_fi: \setbox\z@\vbox{% \unvbox\z@ \unpenalty \global\setbox\@ne\lastbox }% \global\totwidth@\wd\@ne - \if@fleqn \global\advance\totwidth@\@mathmargin \fi: + \if@fleqn \global\advance\totwidth@\@mathmargin \MH_fi: \global\MH_let:NwN\maxcolumn@widths\@empty \begingroup - \MH_let:NwN\or:\relax + \MH_let:NwN\MH_or:\relax \loop \global\setbox\@ne\hbox{% \unhbox\@ne \unskip \global\setbox\thr@@\lastbox }% \ifhbox\thr@@ - \xdef\maxcolumn@widths{ \or: \the\wd\thr@@ \maxcolumn@widths}% + \xdef\maxcolumn@widths{ \MH_or: \the\wd\thr@@ \maxcolumn@widths}% \repeat \endgroup \dimen@\displaywidth \advance\dimen@-\totwidth@ - \if_case:w \xatlevel@ + \MH_if_case:w \xatlevel@ \global\alignsep@\z@ \MH_let:NwN\minalignsep\z@ \@tempcntb\z@ \if@fleqn \@tempcnta\@ne \global\eqnshift@\@mathmargin - \else: + \MH_else: \@tempcnta\tw@ \global\eqnshift@\dimen@ \global\divide\eqnshift@\@tempcnta - \fi: - \or: + \MH_fi: + \MH_or: \@tempcntb\maxfields@ \divide\@tempcntb\tw@ \@tempcnta\@tempcntb @@ -3872,13 +3940,13 @@ and the derived files \global\eqnshift@\@mathmargin \global\alignsep@\dimen@ \global\divide\alignsep@\@tempcnta - \else: + \MH_else: \global\advance\@tempcnta\@ne \global\eqnshift@\dimen@ \global\divide\eqnshift@\@tempcnta \global\alignsep@\eqnshift@ - \fi: - \or: + \MH_fi: + \MH_or: \@tempcntb\maxfields@ \divide\@tempcntb\tw@ \global\advance\@tempcntb\m@ne @@ -3887,43 +3955,43 @@ and the derived files \global\alignsep@\dimen@ \if@fleqn \global\advance\alignsep@\@mathmargin\relax - \fi: + \MH_fi: \global\divide\alignsep@\@tempcntb - \fi: - \if_dim:w \alignsep@<\minalignsep\relax + \MH_fi: + \MH_if_dim:w \alignsep@<\minalignsep\relax \global\alignsep@\minalignsep\relax - \if_dim:w \eqnshift@>\z@ - \if@fleqn\else: + \MH_if_dim:w \eqnshift@>\z@ + \if@fleqn\MH_else: \global\eqnshift@\displaywidth \global\advance\eqnshift@-\totwidth@ \global\advance\eqnshift@-\@tempcntb\alignsep@ \global\divide\eqnshift@\tw@ - \fi: - \fi: - \fi: - \if_dim:w \eqnshift@<\z@ + \MH_fi: + \MH_fi: + \MH_fi: + \MH_if_dim:w \eqnshift@<\z@ \global\eqnshift@\z@ - \fi: + \MH_fi: \calc@shift@align \global\tagshift@\totwidth@ \global\advance\tagshift@\@tempcntb\alignsep@ \if@fleqn - \if_num:w \xatlevel@=\tw@ + \MH_if_num:w \xatlevel@=\tw@ \global\advance\tagshift@-\@mathmargin\relax - \fi: - \else: + \MH_fi: + \MH_else: \global\advance\tagshift@\eqnshift@ - \fi: - \iftagsleft@ \else: + \MH_fi: + \iftagsleft@ \MH_else: \global\advance\tagshift@-\displaywidth - \fi: + \MH_fi: \dimen@\minalignsep\relax \global\advance\totwidth@\@tempcntb\dimen@ - \if_dim:w \totwidth@>\displaywidth + \MH_if_dim:w \totwidth@>\displaywidth \global\MH_let:NwN\displaywidth@\totwidth@ - \else: + \MH_else: \global\MH_let:NwN\displaywidth@\displaywidth - \fi: + \MH_fi: \endgroup } % \end{macrocode} @@ -3960,26 +4028,28 @@ and the derived files \MH_let:NwN\tag\tag@in@align % \end{macrocode} % The patch for \cs{raisetag}. +% \changes{v2.15}{2017/03/31}{added EQ\_ prefix} % \begin{macrocode} - \global\tag@false \global\MH_let:NwN\raise@tag\default_raisetag: + \global\tag@false \global\MH_let:NwN\raise@tag\EQ_default_raisetag: \mmeasure@{#1}% \MH_let:NwN\tag\gobble@tag % \end{macrocode} % The patch. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \MH_let:NwN\label\MT_gobblelabel:w - \tabskip \if@fleqn \@mathmargin \else: \z@skip \fi: + \tabskip \if@fleqn \@mathmargin \MH_else: \z@skip \MH_fi: \totwidth@\displaywidth \if@fleqn \advance\totwidth@-\@mathmargin - \fi: + \MH_fi: \halign\bgroup \hbox to\totwidth@{% \if@fleqn \hskip \@centering \relax - \else: + \MH_else: \hfil - \fi: + \MH_fi: \strut@ $\m@th\displaystyle{}##\endmultline@math%$ \hfil @@ -3988,10 +4058,10 @@ and the derived files \if@fleqn \hskip-\@mathmargin \def\multline@indent{\hskip\@mathmargin}% put it back - \else: + \MH_else: \hfilneg \def\multline@indent{\hskip\multlinegap}% - \fi: + \MH_fi: \iftagsleft@ \iftag@ \begingroup @@ -4006,21 +4076,21 @@ and the derived files \raise@tag }}% \multline@indent - \else: + \MH_else: \setbox\z@\hbox{\make@display@tag}% \dimen@\@mathmargin \advance\dimen@-\wd\z@ - \if_dim:w \dimen@<\multlinetaggap + \MH_if_dim:w \dimen@<\multlinetaggap \dimen@\multlinetaggap - \fi: + \MH_fi: \box\z@ \hskip\dimen@\relax - \fi: + \MH_fi: \endgroup - \else: + \MH_else: \multline@indent - \fi: - \else: + \MH_fi: + \MH_else: \multline@indent - \fi: + \MH_fi: #1% } % \end{macrocode} @@ -4033,6 +4103,7 @@ and the derived files \measuring@true % \end{macrocode} % The patch. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\label##1{% \@ifnextchar[ @@ -4048,49 +4119,49 @@ and the derived files \halign{% \setboxz@h{\@lign$\m@th\displaystyle{}##$}% \iftagsleft@ - \if_num:w \row@=\@ne + \MH_if_num:w \row@=\@ne \global\totwidth@\wdz@ \global\lineht@\ht\z@ - \fi: - \else: + \MH_fi: + \MH_else: \global\totwidth@\wdz@ \global\lineht@\dp\z@ - \fi: + \MH_fi: \crcr #1% \crcr }% }% - \if_meaning:NN + \MH_if_meaning:NN \df@tag\@empty - \else: + \MH_else: \global\tag@true - \fi: - \if@eqnsw\global\tag@true\fi: + \MH_fi: + \if@eqnsw\global\tag@true\MH_fi: \iftag@ \setboxz@h{% \if@eqnsw \stepcounter{equation}% \tagform@\theequation - \else: + \MH_else: \df@tag - \fi: + \MH_fi: }% \global\tagwidth@\wdz@ \dimen@\totwidth@ \advance\dimen@\tagwidth@ \advance\dimen@\multlinetaggap - \iftagsleft@\else: + \iftagsleft@\MH_else: \if@fleqn \advance\dimen@\@mathmargin - \fi: - \fi: - \if_dim:w \dimen@>\displaywidth + \MH_fi: + \MH_fi: + \MH_if_dim:w \dimen@>\displaywidth \global\shifttag@true - \else: + \MH_else: \global\shifttag@false - \fi: - \fi: + \MH_fi: + \MH_fi: \restorecounters@ \endgroup } @@ -4171,6 +4242,7 @@ and the derived files % If the tags are set to the left we just have to lower the end mark % by the total depth of the display including its surrounding box. % Also we have to take care of \cs{normallineskip}. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \raisebox{-\normallineskip -\depthof{\EQ_outerbox:{}} @@ -4178,12 +4250,12 @@ and the derived files -\dp\EQ_mathdisplay_box -\ht\EQ_mathdisplay_box} [0pt][0pt]{\PotEndMark{\maketag@@@}}}} - \else: + \MH_else: \gdef\df@tag{% \raisebox{-\dp\EQ_mathdisplay_box -\depthof{\EQ_outerbox:{}}} {\PotEndMark{\maketag@@@}}}% - \fi:} + \MH_fi:} % \end{macrocode} % \changes{v2.00}{2004/04/14}{Fixed another bug in placement of the % marker} @@ -4205,6 +4277,7 @@ and the derived files % wrap the tag in a box of the correct size, namely |\widthof{##1}| % and then push the end mark to the right margin. Then the displayed % math is set correcly. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \hfuzz\displaywidth \makebox[\widthof{##1}][l]{% @@ -4212,7 +4285,7 @@ and the derived files \raisebox{-\dp\EQ_mathdisplay_box -\depthof{\EQ_outerbox:{}}} {\PotEndMark{\hss}}}}}% - \else: + \MH_else: \gdef\maketag@@@##1{% \hbox{\m@th\normalfont##1\llap{\hss\PotEndMark{% \settoheight{\@tempdima}{\@nameuse{\InTheoType Symbol}}% @@ -4221,24 +4294,25 @@ and the derived files \setlength{\@tempdimb} {\g_EQ_bottomrow_depth_dim+\depthof{\EQ_outerbox:{}} +\depthof{\EQ_innerbox:{}}} - \if_dim:w \@tempdima>\@tempdimb + \MH_if_dim:w \@tempdima>\@tempdimb \MH_setlength:dn \@tempdima{-\dp\EQ_mathdisplay_box -\@tempdima+\g_EQ_bottomrow_depth_dim} \addtolength{\@tempdima}{\depthof{\EQ_innerbox:{}}}% \def\EQ_next:{\raisebox{\@tempdima}}% - \else: + \MH_else: % \end{macrocode} % \changes{v1.06}{2004/03/13}{Fixed bug in placement of the marker % and re-arranged some code} % In v1.06 I fixed a stupid bug regarding placement of the marker. % If I had done a proper test I would have discovered it % immediately! +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\EQ_next:{ \raisebox{-\dp\EQ_mathdisplay_box -\depthof{\EQ_outerbox:{}}}}% - \fi:\EQ_next:}}}}% - \fi:} + \MH_fi:\EQ_next:}}}}% + \MH_fi:} % \end{macrocode} % \end{macro} % \end{macro} @@ -4251,21 +4325,22 @@ and the derived files % \end{macro} % \begin{macro}{\nonumber} % Redefine \cs{nonumber} to reset depth of bottom tag. +% \changes{v2.15}{2017/03/31}{added MH\_ prefixes} % \begin{macrocode} \def\g_EQ_latest_nonzerodepth_row_fint{\z@} \renewcommand*\nonumber{ \@tempcnta=\row@ - \if_num:w \l_EQ_equationtype_int=\thr@@ + \MH_if_num:w \l_EQ_equationtype_int=\thr@@ \advance\@tempcnta\m@ne - \else: - \if_num:w \l_EQ_equationtype_int=4\relax + \MH_else: + \MH_if_num:w \l_EQ_equationtype_int=4\relax \advance\@tempcnta\m@ne - \fi: - \fi: - \if_num:w \g_EQ_latest_nonzerodepth_row_fint=\@tempcnta - \else: + \MH_fi: + \MH_fi: + \MH_if_num:w \g_EQ_latest_nonzerodepth_row_fint=\@tempcnta + \MH_else: \global\g_EQ_bottomtag_depth_dim=-\baselineskip - \fi: + \MH_fi: \MT_nonumber: } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/mathtools/mathtools.dtx b/Master/texmf-dist/source/latex/mathtools/mathtools.dtx index 2405eba3b23..2aece4d7e72 100644 --- a/Master/texmf-dist/source/latex/mathtools/mathtools.dtx +++ b/Master/texmf-dist/source/latex/mathtools/mathtools.dtx @@ -68,7 +68,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: mathtools 2015/11/12 v1.18} +\Msg{* Package: mathtools 2017/05/24 v1.19} \Msg{************************************************************************} \keepsilent @@ -131,7 +131,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{mathtools.drv}% - [2015/11/12 v1.18 mathematical typesetting tools] + [2017/05/24 v1.19 mathematical typesetting tools] \documentclass{ltxdoc} \IfFileExists{fourier.sty}{\usepackage{fourier}}{} \addtolength\marginparwidth{-25pt} @@ -267,7 +267,9 @@ and the derived files \let\MTtheindex\theindex \def\theindex{\MTtheindex\MakePrivateLetters} -\usepackage[final,hyperindex=false]{hyperref} +\usepackage[final, +hyperindex=false, +]{hyperref} \renewcommand*\usage[1]{\textit{\hyperpage{#1}}} \OnlyDescription @@ -277,11 +279,13 @@ and the derived files %</driver> % \fi % +% \changes{v1.19}{2017/03/31}{Updated to match some macro renaming in +% \pkg{mhsetup}} % \changes{v1.0}{2004/07/26}{Initial release} % % \GetFileInfo{mathtools.drv} % -% \CheckSum{3174} +% \CheckSum{3146} % % \title{The \pkg{mathtools} package\thanks{This file has version number % \fileversion, last revised \filedate.}} @@ -292,10 +296,10 @@ and the derived files % \maketitle % % \begin{abstract} -% The \pkg{mathtools} package is an extension package to +% \noindent The \pkg{mathtools} package is an extension package to % \pkg{amsmath}. There are two things on \pkg{mathtools}' agenda: -% 1)~correct various bugs/defeciencies in \pkg{amsmath} until -% these are fixed by the \AmS{} and 2)~provide useful tools +% (1)~correct various bugs/defeciencies in \pkg{amsmath} until +% these are fixed by the \AmS{} and (2)~provide useful tools % for mathematical typesetting, be it a small macro for % typesetting a prescript or an underbracket, or entirely new % display math constructs such as a \env{multlined} environment. @@ -1357,6 +1361,11 @@ and the derived files % } % \end{verbatim} % +% \medskip\noindent +% \textbf{Caveat:} +% \CommentAdded{2017/05/22} +% \cs{shoveleft} and \cs{shoveright} does not work as expected if +% used as the last line in \env{multlined}. % % % \subsubsection{More \env{cases}-like environments} @@ -1606,7 +1615,7 @@ and the derived files % \end{alignat*} % % -% \subsubsection{Centered \cs{vdots}} +% \subsubsection{Centered \texorpdfstring{\cs{vdots}}{\textbackslash vdots}} % % If one want to mark a vertical continuation, there is % the \verb?\vdots? command, but combine this with an alignment and @@ -1774,6 +1783,7 @@ and the derived files % \textbf{Tip:} \cs{intertext} and \cs{shortintertext} also works % within \env{gather}. % +% % \subsection{Paired delimiters} % % @@ -2012,7 +2022,7 @@ and the derived files % \end{verbatim} % Thus giving support for \verb|\Prob{A \given B}|. % -% \medskip\noindent\textbf{Note:} As the number of arguments increase +% \medskip\noindent\textbf{Note 1:} As the number of arguments increase % the \cs{DeclarePairedDelimiter...} macros become hard for users to % understand. A key-value interface would be better. This is planed % for a future release. In @@ -2025,6 +2035,12 @@ and the derived files % obvious how to get \pkg{xparse} to support \verb|[3]| for the number % of arguments. We will consider this for a future release. % +% \medskip\noindent\textbf{Note 2:} If you want to define your own +% manual scaler macros, it is importent that you besides \cs{foo} also +% defines \cs{fool} and \cs{foor}. When a scaler is specified, in say +% \cs{abs[\cs{big}]}\marg{arg}, we actually use \cs{bigl} and \cs{bigr}. +% +% % \subsubsection{Expert use} % % Within the starred version of \cs{DeclarePairedDelimiter} and @@ -2035,26 +2051,44 @@ and the derived files % '$\sin$' and '('. In some special cases it may be useful to be % able to tinker with the behavior. % \begin{codesyntax} -% \SpecialUsageIndex{\reDeclarePairedDelimiterInnerWrapper}\cs{reDeclarePairedDelimiterInnerWrapper}\marg{macro name}\marg{\textnormal{\texttt{star}} or \textnormal{\texttt{nostar}}}\marg{code} +% \SpecialUsageIndex{\reDeclarePairedDelimiterInnerWrapper}\cs{reDeclarePairedDelimiterInnerWrapper}\marg{macro name}\marg{\textnormal{\texttt{star}} or \textnormal{\texttt{nostarnonscaled}} or \textnormal{\texttt{nostarscaled}}}\marg{code} % \end{codesyntax} -% Internally several macros are created, including two call backs +% Internally several macros are created, including three call backs % that take care of the formatting. There is one internal macro for -% the starred version, labeled \texttt{star}, the other one is -% labeled \texttt{nostar}. Within \meta{code}, \texttt{\#1} will be -% replaced by the scaled left fence, \texttt{\#3} the corresponding -% scaled right fence, and \texttt{\#2} the stuff in between. For -% example, here is how one might turn the content into \cs{mathinner}: +% the starred version, labeled \texttt{star}, the other two are +% labeled \texttt{nostarnonscaled} and \texttt{nostarscaled}. Within +% \meta{code}, \texttt{\#1} will be replaced by the (scaled) left +% fence, \texttt{\#3} the corresponding (scaled) right fence, and +% \texttt{\#2} the stuff in between. For example, here is how one +% might turn the content into \cs{mathinner}: % \begin{verbatim} % \DeclarePairedDelimiter\abs\lvert\rvert % \reDeclarePairedDelimiterInnerWrapper\abs{star}{#1#2#3} -% \reDeclarePairedDelimiterInnerWrapper\abs{nostar}{\mathinner{#1#2#3}} +% \reDeclarePairedDelimiterInnerWrapper\abs{nostarnonscaled}{\mathinner{#1#2#3}} +% \reDeclarePairedDelimiterInnerWrapper\abs{nostarscaled}{\mathinner{#1#2#3}} % \end{verbatim} % The default values for the call backs corresponds to % \begin{verbatim} -% star: \mathopen{}\mathclose\bgroup #1#2\aftergroup\egroup #3 -% nostar: \mathopen{#1}#2\mathclose{#3} +% star: \mathopen{}\mathclose\bgroup #1#2\aftergroup\egroup #3 +% nostarnonscaled: \mathopen#1#2\mathclose#3 +% nostarscaled: \mathopen{#1}#2\mathclose{#3} % \end{verbatim} -% +% The two \texttt{nostar...} versions look the same, but they are +% not. In most (math) fonts, the first item in this list will be +% different from the rest (the superscript sits +% higher).\footnote{Interestingly it dod not show up in the font of +% this manual, which uses the \pkg{fourier} font set.} +% \begin{verbatim} +% \mathclose{\rvert}^2\mathclose\rvert^2\rvert^2 +% \end{verbatim} +% +% +% \bigskip\noindent \textbf{Breaking change:} Prior to May 2017, we +% used two wrappers, the other named \texttt{nostar}. As of May 2017 +% \texttt{nostar} has been split into \texttt{nostarnonscaled} and +% \texttt{nostarscaled} and \texttt{nostar} alone is no longer +% supported (will give an error). +% % \bigskip\noindent \textbf{Note:} Since we are using macros to add % the \verb|\left...\right| constructions around some body, it % \emph{is} (in principle) possible to make such a construction @@ -2679,13 +2713,13 @@ and the derived files % \begin{macrocode} %<*package> \ProvidesPackage{mathtools}% - [2015/11/12 v1.18 mathematical typesetting tools] + [2017/05/24 v1.19 mathematical typesetting tools] % \end{macrocode} % \changes{v1.10}{2011/02/12}{Might as well make sure that we need the % latest version of \texttt{mhsetup}} % \begin{macrocode} \RequirePackage{keyval,calc} -\RequirePackage{mhsetup}[2010/01/21] +\RequirePackage{mhsetup}[2017/03/31] \MHInternalSyntaxOn % \end{macrocode} % \changes{v1.13}{2013/02/11}{Robustifying \cs{(}\cs{)}\cs{[}\cs{]}} @@ -2811,7 +2845,7 @@ and the derived files % We have to turn off the new syntax when \pkg{amstext} is loaded. % \begin{macrocode} \MHInternalSyntaxOff -\RequirePackage{amsmath}[2000/07/18] +\RequirePackage{amsmath}[2016/11/05] \MHInternalSyntaxOn \AtEndOfPackage{\MHInternalSyntaxOff} % \end{macrocode} @@ -2968,14 +3002,15 @@ and the derived files % so do not let the tag have width zero. Rememeber % \cs{@safe@activestrue/false} in order to handle active chars in labels. % \changes{v1.12}{2012/04/24}{Added \cs{@safe@activestrue/false}} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_meaning:NN \df@label\@empty + \MH_if_meaning:NN \df@label\@empty \MH_if_boolean:nTF {manual_tag}% this was \MH_if_boolean:nT before { \MH_if_boolean:nTF {show_manual_tags} { \MT_prev_tagform:n {#1} } { \stepcounter{equation} } }{\kern1sp}% this last {\kern1sp} is new. - \else: + \MH_else: \MH_if_boolean:nTF {manual_tag} { \MH_if_boolean:nTF {show_manual_tags} { \MT_prev_tagform:n {#1} } @@ -2988,6 +3023,7 @@ and the derived files % referred to. % \changes{v1.12}{2011/06/08}{Added the falsification of manual tag % when show manual tags is off and maual tag is not referred to} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} { \global\MH_set_boolean_F:n {manual_tag} } { \MT_prev_tagform:n {#1} } @@ -3001,7 +3037,7 @@ and the derived files { \refstepcounter{equation}\MT_prev_tagform:n {#1} } \@safe@activesfalse } - \fi: + \MH_fi: \global\MH_set_boolean_T:n {raw_maketag} } % \end{macrocode} @@ -3009,11 +3045,12 @@ and the derived files % \begin{macro}{\MT_extended_maketag:n} % The extended version of \cs{maketag@@@}. % \changes{v1.12}{2012/04/24}{Added \cs{@safe@activestrue/false}} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \def\MT_extended_maketag:n #1{ \ifx\df@label\@empty \MT_maketag:n {#1} - \else: + \MH_else: \MH_if_boolean:nTF {raw_maketag} { \MH_if_boolean:nTF {show_manual_tags} @@ -3026,7 +3063,7 @@ and the derived files } } { \MT_maketag:n {#1} } - \fi: + \MH_fi: % \end{macrocode} % As this function is always called we let it set the marker for a manual % tag false when exiting (well actually not true, see above). @@ -3084,15 +3121,16 @@ and the derived files \newcommand*\MT@newlabel[1]{ \global\@namedef{MT_r_#1}{} } % \end{macrocode} % \end{macro} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \MH_new_boolean:n {show_only_refs} \MH_new_boolean:n {show_manual_tags} \define@key{\MT_options_name:}{showmanualtags}[true]{ - \@ifundefined{boolean_show_manual_tags_#1:} + \@ifundefined{MH_boolean_show_manual_tags_#1:} { \MT_true_false_error: - \@nameuse{boolean_show_manual_tags_false:} + \@nameuse{MH_boolean_show_manual_tags_false:} } - { \@nameuse{boolean_show_manual_tags_#1:} } + { \@nameuse{MH_boolean_show_manual_tags_#1:} } } % \end{macrocode} % \begin{macro}{\MT_showonlyrefs_true:} @@ -3158,17 +3196,19 @@ and the derived files % equation number where we don't want it. This is probably not needed % since \cs{nonumber} is unnecessary when \key{showonlyrefs} is in % effect, but now you can use it with old documents as well. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \renewcommand\nonumber{ \if@eqnsw - \if_meaning:NN \incr@eqnum\@empty + \MH_if_meaning:NN \incr@eqnum\@empty % \end{macrocode} % Only subtract the number if |show_only_refs| is false. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \MH_if_boolean:nF {show_only_refs} {\addtocounter{equation}\m@ne} - \fi: - \fi: + \MH_fi: + \MH_fi: \MH_let:NwN \print@eqnum\@empty \MH_let:NwN \incr@eqnum\@empty \global\@eqnswfalse } @@ -3186,7 +3226,7 @@ and the derived files % to \cs{nocite}. % \begin{macrocode} \MHInternalSyntaxOff -\newcommand\noeqref[1]{\@bsphack +\newcommand\noeqref[1]{\@bsphack% \@for\@tempa:=#1\do{% \@safe@activestrue% \edef\@tempa{\expandafter\@firstofone\@tempa}% @@ -3197,7 +3237,7 @@ and the derived files }{}% \if@filesw\protected@write\@auxout{}% {\string\MT@newlabel{\@tempa}}\fi% - \@safe@activesfalse} + \@safe@activesfalse}% \@esphack} % \end{macrocode} @@ -3585,25 +3625,26 @@ and the derived files % \begin{macro}{\MT_test_for_tcb_other:nnnnn} % This tests if the token(s) is/are equal to either t, c, or~b, or % something entirely different. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \newcommand*\MT_test_for_tcb_other:nnnnn [1]{ - \if:w t#1\relax + \MH_if:w t#1\relax \expandafter\MH_use_choice_i:nnnn - \else: - \if:w c#1\relax + \MH_else: + \MH_if:w c#1\relax \expandafter\expandafter\expandafter\MH_use_choice_ii:nnnn - \else: - \if:w b#1\relax + \MH_else: + \MH_if:w b#1\relax \expandafter\expandafter\expandafter \expandafter\expandafter\expandafter\expandafter \MH_use_choice_iii:nnnn - \else: + \MH_else: \expandafter\expandafter\expandafter \expandafter\expandafter\expandafter\expandafter \MH_use_choice_iv:nnnn - \fi: - \fi: - \fi: + \MH_fi: + \MH_fi: + \MH_fi: } % \end{macrocode} % \end{macro} @@ -3612,20 +3653,23 @@ and the derived files % \textbf{BUG:} \cs{baselineskip} is zero inside an array or matrix, % thus in those cases the line is \emph{not} invisible. % \changes{v1.14}{2014/05/21}{Added -\cs{jot}} +% \changes{v1.19}{2017/05/24}{Removed -\cs{jot} again, do not +% remember why we added it in the first place} % \begin{macrocode} \def\MT_mult_invisible_line: { \crcr \global\MH_set_boolean_F:n {mult_firstline} \hbox to \l_MT_multwidth_dim{}\crcr - \noalign{\vskip-\baselineskip \vskip-\jot \vskip-\normallineskip} + \noalign{\vskip-\baselineskip \vskip-\normallineskip} } % \end{macrocode} % \end{macro} % \begin{macro}{\MT_mult_mathcr_atat:w} % The normal \cs{math@cr@@} with our hooks. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \def\MT_mult_mathcr_atat:w [#1]{% - \if_num:w 0=`{\fi: \iffalse}\fi: + \MH_if_num:w 0=`{\MH_fi: \iffalse}\MH_fi: \MH_if_boolean:nT {mult_firstline}{ \kern\l_MT_mult_left_fdim \MT_mult_invisible_line: @@ -3633,9 +3677,9 @@ and the derived files \crcr \noalign{\vskip#1\relax} \global\advance\g_MT_multlinerow_int\@ne - \if_num:w \g_MT_multlinerow_int=\l_MT_multline_lastline_fint + \MH_if_num:w \g_MT_multlinerow_int=\l_MT_multline_lastline_fint \MH_let:NwN \math@cr@@\MT_mult_last_mathcr:w - \fi: + \MH_fi: } % \end{macrocode} % \end{macro} @@ -3643,9 +3687,10 @@ and the derived files % The special case where there is a two-line \env{multlined}. We % insert the first kern, then the invisible line of the desired % width, the optional vertical space and then the last kern. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \def\MT_mult_firstandlast_mathcr:w [#1]{% - \if_num:w 0=`{\fi: \iffalse}\fi: + \MH_if_num:w 0=`{\MH_fi: \iffalse}\MH_fi: \kern\l_MT_mult_left_fdim \MT_mult_invisible_line: \noalign{\vskip#1\relax} @@ -3655,9 +3700,10 @@ and the derived files % \end{macro} % \begin{macro}{\MT_mult_last_mathcr:w} % The normal last \cs{math@cr@@} which inserts the last kern. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \def\MT_mult_last_mathcr:w [#1]{ - \if_num:w 0=`{\fi: \iffalse}\fi:\math@cr@@@ + \MH_if_num:w 0=`{\MH_fi: \iffalse}\MH_fi:\math@cr@@@ \noalign{\vskip#1\relax} \kern\l_MT_mult_right_fdim} % \end{macrocode} @@ -3700,9 +3746,11 @@ and the derived files % \begin{macro}{\MT_mult_internal:n} % \changes{v1.01a}{2004/10/10}{Added Ord atom to beginning of each line} % The real internal \env{multlined}. +% \changes{v1.19}{2017/05/22}{Added \cs{alignedspace@left} instead of +% \cs{null}\cs{,}} % \begin{macrocode} \newcommand*\MT_mult_internal:n [1]{ - \MH_if_boolean:nF {outer_mult}{\null\,} + \MH_if_boolean:nF {outer_mult}{\alignedspace@left} %<-- requires amsmath 2016/11/05 \MT_next: \bgroup % \end{macrocode} @@ -3727,18 +3775,20 @@ and the derived files \MT_measure_mult:n {#1} % \end{macrocode} % Make sure the box is wide enough. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_dim:w \l_MT_multwidth_dim<\l_MT_multline_measure_fdim + \MH_if_dim:w \l_MT_multwidth_dim<\l_MT_multline_measure_fdim \MH_setlength:dn \l_MT_multwidth_dim{\l_MT_multline_measure_fdim} \fi \MH_set_boolean_T:n {mult_firstline} % \end{macrocode} % Tricky bit: If we only encountered one \cmd{\\} then use a very % special \cs{math@cr@@} that inserts everything needed. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_num:w \l_MT_multline_lastline_fint=\@ne + \MH_if_num:w \l_MT_multline_lastline_fint=\@ne \MH_let:NwN \math@cr@@ \MT_mult_firstandlast_mathcr:w - \fi: + \MH_fi: % \end{macrocode} % Do the typesetting. % \begin{macrocode} @@ -3779,6 +3829,7 @@ and the derived files % \end{macro} % \begin{macro}{\MT_multlined_second_arg:w} % Scan for a second optional argument. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \MaybeMHPrecedingSpacesOff \newcommand*\MT_multlined_second_arg:w [1][\@empty]{ @@ -3787,10 +3838,10 @@ and the derived files {\def\MT_mult_default_pos:{#1}} {\def\MT_mult_default_pos:{#1}} { - \if_meaning:NN \@empty#1\@empty - \else: + \MH_if_meaning:NN \@empty#1\@empty + \MH_else: \setlength \l_MT_multwidth_dim{#1} - \fi: + \MH_fi: } \MT_start_mult:N \MT_mult_default_pos: } @@ -3812,7 +3863,7 @@ and the derived files \renewenvironment{subarray}[1]{% \vcenter\bgroup \Let@ \restore@math@cr \default@tag - \let\math@cr@@\AMS@math@cr@@ + \let\math@cr@@\AMS@math@cr@@ % <--- the fix \baselineskip\fontdimen10 \scriptfont\tw@ \advance\baselineskip\fontdimen12 \scriptfont\tw@ \lineskip\thr@@\fontdimen8 \scriptfont\thr@@ @@ -3830,6 +3881,7 @@ and the derived files % \begin{environment}{multlined} % The user environment. Scan for an optional argument. % \changes{v1.18}{2015/11/12}{Added \cs{MultlinedHook}} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \newenvironment{multlined}[1][] {\MH_group_align_safe_begin: @@ -3839,10 +3891,10 @@ and the derived files {\def\MT_mult_default_pos:{#1}} {\def\MT_mult_default_pos:{#1}} { - \if_meaning:NN \@empty#1\@empty - \else: + \MH_if_meaning:NN \@empty#1\@empty + \MH_else: \setlength \l_MT_multwidth_dim{#1} - \fi: + \MH_fi: } \MT_multlined_second_arg:w } @@ -3897,30 +3949,81 @@ and the derived files \@namedef{MT_delim_\MH_cs_to_str:N #1 _star_wrapper:nnn}##1##2##3{ \mathopen{}\mathclose\bgroup ##1 ##2 \aftergroup\egroup ##3 } - \@namedef{MT_delim_\MH_cs_to_str:N #1 _nostar_wrapper:nnn}##1##2##3{ +% \end{macrocode} +% Turns out that there is a difference between \verb|\mathclose{)}| +% and \verb|\mathclose)| (placement of for example superscript), so instead of two wrappers, we need three. +% \changes{v1.19}{2017/05/22}{added \cs{...nostarnonscaled..} wrapper} +% \changes{v1.19}{2017/05/22}{renamed \cs{...nostar..} to \cs{...nostarscaled..} } +% \begin{macrocode} + \@namedef{MT_delim_\MH_cs_to_str:N #1 _nostarscaled_wrapper:nnn}##1##2##3{ \mathopen{##1}##2\mathclose{##3} } + \@namedef{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn}##1##2##3{ + \mathopen##1##2\mathclose##3 + } } % \end{macrocode} % \end{macro} % % \begin{macro}{\reDeclarePairedDelimiterInnerWrapper} -% Macro enabling the user to alter an existing call back. Note that -% currently no checks are performed. First argument is the name of -% the macro we are altering (as defined via \cs{DeclarePaired...}), -% the second is \texttt{star} or \texttt{nostar}. In the last +% Macro enabling the user to alter an existing call back. First +% argument is the name of the macro we are altering (as defined via +% \cs{DeclarePaired...}), the second is \texttt{star}, +% \texttt{nostarnonscaled} or \texttt{nostarscaled}. In the last % argument \texttt{\#1} and \texttt{\#3} respectively refer to the -% scaled fences and \texttt{\#3} refer to whatever come between. +% scaled fences and \texttt{\#2} refer to whatever come between. +% \changes{v1.19}{2017/05/23}{Added a test and error} % \begin{macrocode} \newcommand\reDeclarePairedDelimiterInnerWrapper[3]{ - \@namedef{MT_delim_\MH_cs_to_str:N #1 _ #2 _wrapper:nnn}##1##2##3{ - #3 + \@ifundefined{MT_delim_\MH_cs_to_str:N #1 _ #2 _wrapper:nnn}{ + \PackageError{mathtools}{ + Wrapper~not~found~for~\string#1~and~option~'#2'.\MessageBreak + Either~\string#1~is~ not~ defined,~or~ you~ are~using~ the~ + \MessageBreak + 'nostar'~ option,~which~ is~ no~ longer~ supported.~ + \MessageBreak + Please~ use~ 'nostarnonscaled'~ or~ 'nostarscaled~ + \MessageBreak instead.~ + }{See the manual} + }{ + \@namedef{MT_delim_\MH_cs_to_str:N #1 _ #2 _wrapper:nnn}##1##2##3{ + #3 + } } } % \end{macrocode} % +% \begin{macro}{\MT_etb_ifdefempty_x:nnn} +% \begin{macro}{\MT_etb_ifblank:nnn} +% \changes{v1.19}{2017/05/23}{Added so we can test for empty args} +% This is a copy of \cs{etb@ifdefempty} (it is \emph{not} the same +% as \cs{ifdefempty}) and \cs{ifblank} from \pkg{etoolbox}, +% currently we do not want to make \pkg{etoolbox} a requirement, +% that may change in the future. We need a reliable method to check +% whether a macro is blank or not (including spaces). +% \begin{macrocode} +\def\MT_etb_ifdefempty_x:nnn #1{ + \expandafter\expandafter\expandafter + \MT_etb_ifblank:nnn + \expandafter\expandafter\expandafter{% + \expandafter\strip@prefix\meaning#1} +} +\def\MT_etb_ifblank:nnn #1{ + \expandafter\ifx\expandafter\relax\detokenize\expandafter{\@gobble#1?}\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} + + +% \end{macrocode} +% \end{macro} +% \end{macro} +% % +% % \end{macro} % \begin{macro}{\DeclarePairedDelimiter} % \changes{v1.06}{2008/08/01}{Made user command robust} @@ -3934,12 +4037,11 @@ and the derived files % before the delimiters, wrapped in a callback function. % \changes{1.08e}{2010/09/02}{`Fixed' \cs{left}\dots\cs{right} bad spacing} % \changes{1.08e}{2010/09/14}{redid the \cs{left}\dots\cs{right} fix, -% see \cs{DeclarePairedDelimiterX} for details.} +% see \cs{DeclarePairedDelimiterXPP} for details.} % \changes{v1.13}{2012/05/10}{Using call back instead} % \begin{macrocode} - \MT_delim_default_inner_wrappers:n{#1} + \MT_delim_default_inner_wrappers:n{#1} % define the wrappers \@namedef{MT_delim_\MH_cs_to_str:N #1 _star:}##1 - %{\mathopen{}\mathclose\bgroup\left#2 ##1 \aftergroup\egroup\right #3}% { \@nameuse{MT_delim_\MH_cs_to_str:N #1 _star_wrapper:nnn}% {\left#2}{##1}{\right#3} }% % \end{macrocode} @@ -3955,13 +4057,39 @@ and the derived files % With the default optional argument we wind up with \cs{relax}, % else we get \cs{biggr} and \cs{biggl} etc. % \changes{v1.13}{2012/05/10}{Using call back instead} -% \begin{macrocode} - %\mathopen{\@nameuse {\MH_cs_to_str:N ##1 l} #2} ##2 - %\mathclose{\@nameuse {\MH_cs_to_str:N ##1 r} #3}} - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_wrapper:nnn}% - {\@nameuse {\MH_cs_to_str:N ##1 l} #2} - {##2} - {\@nameuse {\MH_cs_to_str:N ##1 r} #3} +% \changes{v1.19}{2017/05/23}{Split the wrappers in two, so know +% \cs{}\cs{@gobble} is now only used to check if the optional +% argument is empty.} +% \begin{macrocode} + \def\@tempa{\\@gobble} + \def\@tempb{##1} + \ifx\@tempa\@tempb +% \end{macrocode} +% As of May 2017, we now run explicit wrapper in the nonscaled +% version, so we can remove the feature to to add l and r version of +% the scaler (as there is none). +% \begin{macrocode} + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn}% + {#2} + {##2} + {#3} + \else +% \end{macrocode} +% Next we need to check whether \texttt{\#\#1} is blank as that +% should not be scaled +% \begin{macrocode} + \MT_etb_ifblank:nnn {##1}{ + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn}% + {#2} + {##2} + {#3} + }{ + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarscaled_wrapper:nnn}% + {\@nameuse {\MH_cs_to_str:N ##1 l} #2} + {##2} + {\@nameuse {\MH_cs_to_str:N ##1 r} #3} + } + \fi } % \end{macrocode} % The user command comes here. Just check for the star and choose @@ -3977,24 +4105,159 @@ and the derived files % \end{macrocode} % \end{macro} % -% \begin{macro}{\DeclarePairedDelimiterX} -% \changes{v1.08}{2010/06/10}{Added \cs{DeclarePairedDelimiterX}} -% It has turned out that it is convenient to have a more general -% version of \cs{DeclarePairedDelimiter}. In this version the user -% can specify the number of arguments the created macro has, and they -% can specify the code for the inner part of the macro. Other than -% that the code is fairly similar to \cs{DeclarePairedDelimiter} -% \changes{v1.08e}{2010/09/02}{Provided better implementation of -% \cs{DeclarePairedDelimiterX}} +% \begin{macro}{\MT_paired_delimx_arg_test:n} +% This tests the \oarg{num args} part of +% \cs{DeclarePairedDelimiterX} and \cs{DeclarePairedDelimiterXPP} +% (code reuse), and complains if it is not 1,\dots,9. +% \changes{v1.14}{2014/05/20}{Added} % \begin{macrocode} -\def\MHempty{} -\def\DeclarePairedDelimiterX#1[#2]#3#4#5{% +\def\MT_paired_delimx_arg_test:n #1{ + \ifnum#1>9\relax + \PackageError{mathtools}{No~ more~ than~ 9~ arguments}{} + \else + \ifnum#1<1\relax + \PackageError{mathtools}{Macro~ need~ 1~ or~ more~ + arguments.\MessageBreak Please~ change~ [#1]~ to~ [1]~ ... [9]}{} + \fi + \fi + } + +% \end{macrocode} +% \end{macro} +% \begin{macro}{\MT_delim_inner_generator:n..n} +% \changes{v1.19}{2017/05/14}{Macro added, changes notes in the +% implementation are taken from when this code was not factored out} +% This generates the internal macro from +% \cs{DeclarePairedDelimiterX} and \cs{DeclarePairedDelimiterXPP} +% that handles the non-starred part of the generated macro. The +% macro takes 7 arguments mimicing the arguments of +% \cs{DeclarePairedDelimiterXPP}: +% \begin{enumerate}\setlength\itemsep{0pt} +% \item external macro name +% \item number of arguments, 1-9, already checked at this stage +% \item predata +% \item left scaler +% \item right scaler +% \item postdata +% \item body +% \end{enumerate} +% +% \begin{macrocode} +\def\@MHempty{} +\newcommand\MT_delim_inner_generator:nnnnnnn [7]{ +% \end{macrocode} +% In order for the starred and non-starred version of +% \cs{DeclarePairedDelimiterX(PP)} to have the same arguments, we need +% to introduce an extra macro to catch the optional argument (this +% means that the non-starred version can actually support ten +% arguments!). Here we do things a little differently than with +% \cs{DeclarePairedDelimiter}. The optional argument have +% \cs{@MHempty} as the default. This was earlier locally redefined to +% eat l/r additions to the scaler when there were no scaler. In this +% implementation, we just look for that macro to see if no scaler has +% been given at all. +% \begin{macrocode} + \@xp\@xp\@xp + \newcommand + \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar_inner:\endcsname + [#2] + { +% \end{macrocode} +% Add the (possibly empty) precode: +% \begin{macrocode} + #3 +% \end{macrocode} +% Next we provide the inner workhorse. We need a bit of expansion +% magic to get \cs{delimsize} to work. +% \changes{v1.13}{2012/05/10}{Using call backs for \cs{mathopen} and +% \cs{mathclose} additions} +% \changes{v1.19}{2017/04/27}{Added resetting code for \cs{@MHempty}, +% cannot rely on groups here. 2017/05/23 removed because of reimplementation} +% +% May 2017: Due to \verb+\mathclose{|}^2+ generally not being equal to +% \verb+\mathclose|^2+ we needed to split the wrapper macro into +% separate nonscaled and scaled versions. This also have the benefit +% of completely eliminating the need to gobble any chars. There is now +% the nonscaled version, which we do not add any scalers to and the +% manually scaled version where we \emph{know} there is a scaler. The +% complication is now that we need to be able to check for blank +% input, thus the including of a few macros from \pkg{etoolbox}. +% \changes{v1.19}{2017/05/23}{Split into two wrappers and some tests} +% First we need to look at \cs{delimsize} to see if it is equal to +% \cs{@MHempty}. If it is run the nonscaled version. +% \begin{macrocode} + \def\@tempa{\@MHempty} + \@xp\def\@xp\@tempb\@xp{\delimsize} + \ifx\@tempa\@tempb + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn} + {#4}{#7}{#5} + \else +% \end{macrocode} +% Next we use a copy of a macro from \pkg{etoolbox} to determine +% whether \cs{delimsize} is empty or not. This is to be sure that +% \verb|\abs[]| and similar still end up in the unscaled branch. +% \begin{macrocode} + \MT_etb_ifdefempty_x:nnn {\delimsize}{ + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn} + {#4}{#7}{#5} + }{ +% \end{macrocode} +% In the scaled version we add features to convert til scaler to its +% l/r versions. +% \begin{macrocode} + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarscaled_wrapper:nnn} + { + \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #4 + } + {#7} + { + \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #5 + } + } + \fi +% \end{macrocode} +% Add the (possibly empty) post code +% \begin{macrocode} + #6 + \endgroup + } +} + +% \end{macrocode} +% +% \end{macro} +% \begin{macro}{\DeclarePairedDelimiterXPP} +% \changes{v1.19}{2017/05/24}{Rewritten as we might as well +% implement ...X via ...XPP} It turns out it is useful to have a +% more general version of \cs{DeclarePairedDelimiter} where we can +% access the body and perhaps even add stuff on the outside of the +% fences. Historically, we added \cs{DeclarePairedDelimiterX} first, +% giving access to the body and the most general +% \cs{DeclarePairedDelimiterXPP} was requested after that, thus +% ending up with two macros so not to break existing document. As of +% May 2017, since \cs{DeclarePairedDelimiterX} is just +% \cs{DeclarePairedDelimiterXPP} with no pre- or postcode, we will +% use this update to just define \cs{DeclarePairedDelimiterXPP} and +% define \cs{DeclarePairedDelimiterX} from that. +% +% The arguments for \cs{DeclarePairedDelimiterXPP} are interpreted +% as +% \begin{center} +% \marg{macroname}\oarg{num~args}\allowbreak\marg{pre~code}\allowbreak\marg{left +% delim}\goodbreak \marg{right delim}\marg{post code}\marg{body} +% \end{center} +% Inside \marg{body} \cs{delimsize} +% refers to the current size of the scaler (\cs{middle} in the starred version). +% \begin{macrocode} +\def\DeclarePairedDelimiterXPP#1[#2]#3#4#5#6#7{% \@ifdefinable{#1}{ % \end{macrocode} % The constructor takes five arguments, the name of the macro, the % number of arguments (1-9), the left and right delimiter, the inner % code for the two macros. First we verify that the number of arguments fit. -% \changes{v1.14}{2014/05/20}{Factored out in separate macro for reuse} +% \changes{v1.14}{2014/05/20}{Factored out in separate macro +% (\cs{MT_paired_delimx_arg_test:n}) for reuse. Comment refers back to +% old \cs{DeclarePairedDelimiterX} implementation.} % \begin{macrocode} \MT_paired_delimx_arg_test:n{#2} % \end{macrocode} @@ -4004,7 +4267,7 @@ and the derived files \MT_delim_default_inner_wrappers:n{#1} % \end{macrocode} % We make sure to store the delimiter size in the local variable -% \cs{delimsize}. Then users can refer to the size in the fifth +% \cs{delimsize}. Then users can refer to the size in the \marg{body} % argument. In the starred version it will refer to \cs{middle} and in % the normal version it will hold the provided optional argument. % \begin{macrocode} @@ -4016,6 +4279,10 @@ and the derived files \begingroup \def\delimsize{\middle} % \end{macrocode} +% Adding the \marg{precode} (possibly empty) +% \begin{macrocode} + #3 +% \end{macrocode} % This is slightly controversial, \cs{left}\dots\cs{right} are known % to produce an inner atom, thus may cause different spacing than % normal delimiters. We `fix' this by introducing \cs{mathopen} and @@ -4025,63 +4292,42 @@ and the derived files % started 2010-08-12.} % \changes{v1.13}{2012/05/10}{Using call back instead} % \begin{macrocode} - %\mathopen{}\mathclose\bgroup\left#3 #5 \aftergroup\egroup\right#4 \@nameuse{MT_delim_\MH_cs_to_str:N #1 _star_wrapper:nnn} - {\left#3}{#5}{\right#4} + {\left#4}{#7}{\right#5} + #6 \endgroup } % \end{macrocode} % In order for the starred and non-starred version to have the same % arguments, we need to introduce an extra macro to catch the optional % argument (this means that the non-starred version can actually -% support ten arguments!). -% Here we do things a little differently than with -% \cs{DeclarePairedDelimiter}. The optional argument have \cs{MHempty} -% as the default. This is locally changed when we scale the -% delimiters, such that it can eat the l/r if needed. +% support ten arguments!). % \begin{macrocode} \@xp\@xp\@xp \newcommand \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname - [1][\MHempty] + [1][\@MHempty] { % \end{macrocode} % We need to introduce a local group in order to support nesting. It -% is ended inside \verb|\MT_delim_\MH_cs_to_str:N #1 _nostar_inner:| +% is ended inside \verb|\MT_delim_\MH_cs_to_str:N #1 _nostar_inner:|, +% here we also stores the scaler in \cs{delimsize}. % \begin{macrocode} \begingroup \def\delimsize{##1} \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_inner:} - } + } % \end{macrocode} -% Next we provide the inner workhorse. We need a bit of expansion -% magic to get \cs{delimsize} to work. -% \changes{v1.13}{2012/05/10}{Using call back instead} +% To make the code easier to work with we factored the next macro +% out. Since \cs{DeclarePairedDelimiterX} is now implemented via +% \cs{DeclarePairedDelimiterXPP} we did not need to. But it makes the +% code a bit simpler. \cs{MT_delim_inner_generator:nnnnnnn} just +% takes care of generating the appropriate \cs{..._nostar_inner:} macro. +% \begin{macrocode} + \MT_delim_inner_generator:nnnnnnn {#1}{#2}{#3}{#4}{#5}{#6}{#7} +% \end{macrocode} +% At the end, generate the actual user command. % \begin{macrocode} - \@xp\@xp\@xp - \newcommand - \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar_inner:\endcsname - [#2] - { - %\mathopen{% - % \let\MHempty\@gobble - % \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #3} - %#5 - %\mathclose{% - % \let\MHempty\@gobble - % \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #4} - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_wrapper:nnn} - { - \let\MHempty\@gobble - \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #3 - } - {#5} - { - \let\MHempty\@gobble - \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #4 - } - \endgroup - } \DeclareRobustCommand{#1}{ \@ifstar {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} @@ -4089,90 +4335,24 @@ and the derived files } } } -% \end{macrocode} -% \end{macro} -% \begin{macro}{\MT_paired_delimx_arg_test:n} -% This tests the \oarg{num args} part of -% \cs{DeclarePairedDelimiterX} and \cs{DeclarePairedDelimiterXPP} -% (code reuse), and complains if it is not 1,\dots,9. -% \changes{v1.14}{2014/05/20}{Added} -% \begin{macrocode} -\def\MT_paired_delimx_arg_test:n #1{ - \ifnum#1>9\relax - \PackageError{mathtools}{No~ more~ than~ 9~ arguments}{} - \else - \ifnum#1<1\relax - \PackageError{mathtools}{Macro~ need~ 1~ or~ more~ - arguments.\MessageBreak Please~ change~ [#1]~ to~ [1]~ ... [9]}{} - \fi - \fi - } % \end{macrocode} % \end{macro} -% \begin{macro}{\DeclarePairedDelimiterXPP} -% \changes{v1.14}{2014/05/20}{Added} -% Similar to \cs{DeclarePairedDelimiterX}, but we can add \meta{pre} -% and \meta{pre} code before and after the delimiters. Arguments are -% interpreted as -% \marg{macro}\oarg{num}\marg{pre code}\marg{left delim}\marg{right -% delim}\marg{post code}\marg{body} +% \begin{macro}{\DeclarePairedDelimiterX} +% \changes{v1.08}{2010/06/10}{Added +% \cs{DeclarePairedDelimiterX}. 2017/05/24: old comment, kept for +% historic reasons.} +% \changes{v1.08e}{2010/09/02}{Provided better implementation of +% \cs{DeclarePairedDelimiterX}. 2017/05/24: old comment, kept for +% historic reasons.} +% As of May 2017, this is now just a call to \cs{DeclarePairedDelimiterXPP}. % \begin{macrocode} -\def\DeclarePairedDelimiterXPP#1[#2]#3#4#5#6#7{% - \@ifdefinable{#1}{ - \MT_paired_delimx_arg_test:n{#2} - \MT_delim_default_inner_wrappers:n{#1} - \@xp\@xp\@xp - \newcommand - \@xp\csname MT_delim_\MH_cs_to_str:N #1 _star:\endcsname - [#2] - { - \begingroup - \def\delimsize{\middle} - #3 - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _star_wrapper:nnn} - {\left#4}{#7}{\right#5} - #6 - \endgroup - } - \@xp\@xp\@xp - \newcommand - \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname - [1][\MHempty] - { - \begingroup - \def\delimsize{##1} - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_inner:} - } - \@xp\@xp\@xp - \newcommand - \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar_inner:\endcsname - [#2] - { - #3 - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_wrapper:nnn} - { - \let\MHempty\@gobble - \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #4 - } - {#7} - { - \let\MHempty\@gobble - \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #5 - } - #6 - \endgroup - } - \DeclareRobustCommand{#1}{ - \@ifstar - {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} - {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar:}} - } - } +\def\DeclarePairedDelimiterX#1[#2]#3#4#5{ + \DeclarePairedDelimiterXPP{#1}[#2]{}{#3}{#4}{}{#5} } - % \end{macrocode} % \end{macro} +% % @@ -4485,88 +4665,94 @@ and the derived files % \end{macrocode} % Check if A is \cs{mathop}. If it is, we know that B is the argument % of the \cs{mathop}. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_meaning:NN \MT_smop_arg_A: \MT_smop_mathop:n + \MH_if_meaning:NN \MT_smop_arg_A: \MT_smop_mathop:n % \end{macrocode} % If A was \cs{mathop} we check if C is \cs{limits} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_meaning:NN \MT_smop_arg_C:\MT_smop_limits: + \MH_if_meaning:NN \MT_smop_arg_C:\MT_smop_limits: \def\MT_smop_final_arg_A:{#1{#2}}% % \end{macrocode} % Now we have something like \verb|\mathop{TTT}\limits|. Then check % if D is \cs{@nil}. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_meaning:NN \MT_smop_arg_D: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_D: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_one} \MH_let:NwN \MT_smop_final_arg_B: \MT_smop_arg_D: \MH_let:NwN \MT_smop_final_arg_C: \MT_smop_arg_E: - \if_meaning:NN \MT_smop_arg_F: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_F: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_two} \MH_let:NwN \MT_smop_final_arg_D: \MT_smop_arg_F: \edef\MT_smop_final_arg_E: {\expandafter\MT_smop_remove_nil_vi:N \MT_smop_arg_G: } - \fi: - \fi: - \else: + \MH_fi: + \MH_fi: + \MH_else: % \end{macrocode} % Here we have something like \verb|\mathop{TTT}|. Still check % if D is \cs{@nil}. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \def\MT_smop_final_arg_A:{#1{#2}}% - \if_meaning:NN \MT_smop_arg_D: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_D: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_one} \MH_let:NwN \MT_smop_final_arg_B: \MT_smop_arg_C: \MH_let:NwN \MT_smop_final_arg_C: \MT_smop_arg_D: - \if_meaning:NN \MT_smop_arg_F: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_F: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_two} \MH_let:NwN \MT_smop_final_arg_D: \MT_smop_arg_E: \MH_let:NwN \MT_smop_final_arg_E: \MT_smop_arg_F: - \fi: - \fi: - \fi: + \MH_fi: + \MH_fi: + \MH_fi: % \end{macrocode} % If A was not \cs{mathop}, it is an operator in itself, so we check % if B is \cs{limits} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \else: - \if_meaning:NN \MT_smop_arg_B:\MT_smop_limits: + \MH_else: + \MH_if_meaning:NN \MT_smop_arg_B:\MT_smop_limits: \def\MT_smop_final_arg_A:{#1}% - \if_meaning:NN \MT_smop_arg_D: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_D: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_one} \MH_let:NwN \MT_smop_final_arg_B: \MT_smop_arg_C: \MH_let:NwN \MT_smop_final_arg_C: \MT_smop_arg_D: - \if_meaning:NN \MT_smop_arg_F: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_F: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_two} \MH_let:NwN \MT_smop_final_arg_D: \MT_smop_arg_E: \MH_let:NwN \MT_smop_final_arg_E: \MT_smop_arg_F: - \fi: - \fi: - \else: + \MH_fi: + \MH_fi: + \MH_else: % \end{macrocode} % No \cs{limits} was found, so we already have the right input. Just % forget about the last two arguments. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \def\MT_smop_final_arg_A:{#1}% - \if_meaning:NN \MT_smop_arg_C: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_C: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_one} \MH_let:NwN \MT_smop_final_arg_B: \MT_smop_arg_B: \MH_let:NwN \MT_smop_final_arg_C: \MT_smop_arg_C: - \if_meaning:NN \MT_smop_arg_D: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_D: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_two} \MH_let:NwN \MT_smop_final_arg_D: \MT_smop_arg_D: \MH_let:NwN \MT_smop_final_arg_E: \MT_smop_arg_E: - \fi: - \fi: - \fi: - \fi: + \MH_fi: + \MH_fi: + \MH_fi: + \MH_fi: % \end{macrocode} % No reason to measure if there's no sub or sup. % \begin{macrocode} @@ -4680,10 +4866,11 @@ and the derived files % as we have no need for the combination % $(\cs{displaystyle},\cs{textstyle})$ etc. Only % $(\cs{scriptstyle},\cs{scriptstyle})$ is useful. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_dim:w \@tempdima>\z@ + \MH_if_dim:w \@tempdima>\z@ \mathop{#1}\limits#2{#3} - \else: + \MH_else: \mathop{#1\MT_vphantom:Nn \displaystyle{#4}}\limits #2{ \def\finsm@sh{\ht\z@\z@ \box\z@} @@ -4691,8 +4878,8 @@ and the derived files \MT_vphantom:Nn \scriptstyle {\MT_cramped_internal:Nn \scriptstyle{#6}} } - \fi: - \if_dim:w \@tempdima>\z@ + \MH_fi: + \MH_if_dim:w \@tempdima>\z@ \mathop{#4\MT_vphantom:Nn \displaystyle{#1}}\limits #5 { @@ -4701,9 +4888,9 @@ and the derived files \def\finsm@sh{\ht\z@\z@ \box\z@} \mathsm@sh\scriptstyle{\MT_cramped_internal:Nn \scriptstyle{#6}} } - \else: + \MH_else: \mathop{#4}\limits#5{#6} - \fi: + \MH_fi: } % \end{macrocode} % \end{macro} @@ -5068,6 +5255,8 @@ and the derived files % test not only \cs{linewidth} against \cs{columnwidth} but also if % \cs{@totalleftmargin} is not zero. The implementation used is due to % David Carlisle. +% \changes{v1.19}{2016/05/26}{Added \cs{ignorespaces} after +% \cs{noindent}, bug inherited from \pkg{amsmath}} % \begin{macrocode} \ifdim \ifdim\@totalleftmargin=\z@ @@ -5078,17 +5267,32 @@ and the derived files =\columnwidth \else \parshape\@ne \@totalleftmargin \linewidth \fi - \noindent##1\par}% + \noindent\ignorespaces##1\par}% \penalty\predisplaypenalty\vskip\abovedisplayskip% \vskip-\lineskiplimit % CCS \vskip\normallineskiplimit % CCS \vskip\l_MT_above_intertext_sep }% -}} + }% % \end{macrocode} -% And provide a key to switch +% We might as well hook on to this and only activate +% \cs{shortintertext} whenever \cs{intertext} is active. This allows +% us to get the same error messages as \cs{intertext}. +% \changes{v1.19}{2017/03/31}{Added} % \begin{macrocode} -\def\MT_orig_intertext_true: { \MH_let:NwN \intertext@ \MT_orig_intertext: } + \MH_let:NwN \shortintertext \shortintertext@ +} +% \end{macrocode} +% And provide a key to switch +% \changes{v1.19}{2017/03/31}{Changed \cs{MT_orig_intertext_true:}} +% Changed \cs{MT_orig_intertext_true:} to also activate +% \cs{shortintertext}, because when this is active, our change to +% \cs{intertext@} is not active. +% \begin{macrocode} +\def\MT_orig_intertext_true: { + \MH_let:NwN \intertext@ \MT_orig_intertext: + \MH_let:NwN \shortintertext \shortintertext@ +} \def\MT_orig_intertext_false: { \MH_let:NwN \intertext@ \MT_intertext: } \define@key{\MT_options_name:}{original-intertext}[true]{ \@nameuse{MT_orig_intertext_#1:} @@ -5124,18 +5328,21 @@ and the derived files % \end{macrocode} % \changes{v1.17}{2015/06/17}{Added extra `in list' check} % Same comment as for \cs{intertext} above. +% \changes{v1.19}{2016/05/26}{Added \cs{ignorespaces} after +% \cs{noindent}, bug inherited from \pkg{amsmath}} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_dim:w - \if_dim:w \@totalleftmargin=\z@ + \MH_if_dim:w + \MH_if_dim:w \@totalleftmargin=\z@ \linewidth - \else: + \MH_else: -\maxdimen - \fi: + \MH_fi: =\columnwidth - \else: + \MH_else: \parshape\@ne \@totalleftmargin \linewidth - \fi: - \noindent#1\par}% + \MH_fi: + \noindent\ignorespaces#1\par}% \penalty\predisplaypenalty\vskip\abovedisplayshortskip% }% } @@ -5189,29 +5396,43 @@ and the derived files % \end{macrocode} % \changes{v1.17}{2015/06/17}{Added extra `in list' check} % Same comment as for \cs{intertext} above. +% \changes{v1.19}{2016/05/26}{Added \cs{ignorespaces} after +% \cs{noindent}, bug inherited from \pkg{amsmath}} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_dim:w - \if_dim:w \@totalleftmargin=\z@ + \MH_if_dim:w + \MH_if_dim:w \@totalleftmargin=\z@ \linewidth - \else: + \MH_else: -\maxdimen - \fi: + \MH_fi: =\columnwidth - \else: + \MH_else: \parshape\@ne \@totalleftmargin \linewidth - \fi: - \noindent#1\par}% + \MH_fi: + \noindent\ignorespaces#1\par}% \penalty\predisplaypenalty\vskip\abovedisplayshortskip% \vskip-\lineskiplimit \vskip\normallineskiplimit \vskip\l_MT_below_shortintertext_sep }% -} +} % \end{macrocode} % Next we need to be able to switch. +% \changes{v1.19}{2017/03/31}{Changed \cs{shortintertext} to be +% internal here.} +% \begin{macrocode} +\def\MT_orig_shortintertext_true: { \MH_let:NwN \shortintertext@ \MT_orig_shortintertext:n } +\def\MT_orig_shortintertext_false: { \MH_let:NwN \shortintertext@ \MT_shortintertext:n } +% \end{macrocode} +% Next make \cs{shortintertext} a no-go everywhere. Thus \cs{shortintertext} is only +% available when \cs{intertext} is, or when +% \verb+original-intertext=true+ is used. +% \changes{v1.19}{2017/03/31}{Added} +% \begin{macrocode} +\newcommand{\shortintertext}{\@amsmath@err{\Invalid@@\shortintertext}\@eha} +% \end{macrocode} % \begin{macrocode} -\def\MT_orig_shortintertext_true: { \MH_let:NwN \shortintertext \MT_orig_shortintertext:n } -\def\MT_orig_shortintertext_false: { \MH_let:NwN \shortintertext \MT_shortintertext:n } \define@key{\MT_options_name:}{original-shortintertext}[true]{ \@nameuse{MT_orig_shortintertext_#1:} } @@ -5466,14 +5687,15 @@ and the derived files \newcommand{\MT_prescript_inner:}[4]{ % \end{macrocode} % Put the sup in box 0 and the sub in box 2. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \@mathmeasure\z@#4{\MT_prescript_sup:{#1}} \@mathmeasure\tw@#4{\MT_prescript_sub:{#2}} - \if_dim:w \wd\tw@>\wd\z@ + \MH_if_dim:w \wd\tw@>\wd\z@ \setbox\z@\hbox to\wd\tw@{\hfil\unhbox\z@} - \else: + \MH_else: \setbox\tw@\hbox to\wd\z@{\hfil\unhbox\tw@} - \fi: + \MH_fi: % \end{macrocode} % Do not let a preceding mathord symbol approach without any % intervening space. @@ -5532,13 +5754,14 @@ and the derived files % only provide the fix for older kernels. % \changes{v1.18}{2015/11/12}{This was now moved into the kernel, thus % we only provide it for older kernels} +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \ifx\e@alloc\@undefined% kernel thus older than 2015 \def\@DeclareMathSizes #1#2#3#4#5{% \@defaultunits\dimen@ #2pt\relax\@nnil - \if:w $#3$% + \MH_if:w $#3$% \MH_let:cN {S@\strip@pt\dimen@}\math@fontsfalse - \else: + \MH_else: \@defaultunits\dimen@ii #3pt\relax\@nnil \@defaultunits\@tempdima #4pt\relax\@nnil \@defaultunits\@tempdimb #5pt\relax\@nnil @@ -5549,7 +5772,7 @@ and the derived files \gdef\noexpand\ssf@size{\strip@pt\@tempdimb}% \the\toks@ }% - \fi: + \MH_fi: } \fi % \end{macrocode} @@ -5572,6 +5795,7 @@ and the derived files % Save the original meaning if you need to go back (note that this % does not save the robust part of the macro, we fix this later on by % rerobustifying). +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \MH_if_boolean:nTF {robustify}{ \MH_let:NwN \MT_mathic_redeffer: \DeclareRobustCommand @@ -5583,37 +5807,40 @@ and the derived files \MT_mathic_redeffer:*\({ \relax\ifmmode\@badmath\else \ifhmode - \if_dim:w \fontdimen\@ne\font>\z@ + \MH_if_dim:w \fontdimen\@ne\font>\z@ % \end{macrocode} % We have a small problem here, if the user use >>\verb|text~\(|<< then % the italic correction is lost due to the penalty (see \cite{TBT}, % section 4.3.3). However, we \emph{know} what \verb|~| does, a % (positive) penalty and a skip. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_dim:w \lastskip>\z@ + \MH_if_dim:w \lastskip>\z@ \skip@\lastskip\unskip % \end{macrocode} % \changes{v1.15}{2014/07/16}{Added penalty workaround} % Here is the fix. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_num:w \lastpenalty>\z@ + \MH_if_num:w \lastpenalty>\z@ \count@\lastpenalty\unpenalty - \fi: + \MH_fi: \@@italiccorr % \end{macrocode} % \changes{v1.15}{2014/07/16}{Added penalty workaround} % And here it is inserted again. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_num:w \count@>\z@ + \MH_if_num:w \count@>\z@ \penalty\count@ - \fi: + \MH_fi: \hskip\skip@ - \else: + \MH_else: \@@italiccorr - \fi: - \fi: - \fi: - $\fi: + \MH_fi: + \MH_fi: + \MH_fi: + $\MH_fi: } } } @@ -5767,29 +5994,31 @@ and the derived files % supported/described in the documentation anymore so new users % won't know about it and b)~it forbids the use of \cs{tag} % anyway. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \if@fleqn - \if_num:w \xatlevel@=\tw@ + \MH_if_num:w \xatlevel@=\tw@ \kern-\@mathmargin - \fi: - \fi: + \MH_fi: + \MH_fi: % \end{macrocode} % End of additions. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if:w 1\shift@tag\row@\relax + \MH_if:w 1\shift@tag\row@\relax \rlap{\vbox{% \normalbaselines \boxz@ \vbox to\lineht@{}% \raise@tag }}% - \else: + \MH_else: \rlap{\boxz@}% - \fi: + \MH_fi: \kern\displaywidth@ - \else: + \MH_else: \kern-\tagshift@ - \if:w 1\shift@tag\row@\relax + \MH_if:w 1\shift@tag\row@\relax \llap{\vtop{% \raise@tag \normalbaselines @@ -5798,10 +6027,10 @@ and the derived files \box\@ne \boxz@ }}% - \else: + \MH_else: \llap{\boxz@}% - \fi: - \fi: + \MH_fi: + \MH_fi: } % \end{macrocode} % \end{macro} @@ -5816,31 +6045,34 @@ and the derived files % <recently read> \@tempcntb % \end{verbatim} % when in \mode{fleqn,leqno} mode. Not very comprehensible for the user. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} \def\x@calc@shift@lf{% - \if_dim:w \eqnshift@=\z@ + \MH_if_dim:w \eqnshift@=\z@ \global\eqnshift@\@mathmargin\relax \alignsep@\displaywidth \advance\alignsep@-\totwidth@ % \end{macrocode} % The addition: If \cs{@tempcntb} is zero we avoid division. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_num:w \@tempcntb=0 - \else: + \MH_if_num:w \@tempcntb=0 + \MH_else: \global\divide\alignsep@\@tempcntb % original line - \fi: + \MH_fi: % \end{macrocode} % Addition end. +% \changes{v1.19}{2017/03/31}{Added MH\_ prefix} % \begin{macrocode} - \if_dim:w \alignsep@<\minalignsep\relax + \MH_if_dim:w \alignsep@<\minalignsep\relax \global\alignsep@\minalignsep\relax - \fi: - \fi: - \if_dim:w \tag@width\row@>\@tempdima + \MH_fi: + \MH_fi: + \MH_if_dim:w \tag@width\row@>\@tempdima \saveshift@1% - \else: + \MH_else: \saveshift@0% - \fi:}% + \MH_fi:}% % \end{macrocode} % \end{macro} % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/mathtools/mhsetup.dtx b/Master/texmf-dist/source/latex/mathtools/mhsetup.dtx index d1fe0bcb154..ffd0833dbaa 100644 --- a/Master/texmf-dist/source/latex/mathtools/mhsetup.dtx +++ b/Master/texmf-dist/source/latex/mathtools/mhsetup.dtx @@ -1,6 +1,7 @@ % \iffalse meta-comment % % Copyright (C) 2002-2007,2010 by Morten Hoegholm +% Copyright (C) 2017 by Lars Madsen % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -12,8 +13,7 @@ % % This work has the LPPL maintenance status "maintained". % -% This Current Maintainer of this work is -% Lars Madsen, Will Robertson and Joseph Wright. +% This Current Maintainer of this work is Lars Madsen <daleif@math.au.dk> % % This work consists of the main source file mhsetup.dtx % and the derived files @@ -67,7 +67,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: mhsetup 2010/01/21 v1.2a mhsetup} +\Msg{* Package: mhsetup 2017/03/31 v1.3 mhsetup} \Msg{************************************************************************} \keepsilent @@ -78,6 +78,7 @@ This is a generated file. Copyright (C) 2002-2007,2010 by Morten Hoegholm +Copyright (C) 2017 by Lars Madsen This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -89,8 +90,7 @@ LaTeX version 2005/12/01 or later. This work has the LPPL maintenance status "maintained". -This Current Maintainer of this work is -Lars Madsen, Will Robertson and Joseph Wright. +This Current Maintainer of this work is Lars Madsen <daleif@math.au.dk> This work consists of the main source file mhsetup.dtx and the derived files @@ -128,7 +128,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{mhsetup.drv}% - [2010/01/21 v1.2a programming setup (MH)] + [2017/03/31 v1.3 programming setup (MH)] \documentclass{ltxdoc} \usepackage{mhsetup} @@ -163,18 +163,18 @@ and the derived files % % \title{The \pkg{mhsetup} package\thanks{This package has version % number \fileversion, last revised on \filedate.}} -% \author{Morten H\o gholm} +% \author{Morten H\o gholm (maintained by Lars Madsen)} % \date{\filedate} % \maketitle % % \begin{abstract} -% The \pkg{mhsetup} package provides tools for a \LaTeX{} +% \noindent The \pkg{mhsetup} package provides tools for a \LaTeX{} % programming environment similar to the one described in % \texttt{expl3} on \textsc{ctan} although not as extensive. It is % a required part of both the \pkg{mathtools} and \pkg{empheq} % packages. % \end{abstract} -% +% \noindent % The description below was made before the extensive changes made to % the expl3 code available from the LaTeX Project website. % @@ -297,7 +297,7 @@ and the derived files % \begin{macrocode} %<*package> \ProvidesPackage{mhsetup}% - [2010/01/21 v1.2a programming setup (MH)] + [2017/03/31 v1.3 programming setup (MH)] % \end{macrocode} % \subsection{The new internal syntax} % \begin{macro}{\MHInternalSyntaxOn} @@ -372,14 +372,14 @@ and the derived files % \cs{MH_new_boolean:n} \marg{name} % \end{quote} % defines the boolean \meta{name} but also the conditional -% \cs{if_boolean_\meta{name}:} to be used in the ordinary +% \cs{MH_if_boolean_\meta{name}:} to be used in the ordinary % \begin{tabbing} % \mbox{}\quad\= \kill -% \cs{if_boolean_\meta{name}:}\\ +% \cs{MH_if_boolean_\meta{name}:}\\ % \> \meta{true code} \\ -% \cs{else:} \\ +% \cs{MH_else:} \\ % \> \meta{false code} \\ -% \cs{fi:} +% \cs{MH_fi:} % \end{tabbing} % There is also a more ``\LaTeX-like'' interface available by using % the commands @@ -397,17 +397,17 @@ and the derived files % \end{quote} % This is the interface I have used in this package. % -% Initially \cs{if_boolean_\meta{name}:} is `false'. This can be +% Initially \cs{MH_if_boolean_\meta{name}:} is `false'. This can be % changed by saying % \begin{tabbing} % \quad \= \LaTeX:\quad \= \kill -% \> \TeX: \> \cs{boolean_\meta{name}_true:} \quad \emph{or}\\ +% \> \TeX: \> \cs{MH_boolean_\meta{name}_true:} \quad \emph{or}\\ % \> \LaTeX: \> \cs{MH_set_boolean_T:n}\marg{name} % \end{tabbing} % and changed back again by % \begin{tabbing} % \quad \= \LaTeX:\quad \= \kill -% \> \TeX: \> \cs{boolean_\meta{name}_false:} \quad \emph{or}\\ +% \> \TeX: \> \cs{MH_boolean_\meta{name}_false:} \quad \emph{or}\\ % \> \LaTeX: \> \cs{MH_set_boolean_F:n}\marg{name} % \end{tabbing} % @@ -415,38 +415,39 @@ and the derived files % \cs{fi} now. That way a simple search and replace will be all that % is needed for this package to be a certified \LaTeX3 package (well, % maybe a little more is needed, but not much). +% \changes{v1.3}{2017/03/31}{Prefixed with MH\_} % \begin{macrocode} \def\MH_new_boolean:n #1{ - \expandafter\@ifdefinable\csname if_boolean_#1:\endcsname{ - \@namedef{boolean_#1_true:} - {\MH_let:cN{if_boolean_#1:}\iftrue} - \@namedef{boolean_#1_false:} - {\MH_let:cN{if_boolean_#1:}\iffalse} - \@nameuse{boolean_#1_false:}% + \expandafter\@ifdefinable\csname MH_if_boolean_#1:\endcsname{ + \@namedef{MH_boolean_#1_true:} + {\MH_let:cN{MH_if_boolean_#1:}\iftrue} + \@namedef{MH_boolean_#1_false:} + {\MH_let:cN{MH_if_boolean_#1:}\iffalse} + \@nameuse{MH_boolean_#1_false:}% } } -\def\MH_set_boolean_F:n #1{ \@nameuse{boolean_#1_false:} } -\def\MH_set_boolean_T:n #1{ \@nameuse{boolean_#1_true:} } +\def\MH_set_boolean_F:n #1{ \@nameuse{MH_boolean_#1_false:} } +\def\MH_set_boolean_T:n #1{ \@nameuse{MH_boolean_#1_true:} } \def\MH_if_boolean:nTF #1{ - \@nameuse{if_boolean_#1:} + \@nameuse{MH_if_boolean_#1:} \expandafter\@firstoftwo - \else: + \MH_else: \expandafter\@secondoftwo - \fi: + \MH_fi: } \def\MH_if_boolean:nT #1{ - \@nameuse{if_boolean_#1:} + \@nameuse{MH_if_boolean_#1:} \expandafter\@firstofone - \else: + \MH_else: \expandafter\@gobble - \fi: + \MH_fi: } \def\MH_if_boolean:nF #1{ - \@nameuse{if_boolean_#1:} + \@nameuse{MH_if_boolean_#1:} \expandafter\@gobble - \else: + \MH_else: \expandafter\@firstofone - \fi: + \MH_fi: } % \end{macrocode} % \end{macro} @@ -456,37 +457,38 @@ and the derived files % \end{macro} % \end{macro} % -% \begin{macro}{\if:w} +% \changes{v1.3}{2017/03/31}{Prefixed all with MH\_} +% \begin{macro}{\MH_if:w} % \changes{v1.0b}{2004/10/10}{Use different test} -% \begin{macro}{\if_meaning:NN} +% \begin{macro}{\MH_if_meaning:NN} % \changes{v1.0b}{2004/10/10}{Use different test} -% \begin{macro}{\else:} +% \begin{macro}{\MH_else:} % \changes{v1.0b}{2004/10/10}{Use different test} -% \begin{macro}{\fi:} +% \begin{macro}{\MH_fi:} % \changes{v1.0b}{2004/10/10}{Use different test} -% \begin{macro}{\if_num:w} +% \begin{macro}{\MH_if_num:w} % \changes{v1.0b}{2004/10/10}{Use different test} % \changes{v1.2a}{2010/01/21}{Define at start of document} -% \begin{macro}{\if_dim:w} +% \begin{macro}{\MH_if_dim:w} % \changes{v1.0b}{2004/10/10}{Use different test} % \changes{v1.2a}{2010/01/21}{Define at start of document} -% \begin{macro}{\if_case:w} +% \begin{macro}{\MH_if_case:w} % \changes{v1.0b}{2004/10/10}{Use different test} % \changes{v1.2a}{2010/01/21}{Define at start of document} -% \begin{macro}{\or:} +% \begin{macro}{\MH_or:} % \changes{v1.0b}{2004/10/10}{Use different test} % Copies of \TeX{} primitives. % \begin{macrocode} -\@ifundefined{if:w}{\MH_let:NwN \if:w =\if}{} -\@ifundefined{if_meaning:NN}{\MH_let:NwN \if_meaning:NN =\ifx}{} -\@ifundefined{else:}{\MH_let:NwN \else:=\else}{} -\@ifundefined{fi:}{\MH_let:NwN \fi:=\fi}{} +\@ifundefined{MH_if:w}{\MH_let:NwN \MH_if:w =\if}{} +\@ifundefined{MH_if_meaning:NN}{\MH_let:NwN \MH_if_meaning:NN =\ifx}{} +\@ifundefined{MH_else:}{\MH_let:NwN \MH_else:=\else}{} +\@ifundefined{MH_fi:}{\MH_let:NwN \MH_fi:=\fi}{} \AtBeginDocument{ - \@ifundefined{if_num:w}{\MH_let:NwN \if_num:w =\ifnum}{} - \@ifundefined{if_dim:w}{\MH_let:NwN \if_dim:w =\ifdim}{} - \@ifundefined{if_case:w}{\MH_let:NwN \if_case:w =\ifcase}{} + \@ifundefined{MH_if_num:w}{\MH_let:NwN \MH_if_num:w =\ifnum}{} + \@ifundefined{MH_if_dim:w}{\MH_let:NwN \MH_if_dim:w =\ifdim}{} + \@ifundefined{MH_if_case:w}{\MH_let:NwN \MH_if_case:w =\ifcase}{} } -\@ifundefined{or:}{\MH_let:NwN \or:=\or}{} +\@ifundefined{MH_or:}{\MH_let:NwN \MH_or:=\or}{} % \end{macrocode} % \end{macro} % \end{macro} @@ -568,6 +570,7 @@ and the derived files % \begin{macro}{\MH_nospace_testopt:nn} % \begin{macro}{\MH_nospace_protected_testopt:n} % Scanning for the next character but disallow spaces. +% \changes{v1.3}{2017/03/31}{Added MH\_ prefix to several \cs{if...} macros} % \begin{macrocode} \long\def\MH_nospace_ifnextchar:Nnn #1#2#3{ \MH_let:NwN\reserved@d=~#1 @@ -576,9 +579,9 @@ and the derived files \futurelet\@let@token\MH_nospace_nextchar: } \def\MH_nospace_nextchar:{ - \if_meaning:NN \@let@token\reserved@d + \MH_if_meaning:NN \@let@token\reserved@d \MH_let:NwN \reserved@b\reserved@a - \fi: + \MH_fi: \reserved@b } \long\def\MH_nospace_testopt:nn #1#2{ @@ -587,11 +590,11 @@ and the derived files {#1[{#2}]} } \def\MH_nospace_protected_testopt:n #1{ - \if_meaning:NN \protect\@typeset@protect + \MH_if_meaning:NN \protect\@typeset@protect \expandafter\MH_nospace_testopt:nn - \else: + \MH_else: \@x@protect#1 - \fi: + \MH_fi: } % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/tex/latex/mathtools/empheq.sty b/Master/texmf-dist/tex/latex/mathtools/empheq.sty index 919228d1e46..1c24bc158ab 100644 --- a/Master/texmf-dist/tex/latex/mathtools/empheq.sty +++ b/Master/texmf-dist/tex/latex/mathtools/empheq.sty @@ -30,8 +30,8 @@ %% empheq.sty, empheq.pdf, empheq.ins, empheq.drv. %% \ProvidesPackage{empheq}% - [2014/07/16 v2.14 Emphasizing equations] -\RequirePackage{mhsetup}[2004/10/10] + [2017/03/31 v2.15 Emphasizing equations] +\RequirePackage{mhsetup}[2017/03/31] \MHInternalSyntaxOn \MH_new_boolean:n {overload_ams} \DeclareOption{overload}{ @@ -53,7 +53,7 @@ \ExecuteOptions{newmultline} \ProcessOptions\relax \MHInternalSyntaxOff -\RequirePackage{mathtools}[2004/10/10] +\RequirePackage{mathtools}[2017/03/31] \MHInternalSyntaxOn \AtEndOfPackage{\MHInternalSyntaxOff} \newcount\l_EQ_equationtype_int @@ -61,16 +61,16 @@ \if@fleqn \iftagsleft@ \l_EQ_alignmentmode_int=4 - \else: + \MH_else: \l_EQ_alignmentmode_int=\thr@@ - \fi: -\else: + \MH_fi: +\MH_else: \iftagsleft@ \l_EQ_alignmentmode_int=\tw@ - \else: + \MH_else: \l_EQ_alignmentmode_int=\@ne - \fi: -\fi: + \MH_fi: +\MH_fi: \newdimen\l_EQ_totalwidth_dim \newdimen\l_EQ_displaywidth_dim \def\EmphEqdisplaywidth{\l_EQ_displaywidth_dim} @@ -97,12 +97,12 @@ \def\EQ_getbody:n #1{% \def\EQ_complete_mathdisplay:{}\def\EQ_mathbody:{#1}} \newenvironment{EmphEqMainEnv}{\collect@body\EQ_getbody:n}{% - \if_num:w \l_EQ_equationtype_int=\z@ %ZeroCheckpoint + \MH_if_num:w \l_EQ_equationtype_int=\z@ %ZeroCheckpoint \EQ_upgrade_error: - \else: + \MH_else: \EQ_post_process: \ignorespacesafterend - \fi:} + \MH_fi:} \def\EQ_post_process:{% \EQ_initialize: \EQ_begin_equation: @@ -114,9 +114,9 @@ } \ifodd \l_EQ_alignmentmode_int \setkeys{\MT_options_name:}{multlined-pos=b} - \else: + \MH_else: \setkeys{\MT_options_name:}{multlined-pos=t} - \fi: + \MH_fi: \g@addto@macro\EQ_complete_mathdisplay:{ \begin{MTmultlined}\relax} } @@ -139,49 +139,49 @@ \@nameuse{EQ_modify_linewidth_ \romannumeral\l_EQ_equationtype_int\EQ_next: :}% \EQ_typeset_display: - \@nameuse{find_displaywidth_ + \@nameuse{EQ_find_displaywidth_ \romannumeral\l_EQ_equationtype_int\EQ_next: :} \MH_addtolength:dn \l_EQ_totalwidth_dim{\l_EQ_displaywidth_dim} \savebox\EQ_mathdisplay_box[\l_EQ_totalwidth_dim][c]{% $\EQ_left_side: \EQ_innerbox:{% - \if_case:w \l_EQ_alignmentmode_int\or: + \MH_if_case:w \l_EQ_alignmentmode_int\MH_or: \makebox[\l_EQ_displaywidth_dim][c] {\usebox{\EQ_mathdisplay_box}}% - \or: + \MH_or: \makebox[\l_EQ_displaywidth_dim][c] {\usebox{\EQ_mathdisplay_box}}% - \or: + \MH_or: \makebox[\l_EQ_displaywidth_dim][l]{% - \if_num:w \l_EQ_equationtype_int=5 \else: - \if_num:w \l_EQ_equationtype_int=6 \else: + \MH_if_num:w \l_EQ_equationtype_int=5 \MH_else: + \MH_if_num:w \l_EQ_equationtype_int=6 \MH_else: \kern-\@mathmargin - \fi: - \fi: + \MH_fi: + \MH_fi: \usebox{\EQ_mathdisplay_box}}% - \or: + \MH_or: \makebox[\l_EQ_displaywidth_dim][l]{% - \if_num:w \l_EQ_equationtype_int=5 \else: - \if_num:w \l_EQ_equationtype_int=6 \else: + \MH_if_num:w \l_EQ_equationtype_int=5 \MH_else: + \MH_if_num:w \l_EQ_equationtype_int=6 \MH_else: \kern-\@mathmargin - \fi: - \fi: + \MH_fi: + \MH_fi: \usebox{\EQ_mathdisplay_box}}% - \fi:}% + \MH_fi:}% \EQ_right_side:$}% \begin{AmSequation*} \@nameuse{EQ_place_display_ \romannumeral\l_EQ_equationtype_int\EQ_next: :} - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_set_boolean_T:n {show_manual_tags} - \if_case:w \l_EQ_alignmentmode_int - \or: \EQ_place_tag:N r %#1 - \or: \EQ_place_tag:N l %#2 - \or: \EQ_place_tag:N r %#3 - \or: \EQ_place_tag:N l %#4 - \fi: - \fi: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: \EQ_place_tag:N r %#1 + \MH_or: \EQ_place_tag:N l %#2 + \MH_or: \EQ_place_tag:N r %#3 + \MH_or: \EQ_place_tag:N l %#4 + \MH_fi: + \MH_fi: \end{AmSequation*} \global\c@equation=\l_EQ_equation_fint\relax } @@ -209,7 +209,12 @@ \def\intertext##1{\PackageError{empheq}{% You~cannot~use~\string\intertext\space inside~the~`empheq' \MessageBreak - environment,~as~`empheq'~creates~an~unbreakable~box}\@eha}} + environment,~as~`empheq'~creates~an~unbreakable~box}\@eha} + \def\shortintertext##1{\PackageError{empheq}{% + You~cannot~use~\string\shortintertext\space inside~the~`empheq' + \MessageBreak + environment,~as~`empheq'~creates~an~unbreakable~box}\@eha} +} \def\EQ_displaybreak:{% \def\dspbrk@[##1]{\PackageWarning{empheq}{% You~cannot~use~\string\displaybreak\space inside~the~`empheq'% @@ -234,6 +239,7 @@ \parbox{.5\maxdimen}{% \hbadness\@M \EQ_prevent_vertical_space: + \columnwidth\linewidth \EQ_typeset_tags_hook: \MH_let:NwN\set@gather@field\EQ_set_gather_field: \MH_let:NwN\set@field\EQ_set_align_field: @@ -244,30 +250,30 @@ \EQ_maketag:Nn \EQ_saved_maketag:n {##1}} \EQ_complete_mathdisplay:}}} \def\EQ_predisplay_adjustment:{% - \if_dim:w \g_EQ_toprow_height_dim<\baselineskip + \MH_if_dim:w \g_EQ_toprow_height_dim<\baselineskip \vskip\g_EQ_toprow_height_dim \vskip-\baselineskip - \else: + \MH_else: \vskip-\normallineskip - \fi: - \if_dim:w \g_EQ_toptag_height_dim>\g_EQ_toprow_height_dim - \if_dim:w \g_EQ_toptag_height_dim>\baselineskip + \MH_fi: + \MH_if_dim:w \g_EQ_toptag_height_dim>\g_EQ_toprow_height_dim + \MH_if_dim:w \g_EQ_toptag_height_dim>\baselineskip \vskip-\g_EQ_toptag_height_dim \vskip\baselineskip \vskip-\normallineskip - \fi: - \fi:} + \MH_fi: + \MH_fi:} \def\EQ_postdisplay_adjustment:{% - \if_dim:w \g_EQ_bottomrow_depth_dim<\dp\strutbox + \MH_if_dim:w \g_EQ_bottomrow_depth_dim<\dp\strutbox \vskip\g_EQ_bottomrow_depth_dim \vskip-\dp\strutbox - \fi: - \if_dim:w \g_EQ_bottomtag_depth_dim>\g_EQ_bottomrow_depth_dim - \if_dim:w \g_EQ_bottomtag_depth_dim>\dp\strutbox + \MH_fi: + \MH_if_dim:w \g_EQ_bottomtag_depth_dim>\g_EQ_bottomrow_depth_dim + \MH_if_dim:w \g_EQ_bottomtag_depth_dim>\dp\strutbox \vskip-\g_EQ_bottomtag_depth_dim \vskip\dp\strutbox - \fi: - \fi:} + \MH_fi: + \MH_fi:} \def\EQ_typeset_display:{% \sbox\EQ_mathdisplay_box{% \parbox{\l_EQ_temp_linewidth_dim}{% @@ -282,46 +288,46 @@ \abovedisplayskip\z@ \belowdisplayskip\z@\relax} \def\EQ_maketag:Nn #1#2{% \setboxz@h{#2}% - \if_num:w \row@=\@ne + \MH_if_num:w \row@=\@ne \global \g_EQ_toptag_height_dim = \ht\z@ - \fi: + \MH_fi: \global \g_EQ_bottomtag_depth_dim=\dp\z@ \xdef\g_EQ_latest_nonzerodepth_row_fint{\number\row@} \@tempdima=\wd\z@ - \if_dim:w \@tempdima > \g_EQ_widesttag_dim + \MH_if_dim:w \@tempdima > \g_EQ_widesttag_dim \global \g_EQ_widesttag_dim = \@tempdima - \fi: + \MH_fi: #1{#2}% } \def\EQ_set_gather_field:{% \iftagsleft@ \global\lineht@\ht\z@ - \else: + \MH_else: \global\lineht@\dp\z@ - \fi: + \MH_fi: \kern\eqnshift@ %\boxz@ % Original amsmath version \EQ_measure_gather: \phantom{\boxz@}% \hfil} \def\EQ_measure_gather:{% - \if_num:w \row@=\@ne + \MH_if_num:w \row@=\@ne \g_EQ_toprow_height_dim=\ht\z@ - \fi: + \MH_fi: \g_EQ_bottomrow_depth_dim=\dp\z@ \global\g_EQ_toprow_height_dim\g_EQ_toprow_height_dim \global\g_EQ_bottomrow_depth_dim\g_EQ_bottomrow_depth_dim} \def\EQ_set_align_field:{% \column@plus \iftagsleft@ - \if_dim:w \ht\z@>\lineht@ + \MH_if_dim:w \ht\z@>\lineht@ \global\lineht@\ht\z@ - \fi: - \else: - \if_dim:w \dp\z@>\lineht@ + \MH_fi: + \MH_else: + \MH_if_dim:w \dp\z@>\lineht@ \global\lineht@\dp\z@ - \fi: - \fi: + \MH_fi: + \MH_fi: %\boxz@ % Original amsmath version \MH_if_boolean:nT {continue_measuring}{ \EQ_measure_align: } \phantom{\boxz@}} @@ -329,32 +335,32 @@ \MH_new_boolean:n {still_in_samerow} \MH_new_boolean:n {continue_measuring} \def\EQ_measure_align:{% - \if_num:w \g_EQ_temprow_int=\row@ + \MH_if_num:w \g_EQ_temprow_int=\row@ \MH_set_boolean_T:n {still_in_samerow} - \else: - \if_num:w \g_EQ_temprow_int>\row@ + \MH_else: + \MH_if_num:w \g_EQ_temprow_int>\row@ \global\MH_set_boolean_F:n {continue_measuring} - \fi: + \MH_fi: \MH_set_boolean_F:n {still_in_samerow} \global\@tempdimc=\@tempdimb \global\@tempdimb=\g_EQ_bottomrow_depth_dim - \fi: + \MH_fi: \MH_if_boolean:nTF {continue_measuring}{ \global\g_EQ_temprow_int=\row@ \@tempcnta=\row@ - \if_num:w \@tempcnta=\z@ + \MH_if_num:w \@tempcnta=\z@ \@tempdima=\g_EQ_toprow_height_dim \g_EQ_toprow_height_dim=\ht\z@\relax - \if_dim:w \g_EQ_toprow_height_dim<\@tempdima + \MH_if_dim:w \g_EQ_toprow_height_dim<\@tempdima \g_EQ_toprow_height_dim\@tempdima - \fi: - \fi: + \MH_fi: + \MH_fi: \MH_if_boolean:nTF {still_in_samerow}{ \@tempdima=\g_EQ_bottomrow_depth_dim \g_EQ_bottomrow_depth_dim=\dp\z@\relax - \if_dim:w \g_EQ_bottomrow_depth_dim<\@tempdima + \MH_if_dim:w \g_EQ_bottomrow_depth_dim<\@tempdima \g_EQ_bottomrow_depth_dim\@tempdima - \fi: + \MH_fi: }{ \g_EQ_bottomrow_depth_dim\dp\z@\relax } @@ -369,29 +375,29 @@ \def\EQ_vertical_tag_adjustment:n #1{{% \@tempdima\z@\@tempdimb\z@ \@tempdimc=\dp\strutbox - \if_dim:w \g_EQ_toprow_height_dim<\baselineskip + \MH_if_dim:w \g_EQ_toprow_height_dim<\baselineskip \MH_setlength:dn \@tempdima{\g_EQ_toprow_height_dim-\baselineskip} - \else: + \MH_else: \MH_setlength:dn \@tempdima{-\normallineskip} - \fi: - \if_dim:w \g_EQ_toptag_height_dim>\g_EQ_toprow_height_dim - \if_dim:w \g_EQ_toptag_height_dim>\baselineskip + \MH_fi: + \MH_if_dim:w \g_EQ_toptag_height_dim>\g_EQ_toprow_height_dim + \MH_if_dim:w \g_EQ_toptag_height_dim>\baselineskip \MH_addtolength:dn \@tempdima {-\g_EQ_toptag_height_dim+\baselineskip-\normallineskip} - \fi: - \fi: - \if_dim:w \g_EQ_bottomrow_depth_dim<\@tempdimc + \MH_fi: + \MH_fi: + \MH_if_dim:w \g_EQ_bottomrow_depth_dim<\@tempdimc \MH_setlength:dn \@tempdimb {\g_EQ_bottomrow_depth_dim-\@tempdimc} - \fi: - \if_dim:w \g_EQ_bottomtag_depth_dim>\g_EQ_bottomrow_depth_dim - \if_dim:w \g_EQ_bottomtag_depth_dim<\@tempdimc - \else: + \MH_fi: + \MH_if_dim:w \g_EQ_bottomtag_depth_dim>\g_EQ_bottomrow_depth_dim + \MH_if_dim:w \g_EQ_bottomtag_depth_dim<\@tempdimc + \MH_else: \MH_addtolength:dn \@tempdimb {-\g_EQ_bottomtag_depth_dim+\@tempdimc} - \fi: - \fi: + \MH_fi: + \MH_fi: \raisebox{-0.5\@tempdima+0.5\@tempdimb}{#1}}}% \def\EQ_use_mathdisplay:{% \EQ_outerbox:{\usebox{\EQ_mathdisplay_box}}} @@ -411,41 +417,41 @@ \EQ_new_equationtype:nnn {EmphEqEnv}{align}{1} \EQ_new_equationtype:nnn {EmphEqEnv}{align*}{2} \def\EQ_modify_linewidth_i:{% - \if_num:w \maxfields@=\tw@ - \else: + \MH_if_num:w \maxfields@=\tw@ + \MH_else: \setlength{\l_EQ_temp_linewidth_dim}{% \linewidth-\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% - \fi:} + \MH_fi:} \def\EQ_modify_linewidth_ii:{\EQ_modify_linewidth_i:} -\def\find_displaywidth_i:{% +\def\EQ_find_displaywidth_i:{% \MH_setlength:dn \l_EQ_displaywidth_dim {\l_EQ_temp_linewidth_dim-\alignsep@} - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\alignsep@}% - \or: % #2: + \MH_or: % #2: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\alignsep@}% - \or: % #3: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \fi:} -\def\find_displaywidth_ii:{\find_displaywidth_i:} + \MH_fi:} +\def\EQ_find_displaywidth_ii:{\EQ_find_displaywidth_i:} \def\EQ_place_display_i: {\EQ_use_mathdisplay:} \def\EQ_place_display_ii:{\EQ_place_display_i:} \EQ_new_equationtype:nnn {EmphEqEnv}{gather}{3} \EQ_new_equationtype:nnn {EmphEqEnv}{gather*}{4} \def\EQ_modify_linewidth_iii:{} \def\EQ_modify_linewidth_iv:{\EQ_modify_linewidth_iii:} -\def\find_displaywidth_iii:{% +\def\EQ_find_displaywidth_iii:{% \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% - \if_case:w \l_EQ_alignmentmode_int \or: \or: % #1 & #2: - \or: % #3: + \MH_if_case:w \l_EQ_alignmentmode_int \MH_or: \MH_or: % #1 & #2: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \fi:} -\def\find_displaywidth_iv:{\find_displaywidth_iii:} + \MH_fi:} +\def\EQ_find_displaywidth_iv:{\EQ_find_displaywidth_iii:} \def\EQ_place_display_iii:{\EQ_use_mathdisplay:} \def\EQ_place_display_iv: {\EQ_place_display_iii:} \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline} @@ -454,33 +460,34 @@ {flalign*}{\MH_set_boolean_T:n {multline}} \MH_new_boolean:n {multline} \def\EQ_multline_modify_linewidth_tag:{% - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{% -\g_EQ_widesttag_dim-\multlinetaggap-\multlinegap}% - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{% -\g_EQ_widesttag_dim-\multlinetaggap-\multlinegap}% - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{% -\@mathmargin-\g_EQ_widesttag_dim-\multlinetaggap}% - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% - \fi: + \MH_fi: } \def\EQ_multline_modify_linewidth_notag:{% - \if_case:w \l_EQ_alignmentmode_int\or: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-2\multlinegap} - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-2\multlinegap} - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% - \or: + \MH_or: \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% - \fi: + \MH_fi: } \MH_let:NwN \MTmultlined \multlined \MH_let:NwN \endMTmultlined \endmultlined @@ -492,57 +499,57 @@ \def\EQ_modify_linewidth_iii_mult:{ \setlength{\l_EQ_temp_linewidth_dim}{% \linewidth-\widthof{\EQ_outerbox:{}}}% - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \EQ_multline_modify_linewidth_tag: - \else: + \MH_else: \EQ_multline_modify_linewidth_notag: - \fi: + \MH_fi: \MH_setlength:dn \l_MT_multwidth_dim{\l_EQ_temp_linewidth_dim} } \def\EQ_modify_linewidth_iv_mult:{\EQ_modify_linewidth_iii_mult:} -\def\find_displaywidth_iii_mult:{% +\def\EQ_find_displaywidth_iii_mult:{% \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% - \if_case:w \l_EQ_alignmentmode_int \or: \or: % #1 & #2: - \or: % #3: + \MH_if_case:w \l_EQ_alignmentmode_int \MH_or: \MH_or: % #1 & #2: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \fi:} -\def\find_displaywidth_iv_mult:{\find_displaywidth_iii_mult:} + \MH_fi:} +\def\EQ_find_displaywidth_iv_mult:{\EQ_find_displaywidth_iii_mult:} \def\EQ_place_display_iii_mult:{ - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \abovedisplayshortskip=\abovedisplayskip \rlap{ \kern-.5\linewidth \kern\multlinegap \EQ_use_mathdisplay: } - \else: + \MH_else: \EQ_use_mathdisplay: - \fi: - \or: % #2: - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_fi: + \MH_or: % #2: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \llap{ \EQ_use_mathdisplay: \kern-.5\linewidth \kern\multlinegap }% - \else: + \MH_else: \EQ_use_mathdisplay: - \fi: - \or: % #3: + \MH_fi: + \MH_or: % #3: \EQ_use_mathdisplay: - \or: % #4: + \MH_or: % #4: \EQ_use_mathdisplay: - \fi: + \MH_fi: } \def\EQ_place_display_iv_mult: {\EQ_place_display_iii_mult:} }{ \def\EQ_generic_multline:nnnnn #1#2#3#4#5{% \hskip1sp#2#3{{}#5}#4% - \if:w *#1\relax\else:\notag\fi:} + \MH_if:w *#1\relax\MH_else:\notag\MH_fi:} \def\multleft{\@ifstar{% \MH_if_boolean:nTF {multlined}{ \def\EQ_next:{\EQ_multlined_left:n} @@ -592,16 +599,16 @@ \MH_if_boolean:nTF {multlined}{ \def\EQ_next:{\EQ_multlined_left:n }% }{ - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \def\EQ_next:{\multleft}% - \or: % #2: + \MH_or: % #2: \def\EQ_next:{\multleft*}% - \or: % #3: + \MH_or: % #3: \def\EQ_next:{\multleft}% - \or: % #4: + \MH_or: % #4: \def\EQ_next:{\multleft*}% - \fi: + \MH_fi: } \EQ_next:} \def\multmiddle{% @@ -617,16 +624,16 @@ \MH_if_boolean:nTF {multlined}{ \def\EQ_next:{\EQ_multlined_right:n }% }{ - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \def\EQ_next:{\multright*}% - \or: % #2: + \MH_or: % #2: \def\EQ_next:{\multright}% - \or: % #3: + \MH_or: % #3: \def\EQ_next:{\multright*}% - \or: % #4: + \MH_or: % #4: \def\EQ_next:{\multright}% - \fi: + \MH_fi: } \EQ_next:} \MH_new_boolean:n {multlined} @@ -643,16 +650,16 @@ \def\EQ_multlined_II:w[#1][#2]{% \MH_set_boolean_T:n {multlined} \MH_let:NwN \Let@\MT_saved_Let: - \if:w t#1\relax \EQ_multlined_III:nn {#1}{#2}% - \else: - \if:w b#1\relax \EQ_multlined_III:nn {#1}{#2}% - \else: - \if:w c#1\relax \EQ_multlined_III:nn {#1}{#2}% - \else: + \MH_if:w t#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_else: + \MH_if:w b#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_else: + \MH_if:w c#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_else: \EQ_multlined_III:nn {#2}{#1}% - \fi: - \fi: - \fi: + \MH_fi: + \MH_fi: + \MH_fi: \mkern-\thinmuskip \EQ_next:} \def\EQ_multlined_III:nn #1#2{% @@ -670,39 +677,39 @@ \def\EQ_modify_linewidth_v:{% \setlength{\l_EQ_temp_linewidth_dim}{% \linewidth-\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ \EQ_multline_modify_linewidth_tag: }{ - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: \MH_addtolength:dn \l_EQ_temp_linewidth_dim {-\g_EQ_widesttag_dim-\mintagsep} - \or: % #2: + \MH_or: % #2: \MH_addtolength:dn \l_EQ_temp_linewidth_dim {-\g_EQ_widesttag_dim-\mintagsep}% - \or: % #3: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_temp_linewidth_dim {-\g_EQ_widesttag_dim-\mintagsep} - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_temp_linewidth_dim {-\@mathmargin} - \fi: + \MH_fi: } - \else: + \MH_else: \MH_if_boolean:nT {multline}{ \EQ_multline_modify_linewidth_notag: } - \fi:} + \MH_fi:} \def\EQ_modify_linewidth_vi:{\EQ_modify_linewidth_v:} -\def\find_displaywidth_v:{% +\def\EQ_find_displaywidth_v:{% \MH_setlength:dn \l_EQ_displaywidth_dim{\l_EQ_temp_linewidth_dim}} -\def\find_displaywidth_vi:{\find_displaywidth_v:} +\def\EQ_find_displaywidth_vi:{\EQ_find_displaywidth_v:} \def\EQ_place_display_v:{% - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ \rlap{\kern\multlinegap \kern-.5\linewidth \EQ_use_mathdisplay: @@ -710,11 +717,11 @@ }{ \rlap{\kern-.5\linewidth\EQ_use_mathdisplay:}% } - \else: + \MH_else: \EQ_use_mathdisplay: - \fi: - \or: % #2: - \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_fi: + \MH_or: % #2: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ \llap{\kern-\mintagsep \kern\multlinetaggap \EQ_use_mathdisplay: @@ -722,36 +729,36 @@ }{ \llap{\EQ_use_mathdisplay:\kern-.5\linewidth}% } - \else: + \MH_else: \EQ_use_mathdisplay: - \fi: - \or: % #3: + \MH_fi: + \MH_or: % #3: \MH_if_boolean:nF {multline}{ \kern-\multlinetaggap } \EQ_use_mathdisplay: - \or: % #4: - \if_dim:w \g_EQ_widesttag_dim>\z@ - \else: + \MH_or: % #4: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_else: \MH_if_boolean:nF {multline}{ \kern-\@mathmargin } - \fi: + \MH_fi: \EQ_use_mathdisplay: - \fi: + \MH_fi: \MH_set_boolean_F:n {multline}} \def\EQ_place_display_vi:{\EQ_place_display_v:} \EQ_new_equationtype_arg:nnn {EmphEqEnv}{alignat}{7} \EQ_new_equationtype_arg:nnn {EmphEqEnv}{alignat*}{8} \def\EQ_modify_linewidth_vii:{} \def\EQ_modify_linewidth_viii:{\EQ_modify_linewidth_vii:} -\def\find_displaywidth_vii:{% +\def\EQ_find_displaywidth_vii:{% \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% - \if_case:w \l_EQ_alignmentmode_int - \or: % #1: - \or: % #2: - \or: % #3: + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \MH_or: % #2: + \MH_or: % #3: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\eqnshift@}% - \or: % #4: + \MH_or: % #4: \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \fi:} -\def\find_displaywidth_viii:{\find_displaywidth_vii:} + \MH_fi:} +\def\EQ_find_displaywidth_viii:{\EQ_find_displaywidth_vii:} \def\EQ_place_display_vii:{\EQ_use_mathdisplay:} \def\EQ_place_display_viii:{\EQ_place_display_vii:} \define@key{\EQ_options_name:}{box}{\def\EQ_outerbox:{#1}} @@ -1013,15 +1020,15 @@ \else \expandafter\endinput \fi -\def\default_raisetag:{\nobreak} +\def\EQ_default_raisetag:{\nobreak} \def\raisetag#1{ \skip@#1\relax - \xdef\raise@tag{\default_raisetag: - \vskip\iftagsleft@\else:-\fi:\the\skip@\relax}} -\MH_let:NwN\raise@tag\default_raisetag: + \xdef\raise@tag{\EQ_default_raisetag: + \vskip\iftagsleft@\MH_else:-\MH_fi:\the\skip@\relax}} +\MH_let:NwN\raise@tag\EQ_default_raisetag: \def\displ@y@{\@display@init{% \global\column@\z@ \global\dspbrk@lvl\m@ne - \global\tag@false \global\MH_let:NwN\raise@tag\default_raisetag: + \global\tag@false \global\MH_let:NwN\raise@tag\EQ_default_raisetag: }} \def\MT_gobblelabel:w #1{\@ifnextchar[{\EQ_gobbleoptional:w}{}} \def\EQ_gobbleoptional:w [#1]{} @@ -1033,14 +1040,14 @@ \savecounters@ \setbox\@ne\vbox{% \everycr{\noalign{\global\tag@false - \global\MH_let:NwN\raise@tag\default_raisetag: + \global\MH_let:NwN\raise@tag\EQ_default_raisetag: \global\column@\z@}}% \MH_let:NwN\label\MT_gobblelabel:w \halign{% \setboxz@h{$\m@th\displaystyle{##}$}% - \if_dim:w \wdz@>\totwidth@ + \MH_if_dim:w \wdz@>\totwidth@ \global\totwidth@\wdz@ - \fi: + \MH_fi: &\setboxz@h{\strut@{##}}% \savetaglength@ \crcr @@ -1051,14 +1058,14 @@ \restorecounters@ \if@fleqn \global\advance\totwidth@\@mathmargin - \fi: + \MH_fi: \iftagsleft@ - \if_dim:w \totwidth@>\displaywidth + \MH_if_dim:w \totwidth@>\displaywidth \global\MH_let:NwN\gdisplaywidth@\totwidth@ - \else: + \MH_else: \global\MH_let:NwN\gdisplaywidth@\displaywidth - \fi: - \fi: + \MH_fi: + \MH_fi: \endgroup } \def\measure@#1{% @@ -1072,7 +1079,7 @@ \global\setbox0\vbox{% \MH_let:NwN\math@cr@@@\math@cr@@@align@measure \everycr{\noalign{\global\tag@false - \global\MH_let:NwN\raise@tag\default_raisetag: + \global\MH_let:NwN\raise@tag\EQ_default_raisetag: \global\column@\z@}}% \MH_let:NwN\label\MT_gobblelabel:w \global\row@\z@ @@ -1087,43 +1094,43 @@ \restorecounters@ \ifodd\maxfields@ \global\advance\maxfields@\@ne - \fi: - \if_num:w \xatlevel@=\tw@ - \if_num:w \maxfields@<\thr@@ + \MH_fi: + \MH_if_num:w \xatlevel@=\tw@ + \MH_if_num:w \maxfields@<\thr@@ \MH_let:NwN\xatlevel@\z@ - \fi: - \fi: + \MH_fi: + \MH_fi: \setbox\z@\vbox{% \unvbox\z@ \unpenalty \global\setbox\@ne\lastbox }% \global\totwidth@\wd\@ne - \if@fleqn \global\advance\totwidth@\@mathmargin \fi: + \if@fleqn \global\advance\totwidth@\@mathmargin \MH_fi: \global\MH_let:NwN\maxcolumn@widths\@empty \begingroup - \MH_let:NwN\or:\relax + \MH_let:NwN\MH_or:\relax \loop \global\setbox\@ne\hbox{% \unhbox\@ne \unskip \global\setbox\thr@@\lastbox }% \ifhbox\thr@@ - \xdef\maxcolumn@widths{ \or: \the\wd\thr@@ \maxcolumn@widths}% + \xdef\maxcolumn@widths{ \MH_or: \the\wd\thr@@ \maxcolumn@widths}% \repeat \endgroup \dimen@\displaywidth \advance\dimen@-\totwidth@ - \if_case:w \xatlevel@ + \MH_if_case:w \xatlevel@ \global\alignsep@\z@ \MH_let:NwN\minalignsep\z@ \@tempcntb\z@ \if@fleqn \@tempcnta\@ne \global\eqnshift@\@mathmargin - \else: + \MH_else: \@tempcnta\tw@ \global\eqnshift@\dimen@ \global\divide\eqnshift@\@tempcnta - \fi: - \or: + \MH_fi: + \MH_or: \@tempcntb\maxfields@ \divide\@tempcntb\tw@ \@tempcnta\@tempcntb @@ -1132,13 +1139,13 @@ \global\eqnshift@\@mathmargin \global\alignsep@\dimen@ \global\divide\alignsep@\@tempcnta - \else: + \MH_else: \global\advance\@tempcnta\@ne \global\eqnshift@\dimen@ \global\divide\eqnshift@\@tempcnta \global\alignsep@\eqnshift@ - \fi: - \or: + \MH_fi: + \MH_or: \@tempcntb\maxfields@ \divide\@tempcntb\tw@ \global\advance\@tempcntb\m@ne @@ -1147,43 +1154,43 @@ \global\alignsep@\dimen@ \if@fleqn \global\advance\alignsep@\@mathmargin\relax - \fi: + \MH_fi: \global\divide\alignsep@\@tempcntb - \fi: - \if_dim:w \alignsep@<\minalignsep\relax + \MH_fi: + \MH_if_dim:w \alignsep@<\minalignsep\relax \global\alignsep@\minalignsep\relax - \if_dim:w \eqnshift@>\z@ - \if@fleqn\else: + \MH_if_dim:w \eqnshift@>\z@ + \if@fleqn\MH_else: \global\eqnshift@\displaywidth \global\advance\eqnshift@-\totwidth@ \global\advance\eqnshift@-\@tempcntb\alignsep@ \global\divide\eqnshift@\tw@ - \fi: - \fi: - \fi: - \if_dim:w \eqnshift@<\z@ + \MH_fi: + \MH_fi: + \MH_fi: + \MH_if_dim:w \eqnshift@<\z@ \global\eqnshift@\z@ - \fi: + \MH_fi: \calc@shift@align \global\tagshift@\totwidth@ \global\advance\tagshift@\@tempcntb\alignsep@ \if@fleqn - \if_num:w \xatlevel@=\tw@ + \MH_if_num:w \xatlevel@=\tw@ \global\advance\tagshift@-\@mathmargin\relax - \fi: - \else: + \MH_fi: + \MH_else: \global\advance\tagshift@\eqnshift@ - \fi: - \iftagsleft@ \else: + \MH_fi: + \iftagsleft@ \MH_else: \global\advance\tagshift@-\displaywidth - \fi: + \MH_fi: \dimen@\minalignsep\relax \global\advance\totwidth@\@tempcntb\dimen@ - \if_dim:w \totwidth@>\displaywidth + \MH_if_dim:w \totwidth@>\displaywidth \global\MH_let:NwN\displaywidth@\totwidth@ - \else: + \MH_else: \global\MH_let:NwN\displaywidth@\displaywidth - \fi: + \MH_fi: \endgroup } \def\EQ_multline_labelhack:n #1{% @@ -1196,22 +1203,22 @@ \chardef\dspbrk@context\z@ \restore@math@cr \MH_let:NwN\tag\tag@in@align - \global\tag@false \global\MH_let:NwN\raise@tag\default_raisetag: + \global\tag@false \global\MH_let:NwN\raise@tag\EQ_default_raisetag: \mmeasure@{#1}% \MH_let:NwN\tag\gobble@tag \MH_let:NwN\label\MT_gobblelabel:w - \tabskip \if@fleqn \@mathmargin \else: \z@skip \fi: + \tabskip \if@fleqn \@mathmargin \MH_else: \z@skip \MH_fi: \totwidth@\displaywidth \if@fleqn \advance\totwidth@-\@mathmargin - \fi: + \MH_fi: \halign\bgroup \hbox to\totwidth@{% \if@fleqn \hskip \@centering \relax - \else: + \MH_else: \hfil - \fi: + \MH_fi: \strut@ $\m@th\displaystyle{}##\endmultline@math%$ \hfil @@ -1220,10 +1227,10 @@ \if@fleqn \hskip-\@mathmargin \def\multline@indent{\hskip\@mathmargin}% put it back - \else: + \MH_else: \hfilneg \def\multline@indent{\hskip\multlinegap}% - \fi: + \MH_fi: \iftagsleft@ \iftag@ \begingroup @@ -1238,21 +1245,21 @@ \raise@tag }}% \multline@indent - \else: + \MH_else: \setbox\z@\hbox{\make@display@tag}% \dimen@\@mathmargin \advance\dimen@-\wd\z@ - \if_dim:w \dimen@<\multlinetaggap + \MH_if_dim:w \dimen@<\multlinetaggap \dimen@\multlinetaggap - \fi: + \MH_fi: \box\z@ \hskip\dimen@\relax - \fi: + \MH_fi: \endgroup - \else: + \MH_else: \multline@indent - \fi: - \else: + \MH_fi: + \MH_else: \multline@indent - \fi: + \MH_fi: #1% } \def\mmeasure@#1{% @@ -1272,49 +1279,49 @@ \halign{% \setboxz@h{\@lign$\m@th\displaystyle{}##$}% \iftagsleft@ - \if_num:w \row@=\@ne + \MH_if_num:w \row@=\@ne \global\totwidth@\wdz@ \global\lineht@\ht\z@ - \fi: - \else: + \MH_fi: + \MH_else: \global\totwidth@\wdz@ \global\lineht@\dp\z@ - \fi: + \MH_fi: \crcr #1% \crcr }% }% - \if_meaning:NN + \MH_if_meaning:NN \df@tag\@empty - \else: + \MH_else: \global\tag@true - \fi: - \if@eqnsw\global\tag@true\fi: + \MH_fi: + \if@eqnsw\global\tag@true\MH_fi: \iftag@ \setboxz@h{% \if@eqnsw \stepcounter{equation}% \tagform@\theequation - \else: + \MH_else: \df@tag - \fi: + \MH_fi: }% \global\tagwidth@\wdz@ \dimen@\totwidth@ \advance\dimen@\tagwidth@ \advance\dimen@\multlinetaggap - \iftagsleft@\else: + \iftagsleft@\MH_else: \if@fleqn \advance\dimen@\@mathmargin - \fi: - \fi: - \if_dim:w \dimen@>\displaywidth + \MH_fi: + \MH_fi: + \MH_if_dim:w \dimen@>\displaywidth \global\shifttag@true - \else: + \MH_else: \global\shifttag@false - \fi: - \fi: + \MH_fi: + \MH_fi: \restorecounters@ \endgroup } @@ -1333,12 +1340,12 @@ -\dp\EQ_mathdisplay_box -\ht\EQ_mathdisplay_box} [0pt][0pt]{\PotEndMark{\maketag@@@}}}} - \else: + \MH_else: \gdef\df@tag{% \raisebox{-\dp\EQ_mathdisplay_box -\depthof{\EQ_outerbox:{}}} {\PotEndMark{\maketag@@@}}}% - \fi:} + \MH_fi:} \def\EQ_tag_plus_endmark:{% \iftagsleft@ \gdef\maketag@@@##1{% @@ -1348,7 +1355,7 @@ \raisebox{-\dp\EQ_mathdisplay_box -\depthof{\EQ_outerbox:{}}} {\PotEndMark{\hss}}}}}% - \else: + \MH_else: \gdef\maketag@@@##1{% \hbox{\m@th\normalfont##1\llap{\hss\PotEndMark{% \settoheight{\@tempdima}{\@nameuse{\InTheoType Symbol}}% @@ -1357,32 +1364,32 @@ \setlength{\@tempdimb} {\g_EQ_bottomrow_depth_dim+\depthof{\EQ_outerbox:{}} +\depthof{\EQ_innerbox:{}}} - \if_dim:w \@tempdima>\@tempdimb + \MH_if_dim:w \@tempdima>\@tempdimb \MH_setlength:dn \@tempdima{-\dp\EQ_mathdisplay_box -\@tempdima+\g_EQ_bottomrow_depth_dim} \addtolength{\@tempdima}{\depthof{\EQ_innerbox:{}}}% \def\EQ_next:{\raisebox{\@tempdima}}% - \else: + \MH_else: \def\EQ_next:{ \raisebox{-\dp\EQ_mathdisplay_box -\depthof{\EQ_outerbox:{}}}}% - \fi:\EQ_next:}}}}% - \fi:} + \MH_fi:\EQ_next:}}}}% + \MH_fi:} \MH_let:NwN \MT_nonumber: \nonumber \def\g_EQ_latest_nonzerodepth_row_fint{\z@} \renewcommand*\nonumber{ \@tempcnta=\row@ - \if_num:w \l_EQ_equationtype_int=\thr@@ + \MH_if_num:w \l_EQ_equationtype_int=\thr@@ \advance\@tempcnta\m@ne - \else: - \if_num:w \l_EQ_equationtype_int=4\relax + \MH_else: + \MH_if_num:w \l_EQ_equationtype_int=4\relax \advance\@tempcnta\m@ne - \fi: - \fi: - \if_num:w \g_EQ_latest_nonzerodepth_row_fint=\@tempcnta - \else: + \MH_fi: + \MH_fi: + \MH_if_num:w \g_EQ_latest_nonzerodepth_row_fint=\@tempcnta + \MH_else: \global\g_EQ_bottomtag_depth_dim=-\baselineskip - \fi: + \MH_fi: \MT_nonumber: } \endinput diff --git a/Master/texmf-dist/tex/latex/mathtools/mathtools.sty b/Master/texmf-dist/tex/latex/mathtools/mathtools.sty index 136fdb6e495..0e2563f7422 100644 --- a/Master/texmf-dist/tex/latex/mathtools/mathtools.sty +++ b/Master/texmf-dist/tex/latex/mathtools/mathtools.sty @@ -30,9 +30,9 @@ %% mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv. %% \ProvidesPackage{mathtools}% - [2015/11/12 v1.18 mathematical typesetting tools] + [2017/05/24 v1.19 mathematical typesetting tools] \RequirePackage{keyval,calc} -\RequirePackage{mhsetup}[2010/01/21] +\RequirePackage{mhsetup}[2017/03/31] \MHInternalSyntaxOn % borrowed from fixltx2e \def\EQ_MakeRobust#1{% @@ -113,7 +113,7 @@ \ExecuteOptions{fixamsmath,disallowspaces} \ProcessOptions\relax \MHInternalSyntaxOff -\RequirePackage{amsmath}[2000/07/18] +\RequirePackage{amsmath}[2016/11/05] \MHInternalSyntaxOn \AtEndOfPackage{\MHInternalSyntaxOff} \def\MT_true_false_error:{ @@ -183,13 +183,13 @@ } \def\MT_extended_tagform:n #1{ \MH_set_boolean_F:n {raw_maketag} - \if_meaning:NN \df@label\@empty + \MH_if_meaning:NN \df@label\@empty \MH_if_boolean:nTF {manual_tag}% this was \MH_if_boolean:nT before { \MH_if_boolean:nTF {show_manual_tags} { \MT_prev_tagform:n {#1} } { \stepcounter{equation} } }{\kern1sp}% this last {\kern1sp} is new. - \else: + \MH_else: \MH_if_boolean:nTF {manual_tag} { \MH_if_boolean:nTF {show_manual_tags} { \MT_prev_tagform:n {#1} } @@ -207,13 +207,13 @@ { \refstepcounter{equation}\MT_prev_tagform:n {#1} } \@safe@activesfalse } - \fi: + \MH_fi: \global\MH_set_boolean_T:n {raw_maketag} } \def\MT_extended_maketag:n #1{ \ifx\df@label\@empty \MT_maketag:n {#1} - \else: + \MH_else: \MH_if_boolean:nTF {raw_maketag} { \MH_if_boolean:nTF {show_manual_tags} @@ -226,7 +226,7 @@ } } { \MT_maketag:n {#1} } - \fi: + \MH_fi: \global\MH_set_boolean_F:n {manual_tag} } \def\MT_extended_eqref:n #1{ @@ -247,11 +247,11 @@ \MH_new_boolean:n {show_only_refs} \MH_new_boolean:n {show_manual_tags} \define@key{\MT_options_name:}{showmanualtags}[true]{ - \@ifundefined{boolean_show_manual_tags_#1:} + \@ifundefined{MH_boolean_show_manual_tags_#1:} { \MT_true_false_error: - \@nameuse{boolean_show_manual_tags_false:} + \@nameuse{MH_boolean_show_manual_tags_false:} } - { \@nameuse{boolean_show_manual_tags_#1:} } + { \@nameuse{MH_boolean_show_manual_tags_#1:} } } \newcommand*\MT_showonlyrefs_true:{ \MH_if_boolean:nF {show_only_refs}{ @@ -288,16 +288,16 @@ } \renewcommand\nonumber{ \if@eqnsw - \if_meaning:NN \incr@eqnum\@empty + \MH_if_meaning:NN \incr@eqnum\@empty \MH_if_boolean:nF {show_only_refs} {\addtocounter{equation}\m@ne} - \fi: - \fi: + \MH_fi: + \MH_fi: \MH_let:NwN \print@eqnum\@empty \MH_let:NwN \incr@eqnum\@empty \global\@eqnswfalse } \MHInternalSyntaxOff -\newcommand\noeqref[1]{\@bsphack +\newcommand\noeqref[1]{\@bsphack% \@for\@tempa:=#1\do{% \@safe@activestrue% \edef\@tempa{\expandafter\@firstofone\@tempa}% @@ -308,7 +308,7 @@ }{}% \if@filesw\protected@write\@auxout{}% {\string\MT@newlabel{\@tempa}}\fi% - \@safe@activesfalse} + \@safe@activesfalse}% \@esphack} \providecommand\@safe@activestrue{}% @@ -480,32 +480,32 @@ \newcount\g_MT_multlinerow_int \newdimen\l_MT_multwidth_dim \newcommand*\MT_test_for_tcb_other:nnnnn [1]{ - \if:w t#1\relax + \MH_if:w t#1\relax \expandafter\MH_use_choice_i:nnnn - \else: - \if:w c#1\relax + \MH_else: + \MH_if:w c#1\relax \expandafter\expandafter\expandafter\MH_use_choice_ii:nnnn - \else: - \if:w b#1\relax + \MH_else: + \MH_if:w b#1\relax \expandafter\expandafter\expandafter \expandafter\expandafter\expandafter\expandafter \MH_use_choice_iii:nnnn - \else: + \MH_else: \expandafter\expandafter\expandafter \expandafter\expandafter\expandafter\expandafter \MH_use_choice_iv:nnnn - \fi: - \fi: - \fi: + \MH_fi: + \MH_fi: + \MH_fi: } \def\MT_mult_invisible_line: { \crcr \global\MH_set_boolean_F:n {mult_firstline} \hbox to \l_MT_multwidth_dim{}\crcr - \noalign{\vskip-\baselineskip \vskip-\jot \vskip-\normallineskip} + \noalign{\vskip-\baselineskip \vskip-\normallineskip} } \def\MT_mult_mathcr_atat:w [#1]{% - \if_num:w 0=`{\fi: \iffalse}\fi: + \MH_if_num:w 0=`{\MH_fi: \iffalse}\MH_fi: \MH_if_boolean:nT {mult_firstline}{ \kern\l_MT_mult_left_fdim \MT_mult_invisible_line: @@ -513,19 +513,19 @@ \crcr \noalign{\vskip#1\relax} \global\advance\g_MT_multlinerow_int\@ne - \if_num:w \g_MT_multlinerow_int=\l_MT_multline_lastline_fint + \MH_if_num:w \g_MT_multlinerow_int=\l_MT_multline_lastline_fint \MH_let:NwN \math@cr@@\MT_mult_last_mathcr:w - \fi: + \MH_fi: } \def\MT_mult_firstandlast_mathcr:w [#1]{% - \if_num:w 0=`{\fi: \iffalse}\fi: + \MH_if_num:w 0=`{\MH_fi: \iffalse}\MH_fi: \kern\l_MT_mult_left_fdim \MT_mult_invisible_line: \noalign{\vskip#1\relax} \kern\l_MT_mult_right_fdim } \def\MT_mult_last_mathcr:w [#1]{ - \if_num:w 0=`{\fi: \iffalse}\fi:\math@cr@@@ + \MH_if_num:w 0=`{\MH_fi: \iffalse}\MH_fi:\math@cr@@@ \noalign{\vskip#1\relax} \kern\l_MT_mult_right_fdim} \newcommand\MT_start_mult:N [1]{ @@ -552,7 +552,7 @@ #2 } \newcommand*\MT_mult_internal:n [1]{ - \MH_if_boolean:nF {outer_mult}{\null\,} + \MH_if_boolean:nF {outer_mult}{\alignedspace@left} %<-- requires amsmath 2016/11/05 \MT_next: \bgroup \Let@ @@ -564,13 +564,13 @@ \spread@equation \MH_set_boolean_F:n {mult_firstline} \MT_measure_mult:n {#1} - \if_dim:w \l_MT_multwidth_dim<\l_MT_multline_measure_fdim + \MH_if_dim:w \l_MT_multwidth_dim<\l_MT_multline_measure_fdim \MH_setlength:dn \l_MT_multwidth_dim{\l_MT_multline_measure_fdim} \fi \MH_set_boolean_T:n {mult_firstline} - \if_num:w \l_MT_multline_lastline_fint=\@ne + \MH_if_num:w \l_MT_multline_lastline_fint=\@ne \MH_let:NwN \math@cr@@ \MT_mult_firstandlast_mathcr:w - \fi: + \MH_fi: \ialign\bgroup \hfil\strut@$\m@th\displaystyle{}##$\hfil \crcr @@ -603,10 +603,10 @@ {\def\MT_mult_default_pos:{#1}} {\def\MT_mult_default_pos:{#1}} { - \if_meaning:NN \@empty#1\@empty - \else: + \MH_if_meaning:NN \@empty#1\@empty + \MH_else: \setlength \l_MT_multwidth_dim{#1} - \fi: + \MH_fi: } \MT_start_mult:N \MT_mult_default_pos: } @@ -614,7 +614,7 @@ \renewenvironment{subarray}[1]{% \vcenter\bgroup \Let@ \restore@math@cr \default@tag - \let\math@cr@@\AMS@math@cr@@ + \let\math@cr@@\AMS@math@cr@@ % <--- the fix \baselineskip\fontdimen10 \scriptfont\tw@ \advance\baselineskip\fontdimen12 \scriptfont\tw@ \lineskip\thr@@\fontdimen8 \scriptfont\thr@@ @@ -634,10 +634,10 @@ {\def\MT_mult_default_pos:{#1}} {\def\MT_mult_default_pos:{#1}} { - \if_meaning:NN \@empty#1\@empty - \else: + \MH_if_meaning:NN \@empty#1\@empty + \MH_else: \setlength \l_MT_multwidth_dim{#1} - \fi: + \MH_fi: } \MT_multlined_second_arg:w } @@ -664,22 +664,50 @@ \@namedef{MT_delim_\MH_cs_to_str:N #1 _star_wrapper:nnn}##1##2##3{ \mathopen{}\mathclose\bgroup ##1 ##2 \aftergroup\egroup ##3 } - \@namedef{MT_delim_\MH_cs_to_str:N #1 _nostar_wrapper:nnn}##1##2##3{ + \@namedef{MT_delim_\MH_cs_to_str:N #1 _nostarscaled_wrapper:nnn}##1##2##3{ \mathopen{##1}##2\mathclose{##3} } + \@namedef{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn}##1##2##3{ + \mathopen##1##2\mathclose##3 + } } \newcommand\reDeclarePairedDelimiterInnerWrapper[3]{ - \@namedef{MT_delim_\MH_cs_to_str:N #1 _ #2 _wrapper:nnn}##1##2##3{ - #3 + \@ifundefined{MT_delim_\MH_cs_to_str:N #1 _ #2 _wrapper:nnn}{ + \PackageError{mathtools}{ + Wrapper~not~found~for~\string#1~and~option~'#2'.\MessageBreak + Either~\string#1~is~ not~ defined,~or~ you~ are~using~ the~ + \MessageBreak + 'nostar'~ option,~which~ is~ no~ longer~ supported.~ + \MessageBreak + Please~ use~ 'nostarnonscaled'~ or~ 'nostarscaled~ + \MessageBreak instead.~ + }{See the manual} + }{ + \@namedef{MT_delim_\MH_cs_to_str:N #1 _ #2 _wrapper:nnn}##1##2##3{ + #3 + } } } +\def\MT_etb_ifdefempty_x:nnn #1{ + \expandafter\expandafter\expandafter + \MT_etb_ifblank:nnn + \expandafter\expandafter\expandafter{% + \expandafter\strip@prefix\meaning#1} +} +\def\MT_etb_ifblank:nnn #1{ + \expandafter\ifx\expandafter\relax\detokenize\expandafter{\@gobble#1?}\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} + \newcommand*\DeclarePairedDelimiter[3]{% \@ifdefinable{#1}{ - \MT_delim_default_inner_wrappers:n{#1} + \MT_delim_default_inner_wrappers:n{#1} % define the wrappers \@namedef{MT_delim_\MH_cs_to_str:N #1 _star:}##1 - %{\mathopen{}\mathclose\bgroup\left#2 ##1 \aftergroup\egroup\right #3}% { \@nameuse{MT_delim_\MH_cs_to_str:N #1 _star_wrapper:nnn}% {\left#2}{##1}{\right#3} }% \@xp\@xp\@xp @@ -687,69 +715,26 @@ \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname [2][\\@gobble] { - %\mathopen{\@nameuse {\MH_cs_to_str:N ##1 l} #2} ##2 - %\mathclose{\@nameuse {\MH_cs_to_str:N ##1 r} #3}} - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_wrapper:nnn}% - {\@nameuse {\MH_cs_to_str:N ##1 l} #2} - {##2} - {\@nameuse {\MH_cs_to_str:N ##1 r} #3} - } - \DeclareRobustCommand{#1}{ - \@ifstar - {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} - {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar:}} - } - } -} -\def\MHempty{} -\def\DeclarePairedDelimiterX#1[#2]#3#4#5{% - \@ifdefinable{#1}{ - \MT_paired_delimx_arg_test:n{#2} - \MT_delim_default_inner_wrappers:n{#1} - \@xp\@xp\@xp - \newcommand - \@xp\csname MT_delim_\MH_cs_to_str:N #1 _star:\endcsname - [#2] - { - \begingroup - \def\delimsize{\middle} - %\mathopen{}\mathclose\bgroup\left#3 #5 \aftergroup\egroup\right#4 - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _star_wrapper:nnn} - {\left#3}{#5}{\right#4} - \endgroup - } - \@xp\@xp\@xp - \newcommand - \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname - [1][\MHempty] - { - \begingroup - \def\delimsize{##1} - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_inner:} - } - \@xp\@xp\@xp - \newcommand - \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar_inner:\endcsname - [#2] - { - %\mathopen{% - % \let\MHempty\@gobble - % \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #3} - %#5 - %\mathclose{% - % \let\MHempty\@gobble - % \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #4} - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_wrapper:nnn} - { - \let\MHempty\@gobble - \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #3 - } - {#5} - { - \let\MHempty\@gobble - \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #4 - } - \endgroup + \def\@tempa{\\@gobble} + \def\@tempb{##1} + \ifx\@tempa\@tempb + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn}% + {#2} + {##2} + {#3} + \else + \MT_etb_ifblank:nnn {##1}{ + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn}% + {#2} + {##2} + {#3} + }{ + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarscaled_wrapper:nnn}% + {\@nameuse {\MH_cs_to_str:N ##1 l} #2} + {##2} + {\@nameuse {\MH_cs_to_str:N ##1 r} #3} + } + \fi } \DeclareRobustCommand{#1}{ \@ifstar @@ -769,6 +754,39 @@ \fi } +\def\@MHempty{} +\newcommand\MT_delim_inner_generator:nnnnnnn [7]{ + \@xp\@xp\@xp + \newcommand + \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar_inner:\endcsname + [#2] + { + #3 + \def\@tempa{\@MHempty} + \@xp\def\@xp\@tempb\@xp{\delimsize} + \ifx\@tempa\@tempb + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn} + {#4}{#7}{#5} + \else + \MT_etb_ifdefempty_x:nnn {\delimsize}{ + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn} + {#4}{#7}{#5} + }{ + \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostarscaled_wrapper:nnn} + { + \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #4 + } + {#7} + { + \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #5 + } + } + \fi + #6 + \endgroup + } +} + \def\DeclarePairedDelimiterXPP#1[#2]#3#4#5#6#7{% \@ifdefinable{#1}{ \MT_paired_delimx_arg_test:n{#2} @@ -789,31 +807,13 @@ \@xp\@xp\@xp \newcommand \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname - [1][\MHempty] + [1][\@MHempty] { \begingroup \def\delimsize{##1} \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_inner:} } - \@xp\@xp\@xp - \newcommand - \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar_inner:\endcsname - [#2] - { - #3 - \@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar_wrapper:nnn} - { - \let\MHempty\@gobble - \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize l\endcsname #4 - } - {#7} - { - \let\MHempty\@gobble - \@xp\@xp\@xp\csname\@xp\MH_cs_to_str:N \delimsize r\endcsname #5 - } - #6 - \endgroup - } + \MT_delim_inner_generator:nnnnnnn {#1}{#2}{#3}{#4}{#5}{#6}{#7} \DeclareRobustCommand{#1}{ \@ifstar {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} @@ -822,6 +822,9 @@ } } +\def\DeclarePairedDelimiterX#1[#2]#3#4#5{ + \DeclarePairedDelimiterXPP{#1}[#2]{}{#3}{#4}{}{#5} +} \def\MT_start_cases:nnnn #1#2#3#4{ % #1=sep,#2=lpreamble,#3=rpreamble,#4=delim \RIfM@\else @@ -956,68 +959,68 @@ \def\MT_smop_arg_C: {#3} \def\MT_smop_arg_D: {#4} \def\MT_smop_arg_E: {#5} \def\MT_smop_arg_F: {#6} \def\MT_smop_arg_G: {#7} - \if_meaning:NN \MT_smop_arg_A: \MT_smop_mathop:n - \if_meaning:NN \MT_smop_arg_C:\MT_smop_limits: + \MH_if_meaning:NN \MT_smop_arg_A: \MT_smop_mathop:n + \MH_if_meaning:NN \MT_smop_arg_C:\MT_smop_limits: \def\MT_smop_final_arg_A:{#1{#2}}% - \if_meaning:NN \MT_smop_arg_D: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_D: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_one} \MH_let:NwN \MT_smop_final_arg_B: \MT_smop_arg_D: \MH_let:NwN \MT_smop_final_arg_C: \MT_smop_arg_E: - \if_meaning:NN \MT_smop_arg_F: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_F: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_two} \MH_let:NwN \MT_smop_final_arg_D: \MT_smop_arg_F: \edef\MT_smop_final_arg_E: {\expandafter\MT_smop_remove_nil_vi:N \MT_smop_arg_G: } - \fi: - \fi: - \else: + \MH_fi: + \MH_fi: + \MH_else: \def\MT_smop_final_arg_A:{#1{#2}}% - \if_meaning:NN \MT_smop_arg_D: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_D: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_one} \MH_let:NwN \MT_smop_final_arg_B: \MT_smop_arg_C: \MH_let:NwN \MT_smop_final_arg_C: \MT_smop_arg_D: - \if_meaning:NN \MT_smop_arg_F: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_F: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_two} \MH_let:NwN \MT_smop_final_arg_D: \MT_smop_arg_E: \MH_let:NwN \MT_smop_final_arg_E: \MT_smop_arg_F: - \fi: - \fi: - \fi: - \else: - \if_meaning:NN \MT_smop_arg_B:\MT_smop_limits: + \MH_fi: + \MH_fi: + \MH_fi: + \MH_else: + \MH_if_meaning:NN \MT_smop_arg_B:\MT_smop_limits: \def\MT_smop_final_arg_A:{#1}% - \if_meaning:NN \MT_smop_arg_D: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_D: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_one} \MH_let:NwN \MT_smop_final_arg_B: \MT_smop_arg_C: \MH_let:NwN \MT_smop_final_arg_C: \MT_smop_arg_D: - \if_meaning:NN \MT_smop_arg_F: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_F: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_two} \MH_let:NwN \MT_smop_final_arg_D: \MT_smop_arg_E: \MH_let:NwN \MT_smop_final_arg_E: \MT_smop_arg_F: - \fi: - \fi: - \else: + \MH_fi: + \MH_fi: + \MH_else: \def\MT_smop_final_arg_A:{#1}% - \if_meaning:NN \MT_smop_arg_C: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_C: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_one} \MH_let:NwN \MT_smop_final_arg_B: \MT_smop_arg_B: \MH_let:NwN \MT_smop_final_arg_C: \MT_smop_arg_C: - \if_meaning:NN \MT_smop_arg_D: \@nnil - \else: + \MH_if_meaning:NN \MT_smop_arg_D: \@nnil + \MH_else: \MH_set_boolean_T:n {smop_two} \MH_let:NwN \MT_smop_final_arg_D: \MT_smop_arg_D: \MH_let:NwN \MT_smop_final_arg_E: \MT_smop_arg_E: - \fi: - \fi: - \fi: - \fi: + \MH_fi: + \MH_fi: + \MH_fi: + \MH_fi: \MH_if_boolean:nT {smop_one}{ \MT_smop_measure:NNNNN \MT_smop_final_arg_A: \MT_smop_final_arg_B: \MT_smop_final_arg_C: @@ -1069,9 +1072,9 @@ \sbox\z@{$\m@th \displaystyle #1$} \sbox\tw@{$\m@th \displaystyle #4$} \@tempdima=\dp\z@ \advance\@tempdima-\dp\tw@ - \if_dim:w \@tempdima>\z@ + \MH_if_dim:w \@tempdima>\z@ \mathop{#1}\limits#2{#3} - \else: + \MH_else: \mathop{#1\MT_vphantom:Nn \displaystyle{#4}}\limits #2{ \def\finsm@sh{\ht\z@\z@ \box\z@} @@ -1079,8 +1082,8 @@ \MT_vphantom:Nn \scriptstyle {\MT_cramped_internal:Nn \scriptstyle{#6}} } - \fi: - \if_dim:w \@tempdima>\z@ + \MH_fi: + \MH_if_dim:w \@tempdima>\z@ \mathop{#4\MT_vphantom:Nn \displaystyle{#1}}\limits #5 { @@ -1089,9 +1092,9 @@ \def\finsm@sh{\ht\z@\z@ \box\z@} \mathsm@sh\scriptstyle{\MT_cramped_internal:Nn \scriptstyle{#6}} } - \else: + \MH_else: \mathop{#4}\limits#5{#6} - \fi: + \MH_fi: } \newcommand\SwapAboveDisplaySkip{% \noalign{\vskip-\abovedisplayskip\vskip\abovedisplayshortskip} @@ -1248,14 +1251,19 @@ =\columnwidth \else \parshape\@ne \@totalleftmargin \linewidth \fi - \noindent##1\par}% + \noindent\ignorespaces##1\par}% \penalty\predisplaypenalty\vskip\abovedisplayskip% \vskip-\lineskiplimit % CCS \vskip\normallineskiplimit % CCS \vskip\l_MT_above_intertext_sep }% -}} -\def\MT_orig_intertext_true: { \MH_let:NwN \intertext@ \MT_orig_intertext: } + }% + \MH_let:NwN \shortintertext \shortintertext@ +} +\def\MT_orig_intertext_true: { + \MH_let:NwN \intertext@ \MT_orig_intertext: + \MH_let:NwN \shortintertext \shortintertext@ +} \def\MT_orig_intertext_false: { \MH_let:NwN \intertext@ \MT_intertext: } \define@key{\MT_options_name:}{original-intertext}[true]{ \@nameuse{MT_orig_intertext_#1:} @@ -1268,17 +1276,17 @@ \noalign{% \penalty\postdisplaypenalty\vskip\abovedisplayshortskip \vbox{\normalbaselines - \if_dim:w - \if_dim:w \@totalleftmargin=\z@ + \MH_if_dim:w + \MH_if_dim:w \@totalleftmargin=\z@ \linewidth - \else: + \MH_else: -\maxdimen - \fi: + \MH_fi: =\columnwidth - \else: + \MH_else: \parshape\@ne \@totalleftmargin \linewidth - \fi: - \noindent#1\par}% + \MH_fi: + \noindent\ignorespaces#1\par}% \penalty\predisplaypenalty\vskip\abovedisplayshortskip% }% } @@ -1312,25 +1320,26 @@ \vskip\normallineskiplimit \vskip\l_MT_above_shortintertext_sep \vbox{\normalbaselines - \if_dim:w - \if_dim:w \@totalleftmargin=\z@ + \MH_if_dim:w + \MH_if_dim:w \@totalleftmargin=\z@ \linewidth - \else: + \MH_else: -\maxdimen - \fi: + \MH_fi: =\columnwidth - \else: + \MH_else: \parshape\@ne \@totalleftmargin \linewidth - \fi: - \noindent#1\par}% + \MH_fi: + \noindent\ignorespaces#1\par}% \penalty\predisplaypenalty\vskip\abovedisplayshortskip% \vskip-\lineskiplimit \vskip\normallineskiplimit \vskip\l_MT_below_shortintertext_sep }% } -\def\MT_orig_shortintertext_true: { \MH_let:NwN \shortintertext \MT_orig_shortintertext:n } -\def\MT_orig_shortintertext_false: { \MH_let:NwN \shortintertext \MT_shortintertext:n } +\def\MT_orig_shortintertext_true: { \MH_let:NwN \shortintertext@ \MT_orig_shortintertext:n } +\def\MT_orig_shortintertext_false: { \MH_let:NwN \shortintertext@ \MT_shortintertext:n } +\newcommand{\shortintertext}{\@amsmath@err{\Invalid@@\shortintertext}\@eha} \define@key{\MT_options_name:}{original-shortintertext}[true]{ \@nameuse{MT_orig_shortintertext_#1:} } @@ -1439,11 +1448,11 @@ \newcommand{\MT_prescript_inner:}[4]{ \@mathmeasure\z@#4{\MT_prescript_sup:{#1}} \@mathmeasure\tw@#4{\MT_prescript_sub:{#2}} - \if_dim:w \wd\tw@>\wd\z@ + \MH_if_dim:w \wd\tw@>\wd\z@ \setbox\z@\hbox to\wd\tw@{\hfil\unhbox\z@} - \else: + \MH_else: \setbox\tw@\hbox to\wd\z@{\hfil\unhbox\tw@} - \fi: + \MH_fi: \mathop{} \mathopen{\vphantom{\MT_prescript_arg:{#3}}}^{\box\z@}\sb{\box\tw@} \MT_prescript_arg:{#3} @@ -1469,9 +1478,9 @@ \ifx\e@alloc\@undefined% kernel thus older than 2015 \def\@DeclareMathSizes #1#2#3#4#5{% \@defaultunits\dimen@ #2pt\relax\@nnil - \if:w $#3$% + \MH_if:w $#3$% \MH_let:cN {S@\strip@pt\dimen@}\math@fontsfalse - \else: + \MH_else: \@defaultunits\dimen@ii #3pt\relax\@nnil \@defaultunits\@tempdima #4pt\relax\@nnil \@defaultunits\@tempdimb #5pt\relax\@nnil @@ -1482,7 +1491,7 @@ \gdef\noexpand\ssf@size{\strip@pt\@tempdimb}% \the\toks@ }% - \fi: + \MH_fi: } \fi \def\MT_mathic_true: { @@ -1498,23 +1507,23 @@ \MT_mathic_redeffer:*\({ \relax\ifmmode\@badmath\else \ifhmode - \if_dim:w \fontdimen\@ne\font>\z@ - \if_dim:w \lastskip>\z@ + \MH_if_dim:w \fontdimen\@ne\font>\z@ + \MH_if_dim:w \lastskip>\z@ \skip@\lastskip\unskip - \if_num:w \lastpenalty>\z@ + \MH_if_num:w \lastpenalty>\z@ \count@\lastpenalty\unpenalty - \fi: + \MH_fi: \@@italiccorr - \if_num:w \count@>\z@ + \MH_if_num:w \count@>\z@ \penalty\count@ - \fi: + \MH_fi: \hskip\skip@ - \else: + \MH_else: \@@italiccorr - \fi: - \fi: - \fi: - $\fi: + \MH_fi: + \MH_fi: + \MH_fi: + $\MH_fi: } } } @@ -1592,24 +1601,24 @@ \iftagsleft@ \kern-\tagshift@ \if@fleqn - \if_num:w \xatlevel@=\tw@ + \MH_if_num:w \xatlevel@=\tw@ \kern-\@mathmargin - \fi: - \fi: - \if:w 1\shift@tag\row@\relax + \MH_fi: + \MH_fi: + \MH_if:w 1\shift@tag\row@\relax \rlap{\vbox{% \normalbaselines \boxz@ \vbox to\lineht@{}% \raise@tag }}% - \else: + \MH_else: \rlap{\boxz@}% - \fi: + \MH_fi: \kern\displaywidth@ - \else: + \MH_else: \kern-\tagshift@ - \if:w 1\shift@tag\row@\relax + \MH_if:w 1\shift@tag\row@\relax \llap{\vtop{% \raise@tag \normalbaselines @@ -1618,29 +1627,29 @@ \box\@ne \boxz@ }}% - \else: + \MH_else: \llap{\boxz@}% - \fi: - \fi: + \MH_fi: + \MH_fi: } \def\x@calc@shift@lf{% - \if_dim:w \eqnshift@=\z@ + \MH_if_dim:w \eqnshift@=\z@ \global\eqnshift@\@mathmargin\relax \alignsep@\displaywidth \advance\alignsep@-\totwidth@ - \if_num:w \@tempcntb=0 - \else: + \MH_if_num:w \@tempcntb=0 + \MH_else: \global\divide\alignsep@\@tempcntb % original line - \fi: - \if_dim:w \alignsep@<\minalignsep\relax + \MH_fi: + \MH_if_dim:w \alignsep@<\minalignsep\relax \global\alignsep@\minalignsep\relax - \fi: - \fi: - \if_dim:w \tag@width\row@>\@tempdima + \MH_fi: + \MH_fi: + \MH_if_dim:w \tag@width\row@>\@tempdima \saveshift@1% - \else: + \MH_else: \saveshift@0% - \fi:}% + \MH_fi:}% } \MaybeMHPrecedingSpacesOff \renewcommand\aligned@a[1][c]{\start@aligned{#1}\m@ne} diff --git a/Master/texmf-dist/tex/latex/mathtools/mhsetup.sty b/Master/texmf-dist/tex/latex/mathtools/mhsetup.sty index b78969e5746..cf84c8ff77c 100644 --- a/Master/texmf-dist/tex/latex/mathtools/mhsetup.sty +++ b/Master/texmf-dist/tex/latex/mathtools/mhsetup.sty @@ -9,6 +9,7 @@ %% This is a generated file. %% %% Copyright (C) 2002-2007,2010 by Morten Hoegholm +%% Copyright (C) 2017 by Lars Madsen %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -20,15 +21,14 @@ %% %% This work has the LPPL maintenance status "maintained". %% -%% This Current Maintainer of this work is -%% Lars Madsen, Will Robertson and Joseph Wright. +%% This Current Maintainer of this work is Lars Madsen <daleif@math.au.dk> %% %% This work consists of the main source file mhsetup.dtx %% and the derived files %% mhsetup.sty, mhsetup.pdf, mhsetup.ins, mhsetup.drv. %% \ProvidesPackage{mhsetup}% - [2010/01/21 v1.2a programming setup (MH)] + [2017/03/31 v1.3 programming setup (MH)] \def\MHInternalSyntaxOn{ \edef\MHInternalSyntaxOff{% \catcode`\noexpand\~=\the\catcode`\~\relax @@ -57,47 +57,47 @@ \expandafter\MH_let:NwN\csname#1\expandafter\endcsname \csname#2\endcsname} \def\MH_new_boolean:n #1{ - \expandafter\@ifdefinable\csname if_boolean_#1:\endcsname{ - \@namedef{boolean_#1_true:} - {\MH_let:cN{if_boolean_#1:}\iftrue} - \@namedef{boolean_#1_false:} - {\MH_let:cN{if_boolean_#1:}\iffalse} - \@nameuse{boolean_#1_false:}% + \expandafter\@ifdefinable\csname MH_if_boolean_#1:\endcsname{ + \@namedef{MH_boolean_#1_true:} + {\MH_let:cN{MH_if_boolean_#1:}\iftrue} + \@namedef{MH_boolean_#1_false:} + {\MH_let:cN{MH_if_boolean_#1:}\iffalse} + \@nameuse{MH_boolean_#1_false:}% } } -\def\MH_set_boolean_F:n #1{ \@nameuse{boolean_#1_false:} } -\def\MH_set_boolean_T:n #1{ \@nameuse{boolean_#1_true:} } +\def\MH_set_boolean_F:n #1{ \@nameuse{MH_boolean_#1_false:} } +\def\MH_set_boolean_T:n #1{ \@nameuse{MH_boolean_#1_true:} } \def\MH_if_boolean:nTF #1{ - \@nameuse{if_boolean_#1:} + \@nameuse{MH_if_boolean_#1:} \expandafter\@firstoftwo - \else: + \MH_else: \expandafter\@secondoftwo - \fi: + \MH_fi: } \def\MH_if_boolean:nT #1{ - \@nameuse{if_boolean_#1:} + \@nameuse{MH_if_boolean_#1:} \expandafter\@firstofone - \else: + \MH_else: \expandafter\@gobble - \fi: + \MH_fi: } \def\MH_if_boolean:nF #1{ - \@nameuse{if_boolean_#1:} + \@nameuse{MH_if_boolean_#1:} \expandafter\@gobble - \else: + \MH_else: \expandafter\@firstofone - \fi: + \MH_fi: } -\@ifundefined{if:w}{\MH_let:NwN \if:w =\if}{} -\@ifundefined{if_meaning:NN}{\MH_let:NwN \if_meaning:NN =\ifx}{} -\@ifundefined{else:}{\MH_let:NwN \else:=\else}{} -\@ifundefined{fi:}{\MH_let:NwN \fi:=\fi}{} +\@ifundefined{MH_if:w}{\MH_let:NwN \MH_if:w =\if}{} +\@ifundefined{MH_if_meaning:NN}{\MH_let:NwN \MH_if_meaning:NN =\ifx}{} +\@ifundefined{MH_else:}{\MH_let:NwN \MH_else:=\else}{} +\@ifundefined{MH_fi:}{\MH_let:NwN \MH_fi:=\fi}{} \AtBeginDocument{ - \@ifundefined{if_num:w}{\MH_let:NwN \if_num:w =\ifnum}{} - \@ifundefined{if_dim:w}{\MH_let:NwN \if_dim:w =\ifdim}{} - \@ifundefined{if_case:w}{\MH_let:NwN \if_case:w =\ifcase}{} + \@ifundefined{MH_if_num:w}{\MH_let:NwN \MH_if_num:w =\ifnum}{} + \@ifundefined{MH_if_dim:w}{\MH_let:NwN \MH_if_dim:w =\ifdim}{} + \@ifundefined{MH_if_case:w}{\MH_let:NwN \MH_if_case:w =\ifcase}{} } -\@ifundefined{or:}{\MH_let:NwN \or:=\or}{} +\@ifundefined{MH_or:}{\MH_let:NwN \MH_or:=\or}{} \def\MH_cs_to_str:N {\expandafter\@gobble\string} \@ifundefined{eTeXversion} { @@ -127,9 +127,9 @@ \futurelet\@let@token\MH_nospace_nextchar: } \def\MH_nospace_nextchar:{ - \if_meaning:NN \@let@token\reserved@d + \MH_if_meaning:NN \@let@token\reserved@d \MH_let:NwN \reserved@b\reserved@a - \fi: + \MH_fi: \reserved@b } \long\def\MH_nospace_testopt:nn #1#2{ @@ -138,11 +138,11 @@ {#1[{#2}]} } \def\MH_nospace_protected_testopt:n #1{ - \if_meaning:NN \protect\@typeset@protect + \MH_if_meaning:NN \protect\@typeset@protect \expandafter\MH_nospace_testopt:nn - \else: + \MH_else: \@x@protect#1 - \fi: + \MH_fi: } \@ifundefined{kernel@ifnextchar} {\MH_let:NwN \kernel@ifnextchar \@ifnextchar} |