1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
30 %%% From File: ltmath.dtx
32 %<leqno>\ProvidesFile{leqno.clo}
33 %<fleqn>\ProvidesFile{fleqn.clo}
34 %<leqno,fleqn> [1998/08/17 v1.1c Standard LaTeX option
35 %<leqno> (left equation numbers)]
36 %<fleqn> (flush left equations)]
40 \ProvidesFile{ltmath.dtx}
41 [2005/11/10 v1.1g LaTeX Kernel (Math Setup)]
46 \documentclass{ltxdoc}
47 \GetFileInfo{ltmath.dtx}
67 % \changes{v1.1b}{1996/07/26}{Removed \cs{global} before
68 % \cs{@ignoretrue} in various places.}
69 % \changes{v1.1c}{1998/08/17}{(RmS) Minor documentation fixes.}
70 % \changes{v1.1g}{2005/11/10}{(MH) Minor documentation fixes.}
72 % \section{Math setup}
74 % This file contains a lot of the original plain \TeX{} code, as well
75 % as the \LaTeX{} environments for math. It still needs sorting out.
81 \message{math definitions,}
86 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
87 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
88 %% Digits \0\1\2\3\4\5\6\7\8\9
89 %% Exclamation \! Double quote \" Hash (number) \#
90 %% Dollar \$ Percent \% Ampersand \&
91 %% Acute accent \' Left paren \( Right paren \)
92 %% Asterisk \* Plus \+ Comma \,
93 %% Minus \- Point \. Solidus \/
94 %% Colon \: Semicolon \; Less than \<
95 %% Equals \= Greater than \> Question mark \?
96 %% Commercial at \@ Left bracket \[ Backslash \\
97 %% Right bracket \] Circumflex \^ Underscore \_
98 %% Grave accent \` Left brace \{ Vertical bar \|
99 %% Right brace \} Tilde \~}
102 % \subsection{Math commands based on plain \TeX}
104 % \subsubsection{The log-like functions}
106 % \changes{1.0m}{1994/10/29}{ASAJ: Added \cs{DeclareMathOperator}.}
107 % \changes{v1.0o}{1994/11/17}
108 % {\cs{@tempa} to \cs{reserved@a}}
109 % \changes{1.0q}{1994/11/30}{ASAJ: \cs{DeclareMathOperator} moved to
111 % \changes{v1.0r}{1995/05/07}{Use \cs{hb@xt@}}
112 % \changes{v1.0r}{1995/05/21}{Update some plain macros}
113 % \changes{v1.0t}{1995/06/28}{minor doc edits}
115 % \begin{macro}{\log}
116 % The standard operators:
118 \def\log{\mathop{\operator@font log}\nolimits}
119 \def\lg{\mathop{\operator@font lg}\nolimits}
120 \def\ln{\mathop{\operator@font ln}\nolimits}
121 \def\lim{\mathop{\operator@font lim}}
122 \def\limsup{\mathop{\operator@font lim\,sup}}
123 \def\liminf{\mathop{\operator@font lim\,inf}}
124 \def\sin{\mathop{\operator@font sin}\nolimits}
125 \def\arcsin{\mathop{\operator@font arcsin}\nolimits}
126 \def\sinh{\mathop{\operator@font sinh}\nolimits}
127 \def\cos{\mathop{\operator@font cos}\nolimits}
128 \def\arccos{\mathop{\operator@font arccos}\nolimits}
129 \def\cosh{\mathop{\operator@font cosh}\nolimits}
130 \def\tan{\mathop{\operator@font tan}\nolimits}
131 \def\arctan{\mathop{\operator@font arctan}\nolimits}
132 \def\tanh{\mathop{\operator@font tanh}\nolimits}
133 \def\cot{\mathop{\operator@font cot}\nolimits}
134 \def\coth{\mathop{\operator@font coth}\nolimits}
135 \def\sec{\mathop{\operator@font sec}\nolimits}
136 \def\csc{\mathop{\operator@font csc}\nolimits}
137 \def\max{\mathop{\operator@font max}}
138 \def\min{\mathop{\operator@font min}}
139 \def\sup{\mathop{\operator@font sup}}
140 \def\inf{\mathop{\operator@font inf}}
141 \def\arg{\mathop{\operator@font arg}\nolimits}
142 \def\ker{\mathop{\operator@font ker}\nolimits}
143 \def\dim{\mathop{\operator@font dim}\nolimits}
144 \def\hom{\mathop{\operator@font hom}\nolimits}
145 \def\det{\mathop{\operator@font det}}
146 \def\exp{\mathop{\operator@font exp}\nolimits}
147 \def\Pr{\mathop{\operator@font Pr}}
148 \def\gcd{\mathop{\operator@font gcd}}
149 \def\deg{\mathop{\operator@font deg}\nolimits}
153 % \begin{macro}{\bmod}
154 % And some operators have to be done by hand:
157 \nonscript\mskip-\medmuskip\mkern5mu%
158 \mathbin{\operator@font mod}\penalty900\mkern5mu%
159 \nonscript\mskip-\medmuskip}
163 % \begin{macro}{\pmod}
166 \allowbreak\mkern18mu({\operator@font mod}\,\,#1)}
170 % \subsubsection{Biggggg}
172 % \begin{macro}{\big}
173 % Variants on |\big| and friends for use with delimiters:
175 \def\bigl{\mathopen\big}
176 \def\bigm{\mathrel\big}
177 \def\bigr{\mathclose\big}
178 \def\Bigl{\mathopen\Big}
179 \def\Bigm{\mathrel\Big}
180 \def\Bigr{\mathclose\Big}
181 \def\biggl{\mathopen\bigg}
182 \def\biggm{\mathrel\bigg}
183 \def\biggr{\mathclose\bigg}
184 \def\Biggl{\mathopen\Bigg}
185 \def\Biggm{\mathrel\Bigg}
186 \def\Biggr{\mathclose\Bigg}
190 % \subsubsection{The UNSORTED Rest}
192 % The other math commands are lifted from plain \TeX.
194 % \begin{macro}{\jot}
201 % \begin{macro}{\interdisplaylinepenalty}
203 \newcount\interdisplaylinepenalty
204 \interdisplaylinepenalty=100
208 % \begin{macro}{\choose}
210 \def\choose{\atopwithdelims()}
214 % \begin{macro}{\brack}
216 \def\brack{\atopwithdelims[]}
220 % \begin{macro}{\brace}
222 \def\brace{\atopwithdelims\{\}}
226 % \begin{macro}{\mathpalette}
228 \def\mathpalette#1#2{%
230 {#1\displaystyle{#2}}%
232 {#1\scriptstyle{#2}}%
233 {#1\scriptscriptstyle{#2}}}
237 % \begin{macro}{\root}
238 % \changes{v1.1d}{1997/01/08}
239 % {(DPC) Remove spurious space tokens from
240 % plain \TeX\ definition /2359}
241 % \begin{macro}{\rootbox}
242 % \begin{macro}{\r@@t}
243 % \changes{v1.0r}{1995/05/21}{Use \cs{sqrtsign} instead of
251 \setbox\rootbox\hbox{$\m@th\scriptscriptstyle{#1}$}%
257 \setbox\z@\hbox{$\m@th#1\sqrtsign{#2}$}%
258 \dimen@\ht\z@ \advance\dimen@-\dp\z@
259 \mkern5mu\raise.6\dimen@\copy\rootbox
266 % \begin{macro}{\phantom}
267 % \changes{v1.0p}{1994/11/18}
268 % {(DPC) use \cs{expandafter} instead of \cs{next}}
269 % \changes{v1.0p}{1994/11/18}
270 % {(DPC) colour support}
271 % \begin{macro}{\hphantom}
272 % \begin{macro}{\vphantom}
279 \def\vphantom{\v@true\h@false\ph@nt}
283 \def\hphantom{\v@false\h@true\ph@nt}
287 \def\phantom{\v@true\h@true\ph@nt}
293 \expandafter\mathpalette\expandafter\mathph@nt
295 \expandafter\makeph@nt
301 \setbox\z@\hbox{\color@begingroup#1\color@endgroup}\finph@nt}
306 \setbox\z@\hbox{$\m@th#1{#2}$}\finph@nt}
312 \ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@\fi
313 \ifh@ \wd\tw@\wd\z@\fi \box\tw@}
319 % \begin{macro}{\mathstrut}
321 \def\mathstrut{\vphantom(}
325 % \begin{macro}{\smash}
326 % \changes{v1.0p}{1994/11/18}
327 % {(DPC) use \cs{expandafter} instead of \cs{next}}
328 % \changes{v1.0p}{1994/11/18}
329 % {(DPC) colour support}
332 \relax % \relax, in case this comes first in \halign
334 \expandafter\mathpalette\expandafter\mathsm@sh
336 \expandafter\makesm@sh
342 \setbox\z@\hbox{\color@begingroup#1\color@endgroup}\finsm@sh}
344 \setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh}
345 \def\finsm@sh{\ht\z@\z@ \dp\z@\z@ \box\z@}
349 % \begin{macro}{\buildrel}
351 \def\buildrel#1\over#2{\mathrel{\mathop{\kern\z@#2}\limits^{#1}}}
356 % \begin{macro}{\cases}
357 % \changes{LaTeX2.09}{1991/08/14}
358 % {(RmS) inserted extra braces around entry for NFSS}
360 \def\cases#1{\left\{\,\vcenter{\normalbaselines\m@th
361 \ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\right.}
365 % \begin{macro}{\matrix}
367 \def\matrix#1{\null\,\vcenter{\normalbaselines\m@th
368 \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
369 \mathstrut\crcr\noalign{\kern-\baselineskip}
370 #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}
374 % \begin{macro}{\pmatrix}
376 \def\pmatrix#1{\left(\matrix{#1}\right)}
381 % \begin{macro}{\bordermatrix}
382 % \changes{LaTeX2e}{1994/01/25}{Removed \cs{p@renwd}.}
384 \def\bordermatrix#1{\begingroup \m@th
387 \def\cr{\crcr\noalign{\kern2\p@\global\let\cr\endline}}%
388 \ialign{$##$\hfil\kern2\p@\kern\@tempdima&\thinspace\hfil$##$\hfil
389 &&\quad\hfil$##$\hfil\crcr
390 \omit\strut\hfil\crcr\noalign{\kern-\baselineskip}%
391 #1\crcr\omit\strut\cr}}%
392 \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}%
393 \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}%
394 \setbox\tw@\hbox{$\kern\wd\@ne\kern-\@tempdima\left(\kern-\wd\@ne
395 \global\setbox\@ne\vbox{\box\@ne\kern2\p@}%
396 \vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip}\,\right)$}%
397 \null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup}
401 % \begin{macro}{\openup}
403 \def\openup{\afterassignment\@penup\dimen@}
407 \def\@penup{\advance\lineskip\dimen@
408 \advance\baselineskip\dimen@
409 \advance\lineskiplimit\dimen@}
413 % \begin{macro}{\displaylines}
419 \def\displ@y{\global\dt@ptrue\openup\jot\m@th
420 \everycr{\noalign{\ifdt@p \global\dt@pfalse \ifdim\prevdepth>-1000\p@
421 \vskip-\lineskiplimit \vskip\normallineskiplimit \fi
422 \else \penalty\interdisplaylinepenalty \fi}}}
426 \def\@lign{\tabskip\z@skip\everycr{}} % restore inside \displ@y
430 \def\displaylines#1{\displ@y \tabskip\z@skip
431 \halign{\hb@xt@\displaywidth{$\@lign\hfil\displaystyle##\hfil$}\crcr
436 % \changes{v1.0r}{1995/05/21}{Remove \cs{mathhexbox} from this file}
451 %\def\,{\mskip\thinmuskip} % already defined in ltspace
452 \def\>{\mskip\medmuskip}
453 \def\;{\mskip\thickmuskip}
454 \def\!{\mskip-\thinmuskip}
462 \def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}}
467 % Nickname for the medium space since |\>| is not available inside
474 % \begin{macro}{\active@math@prime}
475 % \changes{v1.1e}{1999/10/09}{Macro added, see PR 3104.}
476 % This is the definition of the active math prime.
478 \def\active@math@prime{^\bgroup\prim@s}
482 % \begin{macro}{\prime@s}
483 % \changes{v1.0p}{1994/11/18}
484 % {(DPC) use \cs{@let@token} instead of \cs{next}
485 % and \cs{expandafter} instead of \cs{nxt}}
486 % \changes{v1.1e}{1999/10/09}{Introduce \cs{active@math@prime}.}
488 {\catcode`\'=\active \global\let'\active@math@prime}
493 \prime\futurelet\@let@token\pr@m@s}
502 \expandafter\expandafter\expandafter\pr@@@t
510 \def\pr@@@s#1{\prim@s}
514 \def\pr@@@t#1#2{#2\egroup}
518 % \changes{v1.0i}{1994/05/17}{Replaced \cs{let} by \cs{gdef}, for
519 % indirect definition.}
521 {\catcode`\_=\active \gdef_{\_}} % _ in math is
522 % either subscript or \_
526 % \changes{v1.0m}{1994/10/29}{ASAJ: Removed \cs{dag}, \cs{ddag}.}
527 % \changes{v1.0m}{1994/10/29}{ASAJ: Renamed \cs{S} and \cs{P} to
528 % \cs{mathsection} and \cs{mathparagraph} and made them
529 % \cs{mathchardef}s.}
530 % \changes{v1.0m}{1994/10/29}{ASAJ: Added \cs{mathellipsis},
531 % \cs{mathdollar} and \cs{mathsterling}.}
532 % \changes{v1.0n}{1994/10/30}{ASAJ: Moved the new commands to ltoutenc.}
534 % \subsection{Math Environments}
536 % \changes{1.0m}{1994/10/29}{ASAJ: Tidied up documentation.}
540 % Produces |$...$| with checks that |\(| isn't used in math mode, and
541 % that |\)| is only used in math mode begun with |\(|.
543 \def\({\relax\ifmmode\@badmath\else$\fi}
544 \def\){\relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi}
550 % \changes{v1.1g}{2005/11/10}
551 % {(MH) Fixed potential problem in \cs{[} (pr/3399).}
553 % Produces |$$...$$| with checks that |\[| isn't used in math mode,
554 % and that |\]| is only used in math mode begun with |\]|.
562 \makebox[.6\linewidth]{}%
564 $$%%$$ BRACE MATCH HACK
575 $$%%$$ BRACE MATCH HACK
586 % \begin{environment}{math}
587 % \begin{environment}{displaymath}
588 % Disguises for |\(...\)| and |\[...\]|.
596 \def\enddisplaymath{\]\@ignoretrue}
602 % \begin{environment}{equation}
603 % \changes{LaTeX2.09}{1992/01/10}{RmS: put \cs{hbox} around \cs{@eqnnum}
604 % to typeset the equation number in text mode
605 % (as in the eqnarray env.)}
606 % \begin{macro}{\c@equation}
607 % Numbered equations, using the counter |\c@equation|.
608 % \emph{Note}: The document style must define |\theequation| etc., and
609 % do the appropriate |\@addtoreset|. It should also redefine |\@eqnnum|
610 % if another format for the equation number is desired other than the
611 % standard (...), or to move the equation numbers to the flushleft.
612 % (See comment on the |\def| of |\@eqnnum|.)
614 \@definecounter{equation}
615 \def\equation{$$\refstepcounter{equation}}
616 \def\endequation{\eqno \hbox{\@eqnnum}$$\@ignoretrue}
621 % \begin{macro}{\@eqnnum}
622 % \changes{LaTeX2.09}{1991/09/29}{RmS: \cs{reset@font} added.}
623 % \changes{v1.0l}{1994/10/23}{Added \cs{normalcolor} since \cs{eqno}
624 % introduces a subgroup of the displayed math group}
626 % Produces the equation number for equation and
627 % eqnarray environments. The following definition is for
628 % flushright numbers; for flushleft numbers, see leqno.clo.
629 % The equation number is set in black roman type even
630 % if an eqnarray environment appears in an italic environment.
631 % \changes{v1.0s}{1995/05/26}{Removed \cs{rmfamily} (PR 1578),
632 % replaced \cs{reset@font} with \cs{normalfont}}
634 \def\@eqnnum{{\normalfont \normalcolor (\theequation)}}
638 % \begin{macro}{\stackrel}
639 % A disguise for plain \TeX's buildrel.
641 \def\stackrel#1#2{\mathrel{\mathop{#2}\limits^{#1}}}
645 % \changes{v0.9g}{1993/12/11}{Added a group around the first argument
646 % of \cs{frac} to prevent
647 % changes (for example font changes) from modifying the contents of
648 % the second argument.}
650 % \begin{macro}{\frac}
651 % A disguise for plain \TeX's |\over|.
653 \def\frac#1#2{{\begingroup#1\endgroup\over#2}}
657 % \begin{macro}{\sqrt}
658 % \changes{v1.0y}{1995/10/16}{(DPC) Make robust /1808}
659 % \begin{macro}{\@sqrt}
660 % Add an optional argument to plain's |\sqrt| to give the $n$th root
661 % of an expression $\sqrt[n]{e}$.
662 % \changes{v1.0r}{1995/05/21}{Use \cs{sqrtsign}}
664 \DeclareRobustCommand\sqrt{\@ifnextchar[\@sqrt\sqrtsign}
665 \def\@sqrt[#1]{\root #1\of}
670 % \changes{LaTeX2.09}{1985/11/04}{produce warning message if line
671 % extends into margin. Doesn't warn about formula
672 % overprinting equation number.}
673 % \changes{LaTeX2.09}{1993/11/02}{RmS:
674 % Corrected description of \cs{@eqnsel}, moved \cs{@eqnsel}
675 % accordingly and removed extra \cs{tabskip} assignment.}
676 % \changes{LaTeX2e}{1993/11/03}{RmS: Initialized \cs{everycr} to empty}
677 % \changes{v0.9i}{1993/12/16}
678 % {use \cs{refstepcounter} instead of shortcut}
679 % \changes{v0.9o}{1994/01/13}{correcting 0.9i}
681 % \begin{environment}{eqnarray}
682 % \begin{macro}{\@eqcnt}
683 % \begin{macro}{\@eqpen}
684 % \begin{macro}{\if@eqnsw}
685 % \begin{macro}{\@eqnsel}
686 % Here's the eqnarray environment:
687 % Default is for left-hand side of equations to be flushright.
688 % To make them flushleft, |\let\@eqnsel = \hfil|.
692 \newif\if@eqnsw\@eqnswtrue
694 \@centering = 0pt plus 1000pt
696 % To get a proper \cs{@currentlabel} we have to redefine it for the
697 % whole display. Note that we can't use \cs{refstepcounter} as this
698 % results in |\@currentlabel| getting restored at the wrong and
699 % thus always writing the first label to the \texttt{.aux} file.
702 \stepcounter{equation}%
703 \def\@currentlabel{\p@equation\theequation}%
709 $$\everycr{}\halign to\displaywidth\bgroup
710 \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel
711 &\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}$\hfil
712 &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep
713 $\displaystyle{##}$\hfil\tabskip\@centering
714 &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
724 \global\advance\c@equation\m@ne
738 % \begin{macro}{\nonumber}
739 % Switches off equation numbering.
741 \def\nonumber{\global\@eqnswfalse}
745 % \begin{macro}{\@eqncr}
746 % \begin{macro}{\@xeqncr}
747 % \begin{macro}{\@yeqncr}
748 % \changes{v1.0y}{1995/10/16}{(DPC) Use \cs{@testopt} /1911}
753 \global\@eqpen\@M\@yeqncr
755 \global\@eqpen\interdisplaylinepenalty \@yeqncr
761 \def\@yeqncr{\@testopt\@xeqncr\z@skip}
768 \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}%
776 % \begin{macro}{\@@eqncr}
777 % \changes{v0.9i}{1993/12/16}{use \cs{refstepcounter} instead of shortcut}
778 % \changes{v0.9o}{1994/01/13}{correcting 0.9i}
781 \def\@@eqncr{\let\reserved@a\relax
782 \ifcase\@eqcnt \def\reserved@a{& & &}\or \def\reserved@a{& &}%
783 \or \def\reserved@a{&}\else
784 \let\reserved@a\@empty
785 \@latex@error{Too many columns in eqnarray environment}\@ehc\fi
786 \reserved@a \if@eqnsw\@eqnnum\stepcounter{equation}\fi
787 \global\@eqnswtrue\global\@eqcnt\z@\cr}
791 % \begin{environment}{eqnarray*}
792 % \begin{macro}{\@seqncr}
793 % Here's the eqnarray* environment:
799 \@namedef{eqnarray*}{\def\@eqncr{\nonumber\@seqncr}\eqnarray}
803 \@namedef{endeqnarray*}{\nonumber\endeqnarray}
808 % \begin{macro}{\lefteqn}
809 % |\lefteqn{FORMULA}| typesets |FORMULA| in display math style
810 % flushleft in a box of width zero.
811 % \changes{v1.0r}{1995/05/21}{Use \cs{rlap}}
813 \def\lefteqn#1{\rlap{$\displaystyle #1$}}
817 % \begin{macro}{\ensuremath}
818 % In math mode, |\ensuremath{text}| is equivalent to text; in LR or
819 % paragraph mode, it is equivalent to |$|text|$|.
820 % |\relax| is not needed
821 % in front of the |\ifmmode| as |\protect| will be |\let| to |\relax|.
822 % This version (due to Donald Arseneau) avoids duplicating its
823 % argument in the `then' and `else' part of the |\ifmath| which is
824 % necessary in nested `tabular' like environments. See amslatex/2104.
825 % \changes{v1.0k}{1994/05/16}
826 % {Use \cs{DeclareRobustCommand} and add extra braces in math mode}
827 % \changes{v1.0l}{1994/10/23}{Remove extra braces: but see p 168 of
829 % \changes{v1.1a}{1996/03/25}{Reimplement for amslatex/2104}
831 \DeclareRobustCommand{\ensuremath}{%
833 \expandafter\@firstofone
835 \expandafter\@ensuredmath
840 % \begin{macro}{\@ensuredmath}
841 % \changes{v1.1a}{1996/03/25}{Macro added for amslatex/2104}
842 % \changes{v1.1c}{1996/11/09}{Made long, as it was before. /2104}
843 % The |\relax| stops |\ensuremath{}| starting display math.
845 \long\def\@ensuredmath#1{$\relax#1$}
855 % \subsection{External options to the standard document classes}
857 % \changes{v1.0u}{1995/08/09}
858 % {Added code for class options leqno and fleqn}
860 % \subsubsection{Left equation numbering}
862 % \begin{macro}{\@eqnnum}
863 % To put the equation number on the left side of an equation we
864 % have to use a little trick. The number is shifted |\displaywidth|
865 % to the left inside a box of (approximately) zero width. This
866 % fails when the quation is too wide, the equation number than may
867 % overprint the equation itself.
868 % \changes{v1.2y classes}{1995/01/12}{Added \cs{normalcolor}}
869 % \changes{v1.3c classes}{1995/05/25}
870 % {replace \cs{reset@font}\cs{rmfamily} with \cs{normalfont}
874 \renewcommand\@eqnnum{\hb@xt@.01\p@{}%
875 \rlap{\normalfont\normalcolor
876 \hskip -\displaywidth(\theequation)}}
881 % \subsubsection{Flush left equations}
883 % To get the displayed math environments to print the contents
884 % flush left (with an indentation) we have to redefine all of
885 % \LaTeXe's displayed math environments.
887 % \begin{macro}{\mathindent}
888 % The amount of indentation of the equations is stored in a register.
893 % The setting of |\mathindent| has to be deferred until the class
894 % file has been processed, because |\leftmargini| is still 0pt
895 % wide at the moment \texttt{fleqn.clo} is read in.
896 % \changes{v1.0n classes}
897 % {1994/01/19}{Deferred setting of \cs{mathindent}}
898 % \changes{v1.2t classes}
899 % {1994/06/22}{Set \cs{mathindent} at the end of the
900 % class instead of at begin document}
902 \AtEndOfClass{\mathindent\leftmargini}
907 % Begin display math;
909 \renewcommand\[{\relax
913 \@beginparpenalty\predisplaypenalty
914 \@endparpenalty\postdisplaypenalty
916 \hb@xt@\linewidth\bgroup $\m@th\displaystyle %$
917 \hskip\mathindent\bgroup
925 \renewcommand\]{\relax
935 % \begin{environment}{equation}
936 % The \textsf{equation} environment
938 \renewenvironment{equation}%
939 {\@beginparpenalty\predisplaypenalty
940 \@endparpenalty\postdisplaypenalty
941 \refstepcounter{equation}%
942 \trivlist \item[]\leavevmode
943 \hb@xt@\linewidth\bgroup $\m@th% $
947 \displaywidth\linewidth\hbox{\@eqnnum}%
953 % \begin{environment}{eqnarray}
954 % The \textsf{eqnarray} environment
956 \renewenvironment{eqnarray}{%
957 \stepcounter{equation}%
958 \def\@currentlabel{\p@equation\theequation}%
959 \global\@eqnswtrue\m@th
963 \setlength\abovedisplayskip{\topsep}%
965 \addtolength\abovedisplayskip{\partopsep}%
968 % When the documentclass uses a non-zero |\parskip| setting the
969 % |\topsep| might have a negative value to compensate for
970 % that. Therefore we add |\parskip| to |\abovedisplayskip|.
971 % \changes{v1.2v classes}{1994/11/10}{Added value of \cs{parskip} to
972 % \cs{abovedisplayskip} to compensate for negative \cs{topsep}}
974 \addtolength\abovedisplayskip{\parskip}%
975 \setlength\belowdisplayskip{\abovedisplayskip}%
976 \setlength\belowdisplayshortskip{\abovedisplayskip}%
977 \setlength\abovedisplayshortskip{\abovedisplayskip}%
978 $$\everycr{}\halign to\linewidth% $$
981 $\displaystyle\tabskip\z@skip{##}$\@eqnsel&%
982 \global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}$\hfil&%
983 \global\@eqcnt\tw@ \hskip \tw@\arraycolsep
984 $\displaystyle{##}$\hfil \tabskip\@centering&%
986 \hb@xt@\z@\bgroup\hss##\egroup\tabskip\z@skip\cr}%
989 \global\advance\c@equation\m@ne$$% $$