From 663eda4fa065036cbf72489106aa6b8d6244a301 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 24 Mar 2020 20:50:35 +0000 Subject: mathtools (24mar20) git-svn-id: svn://tug.org/texlive/trunk@54516 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/mathtools/README | 84 --- Master/texmf-dist/doc/latex/mathtools/README.md | 56 ++ Master/texmf-dist/doc/latex/mathtools/empheq.pdf | Bin 311438 -> 311417 bytes .../texmf-dist/doc/latex/mathtools/mathtools.pdf | Bin 448435 -> 455418 bytes Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf | Bin 235863 -> 236395 bytes .../texmf-dist/source/latex/mathtools/empheq.dtx | 599 ++++++++++++++------- .../texmf-dist/source/latex/mathtools/empheq.ins | 94 ++++ .../source/latex/mathtools/mathtools.dtx | 296 +++++++++- .../source/latex/mathtools/mathtools.ins | 94 ++++ .../texmf-dist/source/latex/mathtools/mhsetup.dtx | 15 +- Master/texmf-dist/tex/latex/mathtools/empheq.sty | 390 ++++++++------ .../texmf-dist/tex/latex/mathtools/mathtools.sty | 31 +- Master/texmf-dist/tex/latex/mathtools/mhsetup.sty | 6 +- 13 files changed, 1174 insertions(+), 491 deletions(-) delete mode 100644 Master/texmf-dist/doc/latex/mathtools/README create mode 100644 Master/texmf-dist/doc/latex/mathtools/README.md create mode 100644 Master/texmf-dist/source/latex/mathtools/empheq.ins create mode 100644 Master/texmf-dist/source/latex/mathtools/mathtools.ins diff --git a/Master/texmf-dist/doc/latex/mathtools/README b/Master/texmf-dist/doc/latex/mathtools/README deleted file mode 100644 index 3528dc78a89..00000000000 --- a/Master/texmf-dist/doc/latex/mathtools/README +++ /dev/null @@ -1,84 +0,0 @@ -The mathtools bundle -============= -Morten Hoegholm (c) 2002-2011 -Lars Madsen (c) 2012- -email: daleif@math.au.dk -License: LaTeX Project Public License - -The files in the mathtools bundle are: - mhsetup.dtx - mathtools.dtx - empheq.dtx -and derived files. The derived files of each .dtx-file are listed -at the top of the respective .dtx-file. - - -INSTALLATION -============ -Running TeX on each dtx file extracts the runtime files. See the dtx -files for details. - -DESCRIPTION -=========== - - -mathtools -========= - -The mathtools package provides many useful tools for mathematical -typesetting. It is based on amsmath and fixes various deficiencies -of amsmath and standard LaTeX. It provides: - -- Extensible symbols, such as brackets, arrows, harpoons, etc. - -- Various symbols such as \coloneqq (:=). - -- Easy creation of new tag forms. - -- Showing only the referenced equations. - -- Extensible arrows, harpoons and hookarrows. - -- Starred versions of the amsmath matrix environments for - specifying the column alignment. - -- More building blocks: multlined, cases-like environments, new - gathered environments. - -- Math versions of \makebox, \llap, \rlap etc. - -- Cramped math styles. - -- Macro generators. - -- and more... - -mathtools requires mhsetup. - -empheq -====== - -The empheq package is a visual markup extension designed to -function on top of amsmath. It features: - -- Boxing multi line math displays while leaving equation - numbers untouched at the margin. Any kind of box will do. - -- Making the ntheorem package place end-of-theorem markers - perfectly. - -- Placing arbitrary material on either side of math displays. - This includes delimiters that automatically scale to the - correct size. - -empheq requires mathtools. - - -mhsetup -======= - -The mhsetup package defines various programming tools needed by -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 -=========== - -The bundle is maintained by: - - Morten H\o gholm - Lars Madsen - - -Please report bugs to daleif@math.au.dk - -=========== -This README file was last revised 2017/05/24. diff --git a/Master/texmf-dist/doc/latex/mathtools/README.md b/Master/texmf-dist/doc/latex/mathtools/README.md new file mode 100644 index 00000000000..1cad9aafcf7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mathtools/README.md @@ -0,0 +1,56 @@ +The `mathtools` bundle +====================== + +`mathtools` +----------- + +The `mathtools` package provides many useful tools for mathematical +typesetting. It is based on `amsmath` and fixes various deficiencies +of `amsmath` and standard LaTeX. It provides: + +- Extensible symbols, such as brackets, arrows, harpoons, etc. +- Various symbols such as `\coloneqq` (:=). +- Easy creation of new tag forms. +- Showing only the referenced equations. +- Extensible arrows, harpoons and hook arrows. +- Starred versions of the `amsmath` matrix environments for + specifying the column alignment. +- More building blocks: multlined, cases-like environments, new + gathered environments. +- Math versions of `\makebox`, `\llap`, `\rlap`, etc. +- Cramped math styles. +- and more ... + +`mathtools` requires `mhsetup`. + +`empheq` +-------- + +The `empheq` package is a visual markup extension designed to +function on top of `amsmath`. It features: + +- Boxing multi line math displays while leaving equation + numbers untouched at the margin. Any kind of box will do. +- Making the `ntheorem` package place end-of-theorem markers + perfectly. +- Placing arbitrary material on either side of math displays. + This includes delimiters that automatically scale to the + correct size. + +`empheq` requires `mathtools`. + +`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. + +----- + +Copyright (C) 2002-2011 Morten Hoegholm +Copyright (C) 2012-2019 Lars Madsen +Copyright (C) 2020 Lars Madsen, The LaTeX3 Project + +All rights reserved. + diff --git a/Master/texmf-dist/doc/latex/mathtools/empheq.pdf b/Master/texmf-dist/doc/latex/mathtools/empheq.pdf index f0fbac25124..c8e8077f118 100644 Binary files a/Master/texmf-dist/doc/latex/mathtools/empheq.pdf and b/Master/texmf-dist/doc/latex/mathtools/empheq.pdf differ diff --git a/Master/texmf-dist/doc/latex/mathtools/mathtools.pdf b/Master/texmf-dist/doc/latex/mathtools/mathtools.pdf index 2c468fadbeb..f779170580d 100644 Binary files a/Master/texmf-dist/doc/latex/mathtools/mathtools.pdf and b/Master/texmf-dist/doc/latex/mathtools/mathtools.pdf differ diff --git a/Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf b/Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf index 8f608c74aeb..2af0d0843c6 100644 Binary files a/Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf and b/Master/texmf-dist/doc/latex/mathtools/mhsetup.pdf differ diff --git a/Master/texmf-dist/source/latex/mathtools/empheq.dtx b/Master/texmf-dist/source/latex/mathtools/empheq.dtx index 45dace201f8..7f4b76b8ae5 100644 --- a/Master/texmf-dist/source/latex/mathtools/empheq.dtx +++ b/Master/texmf-dist/source/latex/mathtools/empheq.dtx @@ -1,7 +1,8 @@ % \iffalse meta-comment % % Copyright (C) 2002-2007 by Morten Hoegholm -% Copyright (C) 2012 by Lars Madsen +% Copyright (C) 2012-2019 by Lars Madsen +% Copyright (C) 2020 by Lars Madsen, The LaTeX3 Project % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -14,7 +15,7 @@ % This work has the LPPL maintenance status "maintained". % % This Current Maintainer of this work is -% Lars Madsen +% Lars Madsen, The LaTeX3 Project % % This work consists of the main source file empheq.dtx % and the derived files @@ -68,7 +69,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: empheq 2017/03/31 v2.15 empheq} +\Msg{* Package: empheq 2020/03/24 v2.16 empheq} \Msg{************************************************************************} \keepsilent @@ -79,7 +80,8 @@ This is a generated file. Copyright (C) 2002-2007 by Morten Hoegholm -Copyright (C) 2012- by Lars Madsen +Copyright (C) 2012-2019 by Lars Madsen +Copyright (C) 2020- by Lars Madsen, The LaTeX3 Project This work may be distributed and/or modified under the @@ -93,7 +95,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 +Lars Madsen, The LaTeX3 Project This work consists of the main source file empheq.dtx and the derived files @@ -131,7 +133,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{empheq.drv}% - [2017/03/31 v2.15 Emphasizing equations] + [2020/03/24 v2.16 Emphasizing equations] \documentclass{ltxdoc} \usepackage{mathpazo} \usepackage[overload]{empheq} @@ -142,6 +144,7 @@ and the derived files \hyphenation{emph-eq} \makeatletter \providecommand*\pkg[1]{\textsf{#1}} +\providecommand*\cls[1]{\textsf{#1}} \providecommand*\env[1]{\texttt{#1}} \providecommand*\email[1]{\href{mailto:#1}{\texttt{#1}}} \providecommand*\mode[1]{\texttt{[#1]}} @@ -149,6 +152,17 @@ and the derived files \addtolength\marginparwidth{-30pt} +\newcommand\lineref[1]{ + \begingroup + % \p@CodelineNo \normalfont \scriptsize 475 + \let\p@CodelineNo\relax + \let\normalfont\relax + %\let\scriptsize\relax + \ref{#1} + \endgroup +} + + \newcommand*\AddDescribe[3]{% \@namedef{Describe#1}{\leavevmode\@bsphack\begingroup\MakePrivateLetters \@nameuse{Describe@#1}} @@ -323,7 +337,8 @@ and the derived files \DocInput{empheq.dtx} \end{document} % -% \fi +% \fi +% \changes{v2.16}{2020/03/24}{fixed several bugs related to amsart/-book} % \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}} @@ -366,7 +381,7 @@ and the derived files % \title{The \pkg{empheq} package\thanks{This file has version number % \fileversion, last revised \filedate.}\\ % Emphasizing equations in \LaTeXe} -% \author{Morten H\o gholm, Lars Madsen} +% \author{Morten Hoegholm, Lars Madsen, The LaTeX3 Project} % % \date{\filedate} % @@ -1624,11 +1639,10 @@ and the derived files % \section{Contact information} % % Should you have any feature request, suggestions, or bug reports -% then feel free to contact Lars Madsen at +% then feel free to open an issue at (it also covers \pkg{empheq}) % \begin{quote} -% \email{daleif@math.au.dk} +% \url{https://github.com/latex3/mathtools} % \end{quote} -% Please put `empheq' in the subject line. % % \subsection*{Contributors} % @@ -1874,6 +1888,7 @@ and the derived files % \begin{macro}{\l_EQ_totalwidth_dim} % \begin{macro}{\l_EQ_displaywidth_dim} % \begin{macro}{\l_EQ_temp_linewidth_dim} +% \begin{macro}{\l_EQ_linewidth_dim} % \begin{macro}{\EmphEqdelimitershortfall} % \begin{macro}{\EmphEqdelimiterfactor} % \begin{macro}{\g_EQ_toptag_height_dim} @@ -1889,9 +1904,13 @@ and the derived files \newdimen\l_EQ_displaywidth_dim % \end{macrocode} % Just to make it accessible. +% \changes{v2.16}{2020/03/23}{Added \cs{l_EQ_linewidth_dim} since due +% to the \AmS\ classes being able to not rely on \cs{linewidth} can be +% useful.} % \begin{macrocode} \def\EmphEqdisplaywidth{\l_EQ_displaywidth_dim} \newdimen\l_EQ_temp_linewidth_dim +\newdimen\l_EQ_linewidth_dim \newdimen\EmphEqdelimitershortfall \newcount\EmphEqdelimiterfactor \EmphEqdelimiterfactor950 @@ -1913,6 +1932,7 @@ and the derived files % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\EQ_outerbox:} % \begin{macro}{\EQ_innerbox:} @@ -2049,8 +2069,8 @@ and the derived files \MH_else: \setkeys{\MT_options_name:}{multlined-pos=t} \MH_fi: - \g@addto@macro\EQ_complete_mathdisplay:{ - \begin{MTmultlined}\relax} + \g@addto@macro\EQ_complete_mathdisplay:{ + \begin{MTmultlined}\relax} } \g@addto@macro\EQ_complete_mathdisplay:\EQ_mathbody: \MH_if_boolean:nT {outer_mult}{ @@ -2220,7 +2240,45 @@ and the derived files % \begin{macrocode} \MH_let:NwN\SetTagPlusEndMark\EQ_tag_plus_endmark: \MH_let:NwN\SetOnlyEndMark\EQ_only_endmark: +% \end{macrocode} +% \changes{v2.16}{2020/03/19}{Added fix for amsart and amsbook} +% \changes{v2.16}{2020/03/23}{Added additional length as it is useful +% against amsart and friends} +% \begin{macrocode} \l_EQ_temp_linewidth_dim\linewidth + \l_EQ_linewidth_dim\linewidth +% \end{macrocode} +% In classes like \cls{amsart} and \cls{amsbook} thye set +% \cs{displaywidth} to a fixed value. This gives problems inside +% lists, where these classes want to use the full width, not the +% effective width. They do this via \cs{everydisplay} +% which is actually too late for when \cs{EQ_initialize:} runs! +% We know that \cls{amsart/book} defines +% \begin{verbatim} +% \def\fullwidthdisplay{\displayindent\z@ \displaywidth\columnwidth} +% \end{verbatim} +% and then adds this to \cs{everydisplay}. So our fix will be to see +% if \cs{fullwidthdisplay} is defined, run it locally and then extract +% the value of \cs{displaywidth} using a global scratch variable. If +% that size is then larger than the current \cs{linewidth} we will use +% it. Additionally we also save this value in a static length, so we +% can use this everywhere instead of \cs{linewidth}. +% \begin{macrocode} + \@tempdima\z@ + \begingroup + \ifdefined\fullwidthdisplay\relax + \fullwidthdisplay + \global\@tempdima\displaywidth + \fi + \endgroup + \ifdim\@tempdima>\linewidth\relax + \l_EQ_temp_linewidth_dim\@tempdima + \l_EQ_linewidth_dim\@tempdima + \fi + \@tempdima\z@ +% \end{macrocode} +% -- end of \cls{amsart/-book} fix. +% \begin{macrocode} \g_EQ_toprow_height_dim\z@ \g_EQ_bottomrow_depth_dim\z@ \g_EQ_toptag_height_dim\z@ @@ -2303,7 +2361,9 @@ 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. The main idea here is to +% typeset everything inside a box of a massive width, so wide that +% the math part is way outside the area of the text block. % \begin{macrocode} \def\EQ_typeset_tags:{% \sbox\EQ_tag_box{% @@ -2319,7 +2379,7 @@ and the derived files % 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}. +% 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} @@ -2727,9 +2787,13 @@ and the derived files % math display. % \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \changes{v2.15}{2017/03/31}{added EQ\_ prefix} +% \changes{v2.16}{2020/03/23}{switched \cs{linewidth} to +% \cs{l_EQ_linewidth_dim} due to amsart forcing full width displays} % \begin{macrocode} \setlength{\l_EQ_temp_linewidth_dim}{% - \linewidth-\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% + % \linewidth + \l_EQ_linewidth_dim + -\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% \MH_fi:} \def\EQ_modify_linewidth_ii:{\EQ_modify_linewidth_i:} \def\EQ_find_displaywidth_i:{% @@ -2777,6 +2841,13 @@ and the derived files % This was fairly easy, but then I had to take care of \ldots % % \subsubsection{The \env{multline} Family} +% +% \emph{Note: These next three paragraphs are rather confusing. They +% are referring to an older implementation (also available via the +% \opt{oldmultline} option, where the \env{multline} feature was +% implemented via \env{flalign}, nowadays we use \env{multlined} from +% \pkg{mathtools} wrapped inside a \env{gather} for the equation number.} +% % This was quite a pickle. Its implementation in \pkg{amsmath} is % very strange indeed; for instance the tag is typeset in the % measuring phase! So instead I thought I could fake it, but how @@ -2798,6 +2869,10 @@ and the derived files % \cs{MakeKeyvalAliasAddon} now} % Then we make \env{multline} into an alias for {flalign} but with % an extra switch \cs{ifEQ_multline:} set to true. +% +% Note this version of the \env{multline} code is being used when we +% use the \emph{bad} \env{multline} implementation, see code line +% \lineref{goodandbad} onwards. % \begin{macrocode} \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline} {flalign}{\MH_set_boolean_T:n {multline}} @@ -2863,78 +2938,108 @@ and the derived files \MH_let:NwN \endMTmultlined \endmultlined % \end{macrocode} % \end{environment} -% We make a choice here: the good \env{multline} or the bad? +% We make a choice here: the good \env{multline} or the bad? +% \refstepcounter{CodelineNo}\label{goodandbad}\addtocounter{CodelineNo}{-1} % \begin{macrocode} \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}} -\MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline*}{gather*} - {\MH_set_boolean_T:n {outer_mult}} -\def\EQ_modify_linewidth_iii_mult:{ - \setlength{\l_EQ_temp_linewidth_dim}{% - \linewidth-\widthof{\EQ_outerbox:{}}}% - \MH_if_dim:w \g_EQ_widesttag_dim>\z@ - \EQ_multline_modify_linewidth_tag: - \MH_else: - \EQ_multline_modify_linewidth_notag: - \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\EQ_find_displaywidth_iii_mult:{% - \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% - \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}% - \MH_or: % #4: - \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \MH_fi:} -\def\EQ_find_displaywidth_iv_mult:{\EQ_find_displaywidth_iii_mult:} -\def\EQ_place_display_iii_mult:{ - \MH_if_case:w \l_EQ_alignmentmode_int - \MH_or: % #1: +% \changes{v2.16}{2020/03/23}{switched \cs{linewidth} to +% \cs{l_EQ_linewidth_dim} due to amsart forcing full width displays} +% \begin{macrocode} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline}{gather} + {\MH_set_boolean_T:n {outer_mult}} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline*}{gather*} + {\MH_set_boolean_T:n {outer_mult}} + \def\EQ_modify_linewidth_iii_mult:{ + \setlength{\l_EQ_temp_linewidth_dim}{% + % \linewidth + \l_EQ_linewidth_dim + -\widthof{\EQ_outerbox:{}}}% \MH_if_dim:w \g_EQ_widesttag_dim>\z@ - \abovedisplayshortskip=\abovedisplayskip - \rlap{ - \kern-.5\linewidth - \kern\multlinegap - \EQ_use_mathdisplay: - } + \EQ_multline_modify_linewidth_tag: \MH_else: - \EQ_use_mathdisplay: + \EQ_multline_modify_linewidth_notag: \MH_fi: - \MH_or: % #2: - \MH_if_dim:w \g_EQ_widesttag_dim>\z@ - \llap{ + \MH_setlength:dn \l_MT_multwidth_dim{\l_EQ_temp_linewidth_dim} +% \end{macrocode} +% Here is an interesting issue. We have just calculated +% \cs{l_MT_multwidth_dim} which will be the width of the internal +% \env{multline}. But we are typesetting inside \env{gather} inside a +% box of width \cs{l_EQ_temp_linewidth_dim} so the effective width of +% the display is \cs{@mathmargin} less. Solution: add \cs{@mathmargin} +% back in: +% \changes{v2.16}{2020/03/23}{Added \cs{@mathmargin} back into the box +% width} +% \begin{macrocode} + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: \MH_or: % 1 and 2 + \MH_or: + \MH_addtolength:dn + \l_EQ_temp_linewidth_dim{\@mathmargin}% + \MH_or: + \MH_addtolength:dn + \l_EQ_temp_linewidth_dim{\@mathmargin}% + \MH_fi: + } + \def\EQ_modify_linewidth_iv_mult:{\EQ_modify_linewidth_iii_mult:} + \def\EQ_find_displaywidth_iii_mult:{% + \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% + \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}% + \MH_or: % #4: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \MH_fi:} + \def\EQ_find_displaywidth_iv_mult:{\EQ_find_displaywidth_iii_mult:} +% \end{macrocode} +% \changes{v2.16}{2020/03/23}{switched \cs{linewidth} to +% \cs{l_EQ_linewidth_dim} due to amsart forcing full width displays} +% \begin{macrocode} + \def\EQ_place_display_iii_mult:{ + \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-.5\l_EQ_linewidth_dim + \kern\multlinegap + \EQ_use_mathdisplay: + } + \MH_else: \EQ_use_mathdisplay: - \kern-.5\linewidth - \kern\multlinegap - }% - \MH_else: + \MH_fi: + \MH_or: % #2: + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ + \llap{ + \EQ_use_mathdisplay: + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + \kern\multlinegap + }% + \MH_else: + \EQ_use_mathdisplay: + \MH_fi: + \MH_or: % #3: + \EQ_use_mathdisplay: + \MH_or: % #4: \EQ_use_mathdisplay: \MH_fi: - \MH_or: % #3: - \EQ_use_mathdisplay: - \MH_or: % #4: - \EQ_use_mathdisplay: - \MH_fi: -} -\def\EQ_place_display_iv_mult: {\EQ_place_display_iii_mult:} + } + \def\EQ_place_display_iv_mult: {\EQ_place_display_iii_mult:} % \end{macrocode} % \begin{macrocode} -}{ +}{% on to the 'bad' version % \end{macrocode} % The bad % \begin{macrocode} -\def\EQ_generic_multline:nnnnn #1#2#3#4#5{% + \def\EQ_generic_multline:nnnnn #1#2#3#4#5{% % \end{macrocode} % This is a very tricky little detail. If we're in \mode{leqno} mode -% we need just a we little width inside the \env{flalign}, so we put +% we need just a wee little width inside the \env{flalign}, so we put % in the smallest possible amount. Otherwise we wind up in a % \begin{verbatim} % ! Arithmetic overflow. @@ -2946,8 +3051,8 @@ and the derived files % how many users can fix this by themselves? % \changes{v2.15}{2017/03/31}{added MH\_ prefix} % \begin{macrocode} - \hskip1sp#2#3{{}#5}#4% - \MH_if:w *#1\relax\MH_else:\notag\MH_fi:} + \hskip1sp#2#3{{}#5}#4% + \MH_if:w *#1\relax\MH_else:\notag\MH_fi:} % \end{macrocode} % \end{macro} % \end{macro} @@ -2958,51 +3063,51 @@ and the derived files % first three are the general purpose ones that also have a starred % version. The other three are for normal use. % \begin{macrocode} -\def\multleft{\@ifstar{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_left:n} - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {*}{}{\mathrlap}{&&&&&}} - } - \EQ_next:}{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_left:n}% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {}{}{\mathrlap}{&&&&&}} - } - \EQ_next:}}% -\def\multcenter{\@ifstar{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_center:n}% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {*}{&&}{\mathclap}{&&&}} - } - \EQ_next:}{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_center:n }% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {}{&&}{\mathclap}{&&&}} - } - \EQ_next:}}% -\def\multright{\@ifstar{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_right:n }% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {*}{&&&&&}{\mathllap}{}} - } - \EQ_next:}{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_right:n }% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {}{&&&&&}{\mathllap}{}} - } - \EQ_next:}} + \def\multleft{\@ifstar{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_left:n} + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {*}{}{\mathrlap}{&&&&&}} + } + \EQ_next:}{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_left:n}% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {}{}{\mathrlap}{&&&&&}} + } + \EQ_next:}}% + \def\multcenter{\@ifstar{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_center:n}% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {*}{&&}{\mathclap}{&&&}} + } + \EQ_next:}{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_center:n }% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {}{&&}{\mathclap}{&&&}} + } + \EQ_next:}}% + \def\multright{\@ifstar{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_right:n }% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {*}{&&&&&}{\mathllap}{}} + } + \EQ_next:}{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_right:n }% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {}{&&&&&}{\mathllap}{}} + } + \EQ_next:}} % \end{macrocode} % \end{macro} % \end{macro} @@ -3014,65 +3119,70 @@ and the derived files % 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 }% - }{ - \MH_if_case:w \l_EQ_alignmentmode_int - \MH_or: % #1: - \def\EQ_next:{\multleft}% - \MH_or: % #2: - \def\EQ_next:{\multleft*}% - \MH_or: % #3: - \def\EQ_next:{\multleft}% - \MH_or: % #4: - \def\EQ_next:{\multleft*}% - \MH_fi: - } - \EQ_next:} -% \end{macrocode} -% Pretend the star was never there. -% \begin{macrocode} -\def\multmiddle{% - \def\EQ_next:{% + \def\multfirst{% \MH_if_boolean:nTF {multlined}{ - \expandafter\EQ_multlined_center:n + \def\EQ_next:{\EQ_multlined_left:n }% }{ - \expandafter\multcenter + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \def\EQ_next:{\multleft}% + \MH_or: % #2: + \def\EQ_next:{\multleft*}% + \MH_or: % #3: + \def\EQ_next:{\multleft}% + \MH_or: % #4: + \def\EQ_next:{\multleft*}% + \MH_fi: } - }% - \@ifstar{\EQ_next:}{\EQ_next:}} + \EQ_next:} +% \end{macrocode} +% Pretend the star was never there. +% \begin{macrocode} + \def\multmiddle{% + \def\EQ_next:{% + \MH_if_boolean:nTF {multlined}{ + \expandafter\EQ_multlined_center:n + }{ + \expandafter\multcenter + } + }% + \@ifstar{\EQ_next:}{\EQ_next:}} % \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 }% - }{ - \MH_if_case:w \l_EQ_alignmentmode_int - \MH_or: % #1: - \def\EQ_next:{\multright*}% - \MH_or: % #2: - \def\EQ_next:{\multright}% - \MH_or: % #3: - \def\EQ_next:{\multright*}% - \MH_or: % #4: - \def\EQ_next:{\multright}% - \MH_fi: - } - \EQ_next:} + \def\multlast{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_right:n }% + }{ + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \def\EQ_next:{\multright*}% + \MH_or: % #2: + \def\EQ_next:{\multright}% + \MH_or: % #3: + \def\EQ_next:{\multright*}% + \MH_or: % #4: + \def\EQ_next:{\multright}% + \MH_fi: + } + \EQ_next:} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \begin{macro}{\multlinedwidth} % Here begins the code for \env{multlined}. -% \begin{macrocode} -\MH_new_boolean:n {multlined} -\newdimen\multlinedwidth -\MH_setlength:dn \multlinedwidth{.7\linewidth} +% \changes{v2.16}{2020/03/23}{switched \cs{linewidth} to +% \cs{l_EQ_linewidth_dim} due to amsart forcing full width displays} +% \begin{macrocode} + \MH_new_boolean:n {multlined} + \newdimen\multlinedwidth + \MH_setlength:dn \multlinedwidth{ + % .7\linewidth + 0.7\l_EQ_linewidth_dim + } % \end{macrocode} % \end{macro} % \begin{environment}{multlined} @@ -3084,25 +3194,25 @@ and the derived files % Some trickery as we want to scan for two optional arguments that % may be interchanged. % \begin{macrocode} -\renewenvironment{multlined}% - {\MH_nospace_ifnextchar:Nnn [ {\EQ_multlined_I:w} - {\EQ_multlined_I:w[c]} - } - { \endaligned } -\def\EQ_multlined_I:w[#1]{% - \MH_nospace_ifnextchar:Nnn[ {\EQ_multlined_II:w[#1]} - {\EQ_multlined_II:w[#1][\multlinedwidth]}} -\def\EQ_multlined_II:w[#1][#2]{% + \renewenvironment{multlined}% + {\MH_nospace_ifnextchar:Nnn [ {\EQ_multlined_I:w} + {\EQ_multlined_I:w[c]} + } + { \endaligned } + \def\EQ_multlined_I:w[#1]{% + \MH_nospace_ifnextchar:Nnn[ {\EQ_multlined_II:w[#1]} + {\EQ_multlined_II:w[#1][\multlinedwidth]}} + \def\EQ_multlined_II:w[#1][#2]{% % \end{macrocode} % We tell \LaTeX\ that we're in \env{multlined}. % \begin{macrocode} - \MH_set_boolean_T:n {multlined} + \MH_set_boolean_T:n {multlined} % \end{macrocode} % \changes{v2.10}{2004/07/26}{Fixed restoration of \cmd{\\}} % Restore the meaning of \cmd{\\} inside \env{multlined}, else it % wouldn't work in the \env{equation} environment. % \begin{macrocode} - \MH_let:NwN \Let@\MT_saved_Let: + \MH_let:NwN \Let@\MT_saved_Let: % \end{macrocode} % Then check the first optional argument and call % \cs{EQ_multlined_III:w}, which sets \cs{multlinewidth} if @@ -3110,21 +3220,21 @@ and the derived files % three columns). % \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_if:w t#1\relax \EQ_multlined_III:nn {#1}{#2}% \MH_else: - \MH_if:w c#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_if:w b#1\relax \EQ_multlined_III:nn {#1}{#2}% \MH_else: - \EQ_multlined_III:nn {#2}{#1}% + \MH_if:w c#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_else: + \EQ_multlined_III:nn {#2}{#1}% + \MH_fi: \MH_fi: \MH_fi: - \MH_fi: - \mkern-\thinmuskip - \EQ_next:} -\def\EQ_multlined_III:nn #1#2{% - \def\EQ_next:{\setlength\multlinedwidth{#2}% - \start@aligned{#1}{\thr@@}}} + \mkern-\thinmuskip + \EQ_next:} + \def\EQ_multlined_III:nn #1#2{% + \def\EQ_next:{\setlength\multlinedwidth{#2}% + \start@aligned{#1}{\thr@@}}} % \end{macrocode} % \end{macro} % \end{macro} @@ -3136,12 +3246,12 @@ and the derived files % The internal versions of \cs{multleft} etc.\ adapted for % \env{multlined}. % \begin{macrocode} -\def\EQ_multlined_left:n #1{% - \mathrlap{#1}&\hskip.5\multlinedwidth&&\hskip.5\multlinedwidth&&} -\def\EQ_multlined_center:n #1{% - &\hskip.5\multlinedwidth&&\mathclap{#1}\hskip.5\multlinedwidth&&} -\def\EQ_multlined_right:n #1{% - &\hskip.5\multlinedwidth&&\hskip.5\multlinedwidth&&\mathllap{#1}} + \def\EQ_multlined_left:n #1{% + \mathrlap{#1}&\hskip.5\multlinedwidth&&\hskip.5\multlinedwidth&&} + \def\EQ_multlined_center:n #1{% + &\hskip.5\multlinedwidth&&\mathclap{#1}\hskip.5\multlinedwidth&&} + \def\EQ_multlined_right:n #1{% + &\hskip.5\multlinedwidth&&\hskip.5\multlinedwidth&&\mathllap{#1}} % \end{macrocode} % \end{macro} % \end{macro} @@ -3155,12 +3265,16 @@ and the derived files % \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} +% \changes{v2.16}{2020/03/23}{switched \cs{linewidth} to +% \cs{l_EQ_linewidth_dim} due to amsart forcing full width displays} % \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:{}}}% + % \linewidth + \l_EQ_linewidth_dim + -\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ \EQ_multline_modify_linewidth_tag: @@ -3190,16 +3304,24 @@ and the derived files \MH_setlength:dn \l_EQ_displaywidth_dim{\l_EQ_temp_linewidth_dim}} \def\EQ_find_displaywidth_vi:{\EQ_find_displaywidth_v:} +% \end{macrocode} +% \changes{v2.16}{2020/03/23}{switched \cs{linewidth} to +% \cs{l_EQ_linewidth_dim} due to amsart forcing full width displays} +% \begin{macrocode} \def\EQ_place_display_v:{% \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 + \rlap{\kern\multlinegap + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim \EQ_use_mathdisplay: \kern-\mintagsep \kern\multlinetaggap}% }{ - \rlap{\kern-.5\linewidth\EQ_use_mathdisplay:}% + \rlap{%\kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + \EQ_use_mathdisplay:}% } \MH_else: \EQ_use_mathdisplay: @@ -3209,15 +3331,27 @@ and the derived files \MH_if_boolean:nTF {multline}{ \llap{\kern-\mintagsep \kern\multlinetaggap \EQ_use_mathdisplay: - \kern\multlinegap \kern-.5\linewidth}% + \kern\multlinegap + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + }% }{ - \llap{\EQ_use_mathdisplay:\kern-.5\linewidth}% + \llap{\EQ_use_mathdisplay: + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + }% } \MH_else: \EQ_use_mathdisplay: \MH_fi: \MH_or: % #3: - \MH_if_boolean:nF {multline}{ \kern-\multlinetaggap } +% \end{macrocode} +% \changes{v2.16}{2020/03/24}{\cs{multlinetaggap} should be added when +% \opt{multline} is true, and if false \cs{\@mathmargin} should ned +% kerned away} +% \begin{macrocode} + \MH_if_boolean:nTF {multline}{ \kern-\multlinetaggap } + { \kern-\@mathmargin } \EQ_use_mathdisplay: \MH_or: % #4: \MH_if_dim:w \g_EQ_widesttag_dim>\z@ @@ -3538,6 +3672,81 @@ and the derived files % \end{macro} % % +% \subsection{Adjusting for \cls{amsart} and \cls{amsbook}} +% \label{sec:adjust-clsams-clsams} +% +% As mentioned earlier the \AmS{} classes \cls{amsart} and +% \cls{amsbook} explicitly sets \cs{displaywidth} to +% \cs{columnwidth}. The main reason for this (1) they use equation +% numbers on the left and (2) if an equation is inside a list, they +% still want the equation to use the full width (the standard classes +% under \opt{leqno} will have their equation number indented to match +% the effective line width/indentation). +% +% Why is problematic for us? Firstly, this messes up our trick to +% separate the tags (equation numbers) from the display (as we need +% the construction to follow our \emph{very large} line +% width). Secondly this messes up the calculations of \cs{alignsep@}, +% since we can no longer assume that \cs{alignsep@} was calculated +% against the with of the box we wanted. Here is an example that +% \begin{verbatim} +% \makeatletter +% \begingroup +% \fbox{\parbox{0.5\textwidth}{% +% \def\maketag@@@#1{\kern1sp\vphantom{#1}}% +% \begin{align} +% align &= align & align &= align \\ &= align +% \end{align}}} +% \par\noindent +% \def\fullwidthdisplay{\displayindent\z@ \displaywidth\columnwidth} +% \edef\@tempa{\noexpand\fullwidthdisplay\the\everydisplay} +% \everydisplay\expandafter{\@tempa} +% \fbox{\parbox{0.5\textwidth}{% +% \def\maketag@@@#1{\kern1sp\vphantom{#1}}% +% \begin{align} +% align &= align & align &= align \\ &= align +% \end{align}}\vspace{-2\baselineskip}} +% \endgroup +% \makeatletter +% \end{verbatim} +% \makeatletter +% \begingroup^^A +% \fboxsep=2pt +% \abovedisplayskip0pt +% \belowdisplayskip0pt +% \abovedisplayshortskip0pt +% \belowdisplayshortskip0pt +% \fbox{\parbox{0.5\textwidth}{% +% \def\maketag@@@#1{\kern1sp\vphantom{#1}}% +% \begin{align} +% align &= align & align &= align \\ &= align +% \end{align}}} +% \par\noindent +% \def\fullwidthdisplay{\displayindent\z@ \displaywidth\columnwidth}^^A +% \edef\@tempa{\noexpand\fullwidthdisplay\the\everydisplay}^^A +% \everydisplay\expandafter{\@tempa}^^A +% \fbox{\parbox{0.5\textwidth}{% +% \def\maketag@@@#1{\kern1sp\vphantom{#1}}% +% \begin{align} +% align &= align & align &= align \\ &= align +% \end{align}}\vspace{-2\baselineskip}} +% \endgroup +% \makeatletter +% \par\medskip\noindent +% It is pretty obvious that the space between the two alignment +% columns are wrong. Like when we handled the tag separation, one +% solution could be to explicitly set \cs{columnwidth} to be the +% effective line width. Alternatively we could redefine +% \cs{fullwidthdisplay} to do nothing. The latter is probably the +% less severe. +% \begin{macrocode} +\g@addto@macro\EQ_typeset_display_hook:{ + % \columnwidth\linewidth + \def\fullwidthdisplay{} +} +% \end{macrocode} +% +% % \section{The \opt{overload} option} % \begin{macro}{\EQ_overload_ams_begin:n} % A helper for saving snapshots: diff --git a/Master/texmf-dist/source/latex/mathtools/empheq.ins b/Master/texmf-dist/source/latex/mathtools/empheq.ins new file mode 100644 index 00000000000..632545df724 --- /dev/null +++ b/Master/texmf-dist/source/latex/mathtools/empheq.ins @@ -0,0 +1,94 @@ +%% +%% This is file `empheq.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% empheq.dtx (with options: `install') +%% +%% This is a generated file. +%% +%% Copyright (C) 2002-2007 by Morten Hoegholm +%% Copyright (C) 2012-2019 by Lars Madsen +%% Copyright (C) 2020- by Lars Madsen, The LaTeX3 Project +%% +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is +%% Lars Madsen, The LaTeX3 Project +%% +%% This work consists of the main source file empheq.dtx +%% and the derived files +%% empheq.sty, empheq.pdf, empheq.ins, empheq.drv. +%% +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: empheq 2017/03/31 v2.15 empheq} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\preamble + +This is a generated file. + +Copyright (C) 2002-2007 by Morten Hoegholm +Copyright (C) 2012-2019 by Lars Madsen +Copyright (C) 2020- by Lars Madsen, The LaTeX3 Project + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 of this license or (at your option) any later +version. The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +This Current Maintainer of this work is +Lars Madsen, The LaTeX3 Project + +This work consists of the main source file empheq.dtx +and the derived files + empheq.sty, empheq.pdf, empheq.ins, empheq.drv. + +\endpreamble + +\generate{% + \file{empheq.ins}{\from{empheq.dtx}{install}}% + \file{empheq.drv}{\from{empheq.dtx}{driver}}% + \usedir{tex/latex/mh}% + \file{empheq.sty}{\from{empheq.dtx}{package}}% +} + +\obeyspaces +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* empheq.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `empheq.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +\endinput +%% +%% End of file `empheq.ins'. diff --git a/Master/texmf-dist/source/latex/mathtools/mathtools.dtx b/Master/texmf-dist/source/latex/mathtools/mathtools.dtx index 0a08c4fb26c..472c713942f 100644 --- a/Master/texmf-dist/source/latex/mathtools/mathtools.dtx +++ b/Master/texmf-dist/source/latex/mathtools/mathtools.dtx @@ -1,7 +1,8 @@ % \iffalse meta-comment % % Copyright (C) 2004-2011 by Morten Hoegholm -% Copyright (C) 2012- by Lars Madsen +% Copyright (C) 2012-2019 by Lars Madsen +% Copyright (C) 2020 by Lars Madsen, The LaTeX3 team % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -68,7 +69,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: mathtools 2020/01/17 v1.23} +\Msg{* Package: mathtools 2020/03/24 v1.24} \Msg{************************************************************************} \keepsilent @@ -79,7 +80,8 @@ This is a generated file. Copyright (C) 2002-2011 by Morten Hoegholm -Copyright (C) 2012- by Lars Madsen +Copyright (C) 2012-2019 by Lars Madsen +Copyright (C) 2020 by Lars Madsen, the LaTeX3 project This work may be distributed and/or modified under the @@ -93,7 +95,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 +Lars Madsen and the LaTeX3 project This work consists of the main source file mathtools.dtx and the derived files @@ -131,7 +133,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{mathtools.drv}% - [2020/01/17 v1.23 mathematical typesetting tools] + [2020/03/24 v1.24 mathematical typesetting tools] \documentclass{ltxdoc} \IfFileExists{fourier.sty}{\usepackage{fourier}}{} \addtolength\marginparwidth{-25pt} @@ -319,12 +321,12 @@ colorlinks, % % \GetFileInfo{mathtools.drv} % -% \CheckSum{3144} +% \CheckSum{3333} % % \title{The \pkg{mathtools} package\thanks{This file has version number % \fileversion, last revised \filedate.}} % -% \author{Morten H\o gholm, Lars Madsen} +% \author{Morten Høgholm, Lars Madsen and the \LaTeX3 project} % \date{\filedate} % % \maketitle @@ -354,19 +356,20 @@ colorlinks, % lists over the years, although more often than not without being % released as stand-alone packages. % -% % The \pkg{mathtools} package is exactly what its name implies: tools % for mathematical typesetting. It is a collection of many of these % often needed small tweaks---with some big tweaks added as well. It % can only do so by having harvesting newsgroups for code and/or you % writing the maintainers with wishes for code to be included, so if % you have any good macros or just macros that help you when writing -% mathematics, then don't hesitate to report them. It is -% easiest to just contact Lars Madsen at -% \begin{quote}\email{daleif@math.au.dk}\end{quote} -% This is of course also the address to use in case of bug reports. -% Please put `\texttt{mathtools}' in the subject line. -% +% mathematics, then don't hesitate to report them. +% +% As of 2020, \pkg{mathtools} (and \pkg{empheq}) is now hosted at the +% \LaTeX3 team GitHub at +% \begin{center} +% \url{https://github.com/latex3/mathtools} +% \end{center} +% So if you have any issue, feel free to register an issue there. % % \medskip\noindent % Update 2013: We now make \cs{(}\cs{)} and \cs[\cs] @@ -1117,6 +1120,12 @@ colorlinks, % A &\xrightleftharpoons[below]{above} B & % A &\xleftrightharpoons[below]{above} B \\ % \end{align*} +% Change in 2020: In \cs{xLeftarrow}, \cs{xRightarrow} and +% \cs{xLeftrightarrow} we added a space to the argument(s), making +% the arrow slightly longer and moving the argument away from the +% large arrow head. +% +% % % % @@ -1748,16 +1757,22 @@ colorlinks, % doing this as a normal line in an alignment leaves us with excessive % space which \verb?\shortvdotswithin{=}? takes care with for us. % -% \verb?\shortvdotswithin{=}? corresponds to +% The macro call \verb?\shortvdotswithin{=}? corresponds to +% \begin{verbatim} +% \MTFlushSpaceAbove +% & \vdotswithin{=} +% \MTFlushSpaceBelow +% \end{verbatim} +% whereas \verb?\shortvdotswithin*{=}? is the case with % \begin{verbatim} % \MTFlushSpaceAbove -% & \vdotswithin{=} \\ +% \vdotswithin{=} & % \MTFlushSpaceBelow % \end{verbatim} -% whereas \verb?\shortvdotswithin*{=}? is the case with -% \verb?\vdotswithin{=} & \\?. This also means one cannot write more -% on the line when using \verb?\shortvdotswithin? or the starred -% version. But one can de-construct the macro and arrive at +% Note how \verb?\MTFlushSpaceBelow? implicitly adds a \verb?\\? at +% the end of the line. Thus one cannot have more on the line when +% using \verb?\shortvdotswithin? or the starred version. But, if +% needed, one can de-construct the macro and arrive at % \begin{verbatim} % \begin{alignat*}{3} % A&+ B &&= C &&+ D \\ @@ -2635,8 +2650,8 @@ colorlinks, % \subsection{Split fractions} % % \begin{codesyntax} -% \SpecialUsageIndex{\splitfrac}\cs{splitfrac}\marg{numer}\marg{denom}\texttt{~~} -% \SpecialUsageIndex{\splitdfrac}\cs{splitdfrac}\marg{numer}\marg{denom} +% \SpecialUsageIndex{\splitfrac}\cs{splitfrac}\marg{start line}\marg{continuation}\\ +% \SpecialUsageIndex{\splitdfrac}\cs{splitdfrac}\marg{start line}\marg{continuation} % \end{codesyntax} % \cttPosting{Michael J.~Downes}{2001/12/06} % These commands provide split fractions e.g., multiline fractions: @@ -2666,6 +2681,160 @@ colorlinks, % } % {z} % \] +% The difference between \cs{splitfrac} and \cs{splitdfrac} is that +% the former forces its arguments to be typeset in text-mode math, the +% latter does not. +% +% \medskip\noindent \textbf{Note:} If you try to nest \cs{splitfrac} +% inside each other you may need to add \cs{mathstrut} to the first +% argument of the nested fraction to get the spacing look even. It is +% not added by default as often a more cramped looked is desired: +% \begin{verbatim} +% \[ +% \frac{ +% \splitfrac{xy + xy + xy + xy + xy} +% { +% \splitfrac{xy + xy + xy + xy + xy} +% {+ xy + xy + xy + xy} +% } +% } +% {z} +% =\frac{ +% \splitfrac{xy + xy + xy + xy + xy} +% { +% \splitfrac{\mathstrut xy + xy + xy + xy + xy} +% {+ xy + xy + xy + xy} +% } +% } +% {z} +% \] +% \end{verbatim} +% \[ +% \frac{ +% \splitfrac{xy + xy + xy + xy + xy} +% { +% \splitfrac{xy + xy + xy + xy + xy} +% {+ xy + xy + xy + xy} +% } +% } +% {z} +% =\frac{ +% \splitfrac{xy + xy + xy + xy + xy} +% { +% \splitfrac{\mathstrut xy + xy + xy + xy + xy} +% {+ xy + xy + xy + xy} +% } +% } +% {z} +% \] +% Note how the line spaces aren't even on the left hand side. +% +% For even more control, one can use \env{aligned} or \env{gathered} +% instead of \cs{splitfrac}. +% +% +% \newpage +% +% \section{New additions} +% +% \subsection{Variable math strut} +% \begin{codesyntax} +% \SpecialUsageIndex{\xmathstrut}\cs{xmathstrut}\oarg{depth increase}\marg{increase} +% \end{codesyntax} +% \FeatureRequest{Frank Mittelbach}{2020} In typography we use +% \emph{struts} to ensure specific line spacing. In text we have the +% \cs{strut} and in math \cs{mathstrut}. Both have no width, but +% equals the height and depth of an »(« from the current text/math +% font and size. In math we often need to make minute adjustments in +% macro definitiones etc. The \emph{extended} math strut +% \cs{xmathstrut} allows to \emph{increase} (decrease if negative) +% the math strut in two ways. +% +% For an \meta{increase} (a decimal number), say~\verb|0.1|, +% \begin{center} +% \verb|\xmathstrut{0.1}| +% \end{center} +% will give you a new strut where 10\% of the \emph{total height of +% the normal math stut} (\verb|\mathstrut=\mathstrut{0}|) will be +% added to both \emph{the height} and \emph{the depth} of the +% original strut (thus 20\% gets added in total). On the other hand +% \begin{center} +% \verb|\xmathstrut[0.2]{0.1}| +% \end{center} +% will result in a strut where 20\% is added to the depth and 10\% is +% added to the height, resulting in a strut that is 30\% larger than +% normal. +% +% The following example is inspired (with permission) from an example +% showcasing \cs{xmathstrut} in the upcoming third edition of +% \emph{The LaTeX Companion}. The example is very relevant as the +% entries of the \env{cases(*)} environment are typeset in \emph{text +% style} math and thus may end up looking quite +% squished.\footnote{Which is why Frank suggested the macro +% (including its implementation) in the first place.} +% \[ +% \begin{cases*} +% \frac{\frac{ x-1 }{ x-\sin x} }{ \sqrt{ 1 -x }} & $x >0$ \\ +% 0 & otherwise +% \end{cases*} +% \qquad\text{vs.}\qquad +% \begin{cases*} +% \frac{\frac{ \xmathstrut{0.1} x-1 }{ \xmathstrut{0.25} x-\sin x} }{\xmathstrut{0.4} \sqrt{ 1 -x }} & $x >0$ \\ +% 0 & otherwise +% \end{cases*} +% \] +% \begin{verbatim} +% \[ \begin{cases*} +% \frac{\frac{ x-1 }{ x-\sin x} }{ \sqrt{ 1 -x }} & $x >0$ \\ +% 0 & otherwise +% \end{cases*} +% \qquad\text{vs.}\qquad +% \begin{cases*} +% \frac{ \frac{ \xmathstrut{0.1} x-1 } +% { \xmathstrut{0.25} x-\sin x} } +% {\xmathstrut{0.4} \sqrt{ 1 -x } } & $x >0$ \\ +% 0 & otherwise +% \end{cases*} \] +% \end{verbatim} +% +% To showcase the optional argument, it is +% probably easiest to make the strut visible. Here you'll see that +% \verb|\mathstrut| and \verb|\xmathstrut{0}| is the same: +% \newcommand\vfb[1]{\begingroup\fboxsep=0pt\boxed{\,#1\,}\endgroup} +% \[ +% \llap{\rlap{\rule{18mm}{0.1pt}}\quad}a \vfb{\mathstrut} \ \vfb{\xmathstrut{0}}\ +% \vfb{\xmathstrut{0.5} } \ \vfb{\xmathstrut{-0.1} }\ \vfb{\xmathstrut[0.5]{0}} a +% \] +% \begin{verbatim} +% \newcommand\vfb[1]{\begingroup\fboxsep=0pt\boxed{\,#1\,}\endgroup} +% \[ +% a \vfb{\mathstrut} \ % normal strut +% \vfb{\xmathstrut{0}} \ % just 0 => normal strut +% \vfb{\xmathstrut{0.5} } \ % twice as large 50% + 50% +% \vfb{\xmathstrut{-0.1} } \ % negative gives something smaller +% \vfb{\xmathstrut[0.5]{0}} a % change only the depth +% \] +% \end{verbatim} +% -- the last box showcases a strut where we have only changed the +% depth of the strut. One can see \verb|\xmathstrut[B]{0}| kind of the +% opposite of \verb|\smash[b]{...}|, the former makes the depth larger +% and the latter ignores the depth. +% +% +% +% +% +% +% +% +% +% +% +% +% +% +% +% % % % @@ -2676,6 +2845,10 @@ colorlinks, % % % +% +% +% +% % % % @@ -2789,10 +2962,12 @@ colorlinks, % Ellen Swanson, % \emph{Mathematics into type}. % American Mathematical Society, updated edition, 1999. -% Updated by Arlene O'Sean and Antoinette Schleyer. +% Updated by Arlene O'Sean and Antoinette Schleyer. Available from +% the AMS at \url{http://www.ams.org/arc/styleguide/mit-2.pdf} +% % \bibitem{TBT} % Victor Eijkhout, \emph{\TeX\ by Topic, A Texnician's Reference}, 2007. -% Freely available at \url{http://ctan.org/tex-archive/info/texbytopic}. +% Freely available at \url{https://ctan.org/pkg/texbytopic}. % \end{thebibliography} % % @@ -2806,7 +2981,7 @@ colorlinks, % \begin{macrocode} %<*package> \ProvidesPackage{mathtools}% - [2020/01/17 v1.23 mathematical typesetting tools] + [2020/03/24 v1.24 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}} @@ -3361,17 +3536,20 @@ colorlinks, % \begin{macro}{\xLeftrightarrow} % % These are straight adaptions from \pkg{amsmath}. +% \changes{v1.24}{2020/03/13}{Added spaces to move the argument away +% from the arrow head in \cs{xLeftarrow}, \cs{xRightarrow} and +% \cs{xLeftrightarrow}. Suggested by FM} % \begin{macrocode} \providecommand*\xleftrightarrow[2][]{% \ext@arrow 3095\MT_leftrightarrow_fill:{#1}{#2}} \def\MT_leftrightarrow_fill:{% \arrowfill@\leftarrow\relbar\rightarrow} \providecommand*\xLeftarrow[2][]{% - \ext@arrow 0055{\Leftarrowfill@}{#1}{#2}} + \ext@arrow 0055{\Leftarrowfill@}{\ #1}{\ #2}} \providecommand*\xRightarrow[2][]{% - \ext@arrow 0055{\Rightarrowfill@}{#1}{#2}} + \ext@arrow 0055{\Rightarrowfill@}{#1\ }{#2\ }} \providecommand*\xLeftrightarrow[2][]{% - \ext@arrow 0055{\Leftrightarrowfill@}{#1}{#2}} + \ext@arrow 0055{\Leftrightarrowfill@}{\ #1\ }{\ #2\ }} % \end{macrocode} % \end{macro} % \end{macro} @@ -6138,7 +6316,7 @@ colorlinks, {\textstyle#1\quad\hfill}% {\textstyle\hfill\quad\mathstrut#2}% } -\newcommand*\splitdfrac[2]{% +\newcommand*\splitdfrac[2]{% \genfrac{}{}{0pt}{0}{#1\quad\hfill}{\hfill\quad\mathstrut #2}% } % \end{macrocode} @@ -6266,6 +6444,66 @@ colorlinks, % \end{macrocode} % \end{macro} % +% \section{Additional features 2020–} +% +% The selection below is meant for additions addeed 2020 onwards that +% are not integrated into existing macros. +% +% \subsection{\cs{xmathstrut}} +% +% \begin{macro}{\xmathstrut@box} +% \begin{macro}{\xmathstrut@dim} +% \begin{macro}{\xmathstrut} +% \begin{macro}{\xmathstrut@} +% \begin{macro}{\xmathstrut@do} +% Suggested and implemented by Frank Mittelbach. The basic idea is to +% add (or subtract) a fraction of the total height of the normal math +% strut to both the height and depth of the new strut. The input from +% the user is suppose to be a decimal number. The value zero results +% in no change compared to the normal math strut. +% \changes{v1.24}{2020/03/06}{Added \cs{xmathstrut}} +% \begin{macrocode} +\newbox\xmathstrut@box +\newdimen\xmathstrut@dim +\def\xmathstrut{\@dblarg\xmathstrut@} +\def\xmathstrut@[#1]#2{% + \def\xmathstrut@dp{#1}% + \vphantom{\mathpalette\xmathstrut@do{#2}}% +} +% \end{macrocode} +% The algorithm is simple. Start by recording the size (a box) of \verb|$($| +% in the current style (via \verb|\mathpalette|) +% \begin{macrocode} +\def\xmathstrut@do#1#2{% + \setbox\xmathstrut@box\hbox{$#1($}%)%emacs + \xmathstrut@dim\dimexpr\ht\xmathstrut@box+\dp\xmathstrut@box\relax +% \end{macrocode} +% Then manipulate the size of the box by adding the user input times +% the total height of the original box to the height and depth +% respectfully. +% \begin{macrocode} + \ht\xmathstrut@box\dimexpr\ht\xmathstrut@box + +#2\xmathstrut@dim + \relax + \dp\xmathstrut@box\dimexpr\dp\xmathstrut@box + +\xmathstrut@dp\xmathstrut@dim + \relax +% \end{macrocode} +% In the end ship the modified box (it is typeset inside a \verb|\vphantom|). +% \begin{macrocode} + \box\xmathstrut@box} + +% \end{macrocode} +% Do note that this means that for \verb|\xmathstrut{0.1}| 10\% is +% added twice. But it make explaining \verb|\xmathstrut[0.2]{0.1}| a +% lot easier as it is just 10\% added to the height and 20\% added to +% the depth. +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % This is the end of the \pkg{mathtools} package. % \begin{macrocode} % diff --git a/Master/texmf-dist/source/latex/mathtools/mathtools.ins b/Master/texmf-dist/source/latex/mathtools/mathtools.ins new file mode 100644 index 00000000000..7cb4e3727cf --- /dev/null +++ b/Master/texmf-dist/source/latex/mathtools/mathtools.ins @@ -0,0 +1,94 @@ +%% +%% This is file `mathtools.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mathtools.dtx (with options: `install') +%% +%% This is a generated file. +%% +%% Copyright (C) 2002-2011 by Morten Hoegholm +%% Copyright (C) 2012-2019 by Lars Madsen +%% Copyright (C) 2012-2020 by Lars Madsen, the LaTeX3 project +%% +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is +%% Lars Madsen and the LaTeX3 project +%% +%% This work consists of the main source file mathtools.dtx +%% and the derived files +%% mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv. +%% +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: mathtools 2020/01/17 v1.23} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\preamble + +This is a generated file. + +Copyright (C) 2002-2011 by Morten Hoegholm +Copyright (C) 2012-2019 by Lars Madsen +Copyright (C) 2012-2020 by Lars Madsen, the LaTeX3 project + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 of this license or (at your option) any later +version. The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +This Current Maintainer of this work is +Lars Madsen and the LaTeX3 project + +This work consists of the main source file mathtools.dtx +and the derived files + mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv. + +\endpreamble + +\generate{% + \file{mathtools.ins}{\from{mathtools.dtx}{install}}% + \file{mathtools.drv}{\from{mathtools.dtx}{driver}}% + \usedir{tex/latex/mh}% + \file{mathtools.sty}{\from{mathtools.dtx}{package}}% +} + +\obeyspaces +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* mathtools.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `mathtools.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +\endinput +%% +%% End of file `mathtools.ins'. diff --git a/Master/texmf-dist/source/latex/mathtools/mhsetup.dtx b/Master/texmf-dist/source/latex/mathtools/mhsetup.dtx index ffd0833dbaa..b44eea12cbe 100644 --- a/Master/texmf-dist/source/latex/mathtools/mhsetup.dtx +++ b/Master/texmf-dist/source/latex/mathtools/mhsetup.dtx @@ -1,7 +1,8 @@ % \iffalse meta-comment % % Copyright (C) 2002-2007,2010 by Morten Hoegholm -% Copyright (C) 2017 by Lars Madsen +% Copyright (C) 2017-2019 by Lars Madsen +% Copyright (C) 2020- by Lars Madsen, The LaTeX3 team % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -13,7 +14,9 @@ % % This work has the LPPL maintenance status "maintained". % -% This Current Maintainer of this work is Lars Madsen +% This Current Maintainer of this work is Lars Madsen +% , the LaTeX3 team, +% https://github.com/latex3/mathtools % % This work consists of the main source file mhsetup.dtx % and the derived files @@ -78,7 +81,8 @@ This is a generated file. Copyright (C) 2002-2007,2010 by Morten Hoegholm -Copyright (C) 2017 by Lars Madsen +Copyright (C) 2017-2019 by Lars Madsen +Copyright (C) 2020- by Lars Madsen, The LaTeX3 team This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -90,7 +94,8 @@ LaTeX version 2005/12/01 or later. This work has the LPPL maintenance status "maintained". -This Current Maintainer of this work is Lars Madsen +This Current Maintainer of this work is Lars Madsen +, The LaTeX3 team https://github.com/latex3/mathtools This work consists of the main source file mhsetup.dtx and the derived files @@ -163,7 +168,7 @@ 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 (maintained by Lars Madsen)} +% \author{Morten H\o gholm (maintained by Lars Madsen and The LaTeX3 team)} % \date{\filedate} % \maketitle % diff --git a/Master/texmf-dist/tex/latex/mathtools/empheq.sty b/Master/texmf-dist/tex/latex/mathtools/empheq.sty index 1c24bc158ab..380410b66f0 100644 --- a/Master/texmf-dist/tex/latex/mathtools/empheq.sty +++ b/Master/texmf-dist/tex/latex/mathtools/empheq.sty @@ -9,7 +9,8 @@ %% This is a generated file. %% %% Copyright (C) 2002-2007 by Morten Hoegholm -%% Copyright (C) 2012- by Lars Madsen +%% Copyright (C) 2012-2019 by Lars Madsen +%% Copyright (C) 2020- by Lars Madsen, The LaTeX3 Project %% %% %% This work may be distributed and/or modified under the @@ -23,7 +24,7 @@ %% This work has the LPPL maintenance status "maintained". %% %% This Current Maintainer of this work is -%% Lars Madsen +%% Lars Madsen, The LaTeX3 Project %% %% This work consists of the main source file empheq.dtx %% and the derived files @@ -75,6 +76,7 @@ \newdimen\l_EQ_displaywidth_dim \def\EmphEqdisplaywidth{\l_EQ_displaywidth_dim} \newdimen\l_EQ_temp_linewidth_dim +\newdimen\l_EQ_linewidth_dim \newdimen\EmphEqdelimitershortfall \newcount\EmphEqdelimiterfactor \EmphEqdelimiterfactor950 @@ -117,8 +119,8 @@ \MH_else: \setkeys{\MT_options_name:}{multlined-pos=t} \MH_fi: - \g@addto@macro\EQ_complete_mathdisplay:{ - \begin{MTmultlined}\relax} + \g@addto@macro\EQ_complete_mathdisplay:{ + \begin{MTmultlined}\relax} } \g@addto@macro\EQ_complete_mathdisplay:\EQ_mathbody: \MH_if_boolean:nT {outer_mult}{ @@ -190,6 +192,19 @@ \MH_let:NwN\SetTagPlusEndMark\EQ_tag_plus_endmark: \MH_let:NwN\SetOnlyEndMark\EQ_only_endmark: \l_EQ_temp_linewidth_dim\linewidth + \l_EQ_linewidth_dim\linewidth + \@tempdima\z@ + \begingroup + \ifdefined\fullwidthdisplay\relax + \fullwidthdisplay + \global\@tempdima\displaywidth + \fi + \endgroup + \ifdim\@tempdima>\linewidth\relax + \l_EQ_temp_linewidth_dim\@tempdima + \l_EQ_linewidth_dim\@tempdima + \fi + \@tempdima\z@ \g_EQ_toprow_height_dim\z@ \g_EQ_bottomrow_depth_dim\z@ \g_EQ_toptag_height_dim\z@ @@ -420,7 +435,9 @@ \MH_if_num:w \maxfields@=\tw@ \MH_else: \setlength{\l_EQ_temp_linewidth_dim}{% - \linewidth-\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% + % \linewidth + \l_EQ_linewidth_dim + -\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% \MH_fi:} \def\EQ_modify_linewidth_ii:{\EQ_modify_linewidth_i:} \def\EQ_find_displaywidth_i:{% @@ -492,191 +509,209 @@ \MH_let:NwN \MTmultlined \multlined \MH_let:NwN \endMTmultlined \endmultlined \MH_if_boolean:nTF {good_mult}{ -\MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline}{gather} - {\MH_set_boolean_T:n {outer_mult}} -\MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline*}{gather*} - {\MH_set_boolean_T:n {outer_mult}} -\def\EQ_modify_linewidth_iii_mult:{ - \setlength{\l_EQ_temp_linewidth_dim}{% - \linewidth-\widthof{\EQ_outerbox:{}}}% - \MH_if_dim:w \g_EQ_widesttag_dim>\z@ - \EQ_multline_modify_linewidth_tag: - \MH_else: - \EQ_multline_modify_linewidth_notag: - \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\EQ_find_displaywidth_iii_mult:{% - \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% - \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}% - \MH_or: % #4: - \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% - \MH_fi:} -\def\EQ_find_displaywidth_iv_mult:{\EQ_find_displaywidth_iii_mult:} -\def\EQ_place_display_iii_mult:{ - \MH_if_case:w \l_EQ_alignmentmode_int - \MH_or: % #1: + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline}{gather} + {\MH_set_boolean_T:n {outer_mult}} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline*}{gather*} + {\MH_set_boolean_T:n {outer_mult}} + \def\EQ_modify_linewidth_iii_mult:{ + \setlength{\l_EQ_temp_linewidth_dim}{% + % \linewidth + \l_EQ_linewidth_dim + -\widthof{\EQ_outerbox:{}}}% \MH_if_dim:w \g_EQ_widesttag_dim>\z@ - \abovedisplayshortskip=\abovedisplayskip - \rlap{ - \kern-.5\linewidth - \kern\multlinegap - \EQ_use_mathdisplay: - } + \EQ_multline_modify_linewidth_tag: \MH_else: - \EQ_use_mathdisplay: + \EQ_multline_modify_linewidth_notag: \MH_fi: - \MH_or: % #2: - \MH_if_dim:w \g_EQ_widesttag_dim>\z@ - \llap{ - \EQ_use_mathdisplay: - \kern-.5\linewidth - \kern\multlinegap - }% - \MH_else: - \EQ_use_mathdisplay: + \MH_setlength:dn \l_MT_multwidth_dim{\l_EQ_temp_linewidth_dim} + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: \MH_or: % 1 and 2 + \MH_or: + \MH_addtolength:dn + \l_EQ_temp_linewidth_dim{\@mathmargin}% + \MH_or: + \MH_addtolength:dn + \l_EQ_temp_linewidth_dim{\@mathmargin}% \MH_fi: - \MH_or: % #3: - \EQ_use_mathdisplay: - \MH_or: % #4: - \EQ_use_mathdisplay: - \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% - \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} - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {*}{}{\mathrlap}{&&&&&}} } - \EQ_next:}{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_left:n}% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {}{}{\mathrlap}{&&&&&}} - } - \EQ_next:}}% -\def\multcenter{\@ifstar{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_center:n}% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {*}{&&}{\mathclap}{&&&}} - } - \EQ_next:}{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_center:n }% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {}{&&}{\mathclap}{&&&}} - } - \EQ_next:}}% -\def\multright{\@ifstar{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_right:n }% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {*}{&&&&&}{\mathllap}{}} - } - \EQ_next:}{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_right:n }% - }{ - \def\EQ_next:{ - \EQ_generic_multline:nnnnn {}{&&&&&}{\mathllap}{}} - } - \EQ_next:}} -\def\multfirst{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_left:n }% - }{ + \def\EQ_modify_linewidth_iv_mult:{\EQ_modify_linewidth_iii_mult:} + \def\EQ_find_displaywidth_iii_mult:{% + \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% + \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}% + \MH_or: % #4: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \MH_fi:} + \def\EQ_find_displaywidth_iv_mult:{\EQ_find_displaywidth_iii_mult:} + \def\EQ_place_display_iii_mult:{ \MH_if_case:w \l_EQ_alignmentmode_int \MH_or: % #1: - \def\EQ_next:{\multleft}% + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ + \abovedisplayshortskip=\abovedisplayskip + \rlap{ + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + \kern\multlinegap + \EQ_use_mathdisplay: + } + \MH_else: + \EQ_use_mathdisplay: + \MH_fi: \MH_or: % #2: - \def\EQ_next:{\multleft*}% + \MH_if_dim:w \g_EQ_widesttag_dim>\z@ + \llap{ + \EQ_use_mathdisplay: + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + \kern\multlinegap + }% + \MH_else: + \EQ_use_mathdisplay: + \MH_fi: \MH_or: % #3: - \def\EQ_next:{\multleft}% + \EQ_use_mathdisplay: \MH_or: % #4: - \def\EQ_next:{\multleft*}% + \EQ_use_mathdisplay: \MH_fi: } - \EQ_next:} -\def\multmiddle{% - \def\EQ_next:{% + \def\EQ_place_display_iv_mult: {\EQ_place_display_iii_mult:} +}{% on to the 'bad' version + \def\EQ_generic_multline:nnnnn #1#2#3#4#5{% + \hskip1sp#2#3{{}#5}#4% + \MH_if:w *#1\relax\MH_else:\notag\MH_fi:} + \def\multleft{\@ifstar{% \MH_if_boolean:nTF {multlined}{ - \expandafter\EQ_multlined_center:n + \def\EQ_next:{\EQ_multlined_left:n} }{ - \expandafter\multcenter + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {*}{}{\mathrlap}{&&&&&}} } - }% - \@ifstar{\EQ_next:}{\EQ_next:}} -\def\multlast{% - \MH_if_boolean:nTF {multlined}{ - \def\EQ_next:{\EQ_multlined_right:n }% - }{ - \MH_if_case:w \l_EQ_alignmentmode_int - \MH_or: % #1: - \def\EQ_next:{\multright*}% - \MH_or: % #2: - \def\EQ_next:{\multright}% - \MH_or: % #3: - \def\EQ_next:{\multright*}% - \MH_or: % #4: - \def\EQ_next:{\multright}% - \MH_fi: - } - \EQ_next:} -\MH_new_boolean:n {multlined} -\newdimen\multlinedwidth -\MH_setlength:dn \multlinedwidth{.7\linewidth} -\renewenvironment{multlined}% - {\MH_nospace_ifnextchar:Nnn [ {\EQ_multlined_I:w} - {\EQ_multlined_I:w[c]} + \EQ_next:}{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_left:n}% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {}{}{\mathrlap}{&&&&&}} + } + \EQ_next:}}% + \def\multcenter{\@ifstar{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_center:n}% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {*}{&&}{\mathclap}{&&&}} + } + \EQ_next:}{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_center:n }% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {}{&&}{\mathclap}{&&&}} + } + \EQ_next:}}% + \def\multright{\@ifstar{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_right:n }% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {*}{&&&&&}{\mathllap}{}} + } + \EQ_next:}{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_right:n }% + }{ + \def\EQ_next:{ + \EQ_generic_multline:nnnnn {}{&&&&&}{\mathllap}{}} + } + \EQ_next:}} + \def\multfirst{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_left:n }% + }{ + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \def\EQ_next:{\multleft}% + \MH_or: % #2: + \def\EQ_next:{\multleft*}% + \MH_or: % #3: + \def\EQ_next:{\multleft}% + \MH_or: % #4: + \def\EQ_next:{\multleft*}% + \MH_fi: + } + \EQ_next:} + \def\multmiddle{% + \def\EQ_next:{% + \MH_if_boolean:nTF {multlined}{ + \expandafter\EQ_multlined_center:n + }{ + \expandafter\multcenter + } + }% + \@ifstar{\EQ_next:}{\EQ_next:}} + \def\multlast{% + \MH_if_boolean:nTF {multlined}{ + \def\EQ_next:{\EQ_multlined_right:n }% + }{ + \MH_if_case:w \l_EQ_alignmentmode_int + \MH_or: % #1: + \def\EQ_next:{\multright*}% + \MH_or: % #2: + \def\EQ_next:{\multright}% + \MH_or: % #3: + \def\EQ_next:{\multright*}% + \MH_or: % #4: + \def\EQ_next:{\multright}% + \MH_fi: + } + \EQ_next:} + \MH_new_boolean:n {multlined} + \newdimen\multlinedwidth + \MH_setlength:dn \multlinedwidth{ + % .7\linewidth + 0.7\l_EQ_linewidth_dim } - { \endaligned } -\def\EQ_multlined_I:w[#1]{% - \MH_nospace_ifnextchar:Nnn[ {\EQ_multlined_II:w[#1]} - {\EQ_multlined_II:w[#1][\multlinedwidth]}} -\def\EQ_multlined_II:w[#1][#2]{% - \MH_set_boolean_T:n {multlined} - \MH_let:NwN \Let@\MT_saved_Let: - \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}% + \renewenvironment{multlined}% + {\MH_nospace_ifnextchar:Nnn [ {\EQ_multlined_I:w} + {\EQ_multlined_I:w[c]} + } + { \endaligned } + \def\EQ_multlined_I:w[#1]{% + \MH_nospace_ifnextchar:Nnn[ {\EQ_multlined_II:w[#1]} + {\EQ_multlined_II:w[#1][\multlinedwidth]}} + \def\EQ_multlined_II:w[#1][#2]{% + \MH_set_boolean_T:n {multlined} + \MH_let:NwN \Let@\MT_saved_Let: + \MH_if:w t#1\relax \EQ_multlined_III:nn {#1}{#2}% \MH_else: - \MH_if:w c#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_if:w b#1\relax \EQ_multlined_III:nn {#1}{#2}% \MH_else: - \EQ_multlined_III:nn {#2}{#1}% + \MH_if:w c#1\relax \EQ_multlined_III:nn {#1}{#2}% + \MH_else: + \EQ_multlined_III:nn {#2}{#1}% + \MH_fi: \MH_fi: \MH_fi: - \MH_fi: - \mkern-\thinmuskip - \EQ_next:} -\def\EQ_multlined_III:nn #1#2{% - \def\EQ_next:{\setlength\multlinedwidth{#2}% - \start@aligned{#1}{\thr@@}}} -\def\EQ_multlined_left:n #1{% - \mathrlap{#1}&\hskip.5\multlinedwidth&&\hskip.5\multlinedwidth&&} -\def\EQ_multlined_center:n #1{% - &\hskip.5\multlinedwidth&&\mathclap{#1}\hskip.5\multlinedwidth&&} -\def\EQ_multlined_right:n #1{% - &\hskip.5\multlinedwidth&&\hskip.5\multlinedwidth&&\mathllap{#1}} + \mkern-\thinmuskip + \EQ_next:} + \def\EQ_multlined_III:nn #1#2{% + \def\EQ_next:{\setlength\multlinedwidth{#2}% + \start@aligned{#1}{\thr@@}}} + \def\EQ_multlined_left:n #1{% + \mathrlap{#1}&\hskip.5\multlinedwidth&&\hskip.5\multlinedwidth&&} + \def\EQ_multlined_center:n #1{% + &\hskip.5\multlinedwidth&&\mathclap{#1}\hskip.5\multlinedwidth&&} + \def\EQ_multlined_right:n #1{% + &\hskip.5\multlinedwidth&&\hskip.5\multlinedwidth&&\mathllap{#1}} } \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:{}}}% + % \linewidth + \l_EQ_linewidth_dim + -\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ \EQ_multline_modify_linewidth_tag: @@ -711,11 +746,15 @@ \MH_or: % #1: \MH_if_dim:w \g_EQ_widesttag_dim>\z@ \MH_if_boolean:nTF {multline}{ - \rlap{\kern\multlinegap \kern-.5\linewidth + \rlap{\kern\multlinegap + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim \EQ_use_mathdisplay: \kern-\mintagsep \kern\multlinetaggap}% }{ - \rlap{\kern-.5\linewidth\EQ_use_mathdisplay:}% + \rlap{%\kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + \EQ_use_mathdisplay:}% } \MH_else: \EQ_use_mathdisplay: @@ -725,15 +764,22 @@ \MH_if_boolean:nTF {multline}{ \llap{\kern-\mintagsep \kern\multlinetaggap \EQ_use_mathdisplay: - \kern\multlinegap \kern-.5\linewidth}% + \kern\multlinegap + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + }% }{ - \llap{\EQ_use_mathdisplay:\kern-.5\linewidth}% + \llap{\EQ_use_mathdisplay: + % \kern-.5\linewidth + \kern-.5\l_EQ_linewidth_dim + }% } \MH_else: \EQ_use_mathdisplay: \MH_fi: \MH_or: % #3: - \MH_if_boolean:nF {multline}{ \kern-\multlinetaggap } + \MH_if_boolean:nTF {multline}{ \kern-\multlinetaggap } + { \kern-\@mathmargin } \EQ_use_mathdisplay: \MH_or: % #4: \MH_if_dim:w \g_EQ_widesttag_dim>\z@ @@ -902,6 +948,10 @@ \rule[-\dp\z@-\shadowsize]{\shadowsize}{\ht\z@+\dp\z@}}}}% }{}% } +\g@addto@macro\EQ_typeset_display_hook:{ + % \columnwidth\linewidth + \def\fullwidthdisplay{} +} \def\EQ_overload_ams_begin:n #1{% \MH_let:cc {AmS#1}{#1}% \MH_let:cc {AmS#1*}{#1*} diff --git a/Master/texmf-dist/tex/latex/mathtools/mathtools.sty b/Master/texmf-dist/tex/latex/mathtools/mathtools.sty index 3c0c57b48b5..484ed17a818 100644 --- a/Master/texmf-dist/tex/latex/mathtools/mathtools.sty +++ b/Master/texmf-dist/tex/latex/mathtools/mathtools.sty @@ -9,7 +9,8 @@ %% This is a generated file. %% %% Copyright (C) 2002-2011 by Morten Hoegholm -%% Copyright (C) 2012- by Lars Madsen +%% Copyright (C) 2012-2019 by Lars Madsen +%% Copyright (C) 2020 by Lars Madsen, the LaTeX3 project %% %% %% This work may be distributed and/or modified under the @@ -23,14 +24,14 @@ %% This work has the LPPL maintenance status "maintained". %% %% This Current Maintainer of this work is -%% Lars Madsen +%% Lars Madsen and the LaTeX3 project %% %% This work consists of the main source file mathtools.dtx %% and the derived files %% mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv. %% \ProvidesPackage{mathtools}% - [2020/01/17 v1.23 mathematical typesetting tools] + [2020/03/24 v1.24 mathematical typesetting tools] \RequirePackage{keyval,calc} \RequirePackage{mhsetup}[2017/03/31] \MHInternalSyntaxOn @@ -320,11 +321,11 @@ \def\MT_leftrightarrow_fill:{% \arrowfill@\leftarrow\relbar\rightarrow} \providecommand*\xLeftarrow[2][]{% - \ext@arrow 0055{\Leftarrowfill@}{#1}{#2}} + \ext@arrow 0055{\Leftarrowfill@}{\ #1}{\ #2}} \providecommand*\xRightarrow[2][]{% - \ext@arrow 0055{\Rightarrowfill@}{#1}{#2}} + \ext@arrow 0055{\Rightarrowfill@}{#1\ }{#2\ }} \providecommand*\xLeftrightarrow[2][]{% - \ext@arrow 0055{\Leftrightarrowfill@}{#1}{#2}} + \ext@arrow 0055{\Leftrightarrowfill@}{\ #1\ }{\ #2\ }} \def\MT_rightharpoondown_fill:{% \arrowfill@\relbar\relbar\rightharpoondown} \def\MT_rightharpoonup_fill:{% @@ -1702,6 +1703,24 @@ \MaybeMHPrecedingSpacesOff \renewcommand\aligned@a[1][c]{\start@aligned{#1}\m@ne} \MHPrecedingSpacesOn +\newbox\xmathstrut@box +\newdimen\xmathstrut@dim +\def\xmathstrut{\@dblarg\xmathstrut@} +\def\xmathstrut@[#1]#2{% + \def\xmathstrut@dp{#1}% + \vphantom{\mathpalette\xmathstrut@do{#2}}% +} +\def\xmathstrut@do#1#2{% + \setbox\xmathstrut@box\hbox{$#1($}%)%emacs + \xmathstrut@dim\dimexpr\ht\xmathstrut@box+\dp\xmathstrut@box\relax + \ht\xmathstrut@box\dimexpr\ht\xmathstrut@box + +#2\xmathstrut@dim + \relax + \dp\xmathstrut@box\dimexpr\dp\xmathstrut@box + +\xmathstrut@dp\xmathstrut@dim + \relax + \box\xmathstrut@box} + \endinput %% %% End of file `mathtools.sty'. diff --git a/Master/texmf-dist/tex/latex/mathtools/mhsetup.sty b/Master/texmf-dist/tex/latex/mathtools/mhsetup.sty index cf84c8ff77c..cba3e5836b0 100644 --- a/Master/texmf-dist/tex/latex/mathtools/mhsetup.sty +++ b/Master/texmf-dist/tex/latex/mathtools/mhsetup.sty @@ -9,7 +9,8 @@ %% This is a generated file. %% %% Copyright (C) 2002-2007,2010 by Morten Hoegholm -%% Copyright (C) 2017 by Lars Madsen +%% Copyright (C) 2017-2019 by Lars Madsen +%% Copyright (C) 2020- by Lars Madsen, The LaTeX3 team %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -21,7 +22,8 @@ %% %% This work has the LPPL maintenance status "maintained". %% -%% This Current Maintainer of this work is Lars Madsen +%% This Current Maintainer of this work is Lars Madsen +%% , The LaTeX3 team https://github.com/latex3/mathtools %% %% This work consists of the main source file mhsetup.dtx %% and the derived files -- cgit v1.2.3