\leq \geq \equiv \models
∼ ⊥
\prec \succ \sim \perp

\preceq \succeq \simeq \mid
\ll \gg \asymp \parallel
‚ ⊃ ≈
\subset \supset \approx \bowtie
\Join—
⊆ ⊇
\subseteq \supseteq \cong
\sqsubset— \sqsupset— \neq \smile
\sqsubseteq \sqsupseteq \doteq \frown
=
∈ ∝
\in \ni \propto =
< >
\vdash \dashv < >
: :
—
Not prede¬ned in LTEX 2µ . Use one of the packages latexsym, amsfonts or amssymb.
A
Table VIII.4: Punctuation Symbols
, . ·
; :
, ; \colon \ldotp \cdotp
Table VIII.5: Arrow Symbols
← ←’ ‘
\leftarrow \longleftarrow \uparrow
⇐ ⇐= ‘
\Leftarrow \Longleftarrow \Uparrow
’ ’’ “
\rightarrow \longrightarrow \downarrow
=’
’ “
\Rightarrow \Longrightarrow \Downarrow
” ←’
\leftrightarrow \longleftrightarrow \updownarrow
” ⇐’
\Leftrightarrow \Longleftrightarrow \Updownarrow
’ ’’
\mapsto \longmapsto \nearrow
105
SYMBOLS
VIII.8.
← ’
\hookleftarrow \hookrightarrow \searrow
\leftharpoonup \rightharpoonup \swarrow
\leftharpoondown \rightharpoondown \nwarrow
\leadsto—
\rightleftharpoons
—
Not prede¬ned in LTEX 2µ . Use one of the packages latexsym, amsfonts or amssymb.
A
Table VIII.6: Miscellaneous Symbols
. ..
. .
... .
···
\ldots \cdots \vdots \ddots
„µ ∀ ∞
\aleph \prime \forall \infty
\Box—
… ∃
\hbar \emptyset \exists
± \Diamond—
¬
\imath \nabla \neg
√
\jmath \surd \flat \triangle
™
\ell \top \natural \clubsuit
„˜ ⊥ ™¦
\wp \bot \sharp \diamondsuit
\ \backslash ™
\Re \ \heartsuit
‚ \partial ™
∠
\Im \angle \spadesuit
.
—

\mho . 
—
Not prede¬ned in LTEX 2µ . Use one of the packages latexsym, amsfonts or amssymb.
A
Table VIII.7: Variablesized Symbols
\sum \bigcap \bigodot
\prod \bigcup \bigotimes
\coprod \bigsqcup \bigoplus
\int \bigvee \biguplus
\oint \bigwedge
Table VIII.8: Loglike Symbols
\arccos \cos \csc \exp \ker \limsup \min \sinh
\arcsin \cosh \deg \gcd \lg \ln \Pr \sup
\arctan \cot \det \hom \lim \log \sec \tan
\arg \coth \dim \inf \liminf \max \sin \tanh
Table VIII.9: Delimiters
‘ ‘
( )
( ) \uparrow \Uparrow
“ “
[ ]
[ ] \downarrow \Downarrow
{ }
\{ \} \updownarrow \Updownarrow
\lfloor \rfloor \lceil \rceil
/ \
\langle \rangle / \backslash
  \
Table VIII.10: Large Delimiters
± ±
\rmoustache \lmoustache \rgroup \lgroup
¦
¦
\arrowvert \Arrowvert \bracevert
¦
¦
106 TYPESETTING MATHEMATICS
VIII.
Table VIII.11: Math Mode Accents
ˆ ´ ¯ ™
a a a a
\hat{a} \acute{a} \bar{a} \dot{a}
˜ ˇ `
a a a a
\breve{a} \check{a} \grave{a} \vec{a}
¨ ˜
a a
\ddot{a} \tilde{a}
Table VIII.12: Some other Constructions
abc abc
\widetilde{abc} \widehat{abc}
←’ ’’
abc abc
\overleftarrow{abc} \overrightarrow{abc}
abc abc
\overline{abc} \underline{abc}
abc abc
\overbrace{abc} \underbrace{abc}
√ √
n
abc abc
\sqrt{abc} \sqrt[n]{abc}
abc
f f™ \frac{abc}{xyz}
xyz
Table VIII.13: AMS Delimiters
\ulcorner \urcorner \llcorner \lrcorner
Table VIII.14: AMS Arrows
\dashrightarrow \dashleftarrow
\leftleftarrows \leftrightarrows
\Lleftarrow \twoheadleftarrow
\leftarrowtail \looparrowleft
\leftrightharpoons \curvearrowleft
\circlearrowleft \Lsh
\upuparrows \upharpoonleft
\downharpoonleft \multimap
\leftrightsquigarrow \rightrightarrows
\rightleftarrows \rightrightarrows
\rightleftarrows \twoheadrightarrow
\rightarrowtail \looparrowright
\rightleftharpoons \curvearrowright
\circlearrowright \Rsh
\downdownarrows \upharpoonright
\downharpoonright \rightsquigarrow
Table VIII.15: AMS Negated Arrows
\nleftarrow \nrightarrow \nLeftarrow
\nRightarrow \nleftrightarrow \nLeftrightarrow
Table VIII.16: AMS Greek
107
SYMBOLS
VIII.8.
\digamma \varkappa
κ
Table VIII.17: AMS Hebrew
\beth \daleth \gimel
Table VIII.18: AMS Miscellaneous
\hbar \hslash
™¦
\square \lozenge
\measuredangle \nexists
\Game \Bbbk
k
\blacktriangle \blacktriangledown
\bigstar \sphericalangle
\diagup \diagdown
\vartriangle \triangledown
∠
\circledS \angle
\mho \Finv
\backprime \varnothing
…
\blacksquare \blacklozenge
\complement \eth
°
Table VIII.19: AMS Binary Operators
\dotplus \smallsetminus \Cap
\barwedge \veebar \doublebarwedge
\boxtimes \boxdot \boxplus
\ltimes \rtimes \leftthreetimes
\curlywedge \curlyvee \circleddash
\circledcirc \centerdot \intercal
\Cup \boxminus \divideontimes
\rightthreetimes \circledast
Table VIII.20: AMS Binary Relations
\leqq \leqslant \eqslantless
\lessapprox \approxeq \lessdot
\lessgtr \lesseqgtr \lesseqqgtr
\risingdotseq \fallingdotseq \backsim
\subseteqq \Subset \sqsubset
\curlyeqprec \precsim \precapprox
\trianglelefteq \vDash \Vvdash
\smallfrown \bumpeq \Bumpeq
\geqslant \eqslantgtr \gtrsim
\gtrdot \ggg \gtrless
\gtreqqless \eqcirc \circeq
\thicksim \thickapprox \supseteqq
∼ ≈
108 TYPESETTING MATHEMATICS
VIII.
\sqsupset \succcurlyeq \curlyeqsucc
\succapprox \vartriangleright \trianglerighteq
\shortmid \shortparallel \between
∝ ∴
\varpropto \blacktriangleleft \therefore
\blacktriangleright \because \lesssim
\lll \doteqdot \backsimeq
\preccurlyeq \vartriangleleft \smallsmile
\geqq \gtrapprox \gtreqless
\triangleq \Supset \succsim
\Vdash \pitchfork \backepsilon
Table VIII.21: AMS Negated Binary Relations
\nless \nleq \nleqslant
\lneq \lneqq \lvertneqq
\lnapprox \nprec \npreceq
\precnapprox \nsim \nshortmid
\nvdash \nvDash \ntriangleleft
\nsubseteq \subsetneq \varsubsetneq
\varsubsetneqq \ngtr \ngeq
\ngeqq \gneq \gneqq
\gnsim \gnapprox \nsucc
\nsucceq \succnsim \succnapprox
\nshortparallel \nparallel \nvDash
\ntriangleright \ntrianglerighteq \nsupseteq
\supsetneq \varsupsetneq \supsetneqq
\nleqq \lnsim \precnsim
\nmid \ntrianglelefteq \subsetneqq
\ngeqslant \gvertneqq \nsucceq
\ncong \nVDash \nsupseteqq
\varsupsetneqq
Table VIII.22: Math Alphabets
Required package
ABCdef \mathrm{ABCdef}
ABCdef \mathitABCdef
ABCde f \mathnormal{ABCdef}
ABC \mathcal{ABC}
ABC euscript with option: mathcal
\mathcal{ABC}
euscript with option: mathcr
\mathscr{ABC}
eufrak
ABCdef \mathfrak{ABCdef}
amsfonts or amssymb
\mathbb{ABC}
ABC
A BC mathrsfs
\mathscr{ABC}
TUTORIAL IX
TYPESETTING THEOREMS
A
THEOREMS IN L TEX
IX.1.
In Mathematical documents we often have special statements such as axioms (which are
nothing but the assumptions made) and theorems (which are the conclusions obtained,
sometimes known by other names like propositions or lemmas). These are often typeset
in different font to distinguish them from surrounding text and given a name and a num
ber for subsequent reference. Such distinguished statements are now increasingly seen in
other subjects also. We use the term theoremlike statements for all such statements.
LTEX provides the declaration \newtheorem to de¬ne the theoremlike statements
A
needed in a document. This command has two arguments, the ¬rst for the name we
assign to the environment and the second, the name to be printed with the statement.
Thus if you want
Theorem 1. The sum of the angles of a triangle is 180—¦ .
you ¬rst specify
\newtheorem{thm}{Theorem}
and then type
\begin{thm}
The sum of the angles of a triangle is $180ˆ\circ$.
\end{thm}
Note that in the command \newtheorem the ¬rst argument can be any name you fancy, in
stead of the thm given here. Also, it is a good idea to keep all your \newtheorem commands
together in the preamble.
The \newtheorem command has a couple of optional arguments which control the
way the corresponding statement is numbered. For example if you want the above theo
rem to be numbered 1.1 (the ¬rst theorem of the ¬rst section) rather than a plain 1, then
you must specify
\newtheorem{thm}{Theorem}[section]
in the \newtheorem command. Then the same input as above for the theorem produces
The sum of the angles of a triangle is 180—¦ .
Theorem IX.1.1.
The next Theorem will be numbered 1.2, the third Theorem in the fourth section
will be numbered 4.3 and so on.
109
110 TYPESETTING THEOREMS
IX.
The other optional argument of the \newtheorem command is useful when you have
several different types of theoremlike statements (such as lemmas and corollaries) and
you want some of them to share the same numbering sequence. For example if you want
The sum of the angles of a triangle is 180—¦ .
Theorem IX.1.2.
An immediate consequence of the result is the following
The sum of the angles of a quadrilateral is 360—¦ .
Corollary IX.1.3.
Then you must specify
\newtheorem{cor}[thm]{Corollary}
after the speci¬cation \newtheorem{thm}[section] and then type
\begin{thm}
The sum of the angles of a triangle is $180ˆ\circ$.
\end{thm}
An immediate consequence of the result is the following
The sum of the angles of a quadrilateral is 360—¦ .
Corollary IX.1.4.
The optional argument thm in the de¬nition of the cor environment speci¬es that
“Corollaries” and “Theorems” are to be numbered in the same sequence.
A theoremlike environment de¬ned using the \newtheorem command has also an
optional argument which is used to give a note about the theorem such as the name of its
discoverer or its own common name. For example, to get
(Euclid). The sum of the angles of a triangle is 180—¦ .
Theorem IX.1.5
you must type
\begin{thm}[Euclid]
The sum of the angles of a triangle is $180ˆ\circ$.
\end{thm}
Note the optional argument Euclid after the \begin{thm}. This use of [...] for optional
notes sometimes lead to unintended results. For example, to get
Theorem [0, 1] is a compact subset of R.
IX.1.6.
if you type
\begin{thm}
[0,1] is a compact subset of $\mathbb{R}$.
\end{thm}
then you get
Theorem (0,1). is a compact subset of R.
IX.1.7
Do you see what happened? The string 0,1 within [ ] at the beginning of the theorem is
considered an optional note by LTEX ! The correct way is to type
A
THEOREMS”THE AMSTHM PACKAGE 111
DESIGNER
IX.2.
\begin{thm}
$[0,1]$ is a compact subset of $\mathbb{R}$.
\end{thm}
Now all the theoremlike statements produced above have the same typographical form”
name and number in boldface and the body of the statement in italics. What if you need
something like
(EUCLID). The sum of the angles of a triangle is 180—¦ .
THEOREM IX.1.1
Such customization is necessitated not only by the aesthetics of the author but often by
the whims of the designers in publishing houses also.
THEOREMS”THE AMSTHM PACKAGE
DESIGNER
IX.2.
The package amsthm affords a high level of customization in formatting theoremlike
statements. Let us ¬rst look at the prede¬ned styles available in this package.
Ready made styles
IX.2.1.
The default style (this is what you get if you do not say anything about the style) is termed
plain and it is what we have seen so far”name and number in boldface and body in italic.
Then there is the definition style which gives name and number in boldface and body in
roman. And ¬nally there is the remark style which gives number and name in italics and
body in roman.
For example if you put in the preamble
\usepackage{amsthm}
\newtheorem{thm}{Theorem}[section]
\theoremstyle{definition}
\newtheorem{dfn}{Definition}[section]
\theoremstyle{remark}
\newtheorem{note}{Note}[section]
\theoremstyle{plain}
\newtheorem{lem}[thm]{Lemma}
and then type somewhere in your document
\begin{dfn}
A triangle is the figure formed by joining each pair
of three non collinear points by line segments.
\end{dfn}
\begin{note}
A triangle has three angles.
\end{note}
\begin{thm}
The sum of the angles of a triangle is $180ˆ\circ$.
\end{thm}
\begin{lem}
The sum of any two sides of a triangle is greater than or equal to the third.
\end{lem}
112 TYPESETTING THEOREMS
IX.
then you get
De¬nition IX.2.1. A triangle is the ¬gure formed by joining each pair of three non collinear
points by line segments.
A triangle has three angles. 1 note
Note IX.2.1.
The sum of the angles of a triangle is 180—¦ .
Theorem IX.2.1.
Lemma The sum of any two sides of a triangle is greater than or equal to the third.
IX.2.2.
Note how the \theoremstyle command is used to switch between various styles, espe
cially the last \theoremstyle{plain} command. Without it, the previous \theoremstyle{remark}
will still be in force when lem is de¬ned and so “Lemma” will be typeset in the remark
style.
Custom made theorems
IX.2.2.
Now we are ready to roll our own “theorem styles”. This is done via the \newtheoremstyle
command, which allows us to control almost all aspects of typesetting theorem like state
ments. this command has nine parameters and the general syntax is
\newtheoremstyle%
{name}%
{abovespace}%
{belowspace}%
{bodyfont}%
{indent}%
{headfont}%
{headpunct}%
{headspace}%
{customheadspec}%
The ¬rst parameter name is the name of the new style. Note that it is not the name of the
environment which is to be used later. Thus in the example above remark is the name of a
new style for typesetting theorem like statements and note is the name of the environment
subsequently de¬ned to have this style (and Note is the name of the statement itself).
The next two parameters determine the vertical space between the theorem and the
surrounding text”the abovespace is the space from the preceding text and the belows
pace the space from the following text. You can specify either a rigid length (such as
12pt) or a rubber length (such as \baselineskip) as a value for either of these. Leaving
either of these empty sets them to the “usual values” (Technically the \topsep).
The fourth parameter bodyfont speci¬es the font to be used for the body of the
theoremlike statement. This is to be given as a declaration such as \scshape or \bfseries
and not as a command such as \textsc or \textbf. If this is left empty, then the main
text font of the document is used.
The next four parameters refer to the theoremhead”the part of the theorem like
statement consisting of the name, number and the optional note. The ¬fth parameter
indent speci¬es the indentation of theoremhead from the left margin. If this is empty,
then there is no indentation of the theoremhead from the left margin. The next parameter
speci¬es the font to be used for the theoremhead. The comments about the parameter
bodyfont, made in the previous paragraph holds for this also. The parameter headpunct
THEOREMS”THE AMSTHM PACKAGE 113
DESIGNER
IX.2.
(the seventh in our list) is for specifying the punctuation after the theoremhead. If you
do not want any, you can leave this empty. The last parameter in this category (the last
but one in the entire list), namely headspace, determines the (horizontal) space to be left
between the theoremhead and the theorembody. If you want only a normal interword
space here put a single blank space as { } in this place. (Note that it is not the same as
leaving this empty as in {}.) Another option here is to put the command \newline here.
Then instead of a space, you get a linebreak in the output; that is, the theoremhead will
be printed in a line by itself and the theorembody starts from the next line.
The last parameter customheadspec is for customizing theoremheads. Since it needs
some explanation (and since we are de¬nitely in need of some breathing space), let us now
look at a few examples using the eight parameters we™ve already discussed.
It is almost obvious now how the last theorem in Section 1 (see Page 111) was
designed. It was generated by
\newtheoremstyle{mystyle}{}{}{\slshape}{}{\scshape}{.}{ }{}
\theoremstyle{mystyle}
\newtheorem{mythm}{Theorem}[section]
\begin{mythm}
The sum of the angles of a triangle is $180ˆ\circ$.
\end{mythm}
As another example, consider the following
\newtheoremstyle{mynewstyle}{12pt}{12pt}{\itshape}%
{}{\sffamily}{:}{\newline}{}
\theoremstyle{mynewstyle}
\newtheorem{mynewthm}{Theorem}[section]
\begin{mynewthm}[Euclid]
The sum of the angles of a triangle is $180ˆ\circ$.
\end{mynewthm}
This produces
Theorem IX.2.1 (Euclid):
The sum of the angles of a triangle is 180—¦ .
Do you need anything more? Perhaps yes. Note that theoremhead includes the op
tional note to the theorem also, so that the font of the number and name of the theorem
like statement and that of the optional note are always the same. What if you need
something like
Cauchy™s Theorem (Third Version). If G is a simply connected open subset of C, then for every
closed recti¬able curve γ in G, we have
f = 0.
γ
It is in such cases, that the last parameter of \newtheoremstyle is needed. Using it we
can separately customize the name and number of the theoremlike statement and also
the optional note. The basic syntax for setting this parameter is
{commands#1commands#2commands#3}
where #1 corresponds to the name of the theoremlike statement, #2 corresponds to its
number and #3 corresponds to the optional note. We are here actually supplying the
replacement text for a command \thmhead which has three arguments. It is as if we are
de¬ning
114 TYPESETTING THEOREMS
IX.
\renewcommand{\thmhead}[3]{...#1...#2...#3}
but without actually typing the \renewcommand{\thmhead}[3]. For example the theorem
above (Cauchy™s Theorem) was produced by
\newtheoremstyle{nonum}{}{}{\itshape}{}{\bfseries}{.}{ }{#1 (\mdseries #3)}
\theoremstyle{nonum}
\newtheorem{Cauchy}{Cauchy™s Theorem}
\begin{Cauchy}[Third Version]
If $G$ is a simply connected open subset of $\mathbb{C}$, then for every closed
rectifiable curve $\gamma$ in $G$, we have
\begin{equation*}
\int_\gamma f=0.
\end{equation*}
\end{Cauchy}
Note that the absence of #2 in the customheadspec, suppresses the theorem number and
that the space after #1 and the command (\mdseries#3) sets the optional note in medium
size within parentheses and with a preceding space.
Now if you try to produce
Riemann Mapping Theorem. Every open simply connected proper subset of C is analytically
homeomorphic to the open unit disk in C.
by typing
\theoremstyle{nonum}
\newtheorem{Riemann}{Riemann Mapping THeorem}
\begin{Riemann}Every open simply connected proper subset of $\mathbb{C}$ is analytically
homeomorphic to the open unit disk in $\mathbb{C}$.
\end{Riemann}
you will get
Riemann Mapping Theorem (). Every open simply connected proper subset of C is analytically
homeomorphic to the open unit disk in C.
Do you see what is happened? In the \theoremstyle{diffnotenonum}, the parameter
controlling the note part of the theoremhead was de¬ned as (\mdseries #3) and in the
\newtheorem{Riemann}, there is no optional note, so that in the output, you get an empty
“note”, enclosed in parantheses (and also with a preceding space).
To get around these dif¬culties, you can use the commands \thmname, \thmnumber
and \thmnote within the {customheadspec} as
{\thmname{commands#1}%
\thmnumber{commands#2}%
\thmnote{commands#3}}
Each of these three commands will typeset its argument if and only if the correspond
ing argument in the \thmhead is non empty. Thus the correct way to get the Riemann
Mapping theorem in Page 114 is to input
THEOREMS”THE AMSTHM PACKAGE 115
DESIGNER
IX.2.
\newtheoremstyle{newnonum}{}{}{\itshape}{}{\bfseries}{.}{ }%
{\thmname{#1}\thmnote{ (\mdseries #3)}}
\theoremstyle{newnonum}
\newtheorem{newRiemann}{Riemann Mapping Theorem}
\begin{newRiemann} Every open simply connected proper subset of $\mathbb{C}$ is
analytically homeomorphic to the open unit disk in $\mathbb{C}$.
\end{newRiemann}
Then you can also produce Cauchy™s Theorem in Page 113 by typing
\theoremstyle{newnonum}
\newtheorem{newCauchy}{Cauchy™s Theorem}
\begin{newCauchy}[Third Version]If $G$ is a simply connected open subset of
$\mathbb{C}$, then for every closed rectifiable curve $\gamma$ in $G$, we have
\begin{equation*}
\int_\gamma f=0
\end{equation*}
\end{newCauchy}
The output will be exactly the same as that seen in Page 113. Now suppose you
want to highlight certain theorems from other sources in your document, such as
Axiom 1 in [1]. Things that are equal to the same thing are equal to one another.
This can be done as follows:
\newtheoremstyle{citing}{}{}{\itshape}{}{\bfseries}{.}{ }{\thmnote{#3}}
\theoremstyle{citing}
\newtheorem{cit}{}
\begin{cit}[Axiom 1 in \cite{eu}]
Things that are equal to the same thing are equal to one another.
\end{cit}
Of course, your bibliography should include the citation with label eu.
There is more!
IX.2.3.
There are some more prede¬ned features in amsthm package. In all the different examples
we have seen so far, the theorem number comes after the theorem name. Some prefer to
have it the other way round as in
Theorem (Euclid). The sum of the angles in a triangle is 180—¦ .
IX.2.1
This effect is produced by the command \swapnumbers as shown below:
\swapnumbers
\theoremstyle{plain}
\newtheorem{numfirstthm}{Theorem}[section]
\begin{numfirstthm}[Euclid]
The sum of the angles in a triangle is $180ˆ\circ$
\end{numfirstthm}
116 TYPESETTING THEOREMS
IX.
Note that the \swapnumbers command is a sort of toggleswitch, so that once it is given,
all subsequent theoremlike statements will have their numbers ¬rst. If you want it the
other way for some other theorem, then give \swapnumbers again before its de¬nition.
A quick way to suppress theoremnumbers is to use the \newtheorem* command as in
\newtheorem*{numlessthm}{Theorem}[section]
\begin{numlessthm}[Euclid]
The sum of the angles in a triangle is $180ˆ\circ$.
\end{numlessthm}
to produce
Euclid. The sum of the angles in a triangle is 180—¦ .
Note that this could also be done by leaving out #2 in the customheadspec parameter
of \newtheoremstyle, as seen earlier.
We have been talking only about theorems so far, but Mathematicians do not live
by theorems alone; they need proofs. The amsthm package contains a prede¬ned proof
environment so that the proof of a theoremlike statement can be enclosed within \begin
{proof} ... \end{proof} commands as shown below:
\begin{thmsec}
The number of primes is infinite.
\end{thmsec}
\begin{proof}
Let $\{p_1,p_2,\dotsc p_k\}$ be a finite set of primes. Define $n=p_1p_2\dotsm
p_k+1$. Then either $n$ itself is a prime or has a prime factor. Now $n$ is
neither equal to nor is divisible by any of the primes $p_1,p_2,\dotsc p_k$ so
that in either case, we get a prime different from $p_1,p_2,\dotsc p_k$. Thus
no finite set of primes can include all the primes.
\end{proof}
to produce the following output
Theorem The number of primes is in¬nite.
IX.2.3.
Proof. Let {p1 , p2 , . . . pk } be a ¬nite set of primes. De¬ne n = p1 p2 · · · pk + 1. Then either n itself
is a prime or has a prime factor. Now n is neither equal to nor is divisible by any of the primes
p1 , p2 , . . . pk so that in either case, we get a prime different from p1 , p2 , . . . pk . Thus no ¬nite set
of primes can include all the primes.
There is an optional argument to the proof environment which can be used to change
the proofhead. For example,
\begin{proof}[\textsc{Proof\,(Euclid)}:]
\begin{proof}
Let $\{p_1,p_2,\dotsc p_k\}$ be a finite set of primes. Define $n=p_1p_2\dotsm
p_k+1$. Then either $n$ itself is a prime or has a prime factor. Now $n$ is
neither equal to nor is divisible by any of the primes $p_1,p_2,\dotsc p_k$ so
that in either case, we get a prime different from $p_1,p_2,\dotsc p_k$. Thus
no finite set of primes can include all the primes.
\end{proof}
THEOREMS”THE AMSTHM PACKAGE 117
DESIGNER
IX.2.
produces the following
PROOF (EUCLID): Let {p1 , p2 , . . . pk } be a ¬nite set of primes. De¬ne n = p1 p2 · · · pk + 1. Then
either n itself is a prime or has a prime factor. Now n is neither equal to nor is divisible by any
of the primes p1 , p2 , . . . pk so that in either case, we get a prime different from p1 , p2 . . . pk . Thus
no ¬nite set of primes can include all the primes.
Note that the end of a proof is automatically marked with a which is de¬ned in the
package by the command \qedsymbol. If you wish to change it, use \renewcommand to
rede¬ne the \qedsymbol. Thus if you like the original “Halmos symbol” to mark the
ends of your proofs, include
\newcommand{\halmos}{\rule{1mm}{2.5mm}}
\renewcommand{\qedsymbol}{\halmos}
in the preamble to your document.
Again, the placement of the \qedsymbol at the end of the last line of the proof is done
via the command \qed. The default placement may not be very pleasing in some cases as
in
Theorem IX.2.4. The square of the sum of two numbers is equal to the sum of their squares
and twice their product.
Proof. This follows easily from the equation
(x + y)2 = x2 + y2 + 2xy
It would be better if this is typeset as
Theorem IX.2.5. The square of the sum of two numbers is equal to the sum of their squares
and twice their product.
Proof. This follows easily from the equation
(x + y)2 = x2 + y2 + 2xy
which is achieved by the input shown below:
\begin{proof}
This follows easily from the equation
\begin{equation}
(x+y)ˆ2=xˆ2+yˆ2+2xy\tag*{\qed}
\end{equation}
\renewcommand{\qed}{}
\end{proof}
For this trick to work, you must have loaded the package amsmath without the leqno
option. Or, if you prefer
Proof. This follows easily from the equation
(x + y)2 = x2 + y2 + 2xy
Then you can use
118 TYPESETTING THEOREMS
IX.
\begin{proof}
This follows easily from the equation
\begin{equation*}
(x+y)ˆ2=xˆ2+yˆ2+2xy\qed
\end{equation*}
\renewcommand{\qed}{}
\end{proof}
HOUSEKEEPING
IX.3.
It is better to keep all \newtheoremstyle commands in the preamble than scattering them
all over the document. Better still, you can keep them together with other customization
in a personal .sty ¬le and load it using the \usepackage command in the preamble. Also,
within this .sty ¬le, you can divide your \newtheorem commands into groups and preface
each group with the appropriate \theoremstyle.
BIBLIOGRAPHY
[1] Euclid, The Elements, Greece 300 BC
TUTORIAL X
SEVERAL KINDS OF BOXES
The method of composing pages out of boxes lies at the very heart of TEX and many
LTEX constructs are available to take advantage of this method of composition.
A
A box is an object that is treated by TEX as a single character. A box cannot be split
and broken across lines or pages. Boxes can be moved up, down, left and right. LTEX A
has three types of boxes.
(leftright) The content of this box are typeset from left to right.
LR
(paragraphs) This kind of box can contain several lines, which will be typeset
Par
in paragraph mode just like normal text. Paragraphs are put one on top of the
other. Their widths are controlled by a user speci¬ed value.
A thin or thick line that is often used to separate various logical elements on
Rule
the output page, such as between table rows and columns and between running
titles and the main text.
LR
X.1. BOXES
The usage information of four types of LR boxes are given below. The ¬rst line considers
the text inside the curly braces as a box, with or without a frame drawn around it. For
instance, \fbox{some words} gives some words whereas \mbox will do the same thing,
but without the ruled frame around the text.
\mbox{text}
\makebox{width}{pos}{text}
\fbox{text}
\framebox{width}{pos}{text}
The commands in the third and fourth lines are a generalization of the other com
mands. They allow the user to specify the width of the box and the positioning of text
inside.
some words \makebox{5cm}{some words} \par
some words \framebox{5cm}{r}{some words}
In addition to the centering the text with positional argument [c] (the default), you
can position the text ¬‚ush left ([l]). LTEX also offers you an [s] speci¬er that will stretch
A
your text from the left margin to the right margin of the box provided it contains some
stretchable space. The interword space is also stretchable and shrinkable to a certain
extent.
With LTEX, the above box commands with arguments for specifying the dimensions
A
of the box allow you to make use of four special length parameters: \width, \height,
119
120 SEVERAL KINDS BOXES
X. OF
and \totalheight. They specify the natural size of the text, where \totalheight
\depth
is the sum of the \height and \depth.
A few words of advice
A few words of advice
A few words of advice
\framebox{A few words of advice}\\[6pt]
\framebox[5cm][s]{A few words of advice}\\[6pt]
\framebox{1.5\width}{A few words of advice}
As seen in the margin of the current line, boxes with zero width can be used to make text
stick out in the margin. This effect was produced by beginning the paragraph as follows:
\makebox{0mm}{r}{$\Leftrightarrow$}
As seen in the margin of the \dots
The appearance of frameboxes can be controlled by two style parameters.
width of the lines comprising the box produced with the command \fbox
\fboxruleThe
or \framebox. The default value in all standard classes is 0.4pt.
The space left between the edge of the box and its contents by \fbox or \framebox.
\fboxsep
The default value in all standard classes is 3pt.
Text in a box
Text in a box
\fbox{Text in a box}
\setlength\fboxrule{2pt}\setlength\fboxsep{2mm}
\fbox{Text in a box}
Another interesting possibility is to raise or lower boxes. This can be achieved by
the very powerful \raisebox command, which has two obligatory and two optional pa
rameters, de¬ned as follows:
\raisebox{lift}{depth}{height}{contents}
An example of lowered and elevated text boxes is given below.
baseline upward baseline downward baseline
baseline \raisebox{1ex}{upward} baseline
\raisebox{1ex}{downward} baseline
121
PARAGRAPH
X.2. BOXES
As with \makebox and \framebox the LTEX implementation of \raisebox offers you
A
the use of the lengths \height, \depth, \totalheight and \width in the ¬rst three argu
ments. Thus, to pretend that a box extends only 90% of its actual height above the
baseline you could write:
\raisebox{0pt}{0.9\height}{text}
or to rotate a box around its lower left corner (instead of its reference point lying on the
baseline), you could raise it by its \depth ¬rst, e.g.:
g
in
g
in
th
th
g
d
in
Ba
d
th
Ba
x1 x2 x3 x4
d
Ba
$x_1$ \doturn{\fbox{Bad thing}}\\
$x_2$ \doturn{\raisebox{\depth}\\
{\fbox{Bad thing}}}\\
$x_3$ \doturn{\raisebox{\height}\\
{\fbox{Bad thing}}} $x_4$
PARAGRAPH
X.2. BOXES
Paragraph boxes are constructed using the \parbox command or minipage environment.
The text material is typeset in paragraph mode inside a box of width width. The vertical
positioning of the box with respect to the text baseline is controlled by the oneletter
optional parameter pos ([c], [t], and [b]).
The usage for \parbox command is,
\parbox{pos}{width}{text}
whereas that of the minipage environment will be:
\begin{minipage}{pos}{width}
. . . here goes the text matter . . .
\end{minipage}
The center position is the default as shown by the next example. You can also observe
that LTEX might produce wide interword spaces if the measure is incredibly small.
A
This is the rightmost parbox.
Note that the typeset text looks
This is the contents of the left
CURRENT LINE sloppy because L TEX cannot
A
most parbox.
nicely balance the material in
these narrow columns.
The code for generating these three \parbox™s in a row is given below:
\parbox{.3\bs linewidth}
{This is the contents of the leftmost parbox.} \hfill CURRENT LINE \hfill
\parbox{.3\bs linewidth}{This is the rightmost parbox. Note that the typeset
text looks sloppy because \LaTeX{} cannot nicely balance the material in
these narrow columns.}
122 SEVERAL KINDS BOXES
X. OF
The minipage environment is very useful for the placement of material on the page.
In effect, it is a complete miniversion of a page and can contain its own footnotes, para
graphs, and array, tabular and multicols (we will learn about these later) environments.
A simple example of minipage environment at work is given below. The baseline is indi
cated with a small line.
\begin{minipage}{b}{.3\linewidth}
The minipage environment creates a vertical box like the parbox command.
The bottom line of this minipage is aligned with the
\end{minipage}\hrulefill
\begin{minipage}{c}{.3\linewidth}
middle of this narrow parbox, which in turn is
\end{minipage}\hrulefill
\begin{minipage}{t}{.3\linewidth}
the top line of the right hand minipage. It is recommended that the user
experiment with the positioning arguments to get used to their effects.
\end{minipage}
The minipage environment
creates a vertical box like
the parbox command. The
bottom line of this minipage is
middle of this narrow parbox,
aligned with the the top line of the right hand
which in turn is minipage. It is recommended
that the user experiment with
the positioning arguments to
get used to their effects.
PARAGRAPH
X.3. BOXES WITH SPECIFIC HEIGHT
In LTEX, the syntax of the \parbox and minipage has been extended to include two more
A
optional arguments.
\parbox{pos}{height}{inner pos}{width}{text}
is the usage for \parbox command, whereas that of the minipage environment will be:
\begin{minipage}{pos}{height}{inner pos}{width}
. . . here goes the text matter . . .
\end{minipage}
In both cases, height is a length specifying the height of the box; the parameters \height,
\width, \depth, and \totalheight may be employed within the emph argument in the
same way as in the width argument of \makebox and \framebox.
The optional argument inner pos states how the text is to be positioned internally,
something that is only meaningful if height has been given. Its possible values are:
To push the text to the top of the box.
t
To shove it to the bottom.
b
To center it vertically.
c
To stretch it to ¬ll up the whole box.
s
In the last case, we must specify the interline space we wish to have and the deviations
allowed from this value as in the example below.
Note the difference between the external positioning argument pos and the internal
one inner pos: the former states how the box is to be aligned with the surrounding text,
123
NESTED
X.4. BOXES
while the latter determines how the contents are placed within the box itself. See an
example below. We frame the minipages to make it more comprehensible.
This is a mini In this fourth
page with a
box of same
height of 3 cm
In this minipage
with the text height, the text
of same height,
aligned at the
the text is verti
top. is stretched to
In this third box
cally centered.
of same height, ¬ll in the entire
text is aligned at
the bottom. vertical space.
See the code that generated the above boxed material:
\begin{minipage}[b][3cm][t]{2cm}
This is a minipage with a height of 3˜cm with the text aligned
at the top.
\end{minipage}\hfill
\begin{minipage}[b][3cm][c]{2cm}
In this minipage of same height, the text is vertically centered.
\end{minipage}}\hfill
\begin{minipage}[b][3cm][b]{2cm}
In this third box of same height, text is aligned at the bottom.
\end{minipage}\hfill
\begin{minipage}{b}{3cm}{s}{2cm}
\baselineskip 10pt plus 2pt minus 2pt
In this fourth box of same height, the text is stretched to fill in the entire
vertical space.
\end{minipage}
In the last minipage environment the command \baselineskip gets the interline
space to be 10 points text allows it to be as low as 8 points or as high as 12 points.
NESTED
X.4. BOXES
The box commands described above may be nested to any desired level. Including an
LR box within a parbox or a minipage causes no obvious conceptual dif¬culties. The
opposite, a parbox within an LR box, is also possible, and is easy to visualize if one keeps
in mind that every box is a unit, treated by TEX as a single character of the corresponding
size.
A parbox inside an \fbox command has the effect that the entire parbox is
framed. The present structure was made with
{A parbox ...}}}
\fbox{\fbox{\parbox{.75\linewidth}
This is a parbox of width .75\linewidth inside an fbox inside a second fbox,
which thus produces the double framing effect.
124 SEVERAL KINDS BOXES
X. OF
RULE
X.5. BOXES
A rule box is basically a ¬lledin black rectangle. The syntax for the general command is:
\rule{lift}{width}{height}
which produces a solid rectangle of width width and height height, raised above the
baseline by an amount lift. Thus
\rule{8mm}{3mm}
generates
and
\rule{3in}{.2pt}
generates
.
Without an optional argument lift, the rectangle is set on the baseline of the current
line of the text. The parameters lift, width and height are all lengths. If lift has a negative
value, the rectangle is set below the baseline.
It is also possible to have a rule box of zero width. This creates an invisible line with
the given height. Such a construction is called a strut and is used to force a horizontal
box to have a desired height or depth that is different from that of its contents.
TUTORIAL XI
FLOATS
figure ENVIRONMENT
THE
XI.1.
Figures are really problematical to present in a document because they never split between
pages. This leads to bad page breaks which in turn leave blank space at the bottom
of pages. For ¬netuning that document, the typesetter has to adjust the page breaks
manually.
But LTEX provides ¬‚oating ¬gures which automatically move to suitable locations.
A
So the positioning of ¬gures is the duty of LTEX.
A
Creating ¬‚oating ¬gures
XI.1.1.
Floating ¬gures are created by putting commands in a figure environment. The con
tents of the ¬gure environment always remains in one chunk, ¬‚oating to produce good
page breaks. The following commands put the graphic from figure.eps inside a ¬‚oating
¬gure:
\begin{figure}
\centering
\includegraphics{figure.eps}
\caption{This is an inserted EPS graphic}
\label{fig1}
\end{figure}
Features
• The optional \label command can be used with the \ref, and \pageref commands
to reference the caption. The \label command must be placed immediately after
the \caption
• If the ¬gure environment contains no \caption commands, it produces an unnum
bered ¬‚oating ¬gure.
• If the ¬gure environment contains multiple \caption commands, it produces multi
ple ¬gures which ¬‚oat together. This is useful in constructing sidebyside graphics
or complex arrangements.
• A list of ¬gures is generated by the \listoffigures command.
• By default, the caption text is used as the caption and also in the list of ¬gures.
The caption has an optional argument which speci¬es the listof¬gure entry. For
example,
\caption[List Text]{Caption Text}
125
126 FLOATS
XI.
¤¥ ¤¢
¦ £¡
¨ ¤ £ ©§
¨
!¨ ¤
¤¨ ¤!¨ "
% $#
¡ $ £ ¤¤¨
)(
¤ ¤!¤¨ ¦' $ &
$#(
Figure XI.1: This is an inserted EPS graphic
causes “Caption Text” to appear in the caption, but “List Text” to appear in the
list of ¬gures. This is useful when using long, descriptive captions.
• The ¬gure environment can only be used in outer paragraph mode, preventing it
from being used inside any box (such as parbox or minipage).
• Figure environments inside the paragraphs are not processed until the end of the
paragraph. For example:
. . . . . . . . . text text text text text text
\begin{figure}
.........
\end{figure}
. . . . . . . . . text text text text text text
Figure placement
XI.1.2.
The figure environment has an optional argument which allows users to specify possible
¬gure locations. The optional argument can contain any combination of the letters: h, t,
b, p.
h Place the ¬gure in the text where the ¬gure command is located. This option cannot
be executed if there is not enough room remaining on the page.
t Place the ¬gure at the top of the page.
b Place the ¬gure at the bottom of a page.
p Place the ¬gure on a page containing only ¬‚oats.
If no optional arguments are given, the placement options default to [tbp].
When we input a ¬‚oat, LTEX will read that ¬‚oat and hold it until it can be placed
A
at a better location. Unprocessed ¬‚oats are those which are read by LTEX but have not
A
yet been placed on the page. Though the ¬‚oatplacing is done by LTEX, sometimes the
A
user has to invoke commands to process unprocessed ¬‚oats. Following commands will
do that job:
figure ENVIRONMENT 127
THE
XI.1.
This command places unprocessed ¬‚oats and starts a new page.
\clearpage
This command causes all unprocessed ¬‚oats to be processed. This is
\FloatBarrier
provided by the placeins package. It does not start a new page, unlike
\clearpage.
Since it is often desirable to keep ¬‚oats in the section in which they were issued, the
section option
\usepackage[section]{placeins}
rede¬nes the \section command, inserting a \FloatBarrier command before each sec
tion. Note that this option is very strict. This option does not allow a ¬‚oat from the
previous section to appear at the bottom of the page, since that is after the start of a new
section.
The below option
\usepackage[below]{placeins}
is a lessrestrictive version of the section option. It allows ¬‚oats to be placed after the
beginning of a new section, provided that some of the previous section appears on the
page.
The afterpage package provides the \afterpage command which
\afterpage/\clearpage
executes a command at the next naturallyocurring page break.
Therefore, using \afterpage{\clearpage} causes all unprocessed ¬‚oats to be cleared
at the next page break. \afterpage{\clearpage} is especially useful when producing
small ¬‚oatpage ¬gures.
Customizing ¬‚oat placement
XI.1.3.
The following style parameters are used by LTEX to prevent awkwardlooking pages
A
which contain too many ¬‚oats or badlyplaced ¬‚oats.
Float placement counters
The maximum number of ¬‚oats allowed at the top of a text page (the
\topnumber
default is 2).
The maximum number of ¬‚oats allowed at the bottom of a text page
\bottomnumber
(the default is 1).
The maximum number of ¬‚oats allowed on any one text page (the de
\totalnumber
fault is 3).
These counters prevent LTEX from placing too many ¬‚oats on a text page. These
A
counters do not affect ¬‚oat pages. Specifying a ! in the ¬‚oat placement options causes
LTEX to ignore these parameters. The values of these counters are set with the \setcounter
A
command. For example,
\setcounter{totalnumber}{2}
prevents more than two ¬‚oats from being placed on any text page.
Figure fractions
The commands given below control what fraction of a page can be covered by ¬‚oats
(where “fraction” refers to the height of the ¬‚oats divided by \textheight). The ¬rst
128 FLOATS
XI.