diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/breqn.sty | 2056 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/empheq.sty | 419 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/empheq07.sty | 30 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/flexisym.sty | 293 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/mathstyle.sty | 161 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/mathtools.sty | 119 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/mhsetup.sty | 32 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/ntheorem.fix | 402 |
8 files changed, 3014 insertions, 498 deletions
diff --git a/Master/texmf-dist/tex/latex/mh/breqn.sty b/Master/texmf-dist/tex/latex/mh/breqn.sty new file mode 100644 index 00000000000..e69a67473b5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mh/breqn.sty @@ -0,0 +1,2056 @@ +%% +%% This is file `breqn.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% breqn.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 1997-2003 by Michael J. Downes +%% Copyright (C) 2007 by Morten Hoegholm <mh.ctan@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Morten Hoegholm. +%% +%% This work consists of the main source file breqn.dtx +%% and the derived files +%% breqn.sty, breqn.pdf, breqn.ins, breqn.drv. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{breqn}[2007/12/10 v0.96] +\edef\breqnpopcats{% + \catcode\number`\"=\number\catcode`\" + \relax} +\AtEndOfPackage{\breqnpopcats}% +\catcode`\^=7 \catcode`\_=8 \catcode`\"=12 \relax +\DeclareOption{debug}{\errorcontextlines=2000\relax} +\DeclareOption{mathstyleoff}{% + \PassOptionsToPackage{mathstyleoff}{flexisym}% +} +\ProcessOptions\relax +\@ifpackageloaded{flexisym}{}{% + \RequirePackage[cmbase]{flexisym}[2007/12/10] + \edef\breqnpopcats{\breqnpopcats + \catcode\number`\^=\number\catcode`\^ + \catcode\number`\_=\number\catcode`\_ + }% + \catcode`\^=7 \catcode`\_=8 \catcode`\"=12 \relax +} +\RequirePackage{keyval,calc}\relax +\@ifundefined{options}{% +\newcommand{\options}[2]{% + \expandafter\options@a\csname opt@#1.sty\endcsname{#2}% + \setkeys{#1}{#2}% +} +\def\options@a#1#2{% + \edef\@tempa{\options@b#2,\@empty\@nil}% + \ifx#1\relax \let#1\@empty\fi + \xdef#1{#1\ifx#1\@empty\@xp\@gobble\@tempa\@empty\else\@tempa \fi}% +} +\def\options@b#1,#2#3\@nil{% + \options@c#1 \@nil + \ifx#2\@empty \else\options@b#2#3\@nil\fi +} +\def\options@c#1 #2\@nil{\options@d#1=\@nil} +\def\options@d#1=#2\@nil{\ifx\@empty #1\@empty\else,\fi#1} +}{}% end @ifundefined test +\let\@nx\noexpand +\let\@xp\expandafter +\@ifundefined{@emptytoks}{\newtoks\@emptytoks}{} +\chardef\f@ur=4 +\newcount\inf@bad \inf@bad=1000000 +\newcount\maxint \maxint=2147483647 +\let\int@a=\@tempcnta +\let\int@b=\@tempcntb +\let\int@c=\count@ +\let\dim@a\@tempdima +\let\dim@b\@tempdimb +\let\dim@c\@tempdimc +\let\dim@d\dimen@ +\let\dim@e\dimen@ii +\let\dim@A\dimen@i +\let\skip@a\@tempskipa +\let\skip@b\@tempskipb +\let\skip@c\skip@ +\let\toks@a\@temptokena +\let\toks@b\toks@ +\toksdef\toks@c=2 +\toksdef\toks@d=4 +\toksdef\toks@e=6 +\toksdef\toks@f=8 +\def\abs@num#1{\ifnum#1<\z@-\fi#1} +\def\@ifnext#1#2#3{% + \let\@tempd= #1\def\@tempa{#2}\def\@tempb{#3}% + \futurelet\@tempc\@ifnexta +} +\def\@ifnexta{\ifx\@tempc\@tempd \let\@tempb\@tempa \fi \@tempb} +\def\@ifstar#1#2{% + \let\@tempd*\def\@tempa*{#1}\def\@tempb{#2}% + \futurelet\@tempc\@ifnexta +} +\def\@optarg#1#2{\@ifnext[{#1}{#1[#2]}} +\def\@True{00} +\def\@False{01} +\def\@Not#1{0\ifcase#11 \or\@xp 1\else \@xp 0\fi} +\def\@And#1#2{0\ifcase#1#2 \@xp 0\else \@xp 1\fi} +\def\@Or#1#2{0\ifnum#1#2<101 \@xp 0\else \@xp 1\fi} +\def\theb@@le#1{\if#1 True\else False\fi} +\def\freeze@glue#1{#11#1\relax} +\def\z@rule{\vrule\@width\z@}% no \relax ! use with care +\def\keep@glue{\z@rule\relax} +\begingroup \catcode`\&=11 +\gdef\replicate#1{% + \csname &\expandafter\replicate@a\romannumeral\number\number#1 000q\endcsname +} +\endgroup +\long\def\replicate@a#1#2\endcsname#3{#1\endcsname{#3}#2} +\begingroup \catcode`\&=11 +\long\gdef\&m#1#2{#1\csname \endcsname{#1}} +\endgroup +\@xp\let\csname\string &q\endcsname\@gobble +\g@addto@macro\mathchars@reset{% + \let\@symRel\@secondoftwo \let\@symBin\@secondoftwo + \let\@symDeL\@secondoftwo \let\@symDeR\@secondoftwo + \let\@symDeB\@secondoftwo +} +\def\eq@cons#1#2{% + \begingroup \let\@elt\relax \xdef#1{\@elt{#2}#1}\endgroup +} +\providecommand{\@saveprimitive}[2]{% + \begingroup + \edef\@tempa{\string#1}\edef\@tempb{\meaning#1}% + \ifx\@tempa\@tempb \global\let#2#1% + \else + \edef\@tempb{\meaning#2}% + \ifx\@tempa\@tempb + \else \@saveprimitive@a#1#2% + \fi + \fi + \endgroup +} +\providecommand\@saveprimitive@a[2]{% + \begingroup + \def\@tempb##1#1##2{\edef\@tempb{##2}\@car{}}% + \@tempb\nullfont{select font nullfont}% + \topmark{\string\topmark:}% + \firstmark{\string\firstmark:}% + \botmark{\string\botmark:}% + \splitfirstmark{\string\splitfirstmark:}% + \splitbotmark{\string\splitbotmark:}% + #1{\string#1}% + \edef\@tempa{\expandafter\strip@prefix\meaning\@tempb}% + \edef\@tempb{\meaning#1}% + \ifx\@tempa\@tempb \global\let#2#1% + \else + \PackageError{breqn}% + {Unable to properly define \string#2; primitive + \noexpand#1no longer primitive}\@eha + \fi + \fi + \endgroup +} +\begingroup \catcode`\$=\thr@@ % just to make sure + \global\let\@@math=$ \gdef\@@display{$$}% $$$ +\endgroup +\let\@@endmath=\@@math +\let\@@enddisplay=\@@display +\@saveprimitive\vadjust\@@vadjust +\@saveprimitive\insert\@@insert +\@saveprimitive\mark\@@mark +\let\debug=\begingroup +\let\gubed=\endgroup +\def\debugmsg{\message{||= \iffalse}\fi + \@xp\@gobble\string +} +\def\debugwr#1{\immediate\write\sixt@@n{||= #1}} +\def\debug@box#1{% + \batchmode{\showboxbreadth\maxdimen\showboxdepth99\showbox#1}% + \errorstopmode +} +\def\eqinfo{% + \debug@box\EQ@copy + \wlog{!! EQ@copy: \the\wd\EQ@copy\space x + \the\ht\EQ@copy+\the\dp\EQ@copy + }% +} +\def\debug@para{% + \debugwr{\hsize\the\hsize, \parfillskip\the\parfillskip}% + \debugmsg{\leftskip\the\leftskip, \rightskip\the\rightskip}% + \debugmsg{\linepenalty\the\linepenalty, \adjdemerits\the\adjdemerits}% + \debugmsg{\pretolerance\the\pretolerance, \tolerance\the\tolerance, + \parindent\the\parindent}% +} +\@ifpackagewith{breqn}{debug}{}{% + \let\debug\relax \let\gubed\relax + \let\debugmsg\@gobble \let\debug@lines\relax \let\debug@para\relax + \let\debugwr\@gobble + \let\debug@box\@gobble \let\debug@push\@gobbletwo +} +\@ifundefined{listwidth}{\newdimen\listwidth}{} +\listwidth=\z@ +\def\eqfontsize{} % Inherit from context [NOT USED?] +\def\eqcolor{black} % Default to black [NOT USED?] +\newdimen\eqnumsep \eqnumsep=10pt % Min space between equ number and body +\newdimen\eqmargin \eqmargin=8pt % For `multline' gap emulation +\def\eqindent{C}% % C or I, centered or indented +\def\eqnumside{R}% % R or L, right or left +\def\eqnumplace{M}% % M or T or B, middle top or bottom +\def\eqnumfont{}% % Null for easier debugging [mjd,1997/09/26] +\def\eqnumform#1{(#1\@@italiccorr)} % Add parens +\def\eqnumsize{} % Allow numbers to have different typesize ... +\def\eqnumcolor{} % ... or color than eq body e.g. \color{blue} +\newlength\eqlinespacing \eqlinespacing=14pt plus2pt % Base-to-base space between lines +\newlength\eqlineskip \eqlineskip=3pt plus2pt % Min space if eqlinespacing too small +\newdimen\eqlineskiplimit \eqlineskiplimit=2pt % Threshold for switching to eqlineskip +\newmuskip \eqbinoffset \eqbinoffset=15mu minus-3mu % Offset from mathrel alignment pt for mathbins +\newmuskip\eqdelimoffset \eqdelimoffset=2mu % Additional offset for break inside delims +\newdimen\eqindentstep \eqindentstep=8pt % Indent used when LHS wd is n/a or too large +\newtoks\eqstyle % Customization hook +\newcount\eqbreakdepth \eqbreakdepth=2 % Allow breaks within delimiters to this depth +\newcount \eqinterlinepenalty \eqinterlinepenalty=10000 % No page breaks between equation lines +\newcount \intereqpenalty \intereqpenalty=1000 % Pagebreak penalty between equations [BRM: Was \@M] +\newlength \intereqskip \intereqskip=3pt plus2pt % Additional vert space between equations +\newcount\prerelpenalty \prerelpenalty=-\@M % Linebreak penalty before mathrel symbols +\newcount\prebinoppenalty \prebinoppenalty=888 % Linebreak penalty before mathbins +\newmuskip \Dmedmuskip \Dmedmuskip=4mu minus 3mu % medmuskip in displays +\newmuskip \Dthickmuskip \Dthickmuskip=5mu minus 2mu % thickmuskip in displays +\def\eq@number{} % Internal variable +\newlength\eqleftskip \eqleftskip=\@centering % Space on the left [NOT USED?] +\newlength\eqrightskip \eqrightskip=\@centering % Space on the right [NOT USED?] +\newlength\eq@vspan \eq@vspan=\z@skip % Glue used to vcenter the eq number +\newmuskip\eq@binoffset \eq@binoffset=\eqbinoffset % Roughly, \eqbinoffset + \eqdelimoffset +\newsavebox\EQ@box % Storage for equation body +\newsavebox\EQ@copy % For eq body sans vadjust/insert/mark material +\newsavebox\EQ@numbox % For equation number +\newdimen\eq@wdNum % width of number + separation [NEW] +\newsavebox\GRP@numbox % For group number [NEW] +\newdimen\grp@wdNum % width of number + separation [NEW] +%%B\EQ@vimbox % Vadjust, insert, or mark material +%%B\EQ@vimcopy % Spare copy of same +%%B\eq@impinging % Temporary box for measuring number placement +\newcount \eq@lines % Internal counter, actual number of lines +\newcount \eq@curline % Loop counter +\newcount \eq@badness % Used in testing for overfull lines +\newcount \EQ@vims % For bookkeeping +\def\@eq@numbertrue{\let\eq@hasNumber\@True}% +\def\@eq@numberfalse{\let\eq@hasNumber\@False}% +\let\eq@hasNumber\@False +\newdimen\eq@dp % Depth of last line +\newdimen\eq@wdL % Width of the left-hand-side +\newdimen\eq@wdT % Total width for framing +\newdimen\eq@wdMin % Width of narrowest line in equation +\newdimen\grp@wdL % Max width of LHS's in a group +\newdimen\grp@wdR % Max RHS of all equations in a group +\newdimen\grp@wdT +\newdimen\eq@wdRmax +\newdimen\eq@firstht % Height of first line +\newdimen\eq@wdCond +\newdimen\eq@indentstep % Indent amount when LHS is not present +\newdimen\eq@linewidth % Width actually used for display +\newdimen\grp@linewidth % Max eq@linewidth over a group +\newdimen\eq@hshift +\let\eq@isIntertext\@False +\eq@indentstep=\maxdimen +\newdimen\eq@given@sidespace +\def\eq@overrun{0pt} +\@ifpackagewith{amsmath}{leqno}{% + \@ifpackagewith{amsmath}{reqno}{}{\def\eqnumside{L}}% +}{% + \def\@tempa#1,leqno.clo,#2#3\@nil{% + \ifx @#2\relax\else \def\eqnumside{L}\fi + }% + \@xp\@tempa\@filelist,leqno.clo,@\@nil + \if L\eqnumside + \else + \@ifundefined{iftagsleft@}{}{% + \edef\eqnumside{% + \if TT\csname fi\endcsname\csname iftagsleft@\endcsname + L\else R\fi + }% + } + \fi +} +\@ifpackagewith{amsmath}{fleqn}{% + \def\eqindent{I}% +}{% + \def\@tempa#1,fleqn.clo,#2#3\@nil{% + \ifx @#2\relax\else \def\eqindent{I}\fi + }% + \@xp\@tempa\@filelist,fleqn.clo,@\@nil + \if I\eqindent + \else + \@ifundefined{if@fleqn}{}{% + \edef\eqindent{% + \if TT\csname fi\endcsname\csname if@fleqn\endcsname + I\else C\fi + }% + }% + \fi +} + \@ifundefined{mathindent}{% + \newdimen\mathindent + }{% + \@ifundefined{@mathmargin}{}{% + \mathindent\@mathmargin + }% + } +\let\EQ@hasLHS=\@False +\let\EQ@QED=\@empty +\def\mark@lhs#1{% + \ifnum\lr@level<\@ne + \let\mark@lhs\relax + \global\let\EQ@hasLHS=\@True + \global\let\EQ@prebin@space\EQ@prebin@space@a + \mark@lhs@a + \penalty9999 % instead of normal \rel@break + % else no penalty = forbid break + \fi +} +\def\mark@lhs@a{% + \mskip\thickmuskip \@@vadjust{\penalty\tw@}\penalty-\@Mi\@@vadjust{}% +} +\newcommand\hiderel[1]{\mathrel{\advance\lr@level\@ne#1}} +\let\m@@Bin\m@Bin +\let\m@@Rel\m@Rel +\let\EQ@prebin@space\relax +\def\EQ@prebin@space@a{\mskip-\eq@binoffset \keep@glue \mskip\eq@binoffset} +\def\bin@break{\ifnum\lastpenalty=\z@\penalty\prebinoppenalty\fi + \EQ@prebin@space} +\def\rel@break{% + \ifnum\abs@num\lastpenalty <\abs@num\prerelpenalty + \penalty\prerelpenalty + \fi +} +\def\d@@Bin{\bin@break \m@@Bin} +\def\d@@Rel{\mark@lhs \rel@break \m@@Rel} +\let\m@@symRel\@symRel \def\d@@symRel{\mark@lhs \rel@break \m@@symRel} +\let\m@@symBin\@symBin \def\d@@symBin{\bin@break \m@@symBin} +\let\m@@symDel\@symDel +\let\m@@symDeR\@symDeR +\let\m@@symDeB\@symDeB +\let\m@@symDeA\@symDeA +\def\display@setup{% + \medmuskip\Dmedmuskip \thickmuskip\Dthickmuskip + \let\m@Bin\d@@Bin \let\m@Rel\d@@Rel + \let\@symRel\d@@symRel \let\@symBin\d@@symBin + \let\m@DeL\d@@DeL \let\m@DeR\d@@DeR \let\m@DeB\d@@DeB + \let\m@DeA\d@@DeA + \let\@symDeL\d@@symDeL \let\@symDeR\d@@symDeR + \let\@symDeB\d@@symDeB \let\@symDeA\d@@symDeA + \let\left\eq@left \let\right\eq@right \global\lr@level\z@ + \global\eq@wdCond\z@ %BRM: new + \everyhbox{\everyhbox\@emptytoks + \let\display@setup\relax \textmath@setup \let\textmath@setup\relax + }% + \everyvbox{\everyvbox\@emptytoks + \let\display@setup\relax \textmath@setup \let\textmath@setup\relax + }% +} +\def\dseries@display@setup{% + \medmuskip\Dmedmuskip \thickmuskip\Dthickmuskip + \let\m@Bin\d@@Bin + \let\@symBin\d@@symBin + \let\m@DeL\d@@DeL \let\m@DeR\d@@DeR \let\m@DeB\d@@DeB + \let\m@DeA\d@@DeA + \let\@symDeL\d@@symDeL \let\@symDeR\d@@symDeR + \let\@symDeB\d@@symDeB \let\@symDeA\d@@symDeA + \let\left\eq@left \let\right\eq@right \global\lr@level\z@ + \everyhbox{\everyhbox\@emptytoks + \let\display@setup\relax \textmath@setup \let\textmath@setup\relax + }% + \everyvbox{\everyvbox\@emptytoks + \let\display@setup\relax \textmath@setup \let\textmath@setup\relax + }% + \displaystyle +} +\def\textmath@setup{% + \let\m@Bin\m@@Bin \let\m@Rel\m@@Rel + \let\@symRel\m@@symRel \let\@symBin\m@@symBin + \let\m@DeL\m@@DeL \let\m@DeR\m@@DeR \let\m@DeB\m@@DeB + \let\m@DeA\m@@DeA + \let\@symDeL\m@@symDeL \let\@symDeR\m@@symDeR + \let\@symDeB\m@@symDeB \let\@symDeA\m@@symDeA + \let\left\@@left \let\right\@@right +} +\@ifundefined{@displaytrue}{% + \@xp\newif\csname if@display\endcsname + \everydisplay\@xp{\the\everydisplay \@displaytrue}% +}{} +\define@key{breqn}{label}{\def\next@label{\label{#1}}} +\global\let\next@label\@empty +\define@key{breqn}{number}{\def\eq@number{#1}% + \let\@currentlabel\eq@number +} +\define@key{breqn}{shiftnumber}{\let\eq@shiftnumber\@True} +\define@key{breqn}{holdnumber}{\let\eq@holdnumber\@True} +\define@key{breqn}{density}{\def\eq@density@factor{#1}} +\define@key{breqn}{indentstep}{\eqindentstep#1\relax} +\define@key{breqn}{compact}[-99]{\prerelpenalty=#1\relax} +\define@key{breqn}{layout}[?]{% + \edef\eq@layout{\@car#1?\@nil}% +} +\define@key{breqn}{spread}{% + \addtolength\eqlinespacing{#1}% + \addtolength\eqlineskip{#1}% + \eqlineskiplimit\eqlineskip +} +\define@key{breqn}{sidespace}{% + \setlength\eq@given@sidespace{#1}% +} +\define@key{breqn}{style}{\eqstyle\@xp{\the\eqstyle #1}} +\define@key{breqn}{frame}[\fboxrule]{\def\eq@frame{T}% + \dim@a#1\relax\edef\eq@framewd{\the\dim@a}% + \freeze@glue\eqlinespacing \freeze@glue\eqlineskip +} +\define@key{breqn}{fullframe}[]{\def\eq@frame{U}% + \freeze@glue\eqlinespacing \freeze@glue\eqlineskip +} +\def\eq@frame{F} % no frame +\def\eq@framewd{\fboxrule} +\define@key{breqn}{framesep}[\fboxsep]{% + \if\eq@frame F\def\eq@frame{T}\fi + \dim@a#1\relax \edef\eq@framesep{\the\dim@a}% + \freeze@glue\eqlinespacing \freeze@glue\eqlineskip +} +\def\eq@framesep{\fboxsep} +\define@key{breqn}{background}{\def\eq@background{#1}% + \freeze@glue\eqlinespacing \freeze@glue\eqlineskip +} +\define@key{breqn}{color}{\def\eq@foreground{#1}} +\define@key{breqn}{center}[]{\let\eq@centerlines\@True} +\define@key{breqn}{nocenter}[]{\let\eq@centerlines\@False} +\let\eq@centerlines\@False +\define@key{breqn}{noalign}[]{\let\grp@aligned\@False} +\let\grp@aligned\@True % default +\define@key{breqn}{breakdepth}{\eqbreakdepth#1\relax} +\define@key{breqn}{cols}{\global\let\@preamble\@empty + \darray@mkpream#1\@percentchar +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%BRM: The following incorporates several changes: +%% 1) modifications supplied by MJD to fix the eaten \cs{paragraph} problem. +%% 2) Added \cs{display@setup} here, rather than globally. +\newenvironment{dmath}{% + \let\eq@hasNumber\@True \@optarg\@dmath{}}{} +\def\@dmath[#1]{% + \debugmsg{=== DMATH ==================================================}% + \everydisplay\expandafter{\the\everydisplay \display@setup}% + \if@noskipsec \leavevmode \fi + \if@inlabel \leavevmode \global\@inlabelfalse \fi + \if\eq@group\else\eq@prelim\fi + \setkeys{breqn}{#1}% + \the\eqstyle + \eq@setnumber + \begingroup + \eq@setup@a + \eq@startup +} +\def\enddmath#1{\check@punct@or@qed} +\def\end@dmath{% + \gdef\EQ@setwdL{}% Occasionally undefined ??? + \eq@capture + \endgroup + \EQ@setwdL + \eq@measure + \if\eq@group \grp@push \else \eq@finish\fi +} +\newenvironment{dmath*}{% + \let\eq@hasNumber\@False \@optarg\@dmath{}% +}{} +\@namedef{end@dmath*}{\end@dmath} +\@namedef{enddmath*}#1{\check@punct@or@qed} +\def\eq@prelim{% + \if@inlabel \indent \par \fi + \if@nobreak \global\@nobreakfalse \predisplaypenalty\@M \fi + \everypar\@emptytoks + \noindent + \eq@nulldisplay + \par %% \eq@saveparinfo %% needs work + \let\intertext\breqn@intertext +} +\def\breqn@parshape@warning{% + \PackageWarning{breqn}{% + Complex paragraph shape cannot be followed by this equation}% +} +\let\eq@prevshape\@empty +\def\eq@saveparinfo{% + \count@\prevgraf \advance\count@-\thr@@ % for the null display + \edef\eq@prevshape{\prevgraf\the\count@\space}% + \ifcase\parshape + % case 0: no action required + \or \edef\eq@prevshape{\eq@prevshape + \parshape\@ne\displayindent\displaywidth\relax + }% + \else + \breqn@parshape@warning + \fi +} +\def\eq@setnumber{% + \eq@wdNum\z@ + \if\eq@hasNumber + \ifx\eq@number\@empty + \stepcounter{equation}\let\eq@number\theequation + \fi + % This sets up numbox, etc, even if unnumbered????? + \ifx\eq@number\@empty + \else + \debugmsg{Number \eq@number}% + \set@label{equation}\eq@number + \global\sbox\EQ@numbox{% + \next@label \global\let\next@label\@empty + \eqnumcolor\eqnumsize\eqnumfont{\eqnumform{\eq@number}}% + }% + \global\eq@wdNum\wd\EQ@numbox\global\advance\eq@wdNum\eqnumsep + \fi + \fi +} +\def\eq@finish{% + \begingroup + \debugmsg{Formatting equation}% + \debug@showmeasurements + \if F\eq@frame\else + \freeze@glue\eqlinespacing \freeze@glue\eqlineskip + \fi + \csname eq@\eqindent @setsides\endcsname % Compute \leftskip,\rightskip + \adjust@parshape\eq@parshape% Final adjustment of parshape for left|right skips + \eq@topspace{\vskip\parskip}% Set top spacing + \debug@showformat + % Now, invoke the appropriate typesetter according to number placement + \if\eq@hasNumber + \if\eq@shiftnumber + \csname eq@typeset@\eqnumside Shifted\endcsname + \else + \csname eq@typeset@\eqnumside\eqnumplace\endcsname + \fi + \else + \eq@typeset@Unnumbered + \fi + \endgroup + \eq@botspace +} +\def\peek@branch#1#2{% + \let\peek@b#1\let\peek@space#2\futurelet\@let@token\peek@a +} +\def\peek@skipping@spaces#1{\peek@branch#1\peek@skip@space} +\def\peek@a{% + \ifx\@let@token\@sptoken \expandafter\peek@space + \else \expandafter\peek@b\fi +} +\lowercase{\def\peek@skip@space} {\futurelet\@let@token\peek@a}% +\def\check@punct{\futurelet\@let@token\check@punct@a} +\def\check@punct@a{% + \edef\@tempa{% + \ifx\@let@token\@sptoken\@nx\finish@end + \else\ifx\@let@token ,\@nx\check@qed + \else\ifx\@let@token .\@nx\check@qed + \else\check@punct@b % check the less common possibilities + \fi\fi\fi + }% + \@tempa +} +\begingroup +\toks@a{% + \ifx\@let@token ;\@nx\check@qed + \else\ifx\@let@token ?\@nx\check@qed + \else\ifx\@let@token !\@nx\check@qed +} +\toks@c{\fi\fi\fi}% matching with \toks@a +\catcode`\.=\active \catcode`\,=\active \catcode`\;=\active +\catcode`\?=\active \catcode`\!=\active +\toks@b{% + \else\ifx\@let@token ,\@nx\check@qed + \else\ifx\@let@token .\@nx\check@qed + \else\ifx\@let@token ;\@nx\check@qed + \else\ifx\@let@token ?\@nx\check@qed + \else\ifx\@let@token !\@nx\check@qed + \fi\fi\fi\fi\fi +} +\xdef\check@punct@b{% + \the\toks@a\the\toks@b\the\toks@c +} +\endgroup +\let\found@punct\@empty +\def\check@qed#1{% + \gdef\found@punct{#1}% + \peek@skipping@spaces\check@qed@a +} +\def\check@qed@a{% + \ifx\end\@let@token \@xp\check@qed@b + \else \@xp\finish@end + \fi +} +\def\check@qed@b#1#2{% + \@ifundefined{#2qed}{}{% + \toks@\@xp{\found@punct\csname#2qed\endcsname}% + \xdef\found@punct{\the\toks@}% + }% + \finish@end + \end{#2}% +} +\def\@tempa#1\endcsname#2\@nil{\def\latex@end##1{#2}} +\expandafter\@tempa\end{#1}\@nil +\def\end#1{\csname end#1\endcsname \latex@end{#1}}% +\def\check@punct@or@qed#1{% + \xdef\found@punct{\@empty}% BRM: punctuation was being remembered past this eqn. + \def\finish@end{\csname end@#1\endcsname\latex@end{#1}}% + \check@punct +} +\newcommand\eqpunct[1]{\thinspace#1} +\providecommand\set@label[2]{\protected@edef\@currentlabel{#2}} +\def\eq@topspace#1{% + \begingroup + \global\let\EQ@shortskips\@False + \if\@And{\eq@group}{\@Not\GRP@top}% + \parskip\intereqskip \penalty\intereqpenalty + \else + \eq@check@shortskip + \if\EQ@shortskips + \parskip\abovedisplayshortskip + \aftergroup\belowdisplayskip\aftergroup\belowdisplayshortskip + \ifdim\predisplaysize>\z@\nointerlineskip\fi + \else + \parskip\abovedisplayskip + \fi + \fi + \if F\eq@frame + \else + \addtolength\parskip{\eq@framesep+\eq@framewd}% + \fi +\debugmsg{Topspace: \theb@@le\EQ@shortskips, \parskip=\the\parskip, \predisplaysize=\the\predisplaysize}% + #1% + \endgroup +} +\def\eq@check@shortskip{% + \global\let\EQ@shortskips\@False + \setlength\dim@a{\abovedisplayskip+\ht\EQ@numbox}% + \addtolength\leftskip{-2em}% standard TeX value + \ifdim\leftskip<\predisplaysize + \else\if R\eqnumside \global\let\EQ@shortskips\@True + \else\if\eq@shiftnumber + \else\if T\eqnumplace + \ifdim\dim@a<\eq@firstht + \global\let\EQ@shortskips\@True + \fi + \else + \setlength\dim@b{\eq@vspan/2}% + \ifdim\dim@a<\dim@b + \global\let\EQ@shortskips\@True + \fi + \fi\fi\fi\fi +} +\def\eq@botspace{% + \penalty\postdisplaypenalty + \if F\eq@frame + \else + \addtolength\belowdisplayskip{\eq@framesep+\eq@framewd}% + \fi + \vskip\belowdisplayskip + \@endpetrue % kill parindent if current paragraph continues + \global\@ignoretrue % ignore following spaces + \eq@resume@parshape +} +\def\eq@resume@parshape{} +\def\eq@startup{% + \global\let\EQ@hasLHS\@False + \setbox\z@\vbox\bgroup + \noindent \@@math \displaystyle + \penalty-\@Mi +} +\def\eq@setup@a{% + \everymath\everydisplay + %\let\@newline\eq@newline % future possibility? + \let\\\eq@newline + \let\insert\eq@insert \let\mark\eq@mark \let\vadjust\eq@vadjust + \hsize\maxdimen \pretolerance\@M + \linepenalty\@m + \rightskip\z@\@plus\@M\p@ \leftskip\z@skip \parfillskip\z@skip + \clubpenalty\@ne \widowpenalty\z@ \interlinepenalty\z@ + \global\let\EQ@prebin@space\relax + \binoppenalty\@M \relpenalty\@M +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newdimen\eq@wdR\eq@wdR\z@%BRM +\def\eq@capture{% + \ifnum\lastpenalty>-\@M \penalty-\@Mi \fi + \keep@glue\@@endmath + \eq@addpunct + \@@par + \eq@wdL\z@ + \setbox\tw@\lastbox + \global\setbox\EQ@box\hbox{\unhbox\tw@\unskip\unskip\unpenalty}% + \unskip\unpenalty + \global\setbox\EQ@copy\copy\EQ@box +%% \global\setbox\EQ@vimcopy\copy\EQ@vimbox + \clubpenalty\z@ + \eq@wdR\z@%BRM: eq@wdL patch + \eq@repack % recursive + \setbox\tw@\lastbox + \global\setbox\EQ@box\hbox{\unhcopy\tw@\unskip\unpenalty \unhbox\EQ@box}% + \global\setbox\EQ@copy\hbox{\unhbox\tw@\unskip\unpenalty \unhbox\EQ@copy}% + \ifdim\eq@wdR>\z@% BRM: eq@wdL patch + \setlength\dim@a{\wd\EQ@box-\eq@wdR + % Apparently missing a \thickmuskip = 5mu = 5/18em=0.27777777777.. ? + + 0.2777777777777em}% FUDGE??!?!?! + \ifdim\dim@a>\eq@wdL + \debugmsg{Correcting LHS from \the\eq@wdL\space to \the\dim@a = \the\wd\EQ@box - \the\eq@wdR}% + \eq@wdL\dim@a + \xdef\EQ@setwdL{\eq@wdL\the\eq@wdL\relax}% + \fi + \fi + \debugmsg{Capture: total length=\the\wd\EQ@box + ^^J||===== has LHS=\theb@@le\EQ@hasLHS, \eq@wdL=\the\eq@wdL, \eq@wdR=\the\eq@wdR, + ^^J||===== \eq@wdCond=\the\eq@wdCond}% + \egroup % end vbox started earlier +} +\def\eq@addpunct{% + \ifx\found@punct\@empty + \else \eqpunct{\found@punct}% + \fi + % BRM: Added; the punctuation kept getting carried to following environs + \xdef\found@punct{\@empty}% + \EQ@afterspace +} +\global\let\EQ@afterspace\@empty +\def\eq@repack{% + \ifcase\lastpenalty + % case 0: normal case + \setbox\tw@\lastbox + \eq@repacka\EQ@copy \eq@repacka\EQ@box + \unskip + \or % case 1: finished recursing + \unpenalty + \setbox\tw@\lastbox + \eq@repacka\EQ@copy \eq@repacka\EQ@box + \@xp\@gobble + \or % case 2: save box width = LHS width + \unpenalty + \setbox\tw@\lastbox + \setbox\z@\copy\tw@ \setbox\z@\hbox{\unhbox\z@\unskip\unpenalty}% + \addtolength\eq@wdL{\wd\z@} + \setlength\eq@wdR{\wd\EQ@box}% BRM: eq@wdL patch + \xdef\EQ@setwdL{\eq@wdL\the\eq@wdL\relax}% + \global\setbox\EQ@copy\hbox{% + \hbox{\unhcopy\tw@\unskip\unpenalty\unskip}% + \box\EQ@copy + }% + \global\setbox\EQ@box\hbox{% + \hbox{\unhbox\tw@\unskip\unpenalty\unskip}% + \box\EQ@box + }% + \unskip + \or % case 3: unpack left-right box + \unpenalty + \eq@lrunpack + \else + \breqn@repack@err + \fi + \eq@repack % RECURSE +} +\def\breqn@repack@err{% + \PackageError{breqn}{eq@repack penalty neq 0,1,2,3}\relax +} +\def\eq@repacka#1{% + \global\setbox#1\hbox{\unhcopy\tw@ \unskip + \count@-\lastpenalty + \ifnum\count@<\@M \else \advance\count@-\@M \fi + \unpenalty + \ifx\EQ@copy#1\ifnum\count@>\thr@@ \count@\@ne\fi\fi + \ifcase\count@ + % case 0, normal line break + \penalty-\@M % put back the linebreak penalty + \or % case 1, do nothing (end of equation) + \relax + \or % case 2, no-op (obsolete case) + \or % case 3, transfer vspace and/or penalty + \ifx#1\EQ@box \eq@revspace \else \eq@revspaceb \fi + \or % case 4, put back an insert + \eq@reinsert + \or % case 5, put back a mark + \eq@remark + \or % case 6, put back a vadjust + \eq@readjust + \else % some other break penalty + \penalty-\count@ + \fi + \unhbox#1}% +} +\def\eq@nulldisplay{% + \begingroup \frozen@everydisplay\@emptytoks + \@@display + \predisplaypenalty\@M \postdisplaypenalty\@M + \abovedisplayskip\z@skip \abovedisplayshortskip\z@skip + \belowdisplayskip\z@skip \belowdisplayshortskip\z@skip + \xdef\EQ@displayinfo{% + \prevgraf\the\prevgraf \predisplaysize\the\predisplaysize + \displaywidth\the\displaywidth \displayindent\the\displayindent + \listwidth\the\linewidth + \ifdim\displayindent>\z@ + \advance\listwidth\the\leftmargin + \advance\listwidth\the\rightmargin + \fi + \relax}% + \halign{##\cr}% + \@@enddisplay + \par + \endgroup + \EQ@displayinfo +} +\def\eq@newline{% + \@ifstar{\eq@newlinea\@M}{\eq@newlinea\eqinterlinepenalty}} +\def\eq@newlinea#1{% + \@ifnext[{\eq@newlineb{#1}}{\eq@newlineb{#1}[\maxdimen]}} +\def\eq@newlineb#1[#2]{\penalty-\@M} +\def\eq@revspace{% + \global\setbox\EQ@vimbox\vbox{\unvbox\EQ@vimbox + \unpenalty + \global\setbox\@ne\lastbox}% + \@@vadjust{\unvbox\@ne}% + \penalty-\@M +} +\def\eq@revspaceb{% + \global\setbox\EQ@vimcopy\vbox{\unvbox\EQ@vimcopy + \unpenalty + \global\setbox\@ne\lastbox}% + \@@vadjust{\unvbox\@ne}% + \penalty-\@M +} +\def\eq@break#1{\penalty-1000#1 \keep@glue} +\let\@parshape\@empty +\def\eq@measure{% + \ifdim\eq@indentstep=\maxdimen \eq@indentstep\eqindentstep \fi + \ifdim\eq@linewidth=\z@ \else \edef\eq@linewidths{{\the\eq@linewidth}}\fi + \begingroup \eq@params + \leftskip\z@skip + \rightskip\z@\@plus\columnwidth\@minus\hfuzz + \global\EQ@continue{\eq@trial}% + \eq@trial % uses \eq@linewidths + \eq@failout % will be a no-op if the trial succeeded + \endgroup + \EQ@trial +} +\def\debug@showmeasurements{% + \debugmsg{=> \number\eq@lines\space lines}% + \debug + \def\@elt##1^^J##2{^^J||===== \space\space##1/##2}% + \let\@endelt\@empty + \debugmsg{=> trial info:\eq@measurements}% + \debugmsg{=> bounding box: \the\eq@wdT x\the\eq@vspan, badness=\the\eq@badness}% + \let\@elt\relax \let\@endelt\relax + \gubed +} +\def\debug@showmeasurements{% + \begingroup + \def\@elt##1^^J##2{^^J||===== ##1/##2}% + \let\@endelt\@empty + \debugmsg{===> Measurements: \number\eq@lines\space lines + \eq@measurements + ^^J||===== bounding box: \the\eq@wdT x\the\eq@vspan, badness=\the\eq@badness + ^^J||===== \leftskip=\the\leftskip, \rightskip=\the\rightskip}% + \endgroup +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\let\EQ@trial\@empty +\newtoks\EQ@continue +\let\EQ@widths\@empty +\let\EQ@fallback\@empty +\def\eq@linewidths{\displaywidth\linewidth\columnwidth} +\def\eq@trial{% + \ifx\@empty\eq@linewidths + \global\EQ@continue{}% + \else + \iffalse{\fi \@xp\eq@trial@a \eq@linewidths}% + \fi + \the\EQ@continue +} +\def\eq@trial@a#1{% + \dim@c#1\relax + \if T\eq@frame \eq@frame@adjust\dim@c \fi + \ifdim\dim@c>\eq@linewidth + \eq@linewidth\dim@c + \debugmsg{Choose Shape for width(#1)=\the\eq@linewidth}% + \let\eq@trial@b\eq@trial@d + \csname eq@try@layout@\eq@layout\endcsname + \else + \debugmsg{Next width (#1) is shorter; skip it}% + \fi + \edef\eq@linewidths{\iffalse}\fi +} +\def\eq@frame@adjust#1{% + \addtolength#1{-2\eq@framewd-2\eq@framesep}% +} +\def\eq@trial@succeed{% + \aftergroup\@gobbletwo % cancel the \EQ@fallback code; see \eq@trial@c (?) + \global\EQ@continue{\eq@trial@done}% +} +\def\eq@trial@done{% + \debugmsg{End trial: Success!}% + \let\eq@failout\relax +} +\def\eq@trial@init{\global\let\EQ@fallback\eq@nextlayout} +\def\eq@nextlayout#1{% + \endgroup + \debugmsg{Nope ... that ain't gonna work.}% + \begingroup #1% +} +\def\eq@failout{% +\debugmsg{End trial: failout}% + \global\let\EQ@trial\EQ@last@trial +} +\def\eq@trial@save#1{% + \xdef#1{% + \eq@linewidth\the\eq@linewidth + % save info about the fit + \eq@lines\the\eq@lines \eq@badness\the\eq@badness \def\@nx\eq@badline{\eq@badline}% + % save size info + \eq@wdT\the\eq@wdT \eq@wdMin\the\eq@wdMin + \eq@vspan\the\eq@vspan \eq@dp\the\eq@dp \eq@firstht\the\eq@firstht + % save info about the LHS + \eq@wdL\the\eq@wdL \def\@nx\EQ@hasLHS{\EQ@hasLHS}% + % save info about the numbering + \def\@nx\eq@hasNumber{\eq@hasNumber}% + % save info about the chosen layout + \def\@nx\eq@layout{\eq@layout}% + \def\@nx\eq@parshape{\@parshape}% + \def\@nx\eq@measurements{\eq@measurements}% + \def\@nx\adjust@rel@penalty{\adjust@rel@penalty}% + \def\@nx\eq@shiftnumber{\eq@shiftnumber}% + \def\@nx\eq@isIntertext{\@False}% + }% +} +\def\eq@trial@b{\eq@trial@c} +\def\eq@trial@c#1#2{% + \debugmsg{Trying layout "#1" with^^J||===== parshape\space\@xp\@gobble\@parshape}% + \begingroup + \eq@trial@init + \def\eq@layout{#1}% + \setbox\z@\vbox{% + \hfuzz\maxdimen + \eq@trial@p % run the given parshape + \if\@Not{\eq@badline}% + \eq@trial@save\EQ@trial + \if\eq@hasNumber\eq@retry@with@number\fi + \if L\eq@layout \eq@check@density + \else + \if\@Not{\eq@badline}% + \eq@trial@succeed + \fi + \fi + \else + \eq@trial@save\EQ@last@trial + \fi + }% + \EQ@fallback{#2}% + \endgroup +} +\def\eq@trial@d#1#2{\eq@trial@c{#1}{}} +\def\eq@check@density{% + \debugmsg{Checking density for layout L}% + \if\@Or{\@Not\EQ@hasLHS}{\eq@shortLHS}% + \debugmsg{Density check: No LHS, or is short; OK}% + \eq@trial@succeed + \else\if\eq@dense@enough + \eq@trial@succeed + \fi\fi +} +\def\eq@shortLHS{\ifdim\eq@wdL>.44\eq@wdT 1\else 0\fi 0} +\def\eq@trial@p{% + \@parshape % + \eq@dump@box\unhcopy\EQ@copy + {\@@par}% leave \parshape readable + \eq@lines\prevgraf + \eq@fix@lastline + \let\eq@badline\@False + \if i\eq@layout \ifnum\eq@lines>\@ne \let\eq@badline\@True \fi\fi + \eq@curline\eq@lines % loop counter for eq@measure@lines + \let\eq@measurements\@empty + \eq@ml@record@indents + \eq@measure@lines + \eq@recalc + \debug@showmeasurements +} +\let\adjust@rel@penalty\@empty +\def\eq@fix@lastline{% + \setbox\tw@\lastbox \dim@b\wd\tw@ + \eq@dp\dp\tw@ + \nointerlineskip\hbox to\dim@b{\unhbox\tw@ + \skip@c\lastskip \unskip\unskip\hskip\skip@c + }% +} +\def\eq@recalc{% + \eq@wdT\z@ \eq@wdMin\maxdimen \eq@vspan\z@skip \eq@badness\z@ + \let\@elt\eq@recalc@a \eq@measurements \let\@elt\relax +} +\def\eq@recalc@a#1x#2+#3\@endelt{% + \eq@firstht#2\relax + \let\@elt\eq@recalc@b + \@elt#1x#2+#3\@endelt +} +\def\eq@recalc@b#1^^J#2,#3x#4+#5@#6\@endelt{% + \setlength\dim@a{#2+#3}% + \ifdim\dim@a>\eq@wdT \eq@wdT\dim@a \fi + \ifdim\dim@a<\eq@wdMin \eq@wdMin\dim@a \fi + \eq@dp#5\relax + \addtolength\eq@vspan{#1+#4+#5}% + \ifnum#6>\eq@badness \eq@badness#6\relax\fi +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\eq@layout{?} +\@namedef{eq@try@layout@?}{% + \let\eq@trial@b\eq@trial@c + \edef\@parshape{\parshape 1 0pt \the\eq@linewidth\relax}% + \setlength\dim@a{\wd\EQ@copy-2em}% Fudge; can't shrink more than this? + % if we're in a numbered group, try hard to fit within the numbers + \dim@b\eq@linewidth + \if\eq@shiftnumber\else\if\eq@group + \if\eq@hasNumber\addtolength\dim@b{-\wd\EQ@numbox-\eqnumsep}% + \else\if\grp@hasNumber\addtolength\dim@b{-\wd\GRP@numbox-\eqnumsep}% + \fi\fi\fi\fi + \ifdim\dim@a<\dim@b% Do we even have a chance of fitting to one line? + \debugmsg{Choose Shape: (\the\wd\EQ@copy) may fit in \the\dim@b}% + % assuming it might fit, don't push too hard + \setlength\dim@b{\columnwidth-\dim@a+\eq@wdCond}% + \rightskip\z@\@plus\dim@b\@minus\hfuzz + \eq@trial@b{i}{\eq@try@layout@multi}% + \else + \debugmsg{Choose Shape: Too long (\the\wd\EQ@copy) for one line (free width=\the\dim@b)}% + \eq@try@layout@multi + \fi +} +\def\eq@try@layout@multi{% + \if\EQ@hasLHS + \ifdim\eq@wdL>\eq@linewidth + \debugmsg{Choose Shape: LHS \the\eq@wdL > linewidth}% + \setlength\dim@a{\wd\EQ@copy-\eq@wdL}% + \ifdim\dim@a<.25\eq@linewidth \eq@try@layout@S + \else \eq@try@layout@l + \fi + % BRM: Originally .7: Extreme for L since rhs has to wrap within the remaining 30+%! + \else\ifdim\eq@wdL>.50\eq@linewidth + \debugmsg{Choose Shape: LHS (\the\eq@wdL) > .50 linewidth (linewidth=\the\eq@linewidth)}% + \eq@try@layout@D + \else + \debugmsg{Choose Shape: LHS (\the\eq@wdL) not extraordinarily wide}% + \eq@try@layout@L + \fi\fi + \else + \debugmsg{Choose Shape: No LHS here}% + \eq@try@layout@S % (already checked case i) + \fi +} +\def\eq@try@layout@D{% + \setlength\dim@a{\eq@linewidth -\eq@indentstep}% + \edef\@parshape{\parshape 2 + 0pt \the\eq@wdL\space \the\eq@indentstep\space \the\dim@a\relax + }% + \def\adjust@rel@penalty{\penalty-99 }% + \eq@trial@b{D}{\eq@try@layout@A}% +} +\def\eq@try@layout@L{% + \setlength\dim@b{\eq@linewidth-\eq@wdL}% + \edef\@parshape{\parshape 2 0pt \the\eq@linewidth\space + \the\eq@wdL\space \the\dim@b\relax + }% + \eq@trial@b{L}{\eq@try@layout@D}% +} +\def\eq@try@layout@S{% + \setlength\dim@b{\eq@linewidth-2\eqmargin}% \advance\dim@b-1em% + \int@a\wd\EQ@copy \divide\int@a\dim@b + \addtolength\dim@b{-\int@a\eq@indentstep}% + \if\eq@hasNumber + \ifdim\dim@b>15em% + \addtolength\dim@b{-\eq@wdNum}% + \fi + \fi + \int@b\z@ + \def\@tempa{\dim}% + \edef\@parshape{\parshape 2 0pt \the\dim@b\space + \the\eqmargin\space\the\dim@b\relax}% + \eq@trial@b{S}{\eq@try@layout@A}% +} +\def\eq@try@layout@l{% + \setlength\dim@a{\eq@linewidth -\eq@indentstep}% + \int@a\eq@wdL \divide\int@a\dim@a + \advance\int@a\tw@ + \edef\@parshape{\parshape \number\int@a\space + 0pt \the\eq@linewidth + }% + \advance\int@a-\tw@ + \setlength\dim@b{2\eq@indentstep}% + \setlength\dim@c{\eq@linewidth -\dim@b}% + \edef\@parshape{\@parshape + \replicate{\int@a}{\space\the\eq@indentstep\space\the\dim@a}% + \space\the\dim@b\space\the\dim@c\relax + }% + \eq@trial@b{l}{\eq@try@layout@A}% +} +\def\eq@try@layout@A{% + \edef\@parshape{\parshape 1 0pt \the\eq@linewidth\relax}% + \if\EQ@hasLHS \def\adjust@rel@penalty{\penalty-99 }\fi + \eq@trial@b{A}{}% +} +\let\eq@shiftnumber\@False +\def\eq@retry@with@number{% + \if\eq@shiftnumber + \debugmsg{Place number: Shifted number requested}% + \else + \ifdim\eq@wdCond>\z@\if R\eqnumside + \debugmsg{Place number: Condition w/Right number => Shift number}% + \let\eq@shiftnumber\@True + \fi\fi + \dim@b\eq@wdNum + \if L\eqnumside + \ifdim\@totalleftmargin>\dim@b\dim@b\@totalleftmargin\fi + \else + \addtolength\dim@b{\@totalleftmargin}% + \fi + \setlength\dim@a{\eq@linewidth-\dim@b}%\advance\dim@a1em\relax% Allowance for shrink? + \int@a\@ne\if\eq@group\int@a\maxint\fi + \if\eq@shiftnumber % Already know we need to shift + \else\ifdim\eq@wdT<\dim@a % Fits! + \debugmsg{Place number: eqn and number fit together}% + \else + \setlength\leftskip{\eq@wdNum}% + \setlength\rightskip{\z@\@plus\dim@a}% + \adjust@parshape\@parshape + \debugmsg{Place number: Try with \leftskip=\the\leftskip, \rightskip=\the\rightskip, + ^^J||===== parshape\space\@xp\@gobble\@parshape}% + \nointerlineskip + \edef\eq@prev@lines{\the\eq@lines}% + \edef\eq@prev@badness{\the\eq@badness}% BRM + \eq@trial@p + \int@a\eq@prev@badness\relax\advance\int@a 50\relax%? + \int@b\eq@prev@lines \if\eq@group\advance\int@b\@ne\fi% Allow 1 extra line in group + \ifnum\eq@lines>\int@b % \eq@prev@lines + \debugmsg{Adjustment causes more breaks => Shift number}% + \let\eq@shiftnumber\@True + \else\if\eq@badline + \debugmsg{Adjustment causes bad lines (\the\eq@badness) => Shift}% + \let\eq@shiftnumber\@True + \else\ifnum\eq@badness>\int@a % BRM: New case + \debugmsg{Adjustment is badder than previous (\the\eq@badness >> \eq@prev@badness) => Shift}% + \let\eq@shiftnumber\@True + \else + \debugmsg{Adjustment succeeded}% + \fi\fi%\fi + \fi\fi\fi + \if\eq@shiftnumber + \EQ@trial% Restore parshape & other params, + \leftskip\z@\let\eq@shiftnumber\@True % But set shift & leftskip + \edef\@parshape{\eq@parshape}% And copy saved parshape back to `working copy' !?!? + \fi + \eq@trial@save\EQ@trial % Either way, save the trial state. + \fi +} +\def\adjust@parshape#1{% + \@xp\adjust@parshape@a#1\relax + \edef#1{\temp@a}% +} +\def\adjust@parshape@a#1 #2\relax{% + \setlength\dim@a{\leftskip+\rightskip}% + \edef\temp@a{#1}% + \adjust@parshape@b#2 @ @ \relax +} +\def\adjust@parshape@b#1 #2 {% + \ifx @#1\edef\temp@a{\temp@a\relax}% + \@xp\@gobble + \else + \dim@b#1\relax + \dim@c#2\relax + \addtolength\dim@c{\dim@a+\dim@b}% + \ifdim\dim@c>\eq@linewidth\setlength\dim@c{\eq@linewidth}\fi + \addtolength\dim@c{-\dim@b}% + \edef\temp@a{\temp@a\space\the\dim@b\space\the\dim@c}% + \fi + \adjust@parshape@b +} +\def\eq@ml@record@indents{% + \int@a\z@ + \def\@tempa{% + \advance\int@a\@ne + \@xp\edef\csname eq@i\number\int@a\endcsname{\the\dim@a}% + \ifnum\int@a<\int@b \afterassignment\@tempb \fi + \dim@a + }% + \def\@tempb{\afterassignment\@tempa \dim@a}% + \def\@tempc##1##2 {\int@b##2\afterassignment\@tempa\dim@a}% + \@xp\@tempc\@parshape +} +\chardef\@endelt=`\? +\def\eq@measurements{% + \@elt 4.5pt/5.0pt,66.0ptx6.8pt+2.4pt@27\@endelt + ... +} +\def\eq@measure@lines{% + \let\eq@ml@continue\eq@measure@lines + \setbox\tw@\lastbox \dim@b\wd\tw@ % find target width of line + \setbox\z@\hbox to\dim@b{\unhbox\tw@}% check for overfull + \eq@badness\badness + \ifnum\eq@badness<\inf@bad \else \let\eq@badline\@True \fi + \eq@ml@a \eq@ml@continue +} +\def\eq@ml@a{% + \setbox\tw@\hbox{\unhbox\z@ \unskip}% find natural width + \debug\ifnum\eq@badness<\inf@bad\else\debugmsg{!?! Overfull: \the\wd\tw@ >\the\dim@b}\fi\gubed + \ifdim\dim@b<\wd\tw@ \setlength\dim@a{\dim@b}% shrunken line + \else \setlength\dim@a{\wd\tw@}% OK to use natural width + \fi + \addtolength\dim@a{-\leftskip}% BRM: Deduct the skip if we're retrying w/number + \skip@a\lastskip \unskip \unpenalty + \ifdim\skip@a=\z@ + \let\eq@ml@continue\relax % end the recursion + \else + % Sum repeated vskips if present + \def\@tempa{% + \ifdim \lastskip=\z@ + \else \addtolength\skip@a{\lastskip}\unskip\unpenalty \@xp\@tempa + \fi + }% + \fi + \edef\eq@measurements{\@elt + \the\skip@a\space^^J% extra space to facilitate extracting only the + % dimen part later + \csname eq@i% + \ifnum\eq@curline<\parshape \number\eq@curline + \else\number\parshape + \fi + \endcsname,\the\dim@a x\the\ht\tw@+\the\dp\tw@ @\the\eq@badness\@endelt + \eq@measurements + }% + \advance\eq@curline\m@ne + \ifnum\eq@curline=\z@ \let\eq@ml@continue\relax\fi +} +\def\eq@ml@vspace{% + \global\advance\eq@vspan\lastskip \unskip\unpenalty + \ifdim\lastskip=\z@ \else \@xp\eq@ml@vspace \fi +} +\def\eq@dense@enough{% + \ifnum\eq@lines<\thr@@ + \debugmsg{Density check: less than 3 lines; OK}% + \@True + \else + \ifdim\eq@wdL >.7\eq@wdT + \debugmsg{Density check: LHS too long; NOT OK}% + \@False + \else \@xp\@xp\@xp\eq@dense@enough@a + \fi + \fi +} +\def\true@false@true{\fi\fi\iftrue\iffalse\iftrue} +\def\false@false@false{\fi\fi\iffalse\iffalse\iffalse} +\def\false@true@false{\fi\fi\iffalse\iftrue\iffalse} +\def\eq@density@factor{.475} +\def\eq@dense@enough@a{% + \@True \fi + \ifnum\eq@lines>\sixt@@n + \eq@dense@enough@b + \else + \dim@b\z@ \let\@elt\eq@delt \eq@measurements + \dim@c\eq@density@factor\eq@wdT \multiply\dim@c\eq@lines + \debugmsg{Density check: black \the\dim@b/\eq@density@factor total \the\dim@c}% + \ifdim\dim@b>\dim@c \true@false@true \else \false@false@false \fi + \fi +} +\def\eq@delt#1^^J#2,#3x#4+#5@#6\@endelt{\addtolength\dim@b{#3}}% +\def\eq@dense@enough@b{% + \int@b\eq@wdT \divide\int@b\p@ + \dim@b\eq@wdL \divide\dim@b\int@b + \dim@c\eq@lines\p@ \multiply\dim@c\f@ur + \int@b\eq@lines \multiply\int@b 9 \advance\int@b -10% + \divide\dim@c\int@b + \debugmsg{Density check: l/t \the\dim@b\space< \the\dim@c\space 4n/(9n-10)?}% + \ifdim\dim@b<\dim@c \true@true@true \else \false@true@false \fi +} +\let\eq@parshape\@empty +\def\eq@params{% + \baselineskip\eqlinespacing + \lineskip\eqlineskip \lineskiplimit\eqlineskiplimit + \clubpenalty\@M \widowpenalty\@M \interlinepenalty\eqinterlinepenalty + \linepenalty199 \exhyphenpenalty5000 % was 9999: make breaks at, eg. \* a bit easier. + \ifdim\hfuzz<\p@ \hfuzz\p@ \fi + \parfillskip\z@skip + \tolerance9999 \pretolerance\m@ne +} +\def\eq@dump@box#1#2{% + \noindent #1#2\setbox\f@ur\lastbox \setbox\tw@\lastbox + \if L\eq@layout \box\tw@ \else\unhbox\tw@\fi + \adjust@rel@penalty \unhbox\f@ur +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\eq@typeset@Unnumbered{% + \eq@typeset@frame + \eq@typeset@equation +} +\def\eq@typeset@LM{% + \addtolength\dim@a{(\eq@vspan+\ht\EQ@numbox-\dp\EQ@numbox)/2}% + \eq@typeset@leftnumber + \eq@typeset@frame + \eq@typeset@equation +} +\def\eq@typeset@LT{% + \dim@a\eq@firstht + \eq@typeset@leftnumber + \eq@typeset@frame + \eq@typeset@equation +} +\def\eq@typeset@LShifted{% + % place number + \copy\EQ@numbox \penalty\@M + \dim@a\eqlineskip + \if F\eq@frame\else + \setlength\dim@a{\eq@framesep+\eq@framewd}% + \fi + \kern\dim@a + \eq@typeset@frame + \eq@typeset@equation +} +\def\eq@typeset@RM{% + \setlength\dim@a{(\eq@vspan+\ht\EQ@numbox-\dp\EQ@numbox)/2} + \eq@typeset@rightnumber + \eq@typeset@frame + \eq@typeset@equation +} +\def\eq@typeset@RB{% + % NOTE: is \eq@dp useful here + \setlength\dim@a{\eq@vspan-\ht\EQ@numbox-\dp\EQ@numbox}% + \eq@typeset@rightnumber + \eq@typeset@frame + \eq@typeset@equation +} +\def\eq@typeset@RShifted{% + % place number + \eq@typeset@frame + \eq@typeset@equation + \penalty\@M + \dim@a\eqlineskip + \if F\eq@frame\else + \addtolength\dim@a{\eq@framesep+\eq@framewd}% + \fi + \parskip\dim@a + \hbox to\hsize{\hfil\copy\EQ@numbox}\@@par% +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\debug@showformat{% + \debugmsg{Formatting Layout:\eq@layout\space Center/indent: \eqindent\space Number placement \eqnumside\eqnumplace: + ^^J||===== \eq@linewidth=\the\eq@linewidth, \@totalleftmargin=\the\@totalleftmargin, + ^^J||===== Centered Lines=\theb@@le\eq@centerlines, Shift Number=\theb@@le\eq@shiftnumber, + ^^J||===== \eq@wdT=\the\eq@wdT, \eq@wdMin=\the\eq@wdMin, + ^^J||===== LHS=\theb@@le\EQ@hasLHS: \eq@wdL=\the\eq@wdL, + ^^J||===== \eq@firstht=\the\eq@firstht, \eq@vspan=\the\eq@vspan + ^^J||===== \eq@wdNum=\the\eq@wdNum + ^^J||===== \eq@wdCond=\the\eq@wdCond, \conditionsep=\the\conditionsep, + ^^J||===== \leftskip=\the\leftskip, \rightskip=\the\rightskip, + ^^J||===== \abovedisplayskip=\the\abovedisplayskip, + ^^J||===== \belowdisplayskip=\the\belowdisplayskip + ^^J||===== parshape=\eq@parshape}% +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\eq@C@setsides{% + % \dim@c = space for number, if any, and not shifted. + \dim@c\z@ + \if\eq@hasNumber\if\eq@shiftnumber\else + \dim@c\eq@wdNum + \fi\fi + % \dim@e = space for condition(on right), if any and formula is only a single line.(to center nicely) + % but only count it as being right-aligned if we're not framing, since the frame must enclose it. + \dim@e\z@ + \if F\eq@frame + \ifnum\eq@lines=\@ne\ifdim\eq@wdCond>\z@ + \setlength\dim@e{\eq@wdCond+\conditionsep}% + \fi\fi\fi + % \dim@b = minimum needed on left max(totalleftmargin, left number space) + \dim@b\z@ + \if L\eqnumside\ifdim\dim@b<\dim@c + \dim@b\dim@c + \fi\fi + \ifdim\dim@b<\@totalleftmargin + \dim@b\z@ + \else + \addtolength\dim@b{-\@totalleftmargin}% + \fi + % \dim@d = minimum needed on right max(condition, right number space) + \dim@d\dim@e + \if R\eqnumside\ifdim\dim@d<\dim@c + \dim@d\dim@c + \fi\fi + % \dim@a = left margin; initially half available space + % \dim@c = right margin; ditto + \setlength\dim@a{(\eq@linewidth-\eq@wdT+\dim@e+\@totalleftmargin)/2}% + \dim@c=\dim@a + % If too far to the left + \ifdim\dim@a<\dim@b + \addtolength\dim@c{\dim@a-\dim@b}% + \ifdim\dim@c<\z@\dim@c=\z@\fi + \dim@a=\dim@b + % Or if too far to the right + \else\ifdim\dim@c<\dim@d + \addtolength\dim@a{\dim@c-\dim@d}% + \ifdim\dim@a<\z@\dim@a=\z@\fi + \dim@c=\dim@d + \fi\fi + % Now, \dim@d,\dim@e is the left & right glue to center each line for centerlines + \setlength\dim@e{\eq@wdT-\eq@wdMin}\dim@d=\z@ + \dim@d\z@ + \if\eq@centerlines + \divide\dim@e2\relax\dim@d\dim@e + \fi + \setlength\leftskip{\dim@a\@plus\dim@d}% + \addtolength\dim@e{\dim@c}% + \setlength\rightskip{\z@\@plus\dim@e}%\@minus5\p@ + % Special case: if framing, reduce the stretchiness of the formula (eg. condition) + % Or if we have a right number, FORCE space for it + \dim@b\z@ + \if F\eq@frame\else + \dim@b\dim@c + \fi + \if\eq@hasNumber\if\eq@shiftnumber\else\if R\eqnumside + \dim@c\eq@wdNum + \ifdim\dim@c>\dim@b\dim@b\dim@c\fi + \fi\fi\fi + % If either of those cases requires hard rightskip, move that part from glue. + \ifdim\dim@b>\z@ + \addtolength\dim@e{-\dim@c}% + \rightskip\dim@b\@plus\dim@e%\@minus5\p@ + \fi + % And peculiar further special case: in indented environs, width isn't where it would seem + \ifdim\eq@wdCond>\z@ + \addtolength\rightskip{-\@totalleftmargin}% + \fi + \parfillskip\z@skip +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\eq@I@setsides{% + % Leftskip is normally just the requested indentation + \leftskip\mathindent + % But move left, if shifted number presumably because of clashed w/ number? + \if\eq@shiftnumber + \setlength\dim@a{\eq@linewidth-\eq@wdT-\mathindent}% + \ifdim\dim@a<\z@ + \leftskip=\z@ % Or something minimal? + \fi\fi + % Push gently from right. + \dim@a=\z@ + \setlength\dim@b{\eq@linewidth-\leftskip-\eq@wdMin}% + % Special case: if framing be much more rigid(?) + \if F\eq@frame\else + \setlength\dim@a{\eq@linewidth-\leftskip-\eq@wdT} + \addtolength\dim@b{-\dim@a}% + \fi + % Or force the space for right number, if needed + \if\eq@hasNumber\if\eq@shiftnumber\else\if R\eqnumside + \dim@c=\eq@wdNum + \if\dim@c>\dim@a + \addtolength\dim@b{-\dim@c}% + \dim@a=\dim@c + \fi\fi\fi\fi + \setlength\rightskip{\dim@a\@plus\dim@b \@minus\hfuzz }%\hfuzz\z@ + \parfillskip\z@skip +} +\def\eq@typeset@leftnumber{% + \setlength\skip@c{\dim@a-\ht\EQ@numbox}% + \vglue\skip@c% NON discardable + \copy\EQ@numbox \penalty\@M + \kern-\dim@a +} +\def\eq@typeset@rightnumber{% + \setlength\skip@c{\dim@a-\ht\EQ@numbox}% + \vglue\skip@c% NON discardable + \hbox to \hsize{\hfil\copy\EQ@numbox}\penalty\@M + \kern-\dim@a +} +\def\eq@typeset@equation{% + \nobreak + \eq@params\eq@parshape + \nointerlineskip\noindent + \add@grp@label + \eq@dump@box\unhbox\EQ@box\@@par +} +\newcommand\eqframe[2]{% + \begingroup + \fboxrule=\eq@framewd\relax\fboxsep=\eq@framesep\relax + \framebox{\z@rule\@height#2\kern#1}% + \endgroup +} +\def\eq@addframe{% + \hbox to\z@{% + \setlength\dim@a{\eq@framesep+\eq@framewd}% + \kern-\dim@a + \vbox to\z@{\kern-\dim@a + \hbox{\eqframe{\eq@wdT}{\eq@vspan}}% + \vss + }% + \hss + }% +} +\def\eq@typeset@frame{% + \if F\eq@frame\else + % Tricky: put before \noindent, so it's not affected by glue in \leftskip + \nobreak\nointerlineskip + \vbox to\eq@firstht{\moveright\leftskip\hbox to\z@{\eq@addframe\hss}\vss}% + \kern-\eq@firstht + \fi +} +\@saveprimitive\left\@@left +\@saveprimitive\right\@@right +\newcount\lr@level +\def\eq@left{% + \@ifnext .{\eq@nullleft}{\begingroup \let\delimiter\eq@left@a}% +} +\def\eq@right{% + \@ifnext .{\eq@nullright}{\begingroup \let\delimiter\eq@right@a}% +} +\def\eq@left@a#1 #2{\endgroup\@@left\delimiter#1 \after@open} +\def\eq@right@a#1 #2{\endgroup + \@@right\delimiter#1 \after@close \ss@scan{#1}% +} +\def\eq@nullleft#1{\@@left#1\after@open} +\def\eq@nullright#1{\@@right#1\after@close} + % For paren matching: ) +\def\delim@reset{% + \let\after@open\relax \let\after@close\relax + \let\left\@@left \let\right\@@right +} +\@ifundefined{bBigg@}{% not defined + \let\big@size\p@ + \def\big{\bBigg@{8.5}}\def\Big{\bBigg@{11.5}}% + \def\bigg{\bBigg@{14.5}}\def\Bigg{\bBigg@{17.5}}% + \def\biggg{\bBigg@{20.5}}\def\Biggg{\bBigg@{23.5}}% +}{} +\def\bBigg@#1#2{% + {\delim@reset + \left#2% + \vrule\@height#1\big@size\@width-\nulldelimiterspace + \right. + }% +} +\def\bigl#1{\mathopen\big{#1}\after@open} +\def\Bigl#1{\mathopen\Big{#1}\after@open} +\def\biggl#1{\mathopen\bigg{#1}\after@open} +\def\Biggl#1{\mathopen\Bigg{#1}\after@open} +\def\bigggl#1{\mathopen\biggg{#1}\after@open} +\def\Bigggl#1{\mathopen\Biggg{#1}\after@open} + +\def\bigr#1{\mathclose\big{#1}\after@close} +\def\Bigr#1{\mathclose\Big{#1}\after@close} +\def\biggr#1{\mathclose\bigg{#1}\after@close} +\def\Biggr#1{\mathclose\Bigg{#1}\after@close} +\def\bigggr#1{\mathclose\biggg{#1}\after@close} +\def\Bigggr#1{\mathclose\Biggg{#1}\after@close} + +%% No change needed, I think. [mjd,1998/12/04] +%%\def\bigm{\mathrel\big} +%%\def\Bigm{\mathrel\Big} +%%\def\biggm{\mathrel\bigg} +%%\def\Biggm{\mathrel\Bigg} +%%\def\bigggm{\mathrel\biggg} +%%\def\Bigggm{\mathrel\Biggg} +\let\m@@DeL\m@DeL \let\m@@DeR\m@DeR \let\m@@DeB\m@DeB +\def\d@@DeL#1#2#3{% + \delimiter"4\@xp\delim@a\csname sd@#1#2#3\endcsname #1#2#3 \after@open +} +\def\d@@DeR#1#2#3{% + \delimiter"5\@xp\delim@a\csname sd@#1#2#3\endcsname #1#2#3 \after@close +} +\def\d@@DeB#1#2#3{% + \delimiter"0\@xp\delim@a\csname sd@#1#2#3\endcsname #1#2#3 \after@bidir +} +%%BRM: These weren't defined, but apparently should be. +\let\m@@DeA\m@DeA\let\d@@DeA\m@DeA% +\let\after@bidir\@empty +\mathchardef\zero@bop=888 \relax +\mathchardef\bop@incr=4444 \relax +\def\after@open{% + \global\advance\lr@level\@ne + \prebinoppenalty\bop@incr \multiply\prebinoppenalty\lr@level + \advance\prebinoppenalty\zero@bop + \ifnum\eqbreakdepth<\lr@level + \let\m@Bin\m@@Bin + \else + \eq@binoffset=\eqbinoffset + \advance\eq@binoffset\lr@level\eqdelimoffset plus1fill\relax + \def\dt@fill@cancel{\hskip\z@ minus1fill\relax}% + \fi + \penalty\@M % BRM: discourage break after an open fence? +} +\def\after@close{% + \global\advance\lr@level\m@ne + \prebinoppenalty\bop@incr \multiply\prebinoppenalty\lr@level + \advance\prebinoppenalty\zero@bop + \ifnum\eqbreakdepth<\lr@level + \else \let\m@Bin\d@@Bin + \fi + \ifnum\lr@level<\@ne \eq@binoffset=\eqbinoffset\relax \fi +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\let\subsup@flag=\count@ +\def\ss@delim@a#1#2#3#4{\xdef\right@delim@code{\number"#2#3#4}} +\def\ss@scan#1{% + \begingroup + \let\delim@a\ss@delim@a \@tempcnta#1\relax + \endgroup + \subsup@flag\@M \afterassignment\ss@scan@a \let\@let@token=} +\def\ss@scan@a{% + \ifx\@let@token\sb \advance\subsup@flag\@ne\else + \ifx\@let@token\sp \advance\subsup@flag\tw@\else + \ss@finish + \expandafter\@firstoftwo % gobble \ss@scan@b + \fi\fi + \ss@scan@b\@let@token +} +\def\ss@scan@b#1#2{#1{% + \let\m@Bin\m@@Bin \let\m@Rel\m@@Rel + #2}\afterassignment\ss@scan@a \let\@let@token=}% +\def\ss@finish{% + \@@vadjust{\penalty\thr@@}% + \penalty\right@delim@code \penalty-\subsup@flag \keep@glue +} +\def\eq@lrunpack{\setbox\z@\lastbox + \unskip \nointerlineskip + \noindent\unhbox\z@ \unskip + \subsup@flag-\lastpenalty \unpenalty + \xdef\right@delim@code{\number\lastpenalty}% + \unpenalty + \ifnum\subsup@flag>\@M + \advance\subsup@flag-\@M + \setbox\tw@\lastbox + \else \setbox\tw@\box\voidb@x + \fi + \setbox\z@\lastbox + \ifvoid\tw@ \unhbox\z@ + \else \lrss@reattach % uses \subsup@flag, box\z@, box\tw@ + \fi + \penalty-\@Mi\z@rule\@@par + \setbox\z@\lastbox \unskip\unpenalty +%%{\showboxbreadth\maxdimen\showboxdepth99\showlists}% +} +\dimendef\sub@depth=8 \dimendef\sup@base=6 +\dimendef\prelim@sub@depth=4 \dimendef\prelim@sup@base=2 +\def\sym@xheight{\fontdimen5\textfont\tw@} +\def\sup@base@one{\fontdimen13\textfont\tw@} +\def\sub@base@one{\fontdimen16\textfont\tw@} +\def\sub@base@two{\fontdimen17\textfont\tw@} +\def\sup@drop{\fontdimen18\scriptfont\tw@} +\def\sub@drop{\fontdimen19\scriptfont\tw@} +\providecommand{\mathaxis}{\fontdimen22\textfont\tw@} +\def\lrss@reattach{% + \begingroup + % "The TeXbook" Appendix G step 18: + \setlength\prelim@sup@base{\ht\z@-\sup@drop}% + \setlength\prelim@sub@depth{\dp\z@ +\sub@drop}% + \unhbox\z@ + \ifcase\subsup@flag % case 0: this can't happen + \or \lr@subscript % case 1: subscript only + \or \lr@superscript % case 2: superscript only + \else \lr@subsup % case 3: sub and superscript both + \fi + \endgroup +} +\def\lr@subscript{% + \sub@depth\sub@base@one + \ifdim\prelim@sub@depth>\sub@depth \sub@depth\prelim@sub@depth\fi + \setlength\dim@a{\ht\tw@ -.8\sym@xheight}% + \ifdim\dim@a>\sub@depth \sub@depth=\dim@a \fi + \twang@adjust\sub@depth + \lower\sub@depth\box\tw@ +} +\def\lr@superscript{% + \sup@base\sup@base@one + \ifdim\prelim@sup@base>\sup@base \sup@base\prelim@sup@base\fi + \setlength\dim@a{\dp\tw@ -.25\sym@xheight}% + \ifdim\dim@a>\sup@base \sup@base\dim@a \fi + \twang@adjust\sup@base + \raise\sup@base\box\tw@ +} +\def\lr@subsup{% + \sub@depth\sub@base@two + \ifdim\prelim@sub@depth>\sub@depth \sub@depth\prelim@sub@depth \fi + \twang@adjust\sub@depth + \lower\sub@depth\box\tw@ +} +\def\twang@adjust#1{% + \begingroup + \@ifundefined{twang@\right@delim@code}{}{% + \setlength\dim@d{#1-\mathaxis}% + % put an upper limit on the adjustment + \ifdim\dim@d>1em \dim@d 1em \fi + \kern\csname twang@\right@delim@code\endcsname\dim@d + }% + \endgroup +} +\newcommand{\DeclareTwang}[2]{% + \ifcat.\@nx#1\begingroup + \lccode`\~=`#1\lowercase{\endgroup \DeclareTwang{~}}{#2}% + \else + \@xp\decl@twang#1?\@nil{#2}% + \fi +} +\def\decl@twang#1#2#3#4#5#6#7\@nil#8{% + \@namedef{twang@\number"#4#5#6}{#8}% +} +\DeclareTwang{\rangle}{-.4} +\DeclareTwang{)}{-.33} +\DeclareTwang{\rbrace}{-.25} +\newenvironment{dseries}{\let\eq@hasNumber\@True \@optarg\@dseries{}}{}% +\def\enddseries#1{\check@punct@or@qed}% +\newenvironment{dseries*}{\let\eq@hasNumber\@False \@optarg\@dseries{}}{}% +\@namedef{enddseries*}#1{\check@punct@or@qed}% +\@namedef{end@dseries*}{\end@dseries}% +\def\@dseries[#1]{% + \let\display@setup\dseries@display@setup + % Question: should this be the default for dseries??? + \global\eq@wdCond\z@ + \@dmath[layout={M},#1]% + \mathsurround\z@\@@math \penalty\@Mi + \let\endmath\ends@math + \def\premath{% + \ifdim\lastskip<.3em \unskip + \else\ifnum\lastpenalty<\@M \dquad\fi\fi +}% + \def\postmath{\unpenalty\eq@addpunct \penalty\intermath@penalty \dquad \@ignoretrue}% +\ignorespaces +} +\def\end@dseries{% + \unskip\unpenalty + \@@endmath \mathsurround\z@ \end@dmath +} +\def\eq@try@layout@M{% + \edef\@parshape{\parshape 1 0pt \the\eq@linewidth\relax}% + \eq@trial@b{M}{}% +} +\def\intermath@penalty{-221}% +\newcommand\dquad{\hskip0.6em minus.3em} +\newcommand\premath{}\newcommand\postmath{} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\renewenvironment{math}{% + \leavevmode \premath + \ifmmode\@badmath\else\@@math\fi +}{% + \ifmmode\@@endmath\else\@badmath\fi +} +\def\ends@math#1{\check@punct@or@qed} +\def\end@math{% + \ifmmode\@@endmath\else\@badmath\fi + \postmath +} +\let\eq@group\@False +\let\grp@shiftnumber\@False +\let\grp@hasNumber\@False +\let\grp@eqs@numbered\@False +\let\grp@aligned\@True +\global\let\GRP@top\@True +\newenvironment{dgroup}{% + \let\grp@hasNumber\@True\@optarg\@dgroup{}% +}{% + \end@dgroup +} +\newtoks\GRP@queue +\newenvironment{dgroup*}{% + \let\grp@hasNumber\@False\@optarg\@dgroup{}% +}{% + \end@dgroup +} +\def\@dgroup[#1]{% + \debugmsg{=== DGROUP ==================================================}% + \let\eq@group\@True \global\let\GRP@top\@True + \global\GRP@queue\@emptytoks \global\setbox\GRP@box\box\voidb@x + \global\let\GRP@label\@empty + \global\grp@wdL\z@\global\grp@wdR\z@\global\grp@wdT\z@ + \global\grp@linewidth\z@\global\grp@wdNum\z@ + \global\let\grp@eqs@numbered\@False + \global\let\grp@aligned\@True + \global\let\grp@shiftnumber\@False + \eq@prelim + \setkeys{breqn}{#1}% + \if\grp@hasNumber \grp@setnumber \fi +} +\def\end@dgroup{% + \EQ@displayinfo \grp@finish + \if\grp@hasNumber\grp@resetnumber\fi +} +\@ifundefined{c@parentequation}{\newcounter{parentequation}}{} +\global\let\GRP@label\@empty +\def\add@grp@label{% + \ifx\@empty\GRP@label + \else \GRP@label \global\let\GRP@label\@empty + \fi +} +\def\grp@setnumber{% + \global\let\GRP@label\next@label \global\let\next@label\@empty + % Trick \eq@setnumber to doing our work for us. + \let\eq@hasNumber\@True + \eq@setnumber + \global\sbox\GRP@numbox{\unhbox\EQ@numbox}% + \grp@wdNum\eq@wdNum + \let\eq@hasNumber\@False + \let\eq@number\@empty + \eq@wdNum\z@ + \protected@edef\theparentequation{\theequation}% + \setcounter{parentequation}{\value{equation}}% + \setcounter{equation}{0}% + \def\theequation{\theparentequation\alph{equation}}% + \debugmsg{Group Number \theequation}% +} +\def\grp@resetnumber{% + \setcounter{equation}{\value{parentequation}}% +} +\newbox\GRP@box +\newbox\GRP@wholebox +\def\grp@push{% + \global\GRP@queue\@xp\@xp\@xp{\@xp\the\@xp\GRP@queue + \@xp\@elt\@xp{\EQ@trial}% + }% + \global\setbox\GRP@box\vbox{% + \hbox{\box\EQ@box\box\EQ@copy\penalty\@ne\copy\EQ@numbox}% + \unvbox\GRP@box + }% + \global\let\GRP@top\@False + \EQ@trial + \if\eq@isIntertext\else + \ifdim\eq@wdL>\grp@wdL \global\grp@wdL\eq@wdL \fi + \ifdim\eq@wdT>\grp@wdT \global\grp@wdT\eq@wdT \fi + \setlength\dim@a{\eq@wdT-\eq@wdL}% + \ifdim\dim@a>\grp@wdR \global\grp@wdR\dim@a \fi + \ifdim\eq@linewidth>\grp@linewidth \global\grp@linewidth\eq@linewidth\fi + \if\eq@hasNumber + \global\let\grp@eqs@numbered\@True + \ifdim\eq@wdNum>\grp@wdNum\global\grp@wdNum\eq@wdNum\fi + \fi + \if\EQ@hasLHS\else\global\let\grp@aligned\@False\fi + \if D\eq@layout \global\let\grp@aligned\@False\fi % Layout D (usually) puts rel on 2nd line. + \if\eq@shiftnumber\global\let\grp@shiftnumber\@True\fi % One eq shifted forces all. + \fi +} +\def\grp@finish{% + \setlength\dim@a{\grp@wdL+\grp@wdR-4em}% Allowance for shrink? + \if\grp@aligned\ifdim\dim@a>\grp@linewidth + \global\let\grp@aligned\@False + \fi\fi + \addtolength\dim@a{\grp@wdNum }% Effective length + \if\grp@shiftnumber\else\if\grp@hasNumber\if\grp@eqs@numbered\else\ifdim\dim@a>\grp@linewidth + \global\let\grp@shiftnumber\@True + \fi\fi\fi\fi + \if\grp@aligned + \global\grp@wdT\grp@wdL\global\advance\grp@wdT\grp@wdR + \fi + \debugmsg{======= DGROUP Formatting + ^^J||===== \grp@wdL=\the\grp@wdL, \grp@wdR=\the\grp@wdR + ^^J||===== Shift Number=\theb@@le\grp@shiftnumber, Eqns. numbered=\theb@@le\grp@eqs@numbered + ^^J||===== Aligned=\theb@@le\grp@aligned + ^^J||===== \grp@wdNum=\the\grp@wdNum}% + \setbox\GRP@wholebox\vbox{% + \let\@elt\eqgrp@elt + \the\GRP@queue + }% + \eq@topspace{\vskip\parskip}% + \if\grp@hasNumber\if\grp@eqs@numbered\else + \if\grp@shiftnumber + \copy\GRP@numbox \penalty\@M + \kern\eqlineskip + \else + \setlength\dim@a{% + (\ht\GRP@wholebox+\dp\GRP@wholebox+\ht\GRP@numbox-\dp\GRP@numbox)/2}% + \setlength\skip@c{\dim@a-\ht\GRP@numbox}% + \vglue\skip@c% NON discardable + \copy\GRP@numbox \penalty\@M +\debugmsg{GROUP NUMBER: preskip:\the\skip@c, postkern:\the\dim@a, height:\the\ht\GRP@wholebox, + ^^J||===== box height:\the\ht\GRP@numbox, box depth:\the\dp\GRP@numbox}% + \kern-\dim@a + \kern-\abovedisplayskip % To cancel the topspace above the first eqn. + \fi + \fi\fi + \unvbox\GRP@wholebox + \let\@elt\relax + \eq@botspace % not needed unless bottom number? +} +\def\eqgrp@elt#1{% + \global\setbox\GRP@box\vbox{% + \unvbox\GRP@box + \setbox\z@\lastbox + \setbox\tw@\hbox{\unhbox\z@ + \ifnum\lastpenalty=\@ne + \else + \global\setbox\EQ@numbox\lastbox + \fi + \unpenalty + \global\setbox\EQ@copy\lastbox + \global\setbox\EQ@box\lastbox + }% + }% + \begingroup \let\eq@botspace\relax + #1% + \if\eq@isIntertext + \vskip\belowdisplayskip + \unvbox\EQ@copy + \else + \grp@override + \eq@finish + \fi + \endgroup +} +\def\grp@override{% + \def\eqindent{I}% + \setlength\dim@a{(\grp@linewidth-\grp@wdT)/2}% + \ifdim\dim@a<\z@\dim@a=\z@\fi + \dim@b\if L\eqnumside\grp@wdNum\else\z@\fi + \if\grp@shiftnumber\else + \ifdim\dim@b>\dim@a\dim@a\dim@b\fi + \fi + \if\grp@aligned + \addtolength\dim@a{\grp@wdL-\eq@wdL}% + \fi + \mathindent\dim@a + \ifdim\dim@b>\dim@a + \let\eq@shiftnumber\@True + \fi +} +\newskip\darraycolsep \darraycolsep 20pt plus1fil minus12pt +\newcount\cur@row \newcount\cur@col +\def\@tempa#1#2#3{% + \cur@col#1 \hfil + \setbox\z@\hbox{$\displaystyle####\m@th$}\@nx\col@box + \tabskip\z@skip + &\cur@col#2 \hfil + \setbox\z@\hbox{$\displaystyle\mathord{}####\mathord{}\m@th$}\@nx\col@box + \hfil + &\cur@col#3 \setbox\z@\hbox{$\displaystyle####\m@th$}\@nx\col@box + \hfil\tabskip\darraycolsep +} +\xdef\darray@preamble{% + \@tempa 123&\@tempa 456&\@tempa 789% + &\@tempa{10}{11}{12}&\@tempa{13}{14}{15}&\@tempa{16}{17}{18}% + \cr +} +\@ifundefined{Mathstrut@}{\let\Mathstrut@\strut}{} +\def\darray@cr{\Mathstrut@\cr} +\def\col@box{% + \unhbox\z@ +} +\newenvironment{darray}{\@optarg\@darray{}}{} +\def\@darray[#1]{% + \debugmsg{=== DARRAY ==================================================}% + \if\eq@group\else\eq@prelim\fi + \global\let\@preamble\@empty + \setkeys{breqn}{#1}% + \the\eqstyle \eq@setnumber + \ifx\@preamble\@empty \global\let\@preamble\darray@preamble \fi + \check@mathfonts + % \let\check@mathfonts\relax % tempting, but too risky + \@xp\let\csname\string\ \endcsname\darray@cr + \setbox\z@\vbox\bgroup + \everycr{\noalign{\global\advance\cur@row\@ne}}% + \tabskip\z@skip \cur@col\z@ + \global\cur@row\z@ + \penalty\@ne % flag for \dar@repack + \halign\@xp\bgroup\@preamble +} +\def\enddarray#1{\check@punct@or@qed} +\def\end@darray{% + \ifvmode\else \eq@addpunct \Mathstrut@\fi\crcr \egroup + \dar@capture + \egroup +} +\def\dar@capture{% +%% \showboxbreadth\maxdimen\showboxdepth99\showlists + \eq@wdL\z@ \eq@wdRmax\z@ + \dar@repack +} +\def\dar@repack{% + \unpenalty + \setbox\tw@\lastbox + \global\setbox\EQ@box\hbox{% + \hbox{\unhcopy\tw@\unskip}\penalty-\@M \unhbox\EQ@box}% + \global\setbox\EQ@copy\hbox{% + \hbox{\unhbox\tw@\unskip}\penalty-\@M \unhbox\EQ@copy}% + \unskip + \ifcase\lastpenalty \else\@xp\@gobble\fi + \dar@repack +} +\newskip\conditionsep \conditionsep=10pt minus5pt% +\newcommand{\conditionpunct}{,} +\let\cond@gobble\@firstofone +\newcommand\condition{% + \begingroup\@tempswatrue + \@ifstar{\@tempswafalse \condition@a}\condition@a +} +\newcommand\condition@a[2][\conditionpunct]{% + \unpenalty\unskip\unpenalty\unskip % BRM Added + \hbox{#1}% + \penalty -201\relax\hbox{}% Penalty to allow breaks here. + \hskip\conditionsep + \if@tempswa \@xp\hbox \else \@xp\condition@b\fi + {#2}% + \endgroup + \setbox\z@\if@tempswa\hbox{#2}\else\hbox{\textmath@setup #2}\fi + \global\eq@wdCond\wd\z@ + \let\cond@gobble\@gobble +} +\newcommand\condition@b[1]{% + \cond@gobble{\hskip\conditionsep}% + \textmath@setup #1% +} +\newenvironment{XXXXdsuspend}{% + \global\setbox\EQ@box\vbox\bgroup \@parboxrestore + \parshape 1 \displayindent \displaywidth\relax + \hsize=\columnwidth \noindent\ignorespaces +}{% + \par\egroup + \global\setbox\GRP@box\vbox{% + \vbox{\copy\EQ@box\vtop{\unvbox\EQ@box}}% + \unvbox\GRP@box + }% + \global\GRP@queue\@xp{\the\GRP@queue + \@elt{\gdef\EQ@trial{}}% + }% +} +\newenvironment{dsuspend}{% + \global\setbox\EQ@box\vbox\bgroup \@parboxrestore + \parshape 1 \displayindent \displaywidth\relax + \hsize=\columnwidth \noindent\ignorespaces +}{% + \par\egroup + \global\setbox\GRP@box\vbox{% + \hbox{\copy\EQ@box\vtop{\unvbox\EQ@box}}% + \unvbox\GRP@box + }% + \global\GRP@queue\@xp{\the\GRP@queue + \@elt{\let\eq@isIntertext\@True}% + }% +} +\newcommand\breqn@intertext[1]{\dsuspend#1\enddsuspend} +\renewcommand{\*}{% + \if@display + \setbox\z@\hbox{\mathsurround\z@$\mkern\eq@binoffset$}% + \discretionary{}{% + \kern\the\wd\z@ \textchar\discretionarytimes + }{}% + \thinspace + \else + \discretionary{\thinspace\textchar\discretionarytimes}{}{}% + \fi +} +\newcommand{\discretionarytimes}{\times} +\def\nref#1{\@xp\@nref\csname r@#1\endcsname} +\def\@nref#1#2{\ifx\relax#1??\else \@xp\@firstoftwo#1\fi} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +%% +%% End of file `breqn.sty'. diff --git a/Master/texmf-dist/tex/latex/mh/empheq.sty b/Master/texmf-dist/tex/latex/mh/empheq.sty index 94d5f2bf8b9..f2d447b513b 100644 --- a/Master/texmf-dist/tex/latex/mh/empheq.sty +++ b/Master/texmf-dist/tex/latex/mh/empheq.sty @@ -4,28 +4,30 @@ %% %% The original source files were: %% -%% empheq.dtx (with options: `empheq') +%% empheq.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 is a generated file. +%% +%% Copyright (C) 2002-2007 by Morten Hoegholm <mh.ctan@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status "maintained". %% -%% The Current Maintainer of this work is Morten H\o gholm. +%% This Current Maintainer of this work is Morten Hoegholm. %% -%% This work consists of the files empheq.dtx and empheq.ins and the -%% derived files empheq.sty and ntheorem.fix +%% This work consists of the main source file empheq.dtx +%% and the derived files +%% empheq.sty, empheq.pdf, empheq.ins, empheq.drv. %% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{empheq} - [2004/10/10 v2.11a - Emphasizing equations (MH) - ] +\ProvidesPackage{empheq}% + [2007/12/03 v2.12 Emphasizing equations (MH)] \RequirePackage{mhsetup}[2004/10/10] \MHInternalSyntaxOn \MH_new_boolean:n {overload_ams} @@ -40,7 +42,8 @@ \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}}} +\gdef\g@EQ@ntheorem@support@bool{01} +\DeclareOption{ntheorem}{\gdef\g@EQ@ntheorem@support@bool{00}} \DeclareOption*{ \PassOptionsToPackage{\CurrentOption}{mathtools} } @@ -840,6 +843,12 @@ \g@addto@macro\EQ_typeset_display_hook:{ \MH_let:NwN \hyper@refstepcounter\@gobble } + \g@addto@macro\EQ_typeset_display_hook:{ + \let\NCC@ignorepar\relax + } + \g@addto@macro\EQ_typeset_tags_hook:{ + \let\NCC@ignorepar\relax + } \g@addto@macro\EQ_typeset_tags_hook:{ \MH_let:NwN\TagsPlusEndmarks\relax \MH_let:NwN\RestoreTags\relax @@ -980,6 +989,382 @@ } } } +\if\g@EQ@ntheorem@support@bool +\else + \expandafter\endinput +\fi +\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 `empheq.sty'. diff --git a/Master/texmf-dist/tex/latex/mh/empheq07.sty b/Master/texmf-dist/tex/latex/mh/empheq07.sty index 2ca5134e715..581acf10a6c 100644 --- a/Master/texmf-dist/tex/latex/mh/empheq07.sty +++ b/Master/texmf-dist/tex/latex/mh/empheq07.sty @@ -6,24 +6,28 @@ %% %% 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 is a generated file. +%% +%% Copyright (C) 2002-2007 by Morten Hoegholm <mh.ctan@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status "maintained". %% -%% The Current Maintainer of this work is Morten H\o gholm. +%% This Current Maintainer of this work is Morten Hoegholm. %% -%% This work consists of the files empheq07.dtx and empheq07.ins and -%% the derived file empheq07.sty. +%% This work consists of the main source file empheq07.dtx +%% and the derived files +%% empheq07.sty, empheq07.pdf, empheq07.ins, empheq07.drv. %% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{empheq07} - [2004/07/27 v0.7d Emphasizing equations (MH)] +\ProvidesPackage{empheq07}% + [2007/12/03 v0.7e Emphasizing equations (MH)] \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}} \ProcessOptions\relax \RequirePackage{amsmath}[2000/07/18] diff --git a/Master/texmf-dist/tex/latex/mh/flexisym.sty b/Master/texmf-dist/tex/latex/mh/flexisym.sty new file mode 100644 index 00000000000..6d41ac66367 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mh/flexisym.sty @@ -0,0 +1,293 @@ +%% +%% This is file `flexisym.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% flexisym.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 1997-2003 by Michael J. Downes +%% Copyright (C) 2007 by Morten Hoegholm <mh.ctan@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Morten Hoegholm. +%% +%% This work consists of the main source file flexisym.dtx +%% and the derived files +%% flexisym.sty, flexisym.pdf, flexisym.ins, flexisym.drv, +%% cmbase.sym, mathpazo.sym, mathptmx.sym, msabm.sym. +%% +\ProvidesPackage{flexisym}[2007/12/10 v0.95] +\let\@xp\expandafter \let\@nx\noexpand +\edef\do{% + \@nx\AtEndOfPackage{% + \catcode\number`\"=\number\catcode`\" + \relax + }% +} +\do \let\do\relax +\catcode`\"=12 +\let\@sym\@gobble +\DeclareOption{robust}{% + \def\@sym#1{% + \ifx\protect\@typeset@protect \else\protect#1\@xp\@gobblefour\fi + }% +} +\def\mg@bin{2}% binary operators +\def\mg@rel{2}% relations +%%\def\mg@nre{B}% negated relations +\def\mg@del{3}% delimiters +%%\def\mg@arr{B}% arrows +\def\mg@acc{0}% accents +\def\mg@cop{3}% cumulative operators (sum, int) +\def\mg@latin{1}% (Latin) letters +\def\mg@greek{1}% (lowercase) Greek +\def\mg@Greek{0}% (capital) Greek +%%\def\mg@bflatin{4}% bold upright Latin letters ? +%%\def\mg@Bbb{B}% blackboard bold +\def\mg@cal{2}% script/calligraphic +%%\def\mg@frak{5}% Fraktur letters +\def\mg@digit{0}% decimal digits % 1 = oldstyle, 0 = capital +\expandafter\let\csname MathChar \endcsname\mathchar +\expandafter\let\csname Delimiter \endcsname\delimiter +\expandafter\let\csname Radical \endcsname\radical +\newcommand{\MathChar}{} +\edef\MathChar{\csname MathChar \endcsname\noexpand\string} +\newcommand{\Delimiter}{} +\edef\Delimiter{\csname Delimiter \endcsname\noexpand\string} +\newcommand{\Radical}{} +\edef\Radical{\csname Radical \endcsname\noexpand\string} +\let\sumlimits\displaylimits +\let\intlimits\nolimits +\let\namelimits\displaylimits +\edef\m@Ord#1#2#3{\csname MathChar \endcsname"0#1#2#3 } +\edef\m@Var#1#2#3{\csname MathChar \endcsname"7#1#2#3 } +\edef\m@Bin#1#2#3{\csname MathChar \endcsname"2#1#2#3 } +\edef\m@Rel#1#2#3{\csname MathChar \endcsname"3#1#2#3 } +\edef\m@Pun#1#2#3{\csname MathChar \endcsname"6#1#2#3 } +\edef\m@COs#1#2#3{\csname MathChar \endcsname"1#1#2#3 \sumlimits} +\edef\m@COi#1#2#3{\csname MathChar \endcsname"1#1#2#3 \intlimits} +\def\delim@a#1#2#3#4{\ifx\relax#1#2#3#4\else#1\fi #2#3#4} +\def\delim@b#1#2#3#4{\ifx\relax#1#2#3#4\else#1\fi } +\def\@tempa{% + \@nx\@xp\@nx\delim@a\@nx\csname sd@##1##2##3\@nx\endcsname ##1##2##3 } +\edef\m@DeL#1#2#3{\csname Delimiter \endcsname"4\@tempa} +\edef\m@DeR#1#2#3{\csname Delimiter \endcsname"5\@tempa} +\edef\m@DeB#1#2#3{\csname Delimiter \endcsname"0\@tempa} +\edef\m@DeA#1#2#3{\csname Delimiter \endcsname"3\@tempa} +\edef\m@Rad#1#2#3{\csname Radical \endcsname"\@tempa} +\def\do#1#2{\@xp\def\csname sd@#1\endcsname{#2}} +\do{300}{028} +\do{301}{029} +\do{302}{05B} +\do{303}{05D} +\do{304}{262} +\do{305}{263} +\do{306}{264} +\do{307}{265} +\do{308}{266} +\do{309}{267} +\do{30A}{268} +\do{30B}{269} +\do{30C}{26A} +\do{30D}{26B} +\do{30E}{13D} +\do{30F}{26E} +\do{340}{37A} +\do{341}{37B} +\do{33A}{33A} +\do{33B}{33B} +\do{33E}{33E} +\do{33C}{26A} +\do{33D}{26B} +\do{378}{222} +\do{379}{223} +\do{33F}{26C} +\do{37E}{22A} +\do{37F}{22B} +\do{377}{26D} +\do{30F}{26E} +\def\m@Acc#1#2#3#4{\mathaccent"#1#2#3{#4}} +\def\@symAcc{\@sym} +\let\@symtype\@firstofone +\def\@symOrd#1#2{\@symtype\mathord{\OrdSymbol{#2}}} +\def\@symVar{\@symOrd} +\def\@symBin#1#2{\@symtype\mathbin{\OrdSymbol{#2}}} +\def\@symRel#1#2{\@symtype\mathrel{\OrdSymbol{#2}}} +\def\@symPun#1#2{\@symtype\mathpunct{\OrdSymbol{#2}}} +\def\@symCOi#1#2{\@symtype{\mathop{\OrdSymbol{#2}}\intlimits}} +\def\@symCOs#1#2{\@symtype{\mathop{\OrdSymbol{#2}}\sumlimits}} +\def\@symOpe#1#2{\@symtype\mathopen{\OrdSymbol{#2}}} +\def\@symClo#1#2{\@symtype\mathclose{\OrdSymbol{#2}}} +\def\@symDeL#1#2{\@symtype\mathopen{\OrdSymbol{#2}}} +\def\@symDeR#1#2{\@symtype\mathclose{\OrdSymbol{#2}}} +\def\@symDeB#1#2{\@symtype\mathord{\OrdSymbol{#2}}} +\def\@symInn#1#2{\@symtype\mathinner{\OrdSymbol{#2}}} +\def\@xnce#1{\@xp\@nx\csname#1\endcsname} +\let\sym@global\global +\def\DeclareFlexSymbol#1#2#3#4{% + \begingroup + \edef\@tempb{\@nx\@sym\@nx#1\@xnce{m@#2}\@xnce{mg@#3}#4}% + \ifcat\@nx#1\relax + \sym@global\let#1\@tempb + \else + \sym@global\mathcode`#1="8000\relax + \lccode`\~=`#1\relax + \lowercase{\sym@global\let~\@tempb}% + \fi + \endgroup +} +\def\DeclareFlexCompoundSymbol#1#2#3{% + \@xp\DeclareRobustCommand\@xp#1\@xp{\csname @sym#2\endcsname#1{#3}}% + \sym@global\let#1#1\relax +} +\DeclareRobustCommand\textchar{\text@char\textfont} +\DeclareRobustCommand\scriptchar{\text@char\scriptfont}% +\def\text@char@a{\?\endgroup}% +\def\text@char@sym#1#2#3{% + \begingroup + \let\@sym\relax % defense against infinite loops + \the\text@script@char#3% + \afterassignment\text@char@a + \chardef\?="% +} +\def\text@char#1#2{\begingroup\check@mathfonts + \let\text@script@char#1\let\@sym\text@char@sym + \let\@symtype\@secondoftwo \let\OrdSymbol\@firstofone + \let\ifmmode\iftrue \everymath{$\@gobble}%$ + \def\mkern{\muskip\z@}\let\mskip\mkern + \ifcat\relax\noexpand#2#2% + \else + \lccode`\~=\expandafter`\string#2\relax + \lowercase{~}% + \fi + \endgroup +} +\providecommand\textprime{} +\DeclareRobustCommand\textprime{\leavevmode + \raise.8ex\hbox{\text@char\scriptfont\prime}% +} +\@ifundefined{resetMathstrut@}{}{% + \def\resetMathstrut@{% + \setbox\z@\hbox{\textchar\vert}% + \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@ + }% +} +\@ifundefined{rightarrowfill@}{}{% + \def\rightarrowfill@#1{\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ + $#1\copy\z@\mkern-6mu\cleaders + \hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill + \mkern-6mu\OrdSymbol{\rightarrow}$} + \def\leftarrowfill@#1{\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ + $#1\OrdSymbol{\leftarrow}\mkern-6mu\cleaders + \hbox{$#1\mkern-2mu\copy\z@\mkern-2mu$}\hfill + \mkern-6mu\box\z@$} + \def\leftrightarrowfill@#1{\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ + $#1\OrdSymbol{\leftarrow}\mkern-6mu\cleaders + \hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill + \mkern-6mu\OrdSymbol{\rightarrow}$} +} +\def\binrel@sym#1#2#3#4#5{% + \xdef\binrel@@##1{% + \ifx\m@Ord#2\@nx\@symOrd + \else\ifx\m@Var#2\@nx\@symVar + \else\ifx\m@COs#2\@nx\@symCOs + \else\ifx\m@COi#2\@nx\@symCOi + \else\ifx\m@Bin#2\@nx\@symBin + \else\ifx\m@Rel#2\@nx\@symRel + \else\ifx\m@Pun#2\@nx\@symPun + \else\@nx\@symErr \fi\fi\fi\fi\fi\fi\fi + ?{\@nx\OrdSymbol{##1}}}% +} +\def\binrel@a{% + \def\@symOrd##1##2{\gdef\binrel@@####1{\@symOrd##1{\OrdSymbol{####1}}}}% + \def\@symVar##1##2{\gdef\binrel@@####1{\@symVar##1{\OrdSymbol{####1}}}}% + \def\@symCOs##1##2{\gdef\binrel@@####1{\@symCOs##1{\OrdSymbol{####1}}}}% + \def\@symCOi##1##2{\gdef\binrel@@####1{\@symCOi##1{\OrdSymbol{####1}}}}% + \def\@symBin##1##2{\gdef\binrel@@####1{\@symBin##1{\OrdSymbol{####1}}}}% + \def\@symRel##1##2{\gdef\binrel@@####1{\@symRel##1{\OrdSymbol{####1}}}}% + \def\@symPun##1##2{\gdef\binrel@@####1{\@symPun##1{\OrdSymbol{####1}}}}% +} +\def\binrel@#1{% + \setbox\z@\hbox{$% + \let\mathchoice\@gobblethree + \let\@sym\binrel@sym \binrel@a + #1$}% +} +\def\@symextension{sym} +\newcommand\usesymbols[1]{% + \@for\@tempb:=#1\do{% + \@xp\@onefilewithoptions\@xp{\@tempb}[][]\@symextension + }% +} +\newcommand\ProvidesSymbols[1]{\ProvidesFile{#1.sym}} +\DeclareRobustCommand{\not}[1]{\@symRel\not{\OrdSymbol{\notRel#1}}} +\DeclareRobustCommand{\OrdSymbol}[1]{% + \begingroup\mathchars@reset#1\endgroup +} +\def\mathchars@reset{\let\@sym\@sym@ord \let\@symtype\@symtype@ord + \let\OrdSymbol\relax} +\def\@symtype@ord#1#{}% a strange sort of \@gobble +\def\@sym@ord#1#2{\@xp\@sym@ord@a\string#2\@nil}% +\begingroup +\lccode`\.=`\@ \lowercase{\endgroup +\def\@sym@ord@a#1.}#2#3\@nil#4#5#6{% + \csname MathChar \endcsname"0% + \if D#2\@xp\delim@b\csname sd@#4#5#6\endcsname#4#5#6 + \else #4#5#6 + \fi +} +\@ifpackageloaded{amsmath}{% + \begingroup + \long\def\next#1\mathchardef\std@minus\mathcode`\-\relax + \mathchardef\std@equal\mathcode`\=\relax#2\flexi@stop{% + \toks@{#1#2}% + \xdef\@begindocumenthook{\the\toks@}% + }% + \expandafter\next\@begindocumenthook\flexi@stop + \endgroup +}{} +\AtBeginDocument{% +\def\newmcodes@{% + \mathcode `\'39\mathcode `\*42\mathcode `\."613A + \ifnum\mathcode`\-=45 + \else + \ifnum\mathcode`\-=32768 + \else + \mathchardef \std@minus \mathcode `\-\relax + \fi + \fi + \mathcode `\-45 \mathcode `\/47\mathcode `\:"603A\relax +} +} +\DeclareOption{cmbase}{\usesymbols{cmbase}} +\DeclareOption{mathpazo}{\usesymbols{mathpazo}} +\DeclareOption{mathptmx}{\usesymbols{mathptmx}} +\ProcessOptions\relax +\renewcommand{\lnot}{\neg} +\renewcommand{\land}{\wedge} +\renewcommand{\lor}{\vee} +\renewcommand{\le}{\leq} +\renewcommand{\ge}{\geq} +\renewcommand{\ne}{\neq} +\renewcommand{\owns}{\ni} +\renewcommand{\gets}{\leftarrow} +\renewcommand{\to}{\rightarrow} +\renewcommand{\|}{\Vert} +\@ifpackagewith{flexisym}{mathstyleoff}{}{% + \RequirePackage[activechars]{mathstyle}\relax +} +\endinput +%% +%% End of file `flexisym.sty'. diff --git a/Master/texmf-dist/tex/latex/mh/mathstyle.sty b/Master/texmf-dist/tex/latex/mh/mathstyle.sty new file mode 100644 index 00000000000..f95e9ad2a22 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mh/mathstyle.sty @@ -0,0 +1,161 @@ +%% +%% This is file `mathstyle.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mathstyle.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 1997-2003 by Michael J. Downes +%% Copyright (C) 2007 by Morten Hoegholm <mh.ctan@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Morten Hoegholm. +%% +%% This work consists of the main source file mathstyle.dtx +%% and the derived files +%% mathstyle.sty, mathstyle.pdf, mathstyle.ins, mathstyle.drv. +%% +\ProvidesPackage{mathstyle}[2007/12/10 v0.83] +\providecommand\@saveprimitive[2]{% + \begingroup + \edef\@tempa{\string#1}\edef\@tempb{\meaning#1}% + \ifx\@tempa\@tempb \global\let#2#1% + \else + \edef\@tempb{\meaning#2}% + \ifx\@tempa\@tempb + \else \@saveprimitive@a#1#2% + \fi + \fi + \endgroup +} +\providecommand\@saveprimitive@a[2]{% + \begingroup + \def\@tempb##1#1##2{\edef\@tempb{##2}\@car{}}% + \@tempb\nullfont{select font nullfont}% + \topmark{\string\topmark:}% + \firstmark{\string\firstmark:}% + \botmark{\string\botmark:}% + \splitfirstmark{\string\splitfirstmark:}% + \splitbotmark{\string\splitbotmark:}% + #1{\string#1}% + \edef\@tempa{\expandafter\strip@prefix\meaning\@tempb}% + \edef\@tempb{\meaning#1}% + \ifx\@tempa\@tempb \global\let#2#1% + \else + \PackageError{mathstyle}% + {Unable to properly define \string#2; primitive + \noexpand#1no longer primitive}\@eha + \fi + \fi + \endgroup +} +\chardef\mathstyle=\z@ +\@saveprimitive\displaystyle\@@displaystyle +\@saveprimitive\textstyle\@@textstyle +\@saveprimitive\scriptstyle\@@scriptstyle +\@saveprimitive\scriptscriptstyle\@@scriptscriptstyle +\@saveprimitive\mathchoice\@@mathchoice +\@saveprimitive\over\@@over +\@saveprimitive\atop\@@atop +\@saveprimitive\above\@@above +\@saveprimitive\overwithdelims\@@overwithdelims +\@saveprimitive\atopwithdelims\@@atopwithdelims +\@saveprimitive\abovewithdelims\@@abovewithdelims +\DeclareRobustCommand{\displaystyle}{% + \@@displaystyle \chardef\mathstyle\z@} +\DeclareRobustCommand{\textstyle}{% + \@@textstyle \chardef\mathstyle\@ne} +\DeclareRobustCommand{\scriptstyle}{% + \@@scriptstyle \chardef\mathstyle\tw@} +\DeclareRobustCommand{\scriptscriptstyle}{% + \@@scriptscriptstyle \chardef\mathstyle\thr@@} +\begingroup \catcode`\^=7\relax \catcode`\_=8\relax % just in case +\lowercase{\endgroup +\let\@@superscript=^ \let\@@subscript=_ +}% +\def\subsupstyle{% + \ifnum\mathstyle<\tw@ \chardef\mathstyle\tw@ + \else \chardef\mathstyle\thr@@ + \fi +} +\let\mathsup=\@@superscript +\let\mathsub=\@@subscript +\def\sb#1{\mathsub{\protect\subsupstyle#1}}% +\def\sp#1{\mathsup{\protect\subsupstyle#1}}% +\def\mathchoice{% + \relax\ifcase\mathstyle + \expandafter\@firstoffour + \or + \expandafter\@secondoffour + \or + \expandafter\@thirdoffour + \else + \expandafter\@fourthoffour + \fi +} +\providecommand\@firstoffour[4]{#1} +\providecommand\@secondoffour[4]{#2} +\providecommand\@thirdoffour[4]{#3} +\providecommand\@fourthoffour[4]{#4} +\DeclareRobustCommand\genfrac[6]{% + {\fracstyle #1% + {\begingroup #5\endgroup + \csname @@\ifx\maxdimen#4\maxdimen over\else above\fi + \if @#2@\else withdelims\fi\endcsname #2#3#4\relax + #6}% + }% +} +\renewcommand{\frac}{\genfrac{}{}{}{}} +\providecommand{\dfrac}{} +\providecommand{\tfrac}{} +\renewcommand{\dfrac}{\genfrac\displaystyle{}{}{}} +\renewcommand{\tfrac}{\genfrac\textstyle{}{}{}} +\providecommand{\binom}{} +\providecommand{\tbinom}{} +\providecommand{\dbinom}{} +\renewcommand{\binom}{\genfrac{}(){0pt}} +\renewcommand{\dbinom}{\genfrac\displaystyle(){0pt}} +\renewcommand{\tbinom}{\genfrac\textstyle(){0pt}} +\def\fracstyle{\ifcase\mathstyle + \chardef\mathstyle=\@ne + \or + \chardef\mathstyle=\tw@ + \else + \chardef\mathstyle=\thr@@ + \fi +} +\def\currentmathstyle{% + \ifcase\mathstyle + \@@displaystyle + \or + \@@textstyle + \or + \@@scriptstyle + \or + \@@scriptscripstyle + \fi} +\DeclareOption{activechars}{\catcode`\^=13\relax \catcode`\_=13\relax } +\ProcessOptions\relax +\ifnum\catcode`\^=13\relax + \let^=\sp \let_=\sb +\else + \mathcode`\^="8000\relax \mathcode`\_="8000\relax + \begingroup \catcode`\^=\active \catcode`\_=\active + \global\let^=\sp \global\let_=\sb + \endgroup +\fi +\endinput +%% +%% End of file `mathstyle.sty'. diff --git a/Master/texmf-dist/tex/latex/mh/mathtools.sty b/Master/texmf-dist/tex/latex/mh/mathtools.sty index e91b6692726..aa4391daa6c 100644 --- a/Master/texmf-dist/tex/latex/mh/mathtools.sty +++ b/Master/texmf-dist/tex/latex/mh/mathtools.sty @@ -6,26 +6,30 @@ %% %% 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 is a generated file. +%% +%% Copyright (C) 2002-2007 by Morten Hoegholm <mh.ctan@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status "maintained". %% -%% The Current Maintainer of this work is Morten H\o gholm. +%% This Current Maintainer of this work is Morten Hoegholm. %% -%% This work consists of the files mathtools.dtx and mathtools.ins -%% and the derived file mathtools.sty. +%% This work consists of the main source file mathtools.dtx +%% and the derived files +%% mathtools.sty, mathtools.pdf, mathtools.ins, mathtools.drv. %% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{mathtools} - [2004/10/10 v1.01a mathematical typesetting tools (MH)] +\ProvidesPackage{mathtools}% + [2007/12/03 v1.03 mathematical typesetting tools (MH)] \RequirePackage{keyval,calc} -\RequirePackage{mhsetup}[2004/10/10] +\RequirePackage{mhsetup}[2007/12/03] \MHInternalSyntaxOn \def\MT_options_name:{mathtools} \newcommand*\mathtoolsset[1]{\setkeys{\MT_options_name:}{#1}} @@ -117,11 +121,11 @@ \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} } - } + \MH_if_boolean:nTF {manual_tag}% this was \MH_if_boolean:nT before + { \MH_if_boolean:nTF {show_manual_tags} + { \MT_prev_tagform:n {#1} } + { \stepcounter{equation} } + }{\kern1sp}% this last {\kern1sp} is new. \else: \MH_if_boolean:nTF {manual_tag} { \MH_if_boolean:nTF {show_manual_tags} @@ -255,9 +259,9 @@ \kern-\wd0 \lower.22ex\box0}} \providecommand*\xrightleftharpoons[2][]{\mathrel{% \raise.22ex\hbox{% - $\ext@arrow 3095\MT_rightharpoonup_fill:{\phantom{#1}}{#2}$}% + $\ext@arrow 0359\MT_rightharpoonup_fill:{\phantom{#1}}{#2}$}% \setbox0=\hbox{% - $\ext@arrow 0359\MT_leftharpoondown_fill:{#1}{\phantom{#2}}$}% + $\ext@arrow 3095\MT_leftharpoondown_fill:{#1}{\phantom{#2}}$}% \kern-\wd0 \lower.22ex\box0}} \providecommand*\xhookleftarrow[2][]{% \ext@arrow 3095\MT_hookleft_fill:{#1}{#2}} @@ -376,6 +380,7 @@ \providecommand*\colonsim{\vcentcolon\mkern-1.2mu\sim} \providecommand*\Colonsim{\dblcolon\mkern-1.2mu\sim} } +\let \AMS@math@cr@@ \math@cr@@ \MH_new_boolean:n {mult_firstline} \MH_new_boolean:n {outer_mult} \newcount\g_MT_multlinerow_int @@ -511,7 +516,7 @@ \MT_start_mult:N \MT_mult_default_pos: } \newenvironment{multlined}[1][] - { + {\MH_group_align_safe_begin: \MT_test_for_tcb_other:nnnnn {#1} {\def\MT_mult_default_pos:{#1}} {\def\MT_mult_default_pos:{#1}} @@ -525,7 +530,7 @@ \MT_multlined_second_arg:w } { - \hfilneg \endaligned + \hfilneg \endaligned \MH_group_align_safe_end: } \MHPrecedingSpacesOn \define@key{\MT_options_name:} @@ -545,14 +550,15 @@ \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 + \@namedef{MT_delim_\MH_cs_to_str:N #1 _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} + \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname + [2][\\@gobble] + { + \mathopen{\@nameuse {\MH_cs_to_str:N ##1 l} #2} ##2 + \mathclose{\@nameuse {\MH_cs_to_str:N ##1 r} #3}} \newcommand{#1}{ \@ifstar {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} @@ -560,31 +566,38 @@ } } } -\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_start_cases:nnn #1#2#3{ % #1=sep,#2=preamble,#3=delim + \RIfM@\else + \nonmatherr@{\begin{\@currenvir}} + \fi + \MH_group_align_safe_begin: + \left#3 + \vcenter \bgroup + \Let@ \chardef\dspbrk@context\@ne \restore@math@cr + \let \math@cr@@\AMS@math@cr@@ + \spread@equation + \ialign\bgroup + \strut@$\m@th \displaystyle{##}$\hfil \strut@ + #2 + \crcr +} +\def\MH_end_cases:{\crcr\egroup + \restorecolumn@ + \egroup + \MH_group_align_safe_end: +} +\newcommand*\newcases[5]{% #1=name, #2=sep, #3=preamble, #4=left, #5=right + \newenvironment{#1} + {\MT_start_cases:nnn {#2}{#3}{#4}} + {\MH_end_cases:\right#5} +} +\newcommand*\renewcases[5]{ + \renewenvironment{#1} + {\MT_start_cases:nnn {#2}{#3}{#4}} + {\MH_end_cases:\right#5} +} +\newcases{dcases}{\quad}{$\m@th\displaystyle{##}$\hfil}{\lbrace}{.} +\newcases{dcases*}{\quad}{{##}\hfil}{\lbrace}{.} \def\MT_matrix_begin:N #1{% \hskip -\arraycolsep \MH_let:NwN \@ifnextchar \MH_nospace_ifnextchar:Nnn diff --git a/Master/texmf-dist/tex/latex/mh/mhsetup.sty b/Master/texmf-dist/tex/latex/mh/mhsetup.sty index de71af7767c..e85b4b86b3a 100644 --- a/Master/texmf-dist/tex/latex/mh/mhsetup.sty +++ b/Master/texmf-dist/tex/latex/mh/mhsetup.sty @@ -6,24 +6,28 @@ %% %% 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 is a generated file. +%% +%% Copyright (C) 2002-2007 by Morten Hoegholm <mh.ctan@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. %% %% This work has the LPPL maintenance status "maintained". %% -%% The Current Maintainer of this work is Morten H\o gholm. +%% This Current Maintainer of this work is Morten Hoegholm. %% -%% This work consists of the files mhsetup.dtx and mhsetup.ins and -%% the derived file mhsetup.sty. +%% This work consists of the main source file mhsetup.dtx +%% and the derived files +%% mhsetup.sty, mhsetup.pdf, mhsetup.ins, mhsetup.drv. %% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{mhsetup} - [2004/10/10 v1.0b programming setup (MH)] +\ProvidesPackage{mhsetup}% + [2007/12/03 v1.2 programming setup (MH)] \def\MHInternalSyntaxOn{ \edef\MHInternalSyntaxOff{% \catcode`\noexpand\~=\the\catcode`\~\relax @@ -161,6 +165,8 @@ \providecommand*\MHPrecedingSpacesOn{ \MH_let:NwN \@xargdef \MH_kernel_xargdef:nwwn } +\def \MH_group_align_safe_begin: {\iffalse{\fi\ifnum0=`}\fi} +\def \MH_group_align_safe_end: {\ifnum0=`{}\fi} \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 deleted file mode 100644 index fb310ef9c57..00000000000 --- a/Master/texmf-dist/tex/latex/mh/ntheorem.fix +++ /dev/null @@ -1,402 +0,0 @@ -%% -%% 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'. |