| 1 |
%% filename: amsthdoc.tex |
| 2 |
%% version: 2.20.3 |
| 3 |
%% date: 2017/06/01 |
| 4 |
%% |
| 5 |
%% Copyright 1999, 2004, 2010, 2015, 2017 American Mathematical Society. |
| 6 |
%% |
| 7 |
%% American Mathematical Society |
| 8 |
%% Technical Support |
| 9 |
%% Publications Technical Group |
| 10 |
%% 201 Charles Street |
| 11 |
%% Providence, RI 02904 |
| 12 |
%% USA |
| 13 |
%% tel: (401) 455-4080 |
| 14 |
%% (800) 321-4267 (USA and Canada only) |
| 15 |
%% fax: (401) 331-3842 |
| 16 |
%% email: [email protected] |
| 17 |
%% |
| 18 |
%% This work may be distributed and/or modified under the |
| 19 |
%% conditions of the LaTeX Project Public License, either version 1.3c |
| 20 |
%% of this license or (at your option) any later version. |
| 21 |
%% The latest version of this license is in |
| 22 |
%% http://www.latex-project.org/lppl.txt |
| 23 |
%% and version 1.3c or later is part of all distributions of LaTeX |
| 24 |
%% version 2005/12/01 or later. |
| 25 |
%% |
| 26 |
%% This work has the LPPL maintenance status `maintained'. |
| 27 |
%% |
| 28 |
%% The Current Maintainer of this work is the American Mathematical |
| 29 |
%% Society. |
| 30 |
%% |
| 31 |
%% ==================================================================== |
| 32 |
%% |
| 33 |
\documentclass[11pt,twoside]{article} |
| 34 |
\pagestyle{myheadings} |
| 35 |
|
| 36 |
% Use the same version number as for the public amsthm release. |
| 37 |
\def\instrversion{2.20.3} |
| 38 |
\def\instrdate{September 2017} |
| 39 |
|
| 40 |
\title{Using the \pkg{amsthm} Package} |
| 41 |
\author{Version \instrversion, \instrdate\\[.5ex] |
| 42 |
Publications Technical Group\\American Mathematical Society} |
| 43 |
\date{} |
| 44 |
|
| 45 |
\providecommand{\qq}[1]{\textquotedblleft#1\textquotedblright} |
| 46 |
\providecommand{\mdash}{\textemdash\penalty\hyphenpenalty} |
| 47 |
|
| 48 |
% Some item adjustments |
| 49 |
|
| 50 |
\setlength\leftmargini{2em} |
| 51 |
\setlength\leftmarginii{1.5em} |
| 52 |
\renewcommand\labelitemii{$\circ$} |
| 53 |
|
| 54 |
% Embedded \index commands are a legacy from the time when this |
| 55 |
% documentation was part of amsldoc. Since they don't hurt anything, |
| 56 |
% let's leave them in. Maybe they will become useful again in the |
| 57 |
% future. [mjd,2000/06/06] |
| 58 |
|
| 59 |
\chardef\bslchar=`\\ % p. 424, TeXbook |
| 60 |
\newcommand{\ntt}{% |
| 61 |
\fontfamily\ttdefault \fontseries\mddefault \fontshape\updefault |
| 62 |
\selectfont |
| 63 |
} |
| 64 |
\DeclareRobustCommand{\cn}[1]{{\ntt\bslchar#1}} |
| 65 |
\DeclareRobustCommand{\cls}[1]{{\ntt#1}} |
| 66 |
\DeclareRobustCommand{\pkg}[1]{{\ntt#1}} |
| 67 |
\DeclareRobustCommand{\opt}[1]{{\ntt#1}} |
| 68 |
\DeclareRobustCommand{\env}[1]{{\ntt#1}} |
| 69 |
\DeclareRobustCommand{\fn}[1]{{\ntt#1}} |
| 70 |
|
| 71 |
\providecommand{\qedsymbol}{\leavevmode |
| 72 |
\hbox to.77778em{% |
| 73 |
\hfil\vrule |
| 74 |
\vbox to.675em{\hrule width.6em\vfil\hrule}% |
| 75 |
\vrule\hfil}} |
| 76 |
|
| 77 |
%% Provide a meta-command facility; provide an alternate escape |
| 78 |
%% character so it can be used within the verbatim environment. |
| 79 |
|
| 80 |
\catcode`\|=0 |
| 81 |
\begingroup \catcode`\>=13 % in LaTeX2e verbatim env makes > active |
| 82 |
\gdef\?#1>{{\normalfont$\langle$\textit{#1}$\rangle$}} |
| 83 |
\gdef\0{\relax} |
| 84 |
\endgroup |
| 85 |
\def\<#1>{{\normalfont$\langle$\textit{#1}$\rangle$}} |
| 86 |
\def\ntnote#1{{\normalfont$^{#1}$}\hangindent.5em} |
| 87 |
|
| 88 |
\hfuzz4pt \vbadness9999 \hbadness5000 |
| 89 |
\def\latex/{{\protect\LaTeX}} |
| 90 |
|
| 91 |
\setlength{\textwidth}{210mm}\addtolength{\textwidth}{-2in} |
| 92 |
\setlength{\oddsidemargin}{39pt} |
| 93 |
\setlength{\evensidemargin}{39pt} |
| 94 |
\addtolength{\textwidth}{-2\oddsidemargin} |
| 95 |
|
| 96 |
\setcounter{tocdepth}{2} |
| 97 |
|
| 98 |
\usepackage{url} |
| 99 |
\usepackage[breaklinks]{hyperref} |
| 100 |
|
| 101 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 102 |
|
| 103 |
\begin{document} |
| 104 |
\maketitle |
| 105 |
\markboth{Using the \pkg{amsthm} package}{Using the \pkg{amsthm} package} |
| 106 |
|
| 107 |
\begingroup |
| 108 |
\small |
| 109 |
\tableofcontents |
| 110 |
\endgroup |
| 111 |
|
| 112 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 113 |
|
| 114 |
\newpage %%%%%%%%%%%%%%%%%%%% |
| 115 |
|
| 116 |
\section{Introduction} |
| 117 |
|
| 118 |
\begin{sloppypar} |
| 119 |
The \pkg{amsthm} package provides an enhanced version of \latex/'s |
| 120 |
\cn{newtheorem} command for defining theorem-like environments. The |
| 121 |
enhanced \cn{newtheorem} recognizes a |
| 122 |
\cn{theoremstyle} specification (as in Mittelbach's \pkg{theorem} |
| 123 |
package) and has a \verb+*+ form for defining unnumbered environments. The |
| 124 |
\pkg{amsthm} package also defines a \env{proof} environment that |
| 125 |
automatically adds a QED symbol at the end. AMS document classes |
| 126 |
incorporate the \pkg{amsthm} package, so everything described here |
| 127 |
applies to them as well. |
| 128 |
\end{sloppypar} |
| 129 |
|
| 130 |
As part of the AMS \latex/ support environment, \pkg{amsthm} follows |
| 131 |
AMS style. This differs in some respects from the style provided by |
| 132 |
the base \latex/ classes and the package mentioned above; where a |
| 133 |
difference is known to be present, it will be noted in these instructions. |
| 134 |
One notable difference is that, after the end of a theorem or proof, |
| 135 |
the following line of text is assumed to start a new paragraph, and will |
| 136 |
always be indented, whether or not a blank line or \cn{par} is present. |
| 137 |
|
| 138 |
If the \pkg{amsthm} package is used with a non-AMS document class and |
| 139 |
with the \pkg{amsmath} package, \pkg{amsthm} must be loaded |
| 140 |
\emph{after} \pkg{amsmath}, not before. |
| 141 |
|
| 142 |
Since \pkg{amsthm} follows AMS publication style, formats that diverge |
| 143 |
significantly from that style may not be able to be accommodated. |
| 144 |
Other theorem packages \emph{do} exist, and users with incompatible |
| 145 |
requirements who are publishing elsewhere are advised to look for other |
| 146 |
possibilities on CTAN\@. However, authors preparing files for |
| 147 |
publication by the AMS are expected to follow AMS style. |
| 148 |
|
| 149 |
This manual describes the features provided by \pkg{amsthm}. Examples |
| 150 |
are given separately in the file \fn{thmtest.tex}. For best understanding, |
| 151 |
examine the output side-by-side with the input. |
| 152 |
|
| 153 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 154 |
|
| 155 |
%\section{The \cn{newtheorem} command} |
| 156 |
\section{Setup and input of theorem elements} |
| 157 |
|
| 158 |
In mathematical research articles and books, theorems\index{theorems} |
| 159 |
and proofs\index{proofs} are among the most common elements, but authors |
| 160 |
also use many others that fall in the same general class: lemmas, |
| 161 |
propositions, axioms, corollaries, conjectures, definitions, remarks, |
| 162 |
cases, steps, and so forth (see page~\pageref{thmstyle:list}). |
| 163 |
It is natural to handle these elements as |
| 164 |
\latex/ environments, but document classes do not |
| 165 |
provide predefined environments for theorem-like elements because |
| 166 |
(a)~that would make it difficult for authors to exercise the necessary |
| 167 |
control over the automatic numbering, and (b)~the variety of such |
| 168 |
elements is so wide that it's not possible for a document class to |
| 169 |
provide every one that will ever be needed. Instead there is a command |
| 170 |
\cn{newtheorem}, similar in effect to \cn{newenvironment}, that makes it |
| 171 |
easy for authors to set up the elements required for a particular |
| 172 |
document. |
| 173 |
|
| 174 |
The \cn{newtheorem} command has two mandatory arguments: the first one |
| 175 |
is the environment name that the author would like to use for this |
| 176 |
element; the second one is the heading text. For example, |
| 177 |
\begin{verbatim} |
| 178 |
\newtheorem{lem}{Lemma} |
| 179 |
\end{verbatim} |
| 180 |
means that instances in the document of |
| 181 |
\begin{verbatim} |
| 182 |
\begin{lem} Text text ... \end{lem} |
| 183 |
\end{verbatim} |
| 184 |
will produce |
| 185 |
\[\makebox[.8\columnwidth]{% |
| 186 |
\textbf{Lemma 1.} \textit{Text text \dots}\hfill}\] |
| 187 |
where the heading consists of the specified text \qq{Lemma} and an |
| 188 |
automatically generated number and punctuation. Note that there are |
| 189 |
no fixed text assignments as there are with, e.g., \cn{chaptername} |
| 190 |
(usually ``Chapter'' or ``Appendix'', depending on context); the heading |
| 191 |
text in the output will be exactly what you specify in the input. |
| 192 |
|
| 193 |
If \cn{newtheorem*} is used instead of \cn{newtheorem} in this |
| 194 |
example, numbers will not be generated automatically for |
| 195 |
any of the lemmas in the document. This form of the command can be |
| 196 |
useful even if you have only one lemma and don't want it to be |
| 197 |
numbered; more often, though, it is used to produce a special named |
| 198 |
variant of one of the common theorem types. For example, if you have a |
| 199 |
lemma that should get the heading \qq{Klein's Lemma}, then the statement |
| 200 |
\begin{verbatim} |
| 201 |
\newtheorem*{KL}{Klein's Lemma} |
| 202 |
\end{verbatim} |
| 203 |
would allow you to write |
| 204 |
\begin{verbatim} |
| 205 |
\begin{KL} Text text ... \end{KL} |
| 206 |
\end{verbatim} |
| 207 |
and get the desired output. |
| 208 |
|
| 209 |
Sometimes additional information is desired in the heading of a |
| 210 |
theorem or lemma, often because it is cited from another source. |
| 211 |
An optional argument is used to provide this information: |
| 212 |
\begin{verbatim} |
| 213 |
\begin{lem}[Alinhac-Lerner \cite{a-l}] |
| 214 |
\end{verbatim} |
| 215 |
yielding the output |
| 216 |
\[\makebox[.8\columnwidth]{% |
| 217 |
\textbf{Lemma 2.} (Alinhac-Lerner [4]). \textit{Text text \dots}\hfill}\] |
| 218 |
If the citation includes page numbers, the brackets in the reference |
| 219 |
must be ``hidden'' to prevent the closing bracket from being interpreted |
| 220 |
as the end of the optional argument to the heading: |
| 221 |
\begin{verbatim} |
| 222 |
\begin{lem}[Alinhac-Lerner {\cite[p.~37]{a-l}}] |
| 223 |
\end{verbatim} |
| 224 |
with the output |
| 225 |
\[\makebox[.8\columnwidth]{% |
| 226 |
\textbf{Lemma 2.} (Alinhac-Lerner [4, p.~37]). \textit{Text text \dots}\hfill}\] |
| 227 |
|
| 228 |
Often, theorems are referred to elsewhere in a document. The usual |
| 229 |
\latex/ \cn{label}-\cn{ref} mechanism works for this purpose. However, |
| 230 |
problems can arise when the \cn{label} is separated from the heading. |
| 231 |
For this reason, it is recommended to place the label immediately |
| 232 |
after the \verb+\begin{...}[...]+ command; placing it on a separate line |
| 233 |
should not cause any adverse effects. |
| 234 |
|
| 235 |
\subsection{Theorems beginning with lists} |
| 236 |
\label{ThmWithList} |
| 237 |
|
| 238 |
Sometimes it's desired to state a theorem in discrete steps, using |
| 239 |
a list. Preceding the list by text is recommended, to avoid problems |
| 240 |
both with linking (using \env{enumerate}) and with unattractive spacing. |
| 241 |
|
| 242 |
If no text is provided, the list will follow the heading on the same |
| 243 |
line. This has three unwanted effects: the horizontal space between |
| 244 |
the theorem head and the first item will be unacceptably large, a |
| 245 |
hyperlink to the theorem will not be ``live'' in the PDF file |
| 246 |
(although it will be marked), and the extra vertical space that should |
| 247 |
follow the end of the list will be absent. |
| 248 |
|
| 249 |
The best way to avoid these problems is to allow the list to start |
| 250 |
on a new line. One way to accomplish this is to follow the theorem |
| 251 |
head (and \cn{label}, if present) by the command \cn{leavevmode}. |
| 252 |
(For more information, see section~\ref{thmstyle:break}.) |
| 253 |
However, if the theorem comes near the bottom of a page, the list |
| 254 |
might move to the top of the next page, leaving an orphaned heading. |
| 255 |
If this happens, it must be addressed as an exception, to be taken |
| 256 |
care of after the text is final; at that point, the recommended |
| 257 |
fix is to call on the \pkg{needspace} \cite{NDS} package, or insert |
| 258 |
an explicit page break. |
| 259 |
|
| 260 |
An alternative method of starting a new line after the heading is to |
| 261 |
provide a \verb+\newtheoremstyle{break}+; the definition is given below |
| 262 |
on page~\pageref{thmstyle:break}. Like the \cn{leavevmode} approach, |
| 263 |
a \env{break} theorem environment is not perfect; known limitations |
| 264 |
accompany the definition. |
| 265 |
|
| 266 |
%The recommended remedy is to insert the command \cn{leavevmode} |
| 267 |
%after the heading (and label, if present). This will move the first |
| 268 |
%item to a new line, and restore linking and the usual spacing. |
| 269 |
%Adding \cn{samepage} immediately following \cn{leavevmode} will |
| 270 |
%prevent the page break, but this has the side effect of treating the |
| 271 |
%entire theorem as a unit, so such an adjustment should be delayed until |
| 272 |
%the ``last pass'' to minimize possible problems with long theorems. |
| 273 |
|
| 274 |
%% see also "break" below |
| 275 |
|
| 276 |
%% reconsider the following |
| 277 |
%% to be explored: use of enumerate package to reset item id styles |
| 278 |
|
| 279 |
If the list \emph{must} start on the same line as the heading, enter |
| 280 |
the first item identifier manually, with adjustments: enter an |
| 281 |
ordinary space between the heading and the identifier, reset the left |
| 282 |
margin if the item text will require more than one line, and reset |
| 283 |
the item counter (for \env{enumerate}) so that it will start |
| 284 |
with 2 (or whatever is appropriate). |
| 285 |
\begin{verbatim} |
| 286 |
\begin{thm}[|?optional modifier>] |
| 287 |
\hangindent\leftmargini % for a multi-line item |
| 288 |
\label{thm:xxx} |
| 289 |
\textup{(1)} First item ... |
| 290 |
\begin{enumerate} |
| 291 |
\setcounter{enumi}{1} |
| 292 |
\item ... |
| 293 |
\item ... |
| 294 |
\end{enumerate} |
| 295 |
\end{thm} |
| 296 |
\end{verbatim} |
| 297 |
The style shown here for the item identifier matches the default for |
| 298 |
AMS document classes. It may be different for other document classes; |
| 299 |
\pkg{amsthm} retains the class default. (\cn{textup} should be |
| 300 |
applied to hand-coded item identifiers when using an AMS class; AMS |
| 301 |
style conforms to traditional math typography in this respect, with item |
| 302 |
identifiers, cross-references, and similar elements consistently set |
| 303 |
upright, even in italic environments. However, an author should always |
| 304 |
try to match the style of the document class being used.) To match the |
| 305 |
default style of a first-level item counter when using an AMS document |
| 306 |
class, a reference may be entered with \cn{eqref}; however, beware if |
| 307 |
a package such as \pkg{cleveref} is being used, as it may associate the |
| 308 |
wrong element type. |
| 309 |
|
| 310 |
An initial item input in this manner cannot be linked using a \cn{label}, |
| 311 |
since it is not associated with a counter; the \cn{label} in the above |
| 312 |
example refers to the theorem element, not to the item in the list. |
| 313 |
This is an important concept: a \cn{label} will always refer to the |
| 314 |
value of the most recent counter that is automatically incremented; |
| 315 |
this counter will also be the anchor for a hyperlink if the |
| 316 |
\pkg{hyperref} package is used. |
| 317 |
|
| 318 |
%%% theorems starting with lists; linking -- xref |
| 319 |
|
| 320 |
%%% footnote on header -- Q-586 |
| 321 |
|
| 322 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 323 |
|
| 324 |
\enlargethispage{1\baselineskip} %%%%%%%%%%%%%%%%%%%% |
| 325 |
|
| 326 |
\section{Theorem numbering} |
| 327 |
|
| 328 |
In addition to the two mandatory arguments, \cn{newtheorem} has two |
| 329 |
mutually exclusive optional arguments. These govern the |
| 330 |
sequencing\index{theorems!numbering} and hierarchy of the numbering. |
| 331 |
The numbering mechanism can be thought of this way: |
| 332 |
%\null\hfil\verb+\newtheorem{+\<environment name>\verb+}[+\<shared counter>% |
| 333 |
\begin{verbatim} |
| 334 |
\newtheorem{|?env name>}{|?text>}[|?parent counter>] |
| 335 |
\newtheorem{|?env name>}[|?shared counter>]{|?text>} |
| 336 |
\end{verbatim} |
| 337 |
%(Only one of these optional arguments can be present at one time.) |
| 338 |
The \<parent counter> is comparable to \cn{numberwithin}; that is, |
| 339 |
numbering will restart whenever that sectional level is encountered. |
| 340 |
If a \<shared counter> is specified, numbering will progress |
| 341 |
sequentially for all theorem elements using this counter. See |
| 342 |
below for a more detailed explanation. |
| 343 |
|
| 344 |
%% ref tex.sx q/5244 for clear explanation |
| 345 |
|
| 346 |
By default each kind of theorem-like environment is numbered |
| 347 |
independently. Thus if you have three lemmas and two theorems |
| 348 |
interspersed, they will be numbered something like this: Lemma 1, Lemma |
| 349 |
2, Theorem 1, Lemma 3, Theorem 2. If you want lemmas and theorems to |
| 350 |
share the same numbering sequence\mdash Lemma 1, Lemma 2, Theorem 3, Lemma |
| 351 |
4, Theorem 5\mdash then you should use the \<shared counter> to indicate |
| 352 |
the desired relationship as follows: |
| 353 |
\begin{verbatim} |
| 354 |
\newtheorem{thm}{Theorem} |
| 355 |
\newtheorem{lem}[thm]{Lemma} |
| 356 |
\end{verbatim} |
| 357 |
The optional argument \verb+[thm]+ in the second statement means that |
| 358 |
the \env{lem} environment should share the \env{thm} numbering |
| 359 |
sequence instead of having its own independent sequence. |
| 360 |
|
| 361 |
To have a theorem environment numbered subordinately within a |
| 362 |
sectional unit\mdash e.g., to get propositions numbered Proposition 2.1, |
| 363 |
Proposition 2.2, and so on in Section~2\mdash put the name of the parent |
| 364 |
unit in square brackets in final position: |
| 365 |
\begin{verbatim} |
| 366 |
\newtheorem{prop}{Proposition}[section] |
| 367 |
\end{verbatim} |
| 368 |
With the optional argument \verb+[section]+, the \verb+prop+ counter |
| 369 |
will be reset to 0 whenever the parent counter \verb+section+ is |
| 370 |
incremented, and the proposition heading will have the section number |
| 371 |
prepended. |
| 372 |
|
| 373 |
If any theorem elements are numbered by section, and (in a book) the |
| 374 |
first such element in a chapter comes before the first section, |
| 375 |
numbering will continue from the previous chapter. In such a case, |
| 376 |
reset the counter by invoking this command before the affected element: |
| 377 |
\begin{verbatim} |
| 378 |
\setcounter{thm}{0} |
| 379 |
\end{verbatim} |
| 380 |
|
| 381 |
Note that theorem numbering is not accomplished by the same method |
| 382 |
as the \cn{numberwithin} facility of \pkg{amsmath}, so an attempt to |
| 383 |
use that to relate theorem numbers to equation numbers will not work |
| 384 |
in the expected way. A method for accomplishing that, as well as |
| 385 |
some other variations, is given in the AMS Author FAQ \cite{AF}, |
| 386 |
in the section on |
| 387 |
\qq{\href{http://www.ams.org//faq?class_id=561}{Theorems in AMS-\LaTeX}}. |
| 388 |
|
| 389 |
\newpage %%%%%%%%%%%%%%%%%%%% |
| 390 |
|
| 391 |
\subsection{Related topics addressed in the AMS author FAQ} |
| 392 |
|
| 393 |
\begin{itemize} |
| 394 |
\item \href{http://www.ams.org/faq?faq_id=199}{``Number'' |
| 395 |
theorems with letters instead of numbers} |
| 396 |
|
| 397 |
\item \href{http://www.ams.org/faq?faq_id=200}{Restart numbering for each |
| 398 |
chapter, but don't include chapter number as part of theorem number} |
| 399 |
|
| 400 |
\item \href{http://www.ams.org/faq?faq_id=202}{Number theorems by |
| 401 |
section when chapters have sections, but by chapter only when a chapter |
| 402 |
has no sections} |
| 403 |
|
| 404 |
\item \href{http://www.ams.org/faq?faq_id=289}{Number theorems and |
| 405 |
equations with the same numbering sequence} |
| 406 |
\end{itemize} |
| 407 |
|
| 408 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 409 |
|
| 410 |
\section{Changing styles for theorem-like environments} |
| 411 |
|
| 412 |
\subsection{The \texorpdfstring{\cn{theoremstyle}}{theoremstyle} command} |
| 413 |
|
| 414 |
The \pkg{amsthm} package supports the notion of a current theorem style, |
| 415 |
which determines what will be produced by a given \cn{newtheorem} |
| 416 |
command. The three theorem styles provided\mdash |
| 417 |
\env{plain},\index{plain theo@\env{plain} theorem style}\relax |
| 418 |
\index{definition theo@\env{definition} theorem style}\relax |
| 419 |
\index{remark theo@\env{remark} theorem style} \env{definition}, |
| 420 |
and \env{remark}\mdash specify different degrees of |
| 421 |
visual emphasis corresponding to their relative importance. The |
| 422 |
details of this typographical treatment may vary depending on the |
| 423 |
document class, but typically the \env{plain} style produces italic |
| 424 |
body text, while the other two styles produce roman body text. These |
| 425 |
default settings are provided: |
| 426 |
\begin{itemize} |
| 427 |
\item \env{plain}\,: italic text, extra space above and below; |
| 428 |
\item \env{definition}\,: upright text, extra space above and below; |
| 429 |
\item \env{remark}\,: upright text, no extra space above or below. |
| 430 |
\end{itemize} |
| 431 |
|
| 432 |
If no \cn{theoremstyle} command is given, the style used will be |
| 433 |
\env{plain}. To specify different styles, divide your \cn{newtheorem} |
| 434 |
commands into groups and preface each group with the appropriate |
| 435 |
\cn{theoremstyle}. Some examples:\label{thmstyle:list} |
| 436 |
\begin{verbatim} |
| 437 |
\theoremstyle{plain}% default |
| 438 |
\newtheorem{thm}{Theorem}[section] |
| 439 |
\newtheorem{lem}[thm]{Lemma} |
| 440 |
\newtheorem{prop}[thm]{Proposition} |
| 441 |
\newtheorem*{cor}{Corollary} |
| 442 |
\newtheorem*{KL}{Klein's Lemma} |
| 443 |
|
| 444 |
\theoremstyle{definition} |
| 445 |
\newtheorem{defn}{Definition}[section] |
| 446 |
\newtheorem{exmp}{Example}[section] |
| 447 |
\newtheorem{xca}[exmp]{Exercise} |
| 448 |
|
| 449 |
\theoremstyle{remark} |
| 450 |
\newtheorem*{rem}{Remark} |
| 451 |
\newtheorem*{note}{Note} |
| 452 |
\newtheorem{case}{Case} |
| 453 |
\end{verbatim} |
| 454 |
|
| 455 |
The following list summarizes the types of structures which are |
| 456 |
normally associated with each theorem style. |
| 457 |
|
| 458 |
\smallskip |
| 459 |
\begin{tabular}{ll} |
| 460 |
\relax\env{plain} & Theorem, Lemma, Corollary, Proposition, Conjecture, \\ |
| 461 |
& Criterion, Assertion \\ |
| 462 |
\relax\env{definition} \quad & Definition, Condition, Problem, Example, |
| 463 |
Exercise, \\ |
| 464 |
& Algorithm, Question, Axiom, Property, Assumption, \\ |
| 465 |
& Hypothesis \\ |
| 466 |
\relax\env{remark} & Remark, Note, Notation, Claim, Summary, \\ |
| 467 |
& Acknowledgment, Case, Conclusion |
| 468 |
\end{tabular} |
| 469 |
|
| 470 |
\subsection{Number swapping} |
| 471 |
|
| 472 |
A common style variation is to have the theorem number at the beginning |
| 473 |
of the heading instead of at the end, for example \qq{1.4 Theorem} |
| 474 |
instead of \qq{Theorem 1.4}. As this variation is usually applied |
| 475 |
to all \cn{theoremstyle}s, it is done by |
| 476 |
placing a \cn{swapnumbers} command at the beginning of the list of |
| 477 |
\cn{newtheorem} statements that should be affected. For example: |
| 478 |
\begin{verbatim} |
| 479 |
\swapnumbers |
| 480 |
\theoremstyle{plain} |
| 481 |
\newtheorem{thm}{Theorem}[section] |
| 482 |
\theoremstyle{remark} |
| 483 |
\newtheorem{rem}{Remark} |
| 484 |
\end{verbatim} |
| 485 |
|
| 486 |
When \pkg{amsthm} is used with a non-AMS document class, and numbers are |
| 487 |
swapped, no period is set following the number; this differs from the |
| 488 |
``basic'' \latex/ style. A workaround will be given in the AMS Author |
| 489 |
FAQ~\cite{AF}. |
| 490 |
|
| 491 |
In some AMS document classes, the style of the swapped numbers matches |
| 492 |
that of section headings; this may not be the same style as the rest |
| 493 |
of the theorem heading. |
| 494 |
|
| 495 |
% amsart: lightface numbers, bold heading |
| 496 |
% amsproc: all lightface; section headings bold |
| 497 |
% amsbook: all lightface; section headings bold |
| 498 |
|
| 499 |
\newpage %%%%%%%%%%%%%%%%%%%% |
| 500 |
|
| 501 |
\enlargethispage{1\baselineskip} % to fit code on same page |
| 502 |
\subsection{New theorem styles} |
| 503 |
|
| 504 |
The \pkg{amsthm} package provides a \cn{newtheoremstyle} command |
| 505 |
to aid in the creation of custom styles, should the three predefined |
| 506 |
styles prove insufficient. The following example illustrates the use |
| 507 |
of the \cn{newtheoremstyle} command. |
| 508 |
\begin{verbatim} |
| 509 |
\newtheoremstyle{note}% |?name> |
| 510 |
{3pt}% |?Space above>|ntnote1 |
| 511 |
{3pt}% |?Space below>|ntnote1 |
| 512 |
{}% |?Body font> |
| 513 |
{}% |?Indent amount>|ntnote2 |
| 514 |
{\itshape}% |?Theorem head font> |
| 515 |
{:}% |?Punctuation after theorem head> |
| 516 |
{.5em}% |?Space after theorem head>|ntnote3 |
| 517 |
{}% |?Theorem head spec |textup(can be left empty, meaning `normal'|textup)> |
| 518 |
\end{verbatim} |
| 519 |
\noindent |
| 520 |
\ntnote1 Space above and below: these are equal, but the defaults differ |
| 521 |
when using an AMS document class vs.\ \verb+\usepackage{amsthm}+. For |
| 522 |
AMS classes, this is \verb+.5\baselineskip+$\pm$\verb+.2\baselineskip+; |
| 523 |
for \pkg{amsthm} used as a separate package, it is the local value |
| 524 |
of \cn{topsep}. If these arguments are left empty, the current |
| 525 |
defaults are used. |
| 526 |
|
| 527 |
\noindent |
| 528 |
\ntnote2 Indent amount: empty = no indent, \cn{parindent} = normal |
| 529 |
paragraph indent |
| 530 |
|
| 531 |
\noindent |
| 532 |
\ntnote3 Space after theorem head: \verb+{ }+ = normal interword space; \\ |
| 533 |
%\null\phantom{\ntnote2} |
| 534 |
\cn{newline} = line break |
| 535 |
|
| 536 |
\smallskip |
| 537 |
Apply the new theorem style in the same manner as the predefined ones. |
| 538 |
|
| 539 |
Here are some styles that have been requested by authors. |
| 540 |
|
| 541 |
\subsubsection{Theorem style \texttt{break}} |
| 542 |
\label{thmstyle:break} |
| 543 |
This style will break after the theorem heading and start a new line. |
| 544 |
\begin{verbatim} |
| 545 |
\newtheoremstyle{break}% |
| 546 |
{}{}% |
| 547 |
{\itshape}{}% |
| 548 |
{\bfseries}{}% % Note that final punctuation is omitted. |
| 549 |
{\newline}{} |
| 550 |
\end{verbatim} |
| 551 |
|
| 552 |
This style can be used for a theorem beginning with a list. |
| 553 |
When used with \env{enumerate} and an AMS document class, all items |
| 554 |
are properly labeled and will link. However, the vertical spacing |
| 555 |
needs help; a conflict between definitions prevents the first |
| 556 |
item from starting on a new line---it looks almost the same as |
| 557 |
a default theorem beginning with an enumerated list. |
| 558 |
To repair this problem, begin the theorem like this: |
| 559 |
\begin{verbatim} |
| 560 |
\begin{breakthm}[...] |
| 561 |
\leavevmode \vspace{-\baselineskip} |
| 562 |
\begin{enumerate} |
| 563 |
\end{verbatim} |
| 564 |
\verb+\leavevmode+ alone will leave a full blank line after the theorem head. |
| 565 |
|
| 566 |
One more problem may arise: if the theorem starts close to the end |
| 567 |
of a page, the list could be split to a new page, leaving an |
| 568 |
orphaned heading. Make a note to address this when the text is |
| 569 |
final; then call on the \pkg{needspace} \cite{NDS} package, or insert |
| 570 |
an explicit page break. |
| 571 |
|
| 572 |
\subsubsection{Theorem with bold note field} |
| 573 |
|
| 574 |
If the note---with surrounding parentheses---is particularly important, |
| 575 |
setting the note field in bold may be desired. This variation numbers |
| 576 |
the theorem, an option not available when using \cn{newtheorem*}. |
| 577 |
\begin{verbatim} |
| 578 |
\newtheoremstyle{bfnote}% |
| 579 |
{}{}% |
| 580 |
{\itshape}{}% |
| 581 |
{\bfseries}{.}% |
| 582 |
{ }% |
| 583 |
{\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}} |
| 584 |
\end{verbatim} |
| 585 |
|
| 586 |
Parentheses may be omitted from around the note using this trivial |
| 587 |
adaptation of the formulation with a bold note. |
| 588 |
\begin{verbatim} |
| 589 |
\newtheoremstyle{noparens}% |
| 590 |
{}{}% |
| 591 |
{\itshape}{}% |
| 592 |
{\bfseries}{.}% |
| 593 |
{ }% |
| 594 |
{\thmname{#1}\thmnumber{ #2}\thmnote{ #3}} |
| 595 |
\end{verbatim} |
| 596 |
|
| 597 |
%\subsubsection*{other suggested examples (to be considered)} |
| 598 |
% |
| 599 |
%\begin{verbatim} |
| 600 |
% Q-353 [\newtheoremstyle, used with numbers omits parens on text] |
| 601 |
% Q-426 [\newtheoremstyle, number font doesn't change with \@thmheadfont] |
| 602 |
%\end{verbatim} |
| 603 |
|
| 604 |
\subsubsection{Other styles} |
| 605 |
For examples, see the file \fn{thmtest.tex}. |
| 606 |
|
| 607 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 608 |
|
| 609 |
\newpage %%%%%%%%%%%%%%%%%%%% |
| 610 |
|
| 611 |
\section{Proofs} |
| 612 |
|
| 613 |
A predefined \env{proof} environment provided by the \pkg{amsthm} |
| 614 |
package produces the heading \qq{Proof} with appropriate spacing and |
| 615 |
punctuation. The proof environment is primarily intended for short |
| 616 |
proofs, no more than a page or two in length; longer proofs are |
| 617 |
usually better done as a separate \cn{section} or \cn{subsection} in |
| 618 |
your document. |
| 619 |
|
| 620 |
\subsection{The beginning of a proof} |
| 621 |
|
| 622 |
An optional argument of the proof environment allows you to substitute |
| 623 |
a different name for the standard \qq{Proof\/}. If you want |
| 624 |
the proof heading to be, say, \qq{Proof of the Main Theorem}, then write |
| 625 |
\begin{verbatim} |
| 626 |
\begin{proof}[Proof of the Main Theorem] |
| 627 |
\end{verbatim} |
| 628 |
|
| 629 |
Because of the way the \env{proof} environment is defined (as a |
| 630 |
\latex/ list), a substitute ``name'' that is longer than one output |
| 631 |
line will not break as it should; this is on the list for repair. |
| 632 |
In the meantime, this redefinition in your preamble will accomplish |
| 633 |
the desired result. |
| 634 |
\begin{verbatim} |
| 635 |
\makeatletter |
| 636 |
\renewenvironment{proof}[1][\proofname]{\par |
| 637 |
\pushQED{\qed}% |
| 638 |
\normalfont \topsep6\p@\@plus6\p@\relax |
| 639 |
\trivlist |
| 640 |
\item\relax |
| 641 |
{\itshape |
| 642 |
#1\@addpunct{.}}\hspace\labelsep\ignorespaces |
| 643 |
}{% |
| 644 |
\popQED\endtrivlist\@endpefalse |
| 645 |
} |
| 646 |
\makeatother |
| 647 |
\end{verbatim} |
| 648 |
|
| 649 |
A proof beginning with a list can be approached in the same manner |
| 650 |
as a theorem; see section~\ref{ThmWithList}. |
| 651 |
|
| 652 |
\subsection{The end of a proof} |
| 653 |
|
| 654 |
A QED symbol, \qedsymbol, is automatically appended at the end of |
| 655 |
a \env{proof} environment. To substitute a different end-of-proof |
| 656 |
symbol, use \cn{renewcommand} to redefine the command \cn{qedsymbol}. |
| 657 |
For a long proof done as a subsection or section instead of with the |
| 658 |
\env{proof} environment, you can obtain the symbol and the usual |
| 659 |
amount of preceding space by using \cn{qed}; this will work properly |
| 660 |
only if it follows ordinary text. |
| 661 |
|
| 662 |
A blank line preceding \verb+\end{proof}+ (or before an explicit \cn{qed}) |
| 663 |
disables the mechanism that places the QED symbol, and may even allow |
| 664 |
that symbol to be set at the top of a new page. |
| 665 |
|
| 666 |
Placement of the QED symbol can be problematic if the last part of |
| 667 |
a \env{proof} environment is a displayed equation or list environment |
| 668 |
or something of that nature. In that case put a \cn{qedhere} command at |
| 669 |
the place where the QED symbol should appear, for example, |
| 670 |
\begin{verbatim} |
| 671 |
\begin{proof} |
| 672 |
... |
| 673 |
\begin{equation} |
| 674 |
G(t)=L\gamma!\,t^{-\gamma}+t^{-\delta}\eta(t) \qedhere |
| 675 |
\end{equation} |
| 676 |
\end{proof} |
| 677 |
\end{verbatim} |
| 678 |
When used with the \pkg{amsmath} package, version 2 or later, \cn{qedhere} |
| 679 |
will position the QED symbol flush right; with earlier versions, the |
| 680 |
symbol will be spaced a quad away from the end of the text or display. |
| 681 |
|
| 682 |
If \cn{qedhere} produces an error message in an equation, try using \\ |
| 683 |
\verb+\mbox{\qedhere}+ instead. |
| 684 |
|
| 685 |
\cn{qedhere} does not work with \env{eqnarray} or with equations input |
| 686 |
with \verb+$$+; the display environments defined by \pkg{amsmath} and |
| 687 |
the \verb+\[ ... \]+ form of unnumbered equations have been specially |
| 688 |
crafted for this purpose. |
| 689 |
|
| 690 |
When a proof ends with a list environment, place \cn{qedhere} as the |
| 691 |
last thing before \verb+\end{enumerate}+ or \verb+\end{itemize}+. |
| 692 |
|
| 693 |
If, for some reason, it is desired to omit the QED symbol from the |
| 694 |
end of a proof, it can be suppressed by including this definition just |
| 695 |
before \verb+\end{proof}+: |
| 696 |
\begin{verbatim} |
| 697 |
\renewcommand{\qedsymbol}{} |
| 698 |
\end{verbatim} |
| 699 |
If the symbol is to be omitted from \emph{all} proofs in the document, |
| 700 |
place the redefinition in the preamble. |
| 701 |
|
| 702 |
If the QED symbol is needed outside of the \env{proof} environment, |
| 703 |
use \cn{qed} rather than \cn{qedhere}. |
| 704 |
|
| 705 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 706 |
|
| 707 |
\newpage %%%%%%%%%%%%%%%%%%%% |
| 708 |
|
| 709 |
\section{Known problems} |
| 710 |
|
| 711 |
The following problems are listed for attention with the next update |
| 712 |
of \pkg{amsthm}. |
| 713 |
|
| 714 |
\begin{itemize} |
| 715 |
\item Problems with \cn{qedhere}. % B-366 |
| 716 |
\begin{itemize} |
| 717 |
\item When \cn{qedhere} is used with an unstarred multi-line display |
| 718 |
structure, the final line is not numbered. (This is relevant only |
| 719 |
when numbers are on the left; \cn{qedhere} is inappropriate for |
| 720 |
use with displays numbered on the right.) |
| 721 |
\item When \cn{qedhere} is within a \env{split} environment, that |
| 722 |
part of the display is not numbered and \cn{label} is suppressed. |
| 723 |
If \cn{qedhere} is moved outside of \env{split} the number appears |
| 724 |
but the content of the \env{split} is shifted left, and the QED |
| 725 |
symbol may be absent. |
| 726 |
\item In an alignment, if no \verb+&+ is present, the box does not |
| 727 |
go flush to the right margin. |
| 728 |
\item For a one-line equation, both the number and the box appear, |
| 729 |
but the equation is shifted left. |
| 730 |
\end{itemize} |
| 731 |
\item Other problems inherent in \pkg{amsthm}. |
| 732 |
\begin{itemize} |
| 733 |
\item Hyperlinking the first item when a theorem begins with a list. |
| 734 |
\end{itemize} |
| 735 |
\item Problems of interaction with AMS document classes. Corrections |
| 736 |
will be made in the classes, not in \pkg{amsthm}. |
| 737 |
\begin{itemize} |
| 738 |
\item In \cls{amsbook}, when a theorem appears before a chapter's |
| 739 |
first numbered section, theorem numbering continues from the |
| 740 |
previous chapter. |
| 741 |
\end{itemize} |
| 742 |
\end{itemize} |
| 743 |
|
| 744 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 745 |
|
| 746 |
\section{Other packages} |
| 747 |
|
| 748 |
Some packages provide additional theorem functionality, with options |
| 749 |
that recognize the presence of \pkg{amsthm} and adjust for it. |
| 750 |
\begin{itemize} |
| 751 |
\itemsep=.5\itemsep |
| 752 |
\item \pkg{mdframed} \cite{MDF} provides the ability to set off theorems |
| 753 |
(and other elements) with frames of various shapes and colors. |
| 754 |
It should be loaded \emph{after} \pkg{amsthm} if both are used. |
| 755 |
\item \pkg{thmtools} \cite{THT} provides an alternate key-value syntax |
| 756 |
for theorem specification, as well as variant presentation styles, |
| 757 |
both predefined and user definable. A QED symbol can be applied to any |
| 758 |
theorem element, not just to proofs. An adaptable \cn{listoftheorems} |
| 759 |
is also available. |
| 760 |
\end{itemize} |
| 761 |
For details, refer to the package manuals. Both packages are included |
| 762 |
in \TeX~Live, so can be accessed with |
| 763 |
\texttt{texdoc}~\<package>. |
| 764 |
|
| 765 |
Some packages that offer potentially useful features have limitations |
| 766 |
that conflict with the implementation of theorems with AMS document |
| 767 |
classes or \pkg{amsthm}. Here are some we know about. |
| 768 |
\begin{itemize} |
| 769 |
\itemsep=.5\itemsep |
| 770 |
\item \pkg{paralist} overrides the settings in \pkg{amsthm} that apply |
| 771 |
\cn{upshape} to item numbers in an \env{enumerate} environment within |
| 772 |
a theorem; the numbers become italic, which is undesired. |
| 773 |
\item \pkg{wrapfig} documents that it does not coexist with lists. |
| 774 |
Both theorems and proofs in \pkg{amsthm} are based on \cn{trivlist}. |
| 775 |
An insertion using this method may cause succeeding paragraphs to be |
| 776 |
indented by the width of the insert even if the depth of the |
| 777 |
insertion does not warrant it. |
| 778 |
\item \pkg{floatflt} and \pkg{picinpar} suffer from the same limitation. |
| 779 |
\end{itemize} |
| 780 |
|
| 781 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 782 |
|
| 783 |
\section{Potential modifications} |
| 784 |
|
| 785 |
Feedback from users and experience with AMS publications have pointed |
| 786 |
out several areas where added flexibility can benefit both users of |
| 787 |
\pkg{amsthm.sty} and developers of ``derivative'' document classes |
| 788 |
based on the AMS set. |
| 789 |
|
| 790 |
These suggestions are relatively easy to implement: |
| 791 |
|
| 792 |
\begin{itemize} |
| 793 |
\item Change hard-coded font specifications (e.g., \cn{itshape}) |
| 794 |
to commands (e.g., \cn{proofheadingfont}) to allow modification. |
| 795 |
\item Provide commands instead of hard-coded values for other elements, |
| 796 |
such as punctuation. |
| 797 |
\end{itemize} |
| 798 |
|
| 799 |
The following suggestions, while having merit, require more work, including |
| 800 |
redesign of existing code: |
| 801 |
|
| 802 |
\begin{itemize} |
| 803 |
\item Extend applicability of \cn{qedhere} to theorem-class elements |
| 804 |
as well as to proofs. |
| 805 |
\item Provide a means to ignore the definition of \env{proof} to |
| 806 |
avoid name conflicts with some non-AMS document classes. |
| 807 |
\item Consider key-value mechanism for specifying \cn{newtheoremstyle} |
| 808 |
options. |
| 809 |
\item Provide a new theorem style that begins with a list. |
| 810 |
\end{itemize} |
| 811 |
|
| 812 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 813 |
|
| 814 |
\section{Providing feedback} |
| 815 |
|
| 816 |
Reports on bugs found in this package should be submitted to\\ |
| 817 |
\null\hfil \href{mailto:[email protected]}{\texttt{[email protected]}} |
| 818 |
|
| 819 |
\noindent |
| 820 |
For best results, a brief, compilable example should accompany the report. |
| 821 |
|
| 822 |
An alternate method is to use the |
| 823 |
\href{http://latex-project.org/bugs-upload.html}{\LaTeX\ bugs} |
| 824 |
reporting mechanism, specifying \texttt{AMS-LaTeX} as the bug category. |
| 825 |
|
| 826 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 827 |
|
| 828 |
\begin{thebibliography}{[MDF]} |
| 829 |
|
| 830 |
\raggedright |
| 831 |
|
| 832 |
\bibitem[AF]{AF} AMS Author FAQ, |
| 833 |
\url{http://www.ams.org/authors/author-faq} |
| 834 |
|
| 835 |
\bibitem[MDF]{MDF} The \pkg{mdframed} package, |
| 836 |
Marco Daniel and Elke~Schubert, 2013/07/01, v1.9b, |
| 837 |
% \url{http://mirror.ctan.org/macros/latex/contrib/mdframed/mdframed.pdf} |
| 838 |
\url{http://mirror.ctan.org/macros/latex/contrib/mdframed} |
| 839 |
|
| 840 |
\bibitem[NDS]{NDS} The \pkg{needspace} package, |
| 841 |
Peter Wilson, 2010/09/12, v1.3d, |
| 842 |
\url{http://mirror.ctan.org/macros/latex/contrib/needspace} |
| 843 |
|
| 844 |
\bibitem[THT]{THT} \pkg{Thmtools} Users' Guide, |
| 845 |
Ulrich M. Schwarz, 2014/04/21 v66, |
| 846 |
% \url{http://mirror.ctan.org/macros/latex/exptl/thmtools/thmtools.pdf} |
| 847 |
\url{http://mirror.ctan.org/macros/latex/exptl/thmtools} |
| 848 |
|
| 849 |
\end{thebibliography} |
| 850 |
|
| 851 |
\end{document} |