2 %% This is file `amsmath.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
9 %%% ====================================================================
11 %%% filename = "amsmath.dtx",
13 %%% date = "2000/07/18",
14 %%% time = "08:16:41 EDT",
15 %%% author = "American Mathematical Society",
16 %%% copyright = "Copyright 1995, 2000 American Mathematical Society,
17 %%% all rights reserved. Copying of this file is
18 %%% authorized only if either:
19 %%% (1) you make absolutely no changes to your copy,
20 %%% including name; OR
21 %%% (2) if you do make changes, you first rename it
22 %%% to some other name.",
23 %%% address = "American Mathematical Society,
24 %%% Technical Support,
25 %%% Publications Technical Group,
27 %%% Providence, RI 02940,
29 %%% telephone = "401-455-4080 or (in the USA and Canada)
30 %%% 800-321-4AMS (321-4267)",
31 %%% FAX = "401-331-3842",
32 %%% checksum = "38084 5829 21569 202795",
33 %%% email = "tech-support@ams.org (Internet)",
34 %%% codetable = "ISO/ASCII",
35 %%% keywords = "latex, amslatex, math, amsmath",
36 %%% supported = "yes",
37 %%% abstract = "This is a \LaTeX{} package that provides a variety of
38 %%% extra mathematical features, largely derived from
40 %%% docstring = "The checksum field above contains a CRC-16 checksum
41 %%% as the first value, followed by the equivalent of
42 %%% the standard UNIX wc (word count) utility output of
43 %%% lines, words, and characters. This is produced by
44 %%% Robert Solovay's checksum utility.",
46 %%% ====================================================================
47 \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
48 [1994/12/01]% LaTeX date must be December 1994 or later
49 \ProvidesPackage{amsmath}[2000/07/18 v2.13 AMS math features]
50 \edef\@temp{\catcode 96=\number\catcode 96 }
51 \catcode\string `\`=12
52 \def\do#1{\catcode\number`#1=\number\catcode`#1}
54 \noexpand\AtEndOfPackage{%
56 \do\"\do\'\do\(\do\)\do\*\do\+\do\,\do\-\do\.%
57 \do\/\do\<\do\=\do\>\do\[\do\]\do\^\do\_\relax
61 \def\do#1{\catcode\number`#1=12 }
62 \do\"\do\'\do\(\do\)\do\*\do\+\do\,\do\-\do\.
63 \do\/\do\<\do\=\do\>\do\[\do\]
64 \catcode`\^=7 \catcode`\_=8
65 \DeclareOption{intlimits}{\let\ilimits@\displaylimits}
66 \DeclareOption{nointlimits}{\let\ilimits@\nolimits}
67 \DeclareOption{sumlimits}{\let\slimits@\displaylimits}
68 \DeclareOption{nosumlimits}{\let\slimits@\nolimits}
69 \DeclareOption{namelimits}{\PassOptionsToPackage{namelimits}{amsopn}}
70 \DeclareOption{nonamelimits}{%
71 \PassOptionsToPackage{nonamelimits}{amsopn}}
74 \DeclareOption{leqno}{\tagsleft@true}
75 \DeclareOption{reqno}{\tagsleft@false}
76 \DeclareOption{centertags}{\ctagsplit@true}
77 \DeclareOption{tbtags}{\ctagsplit@false}
78 \DeclareOption{cmex10}{%
79 \ifnum\cmex@opt=\@ne \def\cmex@opt{0}%
80 \else \def\cmex@opt{10}\fi
82 \@ifundefined{cmex@opt}{\def\cmex@opt{7}}{}
83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86 \@mathmargin\@centering
87 \DeclareOption{fleqn}{%
90 \let\mathindent=\@mathmargin
92 \ifdim\@mathmargin= -1sp
93 \@mathmargin\leftmargini minus\leftmargini
98 \ExecuteOptions{nointlimits,sumlimits,namelimits,centertags}
100 \@ifpackagewith{amsmath}{?}{%
102 Documentation for the amsmath package is found in amsldoc.dvi^^J%
103 (or .pdf or .tex).^^J%
105 See also http://www.ams.org/tex/amslatex.html.^^J%
107 Note: Using the first edition of The LaTeX Companion (1994) without^^J%
108 errata as a guide for amsmath use is not recommended.^^J%
112 For additional information on amsmath, use the \lq ?\rq\space option.%
115 \ifnum\cmex@opt=7 \relax
116 \DeclareFontShape{OMX}{cmex}{m}{n}{%
117 <-8>cmex7<8>cmex8<9>cmex9%
118 <10><10.95><12><14.4><17.28><20.74><24.88>cmex10%
120 \expandafter\let\csname OMX/cmex/m/n/10\endcsname\relax
122 \ifnum\cmex@opt=\z@ % need to override cmex7 fontdef from amsfonts
124 \fontencoding{OMX}\fontfamily{cmex}%
125 \expandafter\let\csname OMX+cmex\endcsname\relax
128 \expandafter\let\csname OMX/cmex/m/n/10\endcsname\relax
132 \RequirePackage{amstext}[1995/01/25]
133 \RequirePackage{amsbsy}[1995/01/20]
134 \RequirePackage{amsopn}[1995/01/20]
135 \def\@amsmath@err{\PackageError{amsmath}}
136 \providecommand{\AmS}{{\protect\AmSfont
137 A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}
138 \newcommand{\AmSfont}{%
139 \usefont{OMS}{cmsy}{\if\@xp\@car\f@series\@nil bb\else m\fi}{n}}
140 \def\@mathmeasure#1#2#3{\setbox#1\hbox{\frozen@everymath\@emptytoks
142 \@ifundefined{inf@bad}{%
143 \newcount\inf@bad \inf@bad=1000000 \relax
145 \DeclareRobustCommand{\tmspace}[3]{%
146 \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
147 \renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}
149 \renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}
151 \renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
153 \newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}
154 \renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}
156 \newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}
157 \newcommand{\mspace}[1]{\mskip#1\relax}
158 \def\@tempa#1#2\@nil{%
159 \ifx\delimiter#1\@tempcnta#2\relax\else\@tempcnta\z@\fi
161 \@xp\@tempa\vert\@empty\@nil
163 \advance\@tempcnta "4000000
164 \xdef\lvert{\delimiter\number\@tempcnta\space }
165 \advance\@tempcnta "1000000
166 \xdef\rvert{\delimiter\number\@tempcnta\space }
168 \ifx\@@undefined\lvert
169 % Fall back to cmex encoding since we don't know what else to do.
170 \DeclareMathDelimiter{\lvert}
171 {\mathopen}{symbols}{"6A}{largesymbols}{"0C}
172 \DeclareMathDelimiter{\rvert}
173 {\mathclose}{symbols}{"6A}{largesymbols}{"0C}
176 \@xp\@tempa\Vert\@empty\@nil
178 \advance\@tempcnta "4000000
179 \xdef\lVert{\delimiter\number\@tempcnta\space }
180 \advance\@tempcnta "1000000
181 \xdef\rVert{\delimiter\number\@tempcnta\space }
183 \ifx\@@undefined\lVert
184 \DeclareMathDelimiter{\lVert}
185 {\mathopen}{symbols}{"6B}{largesymbols}{"0D}
186 \DeclareMathDelimiter{\rVert}
187 {\mathclose}{symbols}{"6B}{largesymbols}{"0D}
190 \@saveprimitive\over\@@over
191 \@saveprimitive\atop\@@atop
192 \@saveprimitive\above\@@above
193 \@saveprimitive\overwithdelims\@@overwithdelims
194 \@saveprimitive\atopwithdelims\@@atopwithdelims
195 \@saveprimitive\abovewithdelims\@@abovewithdelims
196 \DeclareRobustCommand{\primfrac}[1]{%
197 \PackageWarning{amsmath}{%
198 Foreign command \@backslashchar#1;\MessageBreak
199 \protect\frac\space or \protect\genfrac\space should be used instead%
202 \global\@xp\let\csname#1\@xp\endcsname\csname @@#1\endcsname
205 \renewcommand{\over}{\primfrac{over}}
206 \renewcommand{\atop}{\primfrac{atop}}
207 \renewcommand{\above}{\primfrac{above}}
208 \renewcommand{\overwithdelims}{\primfrac{overwithdelims}}
209 \renewcommand{\atopwithdelims}{\primfrac{atopwithdelims}}
210 \renewcommand{\abovewithdelims}{\primfrac{abovewithdelims}}
211 \DeclareRobustCommand{\frac}[2]{{\begingroup#1\endgroup\@@over#2}}
212 \newcommand{\dfrac}{\genfrac{}{}{}0}
213 \newcommand{\tfrac}{\genfrac{}{}{}1}
214 \DeclareRobustCommand{\binom}{\genfrac()\z@{}}
215 \newcommand{\dbinom}{\genfrac(){0pt}0}
216 \newcommand{\tbinom}{\genfrac(){0pt}1}
217 \DeclareRobustCommand{\genfrac}[4]{%
219 \edef\@tempb{\@nx\@genfrac\@mathstyle{#4}%
220 \csname @@\ifx @#3@over\else above\fi
221 \ifx\@tempa\@empty \else withdelims\fi\endcsname}
223 \def\@genfrac#1#2#3#4#5{{#1{\begingroup#4\endgroup#2#3\relax#5}}}
225 \ifx\@empty#1\@empty\relax
226 \else\ifcase#1\displaystyle % case 0
227 \or\textstyle\or\scriptstyle\else\scriptscriptstyle\fi\fi}
229 \edef\@tempa{\string\mathchar"}
230 \def\@tempb#1"#2\@nil{#1"}
231 \edef\@tempc{\expandafter\@tempb\meaning\coprod "\@nil}
233 \global\let\coprod@\coprod
234 \gdef\coprod{\DOTSB\coprod@\slimits@}
235 \global\let\bigvee@\bigvee
236 \gdef\bigvee{\DOTSB\bigvee@\slimits@}
237 \global\let\bigwedge@\bigwedge
238 \gdef\bigwedge{\DOTSB\bigwedge@\slimits@}
239 \global\let\biguplus@\biguplus
240 \gdef\biguplus{\DOTSB\biguplus@\slimits@}
241 \global\let\bigcap@\bigcap
242 \gdef\bigcap{\DOTSB\bigcap@\slimits@}
243 \global\let\bigcup@\bigcup
244 \gdef\bigcup{\DOTSB\bigcup@\slimits@}
245 \global\let\prod@\prod
246 \gdef\prod{\DOTSB\prod@\slimits@}
248 \gdef\sum{\DOTSB\sum@\slimits@}
249 \global\let\bigotimes@\bigotimes
250 \gdef\bigotimes{\DOTSB\bigotimes@\slimits@}
251 \global\let\bigoplus@\bigoplus
252 \gdef\bigoplus{\DOTSB\bigoplus@\slimits@}
253 \global\let\bigodot@\bigodot
254 \gdef\bigodot{\DOTSB\bigodot@\slimits@}
255 \global\let\bigsqcup@\bigsqcup
256 \gdef\bigsqcup{\DOTSB\bigsqcup@\slimits@}
259 \newcommand{\leftroot}{\@amsmath@err{\Invalid@@\leftroot}\@eha}
260 \newcommand{\uproot}{\@amsmath@err{\Invalid@@\uproot}\@eha}
263 \renewcommand{\root}{\relaxnext@
264 \DN@{\ifx\@let@token\uproot\let\next@\nextii@\else
265 \ifx\@let@token\leftroot\let\next@\nextiii@\else
266 \let\next@\plainroot@\fi\fi\next@}%
267 \def\nextii@\uproot##1{\uproot@##1\relax\FN@\nextiv@}%
268 \def\nextiv@{\ifx\@let@token\@sptoken\DN@. {\FN@\nextv@}\else
269 \DN@.{\FN@\nextv@}\fi\next@.}%
270 \def\nextv@{\ifx\@let@token\leftroot\let\next@\nextvi@\else
271 \let\next@\plainroot@\fi\next@}%
272 \def\nextvi@\leftroot##1{\leftroot@##1\relax\plainroot@}%
273 \def\nextiii@\leftroot##1{\leftroot@##1\relax\FN@\nextvii@}%
274 \def\nextvii@{\ifx\@let@token\@sptoken
275 \DN@. {\FN@\nextviii@}\else
276 \DN@.{\FN@\nextviii@}\fi\next@.}%
277 \def\nextviii@{\ifx\@let@token\uproot\let\next@\nextix@\else
278 \let\next@\plainroot@\fi\next@}%
279 \def\nextix@\uproot##1{\uproot@##1\relax\plainroot@}%
280 \bgroup\uproot@\z@\leftroot@\z@\FN@\next@}
281 \def\plainroot@#1\of#2{\setbox\rootbox\hbox{%
282 $\m@th\scriptscriptstyle{#1}$}%
283 \mathchoice{\r@@t\displaystyle{#2}}{\r@@t\textstyle{#2}}
284 {\r@@t\scriptstyle{#2}}{\r@@t\scriptscriptstyle{#2}}\egroup}
286 \@ifundefined{sqrtsign}{\let\sqrtsign\@@sqrt}{}
287 \def\r@@t#1#2{\setboxz@h{$\m@th#1\sqrtsign{#2}$}%
288 \dimen@\ht\z@\advance\dimen@-\dp\z@
289 \setbox\@ne\hbox{$\m@th#1\mskip\uproot@ mu$}%
290 \advance\dimen@ by1.667\wd\@ne
291 \mkern-\leftroot@ mu\mkern5mu\raise.6\dimen@\copy\rootbox
292 \mkern-10mu\mkern\leftroot@ mu\boxz@}
293 \@ifundefined{varGamma}{%
294 \DeclareMathSymbol{\varGamma}{\mathord}{letters}{"00}
295 \DeclareMathSymbol{\varDelta}{\mathord}{letters}{"01}
296 \DeclareMathSymbol{\varTheta}{\mathord}{letters}{"02}
297 \DeclareMathSymbol{\varLambda}{\mathord}{letters}{"03}
298 \DeclareMathSymbol{\varXi}{\mathord}{letters}{"04}
299 \DeclareMathSymbol{\varPi}{\mathord}{letters}{"05}
300 \DeclareMathSymbol{\varSigma}{\mathord}{letters}{"06}
301 \DeclareMathSymbol{\varUpsilon}{\mathord}{letters}{"07}
302 \DeclareMathSymbol{\varPhi}{\mathord}{letters}{"08}
303 \DeclareMathSymbol{\varPsi}{\mathord}{letters}{"09}
304 \DeclareMathSymbol{\varOmega}{\mathord}{letters}{"0A}
306 \@saveprimitive\overline\@@overline
307 \DeclareRobustCommand{\overline}[1]{\@@overline{#1}}
308 \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
309 \newcommand{\implies}{\DOTSB\;\Longrightarrow\;}
310 \newcommand{\impliedby}{\DOTSB\;\Longleftarrow\;}
311 \def\And{\DOTSB\;\mathchar"3026 \;}
312 \newcommand{\nobreakdash}{\leavevmode
313 \toks@\@emptytoks \def\@tempa##1{\toks@\@xp{\the\toks@-}\FN@\next@}%
314 \DN@{\ifx\@let@token-\@xp\@tempa
315 \else\setboxz@h{\the\toks@\nobreak}\unhbox\z@\fi}%
318 \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
319 \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}
320 \let\ifgtest@\iffalse % initial value
321 \def\gtest@true{\global\let\ifgtest@\iftrue}
322 \def\gtest@false{\global\let\ifgtest@\iffalse}
326 {\uccode`7=`\\ \uccode`8=`m \uccode`9=`a \uccode`0=`t \uccode`!=`h
328 \gdef\math@#1#2#3#4#5#6\math@{\gtest@false\ifx 7#1\ifx 8#2%
329 \ifx 9#3\ifx 0#4\ifx !#5\xdef\meaning@{#6}\gtest@true
331 {\uccode`7=`c \uccode`8=`h \uccode`9=`\"
332 \uppercase{\gdef\mathch@#1#2#3#4#5#6\mathch@{\gtest@false
333 \ifx 7#1\ifx 8#2\ifx 9#5\gtest@true\xdef\meaning@{9#6}\fi\fi\fi}}}
335 \def\getmathch@#1.#2\getmathch@{\classnum@#1 \divide\classnum@4096
336 \ifcase\number\classnum@\or\or\gdef\thedots@{\dotsb@}\or
337 \gdef\thedots@{\dotsb@}\fi}
338 {\uccode`4=`b \uccode`5=`i \uccode`6=`n
339 \uppercase{\gdef\mathbin@#1#2#3{\relaxnext@
340 \def\nextii@##1\mathbin@{\ifx\@sptoken\@let@token\gtest@true\fi}%
341 \gtest@false\DN@##1\mathbin@{}%
342 \ifx 4#1\ifx 5#2\ifx 6#3\DN@{\FN@\nextii@}\fi\fi\fi\next@}}}
343 {\uccode`4=`r \uccode`5=`e \uccode`6=`l
344 \uppercase{\gdef\mathrel@#1#2#3{\relaxnext@
345 \def\nextii@##1\mathrel@{\ifx\@sptoken\@let@token\gtest@true\fi}%
346 \gtest@false\DN@##1\mathrel@{}%
347 \ifx 4#1\ifx 5#2\ifx 6#3\DN@{\FN@\nextii@}\fi\fi\fi\next@}}}
348 {\uccode`5=`m \uccode`6=`a \uccode`7=`c
349 \uppercase{\gdef\macro@#1#2#3#4\macro@{\gtest@false
350 \ifx 5#1\ifx 6#2\ifx 7#3\gtest@true
351 \xdef\meaning@{\macro@@#4\macro@@}\fi\fi\fi}}}
352 \def\macro@@#1->#2\macro@@{#2}
354 {\uccode`6=`\\ \uccode`7=`D \uccode`8=`O \uccode`9=`T \uccode`0=`S
355 \uppercase{\gdef\DOTS@#1#2#3#4#5{\gtest@false\DN@##1\DOTS@{}%
356 \ifx 6#1\ifx 7#2\ifx 8#3\ifx 9#4\ifx 0#5\let\next@\DOTS@@
359 {\uccode`3=`B \uccode`4=`I \uccode`5=`X
360 \uppercase{\gdef\DOTS@@#1{\relaxnext@
361 \def\nextii@##1\DOTS@{\ifx\@sptoken\@let@token\gtest@true\fi}%
363 \ifx 3#1\global\DOTSCASE@\z@\else
364 \ifx 4#1\global\DOTSCASE@\@ne\else
365 \ifx 5#1\global\DOTSCASE@\tw@\else\DN@##1\DOTS@{}%
367 {\uccode`5=`\\ \uccode`6=`n \uccode`7=`o \uccode`8=`t
368 \uppercase{\gdef\not@#1#2#3#4{\relaxnext@
369 \def\nextii@##1\not@{\ifx\@sptoken\@let@token\gtest@true\fi}%
370 \gtest@false\DN@##1\not@{}%
371 \ifx 5#1\ifx 6#2\ifx 7#3\ifx 8#4\DN@{\FN@\nextii@}\fi\fi\fi
373 \def\keybin@{\gtest@true
374 \ifx\@let@token+\else\ifx\@let@token=\else
375 \ifx\@let@token<\else\ifx\@let@token>\else
376 \ifx\@let@token-\else\ifx\@let@token*\else\ifx\@let@token:\else
377 \gtest@false\fi\fi\fi\fi\fi\fi\fi}
378 \@ifundefined{@ldots}{\def\@ldots{\mathellipsis}}{}
379 \DeclareRobustCommand{\ldots}{%
380 \ifmmode \mathellipsis \else \textellipsis \fi
382 \DeclareRobustCommand{\dots}{%
383 \ifmmode \@xp\mdots@\else \@xp\textellipsis \fi
385 \def\tdots@{\leavevmode\unskip\relaxnext@
387 \ifx\@let@token,\,$\else\ifx\@let@token.\,$\else
388 \ifx\@let@token;\,$\else\ifx\@let@token:\,$\else
389 \ifx\@let@token?\,$\else\ifx\@let@token!\,$\else
390 $ \fi\fi\fi\fi\fi\fi}%
392 \def\mdots@{\FN@\mdots@@}
393 \def\mdots@@{\gdef\thedots@{\dotso@}%
394 \ifx\@let@token\boldsymbol \gdef\thedots@\boldsymbol{\boldsymboldots@}%
395 \else\ifx,\@let@token \gdef\thedots@{\dotsc}%
396 \else\ifx\not\@let@token \gdef\thedots@{\dotsb@}%
398 \ifgtest@\gdef\thedots@{\dotsb@}%
399 \else\xdef\meaning@{\meaning\@let@token..........}%
400 \xdef\meaning@@{\meaning@}%
401 \@xp\math@\meaning@\math@
403 \@xp\mathch@\meaning@\mathch@
404 \ifgtest@\@xp\getmathch@\meaning@\getmathch@\fi
405 \else\@xp\macro@\meaning@@\macro@
407 \@xp\not@\meaning@\not@\ifgtest@\gdef\thedots@{\dotsb@}%
408 \else\@xp\DOTS@\meaning@\DOTS@
410 \ifcase\number\DOTSCASE@\gdef\thedots@{\dotsb@}%
411 \or\gdef\thedots@{\dotsi}\else\fi
412 \else\@xp\math@\meaning@\math@
413 \ifgtest@\@xp\mathbin@\meaning@\mathbin@
414 \ifgtest@\gdef\thedots@{\dotsb@}%
415 \else\@xp\mathrel@\meaning@\mathrel@
416 \ifgtest@\gdef\thedots@{\dotsb@}%
417 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
419 \def\boldsymboldots@#1{%
420 \bold@true\let\@let@token=#1\let\delayed@=#1\mdots@@
421 \boldsymbol#1\bold@false}
422 \def\@cdots{\mathinner{\cdotp\cdotp\cdotp}}
423 \newcommand{\dotsi}{\!\@cdots}
425 \def\rightdelim@{\gtest@true
426 \ifx\@let@token)\else
427 \ifx\@let@token]\else
428 \ifx\@let@token\rbrack\else
429 \ifx\@let@token\}\else
430 \ifx\@let@token\rbrace\else
431 \ifx\@let@token\rangle\else
432 \ifx\@let@token\rceil\else
433 \ifx\@let@token\rfloor\else
434 \ifx\@let@token\rgroup\else
435 \ifx\@let@token\rmoustache\else
436 \ifx\@let@token\right\else
437 \ifx\@let@token\bigr\else
438 \ifx\@let@token\biggr\else
439 \ifx\@let@token\Bigr\else
440 \ifx\@let@token\Biggr\else\gtest@false
441 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
443 \rightdelim@\ifgtest@
444 \else\ifx\@let@token$\gtest@true
445 \else\xdef\meaning@{\meaning\@let@token..........}%
446 \@xp\macro@\meaning@\macro@\ifgtest@
447 \@xp\DOTS@\meaning@\DOTS@
449 \ifnum\DOTSCASE@=\tw@\gtest@true\else\gtest@false
452 \def\dotso@{\relaxnext@
454 \let\@let@token\delayed@
455 \def\nextii@{\extra@\@ldots\ifgtest@\,\fi}%
457 \def\nextii@{\DN@{\extra@\@ldots\ifgtest@\,\fi}\FN@\next@}%
462 \ifx\@let@token,\else
463 \ifx\@let@token;\else
464 \ifx\@let@token.\else\extra@
466 \let\next@#1\fi\fi\fi\fi\next@}
467 \DeclareRobustCommand{\cdots}{\DN@{\extrap@\@cdots}\FN@\next@}
470 \DeclareRobustCommand{\dotso}{\relax
471 \ifmmode \DN@{\extrap@\@ldots}%
472 \else \let\next@\tdots@\fi
474 \DeclareRobustCommand{\dotsc}{%
475 \DN@{\ifx\@let@token;\@ldots\,%
476 \else \ifx\@let@token.\@ldots\,%
477 \else \extra@\@ldots \ifgtest@\,\fi
480 \renewcommand{\longrightarrow}{%
481 \DOTSB\protect\relbar\protect\joinrel\rightarrow}
482 \renewcommand{\Longrightarrow}{%
483 \DOTSB\protect\Relbar\protect\joinrel\Rightarrow}
484 \renewcommand{\longleftarrow}{%
485 \DOTSB\leftarrow\protect\joinrel\protect\relbar}
486 \renewcommand{\Longleftarrow}{%
487 \DOTSB\Leftarrow\protect\joinrel\protect\Relbar}
488 \renewcommand{\longleftrightarrow}{\DOTSB\leftarrow\joinrel\rightarrow}
489 \renewcommand{\Longleftrightarrow}{\DOTSB\Leftarrow\joinrel\Rightarrow}
490 \renewcommand{\mapsto}{\DOTSB\mapstochar\rightarrow}
491 \renewcommand{\longmapsto}{\DOTSB\mapstochar\longrightarrow}
492 \renewcommand{\hookrightarrow}{\DOTSB\lhook\joinrel\rightarrow}
493 \renewcommand{\hookleftarrow}{\DOTSB\leftarrow\joinrel\rhook}
494 \renewcommand{\iff}{\DOTSB\;\Longleftrightarrow\;}
495 \renewcommand{\doteq}{%
496 \DOTSB\mathrel{\mathop{\kern0pt =}\limits^{\textstyle.}}}
498 \everydisplay\@xp{\the\everydisplay \@displaytrue}
499 \renewcommand{\int}{\DOTSI\intop\ilimits@}
500 \renewcommand{\oint}{\DOTSI\ointop\ilimits@}
501 \def\intkern@{\mkern-6mu\mathchoice{\mkern-3mu}{}{}{}}
502 \def\intdots@{\mathchoice{\@cdots}%
503 {{\cdotp}\mkern1.5mu{\cdotp}\mkern1.5mu{\cdotp}}%
504 {{\cdotp}\mkern1mu{\cdotp}\mkern1mu{\cdotp}}%
505 {{\cdotp}\mkern1mu{\cdotp}\mkern1mu{\cdotp}}}
506 \newcommand{\iint}{\DOTSI\protect\MultiIntegral{2}}
507 \newcommand{\iiint}{\DOTSI\protect\MultiIntegral{3}}
508 \newcommand{\iiiint}{\DOTSI\protect\MultiIntegral{4}}
509 \newcommand{\idotsint}{\DOTSI\protect\MultiIntegral{0}}
510 \newcommand{\MultiIntegral}[1]{%
511 \edef\ints@c{\noexpand\intop
512 \ifnum#1=\z@\noexpand\intdots@\else\noexpand\intkern@\fi
513 \ifnum#1>\tw@\noexpand\intop\noexpand\intkern@\fi
514 \ifnum#1>\thr@@\noexpand\intop\noexpand\intkern@\fi
518 \futurelet\@let@token\ints@a
521 \ifx\limits\@let@token \ints@b
522 \else \ifx\displaylimits\@let@token \ints@b
523 \else\ifx\ilimits@\displaylimits \ints@b
528 \mkern-7mu\mathchoice{\mkern-2mu}{}{}{}%
530 \mkern7mu\mathchoice{\mkern2mu}{}{}{}%
533 \newbox\Mathstrutbox@
534 \setbox\Mathstrutbox@=\hbox{}
535 \def\Mathstrut@{\copy\Mathstrutbox@}
536 \def\resetMathstrut@{%
538 \mathchardef\@tempa\mathcode`\(\relax
539 \def\@tempb##1"##2##3{\the\textfont"##3\char"}%
540 \expandafter\@tempb\meaning\@tempa \relax
542 \ht\Mathstrutbox@\ht\z@ \dp\Mathstrutbox@\dp\z@
544 \addto@hook\every@math@size{\resetMathstrut@}
546 \def\strut@{\copy\strutbox@}
547 \def\reset@strutbox@{%
548 \global\setbox\strutbox@\hbox{%
549 \lower.5\normallineskiplimit
550 \vbox{\kern-\normallineskiplimit\copy\strutbox}}}
551 \addto@hook\every@math@size{\reset@strutbox@}
552 \AtBeginDocument{\reset@strutbox@}
553 \renewcommand{\big}{\bBigg@\@ne}
554 \renewcommand{\Big}{\bBigg@{1.5}}
555 \renewcommand{\bigg}{\bBigg@\tw@}
556 \renewcommand{\Bigg}{\bBigg@{2.5}}
558 {\@mathmeasure\z@{\nulldelimiterspace\z@}%
559 {\left#2\vcenter to#1\big@size{}\right.}%
561 \addto@hook\every@math@size{%
562 \global\big@size 1.2\ht\Mathstrutbox@
563 \global\advance\big@size 1.2\dp\Mathstrutbox@ }
566 \def\noaccents@{\def\accentclass@{0}}
567 \DeclareFontEncoding{OML}{}{\noaccents@}
568 \DeclareFontEncoding{OMS}{}{\noaccents@}
569 \newcommand{\dddot}[1]{%
570 {\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
571 \hbox{\normalfont ...}\vss}}}}
572 \newcommand{\ddddot}[1]{%
573 {\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
574 \hbox{\normalfont....}\vss}}}}
575 \def\set@mathaccent#1#2#3#4{%
576 \xdef#2{\@nx\protect\@nx\mathaccentV
577 {\@xp\@gobble\string#2}\hexnumber@#1#4}%
579 \def\@tempa#1{\@xp\@tempb\meaning#1\@nil#1}
580 \def\@tempb#1>#2#3 #4\@nil#5{%
581 \@xp\ifx\csname#3\endcsname\mathaccent
582 \@tempc#4?"7777\@nil#5%
584 \PackageWarningNoLine{amsmath}{%
585 Unable to redefine math accent \string#5}%
588 \def\@tempc#1"#2#3#4#5#6\@nil#7{%
589 \chardef\@tempd="#3\relax\set@mathaccent\@tempd{#7}{#2}{#4#5}}
600 \@ifundefined{mathring}{%
601 \DeclareMathAccent{\mathring}{\mathalpha}{operators}{"17}
607 \newcommand{\acc@check}{}
608 \newcommand{\acc@error}{}
609 \def\acc@check{\@ifnextchar\@empty\relax\acc@error}
612 Improper argument for math accent:\MessageBreak
613 Extra braces must be added to prevent wrong output%
617 \long\def\@gobblethree#1#2#3{}
618 \def\mathaccentV#1#2#3#4#5{%
620 \gdef\macc@tmp{\macc@depth\@ne}%
622 \let\mathaccentV\macc@test
623 \let\use@mathgroup\@gobbletwo \let\select@group\@gobblethree
624 \frozen@everymath{}$#5$%
627 \ifnum\macc@depth=\@ne
628 \global\let\macc@nucleus\@empty
629 \mathaccent"\accentclass@
636 \@xp\nonmatherr@\csname#1\endcsname
639 \def\macc@test#1#2#3#4{\xdef\macc@tmp{\macc@tmp\advance\macc@depth\@ne}}
641 \def\macc@nested#1#2#3#4{%
643 \let\math@bgroup\@empty \let\math@egroup\macc@set@skewchar
644 \mathsurround\z@ \frozen@everymath{\mathgroup\macc@group\relax}%
645 \macc@set@skewchar\relax
646 \let\mathaccentV\macc@nested@a
647 \macc@nested@a\relax#1#2#3{#4}%
650 \let\macc@palette\mathpalette
651 \def\macc@nested@a#1#2#3#4#5{%
652 \ifnum\macc@group=\mathgroup
653 \else \macc@set@skewchar\relax \edef\macc@group{\the\mathgroup}%
655 \mathchardef\macc@code "\accentclass@ #2#3#4\relax
656 \macc@palette\macc@a{#5}%
658 \def\macc@set@skewchar#1{%
660 \ifnum\mathgroup=\m@ne \let\@tempa\@ne
662 \ifnum\skewchar\textfont\mathgroup=\m@ne \let\@tempa\@ne
663 \else \let\@tempa\mathgroup
666 \count@=\skewchar\textfont\@tempa
668 \edef\@tempa{\endgroup
669 \mathchardef\noexpand\macc@skewchar=\number\count@\relax}%
675 \let\macc@style#1\relax
676 \def\macc@palette##1{##1\macc@style}%
677 \advance\macc@depth\m@ne
678 \ifnum\macc@depth=\z@
679 \gdef\macc@nucleus{#2}%
680 \setbox\z@\hbox{$#1#2\@empty{}\macc@skewchar$}%
681 \setbox\tw@\hbox{$#1#2\@empty\macc@skewchar$}%
682 \dimen@\tw@\wd\tw@ \advance\dimen@-\tw@\wd\z@
683 \xdef\macc@kerna{\the\dimen@\relax}%
684 \setbox4\hbox{$#1#2\acc@check\@empty$}%
685 \global\setbox\@ne\hbox to\wd4{}%
686 \ht\@ne\ht4 \dp\@ne\dp4
687 \xdef\macc@kernb{\the\wd4\relax}%
688 \mathaccent\macc@code{\box\@ne\kern\macc@kerna}%
690 \mathaccent\macc@code{\let\macc@adjust\@empty #1#2\@empty}%
696 \dimen@\macc@kerna\advance\dimen@\macc@kernb
709 \def\nonmatherr@#1{\@amsmath@err{\protect
710 #1 allowed only in math mode}\@ehd}
711 \renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin
712 {\operator@font mod}\penalty900
713 \mkern5mu\nonscript\mskip-\medmuskip}
714 \newcommand{\pod}[1]{\allowbreak
715 \if@display\mkern18mu\else\mkern8mu\fi(#1)}
716 \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}
717 \newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu
718 \else\mkern12mu\fi{\operator@font mod}\,\,#1}
719 \newcommand{\cfrac}[3][c]{{\displaystyle\frac{%
720 \strut\ifx r#1\hfill\fi#2\ifx l#1\hfill\fi}{#3}}%
721 \kern-\nulldelimiterspace}
722 \newcommand{\overset}[2]{\binrel@{#2}%
723 \binrel@@{\mathop{\kern\z@#2}\limits^{#1}}}
724 \newcommand{\underset}[2]{\binrel@{#2}%
725 \binrel@@{\mathop{\kern\z@#2}\limits_{#1}}}
726 \newcommand{\sideset}[3]{%
727 \@mathmeasure\z@\displaystyle{#3}%
728 \global\setbox\@ne\vbox to\ht\z@{}\dp\@ne\dp\z@
730 \@mathmeasure4\displaystyle{\copy\tw@#1}%
731 \@mathmeasure6\displaystyle{#3\nolimits#2}%
732 \dimen@-\wd6 \advance\dimen@\wd4 \advance\dimen@\wd\z@
733 \hbox to\dimen@{}\mathop{\kern-\dimen@\box4\box6}%
735 \renewcommand{\smash}[1][tb]{%
736 \def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}%
737 \edef\finsm@sh{\csname mb@#1\endcsname\z@\z@ \box\z@}%
738 \ifmmode \@xp\mathpalette\@xp\mathsm@sh
742 \mathchardef\std@minus\mathcode`\-\relax
743 \mathchardef\std@equal\mathcode`\=\relax
745 \mathchardef\std@minus\mathcode`\-\relax
746 \mathchardef\std@equal\mathcode`\=\relax
748 \def\relbar{\mathrel{\mathpalette\mathsm@sh\std@minus}}
749 \def\Relbar{\mathrel\std@equal}
750 \def\arrowfill@#1#2#3#4{%
751 $\m@th\thickmuskip0mu\medmuskip\thickmuskip\thinmuskip\thickmuskip
752 \relax#4#1\mkern-7mu%
753 \cleaders\hbox{$#4\mkern-2mu#2\mkern-2mu$}\hfill
756 \def\leftarrowfill@{\arrowfill@\leftarrow\relbar\relbar}
757 \def\rightarrowfill@{\arrowfill@\relbar\relbar\rightarrow}
758 \def\leftrightarrowfill@{\arrowfill@\leftarrow\relbar\rightarrow}
759 \def\Leftarrowfill@{\arrowfill@\Leftarrow\Relbar\Relbar}
760 \def\Rightarrowfill@{\arrowfill@\Relbar\Relbar\Rightarrow}
761 \def\Leftrightarrowfill@{\arrowfill@\Leftarrow\Relbar\Rightarrow}
762 \def\overarrow@#1#2#3{\vbox{\ialign{##\crcr#1#2\crcr
763 \noalign{\nointerlineskip}$\m@th\hfil#2#3\hfil$\crcr}}}
764 \renewcommand{\overrightarrow}{%
765 \mathpalette{\overarrow@\rightarrowfill@}}
766 \renewcommand{\overleftarrow}{%
767 \mathpalette{\overarrow@\leftarrowfill@}}
768 \newcommand{\overleftrightarrow}{%
769 \mathpalette{\overarrow@\leftrightarrowfill@}}
770 \def\underarrow@#1#2#3{%
771 \vtop{\ialign{##\crcr$\m@th\hfil#2#3\hfil$\crcr
772 \noalign{\nointerlineskip\kern1.3\ex@}#1#2\crcr}}}
773 \newcommand{\underrightarrow}{%
774 \mathpalette{\underarrow@\rightarrowfill@}}
775 \newcommand{\underleftarrow}{%
776 \mathpalette{\underarrow@\leftarrowfill@}}
777 \newcommand{\underleftrightarrow}{%
778 \mathpalette{\underarrow@\leftrightarrowfill@}}
779 \def\ext@arrow#1#2#3#4#5#6#7{%
781 \setbox\z@\hbox{#5\displaystyle}%
782 \setbox\tw@\vbox{\m@th
783 \hbox{$\scriptstyle\mkern#3mu{#6}\mkern#4mu$}%
784 \hbox{$\scriptstyle\mkern#3mu{#7}\mkern#4mu$}%
787 \hbox to\wd\tw@{\unhbox\z@}}%
789 \@ifnotempty{#7}{^{\if0#1\else\mkern#1mu\fi
790 #7\if0#2\else\mkern#2mu\fi}}%
791 \@ifnotempty{#6}{_{\if0#1\else\mkern#1mu\fi
792 #6\if0#2\else\mkern#2mu\fi}}}%
794 \newcommand{\xrightarrow}[2][]{\ext@arrow 0359\rightarrowfill@{#1}{#2}}
795 \newcommand{\xleftarrow}[2][]{\ext@arrow 3095\leftarrowfill@{#1}{#2}}
796 \newenvironment{subarray}[1]{%
798 \Let@ \restore@math@cr \default@tag
799 \baselineskip\fontdimen10 \scriptfont\tw@
800 \advance\baselineskip\fontdimen12 \scriptfont\tw@
801 \lineskip\thr@@\fontdimen8 \scriptfont\thr@@
802 \lineskiplimit\lineskip
803 \ialign\bgroup\ifx c#1\hfil\fi
804 $\m@th\scriptstyle##$\hfil\crcr
808 \newcommand{\substack}[1]{\subarray{c}#1\endsubarray}
809 \newenvironment{smallmatrix}{\null\,\vcenter\bgroup
810 \Let@\restore@math@cr\default@tag
811 \baselineskip6\ex@ \lineskip1.5\ex@ \lineskiplimit\lineskip
812 \ialign\bgroup\hfil$\m@th\scriptstyle##$\hfil&&\thickspace\hfil
813 $\m@th\scriptstyle##$\hfil\crcr
815 \crcr\egroup\egroup\,%
817 \renewenvironment{matrix}{%
818 \matrix@check\matrix\env@matrix
820 \endarray \hskip -\arraycolsep
822 \def\env@matrix{\hskip -\arraycolsep
823 \let\@ifnextchar\new@ifnextchar
824 \array{*\c@MaxMatrixCols c}}
825 \newcount\c@MaxMatrixCols \c@MaxMatrixCols=10
826 \def\matrix@check#1{%
827 \@xp\ifx\csname\@currenvir\endcsname#1%
828 \else\matrix@error#1%
832 \def\matrix@error#1{%
834 Old form `\string#1' should be \string\begin{\@xp\@gobble\string#1}%
836 `\string#1{...}' is old Plain-TeX syntax whose use is
837 ill-advised in LaTeX.%
840 \renewenvironment{pmatrix}{%
842 \matrix@check\pmatrix\env@matrix
846 \newenvironment{bmatrix}{\left[\env@matrix}{\endmatrix\right]}
847 \newenvironment{Bmatrix}{%
848 \left\lbrace\env@matrix
850 \endmatrix\right\rbrace
852 \newenvironment{vmatrix}{\left\lvert\env@matrix}{\endmatrix\right\rvert}
853 \newenvironment{Vmatrix}{\left\lVert\env@matrix}{\endmatrix\right\rVert}
855 \newcommand{\hdotsfor}[1]{%
856 \ifx[#1\@xp\shdots@for\else\hdots@for\@ne{#1}\fi}
857 \newmuskip\dotsspace@
858 \def\shdots@for#1]{\hdots@for{#1}}
859 \def\hdots@for#1#2{\multicolumn{#2}c%
860 {\m@th\dotsspace@1.5mu\mkern-#1\dotsspace@
861 \xleaders\hbox{$\m@th\mkern#1\dotsspace@.\mkern#1\dotsspace@$}%
863 \mkern-#1\dotsspace@}%
865 \renewenvironment{cases}{%
866 \matrix@check\cases\env@cases
871 \let\@ifnextchar\new@ifnextchar
873 \def\arraystretch{1.2}%
874 \array{@{}l@{\quad}l@{}}%
876 \newcounter{parentequation}% Counter for ``parent equation''.
877 \@ifundefined{ignorespacesafterend}{%
878 \def\ignorespacesafterend{\global\@ignoretrue}%
880 \newenvironment{subequations}{%
881 \refstepcounter{equation}%
882 \protected@edef\theparentequation{\theequation}%
883 \setcounter{parentequation}{\value{equation}}%
884 \setcounter{equation}{0}%
885 \def\theequation{\theparentequation\alph{equation}}%
888 \setcounter{equation}{\value{parentequation}}%
889 \ignorespacesafterend
891 \newcommand{\numberwithin}[3][\arabic]{%
892 \@ifundefined{c@#2}{\@nocounterr{#2}}{%
893 \@ifundefined{c@#3}{\@nocnterr{#3}}{%
894 \@addtoreset{#2}{#3}%
895 \@xp\xdef\csname the#2\endcsname{%
896 \@xp\@nx\csname the#3\endcsname .\@nx#1{#2}}}}%
898 \newcommand{\eqref}[1]{\textup{\tagform@{\ref{#1}}}}
901 \interdisplaylinepenalty\@M
902 \newcommand{\allowdisplaybreaks}[1][4]{%
903 \interdisplaylinepenalty\getdsp@pen{#1}\relax
906 \ifcase #1\@M \or 9999 \or 6999 \or 2999 \or \z@\fi
908 \newcommand{\displaybreak}{\new@ifnextchar[\dspbrk@{\dspbrk@[4]}}
909 \chardef\dspbrk@context=\sixt@@n
913 \ifcase\dspbrk@context % case 0 --- OK
914 \global\dspbrk@lvl #1\relax
915 \or % case 1 --- inside a box
917 \else % other cases --- outside of a display
918 \@amsmath@err{\Invalid@@\displaybreak}\@eha
922 \def\nogood@displaybreak{%
923 \@amsmath@err{\protect
924 \displaybreak\space cannot be applied here}%
925 {One of the enclosing environments creates an
926 unbreakable box\MessageBreak
927 (e.g., split, aligned, gathered, ...).}%
929 \def\math@cr{\relax\iffalse{\fi\ifnum0=`}\fi
930 \@ifstar{\global\@eqpen\@M\math@cr@}%
932 \ifnum\dspbrk@lvl <\z@ \interdisplaylinepenalty
933 \else -\@getpen\dspbrk@lvl \fi
935 \def\math@cr@{\new@ifnextchar[\math@cr@@{\math@cr@@[\z@]}}
936 \def\math@cr@@[#1]{\ifnum0=`{\fi \iffalse}\fi\math@cr@@@
937 \noalign{\vskip#1\relax}}
938 \def\Let@{\let\\\math@cr}
939 \def\restore@math@cr{\def\math@cr@@@{\cr}}
941 \newcommand{\intertext}{\@amsmath@err{\Invalid@@\intertext}\@eha}
944 \ifvmode\else\\\@empty\fi
946 \penalty\postdisplaypenalty\vskip\belowdisplayskip
947 \vbox{\normalbaselines
948 \ifdim\linewidth=\columnwidth
949 \else \parshape\@ne \@totalleftmargin \linewidth
952 \penalty\predisplaypenalty\vskip\abovedisplayskip%
956 {tag cannot be used at this point.\space
957 If you don't understand why^^Jyou should consult
958 the documentation.^^JBut don't worry: just continue, and I'll
959 forget what happened.}
960 \def\gobble@tag{\@ifstar\@gobble\@gobble}
961 \def\invalid@tag#1{\@amsmath@err{#1}{\the\tag@help}\gobble@tag}
962 \def\dft@tag{\invalid@tag{\string\tag\space not allowed here}}
963 \def\default@tag{\let\tag\dft@tag}
965 \def\maketag@@{\@ifstar\maketag@@@\tagform@}
966 \def\maketag@@@#1{\hbox{\m@th\normalfont#1}}
967 \def\tagform@#1{\maketag@@@{(\ignorespaces#1\unskip\@@italiccorr)}}
969 \def\@eqnnum{\hbox to1sp{}\rlap{\normalfont\normalcolor
970 \hskip -\displaywidth\tagform@\theequation}}
972 \def\@eqnnum{{\normalfont\normalcolor \tagform@\theequation}}
974 \newcommand{\thetag}{\leavevmode\tagform@}
976 \def\make@df@tag{\@ifstar\make@df@tag@@\make@df@tag@@@}
977 \def\make@df@tag@@#1{%
978 \gdef\df@tag{\maketag@@@{#1}\def\@currentlabel{#1}}}
979 \def\make@df@tag@@@#1{\gdef\df@tag{\tagform@{#1}%
980 \toks@\@xp{\p@equation{#1}}\edef\@currentlabel{\the\toks@}}}
982 \def\label@in@display{%
983 \ifx\df@label\@empty\else
984 \@amsmath@err{Multiple \string\label's:
985 label '\df@label' will be lost}\@eha
989 \toks@\@xp{\@arrayparboxrestore \let\label\ltx@label}%
990 \edef\@arrayboxrestore{\the\toks@}
992 \def\make@display@tag{%
993 \if@eqnsw \incr@eqnum \print@eqnum
994 \else \iftag@ \df@tag \global\let\df@tag\@empty \fi
1000 \@xp\ltx@label\@xp{\df@label}%
1001 \global\let\df@label\@empty
1008 \DN@{\invalid@tag{Multiple \string\tag}}%
1012 \let\next@\make@df@tag
1016 \newcommand{\raisetag}[1]{\skip@#1\relax
1017 \xdef\raise@tag{\vskip\iftagsleft@\else-\fi\the\skip@\relax}%
1019 \let\raise@tag\@empty
1020 \newcommand{\notag}{\nonumber}
1021 \renewcommand{\nonumber}{%
1023 \ifx\incr@eqnum\@empty \addtocounter{equation}\m@ne \fi
1025 \let\print@eqnum\@empty \let\incr@eqnum\@empty
1028 \def\print@eqnum{\tagform@\theequation}
1029 \def\incr@eqnum{\refstepcounter{equation}\let\incr@eqnum\@empty}
1032 \@xp\def\@xp\@arrayparboxrestore\@xp{\@arrayparboxrestore
1033 \ingather@false\inalign@false \default@tag
1034 \let\spread@equation\@spread@equation
1035 \let\reset@equation\@empty
1036 \def\print@eqnum{\tagform@\theequation}%
1037 \def\incr@eqnum{\refstepcounter{equation}\let\incr@eqnum\@empty}%
1046 \global\advance\column@\@ne
1048 \newcount\maxfields@
1049 \def\add@amp#1{\if m#1&\@xp\add@amp\fi}
1052 \count@#1\advance\count@-\column@
1053 \edef\@tempa{\endgroup
1054 \@xp\add@amp\romannumeral\number\count@ 000q}%
1058 {An extra & here is so disastrous that you should probably exit^^J
1063 \newcommand{\mintagsep}{.5\fontdimen6\textfont\tw@}
1064 \newcommand{\minalignsep}{10pt}
1069 \ifcase\@xp#1\tag@lengths\fi
1072 \def\savetaglength@{%
1075 \xdef\tag@lengths{\tag@lengths\or \the\wdz@}%
1080 \ifcase\@xp#1\tag@shifts\fi\relax
1083 \let\tag@shifts\@empty
1087 \xdef\tag@shifts{\or#1\tag@shifts}%
1090 \def\spread@equation{\reset@strutbox@
1091 \openup\jot \let\spread@equation\@empty}
1092 \let\@spread@equation\spread@equation
1093 \def\displ@y{\@display@init{}}
1094 \def\@display@init#1{%
1095 \global\dt@ptrue \spread@equation
1101 \vskip-\lineskiplimit
1102 \vskip\normallineskiplimit
1104 \penalty\@eqpen \global\dspbrk@lvl\m@ne
1109 \def\displ@y@{\@display@init{%
1110 \global\column@\z@ \global\dspbrk@lvl\m@ne
1111 \global\tag@false \global\let\raise@tag\@empty
1115 \ifdim#1>\displaywidth
1118 \vskip-\ht\strutbox@
1119 \vskip-\dp\strutbox@
1120 \vbox{\noindent\hbox to#1{\strut@\hfill}}%
1125 \def\savecounters@{%
1128 \global\csname c@##1\endcsname\the\csname c@##1\endcsname}%
1131 \let\@nx\restorecounters@\@nx\@empty
1134 \let\restorecounters@\@gtempa
1136 \let\restorecounters@\@empty
1137 \def\savealignstate@{%
1141 \global\totwidth@\the\totwidth@
1142 \global\row@\the\row@
1143 \gdef\@nx\tag@lengths{\tag@lengths}%
1144 \let\@nx\restorealignstate@\@nx\@empty
1147 \let\restorealignstate@\@gtempa
1150 \let\restorealignstate@\@empty
1152 \edef\restorecolumn@{%
1153 \global\column@\number\column@
1154 \let\@nx\restorecolumn@\@nx\@empty
1157 \let\restorecolumn@\@empty
1159 \def\addto@envbody#1{\global\@envbody\@xp{\the\@envbody#1}}
1160 \def\collect@body#1{%
1161 \@envbody{\@xp#1\@xp{\the\@envbody}}%
1162 \edef\process@envbody{\the\@envbody\@nx\end{\@currenvir}}%
1163 \@envbody\@emptytoks \def\begin@stack{b}%
1165 \@xp\let\csname\@currenvir\endcsname\collect@@body
1166 \edef\process@envbody{\@xp\@nx\csname\@currenvir\endcsname}%
1169 \def\push@begins#1\begin#2{%
1170 \ifx\end#2\else b\@xp\push@begins\fi
1172 \def\collect@@body#1\end#2{%
1173 \edef\begin@stack{\push@begins#1\begin\end \@xp\@gobble\begin@stack}%
1174 \ifx\@empty\begin@stack
1179 \addto@envbody{#1\end{#2}}%
1181 \process@envbody % A little tricky! Note the grouping
1183 \def\math@cr@@@aligned{%
1184 \ifodd\column@ \let\next@\@empty
1185 \else \def\next@{&\kern-\alignsep@}%
1189 \newcommand{\start@aligned}[2]{%
1191 \nonmatherr@{\begin{\@currenvir}}%
1193 \savecolumn@ % Assumption: called inside a group
1195 \if #1t\vtop \else \if#1b \vbox \else \vcenter \fi \fi \bgroup
1197 \ifnum\maxfields@>\m@ne
1198 \multiply\maxfields@\tw@
1199 \let\math@cr@@@\math@cr@@@alignedat
1202 \let\math@cr@@@\math@cr@@@aligned
1203 \alignsep@\minalignsep
1205 \Let@ \chardef\dspbrk@context\@ne
1207 \spread@equation % no-op if already called
1213 $\m@th\displaystyle{##}$%
1216 $\m@th\displaystyle{{}##}$%
1221 \def\math@cr@@@alignedat{%
1222 \ifnum\column@>\maxfields@
1225 \@amsmath@err{Extra & on this line}%
1226 {\the\andhelp@}% "An extra & here is disastrous"
1232 \def\alignsafe@testopt#1#2{%
1233 \relax\iffalse{\fi\ifnum`}=0\fi
1235 {\let\@let@token\relax \ifnum`{=\z@\fi\iffalse}\fi#1}%
1236 {\let\@let@token\relax \ifnum`{=\z@\fi\iffalse}\fi#1[#2]}%
1238 \newenvironment{aligned}{%
1239 \let\@testopt\alignsafe@testopt
1246 \newcommand{\aligned@a}[1][c]{\start@aligned{#1}\m@ne}
1247 \newenvironment{alignedat}{%
1248 \let\@testopt\alignsafe@testopt
1253 \newcommand{\alignedat@a}[1][c]{\start@aligned{#1}}
1254 \newenvironment{gathered}[1][c]{%
1256 \nonmatherr@{\begin{gathered}}%
1259 \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi \bgroup
1260 \Let@ \chardef\dspbrk@context\@ne \restore@math@cr
1263 \hfil\strut@$\m@th\displaystyle##$\hfil
1268 \def\start@gather#1{%
1271 \DN@{\@namedef{end\@currenvir}{}\@gobble}%
1275 \ifst@rred \else \global\@eqnswtrue \fi
1280 \newenvironment{gather}{%
1281 \start@gather\st@rredfalse
1283 \math@cr \black@\totwidth@ \egroup
1284 $$\ignorespacesafterend
1287 \newenvironment{gather*}{%
1288 \start@gather\st@rredtrue
1293 \ingather@true \let\split\insplit@
1294 \let\tag\tag@in@align \let\label\label@in@display
1295 \chardef\dspbrk@context\z@
1296 \intertext@ \displ@y@ \Let@
1297 \let\math@cr@@@\math@cr@@@gather
1299 \global\shifttag@false
1302 \halign to\displaywidth\bgroup
1304 \setboxz@h{$\m@th\displaystyle{##}$}%
1308 &\setboxz@h{\strut@{##}}%
1310 \tabskip \iftagsleft@ \gdisplaywidth@ \else \z@skip \span\fi
1318 \global\let\tag@lengths\@empty
1321 \everycr{\noalign{\global\tag@false
1322 \global\let\raise@tag\@empty \global\column@\z@}}%
1325 \setboxz@h{$\m@th\displaystyle{##}$}%
1326 \ifdim\wdz@>\totwidth@
1327 \global\totwidth@\wdz@
1329 &\setboxz@h{\strut@{##}}%
1338 \global\advance\totwidth@\@mathmargin
1341 \ifdim\totwidth@>\displaywidth
1342 \global\let\gdisplaywidth@\totwidth@
1344 \global\let\gdisplaywidth@\displaywidth
1349 \def\math@cr@@@gather{%
1350 \ifst@rred\nonumber\fi
1353 \ifst@rred\else\global\@eqnswtrue\fi
1354 \global\advance\row@\@ne
1357 \def\calc@shift@gather{%
1358 \dimen@\mintagsep\relax
1359 \tagwidth@\tag@width\row@\relax
1361 \global\eqnshift@\@mathmargin
1362 \ifdim\tagwidth@>\z@
1363 \advance\dimen@\tagwidth@
1365 \ifdim\dimen@>\@mathmargin
1366 \global\shifttag@true
1369 \advance\dimen@\@mathmargin
1370 \advance\dimen@\wdz@
1371 \ifdim\dimen@>\displaywidth
1372 \global\shifttag@true
1377 \global\eqnshift@\displaywidth
1378 \global\advance\eqnshift@-\wdz@
1379 \ifdim\tagwidth@>\z@
1380 \multiply\dimen@\tw@
1381 \advance\dimen@\wdz@
1382 \advance\dimen@\tagwidth@
1383 \ifdim\dimen@>\displaywidth
1384 \global\shifttag@true
1386 \ifdim\eqnshift@<4\tagwidth@
1387 \global\advance\eqnshift@-\tagwidth@
1391 \global\divide\eqnshift@\tw@
1393 \global\eqnshift@-\eqnshift@
1394 \global\advance\eqnshift@\displaywidth
1395 \global\advance\eqnshift@-\wdz@
1397 \ifdim\eqnshift@<\z@
1398 \global\eqnshift@\z@
1402 \def\place@tag@gather{%
1404 \kern-\gdisplaywidth@
1412 \global\shifttag@false
1417 \ifdim\totwidth@>\displaywidth
1419 \advance\dimen@-\displaywidth
1431 \global\shifttag@false
1437 \def\set@gather@field{%
1439 \global\lineht@\ht\z@
1441 \global\lineht@\dp\z@
1451 \let\xatlevel@\@empty
1452 \def\start@align#1#2#3{%
1453 \let\xatlevel@#1% always \z@, \@ne, or \tw@
1455 \ifnum\maxfields@>\m@ne
1457 \ifnum\xatlevel@=\tw@
1460 \multiply\maxfields@\tw@
1465 \iffalse{\fi\ifnum0=`}\fi
1466 \DN@{\vcenter\bgroup\savealignstate@\align@#2}%
1470 \DN@{\align@recover}%
1473 \DN@{\@namedef{end\@currenvir}{}\@gobble}%
1483 \def\align@recover#1#2#3{%
1486 Erroneous nesting of equation structures;\MessageBreak
1487 trying to recover with `aligned'%
1489 \begin{aligned}\relax#1\end{aligned}%
1491 \newenvironment{alignat}{%
1492 \start@align\z@\st@rredfalse
1496 \newenvironment{alignat*}{%
1497 \start@align\z@\st@rredtrue
1501 \newenvironment{xalignat}{%
1502 \start@align\@ne\st@rredfalse
1506 \newenvironment{xalignat*}{%
1507 \start@align\@ne\st@rredtrue
1511 \newenvironment{xxalignat}{%
1512 \start@align\tw@\st@rredtrue
1516 \newenvironment{align}{%
1517 \start@align\@ne\st@rredfalse\m@ne
1519 \math@cr \black@\totwidth@
1525 \ifnum0=`{\fi\iffalse}\fi
1529 \ignorespacesafterend
1531 \newenvironment{align*}{%
1532 \start@align\@ne\st@rredtrue\m@ne
1536 \newenvironment{flalign}{%
1537 \start@align\tw@\st@rredfalse\m@ne
1541 \newenvironment{flalign*}{%
1542 \start@align\tw@\st@rredtrue\m@ne
1547 \inalign@true \intertext@ \Let@ \chardef\dspbrk@context\z@
1548 \ifingather@\else\displ@y@\fi
1549 \let\math@cr@@@\math@cr@@@align
1550 \ifxxat@\else \let\tag\tag@in@align \fi
1551 \let\label\label@in@display
1553 \ifst@rred\else \global\@eqnswtrue \fi
1558 \span\align@preamble\crcr
1561 \def\math@cr@@@align{%
1562 \ifst@rred\nonumber\fi
1563 \if@eqnsw \global\tag@true \fi
1564 \global\advance\row@\@ne
1565 \add@amps\maxfields@
1569 \setboxz@h{\@lign\strut@{\make@display@tag}}%
1572 \ifst@rred\else\global\@eqnswtrue\fi
1576 \def\math@cr@@@align@measure{%
1578 \global\advance\row@\@ne
1579 \ifst@rred\nonumber\fi
1580 \if@eqnsw \global\tag@true \fi
1581 \ifnum\column@>\maxfields@
1585 \@amsmath@err{Extra & on this line}%
1586 {\the\andhelp@}% "An extra & here is disastrous"
1589 \global\maxfields@\column@
1592 \setboxz@h{\@lign\strut@{%
1594 \stepcounter{equation}%
1595 \tagform@\theequation
1601 \ifst@rred\else\global\@eqnswtrue\fi
1604 \let\field@lengths\@empty
1606 \def\savefieldlength@{%
1609 \xdef\field@lengths{%
1621 \def\fieldlengths@#1{%
1622 \ifcase\@xp#1\field@lengths\fi
1624 \let\maxcolumn@widths\@empty
1625 \def\maxcol@width#1{%
1626 \ifcase\@xp#1\maxcolumn@widths\fi\relax
1631 \global\eqnshift@\z@
1632 \global\alignsep@\z@
1633 \global\let\tag@lengths\@empty
1634 \global\let\field@lengths\@empty
1636 \global\setbox0\vbox{%
1637 \let\math@cr@@@\math@cr@@@align@measure
1638 \everycr{\noalign{\global\tag@false
1639 \global\let\raise@tag\@empty \global\column@\z@}}%
1643 \halign{\span\align@preamble\crcr
1647 \add@amps\maxfields@\cr
1652 \global\advance\maxfields@\@ne
1654 \ifnum\xatlevel@=\tw@
1655 \ifnum\maxfields@<\thr@@
1660 \unvbox\z@ \unpenalty \global\setbox\@ne\lastbox
1662 \global\totwidth@\wd\@ne
1663 \if@fleqn \global\advance\totwidth@\@mathmargin \fi
1664 \global\let\maxcolumn@widths\@empty
1668 \global\setbox\@ne\hbox{%
1669 \unhbox\@ne \unskip \global\setbox\thr@@\lastbox
1672 \xdef\maxcolumn@widths{ \or \the\wd\thr@@ \maxcolumn@widths}%
1675 \dimen@\displaywidth
1676 \advance\dimen@-\totwidth@
1678 \global\alignsep@\z@
1683 \global\eqnshift@\@mathmargin
1686 \global\eqnshift@\dimen@
1687 \global\divide\eqnshift@\@tempcnta
1690 \@tempcntb\maxfields@
1691 \divide\@tempcntb\tw@
1692 \@tempcnta\@tempcntb
1693 \advance\@tempcntb\m@ne
1695 \global\eqnshift@\@mathmargin
1696 \global\alignsep@\dimen@
1697 \global\divide\alignsep@\@tempcnta
1699 \global\advance\@tempcnta\@ne
1700 \global\eqnshift@\dimen@
1701 \global\divide\eqnshift@\@tempcnta
1702 \global\alignsep@\eqnshift@
1705 \@tempcntb\maxfields@
1706 \divide\@tempcntb\tw@
1707 \global\advance\@tempcntb\m@ne
1708 \global\@tempcnta\@tempcntb
1709 \global\eqnshift@\z@
1710 \global\alignsep@\dimen@
1712 \global\advance\alignsep@\@mathmargin\relax
1714 \global\divide\alignsep@\@tempcntb
1716 \ifdim\alignsep@<\minalignsep\relax
1717 \global\alignsep@\minalignsep\relax
1718 \ifdim\eqnshift@>\z@
1720 \global\eqnshift@\displaywidth
1721 \global\advance\eqnshift@-\totwidth@
1722 \global\advance\eqnshift@-\@tempcntb\alignsep@
1723 \global\divide\eqnshift@\tw@
1727 \ifdim\eqnshift@<\z@
1728 \global\eqnshift@\z@
1731 \global\tagshift@\totwidth@
1732 \global\advance\tagshift@\@tempcntb\alignsep@
1734 \ifnum\xatlevel@=\tw@
1735 \global\advance\tagshift@-\@mathmargin\relax
1738 \global\advance\tagshift@\eqnshift@
1741 \global\advance\tagshift@-\displaywidth
1743 \dimen@\minalignsep\relax
1744 \global\advance\totwidth@\@tempcntb\dimen@
1745 \ifdim\totwidth@>\displaywidth
1746 \global\let\displaywidth@\totwidth@
1748 \global\let\displaywidth@\displaywidth
1752 \iftagsleft@\if@fleqn
1753 \def\calc@shift@align{%
1754 \global\let\tag@shifts\@empty
1756 \@tempdima\@mathmargin\relax
1757 \advance\@tempdima-\mintagsep\relax
1760 \ifdim\tag@width\row@>\z@
1769 \def\x@calc@shift@lf{%
1770 \ifdim\eqnshift@=\z@
1771 \global\eqnshift@\@mathmargin\relax
1772 \alignsep@\displaywidth
1773 \advance\alignsep@-\totwidth@
1774 \global\divide\alignsep@\@tempcntb
1775 \ifdim\alignsep@<\minalignsep\relax
1776 \global\alignsep@\minalignsep\relax
1779 \ifdim\tag@width\row@>\@tempdima
1786 \iftagsleft@\else\if@fleqn
1787 \def\calc@shift@align{%
1788 \global\let\tag@shifts\@empty
1792 \ifdim\tag@width\row@>\z@
1801 \def\x@calc@shift@rf{%
1805 \edef\@tempb{\fieldlengths@\row@}%
1806 \@for\@tempa:=\@tempb\do{%
1807 \advance\column@\@ne
1811 \advance\column@\m@ne
1813 \ifnum\@tempcntb>\column@
1814 \advance\@tempcnta-\@tempcntb
1815 \advance\@tempcnta\column@
1818 \tagwidth@\tag@width\row@\relax
1819 \@tempdima\eqnshift@
1820 \advance\@tempdima\@tempdimc\relax
1821 \advance\@tempdima\tagwidth@
1822 \dimen@\minalignsep\relax
1823 \multiply\dimen@\@tempcntb
1824 \advance\dimen@\mintagsep\relax
1825 \advance\dimen@\@tempdima
1826 \ifdim\dimen@>\displaywidth
1830 \dimen@\alignsep@\relax
1831 \multiply\dimen@\@tempcntb
1832 \advance\dimen@\@tempdima
1833 \advance\dimen@\tagwidth@
1834 \ifdim\dimen@>\displaywidth
1835 \dimen@\displaywidth
1836 \advance\dimen@-\@tempdima
1837 \ifnum\xatlevel@=\tw@
1838 \advance\dimen@-\mintagsep\relax
1840 \divide\dimen@\@tempcnta
1841 \ifdim\dimen@<\minalignsep\relax
1842 \global\alignsep@\minalignsep\relax
1844 \global\alignsep@\dimen@
1851 \iftagsleft@\else\if@fleqn\else
1852 \def\calc@shift@align{%
1853 \global\let\tag@shifts\@empty
1857 \ifdim\tag@width\row@>\z@
1866 \def\x@calc@shift@rc{%
1870 \edef\@tempb{\fieldlengths@\row@}%
1871 \@for\@tempa:=\@tempb\do{%
1872 \advance\column@\@ne
1876 \advance\column@\m@ne
1878 \ifnum\@tempcntb>\column@
1879 \advance\@tempcnta-\@tempcntb
1880 \advance\@tempcnta\column@
1883 \tagwidth@\tag@width\row@\relax
1884 \@tempdima\@tempdimc
1885 \advance\@tempdima\tagwidth@
1886 \dimen@\minalignsep\relax
1887 \multiply\dimen@\@tempcntb
1888 \advance\dimen@\mintagsep\relax
1889 \ifnum\xatlevel@=\tw@ \else
1890 \advance\dimen@\mintagsep\relax
1892 \advance\dimen@\@tempdima
1893 \ifdim\dimen@>\displaywidth
1898 \advance\dimen@\@tempdima
1899 \advance\dimen@\@tempcntb\alignsep@
1900 \advance\dimen@\tagwidth@
1901 \ifdim\dimen@>\displaywidth
1902 \dimen@\displaywidth
1903 \advance\dimen@-\@tempdima
1904 \ifnum\xatlevel@=\tw@
1905 \advance\dimen@-\mintagsep\relax
1907 \divide\dimen@\@tempcnta
1908 \ifdim\dimen@<\minalignsep\relax
1909 \global\alignsep@\minalignsep\relax
1910 \eqnshift@\displaywidth
1911 \advance\eqnshift@-\@tempdima
1912 \advance\eqnshift@-\@tempcntb\alignsep@
1913 \global\divide\eqnshift@\tw@
1915 \ifdim\dimen@<\eqnshift@
1917 \global\eqnshift@\z@
1919 \global\eqnshift@\dimen@
1922 \ifdim\dimen@<\alignsep@
1923 \global\alignsep@\dimen@
1932 \def\x@rcalc@width{%
1934 \advance\@tempdimc\@tempdimb
1936 \advance\@tempdimc\maxcol@width\column@
1939 \advance\@tempdimc\@tempa\relax
1940 \@tempdimb\maxcol@width\column@
1941 \advance\@tempdimb-\@tempa\relax
1944 \advance\@tempdimb\maxcol@width\column@\relax
1948 \iftagsleft@\if@fleqn\else
1949 \def\calc@shift@align{%
1950 \global\let\tag@shifts\@empty
1954 \ifdim\tag@width\row@>\z@
1963 \def\x@calc@shift@lc{%
1965 \@tempdima\z@ % ``width of equation''
1966 \@tempdimb\z@ % ``indent of equation''
1967 \edef\@tempb{\fieldlengths@\row@}%
1968 \@for\@tempa:=\@tempb\do{%
1969 \advance\column@\@ne
1973 \tagwidth@\tag@width\row@\relax
1974 \@tempdima\totwidth@
1975 \advance\@tempdima-\@tempdimb
1976 \advance\@tempdima\tagwidth@
1977 \dimen@\minalignsep\relax
1978 \multiply\dimen@\@tempcntb
1979 \advance\dimen@\mintagsep\relax
1980 \ifnum\xatlevel@=\tw@ \else
1981 \advance\dimen@\mintagsep\relax
1983 \advance\dimen@\@tempdima
1984 \ifdim\dimen@>\displaywidth
1989 \multiply\dimen@\count@
1990 \advance\dimen@\eqnshift@
1991 \advance\dimen@\@tempdimb
1992 \ifdim\dimen@<2\tagwidth@
1993 \dimen@\displaywidth
1994 \advance\dimen@-\@tempdima
1995 \ifnum\xatlevel@=\tw@
1996 \advance\dimen@-\mintagsep\relax
1998 \ifnum\@tempcnta>\z@
1999 \divide\dimen@\@tempcnta
2002 \ifdim\dimen@<\minalignsep\relax
2003 \global\alignsep@\minalignsep\relax
2004 \dimen@\displaywidth
2005 \advance\dimen@-\@tempdima
2006 \advance\dimen@-\@tempcntb\alignsep@
2007 \global\divide\dimen@\tw@
2009 \ifdim\dimen@<\alignsep@
2010 \global\alignsep@\dimen@
2013 \ifnum\xatlevel@=\tw@
2014 \dimen@\mintagsep\relax
2016 \advance\dimen@\tagwidth@
2017 \advance\dimen@-\@tempdimb
2018 \advance\dimen@-\count@\alignsep@
2019 \ifdim\dimen@>\eqnshift@
2020 \global\eqnshift@\dimen@
2026 \def\x@lcalc@width{%
2027 \ifdim\@tempdima = \z@
2031 \advance\@tempdimb \maxcol@width\column@
2032 \advance\@tempdimb-\@tempa
2035 \advance\count@\m@ne
2037 \advance\@tempcnta-\count@
2038 \advance\@tempcntb-\count@
2040 \advance\@tempdimb \maxcol@width\column@\relax
2048 \if1\shift@tag\row@\relax
2061 \if1\shift@tag\row@\relax
2075 \def\align@preamble{%
2078 \setboxz@h{\@lign$\m@th\displaystyle{##}$}%
2079 \ifmeasuring@\savefieldlength@\fi
2082 &\setboxz@h{\@lign$\m@th\displaystyle{{}##}$}%
2083 \ifmeasuring@\savefieldlength@\fi
2091 \ifdim\ht\z@>\lineht@
2092 \global\lineht@\ht\z@
2095 \ifdim\dp\z@>\lineht@
2096 \global\lineht@\dp\z@
2103 \string\begin{split} won't work here%
2106 Did you forget a preceding \string\begin{equation}?^^J%
2107 If not, perhaps the `aligned' environment is what
2108 you want.\endcsname}%
2110 \newenvironment{split}{%
2113 \@xp\@xp\@xp\split@aligned
2115 \ifst@rred \else \global\@eqnswtrue \fi
2117 \else \let\endsplit\@empty \@xp\collect@body\@xp\split@err
2119 \collect@body\gather@split
2124 \iftagsleft@ \@xp\lendsplit@ \else \@xp\rendsplit@ \fi
2126 \let\split@tag\relax % init
2127 \def\gather@split#1#2#3{%
2128 \@xp\endgroup \reset@equation % math@cr will handle equation numbering
2130 \toks@\@xp{\df@tag}%
2132 \gdef\@nx\df@tag{\the\toks@}%
2133 \global\@nx\tag@true \@nx\nonumber
2135 \else \let\split@tag\@empty
2139 \gather@{\split@tag \begin{split}#1\end{split}}%
2140 \def\endmathdisplay@a{%
2141 \math@cr \black@ \totwidth@ \egroup
2146 \global\setbox\z@\vbox\bgroup
2147 \Let@ \chardef\dspbrk@context\@ne \restore@math@cr
2148 \default@tag % disallow use of \tag here
2152 $\m@th\displaystyle{##}$%
2153 &$\m@th\displaystyle{{}##}$%
2154 \hfill % Why not \hfil?---dmj, 1994/12/28
2159 \global\setbox9 \vtop{%
2161 \global\setbox8 \lastbox
2167 \global\setbox\tw@\lastbox
2169 \global\setbox\thr@@\lastbox
2173 \hbox to\wd\thr@@{}%
2174 &\vcenter{\vbox{\moveleft\wd\thr@@\boxz@}}%
2177 \global\setbox7 \hbox{\unhbox\tw@\unskip}%
2179 \global\@tempcnta\column@
2182 \global\advance\row@\@ne
2183 \vbox{\moveleft\wd\thr@@\box9}%
2185 \noalign{\global\lineht@\z@}%
2193 \gdef\split@{\vcenter{\boxz@}}%
2203 \global\setbox9\vtop{\unvcopy\z@}%
2207 \global\setbox8\lastbox
2214 \global\setbox\thr@@\lastbox
2218 \hbox to\wd\thr@@{}%
2219 &\vcenter{\vbox{\moveleft\wd\thr@@\box9}}%
2223 \hbox to\wd\thr@@{}%
2224 &\vbox{\moveleft\wd\thr@@\box9}%
2229 \gdef\split@{\vcenter{\box9}}%
2231 \gdef\split@{\box9}%
2236 \def\split@aligned#1#2{%
2237 \iffalse{\fi\ifnum0=`}\fi
2238 \collect@body\split@al@a}
2239 \def\split@al@a#1#2#3{%
2242 \toks@{\begin{aligned}}%
2243 \if@fleqn \split@al@tagcheck \fi
2244 \the\toks@\relax#1\end{aligned}%
2245 \ifnum0=`{\fi\iffalse}\fi
2247 \def\split@al@tagcheck{%
2250 \iftagsleft@ \toks@\@xp{\the\toks@ [t]}%
2251 \else \toks@\@xp{\the\toks@ [b]}%
2255 \def\split@warning{%
2256 \PackageWarning{amsmath}{%
2257 Cannot use `split' here;\MessageBreak trying to recover with `aligned'}%
2259 \newskip\multlinegap
2261 \newskip\multlinetaggap
2263 \def\start@multline#1{%
2266 \DN@{\@namedef{end\@currenvir}{}\@gobble}%
2275 \let\next@\multline@
2279 \newenvironment{multline}{%
2280 \start@multline\st@rredfalse
2282 \iftagsleft@ \@xp\lendmultline@ \else \@xp\rendmultline@ \fi
2283 \ignorespacesafterend
2285 \newenvironment{multline*}{\start@multline\st@rredtrue}{\endmultline}
2288 \@display@init{\global\advance\row@\@ne \global\dspbrk@lvl\m@ne}%
2289 \chardef\dspbrk@context\z@
2291 \let\tag\tag@in@align
2292 \global\tag@false \global\let\raise@tag\@empty
2294 \let\tag\gobble@tag \let\label\@gobble
2295 \tabskip \if@fleqn \@mathmargin \else \z@skip \fi
2296 \totwidth@\displaywidth
2298 \advance\totwidth@-\@mathmargin
2301 \hbox to\totwidth@{%
2303 \hskip \@centering \relax
2308 $\m@th\displaystyle{}##\endmultline@math
2314 \def\multline@indent{\hskip\@mathmargin}% put it back
2317 \def\multline@indent{\hskip\multlinegap}%
2334 \setbox\z@\hbox{\make@display@tag}%
2335 \dimen@\@mathmargin \advance\dimen@-\wd\z@
2336 \ifdim\dimen@<\multlinetaggap
2337 \dimen@\multlinetaggap
2339 \box\z@ \hskip\dimen@\relax
2350 \def\endmultline@math{$}
2351 \def\lendmultline@{%
2358 \def\rendmultline@{%
2360 $\let\endmultline@math\relax
2369 \hbox{\strut@\make@display@tag}%
2372 \hskip\multlinetaggap
2386 \begingroup\measuring@false\label@in@display{##1}\endgroup}%
2387 \def\math@cr@@@{\cr}%
2388 \let\shoveleft\@iden \let\shoveright\@iden
2392 \global\let\df@tag\@empty
2394 \setboxz@h{\@lign$\m@th\displaystyle{}##$}%
2397 \global\totwidth@\wdz@
2398 \global\lineht@\ht\z@
2401 \global\totwidth@\wdz@
2402 \global\lineht@\dp\z@
2409 \ifx\df@tag\@empty\else\global\tag@true\fi
2410 \if@eqnsw\global\tag@true\fi
2414 \stepcounter{equation}%
2415 \tagform@\theequation
2420 \global\tagwidth@\wdz@
2422 \advance\dimen@\tagwidth@
2423 \advance\dimen@\multlinetaggap
2426 \advance\dimen@\@mathmargin
2429 \ifdim\dimen@>\displaywidth
2430 \global\shifttag@true
2432 \global\shifttag@false
2453 \hskip\multlinetaggap
2462 \def\shoveleft#1{#1}%
2466 \setboxz@h{$\m@th\displaystyle{}#1$}%
2467 \setbox\@ne\hbox{$\m@th\displaystyle#1$}%
2474 \hskip\multlinetaggap
2485 \setboxz@h{$\m@th\displaystyle{}#1$}%
2486 \setbox\@ne\hbox{$\m@th\displaystyle#1$}%
2495 \@saveprimitive\leqno\@@leqno
2496 \@saveprimitive\eqno\@@eqno
2497 \def\eqno{\@@eqno\let\eqno\relax\let\leqno\relax}
2498 \def\leqno{\@@leqno\let\leqno\relax\let\eqno\relax}
2500 \iftagsleft@ \let\veqno=\@@leqno \fi
2501 \@ifundefined{SK@@label}{%
2502 \let\SK@@label\relax \let\SK@equationtrue\relax
2504 \let\reset@equation\@empty
2506 \def\tag@in@display#1#{\relax\tag@in@display@a{#1}}
2507 \def\tag@in@display@a#1#2{%
2509 \invalid@tag{Multiple \string\tag}\relax
2511 \global\tag@true \nonumber \reset@equation \st@rredtrue
2513 \gdef\alt@tag{\def\SK@tagform@{#2\@gobble}%
2514 \ifx\SK@@label\relax \let\tagform@\SK@tagform@ \fi
2518 \make@df@tag@@@{#2}%
2522 \let\restore@hfuzz\@empty
2523 \def\mathdisplay#1{%
2526 $$\def\@currenvir{#1}%
2527 \let\dspbrk@context\z@
2528 \let\tag\tag@in@display \let\label\label@in@display \SK@equationtrue
2529 \global\let\df@label\@empty \global\let\df@tag\@empty
2531 \let\mathdisplay@push\mathdisplay@@push
2532 \let\mathdisplay@pop\mathdisplay@@pop
2534 \edef\restore@hfuzz{\hfuzz\the\hfuzz\relax}%
2536 \setbox\z@\hbox to\displaywidth\bgroup
2537 \let\split@warning\relax \restore@hfuzz
2538 \everymath\@emptytoks \m@th $\displaystyle
2542 \def\endmathdisplay#1{%
2543 \ifmmode \else \@badmath \fi
2546 \global\let\df@label\@empty \global\let\df@tag\@empty
2547 \global\tag@false \global\let\alt@tag\@empty
2550 \def\endmathdisplay@a{%
2551 \if@eqnsw \gdef\df@tag{\tagform@\theequation}\fi
2552 \if@fleqn \@xp\endmathdisplay@fleqn
2553 \else \ifx\df@tag\@empty \else \veqno \alt@tag \df@tag \fi
2554 \ifx\df@label\@empty \else \@xp\ltx@label\@xp{\df@label}\fi
2556 \ifnum\dspbrk@lvl>\m@ne
2557 \postdisplaypenalty -\@getpen\dspbrk@lvl
2558 \global\dspbrk@lvl\m@ne
2562 \def\endmathdisplay@fleqn{%
2563 $\hfil\hskip\@mathmargin\egroup
2564 \ifnum\badness<\inf@bad \let\too@wide\@ne \else \let\too@wide\z@ \fi
2567 \setbox4\hbox{\df@tag
2568 \ifx\df@label\@empty \else \@xp\ltx@label\@xp{\df@label}\fi
2572 \ifx\df@tag\@empty U\else \iftagsleft@ L\else R\fi\fi
2577 \ifodd\too@wide % not too wide: just need to swap the glue around
2578 \hbox to\displaywidth{\hskip\@mathmargin\unhbox\z@\unskip}%
2579 \else % M+B > displaywidth
2584 \hbox to\columnwidth{%
2585 \ifdim\displayindent>\z@
2586 \hskip\displayindent minus\displayindent
2588 \hskip\@mathmargin \unhbox\z@ \unskip
2590 \displayindent\z@ \displaywidth\columnwidth
2593 \setbox\tw@\hbox to\displaywidth{%
2594 \hskip\@mathmargin \unhcopy\z@\unskip\hfil\hskip\mintagsep\copy4
2597 \ifnum\badness<\inf@bad \box\tw@ \else \emdf@Ra \fi
2600 \skip@\displayindent minus\displayindent
2601 \displayindent\z@ \displaywidth\columnwidth
2602 \spread@equation \everycr{}\tabskip\z@skip
2603 \halign{\hbox to\displaywidth{##}\cr
2605 \ifdim\skip@>\z@ \hskip\skip@ \fi
2606 \hskip\@mathmargin\unhbox\z@\unskip\hfil\cr
2607 \noalign{\raise@tag}%
2611 \@tempdima\@mathmargin
2612 \advance\@tempdima-\wd4 \advance\@tempdima-\mintagsep
2613 \skip@\@tempdima minus\@tempdima
2614 \setbox\tw@\hbox to\displaywidth{%
2615 \copy4\hskip\mintagsep
2616 \ifdim\skip@>\z@ \hskip\skip@\fi
2620 \ifnum\badness<\inf@bad \box\tw@ \else \emdf@La \fi
2623 \spread@equation \everycr{}\tabskip\z@skip
2624 \halign{\hbox to\displaywidth{##}\cr
2626 \noalign{\raise@tag}%
2627 \hskip\@mathmargin\unhbox\z@\unskip\hfil\cr}%
2629 \newtoks\mathdisplay@stack
2630 \let\mathdisplay@push\@empty
2631 \def\mathdisplay@@push{%
2633 \toks@\@xp{\df@label}\@temptokena\@xp{\df@tag}%
2634 \toks8\@xp{\alt@tag}%
2636 \global\if@eqnsw\@nx\@eqnswtrue\else\@nx\@eqnswfalse\fi
2637 \global\iftag@\@nx\tag@false\else\@nx\tag@true\fi
2638 \gdef\@nx\df@label{\the\toks@}\gdef\@nx\df@tag{\the\@temptokena}%
2639 \gdef\@nx\alt@tag{\the\toks8}%
2640 \global\mathdisplay@stack{\the\mathdisplay@stack}%
2642 \global\mathdisplay@stack\@xp{\@tempa}
2645 \let\mathdisplay@pop\@empty
2646 \def\mathdisplay@@pop{\the\mathdisplay@stack}
2647 \renewenvironment{equation}{%
2650 \st@rredfalse \global\@eqnswtrue
2651 \mathdisplay{equation}%
2653 \endmathdisplay{equation}%
2655 \ignorespacesafterend
2657 \newenvironment{equation*}{%
2659 \st@rredtrue \global\@eqnswfalse
2660 \mathdisplay{equation*}%
2662 \endmathdisplay{equation*}%
2664 \ignorespacesafterend
2666 \DeclareRobustCommand{\[}{\begin{equation*}}
2667 \DeclareRobustCommand{\]}{\end{equation*}}
2670 %% End of file `amsmath.sty'.