2 %% This is file `breqn.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
7 %% breqn.dtx (with options: `package')
9 %% This is a generated file.
11 %% Copyright (C) 1997-2003 by Michael J. Downes
12 %% Copyright (C) 2007 by Morten Hoegholm <mh.ctan@gmail.com>
14 %% This work may be distributed and/or modified under the
15 %% conditions of the LaTeX Project Public License, either
16 %% version 1.3 of this license or (at your option) any later
17 %% version. The latest version of this license is in
18 %% http://www.latex-project.org/lppl.txt
19 %% and version 1.3 or later is part of all distributions of
20 %% LaTeX version 2005/12/01 or later.
22 %% This work has the LPPL maintenance status "maintained".
24 %% This Current Maintainer of this work is Morten Hoegholm.
26 %% This work consists of the main source file breqn.dtx
27 %% and the derived files
28 %% breqn.sty, breqn.pdf, breqn.ins, breqn.drv.
30 \NeedsTeXFormat{LaTeX2e
}
31 \ProvidesPackage{breqn
}[2007/
12/
22 v0.97a
]
33 \catcode\number`\"=
\number\catcode`\"
35 \AtEndOfPackage{\breqnpopcats}%
36 \catcode`\^=
7 \catcode`
\_=
8 \catcode`\"=
12 \relax
37 \DeclareOption{mathstyleoff
}{%
38 \PassOptionsToPackage{mathstyleoff
}{flexisym
}%
41 \@ifpackageloaded
{flexisym
}{}{%
42 \RequirePackage{flexisym
}[2007/
12/
19]
43 \edef\breqnpopcats{\breqnpopcats
44 \catcode\number`\^=
\number\catcode`\^
45 \catcode\number`
\_=
\number\catcode`
\_
47 \catcode`\^=
7 \catcode`
\_=
8 \catcode`\"=
12 \relax
49 \RequirePackage{keyval,calc
}\relax
50 \@ifundefined
{options
}{%
51 \newcommand{\options}[2]{%
52 \expandafter\options@a
\csname opt@
#1.sty
\endcsname{#2}%
56 \edef\@tempa
{\options@b
#2,\@empty\@nil
}%
57 \ifx#1\relax \let#1\@empty
\fi
58 \xdef#1{#1\ifx#1\@empty\@xp\@gobble\@tempa\@empty
\else\@tempa
\fi}%
60 \def\options@b
#1,
#2#3\@nil
{%
62 \ifx#2\@empty
\else\options@b
#2#3\@nil
\fi
64 \def\options@c
#1 #2\@nil
{\options@d
#1=\@nil
}
65 \def\options@d
#1=
#2\@nil
{\ifx\@empty
#1\@empty
\else,
\fi#1}
66 }{}% end @ifundefined test
69 \@ifundefined
{@emptytoks
}{\newtoks\@emptytoks
}{}
71 \newcount\inf@bad
\inf@bad=
1000000
72 \newcount\maxint \maxint=
2147483647
82 \let\skip@a\@tempskipa
83 \let\skip@b\@tempskipb
85 \let\toks@a\@temptokena
91 \def\abs@num
#1{\ifnum#1<
\z@-
\fi#1}
93 \let\@tempd=
#1\def\@tempa
{#2}\def\@tempb
{#3}%
94 \futurelet\@tempc\@ifnexta
96 \def\@ifnexta
{\ifx\@tempc\@tempd
\let\@tempb\@tempa
\fi \@tempb
}
98 \let\@tempd*
\def\@tempa*
{#1}\def\@tempb
{#2}%
99 \futurelet\@tempc\@ifnexta
101 \def\@optarg
#1#2{\@ifnext
[{#1}{#1[#2]}}
104 \def\@Not
#1{0\ifcase#11 \or\@xp
1\else \@xp
0\fi}
105 \def\@And
#1#2{0\ifcase#1#2 \@xp
0\else \@xp
1\fi}
106 \def\@Or
#1#2{0\ifnum#1#2<
101 \@xp
0\else \@xp
1\fi}
107 \def\theb@@le
#1{\if#1 True
\else False
\fi}
108 \def\freeze@glue
#1{#11#1\relax}
109 \def\z@rule
{\vrule\@width
\z@
}% no \relax ! use with care
110 \def\keep@glue
{\z@rule
\relax}
111 \begingroup \catcode`\&=
11
113 \csname &
\expandafter\replicate@a
\romannumeral\number\number#1 000q
\endcsname
116 \long\def\replicate@a
#1#2\endcsname#3{#1\endcsname{#3}#2}
117 \begingroup \catcode`\&=
11
118 \long\gdef\&m
#1#2{#1\csname &
#2\endcsname{#1}}
120 \@xp
\let\csname\string &q
\endcsname\@gobble
121 \g@addto@macro
\mathchars@reset
{%
122 \let\@symRel\@secondoftwo
\let\@symBin\@secondoftwo
123 \let\@symDeL\@secondoftwo
\let\@symDeR\@secondoftwo
124 \let\@symDeB\@secondoftwo
127 \begingroup \let\@elt
\relax \xdef#1{\@elt
{#2}#1}\endgroup
129 \providecommand{\@saveprimitive
}[2]{%
131 \edef\@tempa
{\string#1}\edef\@tempb
{\meaning#1}%
132 \ifx\@tempa\@tempb
\global\let#2#1%
134 \edef\@tempb
{\meaning#2}%
136 \else \@saveprimitive@a
#1#2%
141 \providecommand\@saveprimitive@a
[2]{%
143 \def\@tempb#
#1#1#
#2{\edef\@tempb
{#
#2}\@car
{}}%
144 \@tempb
\nullfont{select font nullfont
}%
145 \topmark{\string\topmark:
}%
146 \firstmark{\string\firstmark:
}%
147 \botmark{\string\botmark:
}%
148 \splitfirstmark{\string\splitfirstmark:
}%
149 \splitbotmark{\string\splitbotmark:
}%
151 \edef\@tempa
{\expandafter\strip@prefix
\meaning\@tempb
}%
152 \edef\@tempb
{\meaning#1}%
153 \ifx\@tempa\@tempb
\global\let#2#1%
155 \PackageError{breqn
}%
156 {Unable to properly define
\string#2; primitive
157 \noexpand#1no longer primitive
}\@eha
162 \begingroup \catcode`\$=
\thr@@
% just to make sure
163 \global\let\@@math=$
\gdef\@@display
{$$
}% $$$
165 \let\@@endmath=\@@math
166 \let\@@enddisplay=\@@display
167 \@saveprimitive
\vadjust\@@vadjust
168 \@saveprimitive
\insert\@@insert
169 \@saveprimitive
\mark\@@mark
170 \@ifundefined
{listwidth
}{\newdimen\listwidth}{}
172 \def\eqfontsize{} % Inherit from context [NOT USED?]
173 \def\eqcolor{black
} % Default to black [NOT USED?]
174 \newdimen\eqnumsep \eqnumsep=
10pt
% Min space between equ number and body
175 \newdimen\eqmargin \eqmargin=
8pt
% For `multline' gap emulation
176 \def\eqindent{C
}% % C or I, centered or indented
177 \def\eqnumside{R
}% % R or L, right or left
178 \def\eqnumplace{M
}% % M or T or B, middle top or bottom
179 \def\eqnumfont{}% % Null for easier debugging [mjd,1997/09/26]
180 \def\eqnumform#1{(
#1\@@italiccorr)
} % Add parens
181 \def\eqnumsize{} % Allow numbers to have different typesize ...
182 \def\eqnumcolor{} % ... or color than eq body e.g. \color{blue}
183 \newlength\eqlinespacing \eqlinespacing=
14pt plus2pt
% Base-to-base space between lines
184 \newlength\eqlineskip \eqlineskip=
3pt plus2pt
% Min space if eqlinespacing too small
185 \newdimen\eqlineskiplimit \eqlineskiplimit=
2pt
% Threshold for switching to eqlineskip
186 \newmuskip \eqbinoffset \eqbinoffset=
15mu minus-
3mu
% Offset from mathrel alignment pt for mathbins
187 \newmuskip\eqdelimoffset \eqdelimoffset=
2mu
% Additional offset for break inside delims
188 \newdimen\eqindentstep \eqindentstep=
8pt
% Indent used when LHS wd is n/a or too large
189 \newtoks\eqstyle % Customization hook
190 \newcount\eqbreakdepth \eqbreakdepth=
2 % Allow breaks within delimiters to this depth
191 \newcount \eqinterlinepenalty \eqinterlinepenalty=
10000 % No page breaks between equation lines
192 \newcount \intereqpenalty \intereqpenalty=
1000 % Pagebreak penalty between equations [BRM: Was \@M]
193 \newlength \intereqskip \intereqskip=
3pt plus2pt
% Additional vert space between equations
194 \newcount\prerelpenalty \prerelpenalty=-\@M
% Linebreak penalty before mathrel symbols
195 \newcount\prebinoppenalty \prebinoppenalty=
888 % Linebreak penalty before mathbins
196 \newmuskip \Dmedmuskip \Dmedmuskip=
4mu minus
3mu
% medmuskip in displays
197 \newmuskip \Dthickmuskip \Dthickmuskip=
5mu minus
2mu
% thickmuskip in displays
198 \def\eq@number
{} % Internal variable
199 \newlength\eqleftskip \eqleftskip=\@centering
% Space on the left [NOT USED?]
200 \newlength\eqrightskip \eqrightskip=\@centering
% Space on the right [NOT USED?]
201 \newlength\eq@vspan
\eq@vspan=
\z@skip
% Glue used to vcenter the eq number
202 \newmuskip\eq@binoffset
\eq@binoffset=
\eqbinoffset % Roughly, \eqbinoffset + \eqdelimoffset
203 \newsavebox\EQ@box
% Storage for equation body
204 \newsavebox\EQ@copy
% For eq body sans vadjust/insert/mark material
205 \newsavebox\EQ@numbox
% For equation number
206 \newdimen\eq@wdNum
% width of number + separation [NEW]
207 \newsavebox\GRP@numbox
% For group number [NEW]
208 \newdimen\grp@wdNum
% width of number + separation [NEW]
209 %%B\EQ@vimbox % Vadjust, insert, or mark material
210 %%B\EQ@vimcopy % Spare copy of same
211 %%B\eq@impinging % Temporary box for measuring number placement
212 \newcount \eq@lines
% Internal counter, actual number of lines
213 \newcount \eq@curline
% Loop counter
214 \newcount \eq@badness
% Used in testing for overfull lines
215 \newcount \EQ@vims
% For bookkeeping
216 \def\@eq@numbertrue
{\let\eq@hasNumber\@True
}%
217 \def\@eq@numberfalse
{\let\eq@hasNumber\@False
}%
218 \let\eq@hasNumber\@False
219 \newdimen\eq@dp
% Depth of last line
220 \newdimen\eq@wdL
% Width of the left-hand-side
221 \newdimen\eq@wdT
% Total width for framing
222 \newdimen\eq@wdMin
% Width of narrowest line in equation
223 \newdimen\grp@wdL
% Max width of LHS's in a group
224 \newdimen\grp@wdR
% Max RHS of all equations in a group
227 \newdimen\eq@firstht
% Height of first line
229 \newdimen\eq@indentstep
% Indent amount when LHS is not present
230 \newdimen\eq@linewidth
% Width actually used for display
231 \newdimen\grp@linewidth
% Max eq@linewidth over a group
233 \let\eq@isIntertext\@False
234 \eq@indentstep=
\maxdimen
235 \newdimen\eq@given@sidespace
237 \@ifpackagewith
{amsmath
}{leqno
}{%
238 \@ifpackagewith
{amsmath
}{reqno
}{}{\def\eqnumside{L
}}%
240 \def\@tempa
#1,leqno.clo,
#2#3\@nil
{%
241 \ifx @
#2\relax\else \def\eqnumside{L
}\fi
243 \@xp\@tempa\@filelist,leqno.clo,@\@nil
246 \@ifundefined
{iftagsleft@
}{}{%
248 \if TT
\csname fi
\endcsname\csname iftagsleft@
\endcsname
254 \@ifpackagewith
{amsmath
}{fleqn
}{%
257 \def\@tempa
#1,fleqn.clo,
#2#3\@nil
{%
258 \ifx @
#2\relax\else \def\eqindent{I
}\fi
260 \@xp\@tempa\@filelist,fleqn.clo,@\@nil
263 \@ifundefined
{if@fleqn
}{}{%
265 \if TT
\csname fi
\endcsname\csname if@fleqn
\endcsname
271 \@ifundefined
{mathindent
}{%
274 \@ifundefined
{@mathmargin
}{}{%
275 \mathindent\@mathmargin
278 \let\EQ@hasLHS=\@False
283 \global\let\EQ@hasLHS=\@True
284 \global\let\EQ@prebin@space
\EQ@prebin@space@a
286 \penalty9999 % instead of normal \rel@break
287 % else no penalty = forbid break
291 \mskip\thickmuskip \@@vadjust
{\penalty\tw@
}\penalty-\@Mi\@@vadjust
{}%
293 \newcommand\hiderel[1]{\mathrel{\advance\lr@level\@ne
#1}}
296 \let\EQ@prebin@space
\relax
297 \def\EQ@prebin@space@a
{\mskip-
\eq@binoffset
\keep@glue
\mskip\eq@binoffset
}
298 \def\bin@break
{\ifnum\lastpenalty=
\z@
\penalty\prebinoppenalty\fi
301 \ifnum\abs@num
\lastpenalty <
\abs@num
\prerelpenalty
302 \penalty\prerelpenalty
305 \def\d@@Bin
{\bin@break
\m@@Bin
}
306 \def\d@@Rel
{\mark@lhs
\rel@break
\m@@Rel
}
307 \let\m@@symRel\@symRel
\def\d@@symRel
{\mark@lhs
\rel@break
\m@@symRel
}
308 \let\m@@symBin\@symBin
\def\d@@symBin
{\bin@break
\m@@symBin
}
309 \let\m@@symDel\@symDel
310 \let\m@@symDeR\@symDeR
311 \let\m@@symDeB\@symDeB
312 \let\m@@symDeA\@symDeA
314 \medmuskip\Dmedmuskip \thickmuskip\Dthickmuskip
315 \let\m@Bin
\d@@Bin
\let\m@Rel
\d@@Rel
316 \let\@symRel
\d@@symRel
\let\@symBin
\d@@symBin
317 \let\m@DeL
\d@@DeL
\let\m@DeR
\d@@DeR
\let\m@DeB
\d@@DeB
319 \let\@symDeL
\d@@symDeL
\let\@symDeR
\d@@symDeR
320 \let\@symDeB
\d@@symDeB
\let\@symDeA
\d@@symDeA
321 \let\left\eq@left
\let\right\eq@right
\global\lr@level
\z@
322 \global\eq@wdCond
\z@
%BRM: new
323 \everyhbox{\everyhbox\@emptytoks
324 \let\display@setup
\relax \textmath@setup
\let\textmath@setup
\relax
326 \everyvbox{\everyvbox\@emptytoks
327 \let\display@setup
\relax \textmath@setup
\let\textmath@setup
\relax
330 \def\dseries@display@setup
{%
331 \medmuskip\Dmedmuskip \thickmuskip\Dthickmuskip
333 \let\@symBin
\d@@symBin
334 \let\m@DeL
\d@@DeL
\let\m@DeR
\d@@DeR
\let\m@DeB
\d@@DeB
336 \let\@symDeL
\d@@symDeL
\let\@symDeR
\d@@symDeR
337 \let\@symDeB
\d@@symDeB
\let\@symDeA
\d@@symDeA
338 \let\left\eq@left
\let\right\eq@right
\global\lr@level
\z@
339 \everyhbox{\everyhbox\@emptytoks
340 \let\display@setup
\relax \textmath@setup
\let\textmath@setup
\relax
342 \everyvbox{\everyvbox\@emptytoks
343 \let\display@setup
\relax \textmath@setup
\let\textmath@setup
\relax
347 \def\textmath@setup
{%
348 \let\m@Bin
\m@@Bin
\let\m@Rel
\m@@Rel
349 \let\@symRel
\m@@symRel
\let\@symBin
\m@@symBin
350 \let\m@DeL
\m@@DeL
\let\m@DeR
\m@@DeR
\let\m@DeB
\m@@DeB
352 \let\@symDeL
\m@@symDeL
\let\@symDeR
\m@@symDeR
353 \let\@symDeB
\m@@symDeB
\let\@symDeA
\m@@symDeA
354 \let\left\@@left
\let\right\@@right
356 \@ifundefined
{@displaytrue
}{%
357 \@xp
\newif\csname if@display
\endcsname
358 \everydisplay\@xp
{\the\everydisplay \@displaytrue
}%
360 \define@key
{breqn
}{label
}{\def\next@label
{\label{#1}}}
361 \global\let\next@label\@empty
362 \define@key
{breqn
}{number
}{\def\eq@number
{#1}%
363 \let\@currentlabel
\eq@number
365 \define@key
{breqn
}{shiftnumber
}{\let\eq@shiftnumber\@True
}
366 \define@key
{breqn
}{holdnumber
}{\let\eq@holdnumber\@True
}
367 \define@key
{breqn
}{density
}{\def\eq@density@factor
{#1}}
368 \define@key
{breqn
}{indentstep
}{\eqindentstep#1\relax}
369 \define@key
{breqn
}{compact
}[-
99]{\prerelpenalty=
#1\relax}
370 \define@key
{breqn
}{layout
}[?
]{%
371 \edef\eq@layout
{\@car
#1?\@nil
}%
373 \define@key
{breqn
}{spread
}{%
374 \addtolength\eqlinespacing{#1}%
375 \addtolength\eqlineskip{#1}%
376 \eqlineskiplimit\eqlineskip
378 \define@key
{breqn
}{sidespace
}{%
379 \setlength\eq@given@sidespace
{#1}%
381 \define@key
{breqn
}{style
}{\eqstyle\@xp
{\the\eqstyle #1}}
382 \define@key
{breqn
}{shortskiplimit
}{\def\eq@shortskiplimit
{#1}}
383 \def\eq@shortskiplimit
{2em
}
384 \define@key
{breqn
}{frame
}[\fboxrule]{\def\eq@frame
{T
}%
385 \dim@a
#1\relax\edef\eq@framewd
{\the\dim@a
}%
386 \freeze@glue
\eqlinespacing \freeze@glue
\eqlineskip
388 \define@key
{breqn
}{fullframe
}[]{\def\eq@frame
{U
}%
389 \freeze@glue
\eqlinespacing \freeze@glue
\eqlineskip
391 \def\eq@frame
{F
} % no frame
392 \def\eq@framewd
{\fboxrule}
393 \define@key
{breqn
}{framesep
}[\fboxsep]{%
394 \if\eq@frame F
\def\eq@frame
{T
}\fi
395 \dim@a
#1\relax \edef\eq@framesep
{\the\dim@a
}%
396 \freeze@glue
\eqlinespacing \freeze@glue
\eqlineskip
398 \def\eq@framesep
{\fboxsep}
399 \define@key
{breqn
}{background
}{\def\eq@background
{#1}%
400 \freeze@glue
\eqlinespacing \freeze@glue
\eqlineskip
402 \define@key
{breqn
}{color}{\def\eq@foreground
{#1}}
403 \define@key
{breqn
}{center
}[]{\let\eq@centerlines\@True
}
404 \define@key
{breqn
}{nocenter
}[]{\let\eq@centerlines\@False
}
405 \let\eq@centerlines\@False
406 \define@key
{breqn
}{noalign
}[]{\let\grp@aligned\@False
}
407 \let\grp@aligned\@True
% default
408 \define@key
{breqn
}{breakdepth
}{\eqbreakdepth#1\relax}
409 \define@key
{breqn
}{cols
}{\global\let\@preamble\@empty
410 \darray@mkpream
#1\@percentchar
412 \newenvironment{dmath
}{%
413 \let\eq@hasNumber\@True \@optarg\@dmath
{}}{}
415 \everydisplay\expandafter{\the\everydisplay \display@setup
}%
416 \if@noskipsec
\leavevmode \fi
417 \if@inlabel
\leavevmode \global\@inlabelfalse
\fi
418 \if\eq@group
\else\eq@prelim
\fi
426 \def\enddmath#1{\check@punct@or@qed
}
428 \gdef\EQ@setwdL
{}% Occasionally undefined ???
433 \if\eq@group
\grp@push
\else \eq@finish
\fi
435 \newenvironment{dmath*
}{%
436 \let\eq@hasNumber\@False \@optarg\@dmath
{}%
438 \@namedef
{end@dmath*
}{\end@dmath
}
439 \@namedef
{enddmath*
}#1{\check@punct@or@qed
}
441 \if@inlabel
\indent \par \fi
442 \if@nobreak
\global\@nobreakfalse
\predisplaypenalty\@M
\fi
446 \par %% \eq@saveparinfo %% needs work
447 \let\intertext\breqn@intertext
449 \def\breqn@parshape@warning
{%
450 \PackageWarning{breqn
}{%
451 Complex paragraph shape cannot be followed by this equation
}%
453 \let\eq@prevshape\@empty
454 \def\eq@saveparinfo
{%
455 \count@
\prevgraf \advance\count@-
\thr@@
% for the null display
456 \edef\eq@prevshape
{\prevgraf\the\count@
\space}%
458 % case 0: no action required
459 \or \edef\eq@prevshape
{\eq@prevshape
460 \parshape\@ne
\displayindent\displaywidth\relax
463 \breqn@parshape@warning
469 \ifx\eq@number\@empty
470 \stepcounter{equation
}\let\eq@number
\theequation
472 % This sets up numbox, etc, even if unnumbered?????
473 \ifx\eq@number\@empty
475 \set@label
{equation
}\eq@number
476 \global\sbox\EQ@numbox
{%
477 \next@label
\global\let\next@label\@empty
478 \eqnumcolor\eqnumsize\eqnumfont{\eqnumform{\eq@number
}}%
480 \global\eq@wdNum
\wd\EQ@numbox
\global\advance\eq@wdNum
\eqnumsep
484 \newcount\eq@final@linecount
485 \let\eq@GRP@first@dmath\@True
489 \freeze@glue
\eqlinespacing \freeze@glue
\eqlineskip
491 \csname eq@
\eqindent @setsides
\endcsname % Compute \leftskip,\rightskip
492 \adjust@parshape
\eq@parshape
% Final adjustment of parshape for left|right skips
494 \if\eq@GRP@first@dmath
495 \global\let\eq@GRP@first@dmath\@False
496 \xdef\dmath@first@leftskip
{\leftskip=
\the\leftskip\relax}%
498 \eq@topspace
{\vskip\parskip}% Set top spacing
501 \eq@topspace
{\vskip\parskip}% Set top spacing
503 \afterassignment\remove@to@nnil
504 \eq@final@linecount=
\expandafter\@gobble
\eq@parshape\@nnil
507 \csname eq@typeset@
\eqnumside Shifted
\endcsname
509 \ifnum\eq@final@linecount=\@ne
510 \csname eq@typeset@
\eqnumside @single
\endcsname
512 \csname eq@typeset@
\eqnumside\eqnumplace\endcsname
516 \eq@typeset@Unnumbered
521 \def\eq@typeset@L@single
{%
523 \eq@params
\eq@parshape
524 \nointerlineskip\noindent
526 \rlap{\kern-
\leftskip\box\EQ@numbox
}%
529 \rlap{\raise\eq@firstht
\hbox to
\z@
{\eq@addframe
\hss}}%
531 \eq@dump@box
\unhbox\EQ@box \@@par
533 \def\eq@typeset@R@single
{%
535 \eq@params
\eq@parshape
536 \nointerlineskip\noindent
540 \rlap{\raise\eq@firstht
\hbox to
\z@
{\eq@addframe
\hss}}%
542 \rlap{\kern-
\leftskip\kern\linewidth\kern-
\wd\EQ@numbox
\copy\EQ@numbox
}%
543 \eq@dump@box
\unhbox\EQ@box
546 \def\peek@branch
#1#2{%
547 \let\peek@b
#1\let\peek@space
#2\futurelet\@let@token
\peek@a
549 \def\peek@skipping@spaces
#1{\peek@branch
#1\peek@skip@space
}
551 \ifx\@let@token\@sptoken
\expandafter\peek@space
552 \else \expandafter\peek@b
\fi
554 \lowercase{\def\peek@skip@space
} {\futurelet\@let@token
\peek@a
}%
555 \def\check@punct
{\futurelet\@let@token
\check@punct@a
}
558 \ifx\@let@token\@sptoken\@nx
\finish@end
559 \else\ifx\@let@token ,\@nx
\check@qed
560 \else\ifx\@let@token .\@nx
\check@qed
561 \else\check@punct@b
% check the less common possibilities
568 \ifx\@let@token ;\@nx
\check@qed
569 \else\ifx\@let@token ?\@nx
\check@qed
570 \else\ifx\@let@token !\@nx
\check@qed
572 \toks@c
{\fi\fi\fi}% matching with \toks@a
573 \catcode`\.=
\active \catcode`\,=
\active \catcode`\;=
\active
574 \catcode`\?=
\active \catcode`\!=
\active
576 \else\ifx\@let@token ,\@nx
\check@qed
577 \else\ifx\@let@token .\@nx
\check@qed
578 \else\ifx\@let@token ;\@nx
\check@qed
579 \else\ifx\@let@token ?\@nx
\check@qed
580 \else\ifx\@let@token !\@nx
\check@qed
584 \xdef\check@punct@b
{%
585 \the\toks@a
\the\toks@b
\the\toks@c
588 \let\found@punct\@empty
590 \gdef\found@punct
{#1}%
591 \peek@skipping@spaces
\check@qed@a
594 \ifx\end\@let@token \@xp
\check@qed@b
595 \else \@xp
\finish@end
598 \def\check@qed@b
#1#2{%
599 \@ifundefined
{#2qed
}{}{%
600 \toks@\@xp
{\found@punct
\csname#2qed
\endcsname}%
601 \xdef\found@punct
{\the\toks@
}%
606 \def\@tempa
#1\endcsname#2\@nil
{\def\latex@end#
#1{#2}}
607 \expandafter\@tempa
\end{#1}\@nil
608 \def\end#1{\csname end
#1\endcsname \latex@end
{#1}}%
609 \def\check@punct@or@qed
#1{%
610 \xdef\found@punct
{\@empty
}% BRM: punctuation was being remembered past this eqn.
611 \def\finish@end
{\csname end@
#1\endcsname\latex@end
{#1}}%
614 \newcommand\eqpunct[1]{\thinspace#1}
615 \providecommand\set@label
[2]{\protected@edef\@currentlabel
{#2}}
618 \global\let\EQ@shortskips\@False
619 \if\@And
{\eq@group
}{\@Not
\eq@GRP@first@dmath
}%
620 \parskip\intereqskip \penalty\intereqpenalty
624 \parskip\abovedisplayshortskip
625 \aftergroup\belowdisplayskip\aftergroup\belowdisplayshortskip
626 \ifdim\predisplaysize>
\z@
\nointerlineskip\fi
628 \parskip\abovedisplayskip
633 \addtolength\parskip{\eq@framesep+
\eq@framewd
}%
638 \def\eq@check@shortskip
{%
639 \global\let\EQ@shortskips\@False
640 \setlength\dim@a
{\abovedisplayskip+
\ht\EQ@numbox
}%
641 \ifdim\leftskip<
\predisplaysize
643 \ifdim -
\maxdimen=
\predisplaysize
646 \global\let\EQ@shortskips\@True
651 \ifdim\dim@a<
\eq@firstht
652 \global\let\EQ@shortskips\@True
655 \setlength\dim@b
{\eq@vspan/
2}%
657 \global\let\EQ@shortskips\@True
666 \penalty\postdisplaypenalty
669 \addtolength\belowdisplayskip{\eq@framesep+
\eq@framewd
}%
671 \vskip\belowdisplayskip
672 \@endpetrue
% kill parindent if current paragraph continues
673 \global\@ignoretrue
% ignore following spaces
676 \def\eq@resume@parshape
{}
678 \global\let\EQ@hasLHS\@False
679 \setbox\z@
\vbox\bgroup
680 \noindent \@@math
\displaystyle
684 \everymath\everydisplay
685 %\let\@newline\eq@newline % future possibility?
687 \let\insert\eq@insert
\let\mark\eq@mark
\let\vadjust\eq@vadjust
688 \hsize\maxdimen \pretolerance\@M
690 \rightskip\z@\@plus\@M
\p@
\leftskip\z@skip
\parfillskip\z@skip
691 \clubpenalty\@ne
\widowpenalty\z@
\interlinepenalty\z@
692 \global\let\EQ@prebin@space
\relax
693 \binoppenalty\@M
\relpenalty\@M
695 \newdimen\eq@wdR
\eq@wdR
\z@
%BRM
697 \ifnum\lastpenalty>-\@M
\penalty-\@Mi
\fi
703 \global\setbox\EQ@box
\hbox{\unhbox\tw@
\unskip\unskip\unpenalty}%
705 \global\setbox\EQ@copy
\copy\EQ@box
706 %% \global\setbox\EQ@vimcopy\copy\EQ@vimbox
708 \eq@wdR
\z@
%BRM: eq@wdL patch
709 \eq@repack
% recursive
711 \global\setbox\EQ@box
\hbox{\unhcopy\tw@
\unskip\unpenalty \unhbox\EQ@box
}%
712 \global\setbox\EQ@copy
\hbox{\unhbox\tw@
\unskip\unpenalty \unhbox\EQ@copy
}%
713 \ifdim\eq@wdR>
\z@
% BRM: eq@wdL patch
714 \setlength\dim@a
{\wd\EQ@box-
\eq@wdR
715 % Apparently missing a \thickmuskip = 5mu = 5/18em=0.27777777777.. ?
716 +
0.2777777777777em
}% FUDGE??!?!?!
719 \xdef\EQ@setwdL
{\eq@wdL
\the\eq@wdL
\relax}%
722 \egroup % end vbox started earlier
725 \ifx\found@punct\@empty
726 \else \eqpunct{\found@punct
}%
728 % BRM: Added; the punctuation kept getting carried to following environs
729 \xdef\found@punct
{\@empty
}%
732 \global\let\EQ@afterspace\@empty
735 % case 0: normal case
737 \eq@repacka
\EQ@copy
\eq@repacka
\EQ@box
739 \or % case 1: finished recursing
742 \eq@repacka
\EQ@copy
\eq@repacka
\EQ@box
744 \or % case 2: save box width = LHS width
747 \setbox\z@
\copy\tw@
\setbox\z@
\hbox{\unhbox\z@
\unskip\unpenalty}%
748 \addtolength\eq@wdL
{\wd\z@
}
749 \setlength\eq@wdR
{\wd\EQ@box
}% BRM: eq@wdL patch
750 \xdef\EQ@setwdL
{\eq@wdL
\the\eq@wdL
\relax}%
751 \global\setbox\EQ@copy
\hbox{%
752 \hbox{\unhcopy\tw@
\unskip\unpenalty\unskip}%
755 \global\setbox\EQ@box
\hbox{%
756 \hbox{\unhbox\tw@
\unskip\unpenalty\unskip}%
760 \or % case 3: unpack left-right box
768 \def\breqn@repack@err
{%
769 \PackageError{breqn
}{eq@repack penalty neq
0,
1,
2,
3}\relax
772 \global\setbox#1\hbox{\unhcopy\tw@
\unskip
774 \ifnum\count@<\@M
\else \advance\count@-\@M
\fi
776 \ifx\EQ@copy
#1\ifnum\count@>
\thr@@
\count@\@ne
\fi\fi
778 % case 0, normal line break
779 \penalty-\@M
% put back the linebreak penalty
780 \or % case 1, do nothing (end of equation)
782 \or % case 2, no-op (obsolete case)
783 \or % case 3, transfer vspace and/or penalty
784 \ifx#1\EQ@box
\eq@revspace
\else \eq@revspaceb
\fi
785 \or % case 4, put back an insert
787 \or % case 5, put back a mark
789 \or % case 6, put back a vadjust
791 \else % some other break penalty
796 \def\eq@nulldisplay
{%
797 \begingroup \frozen@everydisplay\@emptytoks
799 \predisplaypenalty\@M
\postdisplaypenalty\@M
800 \abovedisplayskip\z@skip
\abovedisplayshortskip\z@skip
801 \belowdisplayskip\z@skip
\belowdisplayshortskip\z@skip
802 \xdef\EQ@displayinfo
{%
803 \prevgraf\the\prevgraf \predisplaysize\the\predisplaysize
804 \displaywidth\the\displaywidth \displayindent\the\displayindent
805 \listwidth\the\linewidth
806 \ifdim\displayindent>
\z@
807 \advance\listwidth\the\leftmargin
808 \advance\listwidth\the\rightmargin
818 \@ifstar
{\eq@newlinea\@M
}{\eq@newlinea
\eqinterlinepenalty}}
820 \@ifnext
[{\eq@newlineb
{#1}}{\eq@newlineb
{#1}[\maxdimen]}}
821 \def\eq@newlineb
#1[#2]{\penalty-\@M
}
823 \global\setbox\EQ@vimbox
\vbox{\unvbox\EQ@vimbox
825 \global\setbox\@ne
\lastbox}%
826 \@@vadjust
{\unvbox\@ne
}%
830 \global\setbox\EQ@vimcopy
\vbox{\unvbox\EQ@vimcopy
832 \global\setbox\@ne
\lastbox}%
833 \@@vadjust
{\unvbox\@ne
}%
836 \def\eq@break
#1{\penalty-
1000#1 \keep@glue
}
837 \let\@parshape\@empty
839 \ifdim\eq@indentstep=
\maxdimen \eq@indentstep
\eqindentstep \fi
840 \ifdim\eq@linewidth=
\z@
\else \edef\eq@linewidths
{{\the\eq@linewidth
}}\fi
841 \begingroup \eq@params
843 \rightskip\z@\@plus
\columnwidth\@minus
\hfuzz
844 \global\EQ@continue
{\eq@trial
}%
845 \eq@trial
% uses \eq@linewidths
846 \eq@failout
% will be a no-op if the trial succeeded
852 \let\EQ@widths\@empty
853 \let\EQ@fallback\@empty
854 \def\eq@linewidths
{\displaywidth\linewidth\columnwidth}
856 \ifx\@empty
\eq@linewidths
857 \global\EQ@continue
{}%
859 \iffalse{\fi \@xp
\eq@trial@a
\eq@linewidths
}%
865 \if T
\eq@frame
\eq@frame@adjust
\dim@c
\fi
866 \ifdim\dim@c>
\eq@linewidth
868 \let\eq@trial@b
\eq@trial@d
869 \csname eq@try@layout@
\eq@layout
\endcsname
871 \edef\eq@linewidths
{\iffalse}\fi
873 \def\eq@frame@adjust
#1{%
874 %\addtolength#1{-2\eq@framewd-2\eq@framesep}%
875 \dim@a
\eq@framewd
\advance\dim@a
\eq@framesep
878 \def\eq@trial@succeed
{%
879 \aftergroup\@gobbletwo
% cancel the \EQ@fallback code; see \eq@trial@c (?)
880 \global\EQ@continue
{\eq@trial@done
}%
883 \let\eq@failout
\relax
885 \def\eq@trial@init
{\global\let\EQ@fallback
\eq@nextlayout
}
886 \def\eq@nextlayout
#1{%
891 \global\let\EQ@trial
\EQ@last@trial
893 \def\eq@trial@save
#1{%
895 \eq@linewidth
\the\eq@linewidth
896 % save info about the fit
897 \eq@lines
\the\eq@lines
\eq@badness
\the\eq@badness
\def\@nx
\eq@badline
{\eq@badline
}%
899 \eq@wdT
\the\eq@wdT
\eq@wdMin
\the\eq@wdMin
900 \eq@vspan
\the\eq@vspan
\eq@dp
\the\eq@dp
\eq@firstht
\the\eq@firstht
901 % save info about the LHS
902 \eq@wdL
\the\eq@wdL
\def\@nx
\EQ@hasLHS
{\EQ@hasLHS
}%
903 % save info about the numbering
904 \def\@nx
\eq@hasNumber
{\eq@hasNumber
}%
905 % save info about the chosen layout
906 \def\@nx
\eq@layout
{\eq@layout
}%
907 \def\@nx
\eq@parshape
{\@parshape
}%
908 \def\@nx
\eq@measurements
{\eq@measurements
}%
909 \def\@nx
\adjust@rel@penalty
{\adjust@rel@penalty
}%
910 \def\@nx
\eq@shiftnumber
{\eq@shiftnumber
}%
911 \def\@nx
\eq@isIntertext
{\@False
}%
914 \def\eq@trial@b
{\eq@trial@c
}
915 \def\eq@trial@c
#1#2{%
921 \eq@trial@p
% run the given parshape
922 \if\@Not
{\eq@badline
}%
923 \eq@trial@save
\EQ@trial
924 \if\eq@hasNumber
\eq@retry@with@number
\fi
925 \if L
\eq@layout
\eq@check@density
927 \if\@Not
{\eq@badline
}%
932 \eq@trial@save
\EQ@last@trial
938 \def\eq@trial@d
#1#2{\eq@trial@c
{#1}{}}
939 \def\eq@check@density
{%
940 \if\@Or
{\@Not
\EQ@hasLHS
}{\eq@shortLHS
}%
942 \else\if\eq@dense@enough
946 \def\eq@shortLHS
{\ifdim\eq@wdL>
.44\eq@wdT
1\else 0\fi 0}
949 \eq@dump@box
\unhcopy\EQ@copy
950 {\@@par
}% leave \parshape readable
953 \let\eq@badline\@False
954 \if i
\eq@layout
\ifnum\eq@lines>\@ne
\let\eq@badline\@True
\fi\fi
955 \eq@curline
\eq@lines
% loop counter for eq@measure@lines
956 \let\eq@measurements\@empty
957 \eq@ml@record@indents
961 \let\adjust@rel@penalty\@empty
962 \def\eq@fix@lastline
{%
963 \setbox\tw@
\lastbox \dim@b
\wd\tw@
965 \nointerlineskip\hbox to
\dim@b
{\unhbox\tw@
966 \skip@c
\lastskip \unskip\unskip\hskip\skip@c
970 \eq@wdT
\z@
\eq@wdMin
\maxdimen \eq@vspan
\z@skip
\eq@badness
\z@
971 \let\@elt
\eq@recalc@a
\eq@measurements
\let\@elt
\relax
973 \def\eq@recalc@a
#1x
#2+
#3\@endelt
{%
975 \let\@elt
\eq@recalc@b
976 \@elt
#1x
#2+
#3\@endelt
978 \def\eq@recalc@b
#1X
#2,
#3x
#4+
#5@
#6\@endelt
{%
979 \setlength\dim@a
{#2+
#3}%
980 \ifdim\dim@a>
\eq@wdT
\eq@wdT
\dim@a
\fi
981 \ifdim\dim@a<
\eq@wdMin
\eq@wdMin
\dim@a
\fi
983 \addtolength\eq@vspan
{#1+
#4+
\eq@dp
}%
984 \ifnum#6>
\eq@badness
\eq@badness
#6\relax\fi
987 \@namedef
{eq@try@layout@?
}{%
988 \let\eq@trial@b
\eq@trial@c
989 \edef\@parshape
{\parshape 1 0pt
\the\eq@linewidth
\relax}%
990 \setlength\dim@a
{\wd\EQ@copy-
2em
}% Fudge; can't shrink more than this?
991 % if we're in a numbered group, try hard to fit within the numbers
993 \if\eq@shiftnumber
\else\if\eq@group
994 \if\eq@hasNumber
\addtolength\dim@b
{-
\wd\EQ@numbox-
\eqnumsep}%
995 \else\if\grp@hasNumber
\addtolength\dim@b
{-
\wd\GRP@numbox-
\eqnumsep}%
997 \ifdim\dim@a<
\dim@b
% Do we even have a chance of fitting to one line?
998 \setlength\dim@b
{\columnwidth-
\dim@a+
\eq@wdCond
}%
999 \rightskip\z@\@plus
\dim@b\@minus
\hfuzz
1000 \eq@trial@b
{i
}{\eq@try@layout@multi
}%
1002 \eq@try@layout@multi
1005 \def\eq@try@layout@multi
{%
1007 \ifdim\eq@wdL>
\eq@linewidth
1008 \setlength\dim@a
{\wd\EQ@copy-
\eq@wdL
}%
1009 \ifdim\dim@a<
.25\eq@linewidth
\eq@try@layout@S
1010 \else \eq@try@layout@l
1012 % BRM: Originally .7: Extreme for L since rhs has to wrap within the remaining 30+%!
1013 \else\ifdim\eq@wdL>
.50\eq@linewidth
1019 \eq@try@layout@S
% (already checked case i)
1022 \def\eq@try@layout@D
{%
1023 \setlength\dim@a
{\eq@linewidth -
\eq@indentstep
}%
1024 \edef\@parshape
{\parshape 2
1025 0pt
\the\eq@wdL
\space \the\eq@indentstep
\space \the\dim@a
\relax
1027 \def\adjust@rel@penalty
{\penalty-
99 }%
1028 \eq@trial@b
{D
}{\eq@try@layout@A
}%
1030 \def\eq@try@layout@L
{%
1031 \setlength\dim@b
{\eq@linewidth-
\eq@wdL
}%
1032 \edef\@parshape
{\parshape 2 0pt
\the\eq@linewidth
\space
1033 \the\eq@wdL
\space \the\dim@b
\relax
1035 \eq@trial@b
{L
}{\eq@try@layout@D
}%
1037 \def\eq@try@layout@S
{%
1038 \setlength\dim@b
{\eq@linewidth-
2\eqmargin}% \advance\dim@b-1em%
1039 \int@a
\wd\EQ@copy
\divide\int@a
\dim@b
1040 \addtolength\dim@b
{-
\int@a
\eq@indentstep
}%
1043 \addtolength\dim@b
{-
\eq@wdNum
}%
1048 \edef\@parshape
{\parshape 2 0pt
\the\dim@b
\space
1049 \the\eqmargin\space\the\dim@b
\relax}%
1050 \eq@trial@b
{S
}{\eq@try@layout@A
}%
1052 \def\eq@try@layout@l
{%
1053 \setlength\dim@a
{\eq@linewidth -
\eq@indentstep
}%
1054 \int@a
\eq@wdL
\divide\int@a
\dim@a
1056 \edef\@parshape
{\parshape \number\int@a
\space
1057 0pt
\the\eq@linewidth
1060 \setlength\dim@b
{2\eq@indentstep
}%
1061 \setlength\dim@c
{\eq@linewidth -
\dim@b
}%
1062 \edef\@parshape
{\@parshape
1063 \replicate{\int@a
}{\space\the\eq@indentstep
\space\the\dim@a
}%
1064 \space\the\dim@b
\space\the\dim@c
\relax
1066 \eq@trial@b
{l
}{\eq@try@layout@A
}%
1068 \def\eq@try@layout@A
{%
1069 \edef\@parshape
{\parshape 1 0pt
\the\eq@linewidth
\relax}%
1070 \if\EQ@hasLHS
\def\adjust@rel@penalty
{\penalty-
99 }\fi
1073 \let\eq@shiftnumber\@False
1074 \def\eq@retry@with@number
{%
1077 \ifdim\eq@wdCond>
\z@
\if R
\eqnumside
1078 \let\eq@shiftnumber\@True
1082 \ifdim\@totalleftmargin>
\dim@b
\dim@b\@totalleftmargin
\fi
1084 \addtolength\dim@b
{\@totalleftmargin
}%
1086 \setlength\dim@a
{\eq@linewidth-
\dim@b
}%\advance\dim@a1em\relax% Allowance for shrink?
1087 \int@a\@ne
\if\eq@group
\int@a
\maxint\fi
1088 \if\eq@shiftnumber
% Already know we need to shift
1089 \else\ifdim\eq@wdT<
\dim@a
% Fits!
1091 \setlength\leftskip{\eq@wdNum
}%
1092 \setlength\rightskip{\z@\@plus
\dim@a
}%
1093 \adjust@parshape\@parshape
1095 \edef\eq@prev@lines
{\the\eq@lines
}%
1096 \edef\eq@prev@badness
{\the\eq@badness
}% BRM
1098 \int@a
\eq@prev@badness
\relax\advance\int@a
50\relax%?
1099 \int@b
\eq@prev@lines
\if\eq@group
\advance\int@b\@ne
\fi% Allow 1 extra line in group
1100 \ifnum\eq@lines>
\int@b
% \eq@prev@lines
1101 \let\eq@shiftnumber\@True
1103 \let\eq@shiftnumber\@True
1104 \else\ifnum\eq@badness>
\int@a
% BRM: New case
1105 \let\eq@shiftnumber\@True
1110 \EQ@trial
% Restore parshape & other params,
1111 \leftskip\z@
\let\eq@shiftnumber\@True
% But set shift & leftskip
1112 \edef\@parshape
{\eq@parshape
}% And copy saved parshape back to `working copy' !?!?
1114 \eq@trial@save
\EQ@trial
% Either way, save the trial state.
1117 \def\adjust@parshape
#1{%
1118 \@xp
\adjust@parshape@a
#1\relax
1121 \def\adjust@parshape@a
#1 #2\relax{%
1122 \setlength\dim@a
{\leftskip+
\rightskip}%
1124 \adjust@parshape@b
#2 @ @
\relax
1126 \def\adjust@parshape@b
#1 #2 {%
1127 \ifx @
#1\edef\temp@a
{\temp@a
\relax}%
1132 \addtolength\dim@c
{\dim@a+
\dim@b
}%
1133 \ifdim\dim@c>
\eq@linewidth
\setlength\dim@c
{\eq@linewidth
}\fi
1134 \addtolength\dim@c
{-
\dim@b
}%
1135 \edef\temp@a
{\temp@a
\space\the\dim@b
\space\the\dim@c
}%
1139 \def\eq@ml@record@indents
{%
1143 \@xp
\edef\csname eq@i
\number\int@a
\endcsname{\the\dim@a
}%
1144 \ifnum\int@a<
\int@b
\afterassignment\@tempb
\fi
1147 \def\@tempb
{\afterassignment\@tempa
\dim@a
}%
1148 \def\@tempc#
#1#
#2 {\int@b#
#2\afterassignment\@tempa
\dim@a
}%
1149 \@xp\@tempc\@parshape
1151 \chardef\@endelt=`\?
1152 \def\eq@measurements
{%
1153 \@elt
4.5pt/
5.0pt,
66.0ptx6.8pt+
2.4pt@
27\@endelt
1156 \def\eq@measure@lines
{%
1157 \let\eq@ml@continue
\eq@measure@lines
1158 \setbox\tw@
\lastbox \dim@b
\wd\tw@
% find target width of line
1159 \setbox\z@
\hbox to
\dim@b
{\unhbox\tw@
}% check for overfull
1161 \ifnum\eq@badness<
\inf@bad
\else \let\eq@badline\@True
\fi
1162 \eq@ml@a
\eq@ml@continue
1165 \setbox\tw@
\hbox{\unhbox\z@
\unskip}% find natural width
1166 \ifdim\dim@b<
\wd\tw@
\setlength\dim@a
{\dim@b
}% shrunken line
1167 \else \setlength\dim@a
{\wd\tw@
}% OK to use natural width
1169 \addtolength\dim@a
{-
\leftskip}% BRM: Deduct the skip if we're retrying w/number
1170 \skip@a
\lastskip \unskip \unpenalty
1172 \let\eq@ml@continue
\relax % end the recursion
1174 % Sum repeated vskips if present
1176 \ifdim \lastskip=
\z@
1177 \else \addtolength\skip@a
{\lastskip}\unskip\unpenalty \@xp\@tempa
1181 \edef\eq@measurements
{\@elt
1182 \the\skip@a
\space X
% extra space to facilitate extracting only the
1185 \ifnum\eq@curline<
\parshape \number\eq@curline
1186 \else\number\parshape
1188 \endcsname,
\the\dim@a x
\the\ht\tw@+
\the\dp\tw@ @
\the\eq@badness\@endelt
1191 \advance\eq@curline
\m@ne
1192 \ifnum\eq@curline=
\z@
\let\eq@ml@continue
\relax\fi
1195 \global\advance\eq@vspan
\lastskip \unskip\unpenalty
1196 \ifdim\lastskip=
\z@
\else \@xp
\eq@ml@vspace
\fi
1198 \def\eq@dense@enough
{%
1199 \ifnum\eq@lines<
\thr@@
1202 \ifdim\eq@wdL >
.7\eq@wdT
1204 \else \@xp\@xp\@xp
\eq@dense@enough@a
1208 \def\true@false@true
{\fi\fi\iftrue\iffalse\iftrue}
1209 \def\false@false@false
{\fi\fi\iffalse\iffalse\iffalse}
1210 \def\false@true@false
{\fi\fi\iffalse\iftrue\iffalse}
1211 \def\eq@density@factor
{.475}
1212 \def\eq@dense@enough@a
{%
1214 \ifnum\eq@lines>
\sixt@@n
1217 \dim@b
\z@
\let\@elt
\eq@delt
\eq@measurements
1218 \dim@c
\eq@density@factor
\eq@wdT
\multiply\dim@c
\eq@lines
1219 \ifdim\dim@b>
\dim@c
\true@false@true
\else \false@false@false
\fi
1222 \def\eq@delt
#1X
#2,
#3x
#4+
#5@
#6\@endelt
{\addtolength\dim@b
{#3}}%
1223 \def\eq@dense@enough@b
{%
1224 \int@b
\eq@wdT
\divide\int@b
\p@
1225 \dim@b
\eq@wdL
\divide\dim@b
\int@b
1226 \dim@c
\eq@lines
\p@
\multiply\dim@c
\f@ur
1227 \int@b
\eq@lines
\multiply\int@b
9 \advance\int@b -
10%
1229 \ifdim\dim@b<
\dim@c
\true@true@true
\else \false@true@false
\fi
1231 \let\eq@parshape\@empty
1233 \baselineskip\eqlinespacing
1234 \lineskip\eqlineskip \lineskiplimit\eqlineskiplimit
1235 \clubpenalty\@M
\widowpenalty\@M
\interlinepenalty\eqinterlinepenalty
1236 \linepenalty199 \exhyphenpenalty5000 % was 9999: make breaks at, eg. \* a bit easier.
1237 \ifdim\hfuzz<
\p@
\hfuzz\p@
\fi
1239 \tolerance9999 \pretolerance\m@ne
1241 \def\eq@dump@box
#1#2{%
1242 \noindent #1#2\setbox\f@ur
\lastbox \setbox\tw@
\lastbox
1243 \if L
\eq@layout
\box\tw@
\else\unhbox\tw@
\fi
1244 \adjust@rel@penalty
\unhbox\f@ur
1246 \def\eq@typeset@Unnumbered
{%
1248 \eq@typeset@equation
1250 \def\eq@typeset@LM
{%
1251 \setlength\dim@a
{(
\eq@vspan+
\ht\EQ@numbox-
\dp\EQ@numbox)/
2}%
1252 \eq@typeset@leftnumber
1254 \eq@typeset@equation
1256 \def\eq@typeset@LT
{%
1258 \eq@typeset@leftnumber
1260 \eq@typeset@equation
1262 \def\eq@typeset@LShifted
{%
1264 \copy\EQ@numbox
\penalty\@M
1267 \setlength\dim@a
{\eq@framesep+
\eq@framewd
}%
1271 \eq@typeset@equation
1273 \def\eq@typeset@RM
{%
1274 \setlength\dim@a
{(
\eq@vspan+
\ht\EQ@numbox-
\dp\EQ@numbox)/
2}%
1275 \eq@typeset@rightnumber
1277 \eq@typeset@equation
1279 \def\eq@typeset@RB
{%
1280 % NOTE: is \eq@dp useful here
1281 \setlength\dim@a
{\eq@vspan-
\ht\EQ@numbox-
\dp\EQ@numbox
}%
1282 \eq@typeset@rightnumber
1284 \eq@typeset@equation
1286 \def\eq@typeset@RShifted
{%
1289 \eq@typeset@equation
1293 \addtolength\dim@a
{\eq@framesep+
\eq@framewd
}%
1296 \hbox to
\hsize{\hfil\copy\EQ@numbox
}\@@par
%
1298 \def\eq@C@setsides
{%
1299 % \dim@c = space for number, if any, and not shifted.
1301 \if\eq@hasNumber
\if\eq@shiftnumber
\else
1304 % \dim@e = space for condition(on right), if any and formula is only a single line.(to center nicely)
1305 % but only count it as being right-aligned if we're not framing, since the frame must enclose it.
1308 \ifnum\eq@lines=\@ne
\ifdim\eq@wdCond>
\z@
1309 \setlength\dim@e
{\eq@wdCond+
\conditionsep}%
1311 % \dim@b = minimum needed on left max(totalleftmargin, left number space)
1313 \if L
\eqnumside\ifdim\dim@b<
\dim@c
1316 \ifdim\dim@b<\@totalleftmargin
1319 \addtolength\dim@b
{-\@totalleftmargin
}%
1321 % \dim@d = minimum needed on right max(condition, right number space)
1323 \if R
\eqnumside\ifdim\dim@d<
\dim@c
1326 % \dim@a = left margin; initially half available space
1327 % \dim@c = right margin; ditto
1328 \setlength\dim@a
{(
\eq@linewidth-
\eq@wdT+
\dim@e+\@totalleftmargin)/
2}%
1330 % If too far to the left
1332 \addtolength\dim@c
{\dim@a-
\dim@b
}%
1333 \ifdim\dim@c<
\z@
\dim@c=
\z@
\fi
1335 % Or if too far to the right
1336 \else\ifdim\dim@c<
\dim@d
1337 \addtolength\dim@a
{\dim@c-
\dim@d
}%
1338 \ifdim\dim@a<
\z@
\dim@a=
\z@
\fi
1341 % Now, \dim@d,\dim@e is the left & right glue to center each line for centerlines
1342 \setlength\dim@e
{\eq@wdT-
\eq@wdMin
}\dim@d=
\z@
1345 \divide\dim@e2
\relax
1348 \setlength\leftskip{\dim@a\@plus
\dim@d
}%
1349 \addtolength\dim@e
{\dim@c
}%
1350 \setlength\rightskip{\z@\@plus
\dim@e
}%\@minus5\p@
1351 % Special case: if framing, reduce the stretchiness of the formula (eg. condition)
1352 % Or if we have a right number, FORCE space for it
1357 \if\@And
{\eq@hasNumber
}{\@Not
{\eq@shiftnumber
}}%
1365 % If either of those cases requires hard rightskip, move that part from glue.
1367 \addtolength\dim@e
{-
\dim@c
}%
1368 \rightskip\dim@b\@plus
\dim@e
%\@minus5\p@
1370 % And peculiar further special case: in indented environs, width isn't where it would seem
1371 \ifdim\eq@wdCond>
\z@
1372 \addtolength\rightskip{-\@totalleftmargin
}%
1376 \def\eq@I@setsides
{%
1377 \leftskip\mathindent
1379 \setlength\dim@a
{\eq@linewidth-
\eq@wdT-
\mathindent}%
1381 \leftskip=
\z@
% Or something minimal?
1385 \setlength\dim@b
{\eq@linewidth-
\leftskip-
\eq@wdMin
}%
1388 \setlength\dim@a
{\eq@linewidth-
\leftskip-
\eq@wdT
}
1389 \addtolength\dim@b
{-
\dim@a
}%
1391 % Or force the space for right number, if needed
1392 \if\@And
{\eq@hasNumber
}{\@Not
{\eq@shiftnumber
}}%
1396 \addtolength\dim@b
{-
\dim@c
}%
1401 \setlength\rightskip{\dim@a\@plus
\dim@b \@minus
\hfuzz }%\hfuzz\z@
1404 \def\eq@typeset@leftnumber
{%
1405 \setlength\skip@c
{\dim@a-
\ht\EQ@numbox
}%
1406 \vglue\skip@c
% NON discardable
1407 \copy\EQ@numbox
\penalty\@M
1410 \def\eq@typeset@rightnumber
{%
1411 \setlength\skip@c
{\dim@a-
\ht\EQ@numbox
}%
1412 \vglue\skip@c
% NON discardable
1413 \hbox to
\hsize{\hfil\copy\EQ@numbox
}\penalty\@M
1416 \def\eq@typeset@equation
{%
1418 \eq@params
\eq@parshape
1419 \nointerlineskip\noindent
1421 \eq@dump@box
\unhbox\EQ@box\@@par
1423 \newcommand\eqframe[2]{%
1425 \fboxrule=
\eq@framewd
\relax\fboxsep=
\eq@framesep
\relax
1426 \framebox{\z@rule\@height
#2\kern#1}%
1431 \setlength\dim@a
{\eq@framesep+
\eq@framewd
}%
1433 \vbox to
\z@
{\kern-
\dim@a
1434 \hbox{\eqframe{\eq@wdT
}{\eq@vspan
}}%
1440 \def\eq@typeset@frame
{%
1442 % Tricky: put before \noindent, so it's not affected by glue in \leftskip
1443 \nobreak\nointerlineskip
1444 \vbox to
\eq@firstht
{\moveright\leftskip\hbox to
\z@
{\eq@addframe
\hss}\vss}%
1448 \@saveprimitive
\left\@@left
1449 \@saveprimitive
\right\@@right
1452 \@ifnext .
{\eq@nullleft
}{\begingroup \let\delimiter\eq@left@a
}%
1455 \@ifnext .
{\eq@nullright
}{\begingroup \let\delimiter\eq@right@a
}%
1457 \def\eq@left@a
#1 #2{\endgroup\@@left
\delimiter#1 \after@open
}
1458 \def\eq@right@a
#1 #2{\endgroup
1459 \@@right
\delimiter#1 \after@close
\ss@scan
{#1}%
1461 \def\eq@nullleft
#1{\@@left
#1\after@open
}
1462 \def\eq@nullright
#1{\@@right
#1\after@close
}
1463 % For paren matching: )
1465 \let\after@open
\relax \let\after@close
\relax
1466 \let\left\@@left
\let\right\@@right
1468 \@ifundefined
{bBigg@
}{% not defined
1470 \def\big{\bBigg@
{8.5}}\def\Big{\bBigg@
{11.5}}%
1471 \def\bigg{\bBigg@
{14.5}}\def\Bigg{\bBigg@
{17.5}}%
1472 \def\biggg{\bBigg@
{20.5}}\def\Biggg{\bBigg@
{23.5}}%
1477 \vrule\@height
#1\big@size\@width-
\nulldelimiterspace
1481 \def\bigl#1{\mathopen\big{#1}\after@open
}
1482 \def\Bigl#1{\mathopen\Big{#1}\after@open
}
1483 \def\biggl#1{\mathopen\bigg{#1}\after@open
}
1484 \def\Biggl#1{\mathopen\Bigg{#1}\after@open
}
1485 \def\bigggl#1{\mathopen\biggg{#1}\after@open
}
1486 \def\Bigggl#1{\mathopen\Biggg{#1}\after@open
}
1488 \def\bigr#1{\mathclose\big{#1}\after@close
}
1489 \def\Bigr#1{\mathclose\Big{#1}\after@close
}
1490 \def\biggr#1{\mathclose\bigg{#1}\after@close
}
1491 \def\Biggr#1{\mathclose\Bigg{#1}\after@close
}
1492 \def\bigggr#1{\mathclose\biggg{#1}\after@close
}
1493 \def\Bigggr#1{\mathclose\Biggg{#1}\after@close
}
1495 %% No change needed, I think. [mjd,1998/12/04]
1496 %%\def\bigm{\mathrel\big}
1497 %%\def\Bigm{\mathrel\Big}
1498 %%\def\biggm{\mathrel\bigg}
1499 %%\def\Biggm{\mathrel\Bigg}
1500 %%\def\bigggm{\mathrel\biggg}
1501 %%\def\Bigggm{\mathrel\Biggg}
1502 \let\m@@DeL
\m@DeL
\let\m@@DeR
\m@DeR
\let\m@@DeB
\m@DeB
1504 \delimiter"
4\@xp
\delim@a
\csname sd@
#1#2#3\endcsname #1#2#3 \after@open
1507 \delimiter"
5\@xp
\delim@a
\csname sd@
#1#2#3\endcsname #1#2#3 \after@close
1510 \delimiter"
0\@xp
\delim@a
\csname sd@
#1#2#3\endcsname #1#2#3 \after@bidir
1512 %%BRM: These weren't defined, but apparently should be.
1513 \let\m@@DeA
\m@DeA
\let\d@@DeA
\m@DeA
%
1514 \let\after@bidir\@empty
1515 \mathchardef\zero@bop=
888 \relax
1516 \mathchardef\bop@incr=
4444 \relax
1518 \global\advance\lr@level\@ne
1519 \prebinoppenalty\bop@incr
\multiply\prebinoppenalty\lr@level
1520 \advance\prebinoppenalty\zero@bop
1521 \ifnum\eqbreakdepth<
\lr@level
1524 \eq@binoffset=
\eqbinoffset
1525 \advance\eq@binoffset
\lr@level
\eqdelimoffset plus1fill
\relax
1526 \def\dt@fill@cancel
{\hskip\z@ minus1fill
\relax}%
1528 \penalty\@M
% BRM: discourage break after an open fence?
1531 \global\advance\lr@level
\m@ne
1532 \prebinoppenalty\bop@incr
\multiply\prebinoppenalty\lr@level
1533 \advance\prebinoppenalty\zero@bop
1534 \ifnum\eqbreakdepth<
\lr@level
1535 \else \let\m@Bin
\d@@Bin
1537 \ifnum\lr@level<\@ne
\eq@binoffset=
\eqbinoffset\relax \fi
1539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1541 \let\subsup@flag=
\count@
1542 \def\ss@delim@a
#1#2#3#4{\xdef\right@delim@code
{\number"
#2#3#4}}
1545 \let\delim@a
\ss@delim@a \@tempcnta
#1\relax
1547 \subsup@flag\@M
\afterassignment\ss@scan@a
\let\@let@token=
}
1549 \ifx\@let@token
\sb \advance\subsup@flag\@ne
\else
1550 \ifx\@let@token
\sp \advance\subsup@flag
\tw@
\else
1552 \expandafter\@firstoftwo
% gobble \ss@scan@b
1554 \ss@scan@b\@let@token
1556 \def\ss@scan@b
#1#2{#1{%
1557 \let\m@Bin
\m@@Bin
\let\m@Rel
\m@@Rel
1558 #2}\afterassignment\ss@scan@a
\let\@let@token=
}%
1560 \@@vadjust
{\penalty\thr@@
}%
1561 \penalty\right@delim@code
\penalty-
\subsup@flag
\keep@glue
1563 \def\eq@lrunpack
{\setbox\z@
\lastbox
1564 \unskip \nointerlineskip
1565 \noindent\unhbox\z@
\unskip
1566 \subsup@flag-
\lastpenalty \unpenalty
1567 \xdef\right@delim@code
{\number\lastpenalty}%
1569 \ifnum\subsup@flag>\@M
1570 \advance\subsup@flag-\@M
1572 \else \setbox\tw@
\box\voidb@x
1575 \ifvoid\tw@
\unhbox\z@
1576 \else \lrss@reattach
% uses \subsup@flag, box\z@, box\tw@
1578 \penalty-\@Mi
\z@rule\@@par
1579 \setbox\z@
\lastbox \unskip\unpenalty
1580 %%{\showboxbreadth\maxdimen\showboxdepth99\showlists}%
1582 \dimendef\sub@depth=
8 \dimendef\sup@base=
6
1583 \dimendef\prelim@sub@depth=
4 \dimendef\prelim@sup@base=
2
1584 \def\sym@xheight
{\fontdimen5\textfont\tw@
}
1585 \def\sup@base@one
{\fontdimen13\textfont\tw@
}
1586 \def\sub@base@one
{\fontdimen16\textfont\tw@
}
1587 \def\sub@base@two
{\fontdimen17\textfont\tw@
}
1588 \def\sup@drop
{\fontdimen18\scriptfont\tw@
}
1589 \def\sub@drop
{\fontdimen19\scriptfont\tw@
}
1590 \providecommand{\mathaxis}{\fontdimen22\textfont\tw@
}
1591 \def\lrss@reattach
{%
1593 % "The TeXbook" Appendix G step 18:
1594 \setlength\prelim@sup@base
{\ht\z@-
\sup@drop
}%
1595 \setlength\prelim@sub@depth
{\dp\z@ +
\sub@drop
}%
1597 \ifcase\subsup@flag
% case 0: this can't happen
1598 \or \lr@subscript
% case 1: subscript only
1599 \or \lr@superscript
% case 2: superscript only
1600 \else \lr@subsup
% case 3: sub and superscript both
1605 \sub@depth
\sub@base@one
1606 \ifdim\prelim@sub@depth>
\sub@depth
\sub@depth
\prelim@sub@depth
\fi
1607 \setlength\dim@a
{\ht\tw@ -
.8\sym@xheight
}%
1608 \ifdim\dim@a>
\sub@depth
\sub@depth=
\dim@a
\fi
1609 \twang@adjust
\sub@depth
1610 \lower\sub@depth
\box\tw@
1612 \def\lr@superscript
{%
1613 \sup@base
\sup@base@one
1614 \ifdim\prelim@sup@base>
\sup@base
\sup@base
\prelim@sup@base
\fi
1615 \setlength\dim@a
{\dp\tw@ -
.25\sym@xheight
}%
1616 \ifdim\dim@a>
\sup@base
\sup@base
\dim@a
\fi
1617 \twang@adjust
\sup@base
1618 \raise\sup@base
\box\tw@
1621 \sub@depth
\sub@base@two
1622 \ifdim\prelim@sub@depth>
\sub@depth
\sub@depth
\prelim@sub@depth
\fi
1623 \twang@adjust
\sub@depth
1624 \lower\sub@depth
\box\tw@
1626 \def\twang@adjust
#1{%
1628 \@ifundefined
{twang@
\right@delim@code
}{}{%
1629 \setlength\dim@d
{#1-
\mathaxis}%
1630 % put an upper limit on the adjustment
1631 \ifdim\dim@d>
1em
\dim@d
1em
\fi
1632 \kern\csname twang@
\right@delim@code
\endcsname\dim@d
1636 \newcommand{\DeclareTwang}[2]{%
1637 \ifcat.\@nx
#1\begingroup
1638 \lccode`\~=`
#1\lowercase{\endgroup \DeclareTwang{~
}}{#2}%
1640 \@xp
\decl@twang
#1?\@nil
{#2}%
1643 \def\decl@twang
#1#2#3#4#5#6#7\@nil
#8{%
1644 \@namedef
{twang@
\number"
#4#5#6}{#8}%
1646 \DeclareTwang{\rangle}{-
.4}
1647 \DeclareTwang{)
}{-
.33}
1648 \DeclareTwang{\rbrace}{-
.25}
1649 \newenvironment{dseries
}{\let\eq@hasNumber\@True \@optarg\@dseries
{}}{}%
1650 \def\enddseries#1{\check@punct@or@qed
}%
1651 \newenvironment{dseries*
}{\let\eq@hasNumber\@False \@optarg\@dseries
{}}{}%
1652 \@namedef
{enddseries*
}#1{\check@punct@or@qed
}%
1653 \@namedef
{end@dseries*
}{\end@dseries
}%
1655 \let\display@setup
\dseries@display@setup
1656 % Question: should this be the default for dseries???
1657 \global\eq@wdCond
\z@
1658 \@dmath
[layout=
{M
},
#1]%
1659 \mathsurround\z@\@@math
\penalty\@Mi
1660 \let\endmath\ends@math
1662 \ifdim\lastskip<
.3em
\unskip
1663 \else\ifnum\lastpenalty<\@M
\dquad\fi\fi
1665 \def\postmath{\unpenalty\eq@addpunct
\penalty\intermath@penalty
\dquad \@ignoretrue
}%
1670 \@@endmath
\mathsurround\z@
\end@dmath
1672 \def\eq@try@layout@M
{%
1673 \edef\@parshape
{\parshape 1 0pt
\the\eq@linewidth
\relax}%
1676 \def\intermath@penalty
{-
221}%
1677 \newcommand\dquad{\hskip0.6em minus
.3em
}
1678 \newcommand\premath{}\newcommand\postmath{}
1679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1680 \renewenvironment{math
}{%
1681 \leavevmode \premath
1682 \ifmmode\@badmath
\else\@@math
\fi
1684 \ifmmode\@@endmath
\else\@badmath
\fi
1686 \def\ends@math
#1{\check@punct@or@qed
}
1688 \ifmmode\@@endmath
\else\@badmath
\fi
1691 \let\eq@group\@False
1692 \let\grp@shiftnumber\@False
1693 \let\grp@hasNumber\@False
1694 \let\grp@eqs@numbered\@False
1695 \let\grp@aligned\@True
1696 \newenvironment{dgroup
}{%
1697 \let\grp@hasNumber\@True\@optarg\@dgroup
{}%
1702 \newenvironment{dgroup*
}{%
1703 \let\grp@hasNumber\@False\@optarg\@dgroup
{}%
1708 \let\eq@group\@True
\global\let\eq@GRP@first@dmath\@True
1709 \global\GRP@queue\@emptytoks
\global\setbox\GRP@box
\box\voidb@x
1710 \global\let\GRP@label\@empty
1711 \global\grp@wdL
\z@
\global\grp@wdR
\z@
\global\grp@wdT
\z@
1712 \global\grp@linewidth
\z@
\global\grp@wdNum
\z@
1713 \global\let\grp@eqs@numbered\@False
1714 \global\let\grp@aligned\@True
1715 \global\let\grp@shiftnumber\@False
1717 \setkeys{breqn
}{#1}%
1718 \if\grp@hasNumber
\grp@setnumber
\fi
1721 \EQ@displayinfo
\grp@finish
1722 \if\grp@hasNumber
\grp@resetnumber
\fi
1724 \@ifundefined
{c@parentequation
}{\newcounter{parentequation
}}{}
1725 \global\let\GRP@label\@empty
1726 \def\add@grp@label
{%
1727 \ifx\@empty
\GRP@label
1728 \else \GRP@label
\global\let\GRP@label\@empty
1731 \def\grp@setnumber
{%
1732 \global\let\GRP@label
\next@label
\global\let\next@label\@empty
1733 % Trick \eq@setnumber to doing our work for us.
1734 \let\eq@hasNumber\@True
1736 \global\sbox\GRP@numbox
{\unhbox\EQ@numbox
}%
1738 \let\eq@hasNumber\@False
1739 \let\eq@number\@empty
1741 \protected@edef
\theparentequation{\theequation}%
1742 \setcounter{parentequation
}{\value{equation
}}%
1743 \setcounter{equation
}{0}%
1744 \def\theequation{\theparentequation\alph{equation
}}%
1746 \def\grp@resetnumber
{%
1747 \setcounter{equation
}{\value{parentequation
}}%
1750 \newbox\GRP@wholebox
1752 \global\GRP@queue\@xp\@xp\@xp
{\@xp
\the\@xp
\GRP@queue
1753 \@xp\@elt\@xp
{\EQ@trial
}%
1755 \global\setbox\GRP@box
\vbox{%
1756 \hbox{\box\EQ@box
\box\EQ@copy
\penalty\@ne
\copy\EQ@numbox
}%
1760 \if\eq@isIntertext
\else
1761 \ifdim\eq@wdL>
\grp@wdL
\global\grp@wdL
\eq@wdL
\fi
1762 \ifdim\eq@wdT>
\grp@wdT
\global\grp@wdT
\eq@wdT
\fi
1763 \setlength\dim@a
{\eq@wdT-
\eq@wdL
}%
1764 \ifdim\dim@a>
\grp@wdR
\global\grp@wdR
\dim@a
\fi
1765 \ifdim\eq@linewidth>
\grp@linewidth
\global\grp@linewidth
\eq@linewidth
\fi
1767 \global\let\grp@eqs@numbered\@True
1768 \ifdim\eq@wdNum>
\grp@wdNum
\global\grp@wdNum
\eq@wdNum
\fi
1770 \if\EQ@hasLHS
\else\global\let\grp@aligned\@False
\fi
1771 \if D
\eq@layout
\global\let\grp@aligned\@False
\fi % Layout D (usually) puts rel on 2nd line.
1772 \if\eq@shiftnumber
\global\let\grp@shiftnumber\@True
\fi % One eq shifted forces all.
1776 \setlength\dim@a
{\grp@wdL+
\grp@wdR-
4em
}% Allowance for shrink?
1778 \ifdim\dim@a>
\grp@linewidth
1779 \global\let\grp@aligned\@False
1782 \addtolength\dim@a
{\grp@wdNum
}% Effective length
1785 \if\@And
{\grp@hasNumber
}{\@Not
\grp@eqs@numbered
}
1786 \ifdim\dim@a>
\grp@linewidth
1787 \global\let\grp@shiftnumber\@True
1792 \global\grp@wdT
\grp@wdL
1793 \global\advance\grp@wdT
\grp@wdR
1795 \setbox\GRP@wholebox
\vbox{%
1799 \global\let\eq@GRP@first@dmath\@True
1801 \dmath@first@leftskip
1802 \eq@topspace
{\vskip\parskip}%
1804 \if\@And
{\grp@hasNumber
}{\@Not
{\grp@eqs@numbered
}}%
1806 \copy\GRP@numbox
\penalty\@M
1810 (
\ht\GRP@wholebox+
\dp\GRP@wholebox+
\ht\GRP@numbox-
\dp\GRP@numbox)/
2}%
1811 \setlength\skip@c
{\dim@a-
\ht\GRP@numbox
}%
1812 \vglue\skip@c
% NON discardable
1813 \copy\GRP@numbox
\penalty\@M
1815 \kern-
\abovedisplayskip % To cancel the topspace above the first eqn.
1818 \unvbox\GRP@wholebox
1820 \eq@botspace
% not needed unless bottom number?
1823 \global\setbox\GRP@box
\vbox{%
1826 \setbox\tw@
\hbox{\unhbox\z@
1827 \ifnum\lastpenalty=\@ne
1829 \global\setbox\EQ@numbox
\lastbox
1832 \global\setbox\EQ@copy
\lastbox
1833 \global\setbox\EQ@box
\lastbox
1836 \begingroup \let\eq@botspace
\relax
1839 \vskip\belowdisplayskip
1849 \setlength\dim@a
{(
\grp@linewidth-
\grp@wdT)/
2}%
1850 \ifdim\dim@a<
\z@
\dim@a=
\z@
\fi
1851 \dim@b
\if L
\eqnumside\grp@wdNum
\else\z@
\fi
1852 \if\grp@shiftnumber
\else
1853 \ifdim\dim@b>
\dim@a
\dim@a
\dim@b
\fi
1856 \addtolength\dim@a
{\grp@wdL-
\eq@wdL
}%
1860 \let\eq@shiftnumber\@True
1863 \newskip\darraycolsep \darraycolsep 20pt plus1fil minus12pt
1864 \newcount\cur@row
\newcount\cur@col
1867 \setbox\z@
\hbox{$
\displaystyle####
\m@th$
}\@nx
\col@box
1870 \setbox\z@
\hbox{$
\displaystyle\mathord{}####
\mathord{}\m@th$
}\@nx
\col@box
1872 &
\cur@col
#3 \setbox\z@
\hbox{$
\displaystyle####
\m@th$
}\@nx
\col@box
1873 \hfil\tabskip\darraycolsep
1875 \xdef\darray@preamble
{%
1876 \@tempa
123&\@tempa
456&\@tempa
789%
1877 &\@tempa
{10}{11}{12}&\@tempa
{13}{14}{15}&\@tempa
{16}{17}{18}%
1880 \@ifundefined
{Mathstrut@
}{\let\Mathstrut@
\strut}{}
1881 \def\darray@cr
{\Mathstrut@
\cr}
1885 \newenvironment{darray
}{\@optarg\@darray
{}}{}
1887 \if\eq@group
\else\eq@prelim
\fi
1888 \global\let\@preamble\@empty
1889 \setkeys{breqn
}{#1}%
1890 \the\eqstyle \eq@setnumber
1891 \ifx\@preamble\@empty
\global\let\@preamble
\darray@preamble
\fi
1893 % \let\check@mathfonts\relax % tempting, but too risky
1894 \@xp
\let\csname\string\
\endcsname\darray@cr
1895 \setbox\z@
\vbox\bgroup
1896 \everycr{\noalign{\global\advance\cur@row\@ne
}}%
1897 \tabskip\z@skip
\cur@col
\z@
1899 \penalty\@ne
% flag for \dar@repack
1900 \halign\@xp
\bgroup\@preamble
1902 \def\enddarray#1{\check@punct@or@qed
}
1904 \ifvmode\else \eq@addpunct
\Mathstrut@
\fi\crcr \egroup
1909 %% \showboxbreadth\maxdimen\showboxdepth99\showlists
1910 \eq@wdL
\z@
\eq@wdRmax
\z@
1916 \global\setbox\EQ@box
\hbox{%
1917 \hbox{\unhcopy\tw@
\unskip}\penalty-\@M
\unhbox\EQ@box
}%
1918 \global\setbox\EQ@copy
\hbox{%
1919 \hbox{\unhbox\tw@
\unskip}\penalty-\@M
\unhbox\EQ@copy
}%
1921 \ifcase\lastpenalty \else\@xp\@gobble
\fi
1924 \newskip\conditionsep \conditionsep=
10pt minus5pt
%
1925 \newcommand{\conditionpunct}{,
}
1926 \let\cond@gobble\@firstofone
1927 \newcommand\condition{%
1928 \begingroup\@tempswatrue
1929 \@ifstar
{\@tempswafalse
\condition@a
}\condition@a
1931 \newcommand\condition@a
[2][\conditionpunct]{%
1932 \unpenalty\unskip\unpenalty\unskip % BRM Added
1934 \penalty -
201\relax\hbox{}% Penalty to allow breaks here.
1936 \if@tempswa \@xp
\hbox \else \@xp
\condition@b
\fi
1939 \setbox\z@
\if@tempswa
\hbox{#2}\else\hbox{\textmath@setup
#2}\fi
1940 \global\eq@wdCond
\wd\z@
1941 \let\cond@gobble\@gobble
1943 \newcommand\condition@b
[1]{%
1944 \cond@gobble
{\hskip\conditionsep}%
1947 \newenvironment{XXXXdsuspend
}{%
1948 \global\setbox\EQ@box
\vbox\bgroup \@parboxrestore
1949 \parshape 1 \displayindent \displaywidth\relax
1950 \hsize=
\columnwidth \noindent\ignorespaces
1953 \global\setbox\GRP@box
\vbox{%
1954 \vbox{\copy\EQ@box
\vtop{\unvbox\EQ@box
}}%
1957 \global\GRP@queue\@xp
{\the\GRP@queue
1958 \@elt
{\gdef\EQ@trial
{}}%
1961 \newenvironment{dsuspend
}{%
1962 \global\setbox\EQ@box
\vbox\bgroup \@parboxrestore
1963 \parshape 1 \displayindent \displaywidth\relax
1964 \hsize=
\columnwidth \noindent\ignorespaces
1967 \global\setbox\GRP@box
\vbox{%
1968 \hbox{\copy\EQ@box
\vtop{\unvbox\EQ@box
}}%
1971 \global\GRP@queue\@xp
{\the\GRP@queue
1972 \@elt
{\let\eq@isIntertext\@True
}%
1975 \newcommand\breqn@intertext
[1]{\dsuspend#1\enddsuspend}
1978 \setbox\z@
\hbox{\mathsurround\z@$
\mkern\eq@binoffset$
}%
1980 \kern\the\wd\z@
\textchar\discretionarytimes
1984 \discretionary{\thinspace\textchar\discretionarytimes}{}{}%
1987 \newcommand{\discretionarytimes}{\times}
1988 \def\nref#1{\@xp\@nref
\csname r@
#1\endcsname}
1989 \def\@nref
#1#2{\ifx\relax#1??
\else \@xp\@firstoftwo
#1\fi}
1990 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1993 %% End of file `breqn.sty'.