1 % \iffalse meta-comment
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> [2015/03/31 v1.1i Standard LaTeX option
35 %<leqno> (left equation numbers)]
36 %<fleqn> (flush left equations)]
40 \ProvidesFile{ltmath.dtx}
41 [2015/03/11 v1.1i LaTeX Kernel (Math Setup)]
46 \documentclass{ltxdoc}
47 \GetFileInfo{ltmath.dtx}
59 \MaintainedByLaTeXTeam{latex}
68 % \changes{v1.1b}{1996/07/26}{Removed \cs{global} before
69 % \cs{@ignoretrue} in various places.}
70 % \changes{v1.1c}{1998/08/17}{(RmS) Minor documentation fixes.}
71 % \changes{v1.1g}{2005/11/10}{(MH) Minor documentation fixes.}
73 % \section{Math setup}
75 % This file contains a lot of the original plain \TeX{} code, as well
76 % as the \LaTeX{} environments for math. It still needs sorting out.
82 \message{math definitions,}
87 % {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
88 % 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
89 % Digits \0\1\2\3\4\5\6\7\8\9
90 % Exclamation \! Double quote \" Hash (number) \#
91 % Dollar \$ Percent \% Ampersand \&
92 % Acute accent \' Left paren \( Right paren \)
93 % Asterisk \* Plus \+ Comma \,
94 % Minus \- Point \. Solidus \/
95 % Colon \: Semicolon \; Less than \<
96 % Equals \= Greater than \> Question mark \?
97 % Commercial at \@ Left bracket \[ Backslash \\
98 % Right bracket \] Circumflex \^ Underscore \_
99 % Grave accent \` Left brace \{ Vertical bar \|
100 % Right brace \} Tilde \~}
103 % \subsection{Math commands based on plain \TeX}
105 % \subsubsection{The log-like functions}
107 % \changes{1.0m}{1994/10/29}{ASAJ: Added \cs{DeclareMathOperator}.}
108 % \changes{v1.0o}{1994/11/17}
109 % {\cs{@tempa} to \cs{reserved@a}}
110 % \changes{1.0q}{1994/11/30}{ASAJ: \cs{DeclareMathOperator} moved to
112 % \changes{v1.0r}{1995/05/07}{Use \cs{hb@xt@}}
113 % \changes{v1.0r}{1995/05/21}{Update some plain macros}
114 % \changes{v1.0t}{1995/06/28}{minor doc edits}
116 % \begin{macro}{\log}
117 % The standard operators:
119 \def\log{\mathop{\operator@font log}\nolimits}
120 \def\lg{\mathop{\operator@font lg}\nolimits}
121 \def\ln{\mathop{\operator@font ln}\nolimits}
122 \def\lim{\mathop{\operator@font lim}}
123 \def\limsup{\mathop{\operator@font lim\,sup}}
124 \def\liminf{\mathop{\operator@font lim\,inf}}
125 \def\sin{\mathop{\operator@font sin}\nolimits}
126 \def\arcsin{\mathop{\operator@font arcsin}\nolimits}
127 \def\sinh{\mathop{\operator@font sinh}\nolimits}
128 \def\cos{\mathop{\operator@font cos}\nolimits}
129 \def\arccos{\mathop{\operator@font arccos}\nolimits}
130 \def\cosh{\mathop{\operator@font cosh}\nolimits}
131 \def\tan{\mathop{\operator@font tan}\nolimits}
132 \def\arctan{\mathop{\operator@font arctan}\nolimits}
133 \def\tanh{\mathop{\operator@font tanh}\nolimits}
134 \def\cot{\mathop{\operator@font cot}\nolimits}
135 \def\coth{\mathop{\operator@font coth}\nolimits}
136 \def\sec{\mathop{\operator@font sec}\nolimits}
137 \def\csc{\mathop{\operator@font csc}\nolimits}
138 \def\max{\mathop{\operator@font max}}
139 \def\min{\mathop{\operator@font min}}
140 \def\sup{\mathop{\operator@font sup}}
141 \def\inf{\mathop{\operator@font inf}}
142 \def\arg{\mathop{\operator@font arg}\nolimits}
143 \def\ker{\mathop{\operator@font ker}\nolimits}
144 \def\dim{\mathop{\operator@font dim}\nolimits}
145 \def\hom{\mathop{\operator@font hom}\nolimits}
146 \def\det{\mathop{\operator@font det}}
147 \def\exp{\mathop{\operator@font exp}\nolimits}
148 \def\Pr{\mathop{\operator@font Pr}}
149 \def\gcd{\mathop{\operator@font gcd}}
150 \def\deg{\mathop{\operator@font deg}\nolimits}
154 % \begin{macro}{\bmod}
155 % And some operators have to be done by hand:
158 \nonscript\mskip-\medmuskip\mkern5mu%
159 \mathbin{\operator@font mod}\penalty900\mkern5mu%
160 \nonscript\mskip-\medmuskip}
164 % \begin{macro}{\pmod}
167 \allowbreak\mkern18mu({\operator@font mod}\,\,#1)}
171 % \subsubsection{Biggggg}
173 % \begin{macro}{\big}
174 % Variants on |\big| and friends for use with delimiters:
176 \def\bigl{\mathopen\big}
177 \def\bigm{\mathrel\big}
178 \def\bigr{\mathclose\big}
179 \def\Bigl{\mathopen\Big}
180 \def\Bigm{\mathrel\Big}
181 \def\Bigr{\mathclose\Big}
182 \def\biggl{\mathopen\bigg}
183 \def\biggm{\mathrel\bigg}
184 \def\biggr{\mathclose\bigg}
185 \def\Biggl{\mathopen\Bigg}
186 \def\Biggm{\mathrel\Bigg}
187 \def\Biggr{\mathclose\Bigg}
191 % \subsubsection{The UNSORTED Rest}
193 % The other math commands are lifted from plain \TeX.
195 % \begin{macro}{\jot}
202 % \begin{macro}{\interdisplaylinepenalty}
204 \newcount\interdisplaylinepenalty
205 \interdisplaylinepenalty=100
209 % \begin{macro}{\choose}
211 \def\choose{\atopwithdelims()}
215 % \begin{macro}{\brack}
217 \def\brack{\atopwithdelims[]}
221 % \begin{macro}{\brace}
223 \def\brace{\atopwithdelims\{\}}
227 % \begin{macro}{\mathpalette}
229 \def\mathpalette#1#2{%
231 {#1\displaystyle{#2}}%
233 {#1\scriptstyle{#2}}%
234 {#1\scriptscriptstyle{#2}}}
238 % \begin{macro}{\root}
239 % \changes{v1.1d}{1997/01/08}
240 % {(DPC) Remove spurious space tokens from
241 % plain \TeX\ definition /2359}
242 % \begin{macro}{\rootbox}
243 % \begin{macro}{\r@@t}
244 % \changes{v1.0r}{1995/05/21}{Use \cs{sqrtsign} instead of
252 \setbox\rootbox\hbox{$\m@th\scriptscriptstyle{#1}$}%
258 \setbox\z@\hbox{$\m@th#1\sqrtsign{#2}$}%
259 \dimen@\ht\z@ \advance\dimen@-\dp\z@
260 \mkern5mu\raise.6\dimen@\copy\rootbox
267 % \begin{macro}{\phantom}
268 % \changes{v1.0p}{1994/11/18}
269 % {(DPC) use \cs{expandafter} instead of \cs{next}}
270 % \changes{v1.0p}{1994/11/18}
271 % {(DPC) colour support}
272 % \begin{macro}{\hphantom}
273 % \begin{macro}{\vphantom}
280 \def\vphantom{\v@true\h@false\ph@nt}
284 \def\hphantom{\v@false\h@true\ph@nt}
288 \def\phantom{\v@true\h@true\ph@nt}
294 \expandafter\mathpalette\expandafter\mathph@nt
296 \expandafter\makeph@nt
302 \setbox\z@\hbox{\color@begingroup#1\color@endgroup}\finph@nt}
307 \setbox\z@\hbox{$\m@th#1{#2}$}\finph@nt}
313 \ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@\fi
314 \ifh@ \wd\tw@\wd\z@\fi \box\tw@}
320 % \begin{macro}{\mathstrut}
322 \def\mathstrut{\vphantom(}
326 % \begin{macro}{\smash}
327 % \changes{v1.0p}{1994/11/18}
328 % {(DPC) use \cs{expandafter} instead of \cs{next}}
329 % \changes{v1.0p}{1994/11/18}
330 % {(DPC) colour support}
333 \relax % \relax, in case this comes first in \halign
335 \expandafter\mathpalette\expandafter\mathsm@sh
337 \expandafter\makesm@sh
343 \setbox\z@\hbox{\color@begingroup#1\color@endgroup}\finsm@sh}
345 \setbox\z@\hbox{$\m@th#1{#2}$}\finsm@sh}
346 \def\finsm@sh{\ht\z@\z@ \dp\z@\z@ \box\z@}
350 % \begin{macro}{\buildrel}
352 \def\buildrel#1\over#2{\mathrel{\mathop{\kern\z@#2}\limits^{#1}}}
357 % \begin{macro}{\cases}
358 % \changes{LaTeX2.09}{1991/08/14}
359 % {(RmS) inserted extra braces around entry for NFSS}
361 \def\cases#1{\left\{\,\vcenter{\normalbaselines\m@th
362 \ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\right.}
366 % \begin{macro}{\matrix}
368 \def\matrix#1{\null\,\vcenter{\normalbaselines\m@th
369 \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
370 \mathstrut\crcr\noalign{\kern-\baselineskip}
371 #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}
375 % \begin{macro}{\pmatrix}
377 \def\pmatrix#1{\left(\matrix{#1}\right)}
382 % \begin{macro}{\bordermatrix}
383 % \changes{LaTeX2e}{1994/01/25}{Removed \cs{p@renwd}.}
385 \def\bordermatrix#1{\begingroup \m@th
388 \def\cr{\crcr\noalign{\kern2\p@\global\let\cr\endline}}%
389 \ialign{$##$\hfil\kern2\p@\kern\@tempdima&\thinspace\hfil$##$\hfil
390 &&\quad\hfil$##$\hfil\crcr
391 \omit\strut\hfil\crcr\noalign{\kern-\baselineskip}%
392 #1\crcr\omit\strut\cr}}%
393 \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}%
394 \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}%
395 \setbox\tw@\hbox{$\kern\wd\@ne\kern-\@tempdima\left(\kern-\wd\@ne
396 \global\setbox\@ne\vbox{\box\@ne\kern2\p@}%
397 \vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip}\,\right)$}%
398 \null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup}
402 % \begin{macro}{\openup}
404 \def\openup{\afterassignment\@penup\dimen@}
408 \def\@penup{\advance\lineskip\dimen@
409 \advance\baselineskip\dimen@
410 \advance\lineskiplimit\dimen@}
414 % \begin{macro}{\displaylines}
420 \def\displ@y{\global\dt@ptrue\openup\jot\m@th
421 \everycr{\noalign{\ifdt@p \global\dt@pfalse \ifdim\prevdepth>-1000\p@
422 \vskip-\lineskiplimit \vskip\normallineskiplimit \fi
423 \else \penalty\interdisplaylinepenalty \fi}}}
427 \def\@lign{\tabskip\z@skip\everycr{}} % restore inside \displ@y
431 \def\displaylines#1{\displ@y \tabskip\z@skip
432 \halign{\hb@xt@\displaywidth{$\@lign\hfil\displaystyle##\hfil$}\crcr
437 % \changes{v1.0r}{1995/05/21}{Remove \cs{mathhexbox} from this file}
452 %\def\,{\mskip\thinmuskip} % already defined in ltspace
453 \def\>{\mskip\medmuskip}
454 \def\;{\mskip\thickmuskip}
455 \def\!{\mskip-\thinmuskip}
463 \def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}}
468 % Nickname for the medium space since |\>| is not available inside
475 % \begin{macro}{\active@math@prime}
476 % \changes{v1.1e}{1999/10/09}{Macro added, see PR 3104.}
477 % This is the definition of the active math prime.
479 \def\active@math@prime{^\bgroup\prim@s}
483 % \begin{macro}{\prime@s}
484 % \changes{v1.0p}{1994/11/18}
485 % {(DPC) use \cs{@let@token} instead of \cs{next}
486 % and \cs{expandafter} instead of \cs{nxt}}
487 % \changes{v1.1e}{1999/10/09}{Introduce \cs{active@math@prime}.}
489 {\catcode`\'=\active \global\let'\active@math@prime}
494 \prime\futurelet\@let@token\pr@m@s}
503 \expandafter\expandafter\expandafter\pr@@@t
511 \def\pr@@@s#1{\prim@s}
515 \def\pr@@@t#1#2{#2\egroup}
519 % \changes{v1.0i}{1994/05/17}{Replaced \cs{let} by \cs{gdef}, for
520 % indirect definition.}
522 {\catcode`\_=\active \gdef_{\_}} % _ in math is
523 % either subscript or \_
527 % \changes{v1.0m}{1994/10/29}{ASAJ: Removed \cs{dag}, \cs{ddag}.}
528 % \changes{v1.0m}{1994/10/29}{ASAJ: Renamed \cs{S} and \cs{P} to
529 % \cs{mathsection} and \cs{mathparagraph} and made them
530 % \cs{mathchardef}s.}
531 % \changes{v1.0m}{1994/10/29}{ASAJ: Added \cs{mathellipsis},
532 % \cs{mathdollar} and \cs{mathsterling}.}
533 % \changes{v1.0n}{1994/10/30}{ASAJ: Moved the new commands to ltoutenc.}
535 % \subsection{Math Environments}
537 % \changes{1.0m}{1994/10/29}{ASAJ: Tidied up documentation.}
541 % Produces |$...$| with checks that |\(| isn't used in math mode, and
542 % that |\)| is only used in math mode begun with |\(|.
543 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
546 %<latexrelease>\IncludeInRelease{2015/01/01}{\(}{Make \( robust}%
547 %<*2ekernel|latexrelease>
548 \DeclareRobustCommand\({%
549 \relax\ifmmode\@badmath\else$\fi}%
550 \DeclareRobustCommand\){%
551 \relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi}%
552 %</2ekernel|latexrelease>
553 %<latexrelease>\EndIncludeInRelease
554 %<latexrelease>\IncludeInRelease{0000/00/00}{\(}{Make \( robust}%
555 %<latexrelease>\def\({%
556 %<latexrelease> \relax\ifmmode\@badmath\else$\fi}%
557 %<latexrelease>\def\){%
558 %<latexrelease> \relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi}%
559 %<latexrelease>\EndIncludeInRelease
566 % \changes{v1.1g}{2005/11/10}
567 % {(MH) Fixed potential problem in \cs{[} (pr/3399).}
569 % Produces |$$...$$| with checks that |\[| isn't used in math mode,
570 % and that |\]| is only used in display math mode (though there is no
571 % real test that this display math started with |\[| and not with |$$|).
572 % \changes{v1.1h}{2015/01/08}{Make Robust (latexrelease)}
575 %<latexrelease>\IncludeInRelease{2015/01/01}{\[}{Make \[ robust}%
576 %<*2ekernel|latexrelease>
577 \DeclareRobustCommand\[{%
583 \makebox[.6\linewidth]{}%
585 $$%%$$ BRACE MATCH HACK
591 \DeclareRobustCommand\]{%
596 $$%%$$ BRACE MATCH HACK
606 %</2ekernel|latexrelease>
607 %<latexrelease>\EndIncludeInRelease
608 %<latexrelease>\IncludeInRelease{0000/00/00}{\[}{Make \[ robust}%
609 %<latexrelease>\def\[{%
610 %<latexrelease> \relax\ifmmode
611 %<latexrelease> \@badmath
612 %<latexrelease> \else
613 %<latexrelease> \ifvmode
614 %<latexrelease> \nointerlineskip
615 %<latexrelease> \makebox[.6\linewidth]{}%
617 %<latexrelease> $$%%$$ BRACE MATCH HACK
623 %<latexrelease>\def\]{%
624 %<latexrelease> \relax\ifmmode
625 %<latexrelease> \ifinner
626 %<latexrelease> \@badmath
627 %<latexrelease> \else
628 %<latexrelease> $$%%$$ BRACE MATCH HACK
630 %<latexrelease> \else
631 %<latexrelease> \@badmath
633 %<latexrelease> \ignorespaces
635 %<latexrelease>\EndIncludeInRelease
641 % \begin{environment}{math}
642 % \begin{environment}{displaymath}
643 % Disguises for |\(...\)| and |\[...\]|.
651 \def\enddisplaymath{\]\@ignoretrue}
657 % \begin{environment}{equation}
658 % \changes{LaTeX2.09}{1992/01/10}{RmS: put \cs{hbox} around \cs{@eqnnum}
659 % to typeset the equation number in text mode
660 % (as in the eqnarray env.)}
661 % \begin{macro}{\c@equation}
662 % Numbered equations, using the counter |\c@equation|.
663 % \emph{Note}: The document style must define |\theequation| etc., and
664 % do the appropriate |\@addtoreset|. It should also redefine |\@eqnnum|
665 % if another format for the equation number is desired other than the
666 % standard (...), or to move the equation numbers to the flushleft.
667 % (See comment on the |\def| of |\@eqnnum|.)
669 \@definecounter{equation}
670 \def\equation{$$\refstepcounter{equation}}
671 \def\endequation{\eqno \hbox{\@eqnnum}$$\@ignoretrue}
676 % \begin{macro}{\@eqnnum}
677 % \changes{LaTeX2.09}{1991/09/29}{RmS: \cs{reset@font} added.}
678 % \changes{v1.0l}{1994/10/23}{Added \cs{normalcolor} since \cs{eqno}
679 % introduces a subgroup of the displayed math group}
681 % Produces the equation number for equation and
682 % eqnarray environments. The following definition is for
683 % flushright numbers; for flushleft numbers, see leqno.clo.
684 % The equation number is set in black roman type even
685 % if an eqnarray environment appears in an italic environment.
686 % \changes{v1.0s}{1995/05/26}{Removed \cs{rmfamily} (PR 1578),
687 % replaced \cs{reset@font} with \cs{normalfont}}
689 \def\@eqnnum{{\normalfont \normalcolor (\theequation)}}
693 % \begin{macro}{\stackrel}
694 % A disguise for plain \TeX's buildrel.
696 \def\stackrel#1#2{\mathrel{\mathop{#2}\limits^{#1}}}
700 % \changes{v0.9g}{1993/12/11}{Added a group around the first argument
701 % of \cs{frac} to prevent
702 % changes (for example font changes) from modifying the contents of
703 % the second argument.}
705 % \begin{macro}{\frac}
706 % A disguise for plain \TeX's |\over|.
708 \def\frac#1#2{{\begingroup#1\endgroup\over#2}}
712 % \begin{macro}{\sqrt}
713 % \changes{v1.0y}{1995/10/16}{(DPC) Make robust /1808}
714 % \begin{macro}{\@sqrt}
715 % Add an optional argument to plain's |\sqrt| to give the $n$th root
716 % of an expression $\sqrt[n]{e}$.
717 % \changes{v1.0r}{1995/05/21}{Use \cs{sqrtsign}}
719 \DeclareRobustCommand\sqrt{\@ifnextchar[\@sqrt\sqrtsign}
720 \def\@sqrt[#1]{\root #1\of}
725 % \changes{LaTeX2.09}{1985/11/04}{produce warning message if line
726 % extends into margin. Doesn't warn about formula
727 % overprinting equation number.}
728 % \changes{LaTeX2.09}{1993/11/02}{RmS:
729 % Corrected description of \cs{@eqnsel}, moved \cs{@eqnsel}
730 % accordingly and removed extra \cs{tabskip} assignment.}
731 % \changes{LaTeX2e}{1993/11/03}{RmS: Initialized \cs{everycr} to empty}
732 % \changes{v0.9i}{1993/12/16}
733 % {use \cs{refstepcounter} instead of shortcut}
734 % \changes{v0.9o}{1994/01/13}{correcting 0.9i}
736 % \begin{environment}{eqnarray}
737 % \begin{macro}{\@eqcnt}
738 % \begin{macro}{\@eqpen}
739 % \begin{macro}{\if@eqnsw}
740 % \begin{macro}{\@eqnsel}
741 % Here's the eqnarray environment:
742 % Default is for left-hand side of equations to be flushright.
743 % To make them flushleft, |\let\@eqnsel = \hfil|.
747 \newif\if@eqnsw\@eqnswtrue
749 \@centering = 0pt plus 1000pt
751 % To get a proper \cs{@currentlabel} we have to redefine it for the
752 % whole display. Note that we can't use \cs{refstepcounter} as this
753 % results in |\@currentlabel| getting restored at the wrong and
754 % thus always writing the first label to the \texttt{.aux} file.
757 \stepcounter{equation}%
758 \def\@currentlabel{\p@equation\theequation}%
764 $$\everycr{}\halign to\displaywidth\bgroup
765 \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel
766 &\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}$\hfil
767 &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep
768 $\displaystyle{##}$\hfil\tabskip\@centering
769 &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
779 \global\advance\c@equation\m@ne
793 % \begin{macro}{\nonumber}
794 % Switches off equation numbering.
796 \def\nonumber{\global\@eqnswfalse}
800 % \begin{macro}{\@eqncr}
801 % \begin{macro}{\@xeqncr}
802 % \begin{macro}{\@yeqncr}
803 % \changes{v1.0y}{1995/10/16}{(DPC) Use \cs{@testopt} /1911}
808 \global\@eqpen\@M\@yeqncr
810 \global\@eqpen\interdisplaylinepenalty \@yeqncr
816 \def\@yeqncr{\@testopt\@xeqncr\z@skip}
823 \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}%
831 % \begin{macro}{\@@eqncr}
832 % \changes{v0.9i}{1993/12/16}{use \cs{refstepcounter} instead of shortcut}
833 % \changes{v0.9o}{1994/01/13}{correcting 0.9i}
836 \def\@@eqncr{\let\reserved@a\relax
837 \ifcase\@eqcnt \def\reserved@a{& & &}\or \def\reserved@a{& &}%
838 \or \def\reserved@a{&}\else
839 \let\reserved@a\@empty
840 \@latex@error{Too many columns in eqnarray environment}\@ehc\fi
841 \reserved@a \if@eqnsw\@eqnnum\stepcounter{equation}\fi
842 \global\@eqnswtrue\global\@eqcnt\z@\cr}
846 % \begin{environment}{eqnarray*}
847 % \begin{macro}{\@seqncr}
848 % Here's the eqnarray* environment:
854 \@namedef{eqnarray*}{\def\@eqncr{\nonumber\@seqncr}\eqnarray}
858 \@namedef{endeqnarray*}{\nonumber\endeqnarray}
863 % \begin{macro}{\lefteqn}
864 % |\lefteqn{FORMULA}| typesets |FORMULA| in display math style
865 % flushleft in a box of width zero.
866 % \changes{v1.0r}{1995/05/21}{Use \cs{rlap}}
868 \def\lefteqn#1{\rlap{$\displaystyle #1$}}
872 % \begin{macro}{\ensuremath}
873 % In math mode, |\ensuremath{text}| is equivalent to text; in LR or
874 % paragraph mode, it is equivalent to |$|text|$|.
875 % |\relax| is not needed
876 % in front of the |\ifmmode| as |\protect| will be |\let| to |\relax|.
877 % This version (due to Donald Arseneau) avoids duplicating its
878 % argument in the `then' and `else' part of the |\ifmath| which is
879 % necessary in nested `tabular' like environments. See amslatex/2104.
880 % \changes{v1.0k}{1994/05/16}
881 % {Use \cs{DeclareRobustCommand} and add extra braces in math mode}
882 % \changes{v1.0l}{1994/10/23}{Remove extra braces: but see p 168 of
884 % \changes{v1.1a}{1996/03/25}{Reimplement for amslatex/2104}
886 \DeclareRobustCommand{\ensuremath}{%
888 \expandafter\@firstofone
890 \expandafter\@ensuredmath
895 % \begin{macro}{\@ensuredmath}
896 % \changes{v1.1a}{1996/03/25}{Macro added for amslatex/2104}
897 % \changes{v1.1c}{1996/11/09}{Made long, as it was before. /2104}
898 % The |\relax| stops |\ensuremath{}| starting display math.
900 \long\def\@ensuredmath#1{$\relax#1$}
910 % \subsection{External options to the standard document classes}
912 % \changes{v1.0u}{1995/08/09}
913 % {Added code for class options leqno and fleqn}
915 % \subsubsection{Left equation numbering}
917 % \begin{macro}{\@eqnnum}
918 % To put the equation number on the left side of an equation we
919 % have to use a little trick. The number is shifted |\displaywidth|
920 % to the left inside a box of (approximately) zero width. This
921 % fails when the quation is too wide, the equation number than may
922 % overprint the equation itself.
923 % \changes{v1.2y classes}{1995/01/12}{Added \cs{normalcolor}}
924 % \changes{v1.3c classes}{1995/05/25}
925 % {replace \cs{reset@font}\cs{rmfamily} with \cs{normalfont}
929 \renewcommand\@eqnnum{\hb@xt@.01\p@{}%
930 \rlap{\normalfont\normalcolor
931 \hskip -\displaywidth(\theequation)}}
936 % \subsubsection{Flush left equations}
938 % To get the displayed math environments to print the contents
939 % flush left (with an indentation) we have to redefine all of
940 % \LaTeXe's displayed math environments.
942 % \begin{macro}{\mathindent}
943 % The amount of indentation of the equations is stored in a register.
948 % The setting of |\mathindent| has to be deferred until the class
949 % file has been processed, because |\leftmargini| is still 0pt
950 % wide at the moment \texttt{fleqn.clo} is read in.
951 % \changes{v1.0n classes}
952 % {1994/01/19}{Deferred setting of \cs{mathindent}}
953 % \changes{v1.2t classes}
954 % {1994/06/22}{Set \cs{mathindent} at the end of the
955 % class instead of at begin document}
957 \AtEndOfClass{\mathindent\leftmargini}
962 % Begin display math;
964 \IncludeInRelease{2015/01/01}{\[}{Make \[ robust}%
965 \DeclareRobustCommand\[{\relax
969 \@beginparpenalty\predisplaypenalty
970 \@endparpenalty\postdisplaypenalty
972 \hb@xt@\linewidth\bgroup $\m@th\displaystyle %$
973 \hskip\mathindent\bgroup
979 \IncludeInRelease{0000/00/00}{\[}{Make \[ robust}%
980 \renewcommand\[{\relax
984 \@beginparpenalty\predisplaypenalty
985 \@endparpenalty\postdisplaypenalty
987 \hb@xt@\linewidth\bgroup $\m@th\displaystyle %$
988 \hskip\mathindent\bgroup
997 \IncludeInRelease{2015/01/01}{\]}{Make \] robust}%
998 \DeclareRobustCommand\]{\relax
1005 \EndIncludeInRelease
1009 \IncludeInRelease{0000/00/00}{\]}{Make \] robust}%
1010 \renewcommand\]{\relax
1017 \EndIncludeInRelease
1021 % \begin{environment}{equation}
1022 % The \textsf{equation} environment
1024 \renewenvironment{equation}%
1025 {\@beginparpenalty\predisplaypenalty
1026 \@endparpenalty\postdisplaypenalty
1027 \refstepcounter{equation}%
1028 \trivlist \item[]\leavevmode
1029 \hb@xt@\linewidth\bgroup $\m@th% $
1033 \displaywidth\linewidth\hbox{\@eqnnum}%
1039 % \begin{environment}{eqnarray}
1040 % The \textsf{eqnarray} environment
1042 \renewenvironment{eqnarray}{%
1043 \stepcounter{equation}%
1044 \def\@currentlabel{\p@equation\theequation}%
1045 \global\@eqnswtrue\m@th
1049 \setlength\abovedisplayskip{\topsep}%
1051 \addtolength\abovedisplayskip{\partopsep}%
1054 % When the documentclass uses a non-zero |\parskip| setting the
1055 % |\topsep| might have a negative value to compensate for
1056 % that. Therefore we add |\parskip| to |\abovedisplayskip|.
1057 % \changes{v1.2v classes}{1994/11/10}{Added value of \cs{parskip} to
1058 % \cs{abovedisplayskip} to compensate for negative \cs{topsep}}
1060 \addtolength\abovedisplayskip{\parskip}%
1061 \setlength\belowdisplayskip{\abovedisplayskip}%
1062 \setlength\belowdisplayshortskip{\abovedisplayskip}%
1063 \setlength\abovedisplayshortskip{\abovedisplayskip}%
1064 $$\everycr{}\halign to\linewidth% $$
1067 $\displaystyle\tabskip\z@skip{##}$\@eqnsel&%
1068 \global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}$\hfil&%
1069 \global\@eqcnt\tw@ \hskip \tw@\arraycolsep
1070 $\displaystyle{##}$\hfil \tabskip\@centering&%
1071 \global\@eqcnt\thr@@
1072 \hb@xt@\z@\bgroup\hss##\egroup\tabskip\z@skip\cr}%
1075 \global\advance\c@equation\m@ne$$% $$