LaTeX tips: Theorems

Note: Most of the tips below require the amslatex macros. These are automatically loaded if you use the "amsart" documentclass, but if you use other documentclasses, such as "article", put the following in the preamble, after "\documentclass{...}":
\usepackage{amsmath, amsthm, amssymb}
For more about the amslatex macros, and as a general reference for the tips below, see Gratzer's "Math into LaTeX".

Disabling automatic theorem numbering

One reason why many authors who are familiar with TeX/Amstex are reluctant to switch to LaTeX is the apparent loss of control over the structure of a document, due to LaTeX' tendency to do things like theorem and equation numbering automatically. Most books on LaTeX reinforce this belief and leave the impression that one either has to give up that control and let LaTeX do things the way it's set up by default, or invest considerable time learning how to change the LaTeX default behavior. For example, to get "Theorem A." in Amstex is easy:
\proclaim{Theorem A} We have ... \endproclaim
However, there is no apparent simple way to obtain the same output with LaTeX' automated theorem numbering mechanism (but see below for a simple solution that does not use automatic numbering).

Some authors try to deal with this problem by manually coding theorems, etc., resorting to constructs like

\vspace{5mm}\noindent{\bf Theorem A}. {\it We have ...}\vspace{5mm}
However, such "manual formatting" is bad LaTeX practice, should be avoided. For one, the spacing is likely not optimal, and it would take some trial and error to optimize the spacing. However, any such effort is most likely wasted, since such manual formatting will likely be removed at the publisher's end and replaced by proper LaTeX constructs.

The right way to handle situations like this is to use the "\newtheorem*" command, which works just like "\newtheorem", except that it doesn't number the theorems: To get the above example, add "\newtheorem*{thma}{Theorem A}" to the preamble (this defines a theorem, "thma"), and then use

\begin{thma} We have ... \end{thma}
The "\newtheorem*" command is part of the amslatex macro set; specifically, it is defined in the package "amsthm", which should be loaded (along with "amsmath" and "amssymb") as recommended above, unless you use "amsart" as documentclass (since the "amsart" class loads these packages automatically).

Automatic theorem numbering

Theorems declared with the "\newtheorem" command are automatically numbered. The numbering scheme is highly customizable (see Gratzer's book for details). The LaTeX default is to number each "theorem" consecutively: Theorem 1, Theorem 2, Theorem 3, Corollary 1, Corollary 2, Lemma 1, etc. However, except for short papers with only a few "theorems", this is usually not a good practice. A better scheme, that is appropriate for most papers and could be used in article templates, is one that numbers all theorems (and their equivalents) consecutively, but within each section: Theorem 1.1, Corollary 1.2, Lemma 1.3, etc. This is achieved with the following commands in the preamble:
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
Then theorems, corollaries, and lemmas can be called up (and get automatically numbered) with
\begin{thm}\label{...} .... \end{thm}
\begin{cor}\label{...}  .... \end{cor}
\begin{lem}\label{...}  .... \end{lem}
where "\label{...}" contains the theorem label. The label is not mandatory, but needed if you want to refer back to the theorem with "\ref{...}".

Theorem styles

The "amsthm" package (loaded via the "amsart" documentclass, or explicitly with a "\usepackage{...}" command) provides different "theorem styles", so that theorems, corollaries, and lemmas, can be differentiated from definitions and remarks. In mathematical typesetting, it is customary to set the latter two (definitions and remarks) in ordinary Roman font, while the "real" theorems are set in italics. To achieve this effect, precede the theorem declarations corresponding to definitions and remarks by an appropriate "\theoremstyle{...}" command, as in the following example.
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}

\theoremstyle{remark}
\newtheorem{rem}[thm]{Remark}

\theoremstyle{definition}
\newtheorem{def}[thm]{Definition}
Note that the "real" theorems (thm, cor,lem) need no explicit theoremstyle declaration, since the style appropriate for these theorems is the default. For more on this see Gratzer's book.

Proofs

For proofs use the "\begin{proof} ... \end{proof}" environment, which acts much like the "\demo ... \enddemo" pair in amstex. Here are some hints:

Other hints


Back to the LaTeX Tips Page

Last modified: Mon 10 Sep 2007 08:05:46 AM CDT A.J. Hildebrand