diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:59:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:59:08 +0000 |
commit | d625e47ffd1453f40c42192234fa3ac1c234e835 (patch) | |
tree | 0bf7402a698b8cd9d903a42faec6014447102246 /Master/texmf-dist/tex/latex/mh | |
parent | d686f7c132a166a69afcf546ef992527fbeca48f (diff) |
mh
git-svn-id: svn://tug.org/texlive/trunk@1090 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 | 985 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/empheq07.sty | 752 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/mathtools.sty | 1063 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/mhsetup.sty | 166 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/ntheorem.fix | 402 |
5 files changed, 3368 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/mh/empheq.sty b/Master/texmf-dist/tex/latex/mh/empheq.sty new file mode 100644 index 00000000000..94d5f2bf8b9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mh/empheq.sty @@ -0,0 +1,985 @@ +%% +%% This is file `empheq.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% empheq.dtx (with options: `empheq') +%% +%% It 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 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Morten H\o gholm. +%% +%% This work consists of the files empheq.dtx and empheq.ins and the +%% derived files empheq.sty and ntheorem.fix +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{empheq} + [2004/10/10 v2.11a + Emphasizing equations (MH) + ] +\RequirePackage{mhsetup}[2004/10/10] +\MHInternalSyntaxOn +\MH_new_boolean:n {overload_ams} +\DeclareOption{overload}{ + \MH_set_boolean_T:n {overload_ams} +} +\MH_new_boolean:n {overload_amsII} +\DeclareOption{overload2}{ + \MH_set_boolean_T:n {overload_ams} + \MH_set_boolean_T:n {overload_amsII} +} +\MH_new_boolean:n {good_mult} +\DeclareOption{oldmultline}{\MH_set_boolean_F:n {good_mult}} +\DeclareOption{newmultline}{\MH_set_boolean_T:n {good_mult}} +\DeclareOption{ntheorem}{\AtEndOfPackage{\input{ntheorem.fix}}} +\DeclareOption*{ + \PassOptionsToPackage{\CurrentOption}{mathtools} +} +\ExecuteOptions{newmultline} +\ProcessOptions\relax +\MHInternalSyntaxOff +\RequirePackage{mathtools}[2004/10/10] +\MHInternalSyntaxOn +\AtEndOfPackage{\MHInternalSyntaxOff} +\newcount\l_EQ_equationtype_int +\newcount\l_EQ_alignmentmode_int +\if@fleqn + \iftagsleft@ + \l_EQ_alignmentmode_int=4 + \else: + \l_EQ_alignmentmode_int=\thr@@ + \fi: +\else: + \iftagsleft@ + \l_EQ_alignmentmode_int=\tw@ + \else: + \l_EQ_alignmentmode_int=\@ne + \fi: +\fi: +\newdimen\l_EQ_totalwidth_dim +\newdimen\l_EQ_displaywidth_dim +\def\EmphEqdisplaywidth{\l_EQ_displaywidth_dim} +\newdimen\l_EQ_temp_linewidth_dim +\newdimen\EmphEqdelimitershortfall +\newcount\EmphEqdelimiterfactor +\EmphEqdelimiterfactor950 +\EmphEqdelimitershortfall\p@ +\newdimen\g_EQ_toptag_height_dim +\newdimen\g_EQ_bottomtag_depth_dim +\newdimen\g_EQ_toprow_height_dim +\newdimen\g_EQ_bottomrow_depth_dim +\newdimen\g_EQ_widesttag_dim +\def\EmphEqtagwidth{\g_EQ_widesttag_dim} +\def\EQ_outerbox:{} +\def\EQ_innerbox:{} +\def\EQ_left_side:{} +\def\EQ_right_side:{} +\newsavebox\EQ_mathdisplay_box +\def\EmphEqdisplayheight{\ht\EQ_mathdisplay_box} +\def\EmphEqdisplaydepth{\dp\EQ_mathdisplay_box} +\newsavebox\EQ_tag_box +\def\EQ_complete_mathdisplay:{} +\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 + \EQ_upgrade_error: + \else: + \EQ_post_process: + \ignorespacesafterend + \fi:} +\def\EQ_post_process:{% + \EQ_initialize: + \EQ_begin_equation: + \MH_if_boolean:nT {outer_mult}{ + \setkeys{\MT_options_name:}{ + firstline-afterskip=0pt, + lastline-preskip=0pt, + multlined-width=0pt, + } + \ifodd \l_EQ_alignmentmode_int + \setkeys{\MT_options_name:}{multlined-pos=b} + \else: + \setkeys{\MT_options_name:}{multlined-pos=t} + \fi: + \g@addto@macro\EQ_complete_mathdisplay:{ + \begin{MTmultlined}\relax} + } + \g@addto@macro\EQ_complete_mathdisplay:\EQ_mathbody: + \MH_if_boolean:nT {outer_mult}{ + \g@addto@macro\EQ_complete_mathdisplay:{\end{MTmultlined}} + } + \EQ_end_equation: + \edef\EQ_hyperref_link_fint{\number\Hy@linkcounter} + \savecounters@ + \EQ_typeset_tags: + \edef\l_EQ_equation_fint{\number\c@equation} + \restorecounters@ + \Hy@linkcounter=\EQ_hyperref_link_fint + \settowidth\l_EQ_totalwidth_dim{% + $\EQ_left_side:\EQ_innerbox:{}\EQ_right_side:$}% + \MH_if_boolean:nTF {outer_mult} + { \def\EQ_next:{_mult} } + { \def\EQ_next:{} } + \@nameuse{EQ_modify_linewidth_ + \romannumeral\l_EQ_equationtype_int\EQ_next: :}% + \EQ_typeset_display: + \@nameuse{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: + \makebox[\l_EQ_displaywidth_dim][c] + {\usebox{\EQ_mathdisplay_box}}% + \or: + \makebox[\l_EQ_displaywidth_dim][c] + {\usebox{\EQ_mathdisplay_box}}% + \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: + \kern-\@mathmargin + \fi: + \fi: + \usebox{\EQ_mathdisplay_box}}% + \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: + \kern-\@mathmargin + \fi: + \fi: + \usebox{\EQ_mathdisplay_box}}% + \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_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: + \end{AmSequation*} + \global\c@equation=\l_EQ_equation_fint\relax +} +\def\EQ_initialize:{% + \m@th + \MH_let:NwN\SetTagPlusEndMark\EQ_tag_plus_endmark: + \MH_let:NwN\SetOnlyEndMark\EQ_only_endmark: + \l_EQ_temp_linewidth_dim\linewidth + \g_EQ_toprow_height_dim\z@ + \g_EQ_bottomrow_depth_dim\z@ + \g_EQ_toptag_height_dim\z@ + \g_EQ_bottomtag_depth_dim\z@ + \g_EQ_widesttag_dim\z@ + \xdef\g_EQ_latest_nonzerodepth_row_fint{\z@} + \edef\EQ_restore_tex_delimiter:{% + \delimiterfactor\the\delimiterfactor + \delimitershortfall\the\delimitershortfall\relax}% + \g@addto@macro\EQ_complete_mathdisplay: + \EQ_restore_tex_delimiter: + \delimitershortfall\EmphEqdelimitershortfall + \delimiterfactor\EmphEqdelimiterfactor + \MH_let:NwN\intertext@\EQ_intertext: + \EQ_displaybreak:} +\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}} +\def\EQ_displaybreak:{% + \def\dspbrk@[##1]{\PackageWarning{empheq}{% + You~cannot~use~\string\displaybreak\space inside~the~`empheq'% + \MessageBreak + environment,~as~`empheq'~creates~an~unbreakable~box.}}} +\def\EQ_new_equationtype:nnn #1#2#3{% + \define@key{#1}{#2}[true]{% + \l_EQ_equationtype_int=#3\relax + \def\EQ_begin_equation: + {\g@addto@macro{\EQ_complete_mathdisplay:}{\begin{#2}}}% + \def\EQ_end_equation: + {\g@addto@macro{\EQ_complete_mathdisplay:}{\end{#2}}}}} +\def\EQ_new_equationtype_arg:nnn #1#2#3{% + \define@key{#1}{#2}{% + \l_EQ_equationtype_int=#3\relax + \def\EQ_begin_equation: + {\g@addto@macro{\EQ_complete_mathdisplay:}{\begin{#2}{##1}}}% + \def\EQ_end_equation: + {\g@addto@macro{\EQ_complete_mathdisplay:}{\end{#2}}}}} +\def\EQ_typeset_tags:{% + \sbox\EQ_tag_box{% + \parbox{.5\maxdimen}{% + \hbadness\@M + \EQ_prevent_vertical_space: + \EQ_typeset_tags_hook: + \MH_let:NwN\set@gather@field\EQ_set_gather_field: + \MH_let:NwN\set@field\EQ_set_align_field: + \MH_set_boolean_T:n {continue_measuring} + \global\g_EQ_temprow_int\m@ne + \MH_let:NwN \EQ_saved_maketag:n \maketag@@@ + \def\maketag@@@##1{ + \EQ_maketag:Nn \EQ_saved_maketag:n {##1}} + \EQ_complete_mathdisplay:}}} +\def\EQ_predisplay_adjustment:{% + \if_dim:w \g_EQ_toprow_height_dim<\baselineskip + \vskip\g_EQ_toprow_height_dim + \vskip-\baselineskip + \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 + \vskip-\g_EQ_toptag_height_dim + \vskip\baselineskip + \vskip-\normallineskip + \fi: + \fi:} +\def\EQ_postdisplay_adjustment:{% + \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 + \vskip-\g_EQ_bottomtag_depth_dim + \vskip\dp\strutbox + \fi: + \fi:} +\def\EQ_typeset_display:{% + \sbox\EQ_mathdisplay_box{% + \parbox{\l_EQ_temp_linewidth_dim}{% + \EQ_predisplay_adjustment: + \EQ_prevent_vertical_space: + \EQ_typeset_display_hook: + \def\maketag@@@##1{\EQ_maketag:Nn \vphantom{##1}}% + \EQ_complete_mathdisplay: + \EQ_postdisplay_adjustment:}}} +\def\EQ_prevent_vertical_space:{% + \nointerlineskip + \abovedisplayskip\z@ \belowdisplayskip\z@\relax} +\def\EQ_maketag:Nn #1#2{% + \setboxz@h{#2}% + \if_num:w \row@=\@ne + \global \g_EQ_toptag_height_dim = \ht\z@ + \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 + \global \g_EQ_widesttag_dim = \@tempdima + \fi: + #1{#2}% +} +\def\EQ_set_gather_field:{% + \iftagsleft@ + \global\lineht@\ht\z@ + \else: + \global\lineht@\dp\z@ + \fi: + \kern\eqnshift@ + %\boxz@ % Original amsmath version + \EQ_measure_gather: + \phantom{\boxz@}% + \hfil} +\def\EQ_measure_gather:{% + \if_num:w \row@=\@ne + \g_EQ_toprow_height_dim=\ht\z@ + \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@ + \global\lineht@\ht\z@ + \fi: + \else: + \if_dim:w \dp\z@>\lineht@ + \global\lineht@\dp\z@ + \fi: + \fi: + %\boxz@ % Original amsmath version + \MH_if_boolean:nT {continue_measuring}{ \EQ_measure_align: } + \phantom{\boxz@}} +\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_set_boolean_T:n {still_in_samerow} + \else: + \if_num:w \g_EQ_temprow_int>\row@ + \global\MH_set_boolean_F:n {continue_measuring} + \fi: + \MH_set_boolean_F:n {still_in_samerow} + \global\@tempdimc=\@tempdimb + \global\@tempdimb=\g_EQ_bottomrow_depth_dim + \fi: + \MH_if_boolean:nTF {continue_measuring}{ + \global\g_EQ_temprow_int=\row@ + \@tempcnta=\row@ + \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 + \g_EQ_toprow_height_dim\@tempdima + \fi: + \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 + \g_EQ_bottomrow_depth_dim\@tempdima + \fi: + }{ + \g_EQ_bottomrow_depth_dim\dp\z@\relax + } + }{ + \global\g_EQ_bottomrow_depth_dim=\@tempdimc + } + \global\g_EQ_toprow_height_dim\g_EQ_toprow_height_dim + \global\g_EQ_bottomrow_depth_dim\g_EQ_bottomrow_depth_dim} +\def\EQ_place_tag:N #1{% + \tag*{\makebox[\g_EQ_widesttag_dim][#1]{% + \EQ_vertical_tag_adjustment:n {\usebox{\EQ_tag_box}}}}} +\def\EQ_vertical_tag_adjustment:n #1{{% + \@tempdima\z@\@tempdimb\z@ + \@tempdimc=\dp\strutbox + \if_dim:w \g_EQ_toprow_height_dim<\baselineskip + \MH_setlength:dn + \@tempdima{\g_EQ_toprow_height_dim-\baselineskip} + \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_addtolength:dn \@tempdima + {-\g_EQ_toptag_height_dim+\baselineskip-\normallineskip} + \fi: + \fi: + \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_addtolength:dn \@tempdimb + {-\g_EQ_bottomtag_depth_dim+\@tempdimc} + \fi: + \fi: + \raisebox{-0.5\@tempdima+0.5\@tempdimb}{#1}}}% +\def\EQ_use_mathdisplay:{% + \EQ_outerbox:{\usebox{\EQ_mathdisplay_box}}} +\def\EQ_options_name:{EmphEqOpt} +\MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{equation}{gather} + {\EQ_disable_linebreak:} +\MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{equation*}{gather*} + {\EQ_disable_linebreak:} +\def\EQ_disable_linebreak:{% + \MH_let:NwN \EQ_saved_Let: \Let@ + \def\Let@{\def\\{% + \PackageError{empheq}{You~ cannot~ use~ \string\\~ in~ equation!} + {\@eha}} + \MH_let:NwN \Let@ \EQ_saved_Let: + }% +} +\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: + \setlength{\l_EQ_temp_linewidth_dim}{% + \linewidth-\l_EQ_totalwidth_dim-\widthof{\EQ_outerbox:{}}}% + \fi:} +\def\EQ_modify_linewidth_ii:{\EQ_modify_linewidth_i:} +\def\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_addtolength:dn \l_EQ_displaywidth_dim{-\alignsep@}% + \or: % #2: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\alignsep@}% + \or: % #3: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \or: % #4: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \fi:} +\def\find_displaywidth_ii:{\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:{% + \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% + \if_case:w \l_EQ_alignmentmode_int \or: \or: % #1 & #2: + \or: % #3: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \or: % #4: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \fi:} +\def\find_displaywidth_iv:{\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} + {flalign}{\MH_set_boolean_T:n {multline}} +\MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{multline*} + {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_addtolength:dn \l_EQ_temp_linewidth_dim{% + -\g_EQ_widesttag_dim-\multlinetaggap-\multlinegap}% + \or: + \MH_addtolength:dn \l_EQ_temp_linewidth_dim{% + -\g_EQ_widesttag_dim-\multlinetaggap-\multlinegap}% + \or: + \MH_addtolength:dn \l_EQ_temp_linewidth_dim{% + -\@mathmargin-\g_EQ_widesttag_dim-\multlinetaggap}% + \or: + \MH_addtolength:dn + \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% + \fi: +} +\def\EQ_multline_modify_linewidth_notag:{% + \if_case:w \l_EQ_alignmentmode_int\or: + \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-2\multlinegap} + \or: + \MH_addtolength:dn \l_EQ_temp_linewidth_dim{-2\multlinegap} + \or: + \MH_addtolength:dn + \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% + \or: + \MH_addtolength:dn + \l_EQ_temp_linewidth_dim{-\@mathmargin-\multlinegap}% + \fi: +} +\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:{}}}% + \if_dim:w \g_EQ_widesttag_dim>\z@ + \EQ_multline_modify_linewidth_tag: + \else: + \EQ_multline_modify_linewidth_notag: + \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:{% + \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% + \if_case:w \l_EQ_alignmentmode_int \or: \or: % #1 & #2: + \or: % #3: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \or: % #4: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \fi:} +\def\find_displaywidth_iv_mult:{\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@ + \abovedisplayshortskip=\abovedisplayskip + \rlap{ + \kern-.5\linewidth + \kern\multlinegap + \EQ_use_mathdisplay: + } + \else: + \EQ_use_mathdisplay: + \fi: + \or: % #2: + \if_dim:w \g_EQ_widesttag_dim>\z@ + \llap{ + \EQ_use_mathdisplay: + \kern-.5\linewidth + \kern\multlinegap + }% + \else: + \EQ_use_mathdisplay: + \fi: + \or: % #3: + \EQ_use_mathdisplay: + \or: % #4: + \EQ_use_mathdisplay: + \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:} +\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 }% + }{ + \if_case:w \l_EQ_alignmentmode_int + \or: % #1: + \def\EQ_next:{\multleft}% + \or: % #2: + \def\EQ_next:{\multleft*}% + \or: % #3: + \def\EQ_next:{\multleft}% + \or: % #4: + \def\EQ_next:{\multleft*}% + \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 }% + }{ + \if_case:w \l_EQ_alignmentmode_int + \or: % #1: + \def\EQ_next:{\multright*}% + \or: % #2: + \def\EQ_next:{\multright}% + \or: % #3: + \def\EQ_next:{\multright*}% + \or: % #4: + \def\EQ_next:{\multright}% + \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]} + } + { \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: + \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: + \EQ_multlined_III:nn {#2}{#1}% + \fi: + \fi: + \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}} +} +\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_boolean:nTF {multline}{ + \EQ_multline_modify_linewidth_tag: + }{ + \if_case:w \l_EQ_alignmentmode_int + \or: % #1: + \MH_addtolength:dn \l_EQ_temp_linewidth_dim + {-\g_EQ_widesttag_dim-\mintagsep} + \or: % #2: + \MH_addtolength:dn \l_EQ_temp_linewidth_dim + {-\g_EQ_widesttag_dim-\mintagsep}% + \or: % #3: + \MH_addtolength:dn \l_EQ_temp_linewidth_dim + {-\g_EQ_widesttag_dim-\mintagsep} + \or: % #4: + \MH_addtolength:dn \l_EQ_temp_linewidth_dim + {-\@mathmargin} + \fi: + } + \else: + \MH_if_boolean:nT {multline}{ + \EQ_multline_modify_linewidth_notag: + } + \fi:} +\def\EQ_modify_linewidth_vi:{\EQ_modify_linewidth_v:} +\def\find_displaywidth_v:{% + \MH_setlength:dn + \l_EQ_displaywidth_dim{\l_EQ_temp_linewidth_dim}} +\def\find_displaywidth_vi:{\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_boolean:nTF {multline}{ + \rlap{\kern\multlinegap \kern-.5\linewidth + \EQ_use_mathdisplay: + \kern-\mintagsep \kern\multlinetaggap}% + }{ + \rlap{\kern-.5\linewidth\EQ_use_mathdisplay:}% + } + \else: + \EQ_use_mathdisplay: + \fi: + \or: % #2: + \if_dim:w \g_EQ_widesttag_dim>\z@ + \MH_if_boolean:nTF {multline}{ + \llap{\kern-\mintagsep \kern\multlinetaggap + \EQ_use_mathdisplay: + \kern\multlinegap \kern-.5\linewidth}% + }{ + \llap{\EQ_use_mathdisplay:\kern-.5\linewidth}% + } + \else: + \EQ_use_mathdisplay: + \fi: + \or: % #3: + \MH_if_boolean:nF {multline}{ \kern-\multlinetaggap } + \EQ_use_mathdisplay: + \or: % #4: + \if_dim:w \g_EQ_widesttag_dim>\z@ + \else: + \MH_if_boolean:nF {multline}{ \kern-\@mathmargin } + \fi: + \EQ_use_mathdisplay: + \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:{% + \MH_setlength:dn \l_EQ_displaywidth_dim{\totwidth@}% + \if_case:w \l_EQ_alignmentmode_int + \or: % #1: + \or: % #2: + \or: % #3: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\eqnshift@}% + \or: % #4: + \MH_addtolength:dn \l_EQ_displaywidth_dim{-\@mathmargin}% + \fi:} +\def\find_displaywidth_viii:{\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}} +\MH_keyval_alias:nnn {\EQ_options_name:}{outerbox}{box} +\def\EQ_marginbox:nn #1#2{% + \settowidth{\@tempdima}{#2}% + \makebox[\z@]{\hspace{\@tempdima}#1{#2}}} +\define@key{\EQ_options_name:}{marginbox}{% + \def\EQ_outerbox:{\EQ_marginbox:nn {#1}}} +\define@key{\EQ_options_name:}{innerbox}{\def\EQ_innerbox:{#1}} +\define@key{\EQ_options_name:}{left}{\def\EQ_left_side:{#1}} +\define@key{\EQ_options_name:}{right}{\def\EQ_right_side:{#1}} +\newcommand*\empheqset[1]{\setkeys{\EQ_options_name:}{#1}} +\def\EQ_upgrade_error:{% + \PackageError{empheq} + {You~ are~ using~ the~ old~ syntax!\MessageBreak + The~ `empheq'~ environment~ takes~ a~ mandatory~ + argument~ now.\MessageBreak + You~ need~ to~ exit~ and~ change~ your~ source~ file.} + {It~ won't~ work,~ trust me.~ Press~ `X'~ now.}} +\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:} +\newenvironment{empheq}[2][]{% + \setkeys{EmphEqEnv}{#2}\setkeys{\EQ_options_name:}{#1}% + \EmphEqMainEnv}{\endEmphEqMainEnv} +\newcommand*\DeclareLeftDelimiter[2][]{% + \EQ_declare_left_delimiter:nnnn {#1}{#2}{}{}% + \EQ_declare_left_delimiter:nnnn {#1}{#2}{big}{\EQ_innerbox:}} +\def\EQ_declare_left_delimiter:nnnn #1#2#3#4{% + \@namedef{empheq#3\expandafter\@gobble\string#2}{% + \left#2% + \mkern-\thinmuskip + \vphantom{#4{\parbox{.5\maxdimen}{% + \EQ_predisplay_adjustment: + \EQ_prevent_vertical_space: + \usebox{\EQ_tag_box}% + \EQ_postdisplay_adjustment:}}}% + \right.% + \kern-\nulldelimiterspace #1}} +\newcommand*\DeclareRightDelimiter[2][]{% + \EQ_declare_right_delimiter:nnnn {#1}{#2}{}{}% + \EQ_declare_right_delimiter:nnnn {#1}{#2}{big}{\EQ_innerbox:}} +\def\EQ_declare_right_delimiter:nnnn #1#2#3#4{% + \@namedef{empheq#3\expandafter\@gobble\string#2}{% + \kern-\nulldelimiterspace + #1% + \left.% + \vphantom{#4{\parbox{.5\maxdimen}{% + \EQ_predisplay_adjustment: + \EQ_prevent_vertical_space: + \usebox{\EQ_tag_box}% + \EQ_postdisplay_adjustment:}}}% + \mkern-\thinmuskip + \right#2}} +\DeclareLeftDelimiter{\lbrace} +\DeclareRightDelimiter{\rbrace} +\DeclareLeftDelimiter{\lbrack} +\DeclareRightDelimiter{\rbrack} +\DeclareLeftDelimiter{\langle} +\DeclareRightDelimiter{\rangle} +\DeclareLeftDelimiter{\lvert} +\DeclareRightDelimiter{\rvert} +\DeclareLeftDelimiter{\lVert} +\DeclareRightDelimiter{\rVert} +\DeclareLeftDelimiter{\lfloor} +\DeclareRightDelimiter{\rfloor} +\DeclareLeftDelimiter{\lceil} +\DeclareRightDelimiter{\rceil} +\DeclareLeftDelimiter{\lparen} +\DeclareRightDelimiter{\rparen} +\def\EQ_typeset_tags_hook:{} +\def\EQ_typeset_display_hook:{} +\g@addto@macro\EQ_typeset_display_hook:{ + \def\SK@@label#1>#2\SK@{} +} +\@namedef{SK@AmSequation} {\SK@equationtrue} +\@namedef{SK@AmSequation*} {\SK@equationtrue} +\@namedef{SK@AmSalign} {\SK@equationtrue} +\@namedef{SK@AmSalign*} {\SK@equationtrue} +\@namedef{SK@AmSalignat} {\SK@equationtrue} +\@namedef{SK@AmSalignat*} {\SK@equationtrue} +\@namedef{SK@AmSgather} {\SK@equationtrue} +\@namedef{SK@AmSgather*} {\SK@equationtrue} +\@namedef{SK@AmSmultline} {\SK@equationtrue} +\@namedef{SK@AmSmultline*} {\SK@equationtrue} +\@namedef{SK@AmSflalign} {\SK@equationtrue} +\@namedef{SK@AmSflalign*} {\SK@equationtrue} +\AtBeginDocument{ + \@ifundefined{Hy@linkcounter}{\newcount\Hy@linkcounter}{} +} +\g@addto@macro\EQ_typeset_display_hook:{ + \MH_let:NwN \hyper@refstepcounter\@gobble +} +\g@addto@macro\EQ_typeset_tags_hook:{ + \MH_let:NwN\TagsPlusEndmarks\relax + \MH_let:NwN\RestoreTags\relax +} +\g@addto@macro\EQ_typeset_display_hook:{ + \MH_let:NwN\TagsPlusEndmarks\relax + \MH_let:NwN\RestoreTags\relax +} +\g@addto@macro\EQ_typeset_display_hook:{ + \MH_let:NwN\ltx@label\MT_gobblelabel:w + \MH_let:NwN \GenericError \@gobblefour +} +\AtBeginDocument{% + \@ifpackageloaded{fancybox}{% + \@ifpackageloaded{color}{\definecolor{shadowcolor}{rgb}{0,0,0}}% + {\newcommand*\textcolor[2]{\normalcolor{#2}}}% + \MH_new_boolean:n {shadowbox_star} + \renewcommand*\shadowbox{% + \@ifstar{\MH_set_boolean_T:n {shadowbox_star} + \VerbBox\EQ_shadowbox:n} + {\MH_set_boolean_F:n {shadowbox_star} + \VerbBox\EQ_shadowbox:n}} + \def\EQ_shadowbox:n #1{% + \sbox{\z@}{\fbox{#1}}% + \MH_if_boolean:nTF {shadowbox_star}{ + \MH_setlength:dn \@tempdima{\z@}% + }{ + \MH_setlength:dn \@tempdima{\dp\z@+\shadowsize}% + } + \raisebox{\@tempdima}{% + \makebox[\z@][l]{% + \kern\shadowsize \textcolor{shadowcolor}{% + \rule[-\dp\z@-\shadowsize]{\wd\z@}{\shadowsize}}% + }% + \usebox\z@\textcolor{shadowcolor}{% + \rule[-\dp\z@-\shadowsize]{\shadowsize}{\ht\z@+\dp\z@}}}}% + }{}% +} +\def\EQ_overload_ams_begin:n #1{% + \MH_let:cc {AmS#1}{#1}% + \MH_let:cc {AmS#1*}{#1*} +} +\def\EQ_overload_ams_end:n #1{% + \MH_let:cc {endAmS#1}{endAmSalign} +} +\AtBeginDocument{ + \EQ_overload_ams_begin:n {equation} + \MH_let:cc {endAmSequation}{endequation} + \MH_let:cc {endAmSequation*}{endequation*} + \MH_if_boolean:nT {overload_ams}{ + \def\EQ_renew_ams_environment:n #1{% + \MaybeMHPrecedingSpacesOff + \renewenvironment{#1}[1][]{% + \setkeys{\EQ_options_name:}{##1}% + \setkeys{EmphEqEnv}{AmS#1}% + \EmphEqMainEnv + }{\endEmphEqMainEnv} + \MHPrecedingSpacesOn + } + \EQ_new_equationtype:nnn {EmphEqEnv}{AmSalign} {1} + \EQ_new_equationtype:nnn {EmphEqEnv}{AmSalign*} {2} + \EQ_new_equationtype:nnn {EmphEqEnv}{AmSgather} {3} + \EQ_new_equationtype:nnn {EmphEqEnv}{AmSgather*} {4} + \EQ_new_equationtype:nnn {EmphEqEnv}{AmSflalign} {5} + \EQ_new_equationtype:nnn {EmphEqEnv}{AmSflalign*}{6} + \EQ_new_equationtype_arg:nnn {EmphEqEnv}{AmSalignat} {7} + \EQ_new_equationtype_arg:nnn {EmphEqEnv}{AmSalignat*}{8} + \EQ_overload_ams_begin:n {gather} + \MH_let:cc {endAmSgather}{endgather} + \MH_let:cc {endAmSgather*}{endAmSgather} + \EQ_renew_ams_environment:n {gather} + \EQ_renew_ams_environment:n {gather*} + \EQ_overload_ams_begin:n {equation} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv} {AmSequation} + {AmSgather}{\EQ_disable_linebreak:} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{AmSequation*} + {AmSgather*}{\EQ_disable_linebreak:} + \EQ_renew_ams_environment:n {equation} + \EQ_renew_ams_environment:n {equation*} + \EQ_overload_ams_begin:n {align} + \MH_let:cc {endAmSalign}{endalign} + \EQ_overload_ams_end:n {align*} + \EQ_renew_ams_environment:n {align} + \EQ_renew_ams_environment:n {align*} + \EQ_overload_ams_begin:n {flalign} + \EQ_overload_ams_end:n {flalign} + \EQ_overload_ams_end:n {flalign*} + \EQ_renew_ams_environment:n {flalign} + \EQ_renew_ams_environment:n {flalign*} + \EQ_overload_ams_begin:n {alignat} + \EQ_overload_ams_end:n {alignat} + \EQ_overload_ams_end:n {alignat*} + \MaybeMHPrecedingSpacesOff + \newcommand*\EQ_alignat_optional:w [1][]{ + \setkeys{\EQ_options_name:}{#1} + \EmphEqMainEnv} + \MHPrecedingSpacesOn + \renewenvironment{alignat}[1]{ + \setkeys{EmphEqEnv}{AmSalignat=#1} + \EQ_alignat_optional:w} + {\endEmphEqMainEnv} + \renewenvironment{alignat*}[1]{% + \setkeys{EmphEqEnv}{AmSalignat*=#1}% + \EQ_alignat_optional:w}% + {\endEmphEqMainEnv} + \DeclareRobustCommand{\[}{\begin{AmSequation*}} + \DeclareRobustCommand{\]}{\end{AmSequation*}} + \MH_keyval_alias:nnn {EmphEqEnv}{gather} {AmSgather} + \MH_keyval_alias:nnn {EmphEqEnv}{gather*} {AmSgather*} + \MH_keyval_alias:nnn {EmphEqEnv}{align} {AmSalign} + \MH_keyval_alias:nnn {EmphEqEnv}{align*} {AmSalign*} + \MH_keyval_alias:nnn {EmphEqEnv}{flalign} {AmSflalign} + \MH_keyval_alias:nnn {EmphEqEnv}{flalign*}{AmSflalign*} + \MH_keyval_alias:nnn {EmphEqEnv}{alignat} {AmSalignat} + \MH_keyval_alias:nnn {EmphEqEnv}{alignat*}{AmSalignat*} + \MH_if_boolean:nT {good_mult}{ + \EQ_overload_ams_begin:n {multline} + \MH_let:cc {endAmSmultline}{endmultline} + \MH_let:cc {endAmSmultline*}{endAmSmultline} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{AmSmultline} + {AmSgather}{\MH_set_boolean_T:n {outer_mult}} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{AmSmultline*} + {AmSgather*}{\MH_set_boolean_T:n {outer_mult}} + \EQ_renew_ams_environment:n {multline} + \EQ_renew_ams_environment:n {multline*} + } + \MH_if_boolean:nT {overload_amsII}{ + \MH_protected:\def\[#1\]{\begin{equation*} #1\end{equation*}} + \MH_if_boolean:nF {good_mult}{ + \EQ_overload_ams_begin:n {multline} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{AmSmultline} + {AmSflalign}{\MH_set_boolean_T:n {multline}} + \MH_keyval_alias_with_addon:nnnn {EmphEqEnv}{AmSmultline*} + {AmSflalign*}{\MH_set_boolean_T:n {multline}} + \EQ_renew_ams_environment:n {multline} + \EQ_renew_ams_environment:n {multline*} + } + } + } +} +\endinput +%% +%% End of file `empheq.sty'. diff --git a/Master/texmf-dist/tex/latex/mh/empheq07.sty b/Master/texmf-dist/tex/latex/mh/empheq07.sty new file mode 100644 index 00000000000..2ca5134e715 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mh/empheq07.sty @@ -0,0 +1,752 @@ +%% +%% This is file `empheq07.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% empheq07.dtx (with options: `package') +%% +%% It 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 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Morten H\o gholm. +%% +%% This work consists of the files empheq07.dtx and empheq07.ins and +%% the derived file empheq07.sty. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{empheq07} + [2004/07/27 v0.7d Emphasizing equations (MH)] +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}} +\ProcessOptions\relax +\RequirePackage{amsmath}[2000/07/18] +\RequirePackage{calc,keyval} +\newif\if@emphEQ@FLL +\newif\if@emphEQ@FLR +\newif\if@emphEQ@L +\newif\if@emphEQ@R +\if@fleqn + \iftagsleft@ + \@emphEQ@FLLtrue + \else + \@emphEQ@FLRtrue + \fi +\else + \iftagsleft@ + \@emphEQ@Ltrue + \else + \@emphEQ@Rtrue + \fi +\fi +\newif\if@emphEQ@gather +\newif\if@emphEQ@align +\newif\if@emphEQ@alignat +\newif\if@emphEQ@multline +\newif\if@emphEQ@NoNumEq +\newsavebox{\@emphEQ@Box} +\newlength{\@emphEQ@BoxWidth} +\newlength{\@emphEQ@displaywidth} +\newtoks\@emphEQ@mathbody +\newcommand{\@emphEQ@Left}{} +\newcommand{\@emphEQ@Right}{} +\newlength{\@emphEQ@lwd} +\newlength{\@emphEQ@rwd} +\newcommand{\@emphEQ@boxtype}{} +\newlength{\@emphEQ@boxtypelength} +\AtBeginDocument{% + \@ifpackageloaded{fancybox}{}{% + \let\shadowbox=\fbox}} +\newcommand{\@emphEQ@shadowbox}{\shadowbox} +\newif\if@emphEQ@shadowbox +\newlength{\@emphEQ@templength} +\newcounter{@emphEQ@EqCtr} +\newcommand{\@emphEQ@CloseEnough}[4]{% + \setlength{\@tempdima}{#1-#2}% + \ifdim\@tempdima>-5sp + \ifdim\@tempdima<5sp + #3 + \else + #4 + \fi + \else + #4 + \fi +} +\def\@emphEQ@MainEnv{% + \edef\@emphEQ@EnvName{\@currenvir}% + {\ifnum0=`}\fi + \@emphEQ@mathbody{}\@emphEQ@get@body +} +\let\end@emphEQ@MainEnv\relax +\long\def\@emphEQ@get@body#1\end{% + \@emphEQ@mathbody\expandafter{\the\@emphEQ@mathbody #1}% + \@emphEQ@findend +} +\def\@emphEQ@findend#1{% + \def\@tempa{#1}% + \ifx\@tempa\@emphEQ@EnvName + \expandafter\@emphEQ@PostProcess + \else + \@emphEQ@mathbody\expandafter{\the\@emphEQ@mathbody\end{#1}}% + \expandafter\@emphEQ@get@body + \fi +} +\def\@emphEQ@EnvName{@emphEQ@MainEnv} +\newcommand*{\@emphEQ@PostProcess}{% + \ifx\@emphEQ@boxtype\@emphEQ@shadowbox + \@emphEQ@shadowboxtrue + \else + \@emphEQ@shadowboxfalse + \fi + \tagshift@=0pt \tagwidth@=0pt \totwidth@=0pt + \eqnshift@=0pt \alignsep@=0pt + \setcounter{@emphEQ@EqCtr}{\value{equation}}% + \begin{lrbox}{\@emphEQ@Box}% + \begin{minipage}{\linewidth}% + \vskip-\abovedisplayskip\relax\vskip-1pt\relax + \the\@emphEQ@mathbody + \end{minipage}% + \end{lrbox}% + \ifnum\value{equation}=\value{@emphEQ@EqCtr}% + \ifdim\tagwidth@>0pt + \else + \@emphEQ@NoNumEqtrue + \fi + \else + \setcounter{equation}{\value{@emphEQ@EqCtr}}% + \fi + \settowidth{\@emphEQ@boxtypelength}{\@emphEQ@boxtype{}}% + \if@emphEQ@FLL % fleqn and leqno + \ifdim\alignsep@>0pt % => align + \@emphEQ@aligntrue + \setlength{\@emphEQ@displaywidth}{\tagshift@-\@mathmargin}% + \else + \ifdim\eqnshift@=0pt % => multline %tagwidth@> + \@emphEQ@multlinetrue + \if@emphEQ@NoNumEq + \setlength{\@emphEQ@displaywidth}{% + \linewidth-\multlinegap-\@mathmargin + -\@emphEQ@boxtypelength}% + \else + \setlength{\@emphEQ@displaywidth}{% + \linewidth-\tagwidth@-\multlinegap + -\multlinetaggap-\@emphEQ@boxtypelength}% + \fi + \else + \ifdim\tagshift@=0pt % => gather + \@emphEQ@gathertrue + \setlength{\@emphEQ@displaywidth}{% + \totwidth@-\@mathmargin}% + \else + \ifdim\tagshift@=\totwidth@ % => alignat + \@emphEQ@alignattrue + \setlength{\@emphEQ@displaywidth}{% + \totwidth@-\@mathmargin}% + \else + %Nothing thus far... + \fi + \fi + \fi + \fi + \fi + \if@emphEQ@FLR % fleqn and reqno + \ifdim\alignsep@>0pt % => align + \@emphEQ@aligntrue + \setlength{\@emphEQ@displaywidth}{% + \linewidth-\@mathmargin+\tagshift@}% + \else + \ifdim\eqnshift@=0pt % => multline + \@emphEQ@multlinetrue + \if@emphEQ@NoNumEq + \setlength{\@emphEQ@displaywidth}{% + \linewidth-\multlinegap-\@mathmargin + -\@emphEQ@boxtypelength}% + \else + \setlength{\@emphEQ@displaywidth}{% + \linewidth-\tagwidth@-\@mathmargin + -\multlinetaggap-\@emphEQ@boxtypelength}% + \fi + \else + \ifdim\tagshift@=0pt % => gather + \@emphEQ@gathertrue + \setlength{\@emphEQ@displaywidth}{% + \totwidth@-\@mathmargin}% + \else + \@emphEQ@CloseEnough{\totwidth@-\tagshift@}% + {\linewidth}% + {\@emphEQ@alignattrue + \setlength{\@emphEQ@displaywidth}% + {\totwidth@-\eqnshift@}}{}% + \fi + \fi + \fi + \fi + \if@emphEQ@R % reqno + \ifdim\alignsep@>0pt % => align + \@emphEQ@aligntrue + \setlength{\@emphEQ@displaywidth}{\totwidth@}% + \else + \ifdim\eqnshift@=0pt % => multline + \@emphEQ@multlinetrue + \if@emphEQ@NoNumEq + \setlength{\@emphEQ@displaywidth}{% + \linewidth-2\multlinegap + -\@emphEQ@boxtypelength}% + \else + \setlength{\@emphEQ@displaywidth}{% + \linewidth-\tagwidth@-\multlinegap + -\multlinetaggap-\@emphEQ@boxtypelength}% + \fi + \else + \ifdim\tagshift@=0pt % => gather + \@emphEQ@gathertrue + \setlength{\@emphEQ@displaywidth}{\totwidth@}% + \else + \@emphEQ@CloseEnough{\tagshift@}{-\eqnshift@}% + {\@emphEQ@alignattrue + \setlength{\@emphEQ@displaywidth}{\totwidth@}}{}% + \fi + \fi + \fi + \fi + \if@emphEQ@L % leqno + \ifdim\alignsep@>0pt % => align + \@emphEQ@aligntrue + \setlength{\@emphEQ@displaywidth}{\totwidth@}% + \else + \ifdim\eqnshift@=0pt % => multline + \@emphEQ@multlinetrue + \if@emphEQ@NoNumEq + \setlength{\@emphEQ@displaywidth}{% + \linewidth-2\multlinegap + -\@emphEQ@boxtypelength}% + \else + \setlength{\@emphEQ@displaywidth}{% + \linewidth-\tagwidth@-\multlinegap + -\multlinetaggap-\@emphEQ@boxtypelength}% + \fi + \else + \ifdim\tagshift@=0pt % => gather + \@emphEQ@gathertrue + \setlength{\@emphEQ@displaywidth}{\totwidth@}% + \else + \@emphEQ@CloseEnough{% + \linewidth-\eqnshift@}{\tagshift@}{% + \@emphEQ@alignattrue + \setlength{\@emphEQ@displaywidth}{\totwidth@}}% + {}% + \fi + \fi + \fi + \fi + \settowidth{\@emphEQ@lwd}{${\@emphEQ@Left}% + {\vphantom{\usebox{\@emphEQ@Box}}}$}% + \settowidth{\@emphEQ@rwd}{${\vphantom{\usebox{\@emphEQ@Box}}}% + {\@emphEQ@Right}$}% + \begin{lrbox}{\@emphEQ@Box}% + \if@emphEQ@shadowbox + \addtolength{\@emphEQ@boxtypelength}{-\shadowsize}% + \fi + \if@emphEQ@align + \if@emphEQ@FLL + \begin{minipage}{\linewidth+\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}% + \addtolength{\@mathmargin}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}%% + \fi + \if@emphEQ@FLR + \begin{minipage}{\linewidth}% + \addtolength{\@mathmargin}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}%% + \fi + \if@emphEQ@L + \begin{minipage}{\linewidth+\@emphEQ@lwd-\@emphEQ@rwd}% + \fi + \if@emphEQ@R + \begin{minipage}{\linewidth-\@emphEQ@lwd+\@emphEQ@rwd}% + \fi + \fi + \if@emphEQ@gather + \if@emphEQ@FLL + \begin{minipage}{\linewidth+\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}% + \addtolength{\@mathmargin}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}%% + \fi + \if@emphEQ@FLR + \begin{minipage}{\linewidth}% + \addtolength{\@mathmargin}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}%% + \fi + \if@emphEQ@R + \setlength{\@emphEQ@templength}{\linewidth-\totwidth@ + -\eqnshift@}% + \begin{minipage}{\linewidth-\@emphEQ@lwd+\@emphEQ@rwd + +\@emphEQ@templength-\eqnshift@}% + \fi + \if@emphEQ@L + \setlength{\@emphEQ@templength}{\linewidth-\totwidth@ + -\eqnshift@}% + \begin{minipage}{\linewidth+\@emphEQ@lwd-\@emphEQ@rwd + -\@emphEQ@templength+\eqnshift@}% + \fi + \fi + \if@emphEQ@alignat + \if@emphEQ@FLL + \begin{minipage}{\linewidth+\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}% + \addtolength{\@mathmargin}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}%% + \fi + \if@emphEQ@FLR + \begin{minipage}{\linewidth}% + \addtolength{\@mathmargin}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}%% + \fi + \if@emphEQ@L + \begin{minipage}{\linewidth+\@emphEQ@lwd-\@emphEQ@rwd}% + \fi + \if@emphEQ@R + \begin{minipage}{\linewidth-\@emphEQ@lwd+\@emphEQ@rwd}% + \fi + \fi + \if@emphEQ@multline + \if@emphEQ@FLL + \begin{minipage}{\linewidth}% + \if@emphEQ@NoNumEq + \addtolength{\@mathmargin}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}% + \if@emphEQ@shadowbox + \addtolength{\@mathmargin}{\shadowsize} + \fi% + \else + \addtolength{\multlinetaggap}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}% + \if@emphEQ@shadowbox + \addtolength{\multlinegap}{\shadowsize}% + \fi + \fi + \addtolength{\multlinegap}{\@emphEQ@rwd + +.5\@emphEQ@boxtypelength}% + \fi + \if@emphEQ@FLR + \begin{minipage}{\linewidth}% + \if@emphEQ@NoNumEq + \addtolength{\multlinegap}{\@emphEQ@rwd + +.5\@emphEQ@boxtypelength}% + \if@emphEQ@shadowbox + \addtolength{\multlinegap}{\shadowsize}% + \fi + \else + \addtolength{\multlinetaggap}{\@emphEQ@rwd + +.5\@emphEQ@boxtypelength}% + \if@emphEQ@shadowbox + \addtolength{\multlinetaggap}{\shadowsize}% + \fi + \fi + \addtolength{\@mathmargin}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}% + \fi + \if@emphEQ@L + \begin{minipage}{\linewidth}% + \if@emphEQ@NoNumEq + \addtolength{\multlinegap}{.5\@emphEQ@rwd + +.5\@emphEQ@lwd+.5\@emphEQ@boxtypelength}% + \if@emphEQ@shadowbox + \addtolength{\multlinegap}{.5\shadowsize}% + \fi + \else + \addtolength{\multlinetaggap}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}% + \addtolength{\multlinegap}{\@emphEQ@rwd + +.5\@emphEQ@boxtypelength}% + \if@emphEQ@shadowbox + \addtolength{\multlinegap}{\shadowsize}% + \fi + \fi + \fi + \if@emphEQ@R + \begin{minipage}{\linewidth}% + \if@emphEQ@NoNumEq + \addtolength{\multlinegap}{.5\@emphEQ@rwd + +.5\@emphEQ@lwd+.5\@emphEQ@boxtypelength}% + \if@emphEQ@shadowbox + \addtolength{\multlinegap}{.5\shadowsize} + \fi + \else + \addtolength{\multlinetaggap}{\@emphEQ@rwd + +.5\@emphEQ@boxtypelength}% + \addtolength{\multlinegap}{\@emphEQ@lwd + +.5\@emphEQ@boxtypelength}% + \if@emphEQ@shadowbox + \addtolength{\multlinetaggap}{\shadowsize} + \fi + \fi + \fi + \fi + \vskip-\abovedisplayskip\relax\vskip-1pt\relax + \the\@emphEQ@mathbody + \end{minipage}% + \end{lrbox}% +\setlength{\@emphEQ@BoxWidth}{\@emphEQ@displaywidth+\@emphEQ@rwd + +\@emphEQ@lwd}% +\if@emphEQ@align + \if@emphEQ@FLL + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength% + \kern-\@mathmargin + \kern-\@emphEQ@lwd + \usebox{\@emphEQ@Box}% + \kern-\@emphEQ@displaywidth + \kern-\@emphEQ@rwd + \kern-\@emphEQ@lwd + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@FLR + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength% + \kern-\@mathmargin + \kern-\@emphEQ@lwd + \usebox{\@emphEQ@Box}% + \kern-\alignsep@ + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@L + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% + %\kern\eqnshift@ + %\kern-\alignsep@ + $\@emphEQ@Left$% + \kern-\eqnshift@ + %\kern-\alignsep@ + \usebox{\@emphEQ@Box}% + %\kern-\eqnshift@ + \kern-\alignsep@ + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@R + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% + $\@emphEQ@Left$% + \kern-\eqnshift@ + \usebox{\@emphEQ@Box}% + \kern-\eqnshift@ + $\@emphEQ@Right$}}% + \fi +\fi +\if@emphEQ@alignat + \if@emphEQ@FLL + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength + \kern-\@mathmargin + \kern-\@emphEQ@lwd + \usebox{\@emphEQ@Box}% + \kern\@mathmargin + \kern\@emphEQ@displaywidth + \kern-\linewidth + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@FLR + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength + \kern-\@mathmargin + \kern-\@emphEQ@lwd + \usebox{\@emphEQ@Box}% + \kern\@mathmargin + \kern\@emphEQ@displaywidth + \kern-\linewidth + \kern\@emphEQ@lwd + \kern.5\@emphEQ@boxtypelength + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@L + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% + $\@emphEQ@Left$% + \kern-\eqnshift@ + \usebox{\@emphEQ@Box}% + \kern-\eqnshift@ + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@R + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% + $\@emphEQ@Left$% + \kern-\eqnshift@ + \usebox{\@emphEQ@Box}% + \kern-\eqnshift@ + $\@emphEQ@Right$}}% + \fi +\fi +\if@emphEQ@gather + \if@emphEQ@FLL + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength + \kern-\@mathmargin + \kern-\@emphEQ@lwd + \usebox{\@emphEQ@Box}% + \kern-\linewidth + \kern\@mathmargin + \kern\@emphEQ@displaywidth + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@FLR + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize + \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength + \kern-\@mathmargin + \kern-\@emphEQ@lwd + \usebox{\@emphEQ@Box}% + \kern-\linewidth + \kern.5\@emphEQ@boxtypelength + \kern\@mathmargin + \kern\@emphEQ@displaywidth + \kern\@emphEQ@lwd + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@L + \setlength{\tagwidth@}{\eqnshift@+\@emphEQ@rwd}% + \setlength{\@emphEQ@templength}{\linewidth-\totwidth@ + -\eqnshift@}% + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% + \ifdim\@emphEQ@templength<\tagwidth@ + \setlength{\tagwidth@}{\@emphEQ@templength + +\@emphEQ@lwd}% + \ifdim\tagwidth@<\eqnshift@ + \kern-\@emphEQ@templength + \kern\eqnshift@ + \fi + \else + \kern-\@emphEQ@lwd + \kern\@emphEQ@rwd + \kern-\@emphEQ@templength + \kern\eqnshift@ + \fi + $\@emphEQ@Left$% + \kern-\eqnshift@ + \usebox{\@emphEQ@Box}% + %\kern-\eqnshift@ + \kern-\@emphEQ@lwd + \kern\@emphEQ@rwd + \kern-\@emphEQ@templength + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@R + \setlength{\tagwidth@}{\eqnshift@+\@emphEQ@rwd}% + \setlength{\@emphEQ@templength}{\linewidth-\totwidth@ + -\eqnshift@}% + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% + \kern-\@emphEQ@lwd + \kern\@emphEQ@rwd + \kern\@emphEQ@templength + \kern-\eqnshift@ + $\@emphEQ@Left$% + \ifdim\@emphEQ@templength>\tagwidth@ + \kern-\eqnshift@ + \else + \kern\@emphEQ@lwd + \kern-\@emphEQ@rwd + \kern-\@emphEQ@templength + \fi + \usebox{\@emphEQ@Box}% + \kern-\eqnshift@ + $\@emphEQ@Right$}}% + \fi +\fi +\if@emphEQ@multline + \if@emphEQ@FLL + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@displaywidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength + \kern-\@emphEQ@lwd + \if@emphEQ@NoNumEq + \if@emphEQ@shadowbox \kern-\shadowsize \fi + \kern-\@mathmargin + \else + \kern-\tagwidth@ + \kern-\multlinetaggap + \fi + \usebox{\@emphEQ@Box}% + \kern-\@emphEQ@boxtypelength + \if@emphEQ@NoNumEq + \kern-\multlinegap + \else + \kern\multlinegap + \fi + \kern-\@emphEQ@rwd + \kern-\@emphEQ@lwd + \kern-\@mathmargin + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@FLR + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@displaywidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength + \kern-\@emphEQ@lwd + \kern-\@mathmargin + \usebox{\@emphEQ@Box}% + \kern-\@emphEQ@boxtypelength + \kern-\@emphEQ@rwd + \kern-\@emphEQ@lwd + \if@emphEQ@NoNumEq + \kern-\multlinegap + \else + \kern-\multlinetaggap + \fi + \kern-\@mathmargin + \kern-\tagwidth@ + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@L + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@displaywidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength + \kern-\@emphEQ@lwd + \if@emphEQ@NoNumEq + \kern-\multlinegap + \kern.5\@emphEQ@lwd + \kern-.5\@emphEQ@rwd + \if@emphEQ@shadowbox \kern-.5\shadowsize \fi + \else + \kern-\multlinetaggap + \kern-\tagwidth@ + \fi + \usebox{\@emphEQ@Box}% + \kern-.5\@emphEQ@boxtypelength + \if@emphEQ@NoNumEq + \kern.5\@emphEQ@rwd + \kern-.5\@emphEQ@lwd + \fi + \kern-\@emphEQ@rwd + \kern-\multlinegap + $\@emphEQ@Right$}}% + \fi + \if@emphEQ@R + \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@displaywidth][l]{% + \if@emphEQ@shadowbox \kern.5\shadowsize \fi + $\@emphEQ@Left$% + \kern-.5\@emphEQ@boxtypelength + \if@emphEQ@NoNumEq + \if@emphEQ@shadowbox \kern-.5\shadowsize \fi + \kern-.5\@emphEQ@rwd + \kern.5\@emphEQ@lwd + \fi + \kern-\@emphEQ@lwd + \kern-\multlinegap + \usebox{\@emphEQ@Box}% + \kern-.5\@emphEQ@boxtypelength + \kern-\@emphEQ@rwd + \if@emphEQ@NoNumEq + \kern-\multlinegap + \kern-.5\@emphEQ@lwd + \kern.5\@emphEQ@rwd + \else + \kern-\multlinetaggap + \fi + \kern-\tagwidth@ + $\@emphEQ@Right$}}% + \fi +\fi +\[ + \if@emphEQ@align + \if@emphEQ@L + \kern-\alignsep@ + \kern\eqnshift@ + \fi + \fi + \if@emphEQ@gather + \if@emphEQ@L + \kern-\@emphEQ@templength + \kern\eqnshift@ + \kern\@emphEQ@rwd + \kern-\@emphEQ@lwd + \fi + \if@emphEQ@R + \setlength{\tagwidth@}{\eqnshift@+\@emphEQ@rwd}% + \ifdim\@emphEQ@templength>\tagwidth@ + \kern-\@emphEQ@templength + \kern\eqnshift@ + \kern\@emphEQ@lwd + \else + \kern\@emphEQ@templength + \kern-\eqnshift@ + \kern\@emphEQ@rwd + \kern-\@emphEQ@lwd + \fi + \fi + \fi + \if@emphEQ@multline + \if@emphEQ@NoNumEq + % naught + \else + \if@emphEQ@FLL + \kern-\@mathmargin + \kern\tagwidth@ + \kern\multlinetaggap + \fi + \if@emphEQ@L + \kern\tagwidth@ + \kern\multlinetaggap + \kern-\multlinegap + \fi + \if@emphEQ@R + \kern-\tagwidth@ + \kern-\multlinetaggap + \kern\multlinegap + \fi + \fi + \else + \if@emphEQ@shadowbox + \if@emphEQ@R + \kern\shadowsize + \fi + \if@emphEQ@L + \kern\shadowsize + \fi + \fi + \fi + \@emphEQ@boxtype{\usebox{\@emphEQ@Box}}% + \gdef\@emphEQ@Left{}\gdef\@emphEQ@Right{}% + \gdef\@emphEQ@boxtype{}% + \]% + \ifnum0=`{\fi}% + \expandafter\end\expandafter{\@emphEQ@EnvName}% +} +\define@key{empheq}{boxtype}{\renewcommand\@emphEQ@boxtype{#1}} +\define@key{empheq}{Left}{\def\@emphEQ@Left{#1}} +\define@key{empheq}{Right}{\def\@emphEQ@Right{#1}} +\newenvironment{empheq}[1][]{\setkeys{empheq}{#1}\@emphEQ@MainEnv}% + {\end@emphEQ@MainEnv\ignorespacesafterend}% +\newcommand{\DeclareLeftDelimiter}[2][\!]{% + \@namedef{empheq\expandafter\@gobble\string#2}{ + \left#2 + \vphantom{\usebox{\@emphEQ@Box}}% + \right.#1}} +\newcommand{\DeclareRightDelimiter}[2][\!]{% + \@namedef{empheq\expandafter\@gobble\string#2}{% + #1\left. + \vphantom{\usebox{\@emphEQ@Box}}% + \right#2}}% +\DeclareRightDelimiter{\rbrace} +\DeclareLeftDelimiter{\lbrace} +\endinput +%% +%% End of file `empheq07.sty'. diff --git a/Master/texmf-dist/tex/latex/mh/mathtools.sty b/Master/texmf-dist/tex/latex/mh/mathtools.sty new file mode 100644 index 00000000000..e91b6692726 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mh/mathtools.sty @@ -0,0 +1,1063 @@ +%% +%% This is file `mathtools.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mathtools.dtx (with options: `package') +%% +%% It 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 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Morten H\o gholm. +%% +%% This work consists of the files mathtools.dtx and mathtools.ins +%% and the derived file mathtools.sty. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mathtools} + [2004/10/10 v1.01a mathematical typesetting tools (MH)] +\RequirePackage{keyval,calc} +\RequirePackage{mhsetup}[2004/10/10] +\MHInternalSyntaxOn +\def\MT_options_name:{mathtools} +\newcommand*\mathtoolsset[1]{\setkeys{\MT_options_name:}{#1}} +\MH_new_boolean:n {fixamsmath} +\DeclareOption{fixamsmath}{ + \MH_set_boolean_T:n {fixamsmath} +} +\DeclareOption{donotfixamsmathbugs}{ + \MH_set_boolean_F:n {fixamsmath} +} +\DeclareOption{allowspaces}{ + \MH_let:NwN \MaybeMHPrecedingSpacesOff + \relax + \MH_let:NwN \MH_maybe_nospace_ifnextchar:Nnn \kernel@ifnextchar +} +\DeclareOption{disallowspaces}{ + \MH_let:NwN \MaybeMHPrecedingSpacesOff + \MHPrecedingSpacesOff + \MH_let:NwN \MH_maybe_nospace_ifnextchar:Nnn \MH_nospace_ifnextchar:Nnn +} +\DeclareOption*{ + \PassOptionsToPackage{\CurrentOption}{amsmath} +} +\ExecuteOptions{fixamsmath,disallowspaces} +\ProcessOptions\relax +\MHInternalSyntaxOff +\RequirePackage{amsmath}[2000/07/18] +\MHInternalSyntaxOn +\AtEndOfPackage{\MHInternalSyntaxOff} +\def\MT_true_false_error:{ + \PackageError{mathtools} + {You~ have~ to~ select~ either~ `true'~ or~ `false'} + {I'll~ assume~ you~ chose~ `false'~ for~ now.} +} +\def\MT_define_tagform:nwnn #1[#2]#3#4{ + \@namedef{MT_tagform_#1:n}##1 + {\maketag@@@{#3\ignorespaces#2{##1}\unskip\@@italiccorr#4}} +} +\providecommand*\newtagform[1]{% + \@ifundefined{MT_tagform_#1:n} + {\@ifnextchar[% + {\MT_define_tagform:nwnn #1}% + {\MT_define_tagform:nwnn #1[]}% + }{\PackageError{mathtools} + {The~ tag~ form~ `#1'~ is~ already~ defined\MessageBreak + You~ probably~ want~ to~ look~ up~ \@backslashchar renewtagform~ + instead} + {I~ will~ just~ ignore~ your~ wish~ for~ now.}} +} +\newtagform{default}{(}{)} +\providecommand*\renewtagform[1]{% + \@ifundefined{MT_tagform_#1:n} + {\PackageError{mathtools} + {The~ tag~ form~ `#1'~ is~ not~ defined\MessageBreak + You~ probably~ want~ to~ look~ up~ \@backslashchar newtagform~ instead} + {I~ will~ just~ ignore~ your~ wish~ for~ now.}} + {\@ifnextchar[% + {\MT_define_tagform:nwnn #1}% + {\MT_define_tagform:nwnn #1[]}% + } +} +\providecommand*\usetagform[1]{% + \@ifundefined{MT_tagform_#1:n} + { + \PackageError{mathtools}{% + You~ have~ chosen~ the~ tag~ form~ `#1'\MessageBreak + but~ it~ appears~ to~ be~ undefined} + {I~ will~ use~ the~ default~ tag~ form~ instead.}% + \@namedef{tagform@}{\@nameuse{MT_tagform_default:n}} + } + { \@namedef{tagform@}{\@nameuse{MT_tagform_#1:n}} } + \MH_if_boolean:nT {show_only_refs}{ + \MH_let:NwN \MT_prev_tagform:n \tagform@ + \def\tagform@##1{\MT_extended_tagform:n {##1}} + } +} +\MH_new_boolean:n {manual_tag} +\MH_new_boolean:n {raw_maketag} +\MH_let:NwN \MT_AmS_tag_in_align: \tag@in@align +\def\tag@in@align{ + \global\MH_set_boolean_T:n {manual_tag} + \MT_AmS_tag_in_align: +} +\def\tag@in@display#1#{ + \relax + \global\MH_set_boolean_T:n {manual_tag} + \tag@in@display@a{#1} +} +\def\MT_extended_tagform:n #1{ + \MH_set_boolean_F:n {raw_maketag} + \if_meaning:NN \df@label\@empty + \MH_if_boolean:nT {manual_tag} + { \MH_if_boolean:nTF {show_manual_tags} + { \MT_prev_tagform:n {#1} } + { \stepcounter{equation} } + } + \else: + \MH_if_boolean:nTF {manual_tag} + { \MH_if_boolean:nTF {show_manual_tags} + { \MT_prev_tagform:n {#1} } + { \@ifundefined{MT_r_\df@label} + { } + { \MT_prev_tagform:n {#1} } + } + } + { \@ifundefined{MT_r_\df@label} + { } + { \refstepcounter{equation}\MT_prev_tagform:n {#1} } + } + \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_if_boolean:nTF {raw_maketag} + { + \MH_if_boolean:nTF {show_manual_tags} + { \MT_maketag:n {#1} } + { \@ifundefined{MT_r_\df@label} + { } + { \MT_maketag:n {#1} } + } + } + { \MT_maketag:n {#1} } + \fi: + \global\MH_set_boolean_F:n {manual_tag} +} +\def\MT_extended_eqref:n #1{ + \protected@write\@auxout{} + {\string\MT@newlabel{#1}} + \textup{\MT_prev_tagform:n {\ref{#1}}} +} +\newcommand*\refeq[1]{ + \textup{\ref{#1}} +} +\def\MT_extended_refeq:n #1{ + \protected@write\@auxout{} + {\string\MT@newlabel{#1}} + \textup{\ref{#1}} +} +\newcommand*\MT@newlabel[1]{ \global\@namedef{MT_r_#1}{} } +\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:} + { \MT_true_false_error: + \@nameuse{boolean_show_manual_tags_false:} + } + { \@nameuse{boolean_show_manual_tags_#1:} } +} +\newcommand*\MT_showonlyrefs_true:{ + \MH_if_boolean:nF {show_only_refs}{ + \MH_set_boolean_T:n {show_only_refs} + \MH_let:NwN \MT_incr_eqnum: \incr@eqnum + \MH_let:NwN \incr@eqnum \@empty + \MH_let:NwN \MT_array_parbox_restore: \@arrayparboxrestore + \@xp\def\@xp\@arrayparboxrestore\@xp{\@arrayparboxrestore + \MH_let:NwN \incr@eqnum \@empty + } + \MH_let:NwN \MT_prev_tagform:n \tagform@ + \MH_let:NwN \MT_eqref:n \eqref + \MH_let:NwN \MT_refeq:n \refeq + \MH_let:NwN \MT_maketag:n \maketag@@@ + \MH_let:NwN \maketag@@@ \MT_extended_maketag:n + \def\tagform@##1{\MT_extended_tagform:n {##1}} + \MH_let:NwN \eqref \MT_extended_eqref:n + \MH_let:NwN \refeq \MT_extended_refeq:n + } +} +\def\MT_showonlyrefs_false: { + \MH_if_boolean:nT {show_only_refs}{ + \MH_set_boolean_F:n {show_only_refs} + \MH_let:NwN \tagform@ \MT_prev_tagform:n + \MH_let:NwN \eqref \MT_eqref:n + \MH_let:NwN \refeq \MT_refeq:n + \MH_let:NwN \maketag@@@ \MT_maketag:n + \MH_let:NwN \incr@eqnum \MT_incr_eqnum: + \MH_let:NwN \@arrayparboxrestore \MT_array_parbox_restore: + } +} +\define@key{\MT_options_name:}{showonlyrefs}[true]{ + \@nameuse{MT_showonlyrefs_#1:} +} +\renewcommand\nonumber{ + \if@eqnsw + \if_meaning:NN \incr@eqnum\@empty + \MH_if_boolean:nF {show_only_refs} + {\addtocounter{equation}\m@ne} + \fi: + \fi: + \MH_let:NwN \print@eqnum\@empty \MH_let:NwN \incr@eqnum\@empty + \global\@eqnswfalse +} +\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}} +\providecommand*\xRightarrow[2][]{% + \ext@arrow 0055{\Rightarrowfill@}{#1}{#2}} +\providecommand*\xLeftrightarrow[2][]{% + \ext@arrow 0055{\Leftrightarrowfill@}{#1}{#2}} +\def\MT_rightharpoondown_fill:{% + \arrowfill@\relbar\relbar\rightharpoondown} +\def\MT_rightharpoonup_fill:{% + \arrowfill@\relbar\relbar\rightharpoonup} +\def\MT_leftharpoondown_fill:{% + \arrowfill@\leftharpoondown\relbar\relbar} +\def\MT_leftharpoonup_fill:{% + \arrowfill@\leftharpoonup\relbar\relbar} +\providecommand*\xrightharpoondown[2][]{% + \ext@arrow 0359\MT_rightharpoondown_fill:{#1}{#2}} +\providecommand*\xrightharpoonup[2][]{% + \ext@arrow 0359\MT_rightharpoonup_fill:{#1}{#2}} +\providecommand*\xleftharpoondown[2][]{% + \ext@arrow 3095\MT_leftharpoondown_fill:{#1}{#2}} +\providecommand*\xleftharpoonup[2][]{% + \ext@arrow 3095\MT_leftharpoonup_fill:{#1}{#2}} +\providecommand*\xleftrightharpoons[2][]{\mathrel{% + \raise.22ex\hbox{% + $\ext@arrow 3095\MT_leftharpoonup_fill:{\phantom{#1}}{#2}$}% + \setbox0=\hbox{% + $\ext@arrow 0359\MT_rightharpoondown_fill:{#1}{\phantom{#2}}$}% + \kern-\wd0 \lower.22ex\box0}} +\providecommand*\xrightleftharpoons[2][]{\mathrel{% + \raise.22ex\hbox{% + $\ext@arrow 3095\MT_rightharpoonup_fill:{\phantom{#1}}{#2}$}% + \setbox0=\hbox{% + $\ext@arrow 0359\MT_leftharpoondown_fill:{#1}{\phantom{#2}}$}% + \kern-\wd0 \lower.22ex\box0}} +\providecommand*\xhookleftarrow[2][]{% + \ext@arrow 3095\MT_hookleft_fill:{#1}{#2}} +\def\MT_hookleft_fill:{% + \arrowfill@\leftarrow\relbar{\relbar\joinrel\rhook}} +\providecommand*\xhookrightarrow[2][]{% + \ext@arrow 3095\MT_hookright_fill:{#1}{#2}} +\def\MT_hookright_fill:{% + \arrowfill@{\lhook\joinrel\relbar}\relbar\rightarrow} +\providecommand*\xmapsto[2][]{% + \ext@arrow 0395\MT_mapsto_fill:{#1}{#2}} +\def\MT_mapsto_fill:{% + \arrowfill@{\mapstochar\relbar}\relbar\rightarrow} +\providecommand*\underbracket{ + \@ifnextchar[ + {\MT_underbracket_I:w} + {\MT_underbracket_I:w[\l_MT_bracketheight_fdim]}} +\def\MT_underbracket_I:w[#1]{ + \@ifnextchar[ + {\MT_underbracket_II:w[#1]} + {\MT_underbracket_II:w[#1][.7\fontdimen5\textfont2]}} +\def\MT_underbracket_II:w[#1][#2]#3{% + \mathop{\vtop{\m@th\ialign{## + \crcr + $\hfil\displaystyle{#3}\hfil$% + \crcr + \noalign{\kern .2\fontdimen5\textfont2 \nointerlineskip}% + \upbracketfill {#1}{#2}% + \crcr}}} + \limits} +\def\upbracketfill#1#2{% + \sbox\z@{$\braceld$} + \edef\l_MT_bracketheight_fdim{\the\ht\z@}% + \upbracketend{#1}{#2} + \leaders \vrule \@height \z@ \@depth #1 \hfill + \upbracketend{#1}{#2}% +} +\def\upbracketend#1#2{\vrule \@height #2 \@width #1\relax} +\providecommand*\overbracket{ + \@ifnextchar[ + {\MT_overbracket_I:w} + {\MT_overbracket_I:w[\l_MT_bracketheight_fdim]}} +\def\MT_overbracket_I:w[#1]{ + \@ifnextchar[ + {\MT_overbracket_II:w[#1]} + {\MT_overbracket_II:w[#1][.7\fontdimen5\textfont2]}} +\def\MT_overbracket_II:w[#1][#2]#3{% + \mathop{\vbox{\m@th\ialign{## + \crcr + \downbracketfill{#1}{#2}% + \crcr + \noalign{\kern .2\fontdimen5\textfont2 \nointerlineskip}% + $\hfil\displaystyle{#3}\hfil$ + \crcr}}}% + \limits} +\def\downbracketfill#1#2{% + \sbox\z@{$\braceld$}\edef\l_MT_bracketheight_fdim{\the\ht\z@} + \downbracketend{#1}{#2} + \leaders \vrule \@height #1 \@depth \z@ \hfill + \downbracketend{#1}{#2}% +} +\def\downbracketend#1#2{\vrule \@width #1\@depth #2\relax} +\MH_let:NwN \LaTeXunderbrace \underbrace +\def\underbrace#1{\mathop{\vtop{\m@th\ialign{##\crcr + $\hfil\displaystyle{#1}\hfil$\crcr + \noalign{\kern.7\fontdimen5\textfont2\nointerlineskip}% + \upbracefill\crcr\noalign{\kern.5\fontdimen5\textfont2}}}}\limits} +\MH_let:NwN \LaTeXoverbrace \overbrace +\def\overbrace#1{\mathop{\vbox{\m@th\ialign{##\crcr + \noalign{\kern.5\fontdimen5\textfont2}% + \downbracefill\crcr + \noalign{\kern.7\fontdimen5\textfont2\nointerlineskip}% + $\hfil\displaystyle{#1}\hfil$\crcr}}}\limits} +\providecommand*\lparen{(} +\providecommand*\rparen{)} + +\def\vcentcolon{\mathrel{\mathop\ordinarycolon}} +\begingroup + \catcode`\:=\active + \lowercase{\endgroup + \ifnum\mathcode`\:=32768\relax + \let\ordinarycolon= :% + \else + \mathchardef\ordinarycolon\mathcode`\: % + \fi + \let :\vcentcolon + } +\MH_new_boolean:n {center_colon} +\define@key{\MT_options_name:}{centercolon}[true]{ + \@ifundefined{MT_active_colon_#1:} + { \MT_true_false_error:n + \@nameuse{MT_active_colon_false:} + } + { \@nameuse{MT_active_colon_#1:} } +} +\def\MT_active_colon_true: { + \MH_if_boolean:nF {center_colon}{ + \MH_set_boolean_T:n {center_colon} + \edef\MT_active_colon_false: + {\mathcode`\noexpand\:=\the\mathcode`\:\relax} + \mathcode`\:=32768 + } +} +\AtBeginDocument{ + \providecommand*\dblcolon{\vcentcolon\mkern-.9mu\vcentcolon} + \providecommand*\coloneqq{\vcentcolon\mkern-1.2mu=} + \providecommand*\Coloneqq{\dblcolon\mkern-1.2mu=} + \providecommand*\coloneq{\vcentcolon\mkern-1.2mu\mathrel{-}} + \providecommand*\Coloneq{\dblcolon\mkern-1.2mu\mathrel{-}} + \providecommand*\eqqcolon{=\mkern-1.2mu\vcentcolon} + \providecommand*\Eqqcolon{=\mkern-1.2mu\dblcolon} + \providecommand*\eqcolon{\mathrel{-}\mkern-1.2mu\vcentcolon} + \providecommand*\Eqcolon{\mathrel{-}\mkern-1.2mu\dblcolon} + \providecommand*\colonapprox{\vcentcolon\mkern-1.2mu\approx} + \providecommand*\Colonapprox{\dblcolon\mkern-1.2mu\approx} + \providecommand*\colonsim{\vcentcolon\mkern-1.2mu\sim} + \providecommand*\Colonsim{\dblcolon\mkern-1.2mu\sim} +} +\MH_new_boolean:n {mult_firstline} +\MH_new_boolean:n {outer_mult} +\newcount\g_MT_multlinerow_int +\newdimen\l_MT_multwidth_dim +\newcommand*\MT_test_for_tcb_other:nnnnn [1]{ + \if:w t#1\relax + \expandafter\MH_use_choice_i:nnnn + \else: + \if:w c#1\relax + \expandafter\expandafter\expandafter\MH_use_choice_ii:nnnn + \else: + \if:w b#1\relax + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \MH_use_choice_iii:nnnn + \else: + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \MH_use_choice_iv:nnnn + \fi: + \fi: + \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-\normallineskip} +} +\def\MT_mult_mathcr_atat:w [#1]{% + \if_num:w 0=`{\fi: \iffalse}\fi: + \MH_if_boolean:nT {mult_firstline}{ + \kern\l_MT_mult_left_fdim + \MT_mult_invisible_line: + } + \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_let:NwN \math@cr@@\MT_mult_last_mathcr:w + \fi: +} +\def\MT_mult_firstandlast_mathcr:w [#1]{% + \if_num:w 0=`{\fi: \iffalse}\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@@@ + \noalign{\vskip#1\relax} + \kern\l_MT_mult_right_fdim} +\newcommand\MT_start_mult:N [1]{ + \MT_test_for_tcb_other:nnnnn {#1} + { \MH_let:NwN \MT_next:\vtop } + { \MH_let:NwN \MT_next:\vcenter } + { \MH_let:NwN \MT_next:\vbox } + { + \PackageError{mathtools} + {Invalid~ position~ specifier.~ I'll~ try~ to~ recover~ with~ + `c'}\@ehc + } + \collect@body\MT_mult_internal:n +} +\newcommand*\MT_shoveright:wn [2][0pt]{% + #2\hfilneg + \setlength\@tempdima{#1} + \kern\@tempdima +} +\newcommand*\MT_shoveleft:wn [2][0pt]{% + \hfilneg + \setlength\@tempdima{#1} + \kern\@tempdima + #2 +} +\newcommand*\MT_mult_internal:n [1]{ + \MH_if_boolean:nF {outer_mult}{\null\,} + \MT_next: + \bgroup + \Let@ + \def\l_MT_multline_lastline_fint{0 } + \chardef\dspbrk@context\@ne \restore@math@cr + \MH_let:NwN \math@cr@@\MT_mult_mathcr_atat:w + \MH_let:NwN \shoveleft\MT_shoveleft:wn + \MH_let:NwN \shoveright\MT_shoveright:wn + \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_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_let:NwN \math@cr@@ \MT_mult_firstandlast_mathcr:w + \fi: + \ialign\bgroup + \hfil\strut@$\m@th\displaystyle{}##$\hfil + \crcr + \hfilneg + #1 +} +\newcommand\MT_measure_mult:n [1]{ + \begingroup + \g_MT_multlinerow_int\@ne + \MH_let:NwN \label\MT_gobblelabel:w + \MH_let:NwN \tag\gobble@tag + \setbox\z@\vbox{ + \ialign{\strut@$\m@th\displaystyle{}##$ + \crcr + #1 + \crcr + } + } + \xdef\l_MT_multline_measure_fdim{\the\wdz@} + \advance\g_MT_multlinerow_int\m@ne + \xdef\l_MT_multline_lastline_fint{\number\g_MT_multlinerow_int} + \endgroup + \g_MT_multlinerow_int\@ne +} +\MaybeMHPrecedingSpacesOff +\newcommand*\MT_multlined_second_arg:w [1][\@empty]{ + \MT_test_for_tcb_other:nnnnn {#1} + {\def\MT_mult_default_pos:{#1}} + {\def\MT_mult_default_pos:{#1}} + {\def\MT_mult_default_pos:{#1}} + { + \if_meaning:NN \@empty#1\@empty + \else: + \setlength \l_MT_multwidth_dim{#1} + \fi: + } + \MT_start_mult:N \MT_mult_default_pos: +} +\newenvironment{multlined}[1][] + { + \MT_test_for_tcb_other:nnnnn {#1} + {\def\MT_mult_default_pos:{#1}} + {\def\MT_mult_default_pos:{#1}} + {\def\MT_mult_default_pos:{#1}} + { + \if_meaning:NN \@empty#1\@empty + \else: + \setlength \l_MT_multwidth_dim{#1} + \fi: + } + \MT_multlined_second_arg:w + } + { + \hfilneg \endaligned + } +\MHPrecedingSpacesOn +\define@key{\MT_options_name:} + {firstline-afterskip}{\def\l_MT_mult_left_fdim{#1}} +\define@key{\MT_options_name:} + {lastline-preskip}{\def\l_MT_mult_right_fdim{#1}} +\define@key{\MT_options_name:} + {multlined-width}{\setlength \l_MT_multwidth_dim{#1}} +\define@key{\MT_options_name:} + {multlined-pos}{\def\MT_mult_default_pos:{#1}} +\setkeys{\MT_options_name:}{ + firstline-afterskip=\multlinegap, + lastline-preskip=\multlinegap, + multlined-width=0pt, + multlined-pos=c, +} +\def\MT_gobblelabel:w #1{} +\newcommand*\DeclarePairedDelimiter[3]{% + \@ifdefinable{#1}{ + \edef\MT_next: {\MH_cs_to_str:N #1} + \@namedef{MT_delim_\MT_next: _star:}##1 + {\left#2 ##1 \right #3}% + \@xp\@xp\@xp + \newcommand + \@xp\csname MT_delim_\MT_next: _nostar:\endcsname[2][\\@gobble] + { \edef\MT_next: {\MH_cs_to_str:N ##1} + \@nameuse {\MT_next: l} #2 ##2 \@nameuse {\MT_next: r} #3} + \newcommand{#1}{ + \@ifstar + {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} + {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar:}} + } + } +} +\def\MT_start_cases:nn #1#2{ + \RIfM@\else + \nonmatherr@{\begin{\@currenvir}}% + \fi + \left\lbrace + \vcenter \bgroup + \Let@ \chardef\dspbrk@context\@ne \restore@math@cr + \spread@equation + \ialign\bgroup + \strut@$\m@th\displaystyle{##}$\hfil\strut@ + #2 + \crcr +} +\newcommand*\newcases[3]{ + \newenvironment{#1} + {\MT_start_cases:nn {#2}{#3}} + {\endaligned\right.} +} +\newcommand*\renewcases[3]{ + \renewenvironment{#1} + {\MT_start_cases:nn {#2}{#3}} + {\endaligned\right.} +} +\newcases{dcases}{\quad}{$\m@th\displaystyle{##}$\hfil} +\newcases{dcases*}{\quad}{{##}\hfil} +\def\MT_matrix_begin:N #1{% + \hskip -\arraycolsep + \MH_let:NwN \@ifnextchar \MH_nospace_ifnextchar:Nnn + \array{*\c@MaxMatrixCols #1}} +\def\MT_matrix_end:{\endarray \hskip -\arraycolsep} +\MaybeMHPrecedingSpacesOff +\newenvironment{matrix*}[1][c] + {\MT_matrix_begin:N #1} + {\MT_matrix_end:} +\newenvironment{pmatrix*}[1][c] + {\left(\MT_matrix_begin:N #1} + {\MT_matrix_end:\right)} +\newenvironment{bmatrix*}[1][c] + {\left[\MT_matrix_begin:N #1} + {\MT_matrix_end:\right]} +\newenvironment{Bmatrix*}[1][c] + {\left\lbrace\MT_matrix_begin:N #1} + {\MT_matrix_end:\right\rbrace} +\newenvironment{vmatrix*}[1][c] + {\left\lvert\MT_matrix_begin:N #1} + {\MT_matrix_end:\right\rvert} +\newenvironment{Vmatrix*}[1][c] + {\left\lVert\MT_matrix_begin:N #1} + {\MT_matrix_end:\right\lVert} +\MHPrecedingSpacesOn +\newcommand*\smashoperator[2][lr]{ + \def\MT_smop_use:NNNNN {\@nameuse{MT_smop_smash_#1:NNNNN}} + \toks@{#2} + \expandafter\MT_smop_get_args:wwwNnNn + \the\toks@\@nil\@nil\@nil\@nil\@nil\@nil\@@nil +} +\def\MT_smop_remove_nil_vi:N #1\@nil\@nil\@nil\@nil\@nil\@nil{#1} +\def\MT_smop_mathop:n {\mathop} +\def\MT_smop_limits: {\limits} +\MH_new_boolean:n {smop_one} +\MH_new_boolean:n {smop_two} +\def\MT_smop_get_args:wwwNnNn #1#2#3#4#5#6#7\@@nil{% + \begingroup + \def\MT_smop_arg_A: {#1} \def\MT_smop_arg_B: {#2} + \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: + \def\MT_smop_final_arg_A:{#1{#2}}% + \if_meaning:NN \MT_smop_arg_D: \@nnil + \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_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: + \def\MT_smop_final_arg_A:{#1{#2}}% + \if_meaning:NN \MT_smop_arg_D: \@nnil + \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_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: + \def\MT_smop_final_arg_A:{#1}% + \if_meaning:NN \MT_smop_arg_D: \@nnil + \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_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: + \def\MT_smop_final_arg_A:{#1}% + \if_meaning:NN \MT_smop_arg_C: \@nnil + \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_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_if_boolean:nT {smop_one}{ + \MT_smop_measure:NNNNN + \MT_smop_final_arg_A: \MT_smop_final_arg_B: \MT_smop_final_arg_C: + \MT_smop_final_arg_D: \MT_smop_final_arg_E: + } + \MT_smop_use:NNNNN + \MT_smop_final_arg_A: \MT_smop_final_arg_B: \MT_smop_final_arg_C: + \MT_smop_final_arg_D: \MT_smop_final_arg_E: + \endgroup +} +\def\MT_smop_needed_args:NNNNN #1#2#3#4#5{% + \displaystyle #1 + \MH_if_boolean:nT {smop_one}{ + \limits#2{\MT_cramped_clap_internal:Nn \scriptstyle{#3}} + \MH_if_boolean:nT {smop_two}{ + #4{\MT_cramped_clap_internal:Nn \scriptstyle{#5}} + } + } +} +\def\MT_smop_measure:NNNNN #1#2#3#4#5{% + \MH_let:NwN \MT_saved_mathclap:Nn \MT_cramped_clap_internal:Nn + \MH_let:NwN \MT_cramped_clap_internal:Nn \@secondoftwo + \sbox\z@{$\m@th\MT_smop_needed_args:NNNNN #1#2#3#4#5$} + \MH_let:NwN \MT_cramped_clap_internal:Nn \MT_saved_mathclap:Nn + \sbox\tw@{$\m@th\displaystyle#1$} + \@tempdima=.5\wd0 + \advance\@tempdima-.5\wd2 +} +\def\MT_smop_smash_l:NNNNN #1#2#3#4#5{ + \MT_smop_needed_args:NNNNN #1#2#3#4#5\kern\@tempdima +} +\def\MT_smop_smash_r:NNNNN #1#2#3#4#5{ + \kern\@tempdima\MT_smop_needed_args:NNNNN #1#2#3#4#5 +} +\def\MT_smop_smash_lr:NNNNN #1#2#3#4#5{ + \MT_smop_needed_args:NNNNN #1#2#3#4#5 +} +\def\MT_vphantom:Nn {\v@true\h@false\MT_internal_phantom:N} +\def\MT_hphantom:Nn {\v@false\h@true\MT_internal_phantom:N} +\def\MT_phantom:Nn {\v@true\h@true\MT_internal_phantom:N} +\def\MT_internal_phantom:N #1{ + \ifmmode + \expandafter\mathph@nt\expandafter#1 + \else + \expandafter\makeph@nt + \fi +} +\newcommand*\adjustlimits[6]{ + \sbox\z@{$\m@th \displaystyle #1$} + \sbox\tw@{$\m@th \displaystyle #4$} + \@tempdima=\dp\z@ \advance\@tempdima-\dp\tw@ + \if_dim:w \@tempdima>\z@ + \mathop{#1}\limits#2{#3} + \else: + \mathop{#1\MT_vphantom:Nn \displaystyle{#4}}\limits + #2{ + \def\finsm@sh{\ht\z@\z@ \box\z@} + \mathsm@sh\scriptstyle{\MT_cramped_internal:Nn \scriptstyle{#3}} + \MT_vphantom:Nn \scriptstyle + {\MT_cramped_internal:Nn \scriptstyle{#6}} + } + \fi: + \if_dim:w \@tempdima>\z@ + \mathop{#4\MT_vphantom:Nn \displaystyle{#1}}\limits + #5 + { + \MT_vphantom:Nn \scriptstyle + {\MT_cramped_internal:Nn \scriptstyle{#3}} + \def\finsm@sh{\ht\z@\z@ \box\z@} + \mathsm@sh\scriptstyle{\MT_cramped_internal:Nn \scriptstyle{#6}} + } + \else: + \mathop{#4}\limits#5{#6} + \fi: +} +\def\shortintertext#1{% + \ifvmode\else\\\@empty\fi + \noalign{% + \penalty\postdisplaypenalty\vskip\abovedisplayshortskip + \vbox{\normalbaselines + \if_dim:w \linewidth=\columnwidth + \else: + \parshape\@ne \@totalleftmargin \linewidth + \fi: + \noindent#1\par}% + \penalty\predisplaypenalty\vskip\abovedisplayshortskip% + }% +} +\providecommand*\clap[1]{\hb@xt@\z@{\hss#1\hss}} +\providecommand*\mathllap[1][\@empty]{ + \ifx\@empty#1\@empty + \expandafter \mathpalette \expandafter \MT_mathllap:Nn + \else + \expandafter \MT_mathllap:Nn \expandafter #1 + \fi +} +\providecommand*\mathrlap[1][\@empty]{ + \ifx\@empty#1\@empty + \expandafter \mathpalette \expandafter \MT_mathrlap:Nn + \else + \expandafter \MT_mathrlap:Nn \expandafter #1 + \fi +} +\providecommand*\mathclap[1][\@empty]{ + \ifx\@empty#1\@empty + \expandafter \mathpalette \expandafter \MT_mathclap:Nn + \else + \expandafter \MT_mathclap:Nn \expandafter #1 + \fi +} +\def\MT_mathllap:Nn #1#2{{}\llap{$\m@th#1{#2}$}} +\def\MT_mathrlap:Nn #1#2{{}\rlap{$\m@th#1{#2}$}} +\def\MT_mathclap:Nn #1#2{{}\clap{$\m@th#1{#2}$}} +\providecommand*\mathmbox{\mathpalette\MT_mathmbox:nn} +\def\MT_mathmbox:nn #1#2{\mbox{$\m@th#1#2$}} +\providecommand*\mathmakebox{ + \@ifnextchar[ \MT_mathmakebox_I:w + \mathmbox} +\def\MT_mathmakebox_I:w[#1]{% + \@ifnextchar[ {\MT_mathmakebox_II:w[#1]} + {\MT_mathmakebox_II:w[#1][c]}} +\def\MT_mathmakebox_II:w[#1][#2]{ + \mathpalette{\MT_mathmakebox_III:w[#1][#2]}} +\def\MT_mathmakebox_III:w[#1][#2]#3#4{% + \@begin@tempboxa\hbox{$\m@th#3#4$}% + \setlength\@tempdima{#1}% + \hbox{\hb@xt@\@tempdima{\csname bm@#2\endcsname}}% + \@end@tempboxa} +\def\mathsm@sh#1#2{% + \setbox\z@\hbox{$\m@th#1{#2}$}{}\finsm@sh} +\providecommand*\cramped[1][\@empty]{ + \ifx\@empty#1\@empty + \expandafter \mathpalette \expandafter \MT_cramped_internal:Nn + \else + \expandafter \MT_cramped_internal:Nn \expandafter #1 + \fi +} +\def\MT_cramped_internal:Nn #1#2{ + \sbox\z@{$\m@th#1\nulldelimiterspace=\z@\radical\z@{#2}$} + \ifx#1\displaystyle + \dimen@=\fontdimen8\textfont3 + \advance\dimen@ .25\fontdimen5\textfont2 + \else + \dimen@=1.25\fontdimen8 + \ifx#1\textstyle\textfont + \else + \ifx#1\scriptstyle + \scriptfont + \else + \scriptscriptfont + \fi + \fi + 3 + \fi + \advance\dimen@-\ht\z@ \ht\z@=-\dimen@ + \box\z@ +} +\providecommand*\crampedllap[1][\@empty]{ + \ifx\@empty#1\@empty + \expandafter \mathpalette \expandafter \MT_cramped_llap_internal:Nn + \else + \expandafter \MT_cramped_llap_internal:Nn \expandafter #1 + \fi +} +\def\MT_cramped_llap_internal:Nn #1#2{ + {}\llap{\MT_cramped_internal:Nn #1{#2}} +} +\providecommand*\crampedclap[1][\@empty]{ + \ifx\@empty#1\@empty + \expandafter \mathpalette \expandafter \MT_cramped_clap_internal:Nn + \else + \expandafter \MT_cramped_clap_internal:Nn \expandafter #1 + \fi +} +\def\MT_cramped_clap_internal:Nn #1#2{ + {}\clap{\MT_cramped_internal:Nn #1{#2}} +} +\providecommand*\crampedrlap[1][\@empty]{ + \ifx\@empty#1\@empty + \expandafter \mathpalette \expandafter \MT_cramped_rlap_internal:Nn + \else + \expandafter \MT_cramped_rlap_internal:Nn \expandafter #1 + \fi +} +\def\MT_cramped_rlap_internal:Nn #1#2{ + {}\rlap{\MT_cramped_internal:Nn #1{#2}} +} +\DeclareRobustCommand{\prescript}[3]{ + \@mathmeasure\z@\scriptstyle{\MT_prescript_sup:{#1}} + \@mathmeasure\tw@\scriptstyle{\MT_prescript_sub:{#2}} + \if_dim:w \wd\tw@>\wd\z@ + \setbox\z@\hbox to\wd\tw@{\hfil\unhbox\z@} + \else: + \setbox\tw@\hbox to\wd\z@{\hfil\unhbox\tw@} + \fi: + \mathop{} + \mathopen{\vphantom{\MT_prescript_arg:{#3}}}^{\box\z@}\sb{\box\tw@} + \MT_prescript_arg:{#3} +} +\define@key{\MT_options_name:} + {prescript-sup-format}{\def\MT_prescript_sup:{#1}} +\define@key{\MT_options_name:} + {prescript-sub-format}{\def\MT_prescript_sub:{#1}} +\define@key{\MT_options_name:} + {prescript-arg-format}{\def\MT_prescript_arg:{#1}} +\setkeys{\MT_options_name:}{ + prescript-sup-format={}, + prescript-sub-format={}, + prescript-arg-format={}, +} +\def\@DeclareMathSizes #1#2#3#4#5{% + \@defaultunits\dimen@ #2pt\relax\@nnil + \if:w $#3$% + \MH_let:cN {S@\strip@pt\dimen@}\math@fontsfalse + \else: + \@defaultunits\dimen@ii #3pt\relax\@nnil + \@defaultunits\@tempdima #4pt\relax\@nnil + \@defaultunits\@tempdimb #5pt\relax\@nnil + \toks@{#1}% + \expandafter\xdef\csname S@\strip@pt\dimen@\endcsname{% + \gdef\noexpand\tf@size{\strip@pt\dimen@ii}% + \gdef\noexpand\sf@size{\strip@pt\@tempdima}% + \gdef\noexpand\ssf@size{\strip@pt\@tempdimb}% + \the\toks@ + }% + \fi: +} +\def\MT_mathic_true: { + \MH_if_boolean:nF {math_italic_corr}{ + \MH_set_boolean_T:n {math_italic_corr} + \MH_let:NwN \MT_begin_inlinemath: \( + \renewcommand*\({\relax\ifmmode\@badmath\else + \ifhmode + \if_dim:w \fontdimen\@ne\font>\z@ + \if_dim:w \lastskip>\z@ + \skip@\lastskip\unskip + \@@italiccorr + \hskip\skip@ + \else: + \@@italiccorr + \fi: + \fi: + \fi: + $\fi: + } + } +} +\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_new_boolean:n {math_italic_corr} +\define@key{\MT_options_name:}{mathic}[true]{ + \@ifundefined{MT_mathic_#1:} + { \MT_true_false_error: + \@nameuse{MT_mathic_false:} + } + { \@nameuse{MT_mathic_#1:} } +} +\newenvironment{spreadlines}[1]{ + \setlength{\jot}{#1} + \ignorespaces +}{ \ignorespacesafterend } +\MaybeMHPrecedingSpacesOff +\newenvironment{MT_gathered_env}[1][c]{% + \RIfM@\else + \nonmatherr@{\begin{\@currenvir}}% + \fi + \null\,% + \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi \bgroup + \Let@ \chardef\dspbrk@context\@ne \restore@math@cr + \spread@equation + \ialign\bgroup + \MT_gathered_pre: + \strut@$\m@th\displaystyle##$ + \MT_gathered_post: + \crcr +}{% + \endaligned + \MT_gathered_env_end: +} +\MHPrecedingSpacesOn +\newcommand*\newgathered[4]{ + \newenvironment{#1} + { \def\MT_gathered_pre:{#2} + \def\MT_gathered_post:{#3} + \def\MT_gathered_env_end:{#4} + \MT_gathered_env + }{\endMT_gathered_env} +} +\newcommand*\renewgathered[4]{ + \renewenvironment{#1} + { \def\MT_gathered_pre:{#2} + \def\MT_gathered_post:{#3} + \def\MT_gathered_env_end:{#4} + \MT_gathered_env + }{\endMT_gathered_env} +} +\newgathered{lgathered}{}{\hfil}{} +\newgathered{rgathered}{\hfil}{}{} +\renewgathered{gathered}{\hfil}{\hfil}{} +\newcommand*\splitfrac[2]{% + \genfrac{}{}{0pt}{1}% + {\textstyle#1\quad\hfill}% + {\textstyle\hfill\quad\mathstrut#2}% +} +\newcommand*\splitdfrac[2]{% + \genfrac{}{}{0pt}{0}{#1\quad\hfill}{\hfill\quad\mathstrut #2}% +} +\MH_if_boolean:nT {fixamsmath}{ +\def\place@tag{% + \iftagsleft@ + \kern-\tagshift@ + \if@fleqn + \if_num:w \xatlevel@=\tw@ + \kern-\@mathmargin + \fi: + \fi: + \if:w 1\shift@tag\row@\relax + \rlap{\vbox{% + \normalbaselines + \boxz@ + \vbox to\lineht@{}% + \raise@tag + }}% + \else: + \rlap{\boxz@}% + \fi: + \kern\displaywidth@ + \else: + \kern-\tagshift@ + \if:w 1\shift@tag\row@\relax + \llap{\vtop{% + \raise@tag + \normalbaselines + \setbox\@ne\null + \dp\@ne\lineht@ + \box\@ne + \boxz@ + }}% + \else: + \llap{\boxz@}% + \fi: + \fi: +} +\def\x@calc@shift@lf{% + \if_dim:w \eqnshift@=\z@ + \global\eqnshift@\@mathmargin\relax + \alignsep@\displaywidth + \advance\alignsep@-\totwidth@ + \if_num:w \@tempcntb=0 + \else: + \global\divide\alignsep@\@tempcntb % original line + \fi: + \if_dim:w \alignsep@<\minalignsep\relax + \global\alignsep@\minalignsep\relax + \fi: + \fi: + \if_dim:w \tag@width\row@>\@tempdima + \saveshift@1% + \else: + \saveshift@0% + \fi:}% +} +\MaybeMHPrecedingSpacesOff +\renewcommand\aligned@a[1][c]{\start@aligned{#1}\m@ne} +\MHPrecedingSpacesOn +\endinput +%% +%% End of file `mathtools.sty'. diff --git a/Master/texmf-dist/tex/latex/mh/mhsetup.sty b/Master/texmf-dist/tex/latex/mh/mhsetup.sty new file mode 100644 index 00000000000..de71af7767c --- /dev/null +++ b/Master/texmf-dist/tex/latex/mh/mhsetup.sty @@ -0,0 +1,166 @@ +%% +%% This is file `mhsetup.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mhsetup.dtx (with options: `package') +%% +%% It 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 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Morten H\o gholm. +%% +%% This work consists of the files mhsetup.dtx and mhsetup.ins and +%% the derived file mhsetup.sty. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mhsetup} + [2004/10/10 v1.0b programming setup (MH)] +\def\MHInternalSyntaxOn{ + \edef\MHInternalSyntaxOff{% + \catcode`\noexpand\~=\the\catcode`\~\relax + \catcode`\noexpand\ =\the\catcode`\ \relax + \catcode`\noexpand\^^I=\the\catcode`\^^I\relax + \catcode`\noexpand\@=\the\catcode`\@\relax + \catcode`\noexpand\:=\the\catcode`\:\relax + \catcode`\noexpand\_=\the\catcode`\_\relax + \endlinechar=\the\endlinechar\relax + }% + \catcode`\~=10\relax + \catcode`\ =9\relax + \catcode`\^^I=9\relax + \makeatletter + \catcode`\_=11\relax + \catcode`\:=11\relax + \endlinechar=` % + \relax +} +\MHInternalSyntaxOn +\AtEndOfPackage{\MHInternalSyntaxOff} +\let\MH_let:NwN \let +\def\MH_let:cN #1#2{ + \expandafter\MH_let:NwN \csname#1\endcsname#2} +\def\MH_let:cc #1#2{ + \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:}% + } +} +\def\MH_set_boolean_F:n #1{ \@nameuse{boolean_#1_false:} } +\def\MH_set_boolean_T:n #1{ \@nameuse{boolean_#1_true:} } +\def\MH_if_boolean:nTF #1{ + \@nameuse{if_boolean_#1:} + \expandafter\@firstoftwo + \else: + \expandafter\@secondoftwo + \fi: +} +\def\MH_if_boolean:nT #1{ + \@nameuse{if_boolean_#1:} + \expandafter\@firstofone + \else: + \expandafter\@gobble + \fi: +} +\def\MH_if_boolean:nF #1{ + \@nameuse{if_boolean_#1:} + \expandafter\@gobble + \else: + \expandafter\@firstofone + \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{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{or:}{\MH_let:NwN \or:=\or}{} +\def\MH_cs_to_str:N {\expandafter\@gobble\string} +\@ifundefined{eTeXversion} + { + \MH_let:NwN \MH_protected:\relax + \def\MH_setlength:dn{\setlength} + \def\MH_addtolength:dn{\addtolength} + } + { + \MH_let:NwN \MH_protected:\protected + \def\MH_setlength:dn #1#2{#1=\dimexpr#2\relax\relax} + \def\MH_addtolength:dn #1#2{\advance#1 \dimexpr#2\relax\relax} + } + +\def\MH_keyval_alias_with_addon:nnnn #1#2#3#4{ + \@namedef{KV@#1@#2}{\@nameuse{KV@#1@#3}#4} + \@namedef{KV@#1@#2@default}{\@nameuse{KV@#1@#3@default}#4}} +\def\MH_keyval_alias:nnn #1#2#3{ + \MH_keyval_alias_with_addon:nnnn {#1}{#2}{#3}{}} +\def\MH_use_choice_i:nnnn #1#2#3#4{#1} +\def\MH_use_choice_ii:nnnn #1#2#3#4{#2} +\def\MH_use_choice_iii:nnnn #1#2#3#4{#3} +\def\MH_use_choice_iv:nnnn #1#2#3#4{#4} +\long\def\MH_nospace_ifnextchar:Nnn #1#2#3{ + \MH_let:NwN\reserved@d=~#1 + \def\reserved@a{#2} + \def\reserved@b{#3} + \futurelet\@let@token\MH_nospace_nextchar: +} +\def\MH_nospace_nextchar:{ + \if_meaning:NN \@let@token\reserved@d + \MH_let:NwN \reserved@b\reserved@a + \fi: + \reserved@b +} +\long\def\MH_nospace_testopt:nn #1#2{ + \MH_nospace_ifnextchar:Nnn[ + {#1} + {#1[{#2}]} +} +\def\MH_nospace_protected_testopt:n #1{ + \if_meaning:NN \protect\@typeset@protect + \expandafter\MH_nospace_testopt:nn + \else: + \@x@protect#1 + \fi: +} +\@ifundefined{kernel@ifnextchar} + {\MH_let:NwN \kernel@ifnextchar \@ifnextchar} + {} +\MH_let:NwN \MH_kernel_xargdef:nwwn \@xargdef +\long\def\MH_nospace_xargdef:nwwn #1[#2][#3]#4{ + \@ifdefinable#1{ + \expandafter\def\expandafter#1\expandafter{ + \expandafter + \MH_nospace_protected_testopt:n + \expandafter + #1 + \csname\string#1\endcsname + {#3}} + \expandafter\@yargdef + \csname\string#1\endcsname + \tw@ + {#2} + {#4}}} +\providecommand*\MHPrecedingSpacesOff{ + \MH_let:NwN \@xargdef \MH_nospace_xargdef:nwwn +} +\providecommand*\MHPrecedingSpacesOn{ + \MH_let:NwN \@xargdef \MH_kernel_xargdef:nwwn +} +\endinput +%% +%% End of file `mhsetup.sty'. diff --git a/Master/texmf-dist/tex/latex/mh/ntheorem.fix b/Master/texmf-dist/tex/latex/mh/ntheorem.fix new file mode 100644 index 00000000000..fb310ef9c57 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mh/ntheorem.fix @@ -0,0 +1,402 @@ +%% +%% This is file `ntheorem.fix', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% empheq.dtx (with options: `ntheorem') +%% +%% It 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 2003/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% The Current Maintainer of this work is Morten H\o gholm. +%% +%% This work consists of the files empheq.dtx and empheq.ins and the +%% derived files empheq.sty and ntheorem.fix +%% +\ProvidesFile{ntheorem.fix} + [2004/10/10 v2.11a + empheq support and fixes for ntheorem (MH) + ] +\def\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: +\def\displ@y@{\@display@init{% + \global\column@\z@ \global\dspbrk@lvl\m@ne + \global\tag@false \global\MH_let:NwN\raise@tag\default_raisetag: +}} +\def\MT_gobblelabel:w #1{\@ifnextchar[{\EQ_gobbleoptional:w}{}} +\def\EQ_gobbleoptional:w [#1]{} +\def\gmeasure@#1{% + \begingroup + \measuring@true + \totwidth@\z@ + \global\MH_let:NwN\tag@lengths\@empty + \savecounters@ + \setbox\@ne\vbox{% + \everycr{\noalign{\global\tag@false + \global\MH_let:NwN\raise@tag\default_raisetag: + \global\column@\z@}}% + \MH_let:NwN\label\MT_gobblelabel:w + \halign{% + \setboxz@h{$\m@th\displaystyle{##}$}% + \if_dim:w \wdz@>\totwidth@ + \global\totwidth@\wdz@ + \fi: + &\setboxz@h{\strut@{##}}% + \savetaglength@ + \crcr + #1% + \math@cr@@@ + }% + }% + \restorecounters@ + \if@fleqn + \global\advance\totwidth@\@mathmargin + \fi: + \iftagsleft@ + \if_dim:w \totwidth@>\displaywidth + \global\MH_let:NwN\gdisplaywidth@\totwidth@ + \else: + \global\MH_let:NwN\gdisplaywidth@\displaywidth + \fi: + \fi: + \endgroup +} +\def\measure@#1{% + \begingroup + \measuring@true + \global\eqnshift@\z@ + \global\alignsep@\z@ + \global\MH_let:NwN\tag@lengths\@empty + \global\MH_let:NwN\field@lengths\@empty + \savecounters@ + \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\column@\z@}}% + \MH_let:NwN\label\MT_gobblelabel:w + \global\row@\z@ + \tabskip\z@ + \halign{\span\align@preamble\crcr + #1% + \math@cr@@@ + \global\column@\z@ + \add@amps\maxfields@\cr + }% + }% + \restorecounters@ + \ifodd\maxfields@ + \global\advance\maxfields@\@ne + \fi: + \if_num:w \xatlevel@=\tw@ + \if_num:w \maxfields@<\thr@@ + \MH_let:NwN\xatlevel@\z@ + \fi: + \fi: + \setbox\z@\vbox{% + \unvbox\z@ \unpenalty \global\setbox\@ne\lastbox + }% + \global\totwidth@\wd\@ne + \if@fleqn \global\advance\totwidth@\@mathmargin \fi: + \global\MH_let:NwN\maxcolumn@widths\@empty + \begingroup + \MH_let:NwN\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}% + \repeat + \endgroup + \dimen@\displaywidth + \advance\dimen@-\totwidth@ + \if_case:w \xatlevel@ + \global\alignsep@\z@ + \MH_let:NwN\minalignsep\z@ + \@tempcntb\z@ + \if@fleqn + \@tempcnta\@ne + \global\eqnshift@\@mathmargin + \else: + \@tempcnta\tw@ + \global\eqnshift@\dimen@ + \global\divide\eqnshift@\@tempcnta + \fi: + \or: + \@tempcntb\maxfields@ + \divide\@tempcntb\tw@ + \@tempcnta\@tempcntb + \advance\@tempcntb\m@ne + \if@fleqn + \global\eqnshift@\@mathmargin + \global\alignsep@\dimen@ + \global\divide\alignsep@\@tempcnta + \else: + \global\advance\@tempcnta\@ne + \global\eqnshift@\dimen@ + \global\divide\eqnshift@\@tempcnta + \global\alignsep@\eqnshift@ + \fi: + \or: + \@tempcntb\maxfields@ + \divide\@tempcntb\tw@ + \global\advance\@tempcntb\m@ne + \global\@tempcnta\@tempcntb + \global\eqnshift@\z@ + \global\alignsep@\dimen@ + \if@fleqn + \global\advance\alignsep@\@mathmargin\relax + \fi: + \global\divide\alignsep@\@tempcntb + \fi: + \if_dim:w \alignsep@<\minalignsep\relax + \global\alignsep@\minalignsep\relax + \if_dim:w \eqnshift@>\z@ + \if@fleqn\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@ + \global\eqnshift@\z@ + \fi: + \calc@shift@align + \global\tagshift@\totwidth@ + \global\advance\tagshift@\@tempcntb\alignsep@ + \if@fleqn + \if_num:w \xatlevel@=\tw@ + \global\advance\tagshift@-\@mathmargin\relax + \fi: + \else: + \global\advance\tagshift@\eqnshift@ + \fi: + \iftagsleft@ \else: + \global\advance\tagshift@-\displaywidth + \fi: + \dimen@\minalignsep\relax + \global\advance\totwidth@\@tempcntb\dimen@ + \if_dim:w \totwidth@>\displaywidth + \global\MH_let:NwN\displaywidth@\totwidth@ + \else: + \global\MH_let:NwN\displaywidth@\displaywidth + \fi: + \endgroup +} +\def\EQ_multline_labelhack:n #1{% + \begingroup\measuring@false\label@in@display{#1}\endgroup} +\def\EQ_multline_labelhack_opt:nw #1[#2]{% + \begingroup\measuring@false\label@in@display{#1}[#2]\endgroup} +\def\multline@#1{% + \Let@ + \@display@init{\global\advance\row@\@ne \global\dspbrk@lvl\m@ne}% + \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: + \mmeasure@{#1}% + \MH_let:NwN\tag\gobble@tag + \MH_let:NwN\label\MT_gobblelabel:w + \tabskip \if@fleqn \@mathmargin \else: \z@skip \fi: + \totwidth@\displaywidth + \if@fleqn + \advance\totwidth@-\@mathmargin + \fi: + \halign\bgroup + \hbox to\totwidth@{% + \if@fleqn + \hskip \@centering \relax + \else: + \hfil + \fi: + \strut@ + $\m@th\displaystyle{}##\endmultline@math + \hfil + }% + \crcr + \if@fleqn + \hskip-\@mathmargin + \def\multline@indent{\hskip\@mathmargin}% put it back + \else: + \hfilneg + \def\multline@indent{\hskip\multlinegap}% + \fi: + \iftagsleft@ + \iftag@ + \begingroup + \ifshifttag@ + \rlap{\vbox{% + \normalbaselines + \hbox{% + \strut@ + \make@display@tag + }% + \vbox to\lineht@{}% + \raise@tag + }}% + \multline@indent + \else: + \setbox\z@\hbox{\make@display@tag}% + \dimen@\@mathmargin \advance\dimen@-\wd\z@ + \if_dim:w \dimen@<\multlinetaggap + \dimen@\multlinetaggap + \fi: + \box\z@ \hskip\dimen@\relax + \fi: + \endgroup + \else: + \multline@indent + \fi: + \else: + \multline@indent + \fi: + #1% +} +\def\mmeasure@#1{% + \begingroup + \measuring@true + \def\label##1{% + \@ifnextchar[ + {\EQ_multline_labelhack_opt:nw {##1}} + {\EQ_multline_labelhack:n {##1}} + } + \def\math@cr@@@{\cr}% + \MH_let:NwN\shoveleft\@iden \MH_let:NwN\shoveright\@iden + \savecounters@ + \global\row@\z@ + \setbox\@ne\vbox{% + \global\MH_let:NwN\df@tag\@empty + \halign{% + \setboxz@h{\@lign$\m@th\displaystyle{}##$}% + \iftagsleft@ + \if_num:w \row@=\@ne + \global\totwidth@\wdz@ + \global\lineht@\ht\z@ + \fi: + \else: + \global\totwidth@\wdz@ + \global\lineht@\dp\z@ + \fi: + \crcr + #1% + \crcr + }% + }% + \if_meaning:NN + \df@tag\@empty + \else: + \global\tag@true + \fi: + \if@eqnsw\global\tag@true\fi: + \iftag@ + \setboxz@h{% + \if@eqnsw + \stepcounter{equation}% + \tagform@\theequation + \else: + \df@tag + \fi: + }% + \global\tagwidth@\wdz@ + \dimen@\totwidth@ + \advance\dimen@\tagwidth@ + \advance\dimen@\multlinetaggap + \iftagsleft@\else: + \if@fleqn + \advance\dimen@\@mathmargin + \fi: + \fi: + \if_dim:w \dimen@>\displaywidth + \global\shifttag@true + \else: + \global\shifttag@false + \fi: + \fi: + \restorecounters@ + \endgroup +} +\newlength\mintagvsep +\mintagvsep5pt +\def\EQ_only_endmark:{% + \MH_set_boolean_T:n {show_manual_tags} + \global\tag@true + \iftagsleft@ + \gdef\df@tag{% + \hbox to \displaywidth{% + \hss + \raisebox{-\normallineskip + -\depthof{\EQ_outerbox:{}} + -\heightof{\EQ_outerbox:{}} + -\dp\EQ_mathdisplay_box + -\ht\EQ_mathdisplay_box} + [0pt][0pt]{\PotEndMark{\maketag@@@}}}} + \else: + \gdef\df@tag{% + \raisebox{-\dp\EQ_mathdisplay_box + -\depthof{\EQ_outerbox:{}}} + {\PotEndMark{\maketag@@@}}}% + \fi:} +\def\EQ_tag_plus_endmark:{% + \iftagsleft@ + \gdef\maketag@@@##1{% + \hfuzz\displaywidth + \makebox[\widthof{##1}][l]{% + \hbox to \displaywidth{\m@th\normalfont##1\hss + \raisebox{-\dp\EQ_mathdisplay_box + -\depthof{\EQ_outerbox:{}}} + {\PotEndMark{\hss}}}}}% + \else: + \gdef\maketag@@@##1{% + \hbox{\m@th\normalfont##1\llap{\hss\PotEndMark{% + \settoheight{\@tempdima}{\@nameuse{\InTheoType Symbol}}% + \MH_addtolength:dn \@tempdima + {\g_EQ_bottomtag_depth_dim+\mintagvsep} + \setlength{\@tempdimb} + {\g_EQ_bottomrow_depth_dim+\depthof{\EQ_outerbox:{}} + +\depthof{\EQ_innerbox:{}}} + \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: + \def\EQ_next:{ + \raisebox{-\dp\EQ_mathdisplay_box + -\depthof{\EQ_outerbox:{}}}}% + \fi:\EQ_next:}}}}% + \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@@ + \advance\@tempcnta\m@ne + \else: + \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: + \global\g_EQ_bottomtag_depth_dim=-\baselineskip + \fi: + \MT_nonumber: +} +\endinput +%% +%% End of file `ntheorem.fix'. |