LaTeX - Companion PDF
LaTeX - Companion PDF
LaTeX - Companion PDF
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
C H A P T E R 8
Higher Mathematics
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
224 Higher Mathematics
Tables 8.12 on page 227 to 8.19 on page 229 show the extra math symbols of
the AMS-Fonts, which are automatically available when you specify the amssymb
package.2 However, if you want to define only some of them (perhaps because
your TEX installation has insufficient memory to define all the symbol names),
you can use the amsfonts package and the \DeclareMathSymbol command, which
is explained in section 7.7.6.
1 The AMS distribution also contains a file diff12.tex which describes differences between
version 1.1 and 1.2 of AMS-LATEX. Note in particular that in versions 1.0 and 1.1 of AMS-
LATEX, which predated LATEX 2ε , the amsmath package was named “amstex” and included some
of the font-related features that are now separated in the amssymb and amsfonts packages.
2 Note that the Companion uses Lucida math fonts which contain the standard LATEX and
AMS symbols but with different shapes compared to the Computer Modern math fonts.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.2 Fonts and Symbols in Formulae 225
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
226 Higher Mathematics
.. ..
... \ldots ··· \cdots . \vdots . \ddots ℵ \aleph
0 \prime ∀ \forall ∞
√ \infty ~ \hbar ∅ \emptyset
∃ \exists ∇ \nabla \surd 2 \Boxa 4 \triangle
3 \Diamonda ı \imath \jmath ` \ell ¬ \neg
> \top [ \flat \ \natural ] \sharp ℘ \wp
⊥ \bot ♣ \clubsuit ♦ \diamondsuit ♥ \heartsuit ♠ \spadesuit
0 \mhoa < \Re = \Im ∠ \angle ∂ \partial
a
Not predefined in NFSS. Use the latexsym or amssymb package.
P Q ` R H
T \sum S \prod F \coprod W \int V \oint
J \bigcap N \bigcup L \bigsqcup U \bigvee \bigwedge
\bigodot \bigotimes \bigoplus \biguplus
Table 8.7: Variable-sized symbols (available in LATEX)
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.2 Fonts and Symbols in Formulae 227
\rmoustache \lmoustache \rgroup \lgroup
w
\arrowvert w \Arrowvert
\bracevert
Table 8.10: Large delimiters (available in LATEX)
f
abc \widetilde{abc} c
abc \widehat{abc}
←− −→
abc \overleftarrow{abc} abc \overrightarrow{abc}
abc \overline{abc} abc \underline{abc}
z}|{
abc \overbrace{abc} abc
|{z} \underbrace{abc}
√ √n
abc \sqrt{abc} abc \sqrt[n]{abc}
abc
f0 f’ xyz \frac{abc}{xyz}
Table 8.11: LATEX math constructs
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
228 Higher Mathematics
≮ \nless \nleq
\nleqslant
\nleqq \lneq \lneqq
\lvertneqq \lnsim \lnapprox
⊀ \nprec \npreceq \precnsim
\precnapprox \nsim . \nshortmid
- \nmid 0 \nvdash 2 \nvDash
6 \ntriangleleft 5 \ntrianglelefteq * \nsubseteq
( \subsetneq \varsubsetneq $ \subsetneqq
& \varsubsetneqq ≯ \ngtr \ngeq
\ngeqslant \ngeqq
\gneq
\gneqq \gvertneqq \gnsim
\gnapprox \nsucc \nsucceq
\succnsim \succnapprox \ncong
/ \nshortparallel ∦ \nparallel 2 \nvDash
3 \nVDash 7 \ntriangleright 4 \ntrianglerighteq
+ \nsupseteq # \nsupseteqq ) \supsetneq
! \varsupsetneq % \supsetneqq ' \varsupsetneqq
Table 8.17: AMS negated binary relations (available with amssymb package)
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.2 Fonts and Symbols in Formulae 229
\newcommand{\bpi}{\boldsymbol{\pi}}
\newcommand{\binfty}{\boldsymbol{\infty}}
B∞ + πB1 ∼ B∞ + πB1 \[ B_\infty + \pi B_1 \sim
\mathbf{B}_{\binfty} \boldsymbol{+}
\bpi \mathbf{B}_{\boldsymbol{1}}
\]
For those math symbols where the command \boldsymbol has no effect
because the bold version of the symbol does not exist in the currently available
fonts, there exists a command “Poor man’s bold” (\pmb), which simulates bold
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
230 Higher Mathematics
\mathbb Blackboard bold alphabet, e.g., $\mathbb{NQRZ}$ gives: NQRZ (not available
in amsmath, need to load amssymb).
\mathfrak Euler Fraktur alphabet, e.g., $\mathfrak{E}=\mathfrak{mc}^2$ gives: E =
mc2 (not available in amsmath, need to load amssymb).
\boldsymbol Used to obtain bold numbers and other nonalphabetic symbols, as well as bold
Greek letters (defined in amsbsy).
\pmb “Poor man’s bold,” used for math symbols when
H bold versions don’t exist in the
available fonts, e.g., $\pmb{\oint}$ gives: and $\pmb{\triangle}$ gives:
4 (defined in amsbsy).
\text Produce normal text with correct text-spacing in the current font used outside
math, e.g., $E=mc^2\quad\text{(Einstein)}$ gives: E = mc2 (Einstein)
(defined in amstext).
Table 8.20: Font commands available in mathematics with the AMS packages
by typesetting several copies of the symbol with slight offsets. This procedure
must be used for the extension and large operator symbols from the cmex font,
as well as the AMS extra math symbols from the msam and msbm fonts.
\[ \frac{\partial w}{\partial u}
∂w ∂u \pmb{\Bigg\vert}
∂u ∂v \frac{\partial u}{\partial v} \]
P Q
With large operators and extension symbols (for example, and ) \pmb
does not currently work very well because the proper spacing and treatment of
limits is not preserved. Therefore, the TEX operator \mathop needs to be used
(see table 7.13 on page 213).
XY XY \[ \sum_{j<P}
λR(ri ) λR(xj ) \prod_\lambda \lambda R(r_i) \qquad
j<P λ xj λ \mathop{\pmb{\sum}}_{x_j}
\mathop{\pmb{\prod}}_\lambda \lambda R(x_j)
\]
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.3 Compound Symbols, Delimiters, Operators 231
ZZ \begin{gather}
µ(u, v) du dv (8.1) \iint\limits_V \mu(u,v)\,du\,dv \\
\iiint\limits_V \mu(u,v,w)\,du\,dv\,dw \\
Z Z ZV \iiiint\limits_V \mu(t,u,v,w)\,dt\,du\,dv\,dw\\
µ(u, v, w) du dv dw (8.2) \idotsint\limits_V \mu(u_1,\dots,u_k)
ZZZZ V \end{gather}
µ(t, u, v, w) dt du dv dw (8.3)
V
Z Z
··· µ(u1 , . . . , uk ) (8.4)
V
−−−−−−→ \begin{align*}
ψδ (t)Et h = ψδ (t)Et h \overrightarrow{\psi_\delta(t) E_t h} &
−−−−−−→
←−−−−−− =\underrightarrow{\psi_\delta(t) E_t h} \\
ψδ (t)Et h = ψδ (t)Et h
←−−−−−− \overleftarrow{\psi_\delta(t) E_t h} &
←−−−−→
ψδ (t)Et h = ψδ (t)Et h =\underleftarrow{\psi_\delta(t) E_t h} \\
←−−−−→
\overleftrightarrow{\psi_\delta(t) E_t h} &
=\underleftrightarrow{\psi_\delta(t) E_t h}
\end{align*}
These
R arrows all scale properly in subscript sizes, as seen in the following inte-
gral −→
uv
vt dt, which was coded as $ \int_{\overrightarrow{uv}} vt\,dt $.
3 Some material in this and the following sections is reprinted from the electronic document
testmath.tex (distributed with AMS-LATEX) with permission of the American Mathematical
Society.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
232 Higher Mathematics
8.3.3 Dots
Ellipsis dots should almost always be typed as \dots. Positioning (on the base-
line or centered) is automatically selected according to whatever follows the
\dots. If the next character is a plus sign, the dots will be centered; if it’s a
comma, they will be on the baseline. These default dot placements provided by
the amsmath package can be changed if different conventions are wanted.
If the dots fall at the end of a math formula, the next character will be
something like \end or \) or $, which does not give any information about how
to place the dots. If that is the case, you must help by using \dotsc for “dots
with commas,” or \dotsb for “dots with binary operators/relations,” or \dotsm
for “multiplication dots,” or \dotsi for “dots with integrals.” In the example
below, low dots are produced in the first instance and centered dots in the others,
with the spacing on either side of the dots nicely adjusted.
\begin{gather*}
´ ¯ ˘ ˇ
Á B̄ C̆ Ď \Acute{\Acute{A}} \qquad\Bar{\Bar{B}} \qquad
¨ ` ˆ \Breve{\Breve{C}} \qquad\Check{\Check{D}} \\
Ë Ḟ˙ G̀ Ĥ
\Ddot{\Ddot{E}} \qquad\Dot{\Dot{F}} \qquad
~
I˜
˜ J~ \Grave{\Grave{G}} \qquad\Hat{\Hat{H}} \\
\Tilde{\Tilde{I}} \qquad\Vec{\Vec{J}}
\end{gather*}
This double accent operation is complicated and tends to slow down the
processing of a LATEX file. If the document contains many double accents, you
can load the amsxtra package. It defines the \accentedsymbol command, which
you can use in the preamble of your document to help speed things up. It stores
the result of the double accent command in a box register for quick retrieval.
\accentedsymbol is used like \newcommand:
ˆ
This is a double hat  and this δ̄˙ a delta with \accentedsymbol{\Ahathat}{\Hat{\Hat A}}
a bar and a dot. \accentedsymbol{\dbardot}{\Dot{\Bar \delta}}
This is a double hat \(\Ahathat\) and this
\(\dbardot\) a delta with a bar and a dot.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.3 Compound Symbols, Delimiters, Operators 233
\begin{gather}
(AmBD)b (AmBD)∨ (8.5) (AmBD)\sphat \qquad (AmBD)\spcheck \\
∼ . (AmBD)\sptilde \qquad (AmBD)\spdot \\
(AmBD) (AmBD) (8.6)
.. ... (AmBD)\spddot \qquad(AmBD)\spdddot \\
(AmBD) (AmBD) (8.7)
(AmBD)\spbreve
(AmBD)˘ (8.8) \end{gather}
8.3.7 Roots
In ordinary LATEX the placement of root indices is sometimes not good. With
amsmath the commands \leftroot and \uproot allow the adjustment of the
position of the root. Positive arguments to these commands will move the root
index to the left and up respectively, while a negative argument will move them
right and down. The units of increment are quite small, which is useful for such
adjustments. In the example below, the root index β is moved 2 units to the left
and 4 units up.
√
β
√
β
\[ \sqrt[\beta]{k} \qquad
k k \sqrt[\leftroot{2}\uproot{4}\beta]{k} \]
\[ \boxed{W_t - F \subseteq
Wt − F ⊆ V (Pi ) ⊆ Wt V(P_i) \subseteq W_t} \]
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
234 Higher Mathematics
\[0 \xleftarrow[\zeta]{\alpha}
α ∂0 α(b)
0 ←− F × 4[n − 1] −−−−→ E ∂0 b F\times\triangle[n-1]
ζ
\xrightarrow{\partial_0\alpha(b)}
E^{\partial_0b}
\]
∗ a \[ \overset{*}{X} \qquad
X X X \underset{*}{X} \qquad
∗ b
\overset{a}{\underset{b}{X}} \]
There is also a command called \sideset that serves a rather special pur-
pose: it puts symbols
P in the
Q subscript and superscript positions of large operator
symbols such as and . A prime example is the case when you want to put
a prime on a sum symbol. If there are no limits above or below the sum, you
could just use \nolimits:
X0 \begin{equation}
En . (8.9) \sum\nolimits’ E_n.
\end{equation}
But if you want not only the prime but also limits on the sum symbol,
things are not so easy. Suppose you want to add a prime on the sum symbol in
an expression, like
X \begin{equation}
nEn (8.10) \sum_{n<k,\;n\ \mathrm{odd}}nE_n
n<k, n odd \end{equation}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.3 Compound Symbols, Delimiters, Operators 235
then you can use \sideset like this: \sideset{}{’}\sum_{...}nE_n. The extra
pair of empty braces is explained by the fact that \sideset has the capability
of putting an extra symbol or symbols at each corner of a large operator.
2 Y4 X0 \[
Ei βx \sideset{_1^2}{_3^4}\prod_k \qquad
1 3
k 0≤i≤m \sideset{}{’}\sum_{0\le i\le m} E_i\beta x
\]
√ p \[ X_j=(1/\sqrt{\smash[b]{\lambda_j}})X_j’
Xj = (1/ λj )Xj0 Xj = (1/ λj )Xj0 \qquad
X_j=(1/\sqrt{\lambda_j})X_j’ \]
The previous example shows how the \smash command was used to limit
the depth of the radical, which otherwise extends to encompass the depth of the
subscript (right-hand formula in the baove example).
..._{\text{word or phrase}}
which, apart from having a more descriptive name, is also slightly easier to enter
than the equivalent \mbox, since the correct size is automatically chosen:
\[ \mathbf{y}=\mathbf{y}’ \quad
y = y0 if and only if yk0 = δk yτ (k) \text{if and only if} \quad
y’_k=\delta_k y_{\tau(k)} \]
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
236 Higher Mathematics
Input text
\DeclareMathOperator*{\esssup}{ess\,sup}
\DeclareMathOperator{\meas}{meas}
\newcommand{\abs}[1]{\lvert#1\rvert}
\newcommand{\norm}[1]{\lVert#1\rVert}
\begin{align*}
\norm{f}_\infty & =
\esssup_{x\in R^n}\abs{f(x)} \\
\meas_1\{u\in R_+^1\colon f^*(u)>\alpha\} & =
\meas_n\{x\in R^n\colon\abs{f(x)}\geq\alpha\}\qquad\forall\alpha>0.
\end{align*}
Output text
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.3 Compound Symbols, Delimiters, Operators 237
\begin{gather}
lim n→∞ Q(un , un − u# ) ≤ 0 (8.11) \varlimsup_{n\rightarrow\infty}
lim n→∞ |an+1 | / |an | = 0 (8.12) \mathcal{Q}(u_n,u_n-u^{\#}) \le 0 \\
λ ∗ \varliminf_{n\rightarrow\infty}
−→(mi ·)
lim ≤0 (8.13)
\left|a_{n+1}\right|/\left|a_n\right| = 0 \\
←− p∈S(A) Ap ≤ 0
lim (8.14) \varinjlim (m_i^\lambda\cdot)^* \le 0 \\
\varprojlim_{p\in S(A)}A_p \le 0
\end{gather}
\begin{equation}
gcd(k, l mod k) (8.15) \gcd (k , l \bmod k)
\end{equation}
\begin{align}
u≡v+1 (mod n2 ) (8.16) u & \equiv v + 1 \pmod{n^2} \\
u≡v+1 mod n2 (8.17) u & \equiv v + 1 \mod{n^2} \\
u≡v+1 (n2 ) (8.18) u & \equiv v + 1 \pod{n^2}
\end{align}
\[ \frac{1}{k}\log_2 c(f)\quad
1 1
log2 c(f ) k
log2 c(f ) \tfrac{1}{k}\log_2 c(f) \]
k
and
q r
1 1 $ \sqrt{\frac{1}{k}\log_2 c(f)}\quad
and k
log2 c(f ) log2 c(f ). \sqrt{\dfrac{1}{k}\log_2 c(f)} $.
k
For binomial expressions such as nk the amsmath packages defines the com-
mands \binom, \dbinom, and \tbinom.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
238 Higher Mathematics
! \begin{equation}
k k−1 k
k−2 \binom{k}{1}2^{k-1}+\tbinom{k}{2}2^{k-2}
2 + 2
2 (8.19)
1 \end{equation}
! and
k
k k−2 $\binom{k}{1}2^{k-1}+\dbinom{k}{2}2^{k-2}$.
and 1
2k−1 + 2 .
2
\binom, and its variants \dbinom and \tbinom, as well as \frac and its
variants \dfrac and \tfrac are implemented using the generalized fraction com-
mand \genfrac, which has six parameters.
\genfrac{ldelim}{rdelim}{thick }{style}{num}{denom}
The first two parameters ldelim and rdelim are the left and right delimiters,
respectively. The third parameter thick allows you to override the line thickness
(for instance \binom uses this to set the line thickness to zero, i.e., invisible). If
this argument is left empty, the line thickness defaults to “normal”. The fourth
parameter is the mathematics style override. It can take integer values in the
range 0–3 to select, respectively, \displaystyle, \textstyle, \scriptstyle,
and \scriptscriptstyle. Finally, the fifth argument num is the numerator,
while the sixth denom is the denominator of the fraction.
To illustrate, here is how \frac, \tfrac, and \binom might be defined.
\newcommand{\frac}[2]{\genfrac{}{}{}{}{#1}{#2}}
\newcommand{\tfrac}[2]{\genfrac{}{}{}{1}{#1}{#2}}
\newcommand{\binom}[2]{\genfrac{(}{)}{0pt}{}{#1}{#2}}
* + \renewcommand{\over}[2]{%
n+1 n+1 \genfrac{}{}{}{}{#1}{#2}}
n n \renewcommand{\overwithdelims}[2]{%
\genfrac{\langle}{\rangle}{}{}{#1}{#2}}
! \[ \over{n+1}{n}\qquad\overwithdelims{n+1}{n} \]
n+2 n+2 \renewcommand{\atop}[2]{%
n n \genfrac{}{}{0pt}{}{#1}{#2}}
\renewcommand{\atopwithdelims}[2]{%
\genfrac{(}{)}{0pt}{}{#1}{#2}}
" #
n−3 n−3 \[ \atop{n+2}{n}\qquad\atopwithdelims{n+2}{n} \]
\renewcommand{\above}[2]{%
n n
\genfrac{}{}{1pt}{}{#1}{#2}}
\renewcommand{\abovewithdelims}[2]{%
\genfrac{[}{]}{1pt}{}{#1}{#2}}
\[ \above{n-3}{n}\qquad\abovewithdelims{n-3}{n} \]
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.3 Compound Symbols, Delimiters, Operators 239
\begin{equation}
1 \cfrac{1}{\sqrt{2}+
(8.20)
√ 1 \cfrac{1}{\sqrt{3}+
2+
√ 1 \cfrac{1}{\sqrt{4}+
3+ \cfrac[l]{1}{\sqrt{5}+
√ 1
4+ \cfrac[r]{1}{\sqrt{6}+\dotsb
√ 1
5+ √ }}}}}
6 + ··· \end{equation}
Z tε \[
Ey Lx,yx (s) ϕ(x) ds \biggl(\mathbf{E}_{y}\int_0^{t_\varepsilon}
0 L_{x,y^x(s)}\varphi(x)\,ds \biggr)
\]
Z tε {\Large
\[
Ey Lx,yx (s) ϕ(x) ds \biggl(\mathbf{E}_{y}\int_0^{t_\varepsilon}
0 L_{x,y^x(s)}\varphi(x)\,ds \biggr)
\]}
4 See table 7.13 on page 213 for a discussion of the various math symbol types.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
240 Higher Mathematics
( \begin{equation}
0 if r − j is odd, P_{r-j}=
Pr−j =
r! (−1)(r−j)/2 if r − j is even. \begin{cases}
(8.21) 0& \text{if $r-j$ is odd},\\
r!\,(-1)^{(r-j)/2}& \text{if $r-j$ is even}.
\end{cases}
\end{equation}
\begin{gather*}
0 1 0 −i 1 0 \begin{matrix} 0 & 1 \\ 1 & 0\end{matrix} \quad
1 0 i 0 0 −1
\begin{pmatrix}0 &-i \\ i & 0\end{pmatrix}\quad
a b
1 0
\begin{bmatrix}1 & 0 \\ 0 &-1\end{bmatrix}\\
c d
0 1
\begin{vmatrix}a & b \\ c & d\end{vmatrix}\quad
\begin{Vmatrix}1 & 0 \\ 0 & 1\end{Vmatrix}
\end{gather*}
\begin{equation}
\setcounter{MaxMatrixCols}{20}
A=\begin{pmatrix}
...&...&...&...&...&...&...&...&...&...&...&...& ... \\
... \\
...
\end{pmatrix}
\end{equation}
\setcounter{MaxMatrixCols}{10}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.4 Matrix-Like Environments and Commutative Diagrams 241
As counters are global in LATEX, you might want to reset the value of
MaxMatrixCols to its default value of 10 after finishing your wide matrix, since
with a high value, LATEX must work a lot harder to typeset a matrix.
To produce a small matrix suitable for use in text, use the smallmatrix
environment.
To show the effect of the matrix on To show the effect of the matrix on surrounding
surrounding lines inside a paragraph, we put lines inside a paragraph, we put it here:
it here: ( ac db ) and follow it with enough text \begin{math}
to ensure that there is at least one full line \left( \begin{smallmatrix}
below the matrix. a&b\\ c&d
\end{smallmatrix} \right)
\end{math}
and follow it with enough text to ensure that
there is at least one full line below the matrix.
\hdotsfor[spacing-factor ]{number }
The spacing of the dots can be varied by using the optional parameter
spacing-factor , for example, \hdotsfor[1.5]{3}. The number in square brack-
ets multiplies the spacing between the dots; the normal value is one.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
242 Higher Mathematics
Input text
\[ W(\Phi)= \begin{Vmatrix}
\dfrac\varphi{(\varphi_1,\varepsilon_1)} &0&
\hdotsfor{2} &0 \\
\dfrac{\varphi k_{n2}}{(\varphi_2,\varepsilon_1)} &
\dfrac\varphi{(\varphi_2,\varepsilon_2)} &0&\dots&0\\
\hdotsfor{5} \\
\dfrac{\varphi k_{n1}}{(\varphi_n,\varepsilon_1)} &
\dfrac{\varphi k_{n2}}{(\varphi_n,\varepsilon_2)}&\dots&
\dfrac{\varphi k_{n\,n-1}}{(\varphi_n,\varepsilon_{n-1})}&
\dfrac{\varphi}{(\varphi_n,\varepsilon_n)}
\end{Vmatrix}\]
ϕ
0 ............... 0
(ϕ1 , ε1 )
ϕkn2 ϕ
(ϕ , ε ) (ϕ , ε ) 0 ... 0
W (Φ) =
2 1 2 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ϕkn1 ϕkn2 ϕkn n−1 ϕ
(ϕ , ε ) (ϕ , ε ) . . . (ϕ , ε ) (ϕ , ε )
n 1 n 2 n n−1 n n
Output text
X \begin{equation}
P (i, j) (8.22) \sum
0≤i≤m _{\substack{0\le i\le m\\ 0<j<n}}
0<j<n
P(i,j)
\end{equation}
X \begin{equation}
P (i, j) (8.23) \sum_{\begin{subarray}{l}
i∈Λ i\in \Lambda\\ 0<j<n
0<j<n
\end{subarray}}
P(i,j)
\end{equation}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.4 Matrix-Like Environments and Commutative Diagrams 243
j
\DeclareMathOperator{\End}{End}
S WΛ ⊗ T −−−−→ T \[\begin{CD}
S^{\mathcal{W}_\Lambda}\otimes T
y yEnd P @>j>> T \\
(S ⊗ T )/I (Z ⊗ T )/J @VVV @VV{\End P}V\\
(S\otimes T)/I @= (Z\otimes T)/J
\end{CD}\]
A similar result, which does not look quite as good, can be produced in
ordinary LATEX by:
j
\[\begin{array}{ccc}
S WΛ⊗ T −→ T
S^{\mathcal{W}_\Lambda}\otimes T &
y yEnd P \stackrel{j}{\longrightarrow} &
(S ⊗ T )/I = (Z ⊗ T )/J T \\
\Big\downarrow & &
\Big\downarrow\vcenter{%
\rlap{$\scriptstyle{\mathrm{End}}\,P$}}\\
(S\otimes T)/I & = &
(Z\otimes T)/J
\end{array}\]
When using the amscd package, you will obtain longer horizontal arrows and
improved spacing between elements of the diagram.
In the CD environment the commands @>>>, @<<<, @VVV, and @AAA give (re-
spectively) right, left, down, and up arrows. For people with keyboards lacking
the angle brackets the notations @))) and @((( are available as alternatives.
For the horizontal arrows, material between the first and second > or <
symbols will be typeset as a superscript, and material between the second and
third will be typeset as a subscript. Similarly, material between the first and
second, or second and third, A’s or V’s of vertical arrows will be typeset as left
or right “sidescripts.” This was used in the first example above to place the
operator “End P ” to the right of the arrow.
The final example again shows the use of \DeclareMathOperator.
5 Much more extensive commutative diagram packages are Kristoffer Rose’s XY-pic
system [?], Paul Taylor’s Commutative Diagram package [?], and the Diagram 3 system by
Francis Borceux [?].
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
244 Higher Mathematics
\begin{equation*}
cov(L) −−−−→ non(K) −−−−→ cf(K)
x x \DeclareMathOperator{\add}{add}
y \DeclareMathOperator{\cf}{cf}
\DeclareMathOperator{\cov}{cov}
add(L) −−−−→ add(K) −−−−→ cov(K) \DeclareMathOperator{\non}{non}
\begin{CD}
\cov(\mathcal{L}) @>>> \non(\mathcal{K})
@>>> \cf(\mathcal{K})\\
@VVV @AAA @AAA \\
\add(\mathcal{L}) @>>> \add(\mathcal{K})
@>>> \cov(\mathcal{K})\\
\end{CD}
\end{equation*}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.5 Alignment Structures for Equations 245
\begin{equation}
x2 + y 2 = z 2 (8.24) x^2+y^2 = z^2
\end{equation}
\begin{align}
x2 + y 2 = z 2 (8.25) x^2+y^2 &= z^2 \\ x^3+y^3 &< z^3
3 3 3
x +y <z (8.26) \end{align}
\begin{eqnarray}
x^2+y^2 &=& z^2 \\ x^3+y^3 &<& z^3
x2 + y 2 = z2 (8.27) \end{eqnarray}
3 3
x +y < z3 (8.28)
\begin{gather}
(a + b)2 = a2 + 2ab + b2 (8.29) (a + b)^2 = a^2 + 2ab + b^2\\
(a + b) · (a − b) = a2 − b2 (8.30) (a + b) \cdot (a - b) = a^2 - b^2
\end{gather}
\begin{align}
x2 + y 2 = 1 x3 + y 3 = 1 (8.31) x^2 + y^2 & = 1 &
p p
x = 1 − y2 x = 3 1 − y3 x^3 + y^3 & = 1 \\
(8.32) x & = \sqrt{1-y^2} &
x & = \sqrt[3]{1-y^3}
\end{align}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
246 Higher Mathematics
\begin{align}
L1 = R1 L2 = R2 (8.33) L_1 & = R_1 & \qquad L_2 & = R_2 \\
L3 = R3 L4 = R4 (8.34) L_3 & = R_3 & \qquad L_4 & = R_4
\end{align}
\begin{alignat}{2}
L1 = R1 L2 = R2 (8.35) L_1 & = R_1 & \qquad L_2 & = R_2 \\
L3 = R3 L4 = R4 (8.36) L_3 & = R_3 & \qquad L_4 & = R_4
\end{alignat}
\begin{flalign}
L1 = R1 L2 = R2 (8.37) L_1 & = R_1 & \qquad L_2 & = R_2 \\
L3 = R3 L4 = R4 (8.38) L_3 & = R_3 & \qquad L_4 & = R_4
\end{flalign}
\begin{flalign*}
L1 = R1 L2 = R2 L_1 & = R_1 & \qquad L_2 & = R_2 \\
L3 = R3 L4 = R4 L_3 & = R_3 & \qquad L_4 & = R_4
\end{flalign*}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.5 Alignment Structures for Equations 247
\begin{multline}
First line of equation \text{First line of equation} \\
\text{Centered Middle line} \\
Centered Middle line
\shoveright{\text{Right Middle line}} \\
Right Middle line \text{Other centered Middle} \\
Other centered Middle \shoveleft{\text{Left Middle line}} \\
Left Middle line \text{Last line of equation}
\end{multline}
Last line of equation (8.39)
\begin{equation}
(a + b)4 = (a + b)2 (a + b)2 \begin{split}
= (a2 + 2ab + b2 )(a2 + 2ab + b2 ) (8.40) (a+b)^4 &= (a+b)^2 (a+b)^2 \\
= a4 + 4a3 b + 6a2 b2 + 4ab3 + b4 &= (a^2+2ab+b^2)(a^2+2ab+b^2) \\
&= a^4+4a^3b+6a^2b^2+4ab^3+b^4 \\
\end{split}
\end{equation}
When the tbtags option is specified, the equation number for the split
environment will be put on the last (resp. first) line if the equation number is on
the right (resp. left). By default, the centertags option is in effect, putting the
equation number centered vertically on the height of the split, provided there
is enough room for it.
\begin{equation}
(a + b)3 = (a + b)(a + b)2 \begin{split}
= (a + b)(a2 + 2ab + b2 ) (a+b)^3 &= (a+b) (a+b)^2 \\
= a3 + 3a2 b + 3ab2 + b3 &= (a+b)(a^2+2ab+b^2) \\
(8.41)
&= a^3+3a^2b+3ab^2+b^3 \\
\end{split}
\end{equation}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
248 Higher Mathematics
\begin{equation*}
x2 + y 2 = 1 (a + b)2 = a2 + 2ab + b2 \begin{aligned}
p
x = 1 − y2 (a + b) · (a − b) = a2 − b2 x^2 + y^2 & = 1 \\
x & = \sqrt{1-y^2}
\end{aligned} \qquad
\begin{gathered}
(a + b)^2 = a^2 + 2ab + b^2 \\
(a + b) \cdot (a - b) = a^2 - b^2
\end{gathered}
\end{equation*}
The same mathematics can now be typeset using different vertical alignments
for the environments.
\begin{equation*}
x2 + y 2 = 1 \begin{aligned}[b]
p
x = 1 − y2 (a + b)2 = a2 + 2ab + b2 x^2 + y^2 & = 1 \\
(a + b) · (a − b) = a − b
2 2 x & = \sqrt{1-y^2}
\end{aligned} \qquad
\begin{gathered}[t]
(a + b)^2 = a^2 + 2ab + b^2 \\
(a + b) \cdot (a - b) = a^2 - b^2
\end{gathered}
\end{equation*}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.6 Miscellaneous 249
for this is that page breaks in such situations should receive individual at-
tention from the author. \displaybreak must go before the \\ where it is
supposed to take effect. Like LATEX’s \pagebreak, \displaybreak takes an
optional argument between zero and four denoting the desirability of the page
break. \displaybreak[0] means “it is permissible to break here” without en-
couraging a break; \displaybreak with no optional argument is the same as
\displaybreak[4] and forces a break.
There is also an optional argument for \allowdisplaybreaks. This com-
mand obeys the usual LATEX scoping rules. The normal way of limiting its scope
is to put {\allowdisplaybreaks at the beginning and } at the end of the de-
sired range. Within the scope of an \allowdisplaybreaks command, the \\*
command can be used to prohibit a page break, as usual.
\begin{align}
A1 = N0 (λ; Ω0 ) − φ(λ; Ω0 ), (8.42) A_1&=N_0(\lambda;\Omega’) -
A2 = φ(λ; Ω0 )φ(λ; Ω), (8.43) \phi(\lambda;\Omega’), \\
A_2&=\phi(\lambda;\Omega’)
and finally \phi(\lambda;\Omega), \\
\intertext{and finally}
A_3&=\mathcal{N}(\lambda;\omega).
A3 = N (λ; ω). (8.44)
\end{align}
Here the words “and finally” fall outside the display at the left margin.
8.6 Miscellaneous
This section discusses amsmath commands that have not been introduced yet,
and it gives a list of the document class files that come with the AMS-LATEX
distribution.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
250 Higher Mathematics
counter. The number on any particular line can be suppressed by putting \notag
before the \\. You can also override it with a tag of your own design using
\tag{label } \tag*{label }
where label can be any arbitrary text to be used to number the equation.
The starred form, \tag*, causes the label to be typeset without any anno-
tations like parentheses that might otherwise be added by the document class.
\tag and \tag* can also be used in the starred versions of all the amsmath
alignment environments.
\begin{gather}
x2 + y 2 = z 2 (8.45) x^2+y^2 = z^2 \label{eq:r2} \\
3 3 3 x^3+y^3 = z^3 \notag \\
x +y =z
x^4+y^4 = r^4 \tag{$*$} \\
x4 + y 4 = r 4 (∗)
x^5+y^5 = r^5 \tag*{$*$} \\
5
x +y =r 5 5
∗ x^6+y^6 = r^6 \tag{\ref{eq:r2}$’$}
x6 + y 6 = r6 (8.450 ) \end{gather}
Notice the use of the \label and \ref commands in the previous example
to allow subnumbering of equations.
When leqno is specified as an option to the amsmath package, the equation
number will be printed at the left side of the equation (by default, with amsmath,
it comes out at the right).
\begin{equation}
(8.46) sin2 η + cos2 η = 1 \sin^2\eta + \cos^2\eta = 1
\end{equation}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
But now you have to reset the equation number by hand at the beginning of
each new section or chapter. To make this a little more convenient, amsmath pro-
vides a command \numberwithin. To have equation numbering tied to section
numbering, with automatic reset of the equation counter, the command is
\numberwithin{equation}{section}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.6 Miscellaneous 251
\begin{subequations}
...
\end{subequations}
causes all numbered equations within that part of the document to be numbered
(4.9a) (4.9b) (4.9c) . . . , if the preceding numbered equation was (4.8). A \label
command immediately following \begin{subequations} produces a \ref of the
parent number 4.9, not 4.9a. The counters used by the subequations environ-
ment are parentequation and equation. They can be set by the LATEX com-
mands \addtocounter, \setcounter, \value, etc.. Moreover, the style of the
subordinate numbers, are controlled using standard LATEX methods (see Section
A.1.3). For example, redefining \theequation as follows will produce roman
numerals.
\begin{subequations}
\renewcommand{\theequation}{\theparentequation \roman{equation}}
...
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
252 Higher Mathematics
For allow you to further fine-tune the spacing in math expressions the com-
mand \mspace is defined. Its only argument is a LATEX length expressed in
‘math units’. One math unit, or mu, is equal to 1/18 em (see also table A.1 on
page 476). Thus, to get a negative \quad you could write \mspace{-18.0mu}.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.6 Miscellaneous 253
The following three options are usually global document options and are
thus set on the \documentclass command. They are, however, also recognized
when the amsmath package is loaded with the \usepackage command.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
254 Higher Mathematics
amscd Defines some commands for easing the generation of commutative dia-
grams by introducing the CD environment (see Section 8.4.4). There is
no support for diagonal arrows.
amsintx Provides more descriptive command syntax for integrals and sums (not
released yet).
amsthm Provides a proof environment and extensions for the \newtheorem
command.
amsxtra Provides certain odds and ends such as \fracwithdelims and
\accentedsymbol (see Section 8.3.4).
upref Makes \ref print cross-reference numbers always in an upright/roman
font regardless of context.
Finally, there are a few packages which come with the AMSFonts distribution.
amsfonts defines the \mathfrak and \mathbb commands and sets up the fonts
msam (extra math symbols A), msbm (extra math symbols B, and black-
board bold), eufm (Euler Fraktur), extra sizes of cmmib (bold math
italic and bold lowercase Greek), and cmbsy (bold math symbols and
bold script), for use in mathematics.
amssymb defines the names of all the math symbols available with the AMS
fonts collection. This package loads the amsfonts package.
eufrak Set up the Fraktur letters.
eucal Makes \mathcal use the Euler script instead of the usual Computer
Modern script letters.
All these packages recognize the psamsfonts option, which will use the Y&Y/Blue
Sky Research version of the AMSFonts collection (which is free available on
CTAN).
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.7 Examples of Multiple-Line Equation Structures 255
This was produced by the following input (the TEX command \phantom is used
to leave a space equal to the width of its argument):
\begin{equation}
\begin{split}
f_{h,\varepsilon}(x,y)
&= \varepsilon \mathbf{E}_{x,y} \int_0^{t_\varepsilon}
L_{x,y_\varepsilon(\varepsilon u)} \varphi(x) \, du \\
&= h \int L_{x,z} \varphi(x) \rho_x (dz) \\
& \quad +h \biggl[ \frac{1}{t_\varepsilon} \biggl(
\mathbf{E}_{y} \int_0^{t_\varepsilon} L_{x,y^x(s)} \varphi(x)\,ds
-t_\varepsilon \int L_{x,z} \varphi(x) \rho_x(dz) \biggr) \\
& \phantom{{=}+h\biggl[}+\frac{1}{t_\varepsilon}
\biggl( \mathbf{E}_{y} \int_0^{t_\varepsilon} L_{x,y^x(s)}
\varphi(x) \,ds - \mathbf{E}_{x,y} \int_0^{t_\varepsilon}
L_{x,y_\varepsilon(\varepsilon s)}
\varphi(x) \,ds \biggr) \biggr] \\
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
256 Higher Mathematics
\end{split}
\end{equation}
If the option centertags is included in the options list of the amsmath package,
the equation numbers for split environments will be centered vertically on the
height of the split, as shown in the example below.
Z ( Z a Z θ )
T
dθ
|I2 | = ψ(t) u(a, t) − c(ξ)ut (ξ, t) dξ dt
0 γ(t) k(θ, t) a
Z (8.48)
e−1,0 ◦ e
≤ C6 f Sa,− W2 (Ω, Γl ) |u| → W2A (Ω; Γr , T ) .
Ω
\begin{equation}
\begin{split}
|I_2|
&=\left| \int_{0}^T \psi(t)
\left\{ u(a,t)-\int_{\gamma(t)}^a \frac{d\theta}{k(\theta,t)}
\int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi \right\} dt
\right| \\
&\le C_6 \left| \left|
f\int_\Omega
\left| \widetilde{S}^{-1,0}_{a,-} W_2(\Omega,\Gamma_l)
\right|
\right|
\left|
|u|\overset{\circ}\to W_2^{\widetilde{A}}
(\Omega;\Gamma_r,T)
\right| \right|.
\end{split}
\end{equation}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.7 Examples of Multiple-Line Equation Structures 257
Z
|I1 | = gRu dΩ
Ω
"Z Z 2 #1/2
x
≤ C3 g(ξ, t) dξ dΩ
Ω a
(8.49)
"Z ( Z 2 ) #1/2
x
1
× u2x + cut dξ cΩ
Ω k a
−1,0 ◦ e
≤ C4 f Sea,− W2 (Ω, Γl ) |u| → W2A (Ω; Γr , T ) .
Z ( Z a Z θ )
T
dθ
|I2 | = ψ(t) u(a, t) − c(ξ)ut (ξ, t) dξ dt
0 γ(t) k(θ, t) a
Z
(8.50)
e−1,0 ◦ e
≤ C6 f Sa,− W2 (Ω, Γl ) |u| → W2A (Ω; Γr , T ) .
Ω
\begin{align}
\begin{split}
|I_1| &= \left| \int_\Omega gRu \,d\Omega \right| \\
&\le C_3 \left[ \int_\Omega \left( \int_{a}^x
g(\xi,t) \,d \xi \right)^2d \Omega \right]^{1/2} \\
&\quad\times \left[ \int_\Omega \left\{ u^2_x + \frac{1}{k}
\left( \int_{a}^x cu_t \, d\xi \right)^2 \right\}
c \Omega \right]^{1/2} \\
&\le C_4 \left| \left| f \left| \widetilde{S}^{-1,0}_{a,-}
W_2(\Omega,\Gamma_l) \right| \right|
\left| |u| \overset{\circ} \to W_2^{\widetilde{A}}
(\Omega;\Gamma_r,T) \right| \right|.
\end{split}\label{eq:A} \\
\begin{split}
|I_2| &= \left| \int_{0}^T \psi(t) \left\{ u(a,t)
-\int_{\gamma(t)}^a \frac{d\theta}{k(\theta,t)}
\int_{a}^\theta c(\xi) u_t(\xi,t) \,d \xi \right\} dt
\right| \\
&\le C_6 \left| \left| f \int_\Omega
\left| \widetilde{S}^{-1,0}_{a,-}
W_2(\Omega,\Gamma_l) \right| \right|
\left| |u| \overset{\circ} \to W_2^{\widetilde{A}}
(\Omega;\Gamma_r,T) \right| \right|.
\end{split}
\end{align}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
258 Higher Mathematics
\begin{multline}\label{eq:E}
\int_a^b \biggl\{ \int_a^b [ f(x)^2 g(y)^2 + f(y)^2 g(x)^2 ]
-2f(x) g(x) f(y) g(y) \,dx \biggr\} \,dy \\
=\int_a^b \biggl\{ g(y)^2 \int_a^b f^2 + f(y)^2
\int_a^b g^2 - 2f(y) g(y) \int_a^b fg \biggr\} \,dy
\end{multline}
An unnumbered version of the above is obtained with the same input, except
the multline environment is replaced by multline*.
Z b Z b
2 2 2 2
[f (x) g(y) + f (y) g(x) ] − 2f (x)g(x)f (y)g(y) dx dy
a a
Z b Z b Z b Z b
2 2 2 2
= g(y) f + f (y) g − 2f (y)g(y) f g dy
a a a a
This is the same display, but with \multlinegap set to zero. Notice that the
space on the left of the first line does not change, because of the equation number,
while the second line is pushed over to the right margin.
Z b Z b
[f (x)2 g(y)2 + f (y)2 g(x)2 ] − 2f (x)g(x)f (y)g(y) dx dy
a a
Z b Z b Z b Z b
= g(y)2 f 2 + f (y)2 g 2 − 2f (y)g(y) f g dy [a]
a a a a
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.7 Examples of Multiple-Line Equation Structures 259
{\setlength{\multlinegap}{0pt}
\begin{multline*}\tag*{[a]} ... \end{multline*}}
\begin{gather}
D(a,r) \equiv \{ z \in \mathbf{C}: |z-a|<r \}, \\
\operatorname{seg}(a,r) \equiv \{ z \in \mathbf{C}:
\Im z = \Im a, \ |z-a|<r\}, \notag \\
c(e,\theta,r) \equiv \{ (x,y) \in \mathbf{C}:
|x-e|<y \tan \theta, \ 0<y<r \}, \\
C(E,\theta,r) \equiv \bigcup_{e \in E}c(e,\theta,r).
\end{gather}
\begin{align}
\gamma_x(t) &= (\cos tu + \sin tx, v), \\
\gamma_y(t) &= (u, \cos tv + \sin ty), \\
\gamma_z(t) &= \left( \cos tu + \frac\alpha\beta \sin tv,
- \frac\beta\alpha \sin tu + \cos tv \right).
\end{align}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
260 Higher Mathematics
Unnumbered version:
ζ 0 = (ξ 0 )2 ,
ζ 1 = ξ0ξ1
Here the split environment gets a number from the outer gather environment;
numbers for individual lines of the align* are suppressed because of the star.
\begin{gather}
\begin{split}
\varphi(x,z)
&= z - \gamma_{10} x - \sum_{m+n\ge2} \gamma_{mn} x^m z^n \\
&= z - M r^{-1} x - \sum_{m+n\ge2} M r^{-(m+n)} x^m z^n
\end{split} \\[6pt]
\begin{align*}
\zeta^0 &= (\xi^0)^2, \\
\zeta^1 &= \xi^0 \xi^1
\end{align*}
\end{gather}
Shown below, is the *-ed form of gather with the non-*-ed form of align.
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.7 Examples of Multiple-Line Equation Structures 261
X
ϕ(x, z) = z − γ10 x − γmn xm z n
m+n≥2
X
−1
= z − Mr x− M r −(m+n) xm z n
m+n≥2
ζ 0 = (ξ 0 )2 , (8.59)
1 0 1
ζ =ξ ξ (8.60)
\begin{gather*}
\begin{split} ...\end{split} \\[6pt]
\begin{align}...\end{align}
\end{gather*}
Vi = vi − qi vj , Xi = xi − qi xj , Ui = ui , for i 6= j ; (8.61)
X
Vj = vj , X j = xj , Uj uj + qi ui . (8.62)
i6=j
\begin{alignat}{3}
V_i &= v_i - q_i v_j, & \qquad X_i &= x_i - q_i x_j,
& \qquad U_i &= u_i, \qquad \text{for $i\ne j\,$;}\label{eq:B} \\
V_j &= v_j, & \qquad X_j &= x_j,
& \qquad U_j & u_j + \sum_{i\ne j} q_i u_i.
\end{alignat}
Unnumbered version:
Vi = vi − qi vj , Xi = xi − qi xj , Ui = ui , for i 6= j ;
X
Vj = vj , X j = xj , Uj uj + qi ui .
i6=j
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
262 Higher Mathematics
\begin{alignat}{2}
x &= y && \qquad \text{by (\ref{eq:A})}\label{eq:C} \\
x’ &= y’ && \qquad \text{by (\ref{eq:B})}\label{eq:D} \\
x + x’ &= y+y’ && \qquad \text{by Axiom 1.}
\end{alignat}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.8 Extensions to the theorem Environment 263
\newtheorem{env-name}{label-text}
\newtheorem{env2-name}[env-name]{label-text2 }
\newtheorem{env3-name}{label-text3 }[section]
The above variant defines the env3-name environment and its printed name
is label-text3 . Its counter is enumerated within the counter section, that is, with
every new \section the enumeration starts again with one, and the enumeration
is composed from the section number and the theorem counter itself.
\theoremstyle{style}
The \theoremstyle command can define the layout of various, or all, the-
orem sets. It should be noted that any theorem set defined by \newtheorem is
typeset in the \theoremstyle that is current at the time of the definition.
Thus, the following
\theoremstyle{break} \newtheorem{Cor}{Corollary}
\theoremstyle{plain} \newtheorem{Exa}{Example}[section]
leads to the result that the set Cor is formatted in the style break, while the
set Exa and all the following ones are formatted in the style plain, unless an-
other \theoremstyle follows. Since the definitions installed by \newtheorem
are global, you can also limit \theoremstyle locally by grouping braces.
\theorembodyfont{font-declarations}
The choice of the font for the theorem body is completely independent of the
chosen \theoremstyle; this has proven to be very advantageous. For example,
{\theorembodyfont{\rmfamily} \newtheorem{Rem}{Remark}}
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
264 Higher Mathematics
defines a theorem set Rem, which will be set in \rmfamily in the cur-
rent layout (which in our example is plain). As with \theoremstyle, the
\theorembodyfont chosen is that which is current at the time of \newtheorem.
If \theorembodyfont is not specified or you define \theorembodyfont{}, then
the font used will be defined by \theoremstyle.
\theoremheaderfont{font-declarations}
It is also possible to customize the font used for the theorem headers. This
is, however, a global declaration and, therefore, there should be at most one
\theoremheaderfont command in the preamble. If it is actually necessary to
have different header fonts, you will have to define new theorem styles (substi-
tuting the desired font).
Two additional parameters affect the vertical space around the theorem en-
vironments: \theorempreskipamount and \theorempostskipamount define, re-
spectively, the spacing before and after such an environment. These parameters
apply to all theorem sets and can be manipulated with the ordinary length
macros. They are rubber lengths, and therefore can contain plus and minus
parts. These parameters are set using the \setlength command.
The commands to define theorem sets, as described in this section, can only
be placed in the document preamble or in a package file.
Theorem styles, which exist to date, are shown in table 8.22
\theoremstyle{break} \newtheorem{Cor}{Corollary}
\theoremstyle{plain} \newtheorem{Exa}{Example}[section]
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.8 Extensions to the theorem Environment 265
{\theorembodyfont{\rmfamily} \newtheorem{Rem}{Remark}}
\theoremstyle{marginbreak} \newtheorem{Lem}[Cor]{Lemma}
\theoremstyle{change}
\theorembodyfont{\itshape} \newtheorem{Def}[Cor]{Definition}
\theoremheaderfont{\scshape}
Then the typical examples below show the typeset output resulting from their
use.
Corollary 1 \begin{Cor}
This is a sentence typeset in the theorem This is a sentence typeset in the theorem
environment Cor. environment \Lenv{Cor}.
\end{Cor}
The last two examples show the effect of the optional argument to a theorem
environment (it is typeset in parentheses right after the label).
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
266 Higher Mathematics
and \theoremheaderfont is \bfseries the font selected for the header will have
the characteristics “bold extended italic.” If this is not desired you should set
it to something like \theoremheaderfont{\normalfont\bfseries}. That is,
you should supply all the necessary font information explicitly. See chapter 7 for
more details about how to do that.
The accented symbols represent the so-called cramped styles, which are sim-
ilar to the normal styles except that exponents are not raised so much. TEX also
uses three different type sizes for mathematics, namely: text size, script size,
and scriptscript size.
A formula set inside text (between a $ pair, or between \(...\)) is typeset
using text style (style T ). A formula on a line by itself, e.g., entered between
\[...\], will be typeset in display style (style D). The size of the different parts
of a formula can be determined according to the following scheme:
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
8.9 Mathematical Style Parameters 267
The last two columns describe the style used in the numerator or denomina-
tor of a fraction. An example of the various styles can be seen in the continued
fraction below (see also section 8.3.16):
\normalsize
\[ b^0 + \frac{a^1}{b_1 +
a1
b0 + 2
\frac{a^2}{b_2 +
b1 + a a3 \frac{a^3}{b_3}}}
b2 + b
3 \]
\newcommand{\D}{\displaystyle}
1 \normalsize
a
b0 + \[ b^0 + \frac{a^1}{\D b_1 +
a2 \frac{a^2}{\D b_2 +
b1 +
a3 \frac{a^3}{b_3}}}
b2 + \]
b3
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.
268 Higher Mathematics
The option fleqn causes formulae to be aligned on the left, a fixed distance from
the left margin (see \mathindent below), instead of being centered.
The option leqno causes formula numbers to appear on the left instead of at
the right (see section 8.6.6 on page 252).
In the list of mathematics style parameters below, all lengths (except
\jot and \arraycolsep) are rubber lengths. With the option fleqn, the four
displayskip lengths are made equal to the list defining length \topsep, to which
the value of \partopsep is added if the display starts a paragraph (see figure 3.5
on page 64). The four parameters \abovedisplay... and \belowdisplay...
below depend on the current font size. For this reason they cannot be modified
in the preamble of the document using \setlength, but they must be changed
by modyfying \normalsize, etc.
\arraycolsep This gives half the width of the horizontal space between
columns in an array environment (default value 5pt, see also section 5.3.2).
\jot This is the extra vertical space that is added between rows in an eqnarray
or eqnarray* environment (default value 3pt).
\mathindent This defines the indentation from the left margin of displayed
formulae for the fleqn option (the default value is equal to the indentation
of a first level list, i.e., 2.5em, and is defined by the option fleqn).
\abovedisplayskip This specifies the extra space left above a long displayed
formula, except with the option fleqn, where \topsep is used. A long formula
is one that lies closer to the left margin than does the end of the preceding
line (default value 12pt plus 3pt minus 9pt).
\belowdisplayskip This specifies the extra space left below a long displayed
formula, except with the option fleqn, where \topsep is used (default value
12pt plus 3pt minus 9pt).
\abovedisplayshortskip This specifies the extra space left above a short dis-
played formula, except with the option fleqn, where \topsep is used. A
short formula is one which starts to the right of where the preceding line
ends (default value 0pt plus 3pt).
\belowdisplayshortskip This specifies the extra space left below a short dis-
played formula, except with the option fleqn, where \topsep is used (default
value 7pt plus 3pt minus 4pt).
Chapter 8 of "The LaTeX Companion", updated for AMS-LaTeX version 1.2 (Sep. 1st 1997).
Copyright © 1994-97 by Addison Wesley Longman, Inc. All rights reserved.