diff options
author | Karl Berry <karl@freefriends.org> | 2013-02-13 00:07:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-02-13 00:07:08 +0000 |
commit | 2544b4503021f61f279205ee9cecd1b29a6615ec (patch) | |
tree | 89d542a6cf783a92dbebec9ef461f8a06a7712ab /Master/texmf-dist/tex/latex/mh | |
parent | 33b9decf3736250e2c7bc7c110b29116cef82dda (diff) |
mh (12feb13)
git-svn-id: svn://tug.org/texlive/trunk@29094 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mh')
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/empheq.sty | 21 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/mathtools.sty | 120 |
2 files changed, 125 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/mh/empheq.sty b/Master/texmf-dist/tex/latex/mh/empheq.sty index a80ea8e19ee..7b0a0cf5956 100644 --- a/Master/texmf-dist/tex/latex/mh/empheq.sty +++ b/Master/texmf-dist/tex/latex/mh/empheq.sty @@ -9,6 +9,8 @@ %% This is a generated file. %% %% Copyright (C) 2002-2007 by Morten Hoegholm +%% Copyright (C) 2012 by Lars Madsen +%% %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -28,7 +30,7 @@ %% empheq.sty, empheq.pdf, empheq.ins, empheq.drv. %% \ProvidesPackage{empheq}% - [2007/12/03 v2.12 Emphasizing equations (MH)] + [2013/02/12 v2.13 Emphasizing equations] \RequirePackage{mhsetup}[2004/10/10] \MHInternalSyntaxOn \MH_new_boolean:n {overload_ams} @@ -773,7 +775,12 @@ \define@key{\EQ_options_name:}{boxtype}{\EQ_upgrade_error:} \define@key{\EQ_options_name:}{Left}{\EQ_upgrade_error:} \define@key{\EQ_options_name:}{Right}{\EQ_upgrade_error:} +\let\empheqeqrefbase\textup \newenvironment{empheq}[2][]{% + \MH_let:NwN\EQ_saved_maketag: \maketag@@@% + \renewcommand\eqref[1]{\empheqeqrefbase{% + \let\maketag@@@\EQ_saved_maketag:% + \tagform@{\ref{##1}}}} \setkeys{EmphEqEnv}{#2}\setkeys{\EQ_options_name:}{#1}% \EmphEqMainEnv}{\endEmphEqMainEnv} \newcommand*\DeclareLeftDelimiter[2][]{% @@ -903,6 +910,10 @@ \def\EQ_renew_ams_environment:n #1{% \MaybeMHPrecedingSpacesOff \renewenvironment{#1}[1][]{% + \MH_let:NwN\EQ_saved_maketag: \maketag@@@% + \renewcommand\eqref[1]{\empheqeqrefbase{% + \let\maketag@@@\EQ_saved_maketag:% + \tagform@{\ref{####1}}}} \setkeys{\EQ_options_name:}{##1}% \setkeys{EmphEqEnv}{AmS#1}% \EmphEqMainEnv @@ -948,10 +959,18 @@ \EmphEqMainEnv} \MHPrecedingSpacesOn \renewenvironment{alignat}[1]{ + \MH_let:NwN\EQ_saved_maketag: \maketag@@@% + \renewcommand\eqref[1]{\empheqeqrefbase{% + \let\maketag@@@\EQ_saved_maketag:% + \tagform@{\ref{##1}}}} \setkeys{EmphEqEnv}{AmSalignat=#1} \EQ_alignat_optional:w} {\endEmphEqMainEnv} \renewenvironment{alignat*}[1]{% + \MH_let:NwN\EQ_saved_maketag: \maketag@@@% + \renewcommand\eqref[1]{\empheqeqrefbase{% + \let\maketag@@@\EQ_saved_maketag:% + \tagform@{\ref{##1}}}} \setkeys{EmphEqEnv}{AmSalignat*=#1}% \EQ_alignat_optional:w}% {\endEmphEqMainEnv} diff --git a/Master/texmf-dist/tex/latex/mh/mathtools.sty b/Master/texmf-dist/tex/latex/mh/mathtools.sty index 22afd81b053..79781cdb487 100644 --- a/Master/texmf-dist/tex/latex/mh/mathtools.sty +++ b/Master/texmf-dist/tex/latex/mh/mathtools.sty @@ -9,6 +9,8 @@ %% This is a generated file. %% %% Copyright (C) 2002-2011 by Morten Hoegholm +%% Copyright (C) 2012 by Lars Madsen +%% %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -28,10 +30,59 @@ %% mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv. %% \ProvidesPackage{mathtools}% - [2012/04/24 v1.12 mathematical typesetting tools] + [2013/02/12 v1.13 mathematical typesetting tools] \RequirePackage{keyval,calc} \RequirePackage{mhsetup}[2010/01/21] \MHInternalSyntaxOn + % borrowed from fixltx2e +\def\EQ_MakeRobust#1{% + \@ifundefined{\expandafter\@gobble\string#1}{% + \@latex@error{The control sequence `\string#1' is undefined!% + \MessageBreak There is nothing here to make robust}% + \@eha + }% + {% + \@ifundefined{\expandafter\@gobble\string#1\space}% + {% + \expandafter\let\csname + \expandafter\@gobble\string#1\space\endcsname=#1% + \edef\reserved@a{\string#1}% + \def\reserved@b{#1}% + \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}% + \edef#1{% + \ifx\reserved@a\reserved@b + \noexpand\x@protect\noexpand#1% + \fi + \noexpand\protect\expandafter\noexpand + \csname\expandafter\@gobble\string#1\space\endcsname}% + }% + {\@latex@info{The control sequence `\string#1' is already robust}}% + }% +} +\def\forced_EQ_MakeRobust#1{% + \@ifundefined{\expandafter\@gobble\string#1}{% + \@latex@error{The control sequence `\string#1' is undefined!% + \MessageBreak There is nothing here to make robust}% + \@eha + }% + {% + % \@ifundefined{\expandafter\@gobble\string#1\space}% + % {% + \expandafter\let\csname + \expandafter\@gobble\string#1\space\endcsname=#1% + \edef\reserved@a{\string#1}% + \def\reserved@b{#1}% + \edef\reserved@b{\expandafter\strip@prefix\meaning\reserved@b}% + \edef#1{% + \ifx\reserved@a\reserved@b + \noexpand\x@protect\noexpand#1% + \fi + \noexpand\protect\expandafter\noexpand + \csname\expandafter\@gobble\string#1\space\endcsname}% + % }% + % {\@latex@info{The control sequence `\string#1' is already robust}}% + }% +} \def\MT_options_name:{mathtools} \newcommand*\mathtoolsset[1]{\setkeys{\MT_options_name:}{#1}} \MH_new_boolean:n {fixamsmath} @@ -51,6 +102,11 @@ \MHPrecedingSpacesOff \MH_let:NwN \MH_maybe_nospace_ifnextchar:Nnn \MH_nospace_ifnextchar:Nnn } +\MH_new_boolean:n {robustify} +\MH_set_boolean_T:n {robustify} +\DeclareOption{nonrobust}{ + \MH_set_boolean_F:n {robustify} +} \DeclareOption*{ \PassOptionsToPackage{\CurrentOption}{amsmath} } @@ -65,6 +121,12 @@ {You~ have~ to~ select~ either~ `true'~ or~ `false'} {I'll~ assume~ you~ chose~ `false'~ for~ now.} } +\MH_if_boolean:nT {robustify}{ + \EQ_MakeRobust\( + \EQ_MakeRobust\) + \EQ_MakeRobust\[ + \EQ_MakeRobust\] +} \def\MT_define_tagform:nwnn #1[#2]#3#4{ \@namedef{MT_tagform_#1:n}##1 {\maketag@@@{#3\ignorespaces#2{##1}\unskip\@@italiccorr#4}} @@ -1075,12 +1137,20 @@ \providecommand\bigtimes{\MH_csym_bigtimes:} } \MH_let:NwN \MT_orig_intertext: \intertext@ -\newdimen\l_MT_above_intertext_dim -\newdimen\l_MT_below_intertext_dim +\newdimen\l_MT_above_intertext_sep +\newdimen\l_MT_below_intertext_sep +\define@key{\MT_options_name:} + {aboveintertextdim}{\setlength\l_MT_above_intertext_sep{#1}} +\define@key{\MT_options_name:} + {belowintertextdim}{\setlength\l_MT_below_intertext_sep{#1}} \define@key{\MT_options_name:} - {aboveintertextdim}{\setlength\l_MT_above_interetext_dim{#1}} + {above-intertext-dim}{\setlength\l_MT_above_intertext_sep{#1}} \define@key{\MT_options_name:} - {belowintertextdim}{\setlength\l_MT_below_intertext_dim{#1}} + {below-intertext-dim}{\setlength\l_MT_below_intertext_sep{#1}} +\define@key{\MT_options_name:} + {above-intertext-sep}{\setlength\l_MT_above_intertext_sep{#1}} +\define@key{\MT_options_name:} + {below-intertext-sep}{\setlength\l_MT_below_intertext_sep{#1}} \def\MT_intertext: {% \def\intertext##1{% \ifvmode\else\\\@empty\fi @@ -1088,7 +1158,7 @@ \penalty\postdisplaypenalty\vskip\belowdisplayskip \vskip-\lineskiplimit % CCS \vskip\normallineskiplimit % CCS - \vskip\l_MT_above_intertext_dim + \vskip\l_MT_above_intertext_sep \vbox{\normalbaselines \ifdim\linewidth=\columnwidth \else \parshape\@ne \@totalleftmargin \linewidth @@ -1097,7 +1167,7 @@ \penalty\predisplaypenalty\vskip\abovedisplayskip% \vskip-\lineskiplimit % CCS \vskip\normallineskiplimit % CCS - \vskip\l_MT_above_intertext_dim + \vskip\l_MT_above_intertext_sep }% }} \def\MT_orig_intertext_true: { \MH_let:NwN \intertext@ \MT_orig_intertext: } @@ -1121,12 +1191,20 @@ \penalty\predisplaypenalty\vskip\abovedisplayshortskip% }% } -\newdimen\l_MT_above_shortintertext_dim -\newdimen\l_MT_below_shortintertext_dim +\newdimen\l_MT_above_shortintertext_sep +\newdimen\l_MT_below_shortintertext_sep +\define@key{\MT_options_name:} + {aboveshortintertextdim}{\setlength \l_MT_above_shortintertext_sep{#1}} \define@key{\MT_options_name:} - {aboveshortintertextdim}{\setlength \l_MT_above_shortintertext_dim{#1}} + {belowshortintertextdim}{\setlength \l_MT_below_shortintertext_sep{#1}} \define@key{\MT_options_name:} - {belowshortintertextdim}{\setlength \l_MT_below_shortintertext_dim{#1}} + {above-short-intertext-dim}{\setlength \l_MT_above_shortintertext_sep{#1}} +\define@key{\MT_options_name:} + {below-short-intertext-dim}{\setlength \l_MT_below_shortintertext_sep{#1}} +\define@key{\MT_options_name:} + {above-short-intertext-sep}{\setlength \l_MT_above_shortintertext_sep{#1}} +\define@key{\MT_options_name:} + {below-short-intertext-sep}{\setlength \l_MT_below_shortintertext_sep{#1}} \setkeys{\MT_options_name:}{ aboveshortintertextdim=3pt, belowshortintertextdim=3pt @@ -1137,7 +1215,7 @@ \penalty\postdisplaypenalty\vskip\abovedisplayshortskip \vskip-\lineskiplimit \vskip\normallineskiplimit - \vskip\l_MT_above_shortintertext_dim + \vskip\l_MT_above_shortintertext_sep \vbox{\normalbaselines \if_dim:w \linewidth=\columnwidth \else: @@ -1147,7 +1225,7 @@ \penalty\predisplaypenalty\vskip\abovedisplayshortskip% \vskip-\lineskiplimit \vskip\normallineskiplimit - \vskip\l_MT_below_shortintertext_dim + \vskip\l_MT_below_shortintertext_sep }% } \def\MT_orig_shortintertext_true: { \MH_let:NwN \shortintertext \MT_orig_shortintertext:n } @@ -1307,8 +1385,15 @@ \def\MT_mathic_true: { \MH_if_boolean:nF {math_italic_corr}{ \MH_set_boolean_T:n {math_italic_corr} + \MH_if_boolean:nTF {robustify}{ + \MH_let:NwN \MT_mathic_redeffer: \DeclareRobustCommand + }{ + \MH_let:NwN \MT_mathic_redeffer: \renewcommand + } \MH_let:NwN \MT_begin_inlinemath: \( - \renewcommand*\({\relax\ifmmode\@badmath\else + %\renewcommand*\({ + \MT_mathic_redeffer:*\({ + \relax\ifmmode\@badmath\else \ifhmode \if_dim:w \fontdimen\@ne\font>\z@ \if_dim:w \lastskip>\z@ @@ -1327,7 +1412,12 @@ \def\MT_mathic_false: { \MH_if_boolean:nT {math_italic_corr}{ \MH_set_boolean_F:n {math_italic_corr} - \MH_let:NwN \( \MT_begin_inlinemath: + \MH_if_boolean:nTF {robustify}{ + \edef\({\MT_begin_inlinemath:}% + \forced_EQ_MakeRobust\(% + }{ + \MH_let:NwN \( \MT_begin_inlinemath: + } } } \MH_new_boolean:n {math_italic_corr} |