Bxtexlogo Sample PDF
Bxtexlogo Sample PDF
Bxtexlogo Sample PDF
Contents
1 Introduction 2
3 Theorem numbering 5
3.1 Related topics addressed in the AMS author FAQ . . . . . . . . . . . . . 7
5 Proofs 11
5.1 The beginning of a proof . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2 The end of a proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6 Known problems 13
7 Other packages 13
8 Potential modifications 14
9 Providing feedback 15
1
2 Using the amsthm package
1 Introduction
The amsthm package provides an enhanced version of LATEX’s \newtheorem
command for defining theorem-like environments. The enhanced \newtheorem
recognizes a \theoremstyle specification (as in Mittelbach’s theorem package)
and has a * form for defining unnumbered environments. The amsthm package
also defines a proof environment that automatically adds a QED symbol at
the end. AMS document classes incorporate the amsthm package, so everything
described here applies to them as well.
As part of the AMS LATEX support environment, amsthm follows AMS style.
This differs in some respects from the style provided by the base LATEX classes
and the package mentioned above; where a difference is known to be present,
it will be noted in these instructions. One notable difference is that, after the
end of a theorem or proof, the following line of text is assumed to start a new
paragraph, and will always be indented, whether or not a blank line or \par is
present.
If the amsthm package is used with a non-AMS document class and with the
amsmath package, amsthm must be loaded after amsmath, not before.
Since amsthm follows AMS publication style, formats that diverge signifi-
cantly from that style may not be able to be accommodated. Other theorem
packages do exist, and users with incompatible requirements who are publish-
ing elsewhere are advised to look for other possibilities on CTAN. However,
authors preparing files for publication by the AMS are expected to follow AMS
style.
This manual describes the features provided by amsthm. Examples are given
separately in the file thmtest.tex. For best understanding, examine the output
side-by-side with the input.
\newtheorem{lem}{Lemma}
will produce
where the heading consists of the specified text “Lemma” and an automati-
cally generated number and punctuation. Note that there are no fixed text
assignments as there are with, e.g., \chaptername (usually “Chapter” or “Ap-
pendix”, depending on context); the heading text in the output will be exactly
what you specify in the input.
If \newtheorem* is used instead of \newtheorem in this example, numbers
will not be generated automatically for any of the lemmas in the document.
This form of the command can be useful even if you have only one lemma
and don’t want it to be numbered; more often, though, it is used to produce
a special named variant of one of the common theorem types. For example,
if you have a lemma that should get the heading “Klein’s Lemma”, then the
statement
\newtheorem*{KL}{Klein’s Lemma}
\begin{lem}[Alinhac-Lerner \cite{a-l}]
4 Using the amsthm package
If the citation includes page numbers, the brackets in the reference must be
“hidden” to prevent the closing bracket from being interpreted as the end of
the optional argument to the heading:
\begin{lem}[Alinhac-Lerner {\cite[p.~37]{a-l}}]
If the list must start on the same line as the heading, enter the first item
identifier manually, with adjustments: enter an ordinary space between the
heading and the identifier, reset the left margin if the item text will require
more than one line, and reset the item counter (for enumerate) so that it will
start with 2 (or whatever is appropriate).
\begin{thm}[hoptional modifier i]
\hangindent\leftmargini % for a multi-line item
\label{thm:xxx}
\textup{(1)} First item ...
\begin{enumerate}
\setcounter{enumi}{1}
\item ...
\item ...
\end{enumerate}
\end{thm}
The style shown here for the item identifier matches the default for AMS doc-
ument classes. It may be different for other document classes; amsthm retains
the class default. (\textup should be applied to hand-coded item identifiers
when using an AMS class; AMS style conforms to traditional math typography
in this respect, with item identifiers, cross-references, and similar elements con-
sistently set upright, even in italic environments. However, an author should
always try to match the style of the document class being used.) To match the
default style of a first-level item counter when using an AMS document class,
a reference may be entered with \eqref; however, beware if a package such as
cleveref is being used, as it may associate the wrong element type.
An initial item input in this manner cannot be linked using a \label, since
it is not associated with a counter; the \label in the above example refers
to the theorem element, not to the item in the list. This is an important
concept: a \label will always refer to the value of the most recent counter
that is automatically incremented; this counter will also be the anchor for a
hyperlink if the hyperref package is used.
3 Theorem numbering
In addition to the two mandatory arguments, \newtheorem has two mutually
exclusive optional arguments. These govern the sequencing and hierarchy of
the numbering. The numbering mechanism can be thought of this way:
\newtheorem{henv namei}{htexti}[hparent counter i]
\newtheorem{henv namei}[hshared counter i]{htexti}
6 Using the amsthm package
\newtheorem{thm}{Theorem}
\newtheorem{lem}[thm]{Lemma}
The optional argument [thm] in the second statement means that the lem
environment should share the thm numbering sequence instead of having its
own independent sequence.
To have a theorem environment numbered subordinately within a sectional
unit—e.g., to get propositions numbered Proposition 2.1, Proposition 2.2, and
so on in Section 2—put the name of the parent unit in square brackets in final
position:
\newtheorem{prop}{Proposition}[section]
With the optional argument [section], the prop counter will be reset to 0
whenever the parent counter section is incremented, and the proposition head-
ing will have the section number prepended.
If any theorem elements are numbered by section, and (in a book) the first
such element in a chapter comes before the first section, numbering will continue
from the previous chapter. In such a case, reset the counter by invoking this
command before the affected element:
\setcounter{thm}{0}
• Restart numbering for each chapter, but don’t include chapter number as
part of theorem number
\theoremstyle{plain}% default
\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem*{cor}{Corollary}
\newtheorem*{KL}{Klein’s Lemma}
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
8 Using the amsthm package
\newtheorem{exmp}{Example}[section]
\newtheorem{xca}[exmp]{Exercise}
\theoremstyle{remark}
\newtheorem*{rem}{Remark}
\newtheorem*{note}{Note}
\newtheorem{case}{Case}
The following list summarizes the types of structures which are normally
associated with each theorem style.
plain Theorem, Lemma, Corollary, Proposition, Conjecture,
Criterion, Assertion
definition Definition, Condition, Problem, Example, Exercise,
Algorithm, Question, Axiom, Property, Assumption,
Hypothesis
remark Remark, Note, Notation, Claim, Summary,
Acknowledgment, Case, Conclusion
\swapnumbers
\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]
\theoremstyle{remark}
\newtheorem{rem}{Remark}
When amsthm is used with a non-AMS document class, and numbers are
swapped, no period is set following the number; this differs from the “basic”
LATEX style. A workaround will be given in the AMS Author FAQ [AF].
In some AMS document classes, the style of the swapped numbers matches
that of section headings; this may not be the same style as the rest of the
theorem heading.
Using the amsthm package 9
\newtheoremstyle{note}% hnamei
{3pt}% hSpace abovei1
{3pt}% hSpace below i1
{}% hBody fonti
{}% hIndent amounti2
{\itshape}% hTheorem head fonti
{:}% hPunctuation after theorem head i
{.5em}% hSpace after theorem head i3
{}% hTheorem head spec (can be left empty, meaning ‘normal’ )i
1 Space above and below: these are equal, but the defaults differ when using
an AMS document class vs. \usepackage{amsthm}. For AMS classes, this is
.5\baselineskip±.2\baselineskip; for amsthm used as a separate package,
it is the local value of \topsep. If these arguments are left empty, the current
defaults are used.
2 Indent amount: empty = no indent, \parindent = normal paragraph indent
3 Space after theorem head: { } = normal interword space;
\newtheoremstyle{break}%
{}{}%
{\itshape}{}%
{\bfseries}{}% % Note that final punctuation is omitted.
{\newline}{}
This style can be used for a theorem beginning with a list. When used with
enumerate and an AMS document class, all items are properly labeled and will
link. However, the vertical spacing needs help; a conflict between definitions
prevents the first item from starting on a new line—it looks almost the same as
a default theorem beginning with an enumerated list. To repair this problem,
begin the theorem like this:
10 Using the amsthm package
\begin{breakthm}[...]
\leavevmode \vspace{-\baselineskip}
\begin{enumerate}
\leavevmode alone will leave a full blank line after the theorem head.
One more problem may arise: if the theorem starts close to the end of a
page, the list could be split to a new page, leaving an orphaned heading. Make
a note to address this when the text is final; then call on the needspace [NDS]
package, or insert an explicit page break.
\newtheoremstyle{bfnote}%
{}{}%
{\itshape}{}%
{\bfseries}{.}%
{ }%
{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}
Parentheses may be omitted from around the note using this trivial adap-
tation of the formulation with a bold note.
\newtheoremstyle{noparens}%
{}{}%
{\itshape}{}%
{\bfseries}{.}%
{ }%
{\thmname{#1}\thmnumber{ #2}\thmnote{ #3}}
5 Proofs
A predefined proof environment provided by the amsthm package produces
the heading “Proof” with appropriate spacing and punctuation. The proof
environment is primarily intended for short proofs, no more than a page or
two in length; longer proofs are usually better done as a separate \section or
\subsection in your document.
Because of the way the proof environment is defined (as a LATEX list),
a substitute “name” that is longer than one output line will not break as it
should; this is on the list for repair. In the meantime, this redefinition in your
preamble will accomplish the desired result.
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\trivlist
\item\relax
{\itshape
#1\@addpunct{.}}\hspace\labelsep\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother
section instead of with the proof environment, you can obtain the symbol and
the usual amount of preceding space by using \qed; this will work properly
only if it follows ordinary text.
A blank line preceding \end{proof} (or before an explicit \qed) disables
the mechanism that places the QED symbol, and may even allow that symbol
to be set at the top of a new page.
Placement of the QED symbol can be problematic if the last part of a proof
environment is a displayed equation or list environment or something of that
nature. In that case put a \qedhere command at the place where the QED
symbol should appear, for example,
\begin{proof}
...
\begin{equation}
G(t)=L\gamma!\,t^{-\gamma}+t^{-\delta}\eta(t) \qedhere
\end{equation}
\end{proof}
When used with the amsmath package, version 2 or later, \qedhere will position
the QED symbol flush right; with earlier versions, the symbol will be spaced a
quad away from the end of the text or display.
If \qedhere produces an error message in an equation, try using
\mbox{\qedhere} instead.
\qedhere does not work with eqnarray or with equations input with $$;
the display environments defined by amsmath and the \[ ... \] form of un-
numbered equations have been specially crafted for this purpose.
When a proof ends with a list environment, place \qedhere as the last thing
before \end{enumerate} or \end{itemize}.
If, for some reason, it is desired to omit the QED symbol from the end of a
proof, it can be suppressed by including this definition just before \end{proof}:
\renewcommand{\qedsymbol}{}
If the symbol is to be omitted from all proofs in the document, place the
redefinition in the preamble.
If the QED symbol is needed outside of the proof environment, use \qed
rather than \qedhere.
Using the amsthm package 13
6 Known problems
The following problems are listed for attention with the next update of amsthm.
7 Other packages
Some packages provide additional theorem functionality, with options that rec-
ognize the presence of amsthm and adjust for it.
• mdframed [MDF] provides the ability to set off theorems (and other ele-
ments) with frames of various shapes and colors. It should be loaded after
amsthm if both are used.
• thmtools [THT] provides an alternate key-value syntax for theorem spec-
ification, as well as variant presentation styles, both predefined and user
definable. A QED symbol can be applied to any theorem element, not just
to proofs. An adaptable \listoftheorems is also available.
14 Using the amsthm package
For details, refer to the package manuals. Both packages are included in
TEX Live, so can be accessed with texdoc hpackagei.
Some packages that offer potentially useful features have limitations that
conflict with the implementation of theorems with AMS document classes or
amsthm. Here are some we know about.
8 Potential modifications
Feedback from users and experience with AMS publications have pointed out
several areas where added flexibility can benefit both users of amsthm.sty and
developers of “derivative” document classes based on the AMS set.
These suggestions are relatively easy to implement:
The following suggestions, while having merit, require more work, including
redesign of existing code:
9 Providing feedback
Reports on bugs found in this package should be submitted to
tech-support@ams.org
For best results, a brief, compilable example should accompany the report.
An alternate method is to use the LATEX bugs reporting mechanism, speci-
fying AMS-LaTeX as the bug category.
References
[AF] AMS Author FAQ, http://www.ams.org/authors/author-faq