Debian Codegraph @

texmf-dist/source/latex/amscls/amsclass.dtx

raw
1 % \def\filename{amsclass.dtx}
2 % \def\fileversion{2.20.6}
3 % \def\filedate{2020/05/29}
4 %
5 % \iffalse meta-comment
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 % Copyright 1995, 1999, 2004, 2009-2020 American Mathematical Society.
19 %
20 % This work may be distributed and/or modified under the
21 % conditions of the LaTeX Project Public License, either version 1.3c
22 % of this license or (at your option) any later version.
23 % The latest version of this license is in
24 % http://www.latex-project.org/lppl.txt
25 % and version 1.3c or later is part of all distributions of LaTeX
26 % version 2005/12/01 or later.
27 %
28 % This work has the LPPL maintenance status `maintained'.
29 %
30 % The Current Maintainer of this work is the American Mathematical
31 % Society.
32 %
33 % \fi
34 %
35 % \iffalse
36 %<*driver>
37 \documentclass{amsdtx}
38
39 \CodelineIndex
40
41 \begin{document}
42 \title{%
43 The \cls{amsart}, \cls{amsproc}, and \cls{amsbook} document~classes}
44 \author{American Mathematical Society\\Michael Downes\\
45 updated by Barbara Beeton}
46 \date{Version \fileversion, \filedate}
47 \DocInput{amsclass.dtx}
48 \end{document}
49 %</driver>
50 % \fi
51 %
52 % \maketitle
53 %
54 % \MakeShortVerb\|
55 %
56 % \section{Introduction}
57 % This file (\fn{amsclass.dtx}) is the master file for three \latex/
58 % document classes, \cls{amsart}, \cls{amsproc}, and \cls{amsbook},
59 % which are intended for articles and books containing mathematical
60 % research. They produce output that follows the style conventions of
61 % American Mathematical Society publications. The theorem setup
62 % features of these document classes are also available in a separate
63 % package, \pkg{amsthm}.
64 %
65 % \StopEventually{}
66 %
67 % \section{Implementation}
68 %
69 % Three document class files and one package file (\fn{amsthm.sty})
70 % are produced from this source. Most of the code of the \fn{amsthm}
71 % package is used in all four derived files. Most of the remaining
72 % code is used in all three document class files. Fine tuning is done
73 % with additional docstrip guards.
74 %
75 % The usual name, date, and version information. (Note: the reason
76 % each \cs{ProvidesClass} command is placed on a line by itself, with
77 % separate begin and end guards for docstripping, is to make
78 % automatic update of file date and version slightly easier and more
79 % robust.)
80 %
81 % \begin{macrocode}
82 \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
83 [1995/06/01]% LaTeX date must be June 1995 or later
84 %<*amsart>
85 \ProvidesClass{amsart}[2020/05/29 v2.20.6]
86 %</amsart>
87 %<*amsproc>
88 \ProvidesClass{amsproc}[2020/05/29 v2.20.6]
89 %</amsproc>
90 %<*amsbook>
91 \ProvidesClass{amsbook}[2020/05/29 v2.20.6]
92 %</amsbook>
93 % \end{macrocode}
94 % For \pkg{amsthm} we need to guard against redundant loading via
95 %\begin{verbatim}
96 % \documentclass{amsart}
97 % \usepackage{amsthm}
98 %\end{verbatim}
99 % because in that case the usual \cs{RequirePackage} mechanism for
100 % avoiding redundant loading will not apply. We need to simulate the
101 % loading of the \pkg{amsthm} package.
102 % \begin{macrocode}
103 %<*classes>
104 \global\expandafter\let\csname [email protected]\expandafter\endcsname
105 \csname ver@\@currname.\@currext\endcsname
106 %</classes>
107 %<*amsthm>
108 \ProvidesPackage{amsthm}[2020/05/29 v2.20.6]
109 %</amsthm>
110 % \end{macrocode}
111 %
112 % The following code is shared by the classes and the \pkg{amsthm}
113 % package. Cf.~\fn{amsgen.sty}.
114 % \begin{macrocode}
115 \let\@xp=\expandafter
116 \let\@nx=\noexpand
117 \def\@oparg#1[#2]{\@ifnextchar[{#1}{#1[#2]}}
118 \long\def\@ifempty#1{\@xifempty#1@@..\@nil}
119 \long\def\@xifempty#1#2@#3#4#5\@nil{%
120 \ifx#3#4\@xp\@firstoftwo\else\@xp\@secondoftwo\fi}
121 \long\def\@ifnotempty#1{\@ifempty{#1}{}}
122 \def\setboxz@h{\setbox\z@\hbox}
123 \def\@addpunct#1{%
124 \relax\ifhmode
125 \ifnum\spacefactor>\@m \else#1\fi
126 \fi}
127 % \end{macrocode}
128 % \cn{nopunct} should have a value for \cn{spacefactor} that is
129 % not used for \cn{frenchspacing}.
130 % \begin{macrocode}
131 \def\nopunct{\spacefactor 1007 }
132 \def\frenchspacing{\sfcode`\.1006\sfcode`\?1005\sfcode`\!1004%
133 \sfcode`\:1003\sfcode`\;1002\sfcode`\,1001 }
134 % \end{macrocode}
135 %
136 % If this class is loaded by a parent document class, then we want
137 % to use the name of the parent class. Otherwise the name of the
138 % current class file.
139 % \begin{macrocode}
140 %<*classes>
141 \def\@tempa#1#2\@nil{\edef\@classname{#1}}
142 \expandafter\@tempa\@currnamestack{}{}{}\@nil
143 \ifx\@classname\@empty \edef\@classname{\@currname}\fi
144 % \end{macrocode}
145 %
146 % \subsection{Support for conditional text}
147 %
148 % [This needs to be documented in the users' guide, including the
149 % idea of using \verb'\for{5ed}{\linebreak}' to mark edition-specific
150 % line and page breaks. [mjd,1999/12/27]]
151 %
152 % We would sometimes like to be able to mark fragments of text to be
153 % conditionally discarded or typeset. For example in the title of a
154 % section if we want to add a linebreak but prevent this linebreak
155 % from also taking effect in the table of contents.
156 %
157 % Certain kinds of switches need to be built into the low-level
158 % structure of our document class in order to be useful. For example,
159 % inside the toc we need to arrange for an \qq{in-toc?} test to yield
160 % true.
161 %
162 % \begin{macrocode}
163 \def\@True{00}
164 \def\@False{01}
165 \newcommand\newswitch[2][False]{%
166 \expandafter\@ifdefinable\csname ?@#2\endcsname{%
167 \global\expandafter\let\csname ?@#2\expandafter\endcsname
168 \csname @#1\endcsname
169 }%
170 }
171 \newcommand{\setFalse}[1]{%
172 \expandafter\let\csname ?@#1\endcsname\@False
173 }
174 \newcommand{\setTrue}[1]{%
175 \expandafter\let\csname ?@#1\endcsname\@True
176 }
177 % \end{macrocode}
178 % The empty switch is by default false; i.e., if you write
179 %\begin{verbatim}
180 % \for{}{...}
181 %\end{verbatim}
182 % the material will be discarded.
183 % \begin{macrocode}
184 \newswitch{}
185 % \end{macrocode}
186 %
187 % To get a line break in a section title but not in the table of
188 % contents line for that section, use
189 % \verb'\except{toc}{\linebreak}'. (Presumably you are already giving
190 % a shortened running head version separately, if applicable.)
191 % \begin{macrocode}
192 \DeclareRobustCommand{\except}[1]{%
193 \if\csname ?@#1\endcsname \expandafter\@gobble
194 \else \expandafter\@firstofone
195 \fi
196 }
197 \DeclareRobustCommand{\for}[1]{%
198 \if\csname ?@#1\endcsname \expandafter\@firstofone
199 \else \expandafter\@gobble
200 \fi
201 }
202 % \end{macrocode}
203 %
204 % The \cn{forany} command needs to run through a comma-separated list
205 % of switch names and print its second argument if any of the
206 % switches are true.
207 % \begin{macrocode}
208 \DeclareRobustCommand{\forany}[1]{%
209 \csname for@any@01\endcsname#1,?,\@nil
210 }
211 \@namedef{for@any@\@False}#1,{%
212 \csname for@any@%
213 \csname ?@\zap@space#1 \@empty\endcsname
214 \endcsname
215 }
216 \@namedef{?@?}{x}
217 \@namedef{for@any@\@True}#1\@nil#2{#2}
218 \def\for@any@x{\@car\@gobble}
219 % \end{macrocode}
220 %
221 % \subsection{Options}
222 % \subsubsection{Notes}
223 % Options will be processed in the order they are declared;
224 % cf.~\cs{ProcessOptions}.
225 %
226 % \subsubsection{Paper size}
227 %
228 % The option \opt{letterpaper} (default) sets the target paper width
229 % and height to U.S. letter size, 8.5 in x 11 in. An option
230 % \opt{a4paper} is also supported, but we don't include some of the
231 % more unusual paper options (\opt{legalpaper}, \opt{a5paper},
232 % \opt{executivepaper}) of the generic \cls{article} class. For A4
233 % paper we not only change the paper size but also add 4pc to the
234 % normal textheight of 50.5pc (the difference between 297mm and 11in
235 % is 50pt).
236 % \begin{macrocode}
237 \DeclareOption{a4paper}{\paperheight 297mm\paperwidth 210mm
238 \textheight 54.5pc }
239 \DeclareOption{letterpaper}{\paperheight 11in\paperwidth 8.5in }
240 % \end{macrocode}
241 %
242 % The options \opt{landscape} and \opt{portrait} swap paper height
243 % and width.
244 % \begin{macrocode}
245 \DeclareOption{landscape}{\@tempdima\paperheight
246 \paperheight\paperwidth \paperwidth\@tempdima}
247 \DeclareOption{portrait}{}
248 % \end{macrocode}
249 %
250 % \subsubsection{Two-sided or one-sided printing}
251 %
252 % For two-sided printing we set the switch \cs{if@twoside} which
253 % will cause the margins to be adjusted so that the type blocks of
254 % back-to-back pages will line up. The \cs{if@mparswitch} makes margin
255 % paragraphs print in the outside margin.
256 % \begin{macrocode}
257 \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
258 \DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
259 % \end{macrocode}
260 %
261 % \subsubsection{Draft or final version}
262 %
263 % The \opt{draft} option causes overfull lines to be marked with
264 % a black slug in the right margin.
265 % \begin{macrocode}
266 \DeclareOption{draft}{\overfullrule5\p@
267 \ClassWarningNoLine{\@classname}{%
268 When the draft option is used, the
269 \protect\includegraphics\MessageBreak
270 command will print blank placeholder boxes\MessageBreak
271 for the graphics}%
272 }
273 \DeclareOption{final}{\overfullrule\z@ }
274 % \end{macrocode}
275 %
276 % \subsubsection{Posting date}
277 %
278 % The date when an article is officially posted to the WWW is recorded
279 % in a variable \cs{@dateposted} with the \cn{dateposted} command.
280 %
281 % \begin{macrocode}
282 \def\dateposted#1{\def\@dateposted{#1}}%
283 \let\@dateposted\@empty
284 % \end{macrocode}
285 %
286 % \begin{macrocode}
287 %<*amsart>
288 \def\@setdateposted{%
289 \newline Article electronically published on \@dateposted}
290 %</amsart>
291 % \end{macrocode}
292 %
293 % \subsubsection{Logos}
294 %
295 % The following logo is used for regular journal articles. The one
296 % for proceedings articles and the one for e-only journals are given
297 % separately.
298 % \begin{macrocode}
299 %<*amsart>
300 \def\article@logo{%
301 \set@logo{%
302 \publname
303 % \end{macrocode}
304 % Current volume might be empty when an article is first posted to
305 % the WWW. In that case leave out the issue-specific info.
306 % \begin{macrocode}
307 \ifx\@empty\currentvolume
308 \else \newline\volinfo, \pageinfo
309 \fi
310 \newline \@PII
311 \ifx\@empty\@dateposted \else \@setdateposted\fi
312 }%
313 }
314 \def\eonly@logo{%
315 \set@logo{%
316 \publname
317 \newline\volinfo, \pageinfo
318 \ifx\@empty\@dateposted \else \@setdateposted\fi
319 \newline \@PII
320 }%
321 }
322 %</amsart>
323 % \end{macrocode}
324 %
325 % \begin{macrocode}
326 %<*amsart|amsproc>
327 \def\@logofont{\fontsize{6}{7\p@}\selectfont}
328 \long\def\set@logo#1{%
329 \vbox to\headheight{%
330 \@parboxrestore \@logofont
331 \noindent#1\par\vss
332 }%
333 }
334 %</amsart|amsproc>
335 % \end{macrocode}
336 %
337 % \begin{macrocode}
338 %<*amsproc>
339 \def\procart@logo{%
340 \set@logo{\publname
341 \ifx\@empty\volinfo \else\newline\volinfo\fi}%
342 }
343 %</amsproc>
344 % \end{macrocode}
345 %
346 % \subsubsection{E-only journal}
347 %
348 % Electronic-only journals (for \cls{amsart} only) have different
349 % information in the series logo than paper-only or dual journals.
350 % Only the volume number is reported (no issue or year), and the
351 % posting date is added following the page numbers. [bnb, 1996/10/31]
352 %
353 % This option will be invoked only from publication-specific \fn{.cls}
354 % files.
355 % \begin{macrocode}
356 %<*amsart>
357 \DeclareOption{e-only}{%
358 \def\volinfo{Volume \currentvolume}%
359 \dateposted{Xxxx XX, XXXX}%
360 \def\@setdateposted{\ (\@dateposted)}%
361 \let\article@logo\eonly@logo
362 }
363 %</amsart>
364 % \end{macrocode}
365 %
366 % \subsubsection{Title page}
367 %
368 % The title and related information can optionally be printed on a
369 % separate page.
370 % \begin{macrocode}
371 \newif\if@titlepage
372 \DeclareOption{titlepage}{\@titlepagetrue}
373 \DeclareOption{notitlepage}{\@titlepagefalse}
374 % \end{macrocode}
375 %
376 % \subsubsection{Start on right- or left-hand page}
377 %
378 % For some book series, it's permissible to start chapters on a
379 % left-hand page. Default to `openright', the usual AMS book style.
380 % \begin{macrocode}
381 %<*amsbook>
382 \newif\if@openright
383 \DeclareOption{openright}{\@openrighttrue}
384 \DeclareOption{openany}{\@openrightfalse}
385 \@openrighttrue
386 %</amsbook>
387 % \end{macrocode}
388 %
389 % \subsubsection{Two-column printing}
390 %
391 % Two-column layout is handled through a predefined internal switch.
392 % \begin{macrocode}
393 \DeclareOption{onecolumn}{\@twocolumnfalse}
394 \DeclareOption{twocolumn}{\@twocolumntrue}
395 % \end{macrocode}
396 %
397 % \subsubsection{The nomath option}
398 %
399 % The \opt{nomath} option causes most of the extra math features to
400 % be omitted. Some utility functions will be defined below if this
401 % option is specified.
402 % \begin{macrocode}
403 \DeclareOption{nomath}{}
404 % \end{macrocode}
405 %
406 % \subsubsection{Some font options}
407 %
408 % The \opt{noamsfonts} option means to avoid declaring math alphabets
409 % or symbol fonts for the extra math fonts in the AMSFonts set. If
410 % these fonts are declared, it means that the corresponding \fn{.tfm}
411 % files are required even for documents that do not use any symbols
412 % from those fonts. So we allow optionally to not declare them, for
413 % convenience of users who don't have those fonts on their system and
414 % don't want the hassle of getting them.
415 % \begin{macrocode}
416 \DeclareOption{noamsfonts}{}
417 % \end{macrocode}
418 % The \opt{psamsfonts} option, passed on to the \pkg{amsfonts} package,
419 % means that alternative \fn{.fd} files should be used that do not
420 % refer to \fn{.tfm} files for sizes 6,8,9 (which are not present in
421 % the PostScript (Type 1) AMS fonts set from Y\&Y/Blue Sky Research).
422 % This should also trigger the \opt{cmex10} option of \pkg{amsmath},
423 % to avoid trying to load sizes 7--9 of \fn{cmex}.
424 % \begin{macrocode}
425 \DeclareOption{psamsfonts}{%
426 \PassOptionsToPackage{psamsfonts}{amsfonts}%
427 \PassOptionsToPackage{cmex10}{amsmath}}
428 % \end{macrocode}
429 %
430 % \subsubsection{Equation numbering on the left or right}
431 %
432 % The option \opt{leqno}---equation numbers on the left---is the
433 % default in AMS styles. Therefore we provide also a \opt{reqno}
434 % option.
435 % \begin{macrocode}
436 \newif\iftagsleft@
437 \DeclareOption{leqno}{%
438 \tagsleft@true \PassOptionsToPackage{leqno}{amsmath}}
439 \DeclareOption{reqno}{%
440 \tagsleft@false \PassOptionsToPackage{reqno}{amsmath}}
441 % \end{macrocode}
442 %
443 % \subsubsection{Vertical centering of equation numbers}
444 % For multiline equations the equation number is by default centered
445 % vertically on the total height of the equation. To make the
446 % equation number print on the first line (for left-hand
447 % numbers) or the last line (right-hand numbers), there is a
448 % \opt{tbtags} option `top/bottom tags'.
449 % \begin{macrocode}
450 \newif\ifctagsplit@
451 \DeclareOption{centertags}{%
452 \ctagsplit@true \PassOptionsToPackage{centertags}{amsmath}}
453 \DeclareOption{tbtags}{%
454 \ctagsplit@false \PassOptionsToPackage{tbtags}{amsmath}}
455 % \end{macrocode}
456 %
457 % \subsubsection{Flush left displays}
458 %
459 % The option \opt{fleqn} causes displayed equations to print
460 % aligned on the left instead of centered, with an indentation
461 % of \cs{mathindent} from the prevailing left margin. If the
462 % \pkg{amsmath} package is loaded, most of this code will be
463 % overridden, but it seems we need it anyway because of the
464 % possibility of the \opt{nomath} class option.
465 %
466 % \begin{macrocode}
467 \DeclareOption{fleqn}{}%
468 % \end{macrocode}
469 %
470 % \subsubsection{Dealing with font sizes}
471 %
472 % \begin{macro}{\@mainsize}
473 % \begin{macro}{\@ptsize}
474 % Instead of the miserly \cs{@ptsize} variable from \latex/'s
475 % ancient history that contains only the last digit of the main
476 % typesize, we set up a proper variable \cs{@mainsize} that
477 % contains all the digits of the main typesize. Just in case it is
478 % needed for someone using an old package, we will keep
479 % \cs{@ptsize} also.
480 % \begin{macrocode}
481 \newcommand{\@mainsize}{10}
482 \newcommand{\@ptsize}{0}
483 % \end{macrocode}
484 % \end{macro}
485 % \end{macro}
486 %
487 % \begin{macro}{\larger}
488 % \begin{macro}{\smaller}
489 % This function is an easy byproduct of the work done to fold
490 % typesize-specific code into the main class file. The range of font
491 % sizes is \cn{normalsize}, \cn{small}, \cn{Small}, \cn{SMALL},
492 % \cn{tiny}, \cn{Tiny}, \cn{large}, \cn{Large}, \cn{LARGE},
493 % \cn{huge}, \cn{Huge}. Spaces are left at either end of the case
494 % statement to accommodate adding \cn{TINY} and \cn{HUGE} in the
495 % future but it's not clear that they're really needed.
496 % \begin{macrocode}
497 \newcommand{\larger}[1][1]{%
498 \count@\@currsizeindex \advance\count@#1\relax
499 \ifnum\count@<\z@ \count@\z@ \else\ifnum\count@>12 \count@12 \fi\fi
500 % \end{macrocode}
501 % The various size-changing commands \cn{normalsize}, etc., will take
502 % care of updating \cs{@currsizeindex}.
503 % \begin{macrocode}
504 \ifcase\count@
505 \Tiny\or\Tiny\or\tiny\or\SMALL\or\Small\or\small
506 \or\normalsize
507 \or\large\or\Large\or\LARGE\or\huge\or\Huge\else\Huge
508 \fi
509 }
510 \newcommand{\smaller}[1][1]{\larger[-#1]}
511 % \end{macrocode}
512 % \end{macro}
513 % \end{macro}
514 %
515 % The \cs{@adjustvertspacing} function adapts some vertical spacing
516 % amounts to the current type size. We don't expect large sections of
517 % vertical text to occur in the extraordinarily small or large type
518 % sizes, so the \cs{@adjustvertspacing} function is only called in
519 % the range between `footnote' size and `Large' size. Notice that no
520 % shrinkability is used.
521 % \begin{macrocode}
522 \def\@adjustvertspacing{%
523 % \end{macrocode}
524 % \cs{big/med/smallskipamount} are generic space values that will be
525 % used by the commands \cn{bigskip}, \cn{medskip}, \cn{smallskip}. We
526 % also link the spacing around displayed equations to these amounts.
527 % \begin{macrocode}
528 \bigskipamount.7\baselineskip plus.7\baselineskip
529 \medskipamount\bigskipamount \divide\medskipamount\tw@
530 \smallskipamount\medskipamount \divide\smallskipamount\tw@
531 \abovedisplayskip\medskipamount
532 \belowdisplayskip \abovedisplayskip
533 % \end{macrocode}
534 % The above-display short space is zero but with the same
535 % stretchability as the above-display normal space. And the
536 % below-display short space is similar, but has a base value equal to
537 % \cs{smallskipamount}. Use of the multiplier |1| is an arcane \TeX{}
538 % trick that coerces the skip value to a dimen value, i.e., gives us
539 % the base value of the skip register without the stretch or shrink
540 % values.
541 % \begin{macrocode}
542 \abovedisplayshortskip\abovedisplayskip
543 \advance\abovedisplayshortskip-1\abovedisplayskip
544 \belowdisplayshortskip\abovedisplayshortskip
545 \advance\belowdisplayshortskip 1\smallskipamount
546 % \end{macrocode}
547 % The traditional value for \cs{jot} is 3pt, which we generalize
548 % to \cs{baselineskip}/4. This is used to adjust interline spacing in
549 % multiline displayed equations.
550 % \begin{macrocode}
551 \jot\baselineskip \divide\jot 4 \relax
552 }
553 % \end{macrocode}%
554 %
555 % We fill out the range of typesize changing commands to a full
556 % eleven: five large/huge commands and five small/tiny commands. (The
557 % capitalization of the command names suggests that there should
558 % actually be thirteen---add \cn{TINY} and \cn{HUGE}---but let's be
559 % conservative and leave those out until a real need for them is
560 % known to exist.) An unavoidable side effect is that \cn{tiny} now
561 % selects 6pt instead of 5pt by default.
562 %
563 % In version 1.1 of \cls{amsart} and \cls{amsbook} \cn{small} was
564 % the same as \cn{footnotesize} (\cls{amsproc} didn't exist in v. 1.1).
565 %
566 % The only size-changing command that is predefined by \latex/ is
567 % \cn{normalsize}; that's why it's the only one for which we use
568 % \cn{renewcommand} below.
569 % \begin{macrocode}
570 \renewcommand\normalsize{\@xsetfontsize\normalsize 6%
571 \@adjustvertspacing \let\@listi\@listI}
572 \DeclareRobustCommand{\Tiny}{\@xsetfontsize\Tiny 1}
573 \DeclareRobustCommand{\tiny}{\@xsetfontsize\tiny 2}
574 \DeclareRobustCommand{\SMALL}{\@xsetfontsize\SMALL 3}
575 \DeclareRobustCommand{\Small}{\@xsetfontsize\Small 4%
576 \@adjustvertspacing
577 \def\@listi{\topsep\smallskipamount \parsep\z@skip \itemsep\z@skip
578 \leftmargin=\leftmargini
579 \labelwidth=\leftmargini \advance\labelwidth-\labelsep
580 }%
581 }
582 \DeclareRobustCommand{\small}{\@xsetfontsize\small 5\@adjustvertspacing}
583 % \end{macrocode}
584 % For backward compatibility we had better define \cn{footnotesize}
585 % and \cn{scriptsize}. Also there is the small discrepancy with
586 % \cn{tiny} to worry about.
587 % \begin{macrocode}
588 \def\footnotesize{\Small}
589 \def\scriptsize{\SMALL}
590 % \end{macrocode}
591 %
592 % The sizes above 10pt use magstep values, stored in the functions
593 % \cs{@xipt}, \cs{@xiipt}, etc.
594 % \begin{macrocode}
595 \DeclareRobustCommand{\large}{\@xsetfontsize\large 7\@adjustvertspacing}
596 \DeclareRobustCommand{\Large}{\@xsetfontsize\Large 8\@adjustvertspacing}
597 \DeclareRobustCommand{\LARGE}{\@xsetfontsize\LARGE 9}
598 \DeclareRobustCommand{\huge}{\@xsetfontsize\huge{10}}
599 \DeclareRobustCommand{\Huge}{\@xsetfontsize\Huge{11}}
600 %\DeclareRobustCommand\HUGE{\@xsetfontsize\HUGE{12}}
601 % \end{macrocode}
602 %
603 % So now we had better define the \cs{@xsetfontsize} function.
604 % The size-changing commands use \cs{@setfontsize} instead of
605 % \cn{fontsize} to (a)~give an error message if used in math mode and
606 % (b)~set the \cs{@currsize} variable.
607 % \begin{macrocode}
608 \def\@xsetfontsize#1#2{%
609 \chardef\@currsizeindex#2\relax
610 \edef\@tempa{\@nx\@setfontsize\@nx#1%
611 \@xp\ifcase\@xp\@currsizeindex\@typesizes
612 % \end{macrocode}
613 % Add nonsense values 99/99 at the end just in case some extreme
614 % error turns up.
615 % \begin{macrocode}
616 \else{99}{99}\fi}%
617 \@tempa
618 }
619 % \end{macrocode}
620 % For the record let's initialize \cs{@currsizeindex}.
621 % \begin{macrocode}
622 \chardef\@currsizeindex=6
623 % \end{macrocode}
624 %
625 % Set page-breaking penalties to prevent all widows, orphans, and
626 % hyphens at the end of a page.
627 % \begin{macrocode}
628 \widowpenalty=10000
629 \clubpenalty=10000
630 \brokenpenalty=10000
631 % \end{macrocode}
632 %
633 % Set some default linespacing values. The variable \cs{linespacing}
634 % is usually the normal interline space in the main text. It is used
635 % to specify vertical space for elements such as section heads and
636 % theorems in proportion to the normal interline space.
637 % \begin{macrocode}
638 \newdimen\linespacing
639 \lineskip=1pt \lineskiplimit=1pt
640 \normallineskip=1pt \normallineskiplimit=1pt
641 \let\baselinestretch=\@empty
642 % \end{macrocode}
643 %
644 % Settings for \cn{textheight} and \cn{textwidth}. We start with the
645 % value 50.5pc specified in AMS journal specifications as the total
646 % height of the type block and then subtract the running head height
647 % and adjust for \cs{topskip} to get the proper value for the text
648 % block.
649 % \begin{macrocode}
650 \headheight=8pt \headsep=14pt
651 %<amsbook>\footskip=18pt
652 %<amsart|amsproc>\footskip=12pt
653 \textheight=50.5pc \topskip=10pt
654 \textwidth=30pc
655 \columnsep=10pt \columnseprule=0pt
656 % \end{macrocode}
657 % Some settings for marginpars.
658 % \begin{macrocode}
659 \marginparwidth=90pt
660 \marginparsep=11pt
661 \marginparpush=5pt
662 % \end{macrocode}
663 % To avoid setting text before begin-document, we postpone the
664 % setting of \cs{footnotesep} using \cs{AtBeginDocument}.
665 % \begin{macrocode}
666 \AtBeginDocument{\settoheight{\footnotesep}{\footnotesize M$^1$}}
667 % \end{macrocode}
668 %
669 % \begin{macrocode}
670 \skip\footins=7pt plus11pt
671 \skip\@mpfootins=\skip\footins
672 % \end{macrocode}
673 %
674 % \begin{macrocode}
675 \fboxsep=3pt \fboxrule=.4pt
676 % \end{macrocode}
677 %
678 % \begin{macrocode}
679 \arrayrulewidth=.4pt \doublerulesep=2pt
680 \labelsep=5pt \arraycolsep=\labelsep
681 \tabcolsep=\labelsep \tabbingsep=\labelsep
682 % \end{macrocode}
683 %
684 % \begin{macrocode}
685 \floatsep=15pt plus 12pt \dblfloatsep=15pt plus 12pt
686 \textfloatsep=\floatsep \dbltextfloatsep=15pt plus 12pt
687 \intextsep=\floatsep
688 % \end{macrocode}
689 %
690 % \begin{macrocode}
691 \@fptop=0pt plus1fil \@dblfptop=0pt plus1fil
692 \@fpbot=0pt plus1fil \@dblfpbot=0pt plus1fil
693 \@fpsep=8pt plus2fil \@dblfpsep=8pt plus2fil\relax
694 % \end{macrocode}
695 % Note that \cs{parskip} gets no stretch; this is at variance with
696 % the generic \latex/ classes.
697 % \begin{macrocode}
698 \parskip=0pt \relax
699 % \end{macrocode}
700 %
701 % \cs{@parboxrestore}, used by \cs{@footnotetext}, sets
702 % \cs{parindent} to |0pt|; since this is not what we want, we
703 % make a new dimen \cs{normalparindent} and after calling
704 % \cs{@parboxrestore}, \cs{@footnotetext} resets
705 % \cs{parindent} back to normal.
706 % \begin{macrocode}
707 \newdimen\normalparindent
708 %<amsart>\normalparindent=12pt
709 %<amsproc|amsbook>\normalparindent=18pt
710 \parindent=\normalparindent
711 % \end{macrocode}
712 %
713 % \begin{macrocode}
714 \partopsep=0pt \relax \parsep=0pt \relax \itemsep=0pt \relax
715 % \end{macrocode}
716 %
717 % \begin{macrocode}
718 \@lowpenalty=51 \@medpenalty=151 \@highpenalty=301
719 \@beginparpenalty=-\@lowpenalty
720 \@endparpenalty=-\@lowpenalty
721 \@itempenalty=-\@lowpenalty
722 % \end{macrocode}
723 %
724 % \subsubsection{Typesize-specific code}
725 %
726 % The class option \opt{12pt} sets the main typesize to 12 pt and
727 % makes various adaptations, primarily sliding the size-changing
728 % commands up the scale of magsteps. This makes it more likely that
729 % someone with bitmapped fonts will have all the fonts and sizes
730 % that they need. The \opt{8pt} option is for those who like to
731 % conserve paper.
732 %
733 % By parameterizing some aspects it is possible to make a great deal
734 % of the typesize-specific code automatically adapt to the selected
735 % size. Then there is so little typesize-specific code remaining
736 % that it no longer makes sense to put the code in separate \fn{.clo}
737 % files. So instead of analogs for the generic \fn{size10,11,12.clo}
738 % files we have the code for those options entirely contained in the
739 % \fn{.cls} file in the form of declared options.
740 %
741 % Some miscellaneous remarks.
742 %
743 % ---If PostScript fonts are used, it may seem a little strange to
744 % use fonts following the magstep'd point sizes 10.95, 14.4, 17.28,
745 % 20.74, 24.88 instead of simply 11, 14, 17, 21, 25. But it is not
746 % easy for us to make that distinction here in the document class
747 % definitions of the fontsize changing commands. So we don't try.
748 %
749 % \begin{macrocode}
750 \DeclareOption{10pt}{\def\@mainsize{10}\def\@ptsize{0}%
751 \def\@typesizes{%
752 % \end{macrocode}
753 % There should be 11 typesize/baselineskip pairs: five below
754 % \cn{normalsize} and five above.
755 % \begin{macrocode}
756 \or{5}{6}\or{6}{7}\or{7}{8}\or{8}{10}\or{9}{11}%
757 \or{10}{12}% normalsize
758 \or{\@xipt}{13}\or{\@xiipt}{14}\or{\@xivpt}{17}%
759 \or{\@xviipt}{20}\or{\@xxpt}{24}}%
760 \normalsize \linespacing=\baselineskip
761 }
762 %
763 \DeclareOption{11pt}{\def\@mainsize{11}\def\@ptsize{1}%
764 \def\@typesizes{%
765 \or{6}{7}\or{7}{8}\or{8}{10}\or{9}{11}\or{10}{12}%
766 \or{\@xipt}{13}% normalsize
767 \or{\@xiipt}{14}\or{\@xivpt}{17}\or{\@xviipt}{20}%
768 \or{\@xxpt}{24}\or{\@xxvpt}{30}}%
769 \normalsize \linespacing=\baselineskip
770 }
771 %
772 \DeclareOption{12pt}{\def\@mainsize{12}\def\@ptsize{2}%
773 \def\@typesizes{%
774 \or{7}{8}\or{8}{10}\or{9}{11}\or{10}{12}\or{\@xipt}{13}%
775 \or{\@xiipt}{14}% normalsize
776 \or{\@xivpt}{17}\or{\@xviipt}{20}\or{\@xxpt}{24}%
777 \or{\@xxvpt}{30}\or{\@xxvpt}{30}}%
778 \normalsize \linespacing=\baselineskip
779 }
780 %
781 \DeclareOption{8pt}{\def\@mainsize{8}\def\@ptsize{8}%
782 \def\@typesizes{%
783 \or{5}{6}\or{5}{6}\or{5}{6}\or{6}{7}\or{7}{8}%
784 \or{8}{10}% normalsize
785 \or{9}{11}\or{10}{12}\or{\@xipt}{13}%
786 \or{\@xiipt}{14}\or{\@xivpt}{17}}%
787 \normalsize \linespacing=\baselineskip
788 }
789 %
790 \DeclareOption{9pt}{\def\@mainsize{9}\def\@ptsize{9}%
791 \def\@typesizes{%
792 \or{5}{6}\or{5}{6}\or{6}{7}\or{7}{8}\or{8}{10}%
793 \or{9}{11}% normalsize
794 \or{10}{12}\or{\@xipt}{13}\or{\@xiipt}{14}%
795 \or{\@xivpt}{17}\or{\@xviipt}{20}}%
796 \normalsize \linespacing=\baselineskip
797 }
798 % \end{macrocode}
799 %
800 % \subsubsection{Running heads}
801 % The normal application of pagestyle functions \cs{ps@xxx} is to
802 % determine the contents of running heads and feet. The function
803 % \cs{@mkboth} is used internally by commands \cn{chapter},
804 % \cn{section}, and the like to set the running heads.
805 % \begin{macrocode}
806 \def\ps@empty{\let\@mkboth\@gobbletwo
807 \let\@oddhead\@empty \let\@evenhead\@empty
808 \let\@oddfoot\@empty \let\@evenfoot\@empty
809 % \end{macrocode}
810 % The current implementation in \cls{amsart}/\cls{amsproc}/\cls{amsbook}
811 % of the vertical space at the top of an opening page uses \cs{topskip},
812 % which means that we need to do some resetting here.
813 % \begin{macrocode}
814 \global\topskip\normaltopskip}
815 % \end{macrocode}
816 % Pagestyle `plain' has the page numbers in the running feet.
817 % \begin{macrocode}
818 \def\ps@plain{\ps@empty
819 \def\@oddfoot{\normalfont\scriptsize \hfil\thepage\hfil}%
820 \let\@evenfoot\@oddfoot}
821 % \end{macrocode}
822 %
823 % Pagestyle `headings' uses text from sectioning commands for
824 % running heads. Empty running feet.
825 % \begin{macrocode}
826 \newswitch{runhead}
827 % \end{macrocode}
828 %
829 % \begin{macrocode}
830 \def\ps@headings{\ps@empty
831 \def\@evenhead{%
832 \setTrue{runhead}%
833 \normalfont\scriptsize
834 \rlap{\thepage}\hfil
835 \def\thanks{\protect\thanks@warning}%
836 \leftmark{}{}\hfil}%
837 \def\@oddhead{%
838 \setTrue{runhead}%
839 \normalfont\scriptsize \hfil
840 \def\thanks{\protect\thanks@warning}%
841 \rightmark{}{}\hfil \llap{\thepage}}%
842 \let\@mkboth\markboth
843 %<*amsbook>
844 \def\partmark{\@secmark\markboth\partrunhead\partname}%
845 \def\chaptermark{%
846 \@secmark\markboth\chapterrunhead{}}%
847 \def\sectionmark{%
848 \@secmark\markright\sectionrunhead\sectionname}%
849 %</amsbook>
850 }
851 % \end{macrocode}
852 %
853 % \begin{macro}{\sectionname}
854 % \begin{macro}{\subsectionname}
855 % \begin{macro}{\subsubsectionname}
856 % \begin{macro}{\paragraphname}
857 % \begin{macro}{\subparagraphname}
858 % Initialize section headings.
859 % \begin{macrocode}
860 \let\sectionname\@empty
861 \let\subsectionname\@empty
862 \let\subsubsectionname\@empty
863 \let\paragraphname\@empty
864 \let\subparagraphname\@empty
865 % \end{macrocode}
866 % \end{macro}
867 % \end{macro}
868 % \end{macro}
869 % \end{macro}
870 % \end{macro}
871 %
872 % The default definitions of \cs{leftmark}, \cs{rightmark} are not
873 % what we want: the section title (or whatever) reported in the
874 % right-hand running head should report the section that is current
875 % at the bottom of the right-hand page. And the left-hand running
876 % head should report the status at the top of the page.
877 % Cf.~\fn{amsppt.sty}.
878 % \begin{macrocode}
879 \def\leftmark{\expandafter\@firstoftwo\topmark{}{}}
880 \def\rightmark{\expandafter\@secondoftwo\botmark{}{}}
881 % \end{macrocode}
882 %
883 % Journal and Proceedings articles require an indication of the first
884 % page so the logo and copyright line can appear.
885 % \begin{macrocode}
886 %<*amsart|amsproc>
887 \def\ps@firstpage{\ps@plain
888 \def\@oddfoot{\normalfont\scriptsize \hfil\thepage\hfil
889 % \end{macrocode}
890 % Stick in the reset of \cs{topskip} here so it only gets executed
891 % after the first page is completed.
892 % \begin{macrocode}
893 \global\topskip\normaltopskip}%
894 \let\@evenfoot\@oddfoot
895 \def\@oddhead{\@serieslogo\hss}%
896 \let\@evenhead\@oddhead % in case an article starts on a left-hand page
897 }
898 %</amsart|amsproc>
899 % \end{macrocode}
900 %
901 % \begin{macro}{\@nilgobble}
902 % Something that apparently doesn't exist in the kernel?
903 % \begin{macrocode}
904 \long\def\@nilgobble#1\@nil{}
905 % \end{macrocode}
906 % \end{macro}
907 %
908 % A general section-marking function. Arg 1 is either \cn{markright}
909 % or \cn{markboth} indicating which kind of marking action is desired
910 % (this gives us some string pool/hash table savings by allowing the
911 % \cs{@secmark} function to serve for both cases). Arg 2 is the
912 % function that should be called in the running head to process the
913 % remaining three args. Arg 3 is normally \cs{xxxname} (but could be
914 % empty). Arg 4 is the section-title text. Assumption: whenever
915 % \cs{@secmark} is called, the section-number variable
916 % \cs{@secnumber} has been set to the value of the current section
917 % number (possibly empty, in the case of a |*| section for example).
918 % \begin{macrocode}
919 %<*amsbook>
920 \def\@secmark#1#2#3#4{%
921 % \end{macrocode}
922 % We want to apply expansion to \cs{xxxname} and \cs{thexxx} but not
923 % to the other elements.
924 % \begin{macrocode}
925 \begingroup \let\protect\@unexpandable@protect
926 \edef\@tempa{\endgroup \toks@{\protect#2{#3}{\@secnumber}}}%
927 \@tempa
928 \toks@\@xp{\the\toks@{#4}}%
929 % \end{macrocode}
930 % If a \cn{markright} operation is called for, use the current
931 % left-mark via \cs{@temptokena}.
932 % \begin{macrocode}
933 \afterassignment\@nilgobble\@temptokena\@themark{}\@nil
934 \edef\@tempa{\@nx\@mkboth{%
935 \ifx\markright#1\the\@temptokena\else\the\toks@\fi}{\the\toks@}}%
936 \@tempa}
937 % \end{macrocode}
938 % Init \cs{@secnumber}.
939 % \begin{macrocode}
940 \let\@secnumber\@empty
941 %</amsbook>
942 % \end{macrocode}
943 %
944 % Fix \cn{markboth} so that \cs{@secmark} can work without too much
945 % thrashing.
946 % \begin{macrocode}
947 \def\markboth#1#2{%
948 \begingroup
949 \@temptokena{{#1}{#2}}\xdef\@themark{\the\@temptokena}%
950 \mark{\the\@temptokena}%
951 \endgroup
952 \if@nobreak\ifvmode\nobreak\fi\fi}
953 % \end{macrocode}
954 %
955 % With the myheadings pagestyle, no automatic running heads will be
956 % provided by the document class; only running heads specified by
957 % the user through explicit \cn{markboth} or \cn{markright}
958 % commands will be used.
959 % \begin{macrocode}
960 \def\ps@myheadings{\ps@headings \let\@mkboth\@gobbletwo}
961 % \end{macrocode}
962 %
963 % Save normal topskip value in a skip register.
964 % \begin{macrocode}
965 \newskip\normaltopskip
966 \normaltopskip=10pt \relax
967 % \end{macrocode}
968 %
969 % We also want to turn off all section marks. First-level section
970 % heads will be defined in \cs{ps@headings}.
971 % \begin{macrocode}
972 \let\sectionmark\@gobble
973 \let\subsectionmark\@gobble
974 \let\subsubsectionmark\@gobble
975 \let\paragraphmark\@gobble
976 % \end{macrocode}
977
978 % \subsubsection{Unrecognized options}
979 %
980 % The \opt{makeidx} option is redundant; everything that it does in
981 % the generic \latex/ classes is already done anyway in this class.
982 % \begin{macrocode}
983 \DeclareOption{makeidx}{}
984 %</classes>
985 % \end{macrocode}
986 %
987 % Unrecognized options for \pkg{amsthm} are treated as references
988 % to auxiliary theorem setup (\fn{.thm}) files. This allows a user
989 % to create theorem styles using internal commands (with |@| signs)
990 % without having to be concerned about category coding.
991 %
992 % Here is an example from the file \fn{thmtest.tex} which is part
993 % of this collection. See that file for further information.
994 %\begin{verbatim}
995 % \begin{filecontents}{exercise.thm}
996 % \def\th@exercise{%
997 % \normalfont % body font
998 % \thm@headpunct{:}%
999 % }
1000 % \end{filecontents}
1001 %\end{verbatim}
1002 %
1003 % This facility is available only when \pkg{amsthm} is used as an
1004 % independent package, not as part of an AMS document class.
1005 % \begin{macrocode}
1006 %<*amsthm>
1007 \DeclareOption*{\input{\CurrentOption .thm}}
1008 \ProcessOptions
1009 %</amsthm>
1010 % \end{macrocode}
1011 %
1012 % \subsection{Process options}
1013 %
1014 % Black boxes for overfull lines are turned off by default (the
1015 % \opt{final} option). This can be overridden with the \opt{draft}
1016 % option.
1017 % \begin{macrocode}
1018 %<*classes>
1019 \ExecuteOptions{leqno,centertags,letterpaper,portrait,%
1020 10pt,twoside,onecolumn,final}
1021 % \end{macrocode}
1022 % Options will be processed in the order of the associated
1023 % \cs{DeclareOption} commands.
1024 % \begin{macrocode}
1025 \ProcessOptions\relax
1026 % \end{macrocode}
1027 %
1028 % In compatibility mode, we want to load the frozen version of
1029 % \fn{amstex.sty} instead of the \pkg{amsmath} package. This is
1030 % rather a horrible kluge but I can't see anything better at the
1031 % moment. [mjd,1995/01/27]
1032 % \begin{macrocode}
1033 \if@compatibility
1034 \def\@tempa{\RequirePackage{amstex}\relax}%
1035 \else
1036 \@ifclasswith{\@classname}{nomath}{%
1037 \let\@tempa\relax
1038 }{%
1039 \def\@tempa{\RequirePackage{amsmath}\relax}%
1040 }%
1041 \fi
1042 \@tempa % load amstex.sty or amsmath.sty
1043 % \end{macrocode}
1044 % If the \opt{nomath} option was specified, then \cn{numberwithin}
1045 % and \cs{@emptytoks} remain to be defined.
1046 % \begin{macrocode}
1047 \@ifundefined{numberwithin}{%
1048 \newcommand{\numberwithin}[3][\arabic]{%
1049 \@ifundefined{c@#2}{\@nocounterr{#2}}{%
1050 \@ifundefined{c@#3}{\@nocnterr{#3}}{%
1051 \@addtoreset{#2}{#3}%
1052 \@xp\xdef\csname the#2\endcsname{%
1053 \@xp\@nx\csname the#3\endcsname .\@nx#1{#2}}}}%
1054 }
1055 \csname newtoks\endcsname\@emptytoks
1056 }{}
1057 % \end{macrocode}
1058 %
1059 % If the \opt{noamsfonts} option was called for, skip the
1060 % \pkg{amsfonts} package load.
1061 % \begin{macrocode}
1062 \if@compatibility
1063 \else
1064 \@ifclasswith{\@classname}{noamsfonts}{%
1065 % amsfonts package is not wanted
1066 }{%
1067 % amsfonts package IS wanted; test whether a recent enough version
1068 % seems to be installed
1069 \begingroup \fontencoding{U}\fontfamily{msa}\try@load@fontshape\endgroup
1070 \global\@xp\let\csname U+msa\endcsname\relax % reset
1071 \@ifundefined{U/msa/m/n}{%
1072 \ClassError{\@classname}{%
1073 Package `amsfonts' not installed, or version too old?\MessageBreak
1074 Unable to get font info for the `msam' fonts in the expected form%
1075 }{%
1076 The amsfonts package will not be loaded, to avoid probable\MessageBreak
1077 incompatibility problems. You can (a) use the `noamsfonts'
1078 documentclass\MessageBreak
1079 option next time, or (b) check that the amsfonts package is
1080 installed\MessageBreak
1081 correctly, and is not too old to be compatible.%
1082 }%
1083 }{%
1084 \RequirePackage{amsfonts}[1995/01/01]\relax
1085 }%
1086 }
1087 \fi % end yesamsfonts branch
1088 % \end{macrocode}
1089 %
1090 % \subsection{Basic AMS style features}
1091 %
1092 % AMS style requires that blank pages between chapters be \emph{really}
1093 % blank: no running heads, no page numbers. To accomplish this,
1094 % redefine \cn{cleardoublepage} to do the right thing. [bnb, 1999/07/17]
1095 % \begin{macrocode}
1096 \let\cleardouble@page\cleardoublepage
1097 % \end{macrocode}
1098 % Postpone the redefinition of \cs{cleardoublepage} to begin-document
1099 % to work around difficulties with old versions of \fn{gsm-l.cls}.
1100 % \begin{macrocode}
1101 \AtBeginDocument{%
1102 \ifx\cleardouble@page\cleardoublepage
1103 \def\cleardoublepage{\clearpage{\pagestyle{empty}\cleardouble@page}}
1104 \fi
1105 }
1106 % \end{macrocode}
1107 %
1108 % Now a utility macro to do \cn{uppercase} but sidestep any math, to
1109 % prevent uppercasing math variables. In order to be handled properly
1110 % the |$...$| or |\(...\)| must be on the outer level (not
1111 % enclosed in braces). We did not try to handle the possibility
1112 % |\begin{math}| |...| |\end{math}| in a title at the present time (too
1113 % complicated). Also we increase inter-word space in the uppercase
1114 % text.
1115 %
1116 % One other little problem: uppercasing of a few special characters
1117 % like the German {\ss} (\cn{ss}) and the undotted i and j (\cn{i}
1118 % and \cn{j}), used sometimes with accents. We redefine them to be
1119 % uppercase equivalents. (Undotted \cn{i} and \cn{j} in math would be
1120 % typed as \cn{imath} and \cn{jmath}.)
1121 %
1122 % Spaceskip is changed in accordance with recommendations for
1123 % increased interword spacing in all-caps text by e.g.\ `Words into
1124 % Type'.
1125 % \begin{macrocode}
1126 \newcommand{\uppercasenonmath}[1]{\toks@\@emptytoks
1127 % Insert an extra \@empty to avoid removing braces around arg \arg{1}.
1128 \@xp\@skipmath\@xp\@empty#1$$%
1129 % \end{macrocode}
1130 % The \cs{protect} here is in case the shorttitle gets used for
1131 % shortauthors and we get redundant application of \cn{MakeUppercase}.
1132 % Double braces limit the scope so that later elements in title block
1133 % aren't uppercased, e.g., \cn{i} in an address. [bnb, 2004/04/01]
1134 % \begin{macrocode}
1135 \edef#1{{\@nx\protect\@nx\@upprep\the\toks@}}%
1136 }
1137 % \end{macrocode}
1138 %
1139 % \begin{macro}{\@upprep}
1140 % Preparations for printing all-caps text.
1141 % \begin{macrocode}
1142 \newcommand{\@upprep}{%
1143 \spaceskip1.3\fontdimen2\font plus1.3\fontdimen3\font
1144 \upchars@}
1145 % \end{macrocode}
1146 % \end{macro}
1147 %
1148 % \begin{macro}{\upchars@}
1149 % In all-caps text, esszet should print as SS, dotless i should print
1150 % as normal cap I, Mc should print with a small-caps (not lowercase)
1151 % c, and so forth.
1152 % \begin{macrocode}
1153 \newcommand{\upchars@}{%
1154 \def\ss{SS}\def\i{I}\def\j{J}\def\ae{\AE}\def\oe{\OE}%
1155 \def\o{\O}\def\aa{\AA}\def\l{\L}\def\Mc{M{\scshape c}}}
1156 % \end{macrocode}
1157 % \end{macro}
1158 %
1159 % \begin{macro}{\Mc}
1160 % The use of \cn{Mc} makes it possible for `Mc' to get special
1161 % treatment when uppercasing is applied.
1162 % \begin{macrocode}
1163 \providecommand{\Mc}{Mc}
1164 % \end{macrocode}
1165 % \end{macro}
1166 %
1167 % \begin{macro}{\@skipmath}
1168 % \begin{macro}{\@xskipmath}
1169 % \cs{@skipmath} searches for |$...$| in order to keep from applying
1170 % \cn{uppercase} to the contents. Then it calls \cs{@xskipmath} to
1171 % search for |\(...\)|.
1172 % \begin{macrocode}
1173 \newcommand{\@skipmath}{}
1174 \long\def\@skipmath#1$#2${%
1175 \@xskipmath#1\(\)%
1176 \@ifnotempty{#2}{\toks@\@xp{\the\toks@$#2$}\@skipmath\@empty}}%
1177 %
1178 \newcommand{\@xskipmath}{}
1179 \long\def\@xskipmath#1\(#2\){%
1180 % Expand away the added \@empty
1181 \uppercase{\toks@\@xp\@xp\@xp{\@xp\the\@xp\toks@#1}}%
1182 \@ifnotempty{#2}{\toks@\@xp{\the\toks@\(#2\)}\@xskipmath\@empty}}%
1183 % \end{macrocode}
1184 % \end{macro}
1185 % \end{macro}
1186 %
1187 % \begin{macro}{\altucnm}
1188 % \begin{macrocode}
1189 \def\altucnm#1{%
1190 \MakeTextUppercase{\toks@{#1}}%
1191 \edef#1{\the\toks@}%
1192 }
1193 \AtBeginDocument{%
1194 \@ifundefined{MakeTextUppercase}{}{\let\uppercasenonmath\altucnm}%
1195 }
1196 % \end{macrocode}
1197 % \end{macro}
1198 %
1199 % For older versions of \latex/ this might be needed too:
1200 % \begin{macrocode}
1201 \@ifundefined{MakeUppercase}{\let\MakeUppercase\uppercase}{}%
1202 % \end{macrocode}
1203 %
1204 % \begin{macro}{\today}
1205 % The command \cn{today} produces today's date in the form most
1206 % commonly used in the U.S.
1207 % \begin{macrocode}
1208 \newcommand{\today}{%
1209 \relax\ifcase\month\or
1210 January\or February\or March\or April\or May\or June\or
1211 July\or August\or September\or October\or November\or December\fi
1212 \space\number\day, \number\year}
1213 % \end{macrocode}
1214 % \end{macro}
1215 %
1216 % \subsection{Old font commands}
1217 % The \cn{em} command is not redefined here (let's say, to give an
1218 % `obsolete' warning and recommend instead \cn{emph}) because there
1219 % is no alternative internal command \cs{emshape}.
1220 % \begin{macrocode}
1221 \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
1222 \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
1223 \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
1224 \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
1225 \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
1226 \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
1227 \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
1228 % \end{macrocode}
1229 %
1230 % This warning might have been a good idea back in 1995 but I don't
1231 % think we can add it now [mjd,2000/03/10].
1232 %\begin{verbatim}
1233 %%\if@compatibility
1234 %%\else
1235 %% \def\@obsolete@fontswitch#1#2#3{%
1236 %% \@latex@warning@no@line{%
1237 %% Command {\string#1...}\on@line\space is obsolete;\MessageBreak
1238 %% the LaTeX2e equivalent is \string#3{...}}%
1239 %% \gdef#1{\@fontswitch\relax#3}%
1240 %% }
1241 %% \DeclareRobustCommand*\cal{%
1242 %% \@xp\@obsolete@fontswitch\csname cal \endcsname\relax\mathcal}
1243 %% \DeclareRobustCommand*\mit{%
1244 %% \@xp\@obsolete@fontswitch\csname mit \endcsname\relax\mathnormal}
1245 %%\fi
1246 %\end{verbatim}
1247 % There's too great a chance that some people out there have
1248 % documents that begin with
1249 %\begin{verbatim}
1250 %\documentclass{amsart}
1251 %...
1252 %\newcommand{\cal}{\mathcal}
1253 %\end{verbatim}
1254 % and such documents would now get error messages.
1255 %
1256 % Since \cs{cal} is not documented as a valid command for \LaTeXe/, I
1257 % think it is OK to leave the status as is for AMS document classes.
1258 % If you use \cs{documentstyle}, \cs{cal} will work. If you use
1259 % \cs{documentclass}, well, it's a good idea to update to
1260 % \cs{mathcal} instead of leaving old instances of \cs{cal}.
1261 %
1262 % \subsection{Top matter}
1263 % For the \cn{title} command, we support an optional argument to give
1264 % a shortened version of the title for running heads.
1265 % \begin{macrocode}
1266 \renewcommand*{\title}[2][]{\gdef\shorttitle{#1}\gdef\@title{#2}}
1267 % \end{macrocode}
1268 % The default value for the optional argument is `same as the
1269 % mandatory arg' but there doesn't seem to be an easy way to get that
1270 % effect with \ncn{[re]newcommand}. Here is how to use \cs{@dblarg}
1271 % in conjunction with the preceding \cn{newcommand}:
1272 % \begin{macrocode}
1273 \edef\title{\@nx\@dblarg
1274 \@xp\@nx\csname\string\title\endcsname}
1275 % \end{macrocode}
1276 % The \cn{author} command accepts an optional argument similar to
1277 % that of the \cn{title} command.
1278 % Moved update of \cn{addresses} within scope of \cs{else} to avoid
1279 % adding anything if no authors, and thus avoiding output of ``Author
1280 % address'' on monograph titlepage. [bnb, 1996/11/03]
1281 % \begin{macrocode}
1282 \renewcommand{\author}[2][]{%
1283 \ifx\@empty\authors
1284 \gdef\authors{#2}%
1285 \else
1286 \g@addto@macro\authors{\and#2}%
1287 \g@addto@macro\addresses{\author{}}%
1288 \fi
1289 \@ifnotempty{#1}{%
1290 \ifx\@empty\shortauthors
1291 \gdef\shortauthors{#1}%
1292 \else
1293 \g@addto@macro\shortauthors{\and#1}%
1294 \fi
1295 }%
1296 }
1297 \edef\author{\@nx\@dblarg
1298 \@xp\@nx\csname\string\author\endcsname}
1299 % \end{macrocode}
1300 % Initialize some variables.
1301 % \begin{macrocode}
1302 \let\shortauthors\@empty \let\authors\@empty
1303 % \end{macrocode}
1304 %
1305 % \begin{macro}{\contrib}
1306 %
1307 % Contributors are similar to authors except that they are responsible
1308 % for only part of a work, e.g., an appendix. The optional argument
1309 % for the first contributor of a group identifies what has been
1310 % contributed. There can be more than one group of contributors;
1311 % each group is treated separately, using the same ``and'' conventions
1312 % within the group as for authors. Contributor groups are strung
1313 % together separated by a comma; if the word ``and'' is desired before
1314 % the final group of contributors, it must be included in the optional
1315 % argument for that group.
1316 % \begin{macrocode}
1317 %<*amsart|amsproc>
1318 \newif\ifresetcontrib \resetcontribfalse
1319 \newcommand\contrib[2][]{%
1320 \def\@tempa{#1}%
1321 \ifx\@empty\@tempa
1322 \else
1323 \ifresetcontrib \@xcontribs
1324 \else \global\resetcontribtrue
1325 \fi
1326 \fi
1327 \ifx\@empty\contribs
1328 \gdef\contribs{#1 #2}%
1329 \else
1330 \g@addto@macro\contribs{\and#1 #2}%
1331 \fi
1332 % \end{macrocode}
1333 % Accumulate contribs separately for the table of contents. Here,
1334 % this is just a dummy; it is fully defined for in-house processing.
1335 % \begin{macrocode}
1336 \@wraptoccontribs{#1}{#2}%
1337 }
1338 \def\wraptoccontribs#1#2{}
1339 \def\@xcontribs{%
1340 \author@andify\contribs
1341 \ifx\@empty\xcontribs
1342 \xdef\xcontribs{\contribs}%
1343 \else
1344 \xdef\xcontribs{\xcontribs, \contribs}%
1345 \fi
1346 \let\contribs\@empty
1347 }
1348 % \end{macrocode}
1349 % \end{macro}
1350 %
1351 % Initialize some more variables.
1352 % \begin{macrocode}
1353 \let\contribs\@empty \let\xcontribs\@empty \let\toccontribs\@empty
1354 %</amsart|amsproc>
1355 \let\addresses\@empty \let\thankses\@empty
1356 % \end{macrocode}
1357 %
1358 % The optional arguments of \cn{address}, \cn{curraddr}, \cn{email}
1359 % are to indicate which author the address applies to, if a document
1360 % has multiple authors and there is not a normal one-to-one
1361 % correspondence between authors and addresses.
1362 % \begin{macrocode}
1363 \newcommand{\address}[2][]{\g@addto@macro\addresses{\address{#1}{#2}}}
1364 \newcommand{\curraddr}[2][]{\g@addto@macro\addresses{\curraddr{#1}{#2}}}
1365 \newcommand{\email}[2][]{\g@addto@macro\addresses{\email{#1}{#2}}}
1366 \newcommand{\urladdr}[2][]{\g@addto@macro\addresses{\urladdr{#1}{#2}}}
1367 % \end{macrocode}
1368 %
1369 % Someone who does not look closely at the \cls{amsart} documentation
1370 % is likely to put the \cn{thanks} command inside that argument of
1371 % \cn{author}.
1372 % \begin{macrocode}
1373 \long\def\thanks@warning#1{%
1374 \ClassError{\@classname}{%
1375 \protect\thanks\space should be given separately, not inside author name.%
1376 }\@ehb
1377 }
1378 % \end{macrocode}
1379 %
1380 % \begin{macrocode}
1381 \renewcommand{\thanks}[1]{%
1382 \@ifnotempty{#1}{\g@addto@macro\thankses{\thanks{#1}}}%
1383 }
1384 % \end{macrocode}
1385 %
1386 % The following example of addresses for three authors of a
1387 % tri-author paper illustrates the kind of complications that need to
1388 % be handled.
1389 %\begin{verbatim}
1390 % \author{Roland Campbell}
1391 % \address{Department of Mathematics\\
1392 % Pennsylvania State University\\
1393 % Pittsburgh, Pennsylvania 13593}
1394 % \email[R.~Campbell]{campr@@galois.psu.edu}
1395 %
1396 % \author{Mark M. Dane}
1397 % % Same address as R. Campbell
1398 % \curraddr[M.~Dane]{Atmospheric Research Station\\
1399 % Pala Lundi, Fiji}
1400 % \email[M.~Dane]{DaneMark@@ffr.choice}
1401 %
1402 % \author{Jeremiah Jones}
1403 % \address[J.~Jones]{Department of Philosophy\\
1404 % Freedman College\\
1405 % Periwinkle, Colorado 84320}
1406 % \email[J.~Jones]{id739e@@oseoi44 (Bitnet)}
1407 %\end{verbatim}
1408 % In an article, typesetting of the address information is done at
1409 % the end of the document, by calling \cs{@setaddresses}. This is done
1410 % through a parent function \cs{enddoc@text}, because some AMS journals
1411 % also print the abstract there instead of at the beginning, and it's
1412 % easier to redefine \cs{enddoc@text} than to try undoing material
1413 % already added to the \cs{AtEndDocument} hook.
1414 % \begin{macrocode}
1415 %<*amsart|amsproc>
1416 \def\enddoc@text{\ifx\@empty\@translators \else\@settranslators\fi
1417 \ifx\@empty\addresses \else\@setaddresses\fi}
1418 \AtEndDocument{\enddoc@text}
1419 %</amsart|amsproc>
1420 % \end{macrocode}
1421 %
1422 % \begin{macrocode}
1423 \def\curraddrname{{\itshape Current address}}
1424 \def\emailaddrname{{\itshape Email address}}
1425 \def\urladdrname{{\itshape URL}}
1426 \def\@setaddresses{\par
1427 \nobreak \begingroup
1428 %<amsart|amsproc>\footnotesize
1429 \def\author##1{\nobreak\addvspace\bigskipamount}%
1430 % \end{macrocode}
1431 % Address is supposed to go all on one line, so we redefine |\\|
1432 % to just insert a comma instead of doing a line break.
1433 % \begin{macrocode}
1434 \def\\{\unskip, \ignorespaces}%
1435 % \end{macrocode}
1436 % No page breaks in the address section is accomplished by
1437 % |\interlinepenalty\@M| and by the \cn{nobreak} before the \cn{bigskip}.
1438 % \begin{macrocode}
1439 \interlinepenalty\@M
1440 \def\address##1##2{\begingroup
1441 % \end{macrocode}
1442 % If there are two addresses for the same author, add a \cn{bigskip}
1443 % between them.
1444 % \begin{macrocode}
1445 \par\addvspace\bigskipamount\indent
1446 % \end{macrocode}
1447 % If the name of the author to whom this address applies
1448 % was given, typeset it.
1449 % \begin{macrocode}
1450 \@ifnotempty{##1}{(\ignorespaces##1\unskip) }%
1451 % \end{macrocode}
1452 % Now the main part of the address:
1453 % \begin{macrocode}
1454 {\scshape\ignorespaces##2}\par\endgroup}%
1455 % \end{macrocode}
1456 % Current address:
1457 % \begin{macrocode}
1458 \def\curraddr##1##2{\begingroup
1459 \@ifnotempty{##2}{\nobreak\indent\curraddrname
1460 \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
1461 ##2\par}\endgroup}%
1462 % \end{macrocode}
1463 % And then email. In versions 1.0 and 1.1 |@@| was required to print
1464 % a single \qc{\@} character; for bulletproofing we convert doubled
1465 % \qc{\@} characters if found.
1466 % \begin{macrocode}
1467 \def\email##1##2{\begingroup
1468 \@ifnotempty{##2}{\nobreak\indent\emailaddrname
1469 \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
1470 \ttfamily##2\par}\endgroup}%
1471 % \end{macrocode}
1472 % URLaddr is simply a replica of the email address, with the
1473 % addition of a feature to enable |~| to print.
1474 % \begin{macrocode}
1475 \def\urladdr##1##2{\begingroup
1476 \def~{\char`\~}%
1477 \@ifnotempty{##2}{\nobreak\indent\urladdrname
1478 \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
1479 \ttfamily##2\par}\endgroup}%
1480 \addresses
1481 \endgroup
1482 }
1483 % \end{macrocode}
1484 %
1485 % Some other administrative info. For \cn{date} we can just use the
1486 % default definition provided by \latex/, except that we initialize
1487 % the date to empty instead of to \cn{today}.
1488 % \begin{macrocode}
1489 \let\@date\@empty
1490 \def\dedicatory#1{\def\@dedicatory{#1}}
1491 \let\@dedicatory=\@empty
1492 \def\keywords#1{\def\@keywords{#1}}
1493 \let\@keywords=\@empty
1494 % \end{macrocode}
1495 %
1496 % To allow various versions of the subject classification, accept an
1497 % optional value to identify the version, provide text for the two
1498 % currently in use, and give a warning if the version specified is
1499 % unknown. Default to 2020 version.
1500 % \begin{macrocode}
1501 \newcommand*\subjclass[2][2020]{%
1502 \def\@subjclass{#2}%
1503 \@ifundefined{subjclassname@#1}{%
1504 \ClassWarning{\@classname}{Unknown edition (#1) of Mathematics
1505 Subject Classification; using '2020'.}%
1506 }{%
1507 \@xp\let\@xp\subjclassname\csname subjclassname@#1\endcsname
1508 }%
1509 }
1510 \let\@subjclass=\@empty
1511 %<amsart>\def\commby#1{\def\@commby{(Communicated by #1)}}
1512 %<amsart>\let\@commby=\@empty
1513 % \end{macrocode}
1514 %
1515 % We handle translator names like author names, just in case there is
1516 % more than one translator. [mjd,1994/10/19]
1517 % \begin{macrocode}
1518 \def\translname{Translated by}
1519 \def\translator#1{%
1520 \ifx\@empty\@translators \def\@translators{#1}%
1521 \else\g@addto@macro\@translators{\and#1}\fi}
1522 \let\@translators=\@empty
1523 % \end{macrocode}
1524 %
1525 % \begin{macrocode}
1526 %<*amsart|amsproc>
1527 \def\@settranslators{\par\begingroup
1528 \addvspace{6\p@\@plus9\p@}%
1529 \hbox to\columnwidth{\hss\normalfont\normalsize
1530 \translname{ }%
1531 \andify\@translators \uppercasenonmath\@translators
1532 \@translators}
1533 \endgroup
1534 }
1535 %</amsart|amsproc>
1536 % \end{macrocode}
1537 %
1538 % The general function to convert a list of items in the form
1539 %\begin{verbatim}
1540 % A\and B\and C\and D
1541 %\end{verbatim}
1542 % to the form `A, B, C, and D' is \cs{xandlist}:
1543 %\begin{verbatim}
1544 % \xandlist{, }{ and }{, and }{A\and B\and C\and D}
1545 %\end{verbatim}
1546 % This is a completely expandable macro, with the return value being
1547 % the converted list. There is also a `no-execute' version whose
1548 % fourth argument should be a macro; the text to be converted will be
1549 % taken from that macro and after conversion will be put back as the
1550 % macro's new replacement text.
1551 %\begin{verbatim}
1552 % \nxandlist{, }{ and }{, and }\result
1553 %\end{verbatim}
1554 % I don't think I want to explain this except by recommending that
1555 % you watch it in operation with \cs{tracingmacros} if you're
1556 % interested. [mjd,1994/10/19]
1557 % \begin{macrocode}
1558 \newcommand{\xandlist}[4]{\@andlista{{#1}{#2}{#3}}#4\and\and}
1559 \def\@andlista#1#2\and#3\and{\@andlistc{#2}\@ifnotempty{#3}{%
1560 \@andlistb#1{#3}}}
1561 \def\@andlistb#1#2#3#4#5\and{%
1562 \@ifempty{#5}{%
1563 \@andlistc{#2#4}%
1564 }{%
1565 \@andlistc{#1#4}\@andlistb{#1}{#3}{#3}{#5}%
1566 }}
1567 \let\@andlistc\@iden
1568 \newcommand{\nxandlist}[4]{%
1569 \def\@andlistc##1{\toks@\@xp{\the\toks@##1}}%
1570 \toks@{\toks@\@emptytoks \@andlista{{#1}{#2}{#3}}}%
1571 \the\@xp\toks@#4\and\and
1572 \edef#4{\the\toks@}%
1573 \let\@andlistc\@iden}
1574 % \end{macrocode}
1575 %
1576 % \begin{macro}{andify}
1577 %
1578 % The \cs{andify} function is provided as a convenient abbreviation
1579 % for the most common case. See also \cs{author@andify} (for
1580 % \cls{amsart} and \cls{amsproc} only), which gives better results
1581 % in cases with a large number of authors. Provide a substitutable
1582 % text string to simplify language-specific modifications.
1583 % \begin{macrocode}
1584 \def\@@and{and}
1585 \newcommand{\andify}{%
1586 \nxandlist{\unskip, }{\unskip{} \@@and~}{\unskip, \@@and~}}
1587 % \end{macrocode}
1588 % Override the funny default definition of \cn{and} from \latex/.
1589 % This is not actually used by AMS classes, however.
1590 % \begin{macrocode}
1591 \def\and{\unskip{ }\@@and{ }\ignorespaces}
1592 % \end{macrocode}
1593 % \end{macro}
1594 %
1595 % \begin{macro}{maketitle}
1596 %
1597 % Set up the style of an article opening page. For books, see below.
1598 % For articles, we must add the copyright info footnote.
1599 % \begin{macrocode}
1600 %<*amsart|amsproc>
1601 \def\maketitle{\par
1602 \@topnum\z@ % this prevents figures from falling at the top of page 1
1603 \@setcopyright
1604 \thispagestyle{firstpage}% this sets first page specifications
1605 % \end{macrocode}
1606 % Do some setup for the running heads here. If there are no author names,
1607 % we set the left-hand running head to the value of the right-hand running
1608 % head.
1609 % \begin{macrocode}
1610 \uppercasenonmath\shorttitle
1611 \ifx\@empty\shortauthors \let\shortauthors\shorttitle
1612 \else \andify\shortauthors
1613 \fi
1614 % \end{macrocode}
1615 % The following hook is used to activate the writing of author and
1616 % title information to an `issue table of contents' when multiple
1617 % articles are being processed for a journal issue or a proceedings
1618 % volume.
1619 % \begin{macrocode}
1620 \@maketitle@hook
1621 \begingroup
1622 \@maketitle
1623 \toks@\@xp{\shortauthors}\@temptokena\@xp{\shorttitle}%
1624 \toks4{\def\\{ \ignorespaces}}% defend against questionable usage
1625 \edef\@tempa{%
1626 \@nx\markboth{\the\toks4
1627 \@nx\MakeUppercase{\the\toks@}}{\the\@temptokena}}%
1628 \@tempa
1629 \endgroup
1630 \c@footnote\z@
1631 \@cleartopmattertags
1632 }
1633 \def\@cleartopmattertags{%
1634 \def\do##1{\let##1\relax}%
1635 \do\maketitle \do\@maketitle \do\title \do\@xtitle \do\@title
1636 \do\author \do\@xauthor \do\address \do\@xaddress
1637 \do\contrib \do\contribs \do\xcontribs \do\toccontribs
1638 \do\email \do\@xemail \do\curraddr \do\@xcurraddr
1639 %<amsart> \do\commby \do\@commby
1640 \do\dedicatory \do\@dedicatory \do\thanks \do\thankses
1641 \do\keywords \do\@keywords \do\subjclass \do\@subjclass
1642 }
1643 %</amsart|amsproc>
1644 % \end{macrocode}
1645 % \end{macro}
1646 %
1647 % The hook \cs{@maketitle@hook} is placed into \cn{maketitle} rather
1648 % than \cs{@maketitle} because the latter tends to get redefined by
1649 % derived classes using this one as a base. The initial motivation
1650 % for this hook is to extract title and author information to an
1651 % external file, so we can't do it with \cs{AtBeginDocument}:
1652 % \cn{title} and \cn{author} commands might occur between
1653 % \verb'\begin{document}' and \cn{maketitle}.
1654 %
1655 % \begin{macrocode}
1656 %<*amsart|amsproc>
1657 \def\@maketitle@hook{\global\let\@maketitle@hook\@empty}
1658 %</amsart|amsproc>
1659 % \end{macrocode}
1660 %
1661 % Set up the style of an article opening page.
1662 % \begin{macrocode}
1663 %<*amsart|amsproc>
1664 \def\@maketitle{%
1665 % \end{macrocode}
1666 % Set font to normal, just in case.
1667 % \begin{macrocode}
1668 \normalfont\normalsize
1669 % \end{macrocode}
1670 % Special footnotes are put here to ensure that they come first at
1671 % the bottom of the page.
1672 % \begin{macrocode}
1673 \@adminfootnotes
1674 % \end{macrocode}
1675 % If |\pagestyle{myheadings}| was specified, \cs{@mkboth} will be a no-op.
1676 % \begin{macrocode}
1677 \@mkboth{\@nx\shortauthors}{\@nx\shorttitle}%
1678 %<amsproc> \global\topskip8pc\relax % 10pc to base of first title line
1679 %<amsart> \global\topskip42\p@\relax % 5.5pc " " " " "
1680 \@settitle
1681 \ifx\@empty\authors \else \@setauthors \fi
1682 % \end{macrocode}
1683 % Likewise with \cs{@dedicatory} and \cs{@date}.
1684 % \begin{macrocode}
1685 \ifx\@empty\@dedicatory
1686 \else
1687 %<amsproc> \baselineskip26\p@
1688 %<amsart> \baselineskip18\p@
1689 \vtop{\centering{\footnotesize\itshape\@dedicatory\@@par}%
1690 \global\dimen@i\prevdepth}\prevdepth\dimen@i
1691 \fi
1692 \@setabstract
1693 % \end{macrocode}
1694 % Space before the main text should be 32 + 14 base-to-base; we
1695 % accomplish this by doing a vskip of that amount with \cs{baselineskip}
1696 % subtracted.
1697 % \begin{macrocode}
1698 \normalsize
1699 \if@titlepage
1700 \newpage
1701 \else
1702 \dimen@34\p@ \advance\dimen@-\baselineskip
1703 \vskip\dimen@\relax
1704 \fi
1705 } % end \@maketitle
1706 % \end{macrocode}
1707 %
1708 % Segregate the definitions of administrative footnotes to permit
1709 % easier customization, especially for translation journals.
1710 % \begin{macrocode}
1711 \def\@adminfootnotes{%
1712 \let\@makefnmark\relax \let\@thefnmark\relax
1713 %<amsart> \ifx\@empty\@date\else \@footnotetext{\@setdate}\fi
1714 \ifx\@empty\@subjclass\else \@footnotetext{\@setsubjclass}\fi
1715 \ifx\@empty\@keywords\else \@footnotetext{\@setkeywords}\fi
1716 % \end{macrocode}
1717 % In order to make multiple thanks footnotes work inside a single
1718 % \cs{@footnotetext} argument we need to make the first \cn{par} be
1719 % ignored. Cf.~\cs{@setthanks}.
1720 % \begin{macrocode}
1721 \ifx\@empty\thankses\else \@footnotetext{%
1722 \def\par{\let\par\@par}\@setthanks}%
1723 \fi
1724 }
1725 %</amsart|amsproc>
1726 % \end{macrocode}
1727 %
1728 % \subsection{Journal/series logo for articles}
1729 %
1730 % \cs{publname} either will be defined by a parent class that is calling
1731 % \cls{amsart} or \cls{amsproc} as a base class, or will be absent, in
1732 % which case this can be used as a signal to omit the \cs{@serieslogo}.
1733 % A typical value for \cs{publname} would be
1734 %\begin{verbatim}
1735 % \def\publname{JOURNAL OF THE\newline
1736 % AMERICAN MATHEMATICAL SOCIETY}
1737 %\end{verbatim}
1738 %
1739 % Initialize \cs{publname} and \cs{@serieslogo} to no-op if
1740 % \cs{publname} is not already defined.
1741 % \begin{macrocode}
1742 %<*amsart|amsproc>
1743 \AtBeginDocument{%
1744 \@ifundefined{publname}{%
1745 \let\publname\@empty
1746 \let\@serieslogo\@empty
1747 }{%
1748 %<amsart> \def\@serieslogo{\article@logo}%
1749 %<amsproc> \def\@serieslogo{\procart@logo}%
1750 }%
1751 }
1752 %</amsart|amsproc>
1753 % \end{macrocode}
1754 %
1755 % The \cs{number} prefix on current issue is to work around
1756 % inconsistencies in the form of issue numbers as passed in from
1757 % system level. Sometimes they will get passed in with a leading
1758 % zero, which we don't want to print if it happens to occur.
1759 % The |0| prevents an error if \cs{currentissue} happens to be empty.
1760 % \begin{macrocode}
1761 %<*amsart>
1762 \AtBeginDocument{%
1763 \@ifundefined{volinfo}{%
1764 \def\volinfo{%
1765 Volume \currentvolume, Number \number0\currentissue
1766 % \end{macrocode}
1767 % Month/year is not included initially when a journal article is
1768 % posted on the WWW prior to print publication.
1769 % \begin{macrocode}
1770 \if\@printyear , \currentmonth\ \currentyear\fi
1771 }%
1772 }{}%
1773 }
1774 \def\@printyear{TF}% boolean false
1775 %</amsart>
1776 % \end{macrocode}
1777 %
1778 % \begin{macrocode}
1779 %<*amsproc>
1780 \AtBeginDocument{%
1781 \@ifundefined{volinfo}{\let\volinfo\@empty}{}
1782 }
1783 %</amsproc>
1784 % \end{macrocode}
1785 %
1786 % Default values for information such as volume, year, and so on are
1787 % provided as follows.
1788 % \begin{macrocode}
1789 %<*amsart|amsproc>
1790 \def\issueinfo#1#2#3#4{\def\currentvolume{#1}\def\currentissue{#2}%
1791 \def\currentmonth{#3}\def\currentyear{#4}}
1792 \issueinfo{00}% volume number
1793 {0}% % issue number
1794 {Xxxx}% % month
1795 {XXXX}% % year
1796 %</amsart|amsproc>
1797 % \end{macrocode}
1798 %
1799 % Copyright year may be different from issue year. Allow it to be
1800 % specified separately. It is probably more natural anyway, from the
1801 % user's perspective, to give the copyright year in the same command
1802 % when giving the name of the copyright holder.
1803 % \begin{macrocode}
1804 \newcommand{\copyrightinfo}[2]{%
1805 \def\copyrightyear{#1}%
1806 \@ifnotempty{#2}{\def\copyrightholder{#2}}%
1807 }
1808 \copyrightinfo{0000}{(copyright holder)}
1809 % \end{macrocode}
1810 %
1811 % Provide page span information. If negative number is given, convert
1812 % to roman numeral form.
1813 % \begin{macrocode}
1814 %<*amsart|amsproc>
1815 \def\pagespan#1#2{\setcounter{page}{#1}%
1816 \ifnum\c@page<\z@ \pagenumbering{roman}\setcounter{page}{-#1}\fi
1817 \def\start@page{#1}\def\end@page{#2}}
1818 \pagespan{000}{000}
1819 %</amsart|amsproc>
1820 % \end{macrocode}
1821 %
1822 % Formatting for journal page numbers. [bnb, 1996/09/11]
1823 % \begin{macrocode}
1824 %<*amsart>
1825 \AtBeginDocument{%
1826 \@ifundefined{pageinfo}{%
1827 \def\pageinfo{%
1828 \ifnum\start@page=\z@
1829 Pages 000--000
1830 \else
1831 \ifx\start@page\end@page
1832 Page \start@page
1833 \else
1834 Pages \start@page--\end@page
1835 \fi
1836 \fi}%
1837 }{}%
1838 }
1839 %</amsart>
1840 % \end{macrocode}
1841 %
1842 % Publisher Item Identifier (we started using them in journal logos
1843 % as of January 1997).
1844 % \begin{macrocode}
1845 %<amsart>\@ifundefined{ISSN}{\def\ISSN{0000-0000}}{}
1846 %<amsart>\newcommand\PII[1]{\def\@PII{#1}}
1847 %<amsart>\PII{S \ISSN(XX)0000-0}
1848 % \end{macrocode}
1849 %
1850 % \subsection{Copyright block}
1851 %
1852 % Doing the copyright info on the first page is a little tricky. We
1853 % want it to come at the bottom, after any footnotes and floating
1854 % inserts, but before the page number. If we simply put it into
1855 % \cs{@oddfoot} (in \cs{ps@plain}) its height will not be subtracted
1856 % from the height of the text and then the page number will be lower
1857 % than we want. So we do it as an insert.
1858 %
1859 % Through version 1.2, this code was included only for \pkg{amsart}
1860 % and \pkg{amsproc}; the formatting of some book series requires an
1861 % insert at the bottom of the text block, so this code has been
1862 % extended to all AMS document classes. [bnb, 1999/07/14]
1863 % \begin{macrocode}
1864 \newinsert\copyins
1865 % \end{macrocode}
1866 % We set the skip register associated with this insert to the
1867 % \emph{base-to-base} distance from the bottom of the page contents
1868 % to the base of the first line in the copyright info. See the
1869 % definition of \cs{@setcopyright}.
1870 % \begin{macrocode}
1871 \skip\copyins=1.5pc
1872 \count\copyins=1000 % magnification factor, 1000 = 100%
1873 \dimen\copyins=.5\textheight % maximum allowed per page
1874 % \end{macrocode}
1875 % \cn{copyins} is ignored if a float is input on the first page;
1876 % adding it to \cs{@reinserts} will make the output routine behave.
1877 % [bnb; 2004/06/09; B-365]
1878 % \begin{macrocode}
1879 \g@addto@macro\@reinserts{%
1880 \ifvoid\copyins\else\insert\copyins{\unvbox\copyins}\fi
1881 }
1882 % \end{macrocode}
1883 % Put the contents into a \tex/ insert. This information is omitted
1884 % unless \cs{@serieslogo} is non-null. In other words it will
1885 % normally not print except when an AMS publication-specific document
1886 % class such as \cls{tran-l} is used.
1887 % And even if the series logo is printed, omit the copyright line
1888 % if requested by |\coprightinfo{}{}|. [bnb, 1996/10/17]
1889 % \begin{macrocode}
1890 \def\@copyinsfontsize{\fontsize{6}{7\p@}\normalfont\upshape}
1891 \newif\if@extracrline \@extracrlinefalse
1892 \let\@extracrline\@empty
1893 \relax
1894 \def\@setcopyright{%
1895 \ifx\@empty\@serieslogo
1896 \else\ifx\@empty\copyrightyear
1897 \else
1898 \insert\copyins{\hsize\textwidth
1899 \parfillskip\z@\relax
1900 \leftskip\z@\@plus.9\textwidth\relax \rightskip\z@\relax
1901 \@copyinsfontsize
1902 % \end{macrocode}
1903 % The spacing between the preceding text and the copyright info is
1904 % done with a strut of height |\skip\copyins|. (Note that
1905 % \cs{lineskip} and \cs{baselineskip} are 0 in the \latex/ output
1906 % routine.) The negative vskip gives an effective distance of 0 from
1907 % the top of the box to the base of the first line (assuming
1908 % |\skip\copyins| is greater than the height of that line). Then the
1909 % apparent total height of the box will work well with \tex/'s
1910 % calculations involving |\skip\copyins| for how much room to leave
1911 % for this object. An extra 6pt is allowed when an additional line
1912 % is present; this adjustment was found adequate in some borderline
1913 % cases where tight pages reset with the additional line had text
1914 % lines moved to the next page, causing the paper length to expand
1915 % by a page. [bnb, 2004/05/07-06/24]
1916 % \begin{macrocode}
1917 \everypar{}%
1918 \vskip-\skip\copyins
1919 \if@extracrline
1920 \vskip-6pt
1921 \fi
1922 \nointerlineskip
1923 \leavevmode\hfill\vrule\@width\z@\@height\skip\copyins
1924 \copyright\copyrightyear\ \copyrightholder\ignorespaces
1925 \if@extracrline \@extracrline \fi
1926 \par
1927 % \end{macrocode}
1928 % This kern of 0pt forces the depth of the last line (if any) to be
1929 % added to the height of the box.
1930 % \begin{macrocode}
1931 \kern\z@}%
1932 \fi\fi
1933 }
1934 % \end{macrocode}
1935 %
1936 % When \cs{@combinefloats} is called, the box \cs{@outputbox} already
1937 % contains the main text of the page and any footnotes. Then \latex/
1938 % adds top and bottom figures. We want to add our copyright info at
1939 % the very bottom, but still inside of the vbox.
1940 % \begin{macrocode}
1941 \def\@combinefloats{%
1942 \ifx \@toplist\@empty \else \@cflt \fi
1943 \ifx \@botlist\@empty \else \@cflb \fi
1944 \ifvoid\copyins \else \@cflci \fi
1945 }
1946 % \end{macrocode}
1947 % \subsubsection{combine-floats-copyright-insert}
1948 %
1949 % In the twocolumn/firstcolumn case, postpone adding the drop folio.
1950 % Put an empty box of the same height at the bottom of the left-hand
1951 % column to make the columns balance. Allow a smidge of stretch in
1952 % case the first page of a chapter has no internal stretch, so that
1953 % the drop folio will be flush to the bottom of the text block;
1954 % don't do this for a twocolumn page, to avoid an uneven bottom.
1955 % \begin{macrocode}
1956 \def\@cflci{%
1957 \setbox\@outputbox\vbox{%
1958 \unvbox\@outputbox
1959 \vskip\skip\copyins
1960 \if@twocolumn \else \vskip\z@ plus\p@ \fi
1961 \hbox to\columnwidth{%
1962 \hss\vbox to\z@{\vss
1963 % \end{macrocode}
1964 % In two-column layout, put an empty box in the first column
1965 % instead of the drop folio.
1966 % \begin{macrocode}
1967 \if@twocolumn
1968 \if@firstcolumn \else \unvbox\copyins \fi
1969 \else
1970 \unvbox\copyins
1971 \fi
1972 }}}%
1973 % \end{macrocode}
1974 % Now redo the insert to make sure we get the right amount of space
1975 % reserved for it in the second column.
1976 % \begin{macrocode}
1977 \if@twocolumn \if@firstcolumn
1978 \insert\copyins{\unvbox\copyins}%
1979 \fi\fi
1980 % \end{macrocode}
1981 % Reset the \cs{copyins} flag so that a subsequent insert
1982 % (e.g.\ \cs{@dropfolio} in some book series) will work.
1983 % \begin{macrocode}
1984 \global\count\copyins=999 \relax
1985 }
1986 % \end{macrocode}
1987 % [End of code to support inserts at end of text block.]
1988 %
1989 % For journals only, provide a switch that indicates the author has
1990 % agreed to revert copyright to the public domain; this results in
1991 % an addition to the copyright block on the article.
1992 % \begin{macrocode}
1993 %<*amsart>
1994 \newif\if@revertcopyright \@revertcopyrightfalse
1995 \newcommand{\revertcopyright}{%
1996 \global\@revertcopyrighttrue
1997 \global\@extracrlinetrue}
1998 % \end{macrocode}
1999 % Add notation regarding reversion of copyright to public domain if
2000 % author has agreed to it. Permit this to be set in a different
2001 % size than the copyright line (required for some author packages).
2002 % \begin{macrocode}
2003 \def\@revertcrfontsize{\fontsize{6}{7\p@}\normalfont\upshape}
2004 \def\@extracrline{%
2005 \if@revertcopyright
2006 \unskip\\
2007 \@revertcrfontsize
2008 Reverts to public domain 28 years from publication
2009 \fi
2010 }
2011 %</amsart>
2012 % \end{macrocode}
2013 %
2014 % \subsection{Other top matter info}
2015 %
2016 % Some name setup.
2017 % \begin{macrocode}
2018 \newcommand{\abstractname}{Abstract}
2019 \newcommand{\keywordsname}{Key words and phrases}
2020 % \end{macrocode}
2021 % Support the most recent versions. Earlier, unsupported versions
2022 % were:
2023 % \begin{itemize}
2024 % \item \textup{1980} Mathematics Subject Classification
2025 % \item \textup{1980} Mathematics Subject Classification
2026 % \textup{(1985} Revision\textup{)}
2027 % \end{itemize}
2028 % \begin{macrocode}
2029 \@namedef{subjclassname@1991}{%
2030 \textup{1991} Mathematics Subject Classification}
2031 \@namedef{subjclassname@2000}{%
2032 \textup{2000} Mathematics Subject Classification}
2033 \@namedef{subjclassname@2010}{%
2034 \textup{2010} Mathematics Subject Classification}
2035 \@namedef{subjclassname@2020}{%
2036 \textup{2020} Mathematics Subject Classification}
2037 % \end{macrocode}
2038 % Default to the 2020 edition.
2039 % \begin{macrocode}
2040 \@xp\let\@xp\subjclassname\csname subjclassname@2020\endcsname
2041 % \end{macrocode}
2042 % For the date we have a special little problem: We only want to add
2043 % the `Received by the editors' text for publication-specific
2044 % document classes such as \cls{tran-l}.
2045 % \begin{macrocode}
2046 %<amsbook>\def\@tempb{amsbook}
2047 %<amsproc>\def\@tempb{amsproc}
2048 %<amsart>\def\@tempb{amsart}
2049 \ifx\@classname\@tempb
2050 \newcommand{\datename}{\textit{Date}:}
2051 \else
2052 \newcommand{\datename}{Received by the editors}
2053 \fi
2054 % \end{macrocode}
2055 %
2056 % \begin{macrocode}
2057 %<*amsart|amsproc>
2058 \def\@settitle{\begin{center}%
2059 %<amsart> \baselineskip14\p@\relax
2060 %<amsproc> \Large
2061 \bfseries
2062 %<amsart>\uppercasenonmath\@title
2063 \@title
2064 \end{center}%
2065 }
2066 %</amsart|amsproc>
2067 % \end{macrocode}
2068 %
2069 % For multiple authors we need to combine the author names into a
2070 % list of the form Author One, Author Two, \dots, and Author Last.
2071 % Change line breaking penalties to avoid a line break in the middle of
2072 % an author name if there are a lot of authors. This should probably
2073 % better be done by changing spaces within author names to
2074 % |\nolinebreak[3]\space|, but that would take more work.
2075 % [mjd,2000/12/27]
2076 % \begin{macrocode}
2077 %<*amsart|amsproc>
2078 \def\author@andify{%
2079 \nxandlist {\unskip ,\penalty-1 \space\ignorespaces}%
2080 {\unskip {} \@@and~}%
2081 {\unskip ,\penalty-2 \space \@@and~}%
2082 }
2083 % \end{macrocode}
2084 %
2085 % \begin{macrocode}
2086 \def\@setauthors{%
2087 \begingroup
2088 \def\thanks{\protect\thanks@warning}%
2089 \trivlist
2090 %<amsart> \centering\footnotesize \@topsep30\p@\relax
2091 %<amsart> \advance\@topsep by -\baselineskip
2092 %<amsproc> \centering \fontsize{11}{13\p@}\selectfont\@topsep13\p@\relax
2093 \item\relax
2094 \author@andify\authors
2095 % \end{macrocode}
2096 % Make dbl-backslash robust to prevent problems if/when
2097 % \cs{MakeTextUppercase} expansion is applied.
2098 % \begin{macrocode}
2099 \def\\{\protect\linebreak}%
2100 %<amsart> \MakeUppercase{\authors}%
2101 %<amsproc> \authors
2102 \ifx\@empty\contribs
2103 \else
2104 ,\penalty-3 \space \@setcontribs
2105 \@closetoccontribs
2106 \fi
2107 \endtrivlist
2108 \endgroup
2109 }
2110 \def\@closetoccontribs{}
2111 \def\@setcontribs{%
2112 \@xcontribs
2113 %<amsart> \MakeUppercase{\xcontribs}%
2114 %<amsproc> \xcontribs
2115 }
2116 \def\@setdate{\datename\ \@date\@addpunct.}
2117 \def\@setsubjclass{%
2118 {\itshape\subjclassname.}\enspace\@subjclass\@addpunct.}
2119 \def\@setkeywords{%
2120 {\itshape \keywordsname.}\enspace \@keywords\@addpunct.}
2121 %</amsart|amsproc>
2122 % \end{macrocode}
2123 %
2124 % The following definitions suffice for all the AMS document classes.
2125 % \begin{macrocode}
2126 \def\@setthanks{\def\thanks##1{\par##1\@addpunct.}\thankses}
2127 % \end{macrocode}
2128 %
2129 % `Abstract' can be changed to, say, `R\'esum\'e' (French) by
2130 % redefining \cn{abstractname}. This and other control sequence names
2131 % (\cn{refname}, \cn{contentsname}, \cn{appendixname}, and so on) are
2132 % compatible with the \pkg{babel} package (the AMS sometimes
2133 % publishes articles in languages other than English.)
2134 %
2135 % In AMS document classes, the abstract should be placed before
2136 % \cn{maketitle} (otherwise the desired ordering of frontmatter
2137 % elements cannot be ensured in all cases).
2138 % \begin{macrocode}
2139 \newbox\abstractbox
2140 % \end{macrocode}
2141 % We start by checking whether \cn{maketitle} has already been used
2142 % (in which case it was reset to \cs{relax}); if so, we give a
2143 % warning that the abstract should be placed before \cn{maketitle}.
2144 % \begin{macrocode}
2145 \newenvironment{abstract}{%
2146 \ifx\maketitle\relax
2147 \ClassWarning{\@classname}{Abstract should precede
2148 \protect\maketitle\space in AMS document classes; reported}%
2149 \fi
2150 \global\setbox\abstractbox=\vtop \bgroup
2151 \normalfont\Small
2152 \list{}{\labelwidth\z@
2153 \leftmargin3pc \rightmargin\leftmargin
2154 \listparindent\normalparindent \itemindent\z@
2155 \parsep\z@ \@plus\p@
2156 % \end{macrocode}
2157 % In order to get equation numbers indented with the rest of the
2158 % abstract, we have to do this:
2159 % \begin{macrocode}
2160 \let\fullwidthdisplay\relax
2161 }%
2162 \item[\hskip\labelsep\scshape\abstractname.]%
2163 }{%
2164 \endlist\egroup
2165 % \end{macrocode}
2166 % If the abstract was supposed to be typeset earlier, then
2167 % \cs{@setabstract} is now equal to \cs{relax}, and we had better
2168 % drop the contents of the abstract box onto the page immediately, to
2169 % salvage the situation as best we can.
2170 % \begin{macrocode}
2171 \ifx\@setabstract\relax \@setabstracta \fi
2172 }
2173 % \end{macrocode}
2174 %
2175 % Because the abstract might be postponed until the end of an
2176 % article, we cannot simply use the fact of a preceding
2177 % \cn{maketitle} to tell whether \cs{endabstract} should immediately
2178 % put the abstract box contents on the page. So we use an auxiliary
2179 % function that will be reset to no-op once we have passed the point
2180 % where the abstract should normally be typeset.
2181 % \begin{macrocode}
2182 \def\@setabstract{\@setabstracta \global\let\@setabstract\relax}
2183 \def\@setabstracta{%
2184 \ifvoid\abstractbox
2185 \else
2186 \skip@20\p@ \advance\skip@-\lastskip
2187 \advance\skip@-\baselineskip \vskip\skip@
2188 \box\abstractbox
2189 \prevdepth\z@ % because \abstractbox is a vtop
2190 \fi
2191 }
2192 % \end{macrocode}
2193 %
2194 % Title page environment does nothing much; information and
2195 % formatting to be provided by the user.
2196 % \begin{macrocode}
2197 \def\titlepage{%
2198 %<amsbook> \cleardoublepage
2199 %<amsart|amsproc> \clearpage
2200 \thispagestyle{empty}\setcounter{page}{0}}
2201 \def\endtitlepage{\newpage}
2202 % \end{macrocode}
2203 %
2204 % \subsection{Macros for list labels}
2205 %
2206 % Through version 1.2, first-level enumerated item labels were formatted
2207 % with a following period, which is not AMS style. Effective with
2208 % version 2.0 these labels are formatted with parentheses. Anyone
2209 % requiring the period style will have to redefine \cs{labelenumi}.
2210 % \begin{macrocode}
2211 \def\labelenumi{(\theenumi)}
2212 \def\theenumi{\@arabic\c@enumi}
2213 \def\labelenumii{(\theenumii)}
2214 \def\theenumii{\@alph\c@enumii}
2215 \def\p@enumii{\theenumi}
2216 \def\labelenumiii{(\theenumiii)}
2217 \def\theenumiii{\@roman\c@enumiii}
2218 \def\p@enumiii{\theenumi(\theenumii)}
2219 \def\labelenumiv{(\theenumiv)}
2220 \def\theenumiv{\@Alph\c@enumiv}
2221 \def\p@enumiv{\p@enumiii\theenumiii}
2222 % \end{macrocode}
2223 %
2224 % \begin{macrocode}
2225 \def\labelitemi{$\m@th\bullet$}
2226 \def\labelitemii{\bfseries --}% \upshape already done by \itemize
2227 \def\labelitemiii{$\m@th\ast$}
2228 \def\labelitemiv{$\m@th\cdot$}
2229 % \end{macrocode}
2230 %
2231 % \subsection{Verse and quotation environments}
2232 % \begin{macrocode}
2233 \newenvironment{verse}{\let\\\@centercr
2234 \list{}{\itemsep\z@ \itemindent -1.5em\listparindent\itemindent
2235 \rightmargin\leftmargin \advance\leftmargin 1.5em}\item[]%
2236 }{%
2237 \endlist
2238 }
2239 \let\endverse=\endlist % for efficiency
2240 % \end{macrocode}
2241 % The left/right margins of the quotation environment are supposed to
2242 % be the same as for the abstract environment.
2243 % \begin{macrocode}
2244 \newenvironment{quotation}{\list{}{%
2245 \leftmargin3pc \listparindent\normalparindent
2246 \itemindent\z@
2247 \rightmargin\leftmargin \parsep\z@ \@plus\p@}%
2248 \item[]%
2249 }{%
2250 \endlist
2251 }
2252 \let\endquotation=\endlist % for efficiency
2253 \newenvironment{quote}{%
2254 \list{}{\rightmargin\leftmargin}\item[]%
2255 }{%
2256 \endlist
2257 }
2258 \let\endquote=\endlist % for efficiency
2259 % \end{macrocode}
2260 %
2261 % \subsection{List environments}
2262 % Changed definition of \cs{trivlist}, \env{enumerate}, and
2263 % \env{itemize} in order to have \cn{makelabel} apply \cn{upshape}.
2264 % \begin{macrocode}
2265 \def\trivlist{\parsep\parskip\@nmbrlistfalse
2266 \@trivlist \labelwidth\z@ \leftmargin\z@
2267 \itemindent\z@
2268 \let\@itemlabel\@empty
2269 \def\makelabel##1{\upshape##1}}
2270 % \end{macrocode}
2271 %
2272 % \begin{macrocode}
2273 \renewenvironment{enumerate}{%
2274 \ifnum \@enumdepth >3 \@toodeep\else
2275 \advance\@enumdepth \@ne
2276 \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
2277 {\csname label\@enumctr\endcsname}{\usecounter
2278 {\@enumctr}\def\makelabel##1{\hss\llap{\upshape##1}}}\fi
2279 }{%
2280 \endlist
2281 }
2282 \let\endenumerate=\endlist % for efficiency
2283 % \end{macrocode}
2284 %
2285 % \begin{macrocode}
2286 \renewenvironment{itemize}{%
2287 \ifnum\@itemdepth>3 \@toodeep
2288 \else \advance\@itemdepth\@ne
2289 \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
2290 \list{\csname\@itemitem\endcsname}%
2291 {\def\makelabel##1{\hss\llap{\upshape##1}}}%
2292 \fi
2293 }{%
2294 \endlist
2295 }
2296 \let\enditemize=\endlist % for efficiency
2297 % \end{macrocode}
2298 %
2299 % \begin{macrocode}
2300 \newcommand{\descriptionlabel}[1]{\hspace\labelsep \upshape\bfseries #1:}
2301 \newenvironment{description}{\list{}{%
2302 % \end{macrocode}
2303 % Adjust the indent of the first line to the desired value:
2304 % \begin{macrocode}
2305 \advance\leftmargini6\p@ \itemindent-12\p@
2306 \labelwidth\z@ \let\makelabel\descriptionlabel}%
2307 }{
2308 \endlist
2309 }
2310 \let\enddescription=\endlist % for efficiency
2311 % \end{macrocode}
2312 %
2313 % \begin{macro}{\upn}
2314 % The command \cn{upn} can be used to force upright font for
2315 % punctuation or digits in italic text. For example
2316 %\begin{verbatim}
2317 % ... as numbered by \upn{``A''} or \upn{``1''} hereafter\upn{)}
2318 %\end{verbatim}
2319 % \begin{macrocode}
2320 \let\upn=\textup
2321 % \end{macrocode}
2322 % \end{macro}
2323 %
2324 % Since these margin settings are dependent on the fonts used, we
2325 % postpone them until begin-document. (This means that we cannot use
2326 % the values directly for calculations before begin-document.) Allow
2327 % for a reasonable maximum value; 13 = xiii = m should be adequate.
2328 % \begin{macrocode}
2329 \AtBeginDocument{%
2330 \labelsep=5pt\relax
2331 \setcounter{enumi}{13}\setcounter{enumii}{13}%
2332 \setcounter{enumiii}{13}\setcounter{enumiv}{13}%
2333 \settowidth\leftmargini{\labelenumi\hskip\labelsep}%
2334 \advance\leftmargini by \normalparindent
2335 \settowidth\leftmarginii{\labelenumii\hskip\labelsep}%
2336 \settowidth\leftmarginiii{\labelenumiii\hskip\labelsep}%
2337 \settowidth\leftmarginiv{\labelenumiv\hskip\labelsep}%
2338 \setcounter{enumi}{0}\setcounter{enumii}{0}%
2339 \setcounter{enumiii}{0}\setcounter{enumiv}{0}%
2340 \leftmarginv=10pt \leftmarginvi=\leftmarginv
2341 \leftmargin=\leftmargini
2342 \labelwidth=\leftmargini \advance\labelwidth-\labelsep
2343 \@listi}
2344 % \end{macrocode}
2345 %
2346 % In some contexts the space above/below lists needs to be
2347 % suppressed. So we put it into a variable \cs{listisep}.
2348 % \begin{macrocode}
2349 \newskip\listisep
2350 \listisep\smallskipamount
2351 \def\@listI{\leftmargin\leftmargini \parsep\z@skip
2352 \topsep\listisep \itemsep\z@skip
2353 \listparindent\normalparindent}
2354 \let\@listi\@listI
2355 % \end{macrocode}
2356 %
2357 % Is it necessary to reset \cs{parsep}, \cs{partopsep}, \cs{itemsep}
2358 % to their default values (0) in each of the subordinate list
2359 % setup functions? I don't believe so, but I leave the settings in
2360 % the listii function just in case some unusual nesting of
2361 % environments might cause trouble. [mjd,1994/09/22]
2362 % \begin{macrocode}
2363 \def\@listii{\leftmargin\leftmarginii
2364 \labelwidth\leftmarginii \advance\labelwidth-\labelsep
2365 \topsep\z@skip \parsep\z@skip \partopsep\z@skip \itemsep\z@skip}
2366 \def\@listiii{\leftmargin\leftmarginiii
2367 \labelwidth\leftmarginiii \advance\labelwidth-\labelsep}
2368 \def\@listiv{\leftmargin\leftmarginiv
2369 \labelwidth\leftmarginiv \advance\labelwidth-\labelsep}
2370 \def\@listv{\leftmargin\leftmarginv
2371 \labelwidth\leftmarginv \advance\labelwidth-\labelsep}
2372 \def\@listvi{\leftmargin\leftmarginvi
2373 \labelwidth\leftmarginvi \advance\labelwidth-\labelsep}
2374 % \end{macrocode}
2375 %
2376 % \subsection{Fleqn option}
2377 %
2378 % \begin{macrocode}
2379 \@ifclasswith{\@classname}{fleqn}{%
2380 \let\@tempa\@iden
2381 \AtBeginDocument{\mathindent\leftmargini}%
2382 }{\let\@tempa\@gobble}%
2383 \@ifpackageloaded{amsmath}{\let\@tempa\@gobble}{%
2384 \@ifpackageloaded{amstex}{\let\@tempa\@gobble}{}%
2385 }
2386 \@tempa{%
2387 \def\[{\relax
2388 \ifmmode\@badmath
2389 \else
2390 \begin{trivlist}%
2391 \@beginparpenalty\predisplaypenalty
2392 \@endparpenalty\postdisplaypenalty
2393 \item[]\leavevmode
2394 \hbox to\linewidth\bgroup$\displaystyle
2395 % \end{macrocode}
2396 % Note that the \cs{m@th} should go at the end in \cn{]} just in
2397 % case an embedded small math formula inside \cn{text} occurs in
2398 % the display.
2399 %
2400 % Why the extra bgroup here? I think it's not needed.
2401 % [mjd,3-Feb-1994]
2402 % \begin{macrocode}
2403 \hskip\mathindent\bgroup
2404 \fi}%
2405 \def\]{\relax
2406 \ifmmode
2407 \egroup \m@th$\hfil \egroup
2408 \end{trivlist}%
2409 \else \@badmath
2410 \fi}%
2411 \renewenvironment{equation}{%
2412 \@beginparpenalty\predisplaypenalty
2413 \@endparpenalty\postdisplaypenalty
2414 \refstepcounter{equation}%
2415 \@topsep\abovedisplayskip \trivlist
2416 \item[]\leavevmode
2417 \hbox to\linewidth\bgroup\hskip\mathindent$\displaystyle
2418 }{%
2419 \m@th$\hfil \displaywidth\linewidth \hbox{\@eqnnum}\egroup
2420 \endtrivlist
2421 }%
2422 \renewenvironment{eqnarray}{%
2423 \stepcounter{equation}\let\@currentlabel\theequation
2424 \global\@eqnswtrue \global\@eqcnt\z@ \tabskip\mathindent
2425 \let\\=\@eqncr \abovedisplayskip\topsep
2426 \ifvmode \advance\abovedisplayskip\partopsep \fi
2427 \belowdisplayskip\abovedisplayskip
2428 \belowdisplayshortskip\abovedisplayskip
2429 \abovedisplayshortskip\abovedisplayskip
2430 $$\everycr{}\halign to\linewidth\bgroup
2431 \hskip\@centering
2432 $\displaystyle\tabskip\z@skip####\m@th$&%
2433 \@eqnsel \global\@eqcnt\@ne
2434 \hfil${}####{}\m@th$\hfil&%
2435 \global\@eqcnt\tw@
2436 $\displaystyle ####\m@th$\hfil\tabskip\@centering&%
2437 \global\@eqcnt\thr@@
2438 \hbox to \z@\bgroup\hss####\egroup\tabskip\z@skip\cr
2439 }{%
2440 \@@eqncr \egroup \global\advance\c@equation\m@ne$$%
2441 \global\@ignoretrue
2442 }%
2443 \newdimen\mathindent
2444 \mathindent\leftmargini
2445 }
2446 % \end{macrocode}
2447 %
2448 % \subsection{Redefined internal sectioning commands}
2449 %
2450 % In amsart.sty \cs{@startsection}, \cs{@sect},
2451 % and a couple of other things are redefined to fix a few hard-coded
2452 % things that would interfere with the desired style. The most
2453 % noteworthy difference is that all section headings will go into the
2454 % table of contents (governed by secnumdepth as usual), EVEN WHEN THE
2455 % |*| FORM IS USED. The only section heading not listed in the table of
2456 % contents is the heading for the toc itself.
2457 %
2458 % A second major departure from standard \latex/ is that when a
2459 % short form of a section title is given, it is used only for the
2460 % running heads; the table of contents still gets the full version of
2461 % the title. This is correct for AMS editorial practice. However if
2462 % one wants to get a line break into the table of contents it means
2463 % that the standard \latex/ method cannot be used. See the
2464 % \cn{except} and \cn{for} commands.
2465 % \begin{macrocode}
2466 \def\@startsection#1#2#3#4#5#6{%
2467 % \end{macrocode}
2468 % Section titles, if they are run-in with the following text, are
2469 % stored in a box instead of being typeset right away. They will be
2470 % typeset by \cs{everypar}, but if one section heading follows
2471 % right after another, this won't happen. So by doing
2472 % \cs{leavevmode} we force this to happen. (\cs{if@noskipsec}
2473 % is true if the previous section title has not yet been typeset.)
2474 % \begin{macrocode}
2475 \if@noskipsec \leavevmode \fi
2476 \par \@tempskipa #4\relax
2477 \@afterindenttrue
2478 \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
2479 \if@nobreak \everypar{}\else
2480 \addpenalty\@secpenalty\addvspace\@tempskipa\fi
2481 % Don't call \@ssect in the ifstar case:
2482 \@ifstar{\@dblarg{\@sect{#1}{\@m}{#3}{#4}{#5}{#6}}}%
2483 {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}%
2484 }
2485 % \end{macrocode}
2486 %
2487 % We add \cn{textup} here in order to make section
2488 % numbers always roman, even if the rest of the section head is
2489 % italic.
2490 % \begin{macrocode}
2491 \def\@seccntformat#1{%
2492 \protect\textup{\protect\@secnumfont
2493 \csname the#1\endcsname
2494 \protect\@secnumpunct
2495 }%
2496 }
2497 % \end{macrocode}
2498 %
2499 % Some journals require a different font for section numbers. (As
2500 % coded here, this option permits only a change of weight, to
2501 % \cn{bfseries}.) The \cls{amsart} font is checked again later,
2502 % when processing \cn{section}, and if there is no section title,
2503 % it is made bold.
2504 % \begin{macrocode}
2505 %<amsbook|amsproc>\let\@secnumfont\@empty
2506 %<amsart>\def\@secnumfont{\mdseries}
2507 % \end{macrocode}
2508 %
2509 % For reference, here is the argument list for \cs{@sect}.
2510 %\begin{verbatim}
2511 % % #1 #2 #3 #4 #5 #6 #7 #8
2512 % {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}[SHORTT]{TITLE}
2513 %\end{verbatim}
2514 % \begin{macrocode}
2515 \def\@sect#1#2#3#4#5#6[#7]#8{%
2516 % \end{macrocode}
2517 % Define \cs{@toclevel} for for \cs{@tocwrite} (to
2518 % \cs{@tochangmeasure}).
2519 % \begin{macrocode}
2520 \edef\@toclevel{\ifnum#2=\@m 0\else\number#2\fi}%
2521 \ifnum #2>\c@secnumdepth \let\@secnumber\@empty
2522 \else \@xp\let\@xp\@secnumber\csname the#1\endcsname\fi
2523 % \end{macrocode}
2524 % If the value of afterskip $>0$, then this is not a run-in section
2525 % heading, and we want to suppress final punctuation.
2526 % \begin{macrocode}
2527 \@tempskipa #5\relax
2528 % \end{macrocode}
2529 % \cs{@svsec} will be the section number plus some formatting if
2530 % the star form was not used and if the depth of numbering extends to
2531 % the current level. The user can change secnumdepth to control how
2532 % many levels of sectioning will be numbered.
2533 % \begin{macrocode}
2534 \ifnum #2>\c@secnumdepth
2535 \let\@svsec\@empty
2536 \else
2537 \refstepcounter{#1}%
2538 % \end{macrocode}
2539 % If the section heading is not run-in and there is no title, omit
2540 % final punctuation and space. If it is run-in, omit extra space.
2541 % \begin{macrocode}
2542 \edef\@secnumpunct{%
2543 \ifdim\@tempskipa>\z@ % not a run-in section heading
2544 \@ifnotempty{#8}{.\@nx\enspace}%
2545 \else
2546 \@ifempty{#8}{.}{.\@nx\enspace}%
2547 \fi
2548 }%
2549 % \end{macrocode}
2550 % For \cls{amsart}, if a subsection has no title, make the section
2551 % number bold; otherwise leave it alone.
2552 % [bnb; 2004/06/08; per vwa, B-442]
2553 % \begin{macrocode}
2554 %<amsart> \@ifempty{#8}{%
2555 %<amsart> \ifnum #2=\tw@ \def\@secnumfont{\bfseries}\fi}{}%
2556 % \end{macrocode}
2557 % If the |*|-form was not used (\arg{2} less than 1000), we add
2558 % \cn{sectionname} or whatever as a prefix, separated by a space.
2559 % We need the ifundefined test in order to know whether the space
2560 % should be added or not. There must be a better way to do this
2561 % but I haven't thought of it yet.
2562 % \begin{macrocode}
2563 \protected@edef\@svsec{%
2564 \ifnum#2<\@m
2565 \@ifundefined{#1name}{}{%
2566 \ignorespaces\csname #1name\endcsname\space
2567 }%
2568 \fi
2569 \@seccntformat{#1}%
2570 }%
2571 \fi
2572 \ifdim \@tempskipa>\z@ % then this is not a run-in section heading
2573 \begingroup #6\relax
2574 \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty\@M #8\par}%
2575 \endgroup
2576 % \end{macrocode}
2577 %
2578 % Section headings don't set marks for the running heads in the article
2579 % style, only in the amsbook style. Assumption: \cs{sectionmark} is
2580 % defined to call \cs{@secnumber} as its penultimate argument.
2581 % \begin{macrocode}
2582 %<amsbook> \csname #1mark\endcsname{#7}%
2583 % \end{macrocode}
2584 % If \arg{2} (level) is greater than 1000 then we don't do a table
2585 % of contents entry. This happens only for the section heading above
2586 % the table of contents itself.
2587 % \begin{macrocode}
2588 \ifnum#2>\@m \else \@tocwrite{#1}{#8}\fi
2589 \else
2590 % \end{macrocode}
2591 % Otherwise we're doing a run-in heading; it is stored as \cs{@svsechd},
2592 % which will be typeset by \cs{everypar} as soon as some text is
2593 % encountered.
2594 % \begin{macrocode}
2595 \def\@svsechd{#6\hskip #3\@svsec
2596 % \end{macrocode}
2597 % To allow for the possibility that the user wants an empty section
2598 % title, leaving just the section number, we check whether \arg{8}
2599 % is nonempty before adding the period.
2600 % \begin{macrocode}
2601 \@ifnotempty{#8}{\ignorespaces#8\unskip
2602 % \end{macrocode}
2603 % The following test is to prevent a period being added if the
2604 % section title ended in a question mark or other punctuation.
2605 % \begin{macrocode}
2606 \@addpunct.}%
2607 \ifnum#2>\@m \else \@tocwrite{#1}{#8}\fi
2608 }%
2609 \fi
2610 % \end{macrocode}
2611 % In a previous version of \cls{amsart} \cs{@nobreaktrue} was added to
2612 % \cs{@xsect} for some reason. Let's keep that just in case it was done to
2613 % prevent a certain kind of bug. [mjd,17-Aug-1994]
2614 % \begin{macrocode}
2615 \global\@nobreaktrue
2616 % \end{macrocode}
2617 % \cs{@xsect} does some more stuff based on whether this is a run-in
2618 % heading or not.
2619 % \begin{macrocode}
2620 \@xsect{#5}}
2621 % \end{macrocode}
2622 %
2623 % Undefine \cs{@ssect} to save memory; it's not needed in \cls{amsart}.
2624 % \begin{macrocode}
2625 \let\@ssect\relax
2626 % \end{macrocode}
2627 %
2628 % \subsection{Chapters and sections}
2629 % Allocate counters for sectioning commands. Paragraph and subparagraph
2630 % counters are allocated but normally not used.
2631 % \begin{macrocode}
2632 \newcounter{part}
2633 %<amsbook>\newcounter{chapter}
2634 %<amsproc|amsart>\newcounter{section}
2635 %<amsbook>\newcounter{section}[chapter]
2636 %<amsbook>\def\thesection{\arabic{section}}
2637 \newcounter{subsection}[section]
2638 \newcounter{subsubsection}[subsection]
2639 \newcounter{paragraph}[subsubsection]
2640 \newcounter{subparagraph}[paragraph]
2641 % \end{macrocode}
2642 % Set numbering style for sectioning commands. In a couple of cases
2643 % resetting is unnecessary but we include the full list here for
2644 % completeness.
2645 % \begin{macrocode}
2646 \renewcommand\thepart {\arabic{part}}
2647 %<amsbook>\renewcommand\thechapter {\arabic{chapter}}
2648 \renewcommand\thesection {\arabic{section}}
2649 \renewcommand\thesubsection {\thesection.\arabic{subsection}}
2650 \renewcommand\thesubsubsection {\thesubsection .\arabic{subsubsection}}
2651 \renewcommand\theparagraph {\thesubsubsection.\arabic{paragraph}}
2652 \renewcommand\thesubparagraph {\theparagraph.\arabic{subparagraph}}
2653 % \end{macrocode}
2654 % Depth of section numbering; if \fn{secnumdepth} were 2 instead of
2655 % 3, \cn{subsubsection} would not be numbered.
2656 % \begin{macrocode}
2657 \setcounter{secnumdepth}{3}
2658 % \end{macrocode}
2659 %
2660 % The arguments of \cs{@startsection} are given for reference:
2661 %\begin{verbatim}
2662 % % #1 #2 #3 #4 #5 #6
2663 % {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}
2664 %\end{verbatim}
2665 %
2666 % \begin{macrocode}
2667 \def\partname{Part}
2668 %<*amsart|amsproc>
2669 \def\part{\@startsection{part}{0}%
2670 \z@{\linespacing\@plus\linespacing}{.5\linespacing}%
2671 {\normalfont\bfseries\raggedright}}
2672 %</amsart|amsproc>
2673 % \end{macrocode}
2674 %
2675 % Specialsection correlates to our inhouse Z-head.
2676 % \begin{macrocode}
2677 \def\specialsection{\@startsection{section}{1}%
2678 %<amsart> \z@{\linespacing\@plus\linespacing}{.5\linespacing}%
2679 %<amsproc|amsbook> \z@{2\linespacing\@plus\linespacing}{.5\linespacing}%
2680 %<amsart> {\normalfont\centering}}
2681 %<amsproc|amsbook> {\large\scshape\centering}}
2682 % \end{macrocode}
2683 %
2684 % In the book class \cn{part} puts the part title on a separate
2685 % page.
2686 % \begin{macrocode}
2687 %<*amsbook>
2688 \def\part{\cleardoublepage \thispagestyle{empty}%
2689 \null\vfil \markboth{}{}\secdef\@part\@spart}
2690 %
2691 \def\@part[#1]#2{%
2692 \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}%
2693 \addcontentsline{toc}{part}{\partname\ \thepart.
2694 \protect\enspace\protect\noindent#1}%
2695 \else
2696 \addcontentsline{toc}{part}{#1}\fi
2697 \begingroup\centering
2698 \ifnum \c@secnumdepth >-2\relax
2699 {\fontsize{\@xviipt}{22}\bfseries
2700 \partname\ \thepart} \vskip 20\p@ \fi
2701 \fontsize{\@xxpt}{25}\bfseries
2702 #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}}
2703
2704 \def\@spart#1{\addcontentsline{toc}{part}{\protect\noindent#1}%
2705 \begingroup\centering
2706 \fontsize{\@xxpt}{25}\bfseries
2707 #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}}
2708 %</amsbook>
2709 % \end{macrocode}
2710 %
2711 % The arguments of \cs{partrunhead} are \cs{partname},
2712 % \cs{thepart}, and the text of the part title. The first two were
2713 % fully expanded during the marking process. Use of a mere
2714 % interword space between the first two args makes it possible
2715 % to apply \cn{ignorespaces} and \cn{unskip} as shown here
2716 % to produce the desired results if one or the other is empty.
2717 % \begin{macrocode}
2718 %<*amsbook>
2719 \def\partrunhead#1#2#3{%
2720 \@ifnotempty{#2}{\uppercase{\ignorespaces#1 #2\unskip}\@ifnotempty{#3}{. }}%
2721 \def\@tempa{#3}%
2722 \ifx\@empty\@tempa\else
2723 \begingroup \def\\{ \ignorespaces}% defend against questionable usage
2724 \uppercasenonmath\@tempa\@tempa
2725 \endgroup
2726 \fi
2727 }
2728 \let\chapterrunhead\partrunhead
2729 \let\sectionrunhead\partrunhead
2730 %</amsbook>
2731 % \end{macrocode}
2732 %
2733 % Section headings in the amsbook style differ from the amsart
2734 % style in a couple of ways: The ones that aren't centered are
2735 % indented on the left, instead of flush left; and the first
2736 % level, \cn{section}, is not small caps but bold.
2737 % Cf.~the definition of \cn{appendix}.
2738 % \begin{macrocode}
2739 \def\section{\@startsection{section}{1}%
2740 \z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
2741 %<amsart> {\normalfont\scshape\centering}}
2742 %<amsbook|amsproc> {\normalfont\bfseries\centering}}
2743 % \end{macrocode}
2744 %
2745 % Negative value for \arg{5} is a signal to make a run-in heading instead
2746 % of doing a vskip after the heading.
2747 % \begin{macrocode}
2748 \def\subsection{\@startsection{subsection}{2}%
2749 %<amsart> \z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
2750 %<amsbook|amsproc> \normalparindent{.5\linespacing\@plus.7\linespacing}{-.5em}%
2751 {\normalfont\bfseries}}
2752 % \end{macrocode}
2753 %
2754 % \begin{macrocode}
2755 \def\subsubsection{\@startsection{subsubsection}{3}%
2756 %<amsart> \z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
2757 %<amsbook|amsproc> \normalparindent\z@{-.5em}%
2758 {\normalfont\itshape}}
2759 % \end{macrocode}
2760 %
2761 % Fontdimen 2 of the current font is the ideal interword space of the
2762 % font. Thus the following spec says that the space after the
2763 % paragraph heading should be a normal interword space (but
2764 % nonstretching and nonshrinking).
2765 % \begin{macrocode}
2766 \def\paragraph{\@startsection{paragraph}{4}%
2767 %<amsart> \z@\z@{-\fontdimen2\font}%
2768 %<amsbook|amsproc> \normalparindent\z@{-\fontdimen2\font}%
2769 \normalfont}
2770 % \end{macrocode}
2771 %
2772 % \begin{macrocode}
2773 \def\subparagraph{\@startsection{subparagraph}{5}%
2774 \z@\z@{-\fontdimen2\font}%
2775 \normalfont}
2776 % \end{macrocode}
2777 %
2778 % \begin{macrocode}
2779 %<*amsart|amsproc>
2780 \def\appendix{\par\c@section\z@ \c@subsection\z@
2781 \let\sectionname\appendixname
2782 \def\thesection{\@Alph\c@section}}
2783 \def\appendixname{Appendix}
2784 %</amsart|amsproc>
2785 % \end{macrocode}
2786 %
2787 % A slower, but fully expandable definition of \cs{@Roman} to avoid
2788 % the nonexpandable \cn{uppercase} which is undesirable in certain
2789 % circumstances.
2790 % \begin{macrocode}
2791 \def\@Roman#1{\@xp\@slowromancap
2792 \romannumeral#1@}%
2793 %
2794 \def\@slowromancap#1{\ifx @#1% then terminate
2795 \else
2796 % \end{macrocode}
2797 % Note: \cs{if} is required here, not \cs{ifx}, because
2798 % \cs{romannumeral} returns category 12 letters!
2799 % \begin{macrocode}
2800 \if i#1I\else\if v#1V\else\if x#1X\else\if l#1L\else\if
2801 c#1C\else\if m#1M\else#1\fi\fi\fi\fi\fi\fi
2802 \@xp\@slowromancap
2803 \fi
2804 }
2805 % \end{macrocode}
2806 %
2807 % \subsection{Book features}
2808 % Books (monographs) comprise three distinct sections,
2809 % \cn{frontmatter}, \cn{mainmatter}, and \cn{backmatter}. The
2810 % \cn{frontmatter} would consist of the title page, copyright page,
2811 % table of contents, preface, etc. The \cn{mainmatter} would
2812 % be the body of the book. The \cn{backmatter} would include the
2813 % appendix, bibliography, glossary, and index.
2814 % \begin{macrocode}
2815 %<*amsbook>
2816 \def\frontmatter{\cleardoublepage\pagenumbering{roman}}
2817 \def\mainmatter{\cleardoublepage\pagenumbering{arabic}}
2818 \def\backmatter{%
2819 \if@openright\cleardoublepage\else\clearpage\fi
2820 \let\chaptername\relax}
2821 %</amsbook>
2822 % \end{macrocode}
2823 %
2824 % Book proceedings and monographs allow a signature to print at the
2825 % end of a preface.
2826 % \begin{macrocode}
2827 %<*!amsart>
2828 \def\aufm#1{\par\vspace*{12pt}{\flushright #1\par}}
2829 %</!amsart>
2830 % \end{macrocode}
2831 %
2832 % Monographs can have a special exercise environment.
2833 %
2834 % \begin{macrocode}
2835 %<*amsbook>
2836 \newenvironment{xcb}{%
2837 \setcounter{enumi}{0}%
2838 \settowidth{\leftmargini}{\labelenumi\hskip\labelsep}%
2839 \setcounter{enumii}{4}% letter d
2840 \settowidth{\leftmarginii}{\labelenumii\hskip\labelsep}%
2841 \@startsection{section}% counter name; ignored because of the
2842 % * below
2843 {1}% sectioning level
2844 {\z@}% indent to the left of the section title
2845 {18\p@\@plus2\p@}% vertical space above
2846 {1sp}% Space below of 13pt base-to-base, so none needs to be added
2847 % here; but \z@ would cause the following text to be run-in, so we
2848 % use 1sp instead.
2849 {\bfseries}% The font of the subsection title
2850 *% always unnumbered
2851 }{%
2852 \par
2853 }
2854 %</amsbook>
2855 % \end{macrocode}
2856 %
2857 % \subsection{Book chapters}
2858 % The \cn{chapter} command is provided only in the \cls{amsbook} class,
2859 % not in \cls{amsart} or \cls{amsproc}.
2860 % \begin{macrocode}
2861 %<*amsbook>
2862 \def\chapter{%
2863 \if@openright\cleardoublepage\else\clearpage\fi
2864 \thispagestyle{plain}\global\@topnum\z@
2865 \@afterindenttrue \secdef\@chapter\@schapter}
2866 % \end{macrocode}
2867 % \cs{@chapter} for numbered chapters.
2868 % \begin{macrocode}
2869 \def\@chapter[#1]#2{\refstepcounter{chapter}%
2870 \ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
2871 \else \let\@secnumber\thechapter \fi
2872 \typeout{\chaptername\space\@secnumber}%
2873 \def\@toclevel{0}%
2874 \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}%
2875 \else \@tocwriteb\tocchapter{chapter}{#2}\fi
2876 \chaptermark{#1}%
2877 \addtocontents{lof}{\protect\addvspace{10\p@}}%
2878 \addtocontents{lot}{\protect\addvspace{10\p@}}%
2879 \@makechapterhead{#2}\@afterheading}
2880 % \end{macrocode}
2881 % \cs{@schapter} for unnumbered chapters.
2882 % \begin{macrocode}
2883 \def\@schapter#1{\typeout{#1}%
2884 \let\@secnumber\@empty
2885 \def\@toclevel{0}%
2886 \ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#1}%
2887 \else \@tocwriteb\tocchapter{chapter}{#1}\fi
2888 \chaptermark{#1}%
2889 \addtocontents{lof}{\protect\addvspace{10\p@}}%
2890 \addtocontents{lot}{\protect\addvspace{10\p@}}%
2891 \@makeschapterhead{#1}\@afterheading}
2892 % \end{macrocode}
2893 %
2894 % \begin{macrocode}
2895 \newcommand\chaptername{Chapter}
2896 \newcommand\appendixname{Appendix}
2897 % \end{macrocode}
2898 %
2899 % \begin{macrocode}
2900 \def\@makechapterhead#1{\global\topskip 7.5pc\relax
2901 \begingroup
2902 \fontsize{\@xivpt}{18}\bfseries\centering
2903 % \end{macrocode}
2904 % In order to keep the chapter number ``CHAPTER III'' from
2905 % getting in the way of the \cs{topskip} we put it inside
2906 % the paragraph containing the main title. Then we have to
2907 % do some laborious \cs{rlap}ing and \cs{hskip}ing to
2908 % position it correctly.
2909 % \begin{macrocode}
2910 \ifnum\c@secnumdepth>\m@ne
2911 \leavevmode \hskip-\leftskip
2912 \rlap{\vbox to\z@{\vss
2913 \centerline{\normalsize\mdseries
2914 \uppercase\@xp{\chaptername}\enspace\thechapter}
2915 \vskip 3pc}}\hskip\leftskip\fi
2916 #1\par \endgroup
2917 \skip@34\p@ \advance\skip@-\normalbaselineskip
2918 \vskip\skip@ }
2919 % \end{macrocode}
2920 %
2921 % \begin{macrocode}
2922 \def\@makeschapterhead#1{\global\topskip 7.5pc\relax
2923 \begingroup
2924 \fontsize{\@xivpt}{18}\bfseries\centering
2925 #1\par \endgroup
2926 \skip@34\p@ \advance\skip@-\normalbaselineskip
2927 \vskip\skip@ }
2928 %</amsbook>
2929 % \end{macrocode}
2930 % The \cn{appendix} command, following the \latex/ book, marks the
2931 % start of a division after \cn{mainmatter} and before
2932 % \cn{backmatter} that consists of appendixes.
2933 % \begin{macrocode}
2934 %<*amsbook>
2935 \def\appendix{\par
2936 \c@chapter\z@ \c@section\z@
2937 \let\chaptername\appendixname
2938 \def\thechapter{\@Alph\c@chapter}}
2939 %</amsbook>
2940 % \end{macrocode}
2941 %
2942 % \subsection{Table of contents macros}
2943 %
2944 % \cn{tableofcontents} is like \cn{chapter} or \cn{section} except
2945 % for no number and no table of contents entry.
2946 %
2947 % \cs{@pnumwidth} is the maximum width for page numbers in a table of
2948 % contents. |1.6em| allows enough room for three digits.
2949 % \begin{macrocode}
2950 \newcommand{\@pnumwidth}{1.6em}
2951 % \end{macrocode}
2952 % \cs{@tocrmarg} is \cs{@pnumwidth} plus the desired minimum
2953 % space (|1em|) between page numbers and the preceding text.
2954 % \begin{macrocode}
2955 \newcommand{\@tocrmarg}{2.6em}
2956 %<amsart>\setcounter{tocdepth}{2}
2957 %<amsbook|amsproc>\setcounter{tocdepth}{1}
2958 % \end{macrocode}
2959 %
2960 % \begin{macrocode}
2961 \newswitch{toc}
2962 \newswitch{lof}
2963 \newswitch{lot}
2964 % \end{macrocode}
2965 %
2966 % Since table of contents, list of figures and list of figures
2967 % are identical in design as far as the chapter heading and other
2968 % preliminaries go, we redefine \cs{@starttoc} to do the necessary
2969 % work, rather than defining a new macro (which would use up another
2970 % control sequence name).
2971 %
2972 % We define first the article form of \cs{@starttoc}, then the book
2973 % form.
2974 %
2975 % Owing to confusion about what font to use for \cn{contentsname}, a
2976 % symbolic name has been assigned to provide flexibility.
2977 % \begin{macrocode}
2978 %<*amsart|amsproc>
2979 \newcommand\contentsnamefont{\scshape}
2980 % \end{macrocode}
2981 %
2982 % \begin{macrocode}
2983 \def\@starttoc#1#2{\begingroup
2984 \setTrue{#1}%
2985 % \end{macrocode}
2986 % Remove the skip after the abstract so that we can substitute another.
2987 % \begin{macrocode}
2988 \par\removelastskip\vskip\z@skip
2989 % \end{macrocode}
2990 % The first two arguments of \cs{@startsection} here are special values
2991 % that cause different internal branches to be taken.
2992 %\begin{verbatim}
2993 % Arguments: {} = name = empty
2994 % \@M = no number should be used and no table of contents entry
2995 % \z@ = indent amount
2996 % 12pt + 12pt = vskip before
2997 % 6pt = vskip after
2998 % \centering\contentsnamefont = format
2999 %\end{verbatim}
3000 % \begin{macrocode}
3001 \@startsection{}\@M\z@{\linespacing\@plus\linespacing}%
3002 {.5\linespacing}{\centering\contentsnamefont}{#2}%
3003 % \end{macrocode}
3004 % If we have a list of figures or list of tables we want to put
3005 % them in the main table of contents, but we don't want to put an
3006 % entry there for the main table of contents itself. So we check
3007 % to see if argument 2 is \cn{contentsname} and if it is then
3008 % we refrain from doing \cn{addcontentsline}.
3009 % \begin{macrocode}
3010 \ifx\contentsname#2%
3011 \else \addcontentsline{toc}{section}{#2}\fi
3012 \makeatletter
3013 \@input{\jobname.#1}%
3014 \if@filesw
3015 \@xp\newwrite\csname tf@#1\endcsname
3016 \immediate\@xp\openout\csname tf@#1\endcsname \jobname.#1\relax
3017 \fi
3018 \global\@nobreakfalse \endgroup
3019 \addvspace{32\p@\@plus14\p@}%
3020 \let\tableofcontents\relax
3021 }
3022 %</amsart|amsproc>
3023 % \end{macrocode}
3024 % And here is the book form of \cs{@starttoc}.
3025 % \begin{macrocode}
3026 %<*amsbook>
3027 \def\@starttoc#1#2{%
3028 \begingroup
3029 \setTrue{#1}%
3030 % \end{macrocode}
3031 % Inside this group we change \cs{secdef} so that we can call
3032 % \cn{chapter} and only get the preliminary part of its definition
3033 % that we need.
3034 % \begin{macrocode}
3035 \let\secdef\@gobbletwo \chapter
3036 % \end{macrocode}
3037 % If we have a list of figures or list of tables we want to put
3038 % them in the main table of contents, but we don't want to put an
3039 % entry there for the main table of contents itself. So we check
3040 % to see if argument 2 is \cn{contentsname} and if it is then
3041 % we refrain from doing \cn{addcontentsline}.
3042 % \begin{macrocode}
3043 \let\@secnumber\@empty % for \@tocwrite and \chaptermark
3044 \ifx\contentsname#2%
3045 \else \@tocwrite{chapter}{#2}\fi
3046 % \end{macrocode}
3047 % Now we do the equivalent of \cs{@schapter}. Expand \arg{2} so that
3048 % it will be easy to apply uppercasing to it. (For \cs{@starttoc} we
3049 % assume that \arg{2} is always a control such as \cn{contentsname}.)
3050 % \begin{macrocode}
3051 \typeout{#2}\@xp\chaptermark\@xp{#2}%
3052 \@makeschapterhead{#2}\@afterheading
3053 % \end{macrocode}
3054 % Protect against document classes that have nonzero \cs{parskip}.
3055 % \begin{macrocode}
3056 \parskip\z@skip
3057 % \end{macrocode}
3058 % And finally we read in the \fn{.toc} (or whatever) file.
3059 % \begin{macrocode}
3060 \makeatletter
3061 \@input{\jobname.#1}%
3062 \if@filesw
3063 \@xp\newwrite\csname tf@#1\endcsname
3064 \immediate\@xp\openout\csname tf@#1\endcsname \jobname.#1\relax
3065 \fi
3066 \global\@nobreakfalse \endgroup
3067 \newpage
3068 }
3069 %</amsbook>
3070 % \end{macrocode}
3071 %
3072 % Now it is easy to define \cn{tableofcontents} and its relatives.
3073 % \begin{macrocode}
3074 \def\contentsname{Contents}
3075 \def\listfigurename{List of Figures}
3076 \def\listtablename{List of Tables}
3077 \def\tableofcontents{%
3078 \@starttoc{toc}\contentsname
3079 }
3080 \def\listoffigures{\@starttoc{lof}\listfigurename}
3081 \def\listoftables{\@starttoc{lot}\listtablename}
3082 % \end{macrocode}
3083 %
3084 % In order to automatically leave enough space for the `number' part
3085 % of toc entries, we compute the maximum width of the `number' part
3086 % for each sectioning level and pass that information to
3087 % \cs{@tocline} through the \fn{.aux} file.
3088 %
3089 % Init the tocindents if they are not yet set (first run).
3090 % \begin{macrocode}
3091 \AtBeginDocument{%
3092 \@for\@tempa:=-1,0,1,2,3\do{%
3093 \@ifundefined{r@tocindent\@tempa}{%
3094 \@xp\gdef\csname r@tocindent\@tempa\endcsname{0pt}}{}%
3095 }%
3096 }
3097 % \end{macrocode}
3098 %
3099 % \begin{macro}{\@writetocindents}
3100 % This function writes out the max toc indents to the aux file.
3101 % \begin{macrocode}
3102 \def\@writetocindents{%
3103 \begingroup
3104 \@for\@tempa:=-1,0,1,2,3\do{%
3105 \immediate\write\@auxout{%
3106 \string\newlabel{tocindent\@tempa}{%
3107 \csname r@tocindent\@tempa\endcsname}}%
3108 }%
3109 \endgroup}
3110 %
3111 \AtEndDocument{\@writetocindents}
3112 % \end{macrocode}
3113 % \end{macro}
3114 %
3115
3116 % \begin{macro}{\indentlabel}
3117 % This function is a no-op except in \cs{@tocwrite} where it is a
3118 % pointer to \cs{@tochangmeasure}.
3119 % \begin{macrocode}
3120 \let\indentlabel\@empty
3121 % \end{macrocode}
3122 % \end{macro}
3123 %
3124 % \begin{macro}{\@tochangmeasure}
3125 % This function measures the hangindent part of a toc entry and
3126 % updates the current max for the given sectioning level, if
3127 % necessary. The max's at the end of the document will be written
3128 % in the form of a pseudo-label to the \fn{.aux} file by
3129 % \cs{@writetocindents}.
3130 %
3131 % We can assume that \cs{@tochangmeasure} is already inside a group
3132 % when called.
3133 % \begin{macrocode}
3134 \def\@tochangmeasure#1{\sbox\z@{#1}%
3135 \ifdim\wd\z@>\csname r@tocindent\@toclevel\endcsname\relax
3136 \@xp\xdef\csname r@tocindent\@toclevel\endcsname{\the\wd\z@}%
3137 \fi
3138 }
3139 % \end{macrocode}
3140 % \end{macro}
3141 %
3142 % \begin{macro}{\@toclevel}
3143 % Initialize, for the record.
3144 % \begin{macrocode}
3145 \def\@toclevel{0}
3146 % \end{macrocode}
3147 % \end{macro}
3148 %
3149 % Since we don't have leader dots, we have \cs{@tocline} instead of
3150 % \cs{@dottedtocline}.
3151 % \begin{macrocode}
3152 \def\@tocline#1#2#3#4#5#6#7{\relax
3153 \ifnum #1>\c@tocdepth % then omit
3154 \else
3155 \par \addpenalty\@secpenalty\addvspace{#2}%
3156 \begingroup \hyphenpenalty\@M
3157 \@ifempty{#4}{%
3158 \@tempdima\csname r@tocindent\number#1\endcsname\relax
3159 }{%
3160 \@tempdima#4\relax
3161 }%
3162 \parindent\z@ \leftskip#3\relax \advance\leftskip\@tempdima\relax
3163 \rightskip\@pnumwidth plus4em \parfillskip-\@pnumwidth
3164 #5\leavevmode\hskip-\@tempdima #6\nobreak\relax
3165 \hfil\hbox to\@pnumwidth{\@tocpagenum{#7}}\par
3166 \nobreak
3167 \endgroup
3168 \fi}
3169 % \end{macrocode}
3170 %
3171 % \begin{macrocode}
3172 \def\@tocpagenum#1{\hss{\mdseries #1}}
3173 % \end{macrocode}
3174 %
3175 % The function \cs{@tocwrite} writes the information of a section
3176 % heading to the \fn{.toc} file in a standard form. It allows
3177 % different functions to be substituted for \cs{numberline}, to get
3178 % greater control of toc formatting.
3179 % \begin{macrocode}
3180 \def\@tocwrite#1{\@xp\@tocwriteb\csname toc#1\endcsname{#1}}
3181 % \end{macrocode}
3182 % The \cn{chapter} command uses \cs{@tocwriteb} directly because of
3183 % the need to write slightly different things to the toc file
3184 % depending on the current value of \cn{chaptername}.
3185 % \begin{macrocode}
3186 \def\@tocwriteb#1#2#3{%
3187 \begingroup
3188 \def\@tocline##1##2##3##4##5##6{%
3189 \ifnum##1>\c@tocdepth
3190 \else \sbox\z@{##5\let\indentlabel\@tochangmeasure##6}\fi}%
3191 \csname l@#2\endcsname{#1{\csname#2name\endcsname}{\@secnumber}{}}%
3192 \endgroup
3193 \addcontentsline{toc}{#2}%
3194 {\protect#1{\csname#2name\endcsname}{\@secnumber}{#3}}}
3195 % \end{macrocode}
3196 %
3197 % Specs for monograph toc are as follows (tocdepth is 1, i.e.,
3198 % subsections and lower are not listed in toc).
3199 %\begin{verbatim}
3200 % Part: Space above 12pt plus2pt, indent 0pt, "Part" + wordspace +
3201 % number + "." + 1em + title (raggedright, no hangindent) + 1em +
3202 % page number in column 1.6em wide.
3203 %
3204 % Chapter: Space above 8pt, hangindent on ("Chapter 0" + "." + 1em),
3205 % + title (raggedright) + 1em + page number in column 1.6em wide.
3206 %
3207 % Appendix: Same as Chapter except for epithet "Appendix M"
3208 %
3209 % Section: Space above 0pt, hangindent on (1pc + "0.0" + "." + 1em),
3210 % + title (raggedright) + 1em + page number in column 1.6em wide.
3211 %\end{verbatim}
3212 %
3213 % Specs for article toc are as follows (tocdepth 2):
3214 %\begin{verbatim}
3215 % Section: Same as for monograph.
3216 %
3217 % Subsection: Space above 0pt, hangindent 6pc (number + "." + 1em),
3218 % + title (raggedright) + 1em + page number in column 1.6em wide.
3219 %
3220 % Subsubsection: Same as subsection but hangindent 8pc
3221 %\end{verbatim}
3222 %
3223 % Typical invocation of \cs{l@chapter}:
3224 %\begin{verbatim}
3225 % \contentsline{chapter}{%
3226 % \tocchapter{Chapter}{3}{Some title stuff}}{103}
3227 % -->\l@chapter-->
3228 % #1 #2 #3 #4 #5
3229 % \@tocline{0}{8pt}{0pt}{}{\bfseries}
3230 % #6 6a 6b 6c #7
3231 % {\tocchapter{Chapter}{3}{Some title stuff}}{103}
3232 %\end{verbatim}%
3233 % The \cs{tocchapter} is a slightly more useful form than
3234 % \cs{numberline} that allows control for optionally omitting strings
3235 % like `Chapter' or changing fonts for subcomponents of the toc
3236 % entry. Note that it is allowed to have appendix and chapter at the
3237 % same toc level, with \cs{tocappendix} instead of \cs{tocchapter}
3238 % written in the \fn{.toc} file.
3239 %
3240 % The arguments of \cs{@tocline} are as follows:
3241 %\begin{verbatim}
3242 % \@tocline{LEVEL}{VSPACE}{INDENT}{NUMBERWIDTH}{EXTRA}%
3243 % {TEXT}{PAGENUM}
3244 %\end{verbatim}%
3245 % where `numberwidth' is the width of the box allotted to contain the
3246 % section number, including any preceding word like `Chapter' or
3247 % `Part'. If this width arg is empty then an automatically computed
3248 % width (max over TOC of the numberwidths for this level) is used.
3249 % The `extra' argument is formatting such as font changes.
3250 % The `text' argument contains a section-command specific function
3251 % like \cs{tocsection} or \cs{tocchapter} which takes in turn three
3252 % arguments: epithet, number, topic.
3253 % \begin{macrocode}
3254 \def\l@section{\@tocline{1}{0pt}{1pc}{}{}}
3255 % \end{macrocode}
3256 % *** The indents do not agree between in-house and distributed ***\\
3257 % *** versions; no changes; get specs before revising. ***\\
3258 % The use of \cn{ignorespaces} in \cs{tocsection} and its relatives
3259 % means that if \arg{1} is empty, the following space will be also
3260 % removed.
3261 % \begin{macrocode}
3262 \newcommand{\tocsection}[3]{%
3263 \indentlabel{\@ifnotempty{#2}{\ignorespaces#1 #2.\quad}}#3}
3264 \def\l@subsection{\@tocline{2}{0pt}{1pc}{5pc}{}}
3265 \let\tocsubsection\tocsection
3266 \def\l@subsubsection{\@tocline{3}{0pt}{1pc}{7pc}{}}
3267 \let\tocsubsubsection\tocsection
3268 \let\l@paragraph\l@subsubsection
3269 \let\tocparagraph\tocsection
3270 \let\l@subparagraph\l@subsubsection
3271 \let\tocsubparagraph\tocsection
3272 %
3273 \def\l@part{\@tocline{-1}{12pt plus2pt}{0pt}{}{\bfseries}}
3274 \let\tocpart\tocsection
3275 \def\l@chapter{\@tocline{0}{8pt plus1pt}{0pt}{}{}}
3276 \let\tocchapter\tocsection
3277 % \end{macrocode}
3278 % In this case we are pretty sure the word "Appendix" or similar is
3279 % present, so only check if arg 2 is empty:
3280 % \begin{macrocode}
3281 \newcommand{\tocappendix}[3]{%
3282 \indentlabel{#1\@ifnotempty{#2}{ #2}.\quad}#3}
3283 % \end{macrocode}
3284 %
3285 % \begin{macrocode}
3286 \def\l@figure{\@tocline{0}{3pt plus2pt}{0pt}{1.5pc}{}}
3287 \let\l@table=\l@figure
3288 % \end{macrocode}
3289 %
3290 % \subsection{Bibliography section or chapter}
3291 %
3292 % Following the \pkg{babel} package, we use \cn{refname} in articles
3293 % and \cn{bibname} in books.
3294 % \begin{macrocode}
3295 \def\refname{References}
3296 \def\bibname{Bibliography}
3297 % \end{macrocode}
3298 %
3299 % Restudy the following code; \cs{bibsetup} isn't used anywhere
3300 % although it's defined for the three different bibstyles.
3301 % Because some publications have different default label styles,
3302 % separate that out for easy tailoring of packages.
3303 % \begin{macrocode}
3304 \def\@defaultbiblabelstyle#1{#1.}
3305 \def\bibliographystyle#1{%
3306 \if@filesw\immediate\write\@auxout{\string\bibstyle{#1}}\fi
3307 \def\@tempa{#1}%
3308 \def\@tempb{amsplain}%
3309 \def\@tempc{}%
3310 \ifx\@tempa\@tempb
3311 \def\@biblabel##1{\@defaultbiblabelstyle{##1}}%
3312 \def\bibsetup{}%
3313 \else
3314 \def\bibsetup{\labelsep6\p@}%
3315 \ifx\@tempa\@tempc
3316 \def\@biblabel##1{}%
3317 \def\bibsetup{\labelwidth\z@ \leftmargin24\p@
3318 \itemindent-\leftmargin
3319 \labelsep\z@ }%
3320 \fi
3321 \fi}
3322 % \end{macrocode}
3323 %
3324 % Permit easy change of font size for unusual purpose, e.g., for
3325 % an author's ``life list'' in collected works. [bnb, 2004/04/01]
3326 % \begin{macrocode}
3327 \newcommand{\bibliofont}{\footnotesize}
3328 % \end{macrocode}
3329 %
3330 % \env{thebibliography} differs in some author packages only in the
3331 % shape of the title; make this easy to change. [bnb, 2004/05/22]
3332 % \begin{macrocode}
3333 \newcommand{\@bibtitlestyle}{%
3334 %<amsart|amsproc> \@xp\section\@xp*\@xp{\refname}%
3335 %<amsbook> \@xp\chapter\@xp*\@xp{\bibname}%
3336 }
3337 \newenvironment{thebibliography}[1]{%
3338 \@bibtitlestyle
3339 \normalfont\bibliofont\labelsep .5em\relax
3340 \renewcommand\theenumiv{\arabic{enumiv}}\let\p@enumiv\@empty
3341 \list{\@biblabel{\theenumiv}}{\settowidth\labelwidth{\@biblabel{#1}}%
3342 \leftmargin\labelwidth \advance\leftmargin\labelsep
3343 \usecounter{enumiv}}%
3344 \sloppy \clubpenalty\@M \widowpenalty\clubpenalty
3345 \sfcode`\.=\@m
3346 }{%
3347 % \end{macrocode}
3348 % Change error for empty list (no items) to warning, to allow authors
3349 % to leave their bibliography temporarily empty during writing:
3350 % \begin{macrocode}
3351 \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
3352 \endlist
3353 }
3354 % \end{macrocode}
3355 %
3356 % The \cn{bysame} command prints a horizontal dash indicating
3357 % repetition of the author's name in consecutive bibliography
3358 % entries.
3359 % \begin{macrocode}
3360 \def\bysame{\leavevmode\hbox to3em{\hrulefill}\thinspace}
3361 % \end{macrocode}
3362 % We define \cn{newblock} even though it's not needed for AMS
3363 % publication style, just to avoid error messages when a non-AMS
3364 % \fn{.bst} file is used. This is a convenience for users; use of
3365 % \cn{newblock} is not recommended for submissions to the AMS.
3366 % \begin{macrocode}
3367 \def\newblock{}
3368 % \end{macrocode}
3369 %
3370 % \begin{macro}{\MR}
3371 % \begin{macro}{\MRhref}
3372 % Provide an MR number for a bibliography item. At the moment
3373 % [mjd,1995/08/07] this only prints the MR number, but later
3374 % we expect to extend it to write an HTML \cs{special} to the
3375 % \fn{.dvi} file.
3376 %
3377 % The presentation of the MR number has been simplified (from using
3378 % a bold volume number) coincident with the change in the MathSciNet
3379 % database to a 7-digit reference number from the volume:number form.
3380 %
3381 % Ensure that an old-style MR number does not break across lines if
3382 % it contains a space; editorial request. [bnb; 2004/04/01]
3383 % Countermanded, to permit break between reference number and an
3384 % old-style number following in parentheses. [bnb; 2004/06/11]
3385 % \begin{macrocode}
3386 \newcommand\MR[1]{\relax\ifhmode\unskip\spacefactor3000 \space\fi
3387 MR~\MRhref{#1}{#1}}
3388 % \end{macrocode}
3389 %
3390 % \begin{macrocode}
3391 \let\MRhref\@gobble
3392 % \end{macrocode}
3393 % \end{macro}
3394 % \end{macro}
3395 %
3396 % \begin{macro}{\URL}
3397 % \begin{macro}{\URLhref}
3398 % \begin{macro}{\@URL}
3399 % Allows sticking in an arbitrary URL in a bibliography. Leading
3400 % ``http'' is not assumed. Call \cn{verb} to ensure that special
3401 % characters in the URL don't cause trouble.
3402 % \begin{macrocode}
3403 \newcommand\URL{\begingroup
3404 \def\@sverb##1{%
3405 \def\@tempa####1##1{\@URL{####1}\egroup\endgroup}%
3406 \@tempa}%
3407 \verb}
3408 % \end{macrocode}
3409 %
3410 % \begin{macrocode}
3411 \let\URLhref\@gobble
3412 \def\@URL#1{\URLhref{#1}#1}
3413 % \end{macrocode}
3414 % \end{macro}
3415 % \end{macro}
3416 % \end{macro}
3417 %
3418 % \subsection{Index section or chapter}
3419 %
3420 % Chapter or section heading for an index. Index is set up to be two
3421 % columns.
3422 % \begin{macrocode}
3423 \newif\if@restonecol
3424 % \end{macrocode}
3425 %
3426 % \begin{macrocode}
3427 %<*amsbook>
3428 \def\indexchap#1{\global\topskip 7.5pc\relax
3429 \twocolumn[{\fontsize{\@xivpt}{18}\bfseries\centering
3430 \vskip\topskip\hbox{}\vskip-\baselineskip% adjust top space
3431 #1\par
3432 % \end{macrocode}
3433 % After \cs{twocolumn} finishes operating, the top material is left in an
3434 % insert register, and topskip will now be applied above the
3435 % following material. So we should set it to the normal
3436 % after-chapter-title space (34pt)---cf.~\cs{@makeschapterhead}.
3437 % \begin{macrocode}
3438 \global\topskip 34\p@\relax
3439 \ifx\@empty\indexintro
3440 \else
3441 \begingroup \normalsize
3442 \skip@\topskip \advance\skip@ -\baselineskip
3443 \vskip\skip@
3444 \parbox[t]{24pc}{\normalfont\indexintro\par}%
3445 \endgroup
3446 \global\topskip 24\p@\relax
3447 \fi
3448 }]%
3449 }
3450 \newcommand{\indexintro}{}
3451 %</amsbook>
3452 % \end{macrocode}
3453 %
3454 % \env{theindex} differs in some author packages only in the
3455 % shape of the title; make this easy to change. [bnb, 2004/05/22]
3456 % \begin{macrocode}
3457 \newcommand{\@indextitlestyle}{%
3458 %<*amsbook>
3459 \let\@makeschapterhead\indexchap
3460 \@xp\chapter\@xp*\@xp{\indexname}%
3461 %</amsbook>
3462 %<amsart|amsproc> \twocolumn[\@xp\section\@xp*\@xp{\indexname}]%
3463 }
3464 \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
3465 \columnseprule\z@ \columnsep 35\p@
3466 \@indextitlestyle
3467 \thispagestyle{plain}%
3468 \let\item\@idxitem
3469 \parindent\z@ \parskip\z@\@plus.3\p@\relax
3470 \raggedright
3471 \hyphenpenalty\@M
3472 \footnotesize}
3473 % \end{macrocode}
3474 %
3475 % \begin{macrocode}
3476 \def\indexname{Index}
3477 % \end{macrocode}
3478 %
3479 % \begin{macrocode}
3480 \def\@idxitem{\par\hangindent 2em}
3481 \def\subitem{\par\hangindent 2em\hspace*{1em}}
3482 \def\subsubitem{\par\hangindent 3em\hspace*{2em}}
3483 \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
3484 \def\indexspace{\par\bigskip}
3485 % \end{macrocode}
3486 %
3487 % \subsection{Footnotes}
3488 % In books the footnote counter should reset to 0 at the beginning of
3489 % each chapter:
3490 % \begin{macrocode}
3491 %<amsbook>\@addtoreset{footnote}{chapter}
3492 % \end{macrocode}
3493 %
3494 % Rule above footnotes is 5 picas wide.
3495 % \begin{macrocode}
3496 \def\footnoterule{\kern-.4\p@
3497 \hrule\@width 5pc\kern11\p@\kern-\footnotesep}
3498 % \end{macrocode}
3499 %
3500 % A simple superscript doesn't work here; it fails on a minipage,
3501 % where \cs{itshape} (which is invalid in math mode) is used for the
3502 % footnote numbers. Cf.~ the definition of \cn{textprime}.
3503 % \begin{macrocode}
3504 \def\@makefnmark{%
3505 \leavevmode
3506 \raise.9ex\hbox{\fontsize\sf@size\z@\normalfont\@thefnmark}%
3507 }
3508 %
3509 \def\@makefntext{\indent\@makefnmark}
3510 % \end{macrocode}
3511 % Add \cn{normalfont} before \cn{footnotesize} so that
3512 % fonts will come out properly using the new font selection scheme.
3513 % \begin{macrocode}
3514 \long\def\@footnotetext#1{%
3515 \insert\footins{%
3516 \normalfont\footnotesize
3517 \interlinepenalty\interfootnotelinepenalty
3518 \splittopskip\footnotesep \splitmaxdepth \dp\strutbox
3519 \floatingpenalty\@MM \hsize\columnwidth
3520 % \end{macrocode}
3521 % Mostly \cs{@parboxrestore} does what we want; but not with
3522 % respect to \cs{parindent} and \cs{tolerance}.
3523 % \begin{macrocode}
3524 \@parboxrestore \parindent\normalparindent \sloppy
3525 \protected@edef\@currentlabel{%
3526 \csname p@footnote\endcsname\@thefnmark}%
3527 \@makefntext{%
3528 \rule\z@\footnotesep\ignorespaces#1\unskip\strut\par}}}
3529 % \end{macrocode}
3530 % We change \cn{sloppy} to keep it from overriding our normal value of
3531 % 1pt for \cs{hfuzz} and \cs{vfuzz} with a LESS sloppy value (.5pt).
3532 % \begin{macrocode}
3533 \hfuzz=1pt \vfuzz=\hfuzz
3534 \def\sloppy{\tolerance9999 \emergencystretch 3em\relax}
3535 % \end{macrocode}
3536 %
3537 % \subsection{Float placement parameters}
3538 % These control the placing of floating objects like tables and
3539 % figures. We use much more tolerant values than the \latex/ defaults;
3540 % the \latex/ defaults are geared to fussier page breaks, at a price of
3541 % requiring more manual intervention to deal with difficult page
3542 % breaking problems.
3543 %
3544 % When using \latex/'s twocolumn option, `page' really means `column',
3545 % for the parameters that don't have a dbl prefix: that is, topnumber
3546 % is then the maximum number of top figures allowed in each column,
3547 % and so forth.
3548 % \begin{description}
3549 % \item[topnumber] maximum number of top figures allowed per page
3550 % \item[bottomnumber] maximum number of bottom figures allowed per page
3551 % \item[totalnumber] maximum number of figures (top and bottom) allowed
3552 % per page
3553 % \item[dbltopnumber] same as topnumber, but for two-column wide
3554 % figures, when double-column format is used
3555 % \end{description}
3556 % \begin{macrocode}
3557 \setcounter{topnumber}{4}
3558 \setcounter{bottomnumber}{4}
3559 \setcounter{totalnumber}{4}
3560 \setcounter{dbltopnumber}{4}
3561 % \end{macrocode}
3562 % Float fraction parameters.
3563 % \begin{description}
3564 % \item[\cs{topfraction}] maximum part of the page allowed for top
3565 % figures, expressed as a decimal fraction. The value of .97 means
3566 % roughly `accept pages that have only two lines of text, and the
3567 % rest figures'.
3568 % \item[\cs{bottomfraction}] same as \cs{topfraction}, but for bottom
3569 % figures
3570 % \item[\cs{textfraction}] \emph{minimum} part of the page that must be
3571 % occupied by text, if the page is to have any text at all. If this
3572 % value cannot be achieved, \latex/ will turn the current figure or
3573 % figures into a ``float page'', i.e., a page of figures without any
3574 % text.
3575 % \item[\cs{floatpagefraction}] minimum amount (that is, total combined
3576 % height) of figures needed before \latex/ will make a float page. This
3577 % is expressed as a fraction of the normal page height.
3578 % \item[\cs{dbltopfraction}] like \cs{topfraction}, but applies only to
3579 % figures that are two columns wide, when double-column format is
3580 % used.
3581 % \item[\cs{dblfloatpagefraction}] minimum amount of double-column
3582 % figure material needed before \latex/ will make a two-column wide
3583 % ``float page''
3584 % \end{description}
3585 % \begin{macrocode}
3586 \renewcommand{\topfraction}{.97}
3587 \renewcommand{\bottomfraction}{.97}
3588 \renewcommand{\textfraction}{.03}
3589 \renewcommand{\floatpagefraction}{.9}
3590 \renewcommand{\dbltopfraction}{.97}
3591 \renewcommand{\dblfloatpagefraction}{.9}
3592 % \end{macrocode}
3593 %
3594 % We also modify the default values for spacing around floating
3595 % figures: (A) so that figures on a float page will not be
3596 % vertically centered on the total page height but will
3597 % be flush at the top of the page, and (B) so that there will
3598 % be slightly more stretchability around figures, to help find better
3599 % page breaks in difficult situations.
3600 %
3601 % \begin{description}
3602 % \item[\cs{floatsep}] Space between consecutive figures
3603 % \item[\cs{textfloatsep}] Space between text and top or bottom figures
3604 % \item[\cs{intextsep}] Space above and below a figure in the middle of
3605 % the text (i.e., placed with the |[h]| option)
3606 % \item[\cs{dblfloatsep}] Space between consecutive figures that are
3607 % two columns wide (when two-column format is used)
3608 % \item[\cs{dbltextfloatsep}] Space between double-column figures and text
3609 % \item[\cs{@fptop}] Space above the first figure on a float page
3610 % \item[\cs{@fpsep}] Space between figures on a float page
3611 % \item[\cs{@fpbot}] Space below the last figure on a float page
3612 % \item[\cs{@dblfptop}] Space above the first double-column figure on a
3613 % two-column wide float page
3614 % \item[\cs{@dblfptop}] Space between double-column figures on a two-column
3615 % wide float page
3616 % \item[\cs{@dblfptop}] Space below the last double-column figure on a
3617 % two-column wide float page
3618 % \end{description}
3619 % \begin{macrocode}
3620 \setlength{\floatsep}{12pt plus 6pt minus 4pt}
3621 \setlength{\textfloatsep}{15pt plus 8pt minus 5pt}
3622 \setlength{\intextsep}{12pt plus 6pt minus 4pt}
3623 \setlength{\dblfloatsep}{12pt plus 6pt minus 4pt}
3624 \setlength{\dbltextfloatsep}{15pt plus 8pt minus 5pt}
3625 \setlength{\@fptop}{0pt}% removed "plus 1fil"
3626 \setlength{\@fpsep}{8pt}% removed "plus 2fil"
3627 \setlength{\@fpbot}{0pt plus 1fil}
3628 \setlength{\@dblfptop}{0pt}% removed "plus 1fil"
3629 \setlength{\@dblfpsep}{8pt}% removed "plus 2fil"
3630 \setlength{\@dblfpbot}{0pt plus 1fil}
3631 % \end{macrocode}
3632 %
3633 % \cs{fps@figure}, \cs{fps@table}: placement specifications for
3634 % \env{figure} and \env{table} environments. `|tbp|' means that a
3635 % figure will be placed at the top or bottom of a page, or on a
3636 % separate page with no text. This might be changed to `|tp|', for
3637 % example, if you never want figures to appear at the bottom of a
3638 % page.
3639 % \begin{macrocode}
3640 \newcommand{\fps@figure}{tbp}
3641 \newcommand{\fps@table}{tbp}
3642 % \end{macrocode}
3643 %
3644 % Some more setup for figures.
3645 % \begin{macrocode}
3646 %<amsart|amsproc>\newcounter{figure}
3647 %<amsbook>\newcounter{figure}[chapter]
3648 \def\@captionheadfont{\scshape}
3649 \def\@captionfont{\normalfont}
3650 \def\ftype@figure{1}
3651 \def\ext@figure{lof}
3652 \def\fnum@figure{\figurename\ \thefigure}
3653 \def\figurename{Figure}
3654 \newenvironment{figure}{%
3655 \@float{figure}%
3656 }{%
3657 \end@float
3658 }
3659 \newenvironment{figure*}{%
3660 \@dblfloat{figure}%
3661 }{%
3662 \end@dblfloat
3663 }
3664 % \end{macrocode}
3665 % And similar for tables.
3666 % \begin{macrocode}
3667 %<amsart|amsproc>\newcounter{table}
3668 %<amsbook>\newcounter{table}[chapter]
3669 \def\ftype@table{2}
3670 \def\ext@table{lot}
3671 \def\fnum@table{\tablename\ \thetable}
3672 \def\tablename{Table}
3673 \newenvironment{table}{%
3674 \@float{table}%
3675 }{%
3676 \end@float
3677 }
3678 \newenvironment{table*}{%
3679 \@dblfloat{table}%
3680 }{%
3681 \end@dblfloat
3682 }
3683 % \end{macrocode}
3684 %
3685 % Change \cs{@floatboxreset} to add \cn{centering}. Centering is
3686 % always applied to tables and figures in AMS publications. It should
3687 % not be necessary to throw in |\begin{center}| \ldots |\end{center}|
3688 % in every instance to achieve this.
3689 % \begin{macrocode}
3690 \def\@floatboxreset{\global\@minipagefalse \centering}
3691 % \end{macrocode}
3692 %
3693 % This is what we want \cs{@makecaption} to do: If the total width is
3694 % greater than normal columnwidth we want to break the caption into
3695 % lines using a line width of $W$ = (columnwidth $-$ 6pc), and center
3696 % the resulting block between the margins. Otherwise we want to set
3697 % the caption as a single line, centered between the margins.
3698 %
3699 % To do this we set the caption as a vbox with line width $W$,
3700 % except that we allow the last line (which may be the only line) to
3701 % have width up to full columnwidth by adding a kern of -6pc. If the
3702 % result is a single hbox (i.e., a single line) we need to unpack the
3703 % hbox, remove rightskip, parfillskip, and the -6pc kern, and center
3704 % the remaining material. If the caption is more than one line, then
3705 % box 1 contains the last line, which we need to unpack in the same
3706 % way, and run through the paragraphing process again (because this
3707 % last line may be up to 6 picas wider than the desired width).
3708 %
3709 % In practice this procedure tends to fail if there are any potential
3710 % breakpoints near the end of the first line (in the window between
3711 % short-width and full-width). Then \TeX{} tends to choose a break
3712 % (depending on spaceskip, tolerance, etc) at the last acceptable
3713 % breakpoint before short-width is exceeded, \emph{without
3714 % considering any later material}---in particular, the negative kern.
3715 % [This was pointed out by Donald Arseneau, May 2000.] Unfortunately,
3716 % setting parfillskip to a negative value does not work either. I
3717 % guess this is a special case of the existing limitation on
3718 % parshape: you cannot specify a parshape in terms of number of lines
3719 % from the bottom of the paragraph. (We would like to specify a
3720 % parshape where the last line is 6 picas longer than the others.)
3721 %
3722 % Finally, if the caption is for a figure, it will be set below the
3723 % figure, so the separating space goes above the caption; otherwise
3724 % the separating space goes below the caption.
3725 % \begin{macrocode}
3726 \long\def\@makecaption#1#2{%
3727 % \end{macrocode}
3728 % Measure the contents of the caption. If \arg{2} is not
3729 % empty, then we must add a period and an en-space before
3730 % typesetting it. The \cs{@caption} macro adds an extra
3731 % \cn{ignorespaces} at the beginning of \arg{2}, so in order
3732 % to find out if the user-typed portion is empty we use
3733 % \cs{@cdr} to pull off the \cn{ignorespaces}.
3734 % \begin{macrocode}
3735 % Use color-safe commands
3736 \setbox\@tempboxa\vbox{\color@setgroup
3737 \advance\hsize-2\captionindent\noindent
3738 \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
3739 {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}%
3740 \unskip\kern-2\captionindent\par
3741 \global\setbox\@ne\lastbox\color@endgroup}%
3742 \ifhbox\@ne % the normal case
3743 \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
3744 \fi
3745 % \end{macrocode}
3746 % If \cs{@tempboxa} is not empty at this point then the caption was
3747 % more than one line long or there was extra vertical mode material,
3748 % maybe a \cs{write} (from \cn{index} or something).
3749 % Interestingly, we can't use \cs{ifvoid} to see if
3750 % \cs{@tempboxa} is empty, because empty is not the same thing
3751 % as void (as far as the \cs{ifvoid} test is concerned). So
3752 % instead we measure the width of \cs{@tempboxa}
3753 % to see if it's zero; this should suffice for non-bizarre cases.
3754 % \begin{macrocode}
3755 \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
3756 \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
3757 \else % tempboxa contained more than one line
3758 \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip
3759 \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
3760 \fi
3761 \ifnum\@tempcnta<64 % if the float IS a figure...
3762 \addvspace\abovecaptionskip
3763 \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
3764 \else % if the float IS NOT a figure...
3765 \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
3766 \nobreak
3767 \vskip\belowcaptionskip
3768 \fi
3769 \relax
3770 }
3771 % \end{macrocode}
3772 % Allocate the skip registers for above and below caption space.
3773 % \begin{macrocode}
3774 \newskip\abovecaptionskip \abovecaptionskip=12pt \relax
3775 \newskip\belowcaptionskip \belowcaptionskip=12pt \relax
3776 \newdimen\captionindent \captionindent=3pc
3777 % \end{macrocode}
3778 %
3779 % \subsection{Miscellaneous}
3780 %
3781 % \begin{macro}{\nonbreakingspace}
3782 % Change \qc{\~} to be more forgiving of accidental adjacent spaces.
3783 % Note that this means multiple |~~~...| cannot be used to get
3784 % multiple spaces in the output.
3785 % \begin{macrocode}
3786 \def\nonbreakingspace{\unskip\nobreak\ \ignorespaces}
3787 \def~{\protect\nonbreakingspace}
3788 % \end{macrocode}
3789 % \end{macro}
3790 %
3791 % Redefine \cs{@biblabel} to do nothing if the argument is empty. We
3792 % don't really care what the previous definition was so we don't
3793 % check it.
3794 % \begin{macrocode}
3795 \def\@biblabel#1{\@ifnotempty{#1}{[#1]}}
3796 % \end{macrocode}
3797 % Changed \cs{@cite} to always use roman/upright, nonbold font, even
3798 % in italic or bold text (following AMS style).
3799 % Turn off \cs{mathsurround} just in case there are subscripts in the
3800 % cite numbers.
3801 % \begin{macrocode}
3802 \def\@citestyle{\m@th\upshape\mdseries}
3803 %<amsart>\let\citeform\@firstofone
3804 %<amsbook|amsproc>\def\citeform#1{{\bfseries#1}}
3805 \def\@cite#1#2{{%
3806 \@citestyle[\citeform{#1}\if@tempswa, #2\fi]}}
3807 % \end{macrocode}
3808 %
3809 % Make \cn{cite} robust if it isn't already. Too many unsuspecting
3810 % users get problems from this in a figure or table caption.
3811 % \begin{macrocode}
3812 \@ifundefined{cite }{%
3813 \expandafter\let\csname cite \endcsname\cite
3814 \edef\cite{\@nx\protect\@xp\@nx\csname cite \endcsname}%
3815 }{}
3816 % \end{macrocode}
3817 %
3818 % \begin{macro}{\fullwidthdisplay}
3819 % The function \cs{fullwidthdisplay} makes a displayed equation take
3820 % up the full column width even if the current context is an indented
3821 % list.
3822 % \begin{macrocode}
3823 \def\fullwidthdisplay{\displayindent\z@ \displaywidth\columnwidth}
3824 % \end{macrocode}
3825 % And we insert the \cs{fullwidthdisplay} function at the beginning of
3826 % \cs{everydisplay} just in case any later code in \cs{everydisplay}
3827 % needs to use the values of \cs{displayindent} or \cs{displaywidth}.
3828 % \begin{macrocode}
3829 \edef\@tempa{\noexpand\fullwidthdisplay\the\everydisplay}
3830 \everydisplay\expandafter{\@tempa}
3831 % \end{macrocode}
3832 % \end{macro}
3833 %
3834 % A few odds and ends for indexes, based on \pkg{makeindex}. The
3835 % definition of \cn{see} as ``see also'' is unfortunate, but of
3836 % long standing, and cannot be changed without destroying backward
3837 % compatibility, so an alternate command, \cn{seeonly}, is provided
3838 % to cover the basic situation.
3839 % \begin{macrocode}
3840 \newcommand*\seeonlyname{see}
3841 \newcommand*\seename{see also}
3842 \newcommand*\alsoname{see also}
3843 \newcommand*\seeonly[2]{\emph{\seeonlyname} #1}
3844 \newcommand*\see[2]{\emph{\seename} #1}
3845 \newcommand*\seealso[2]{\emph{\alsoname} #1}
3846 \newcommand\printindex{\@input{\jobname.ind}}
3847 % \end{macrocode}
3848 %
3849 % \begin{macro}{\textprime}
3850 % A text prime symbol, for applying primes to numbers such as list
3851 % numbers or equation numbers that are not really math. Furthermore
3852 % Cyrillic myagkii znak, or soft sign, is represented by a prime
3853 % symbol in Russian names when they are transliterated into English.
3854 %
3855 % \cn{textprime} uses the prime symbol from math, but because it's
3856 % intended specifically for nonmath use, we avoid going through math
3857 % mode with \verb'$...$'. We must therefore call \cs{check@mathfonts}
3858 % to ensure that \verb'scriptfont2' is actually defined. Otherwise,
3859 % if \cn{textprime} were used in a document before the first math
3860 % formula, there would be no adequate assignment yet for
3861 % \verb'\scriptfont2'.
3862 %
3863 % The raise value of \verb'.8ex' is just a reasonable guess at making
3864 % the bottom of the prime symbol fall near the top of a preceding
3865 % lowercase letter but still not fall too low on an uppercase letter.
3866 % We could look up the \cs{fontdimen} values used in math mode for
3867 % superscripts but I don't think it's worth the bother.
3868 %
3869 % Cf.~also the definition of \cs{@makefnmark}. The prime symbol here
3870 % is not raised quite so high because I think that is desirable for
3871 % the soft-sign usage.
3872 % \begin{macrocode}
3873 \DeclareRobustCommand\textprime{\leavevmode
3874 \raise.8ex\hbox{\check@mathfonts\the\scriptfont2 \char48 }}
3875 % \end{macrocode}
3876 % \end{macro}
3877 %
3878 % \subsection{Book style variations}
3879 % Here is the layout for a \cn{maketitle} in the \cls{amsbook} class.
3880 % \begin{macrocode}
3881 %<*amsbook>
3882 \def\maketitle{\par
3883 \@topnum\z@ % this prevents figures from falling at the top of page 1
3884 \begingroup
3885 \@maketitle
3886 \endgroup
3887 \c@footnote\z@
3888 \def\do##1{\let##1\relax}%
3889 \do\maketitle \do\@maketitle \do\title \do\@xtitle \do\@title
3890 \do\author \do\@xauthor \do\address \do\@xaddress
3891 \do\email \do\@xemail \do\curraddr \do\@xcurraddr
3892 \do\dedicatory \do\@dedicatory \do\thanks \do\thankses
3893 \do\keywords \do\@keywords \do\subjclass \do\@subjclass
3894 }
3895 % \end{macrocode}
3896 %
3897 % \begin{macrocode}
3898 \def\@maketitle{%
3899 \cleardoublepage \thispagestyle{empty}%
3900 \begingroup \topskip\z@skip
3901 \null\vfil
3902 \begingroup
3903 \LARGE\bfseries \centering
3904 \openup\medskipamount
3905 \@title\par\vspace{24pt}%
3906 \def\and{\par\medskip}\centering
3907 \mdseries\authors\par\bigskip
3908 \endgroup
3909 \vfil
3910 \ifx\@empty\addresses \else \@setaddresses \fi
3911 \vfil
3912 \ifx\@empty\@dedicatory
3913 \else \begingroup
3914 \centering{\footnotesize\itshape\@dedicatory\@@par}%
3915 \endgroup
3916 \fi
3917 \vfill
3918 \newpage\thispagestyle{empty}
3919 \begin{center}
3920 \ifx\@empty\@subjclass\else\@setsubjclass\fi
3921 \ifx\@empty\@keywords\else\@setkeywords\fi
3922 \ifx\@empty\@translators\else\vfil\@settranslators\fi
3923 \ifx\@empty\thankses\else\vfil\@setthanks\fi
3924 \end{center}
3925 \vfil
3926 \@setabstract
3927 \endgroup}
3928 % \end{macrocode}
3929 %
3930 % Define the desired form for translator names.
3931 % \begin{macrocode}
3932 \def\@settranslators{\par
3933 \begingroup
3934 \translname: \andify\@translators \uppercasenonmath\@translators
3935 \@translators \@@par
3936 \endgroup}
3937 \def\@setdate{\par\smallskip\@date\par\smallskip}
3938 \def\@setsubjclass{\par\smallskip
3939 {\itshape\subjclassname.}\enspace\@subjclass\par\smallskip}
3940 \def\@setkeywords{\par\smallskip
3941 {\itshape \keywordsname.}\enspace \@keywords\par\smallskip}
3942 %</amsbook>
3943 %</classes>
3944 % \end{macrocode}
3945 %
3946 % \subsection{Setup for theorems, definitions, remarks, proofs}
3947 % \subsubsection{Intended usage}
3948 %
3949 % Here are some examples showing the kinds of theorem environment
3950 % declarations that are possible.
3951 %\begin{verbatim}
3952 % \newtheorem{prop}{Proposition}
3953 % \newtheorem{thm}{Theorem}[section]
3954 % \newtheorem{lem}[thm]{Lemma}
3955 % \newtheorem*{Zorn}{Zorn's Lemma}
3956 %
3957 % \theoremstyle{definition}
3958 % \newtheorem{dfn}{Definition}
3959 %
3960 % \theoremstyle{remark}
3961 % \newtheorem*{rmk}{Remark}
3962 %\end{verbatim}
3963 %
3964 % The first four statements all define environments using the default
3965 % theorem style (`plain'), since there is no prefatory
3966 % \cn{theoremstyle} declaration. The first statement defines an
3967 % automatically numbered \env{prop} environment whose headings will
3968 % look like this: Proposition 1, Proposition 2, and so forth. The
3969 % second statement defines an environment \env{thm} with numbers
3970 % subordinate to section numbers, so the headings will look like
3971 % this: Theorem 1.1, Theorem 1.2, Theorem 1.3, \dots, (in section 2:)
3972 % Theorem 2.1, Theorem 2.2, and so forth. The third statement defines
3973 % a \env{lem} environment whose numbers will interleave in sequence
3974 % with the theorem numbers: Theorem 1.3, Lemma 1.4, Lemma 1.5,
3975 % Theorem 1.6, and so forth. The fourth statement defines a special
3976 % unnumbered lemma named `Zorn's Lemma'. The remaining two
3977 % \cn{newtheorem} statements have no special features except for the
3978 % \cn{theoremstyle} declarations that cause the \env{dfn} and
3979 % \env{rmk} environments to have some differences in appearance.
3980 %
3981 % There are three basic styles provided: The `plain' style produces
3982 % bold headings and italic body text; the `definition' style produces
3983 % bold headings and normal body text; the `remark' style produces
3984 % italic headings and normal body text.
3985 %
3986 % A \cn{swapnumbers} command allows theorem numbers to be swapped to
3987 % the front of the theorem headings. Putting \cn{swapnumbers} in your
3988 % document preamble will cause \emph{all following} \cn{newtheorem}
3989 % statements to produce number-first headings. (To provide maximum
3990 % control, \cn{swapnumbers} is designed so that it can be used more
3991 % than once; each time it is used, theorem numbers will be swapped to
3992 % the opposite side for all following \cn{newtheorem} statements. But
3993 % rarely will it need to be invoked more than once per document.)
3994 %
3995 % \subsubsection{Custom theorem styles}
3996 % There is a \cn{newtheoremstyle} command provided to make the
3997 % creation of custom theoremstyles fairly easy.
3998 %
3999 % Usage:
4000 %\begin{verbatim}
4001 % #1
4002 % \newtheoremstyle{NAME}%
4003 % #2 #3 #4
4004 % {ABOVESPACE}{BELOWSPACE}{BODYFONT}%
4005 % #5 #6 #7 #8
4006 % {INDENT}{HEADFONT}{HEADPUNCT}{HEADSPACE}%
4007 % #9
4008 % {CUSTOM-HEAD-SPEC}
4009 %\end{verbatim}
4010 % Leaving the `indent' argument empty is equivalent to entering
4011 % |0pt|. The `headpunct' and `headspace' arguments are for the
4012 % punctuation and horizontal space between the theorem head and the
4013 % following text. There are two special values that may be used for
4014 % `headspace': a single space means that a normal interword space
4015 % should be used; ``\cn{newline}'' means that there should be a line
4016 % break after the head instead of horizontal space. The
4017 % `custom-head-spec' argument follows a special convention: it is
4018 % interpreted as the replacement text for an internal three-argument
4019 % function \cn{thmhead}, i.e., as if you were defining
4020 %\begin{verbatim}
4021 % \renewcommand{\thmhead}[3]{...#1...#2...#3...}
4022 %\end{verbatim}
4023 % but omitting the initial |\renewcommand{\thmhead}[3]|. The three
4024 % arguments that will be supplied to \cn{thmhead} are the name,
4025 % number, and optional note components. Within the replacement text
4026 % you can (and normally will want to) use other special functions
4027 % \cn{thmname}, \cn{thmnumber}, and \cn{thmnote}. These will print
4028 % their argument if and only if the corresponding argument of
4029 % \cn{thmhead} is nonempty. For example
4030 %\begin{verbatim}
4031 % {\thmname{#1}\thmnumber{ #2}\thmnote{ (#3)}}
4032 %\end{verbatim}
4033 % This would cause the theorem note \arg{3} to be printed with a
4034 % preceding space and enclosing parentheses, if it is present, and if
4035 % it is absent, the space and parentheses will be omitted because
4036 % they are inside the argument of \cn{thmnote}.
4037 %
4038 % Finally, if you have an extra bit of arbitrary code that you want
4039 % to slip in somewhere, the best place to do it is in the `body font'
4040 % argument.
4041 %
4042 % The \cn{newtheoremstyle} command is designed to provide, through a
4043 % relatively simple interface, control over the style aspects that
4044 % are most commonly changed. More complex requirements must be
4045 % addressed through a separate \latex/ package.
4046 %
4047 % When you set up custom theorem styles with \cn{newtheoremstyle} you
4048 % should not use \cn{swapnumbers}. You have full control of the
4049 % ordering of elements in the theorem head, just place them where you
4050 % want. Or, if you do use \cn{swapnumbers}, you must look at the
4051 % definition of \cs{swappedhead} and change it appropriately.
4052
4053 % \subsubsection{Implementation}
4054 % The \cn{theoremstyle} command is very simple except for the need to
4055 % warn about an unknown theoremstyle.
4056 % \begin{macrocode}
4057 %<*amsthm|classes>
4058 \newcommand{\theoremstyle}[1]{%
4059 \@ifundefined{th@#1}{%
4060 \PackageWarning{amsthm}{Unknown theoremstyle `#1'}%
4061 \thm@style{plain}%
4062 }{%
4063 \thm@style{#1}%
4064 }%
4065 }
4066 % \end{macrocode}
4067 %
4068 % \begin{macrocode}
4069 \newtoks\thm@style
4070 \thm@style{plain}
4071 % \end{macrocode}
4072 %
4073 % What's really needed is a full-fledged systematic approach for
4074 % specifying the desired order and formatting of the three identified
4075 % parts of a theorem head (name, number, note).
4076 % \begin{macrocode}
4077 \newtoks\thm@bodyfont \thm@bodyfont{\itshape}
4078 \newtoks\thm@headfont \thm@headfont{\bfseries}
4079 \newtoks\thm@notefont \thm@notefont{}
4080 \newtoks\thm@headpunct \thm@headpunct{.}
4081 % \end{macrocode}
4082 % Vertical spacing: initialize to current value of \cs{topsep}.
4083 % If a document class loads the \pkg{amsthm} package it
4084 % should take care to set these variables explicitly, if current
4085 % \cs{topsep} is not the desired value.
4086 % \begin{macrocode}
4087 \newskip\thm@preskip \newskip\thm@postskip
4088 %<*classes>
4089 \def\thm@space@setup{%
4090 \thm@preskip=.5\baselineskip\@plus.2\baselineskip
4091 \@minus.2\baselineskip
4092 \thm@postskip=\thm@preskip
4093 }
4094 %</classes>
4095 %<*amsthm>
4096 \def\thm@space@setup{%
4097 \thm@preskip=\topsep \thm@postskip=\thm@preskip
4098 }
4099 %</amsthm>
4100 % \end{macrocode}
4101 % Modify \cn{newtheorem} to add |*| option. If a |*| is found, pass
4102 % it on to \cs{@xnthm} as the first argument. (This information
4103 % enables us to handle two different possibilities in a single
4104 % function \cs{@xnthm} instead of needing two separate functions.)
4105 % \begin{macrocode}
4106 \renewcommand{\newtheorem}{\@ifstar{\@xnthm *}{\@xnthm \relax}}
4107 % \end{macrocode}
4108 %
4109 % Check to see if an optional arg is present after the first
4110 % mandatory arg (which is \arg{2} at the moment since the |*| or
4111 % non-|*| is \arg{1}).
4112 % \begin{macrocode}
4113 \def\@xnthm#1#2{%
4114 \let\@tempa\relax
4115 \@xp\@ifdefinable\csname #2\endcsname{%
4116 \global\@xp\let\csname end#2\endcsname\@endtheorem
4117 \ifx *#1% unnumbered, need to get one more mandatory arg
4118 \edef\@tempa##1{%
4119 \gdef\@xp\@nx\csname#2\endcsname{%
4120 \@nx\@thm{\@xp\@nx\csname th@\the\thm@style\endcsname}%
4121 {}{##1}}}%
4122 \else % numbered theorem, need to check for optional arg
4123 \def\@tempa{\@oparg{\@ynthm{#2}}[]}%
4124 \fi
4125 }%
4126 \@tempa
4127 }
4128 % \end{macrocode}
4129 %
4130 % Environment numbered together with a previously defined
4131 % environment.
4132 %
4133 % Arg1: env name, e.g. `thm'\par
4134 % Arg2: optional sibling counter\par
4135 % Arg3: heading text e.g. `Theorem'
4136 % \begin{macrocode}
4137 \def\@ynthm#1[#2]#3{%
4138 % \end{macrocode}
4139 % If optional arg \arg{2} is empty, call \cs{@xthm} to look for a
4140 % possible optional arg in terminal position. Note that
4141 % the two optional args are mutually exclusive. As \arg{2} is a
4142 % counter name and must be processed by \cs{csname} anyway,
4143 % we can use a simpler test instead of \cs{@ifempty}.
4144 % \begin{macrocode}
4145 \ifx\relax#2\relax
4146 \def\@tempa{\@oparg{\@xthm{#1}{#3}}[]}%
4147 \else
4148 \@ifundefined{c@#2}{%
4149 \def\@tempa{\@nocounterr{#2}}%
4150 }{%
4151 \@xp\xdef\csname the#1\endcsname{\@xp\@nx\csname the#2\endcsname}%
4152 \toks@{#3}%
4153 \@xp\xdef\csname#1\endcsname{%
4154 \@nx\@thm{%
4155 \let\@nx\thm@swap
4156 \if S\thm@swap\@nx\@firstoftwo\else\@nx\@gobble\fi
4157 \@xp\@nx\csname th@\the\thm@style\endcsname}%
4158 {#2}{\the\toks@}}%
4159 \let\@tempa\relax
4160 }%
4161 \fi
4162 \@tempa
4163 }
4164 % \end{macrocode}
4165 %
4166 % Environment numbered relative to the counter given as \arg{3}. This
4167 % function should really be named \cs{@znthm} but we're trying to
4168 % save a bit of hash table and string pool by reusing one of the
4169 % command names rendered obsolete by the \pkg{amsthm} package.
4170 %
4171 % Arg1: env name e.g. `thm';
4172 % Arg2: heading text e.g. `Theorem';
4173 % Arg3: parent counter e.g. section.
4174 % \begin{macrocode}
4175 \def\@xthm#1#2[#3]{%
4176 % \end{macrocode}
4177 % Set up the counter \verb'c@#1' and optionally add it to the reset
4178 % list of counter \arg{3}. As \arg{3} is a
4179 % counter name and must be processed by \cs{csname} anyway,
4180 % we can use a simpler test instead of \cs{@ifempty}.
4181 % \begin{macrocode}
4182 \ifx\relax#3\relax
4183 \newcounter{#1}%
4184 \else
4185 \newcounter{#1}[#3]%
4186 % \end{macrocode}
4187 % Define \cn{thexxx} to be \verb'\theyyy.\arabic{xxx}' (assuming
4188 % default values of punctuation and numbering style). The use of
4189 % \cs{xdef} here is inherited from the old \latex/ code, I'm not
4190 % sure it's a good idea in general, but there should not be any
4191 % problems unless someone changes the value of \cs{@thmcountersep} or
4192 % \cs{@thmcounter}.
4193 % \begin{macrocode}
4194 \@xp\xdef\csname the#1\endcsname{\@xp\@nx\csname the#3\endcsname
4195 \@thmcountersep\@thmcounter{#1}}%
4196 \fi
4197 \toks@{#2}%
4198 \@xp\xdef\csname#1\endcsname{%
4199 \@nx\@thm{%
4200 \let\@nx\thm@swap
4201 \if S\thm@swap\@nx\@firstoftwo\else\@nx\@gobble\fi
4202 \@xp\@nx\csname th@\the\thm@style\endcsname}%
4203 {#1}{\the\toks@}}%
4204 }
4205 % \end{macrocode}
4206 %
4207 % [mjd,1999/10/13] The following code doesn't handle the case where
4208 % an equation is immediately followed by a theorem with no
4209 % intervening \cs{par}---then the spacefactor is 1000.
4210 % \begin{macrocode}
4211 % % \def\thm@check@break{%
4212 % % \ifhmode \unskip \unskip
4213 % % \edef\pre@thm@spacefactor{\the\spacefactor}\par
4214 % % \edef\thm@topbreak{%
4215 % % \ifnum\pre@thm@spacefactor<\sfcode`\!\relax
4216 % % % preceding text line did not end with end-of-sentence punctuation
4217 % % \ifnum\prevgraf=\@ne \penalty\widowpenalty
4218 % % \else \penalty9999\relax
4219 % % \fi
4220 % % \else
4221 % % \@nx\addpenalty{\@beginparpenalty}%
4222 % % \fi
4223 % % }%
4224 % % \else
4225 % % \def\thm@topbreak{\addpenalty\@beginparpenalty}%
4226 % % \fi
4227 % % }
4228 % \end{macrocode}
4229 %
4230 % If arg \arg{2} is empty, this is an unnumbered environment;
4231 % otherwise \arg{2} is the name of a counter. \arg{3} is descriptive
4232 % name such as ``Theorem'' or ``Lemma''. Arg \arg{1} is the style
4233 % function, for example \cs{th@plain}.
4234 % \begin{macrocode}
4235 \def\@thm#1#2#3{%
4236 \ifhmode\unskip\unskip\par\fi
4237 \normalfont
4238 \trivlist
4239 % \end{macrocode}
4240 % Explicitly set plain style here, then override parts as necessary
4241 % in the function provided as \arg{1}.
4242 % \begin{macrocode}
4243 \let\thmheadnl\relax
4244 \let\thm@swap\@gobble
4245 %<amsart> \let\thm@indent\noindent % no indent
4246 %<amsart> \thm@headfont{\bfseries}% heading font bold
4247 %<amsbook|amsproc> \let\thm@indent\indent % indent
4248 %<amsbook|amsproc> \thm@headfont{\scshape}% heading font small caps
4249 \thm@notefont{\fontseries\mddefault\upshape}%
4250 \thm@headpunct{.}% add period after heading
4251 \thm@headsep 5\p@ plus\p@ minus\p@\relax
4252 \thm@space@setup
4253 #1% style overrides
4254 \@topsep \thm@preskip % used by thm head
4255 \@topsepadd \thm@postskip % used by \@endparenv
4256 \def\@tempa{#2}\ifx\@empty\@tempa
4257 \def\@tempa{\@oparg{\@begintheorem{#3}{}}[]}%
4258 \else
4259 \refstepcounter{#2}%
4260 \def\@tempa{\@oparg{\@begintheorem{#3}{\csname the#2\endcsname}}[]}%
4261 \fi
4262 \@tempa
4263 }
4264 % \end{macrocode}
4265 %
4266 % The internal function \cs{@restorelabelsep} starts out as a no-op.
4267 % I don't think this is needed any more [mjd,2000/10/26].
4268 % \begin{macrocode}
4269 \def\@restorelabelsep{\relax}
4270 % \end{macrocode}
4271 %
4272 % This variation of the \cs{@thm} command is no longer needed. The
4273 % variation \cs{@xthm} was commandeered for \cn{newtheorem} use.
4274 % \begin{macrocode}
4275 \let\@ythm\relax
4276 % \end{macrocode}
4277 %
4278 % Init \cn{thmname} etc.
4279 % \begin{macrocode}
4280 \let\thmname\@iden \let\thmnote\@iden \let\thmnumber\@iden
4281 % \end{macrocode}
4282 %
4283 % \begin{macro}{\@upn}
4284 % The function \cs{\@upn} is used to force theorem numbers and
4285 % similar elements to be upright even when the current font is
4286 % italic. If a suitable italic font with upright numbers and
4287 % punctuation is available, this function should be redefined to be a
4288 % no-op.
4289 % \begin{macrocode}
4290 \providecommand\@upn{\textup}
4291 % \end{macrocode}
4292 % \end{macro}
4293 %
4294 % Definitions for theorem heads.
4295 % \begin{macrocode}
4296 \def\thmhead@plain#1#2#3{%
4297 % \end{macrocode}
4298 % To allow for the case where the thmname part is empty and the
4299 % heading consists only of a number (don't laugh, we have
4300 % examples from real mathematical manuscripts), we don't add the
4301 % space at the beginning of thmnumber unless \arg{1} is nonempty.
4302 % \begin{macrocode}
4303 \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
4304 % \end{macrocode}
4305 % In thmnote we always add a leading space, i.e., assuming that
4306 % at least one of the preceding parts will always be present.
4307 % \begin{macrocode}
4308 \thmnote{ {\the\thm@notefont(#3)}}}
4309 \let\thmhead\thmhead@plain
4310 % \end{macrocode}
4311 % Swappedhead is for the case where the number precedes the
4312 % word "Theorem". When the numbers fall on the left, like section
4313 % numbers, AMS journal style calls for them to be lightface. We get
4314 % this by invoking \cs{@secnumfont}.
4315 %
4316 % In handling the punctuation after the number we have to step
4317 % delicately if we want to successfully handle cases where the
4318 % theorem name is empty (this is very rare, yet it sometimes arises
4319 % in practice).
4320 % \begin{macrocode}
4321 \def\swappedhead#1#2#3{%
4322 %<amsthm> \thmnumber{#2}%
4323 %<amsthm> \thmname{\@ifnotempty{#2}{~}#1}%
4324 %<classes> \thmnumber{\@upn{\@secnumfont#2\@ifnotempty{#1}{.~}}}%
4325 %<classes> \thmname{#1}%
4326 \thmnote{ {\the\thm@notefont(#3)}}}
4327 % \end{macrocode}
4328 %
4329 % A customized definition of \cs{th@plain} written for version 1.x of
4330 % the \pkg{amsthm} package might refer to \cs{swappedhead@plain}; this
4331 % gives it a definition for backward compatibility.
4332 % \begin{macrocode}
4333 \let\swappedhead@plain=\swappedhead
4334 % \end{macrocode}
4335 %
4336 % In \cs{@begintheorem} \cn{thmheadnl} is called after the theorem
4337 % head: maybe a newline, otherwise a no-op.
4338 % \begin{macrocode}
4339 \let\thmheadnl\relax
4340 \let\thm@indent\noindent
4341 \let\thm@swap\@gobble
4342 % \end{macrocode}
4343 %
4344 % If argument \arg{2} is empty, then this is an unnumbered
4345 % environment. Otherwise \arg{2} is a numbering command such as
4346 % \cn{thexyz}. We use \cs{deferred@thm@head} instead of \cs{item} in
4347 % order to allow line breaking in the optional note argument.
4348 % \begin{macrocode}
4349 \def\@begintheorem#1#2[#3]{%
4350 \deferred@thm@head{\the\thm@headfont \thm@indent
4351 % \end{macrocode}
4352 % Changes to \cs{thmnumber} and \cs{thmnote} are local to the
4353 % containing box.
4354 % \begin{macrocode}
4355 \@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}%
4356 \@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}%
4357 \@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}%
4358 % \end{macrocode}
4359 % The \cs{thm@swap} function selects either \cs{swappedhead} or
4360 % \cs{thmhead}.
4361 % \begin{macrocode}
4362 \thm@swap\swappedhead\thmhead{#1}{#2}{#3}%
4363 % \end{macrocode}
4364 % I can't think of any example where the after-head punctuation
4365 % should be omitted so it seems correct not to use \cs{@addpunct}
4366 % here.
4367 % \begin{macrocode}
4368 \the\thm@headpunct
4369 % \end{macrocode}
4370 % If this \emph{is} a newline (from a \cn{newtheoremstyle}), it
4371 % gets lost if there isn't any text following the heading, since
4372 % \cs{deferred@thm@head} packs the heading into an hbox with
4373 % \cs{sbox}\cs{@labels}. Attempting to move the \cs{thmheadnl}
4374 % outside the scope of \cs{deferred@thm@head} (just outside the
4375 % ending brace below) results in no improvement if no text follows
4376 % the heading, and where there is text, runs it in. Inserting a
4377 % space following such a heading results in an extra blank line.
4378 % [bnb, 2004/06/30]
4379 % \begin{macrocode}
4380 \thmheadnl % possibly a newline.
4381 \hskip\thm@headsep
4382 }%
4383 \ignorespaces}
4384 % \end{macrocode}
4385 %
4386 % \begin{macrocode}
4387 \newskip\thm@headsep
4388 \thm@headsep=5pt plus1pt minus1pt\relax
4389 % \end{macrocode}
4390 %
4391 % \begin{macrocode}
4392 \let\adjust@parskip@nobreak=\@nbitem
4393 % \end{macrocode}
4394 %
4395 % \begin{macrocode}
4396 \newtoks\dth@everypar
4397 \dth@everypar={%
4398 \@minipagefalse \global\@newlistfalse
4399 \@noparitemfalse
4400 \if@inlabel
4401 \global\@inlabelfalse
4402 \begingroup \setbox\z@\lastbox
4403 \ifvoid\z@ \kern-\itemindent \fi
4404 \endgroup
4405 \unhbox\@labels
4406 \fi
4407 \if@nobreak \@nobreakfalse \clubpenalty\@M
4408 \else \clubpenalty\@clubpenalty \everypar{}%
4409 \fi
4410 }%
4411 % \end{macrocode}
4412 %
4413 % \begin{macrocode}
4414 \def\deferred@thm@head#1{%
4415 \if@inlabel \indent \par \fi % eject a section head if one is pending
4416 \if@nobreak
4417 % \end{macrocode}
4418 % This case normally arises when a theorem follows immediately after
4419 % a section head. Then we leave the below-section-head space instead
4420 % of adding above-theorem space; but some adjustment of parskip is
4421 % needed.
4422 % \begin{macrocode}
4423 \adjust@parskip@nobreak
4424 \else
4425 \addpenalty\@beginparpenalty
4426 \addvspace\@topsep
4427 \addvspace{-\parskip}%
4428 \fi
4429 \global\@inlabeltrue
4430 \everypar\dth@everypar
4431 \sbox\@labels{\normalfont#1}%
4432 \ignorespaces
4433 }
4434 % \end{macrocode}
4435 %
4436 % \begin{macro}{\nonslanted}
4437 % The \cn{nonslanted} command changes the current font to
4438 % \cn{upshape} if it is \cn{itshape} or \cn{slshape}. This is used
4439 % for document structure numbers that should be consistently upright
4440 % in all contexts.
4441 % \begin{macrocode}
4442 \def\nonslanted{\relax
4443 % \end{macrocode}
4444 % Can't do a direct \cs{ifx} between \cs{f@shape} and \cs{itdefault}
4445 % because the latter is \cs{long} (grumble grumble).
4446 % \begin{macrocode}
4447 \@xp\let\@xp\@tempa\csname\f@shape shape\endcsname
4448 \ifx\@tempa\itshape\upshape
4449 \else\ifx\@tempa\slshape\upshape\fi\fi}
4450 % \end{macrocode}
4451 % \end{macro}
4452 %
4453 % \begin{macro}{\swapnumbers}
4454 % The \cn{swapnumbers} command sets a switch \cs{thm@swap} that is
4455 % used by \cn{newtheorem}. To conserve hash table we load
4456 % \cs{thm@swap} with two uses; the first one is needed only in
4457 % \cn{newtheorem} declarations and the second one is needed only in
4458 % typesetting theorem environments.
4459 % \begin{macrocode}
4460 \def\swapnumbers{\edef\thm@swap{\if S\thm@swap N\else S\fi}}
4461 \def\thm@swap{N}%
4462 % \end{macrocode}
4463 % \end{macro}
4464 %
4465 % \cs{@opargbegintheorem} not needed, \cs{@oparg} utility serves
4466 % instead.
4467 % \begin{macrocode}
4468 \let\@opargbegintheorem\relax
4469 % \end{macrocode}
4470 %
4471 % Except for the body font, default values are built into \cs{@thm}.
4472 % \begin{macrocode}
4473 \def\th@plain{%
4474 %% \let\thm@indent\noindent % no indent
4475 %% \thm@headfont{\bfseries}% heading font is bold
4476 %% \thm@notefont{}% same as heading font
4477 %% \thm@headpunct{.}% add period after heading
4478 %% \let\thm@swap\@gobble
4479 %% \thm@preskip\topsep
4480 %% \thm@postskip\theorempreskipamount
4481 \itshape % body font
4482 }
4483 % \end{macrocode}
4484 %
4485 % Theorem style `definition' is the same as `plain' except for the
4486 % body font.
4487 % \begin{macrocode}
4488 \def\th@definition{%
4489 \normalfont % body font
4490 }
4491 % \end{macrocode}
4492 %
4493 % Theorem style `remark' differs from `plain' in head font and body
4494 % font. Also smaller spacing above and below for AMS classes only.
4495 % \begin{macrocode}
4496 \def\th@remark{%
4497 %<amsart|amsthm> \thm@headfont{\itshape}%
4498 \normalfont % body font
4499 %<*amsthm>
4500 \thm@preskip\topsep \divide\thm@preskip\tw@
4501 \thm@postskip\thm@preskip
4502 %</amsthm>
4503 }
4504 % \end{macrocode}
4505 %
4506 % The standard definition of \cs{@endtheorem} is just
4507 % \cs{endtrivlist}, but that doesn't automatically start a new
4508 % paragraph, so we add \cs{@endpefalse} in order to ensure a new
4509 % paragraph. This differs from the basic \latex/ behavior.
4510 % \begin{macrocode}
4511 \def\@endtheorem{\endtrivlist\@endpefalse }
4512 % \end{macrocode}
4513 %
4514 % \begin{macro}{\newtheoremstyle}
4515 % An easy way to make a not too complicated variant theorem style.
4516 % Usage:
4517 %\begin{verbatim}
4518 % #1
4519 % \newtheoremstyle{NAME}%
4520 % #2 #3 #4
4521 % {ABOVESPACE}{BELOWSPACE}{BODYFONT}%
4522 % #5 #6 #7 #8
4523 % {INDENT}{HEADFONT}{HEADPUNCT}{HEADSPACE}%
4524 % #9
4525 % {CUSTOM-HEAD-SPEC}
4526 %\end{verbatim}
4527 % \begin{macrocode}
4528 \newcommand{\newtheoremstyle}[9]{%
4529 % \end{macrocode}
4530 % Empty or 0pt for \arg{5} is translated to \cs{noindent}.
4531 % \begin{macrocode}
4532 \@ifempty{#5}{\dimen@\z@skip}{\dimen@#5\relax}%
4533 \ifdim\dimen@=\z@
4534 % \end{macrocode}
4535 % \arg{4} is body font. Extra code could be included there if
4536 % necessary.
4537 % \begin{macrocode}
4538 \toks@{#4\let\thm@indent\noindent}%
4539 \else
4540 \toks@{#4\def\thm@indent{\noindent\hbox to#5{}}}%
4541 \fi
4542 % \end{macrocode}
4543 % Arg \arg{8} is a glue spec for the space after the head. As
4544 % a proper glue spec for `normal interword space' is rather hard to
4545 % write, we recognize an argument of |{ }| as a special case and
4546 % translate internally to the necessary fontdimen equivalent.
4547 % Furthermore, if \arg{8} consists entirely of \cn{newline}, then we
4548 % will perform a line break after the theorem head instead of adding
4549 % horizontal space. At the moment [1995/01/23] this is not perfectly
4550 % well implemented because of complications with the way \latex/'s
4551 % \cn{item} adds a heading to the vertical list; for best results
4552 % there should not be anything (not even a blank line) after the
4553 % |\begin{xxx}| command.
4554 % \begin{macrocode}
4555 \def\@tempa{#8}\ifx\space\@tempa
4556 % \end{macrocode}
4557 % Notice that we disregard stretch and shrink for labelsep =
4558 % interwordspace.
4559 % \begin{macrocode}
4560 \toks@\@xp{\the\toks@ \thm@headsep\fontdimen\tw@\font\relax}%
4561 \else
4562 \def\@tempb{\newline}%
4563 \ifx\@tempb\@tempa
4564 \toks@\@xp{\the\toks@ \thm@headsep\z@skip
4565 \def\thmheadnl{\newline}}%
4566 \else
4567 \toks@\@xp{\the\toks@ \thm@headsep#8\relax}%
4568 \fi
4569 \fi
4570 \begingroup
4571 \thm@space@setup
4572 \@defaultunits\@tempskipa#2\thm@preskip\relax\@nnil
4573 \@defaultunits\@tempskipb#3\thm@postskip\relax\@nnil
4574 \xdef\@gtempa{\thm@preskip\the\@tempskipa
4575 \thm@postskip\the\@tempskipb\relax}%
4576 \endgroup
4577 \@temptokena\@xp{\@gtempa
4578 \thm@headfont{#6}\thm@headpunct{#7}%
4579 }%
4580 \@ifempty{#9}{%
4581 \let\thmhead\thmhead@plain
4582 }{%
4583 \@namedef{thmhead@#1}##1##2##3{#9}%
4584 \@temptokena\@xp{\the\@temptokena
4585 \@xp\let\@xp\thmhead\csname thmhead@#1\endcsname}%
4586 }%
4587 \@xp\xdef\csname th@#1\endcsname{\the\toks@ \the\@temptokena}%
4588 }
4589 % \end{macrocode}
4590 % \end{macro}
4591 %
4592 % \begin{macro}{\qed}
4593 % Define \cn{qed} for end of proof. This command might
4594 % occur in math mode, in a displayed equation, but it should never
4595 % occur in inner math mode in ordinary paragraph text.
4596 % \begin{macrocode}
4597 \DeclareRobustCommand{\qed}{%
4598 \ifmmode \mathqed
4599 \else
4600 \leavevmode\unskip\penalty9999 \hbox{}\nobreak\hfill
4601 % \end{macrocode}
4602 % The hbox is to prevent a line break within the \cn{qedsymbol} if it
4603 % is defined to be something composite--- e.g., things like
4604 % \verb"(Corollary 1.2) \openbox" as are occasionally done.
4605 % \begin{macrocode}
4606 \quad\hbox{\qedsymbol}%
4607 \fi
4608 }
4609 % \end{macrocode}
4610 % \end{macro}
4611 %
4612 % Setup for QED stack. We use a dedicated iterator macro \cs{qed@elt}
4613 % instead of the generic \cs{@elt} because the \latex/ output routine
4614 % is not safe against changes in \cs{@elt}. Therefore it is not safe
4615 % to use \cs{@elt} for any processing that might trigger the output
4616 % routine. Although this does not seem very likely when adding a QED
4617 % symbol to a horizontal list, we did in fact get a bug report for
4618 % this kind of failure.
4619 % \begin{macrocode}
4620 \let\QED@stack\@empty
4621 \let\qed@elt\relax
4622 % \end{macrocode}
4623 %
4624 % Puts a QED symbol on the stack:
4625 % \begin{macrocode}
4626 \newcommand{\pushQED}[1]{%
4627 \toks@{\qed@elt{#1}}\@temptokena\expandafter{\QED@stack}%
4628 \xdef\QED@stack{\the\toks@\the\@temptokena}%
4629 }
4630 % \end{macrocode}
4631 %
4632 % Pops the QED stack and prints the result.
4633 % \begin{macrocode}
4634 \newcommand{\popQED}{%
4635 \begingroup\let\qed@elt\popQED@elt \QED@stack\relax\relax\endgroup
4636 }
4637 % \end{macrocode}
4638 %
4639 % \begin{macrocode}
4640 \def\popQED@elt#1#2\relax{#1\gdef\QED@stack{#2}}
4641 % \end{macrocode}
4642 %
4643 % Prints the current QED symbol and replaces the top entry on the
4644 % stack with a null entry.
4645 % \begin{macrocode}
4646 \newcommand{\qedhere}{%
4647 \begingroup \let\mathqed\math@qedhere
4648 \let\qed@elt\setQED@elt \QED@stack\relax\relax \endgroup
4649 }
4650 % \end{macrocode}
4651 %
4652 % In case the \pkg{amsmath} or \pkg{amstext} packages are loaded, we
4653 % need the following two tests. (Redundantly declaring them is
4654 % harmless.)
4655 % \begin{macrocode}
4656 \newif\ifmeasuring@
4657 \newif\iffirstchoice@ \firstchoice@true
4658 % \end{macrocode}
4659 %
4660 % \begin{macrocode}
4661 \def\setQED@elt#1#2\relax{%
4662 \ifmeasuring@
4663 \else \iffirstchoice@ \gdef\QED@stack{\qed@elt{}#2}\fi
4664 \fi
4665 #1%
4666 }
4667 % \end{macrocode}
4668 %
4669 % \begin{macro}{\mathqed}
4670 % When a QED occurs inside a math formula, well, it is presumably a
4671 % displayed equation. In order to find out where to place the QED
4672 % symbol, we need to check what kind of equation structure we are in.
4673 %
4674 % \begin{macrocode}
4675 \def\qed@warning{%
4676 \PackageWarning{amsthm}{The \@nx\qedhere command may not work
4677 correctly here}%
4678 }
4679 % \end{macrocode}
4680 %
4681 % \begin{macrocode}
4682 \newcommand{\mathqed}{\quad\hbox{\qedsymbol}}
4683 % \end{macrocode}
4684 %
4685 % The \cs{linebox@qed} function comes into play with the \opt{fleqn}
4686 % option.
4687 % \begin{macrocode}
4688 \def\linebox@qed{\hfil\hbox{\qedsymbol}\hfilneg}
4689 % \end{macrocode}
4690 % \end{macro}
4691 %
4692 % Two large sections of code follow. One for \fn{amsmath} 2.0 and one
4693 % for plain \latex/.
4694 % \begin{macrocode}
4695 \@ifpackageloaded{amsmath}{%
4696 % \end{macrocode}
4697 %
4698 % \begin{macrocode}
4699 \def\math@qedhere{%
4700 \@ifundefined{\@currenvir @qed}{%
4701 \qed@warning\quad\hbox{\qedsymbol}%
4702 }{%
4703 \@xp\aftergroup\csname\@currenvir @qed\endcsname
4704 }%
4705 }
4706 % \end{macrocode}
4707 %
4708 % \begin{macrocode}
4709 \def\displaymath@qed{%
4710 \relax
4711 \ifmmode
4712 \ifinner \aftergroup\linebox@qed
4713 \else
4714 \eqno
4715 \let\eqno\relax \let\leqno\relax \let\veqno\relax
4716 \hbox{\qedsymbol}%
4717 \fi
4718 \else
4719 \aftergroup\linebox@qed
4720 \fi
4721 }
4722 % \end{macrocode}
4723 %
4724 % \begin{macrocode}
4725 \@xp\let\csname equation*@qed\endcsname\displaymath@qed
4726 % \end{macrocode}
4727 %
4728 % If the equation has both an equation number and a qed, we've got
4729 % trouble, but we can provide half-way decent for the simple cases.
4730 % \begin{macrocode}
4731 \def\equation@qed{%
4732 \iftagsleft@
4733 \hbox{\phantom{\quad\qedsymbol}}%
4734 \gdef\alt@tag{%
4735 \rlap{\hbox to\displaywidth{\hfil\qedsymbol}}%
4736 \global\let\alt@tag\@empty
4737 }%
4738 \else
4739 \gdef\alt@tag{%
4740 \global\let\alt@tag\@empty
4741 \vtop{\ialign{\hfil####\cr
4742 \tagform@\theequation\cr
4743 \qedsymbol\cr}}%
4744 \setbox\z@
4745 }%
4746 \fi
4747 }
4748 % \end{macrocode}
4749 %
4750 % \begin{macrocode}
4751 \def\qed@tag{%
4752 \global\tag@true \nonumber
4753 &\omit\setboxz@h {\strut@ \qedsymbol}\tagsleft@false
4754 \place@tag@gather
4755 \kern-\tabskip
4756 \ifst@rred \else \global\@eqnswtrue \fi \global\advance\row@\@ne \cr
4757 }
4758 % \end{macrocode}
4759 %
4760 % \begin{macrocode}
4761 \def\split@qed{%
4762 \def\endsplit{\crcr\egroup \egroup \ctagsplit@false \rendsplit@
4763 \aftergroup\align@qed
4764 }%
4765 }
4766 % \end{macrocode}
4767 %
4768 % \begin{macrocode}
4769 \def\align@qed{%
4770 \ifmeasuring@ \tag*{\qedsymbol}%
4771 \else \let\math@cr@@@\qed@tag
4772 \fi
4773 }
4774 \@xp\let\csname align*@qed\endcsname\align@qed
4775 \@xp\let\csname gather*@qed\endcsname\align@qed
4776 % \end{macrocode}
4777 %
4778 % \begin{macrocode}
4779 %% Needs some patching up for amsmath 1.2
4780 % \end{macrocode}
4781 %
4782 % \begin{macrocode}
4783 }{% end of amsmath branch, start plain LaTeX branch
4784 % \end{macrocode}
4785 %
4786 % The \cn{qedhere} handling for generic \latex/ classes (\cls{article},
4787 % \cls{book}) with the \pkg{amsthm} package (without \pkg{amsmath}) is
4788 % fairly sketchy. When a qed symbol and an equation number are both
4789 % applied to a single display, the results may not be entirely
4790 % satisfactory, particularly when the \opt{fleqn} and/or \opt{leqno}
4791 % options are used. [mjd,2000/01/17]
4792 %
4793 % As for \cs{math@qedhere}, it is expected to occur only via
4794 % \cn{qedhere}, where the \cs{aftergroup} makes sense.
4795 % \begin{macrocode}
4796 \def\math@qedhere{%
4797 \@ifundefined{\@currenvir @qed}{%
4798 \qed@warning \aftergroup\displaymath@qed
4799 }{%
4800 \@xp\aftergroup\csname\@currenvir @qed\endcsname
4801 }%
4802 }
4803 % \end{macrocode}
4804 %
4805 % The \cs{ifmmode} \cs{ifinner} case is expected to happen with the
4806 % \opt{fleqn} option, where we have something like:
4807 %\begin{verbatim}
4808 %\hbox to\linewidth{\hbox{$...$}\hfil}
4809 %\end{verbatim}
4810 % In order to counteract the \cs{hfil} we must jump out two grouping
4811 % levels.
4812 % \begin{macrocode}
4813 \def\displaymath@qed{%
4814 \relax
4815 \ifmmode
4816 \ifinner \aftergroup\aftergroup\aftergroup\linebox@qed
4817 \else
4818 \eqno \def\@badmath{$$}%
4819 \let\eqno\relax \let\leqno\relax \let\veqno\relax
4820 \hbox{\qedsymbol}%
4821 \fi
4822 \else
4823 \aftergroup\linebox@qed
4824 \fi
4825 }
4826 % \end{macrocode}
4827 %
4828 % This definition is a fallback definition that places the qed and
4829 % then the equation number, on the right-hand side. For \opt{leqno},
4830 % not so good; but then
4831 % \begin{macrocode}
4832 \@ifundefined{[email protected]}{%
4833 \def\equation@qed{\displaymath@qed \quad}%
4834 }{%
4835 \def\equation@qed{\displaymath@qed}%
4836 }
4837 % \end{macrocode}
4838 %
4839 % If \pkg{amsmath} is not loaded, then we need to do some surgery
4840 % on the \cn{[} macro. Normally it looks like this:
4841 %\begin{verbatim}
4842 % \[=macro:
4843 % ->\relax \ifmmode \@badmath \else
4844 % \ifvmode \nointerlineskip \makebox [.6\linewidth ]\fi $$\fi
4845 %\end{verbatim}
4846 %
4847 % If arg 2 is \cs{m@th} when we make this test it indicates that the
4848 % fleqn option is in effect. Perhaps try to do something there.
4849 % \begin{macrocode}
4850 \def\@tempa#1$#2#3\@nil#4{%
4851 \def#4{#1$#2\def\@currenvir{displaymath}#3}%
4852 }%
4853 % \end{macrocode}
4854 % If \cn{[} has already been made robust (by \pkg{fixltx2e} or
4855 % a \LaTeX\ format from 2015 or later), patch the internal macro
4856 % \cs{[<space>} instead.
4857 % \begin{macrocode}
4858 \expandafter\ifx\csname[ \endcsname\relax
4859 \expandafter\@tempa\[\@nil\[%
4860 \else
4861 \expandafter\expandafter\expandafter\@tempa\csname[
4862 \expandafter\endcsname\expandafter\@nil
4863 \csname[ \endcsname
4864 \fi
4865 }
4866 % \end{macrocode}
4867 %
4868 % If an older version of \pkg{amsmath} is in use, we need to fall
4869 % back to a simpler definition of \cs{math@qedhere}.
4870 % \begin{macrocode}
4871 \@ifpackageloaded{amstex}{%
4872 \def\@tempa{TT}%
4873 }{%
4874 \@ifpackageloaded{amsmath}{%
4875 \def\@tempb#1 v#2.#3\@nil{#2}%
4876 \ifnum\@xp\@xp\@xp\@tempb\csname [email protected]\endcsname v0.0\@nil
4877 <\tw@
4878 \def\@tempa{TT}%
4879 \else
4880 \def\@tempa{TF}%
4881 \fi
4882 }{%
4883 \def\@tempa{TF}
4884 }%
4885 }
4886 \if\@tempa
4887 \renewcommand{\math@qedhere}{\quad\hbox{\qedsymbol}}%
4888 \fi
4889 % \end{macrocode}
4890 %
4891 % The reason that we do not simply use the \cn{square} symbol from
4892 % \fn{msam} for the open-box qed symbol is that we want to avoid
4893 % requiring users to have the AMSFonts font package. And the \fn{lasy}
4894 % \cn{Box} is too large.
4895 % \begin{macrocode}
4896 \newcommand{\openbox}{\leavevmode
4897 % \end{macrocode}
4898 % I think I got these numbers from measuring \fn{msam}'s \cn{square}
4899 % but I forgot to make notes at the time. [mjd,1995/01/25]
4900 % \begin{macrocode}
4901 \hbox to.77778em{%
4902 \hfil\vrule
4903 \vbox to.675em{\hrule width.6em\vfil\hrule}%
4904 \vrule\hfil}}
4905 % \end{macrocode}
4906 %
4907 % \begin{macrocode}
4908 \DeclareRobustCommand{\textsquare}{%
4909 \begingroup \usefont{U}{msa}{m}{n}\thr@@\endgroup
4910 }
4911 % \end{macrocode}
4912 %
4913 % \begin{macrocode}
4914 %<*classes>
4915 \@ifclasswith{\@classname}{noamsfonts}{%
4916 \providecommand{\qedsymbol}{\openbox}%
4917 }{}
4918 \providecommand{\qedsymbol}{\textsquare}
4919 %</classes>
4920 %<amsthm>\providecommand{\qedsymbol}{\openbox}
4921 % \end{macrocode}
4922 %
4923 % The proof environment is never numbered, and has a \cn{qed} at the
4924 % end, which makes it inconvenient to use \cn{newtheorem} for
4925 % defining it. Also authors frequently need to substitute an
4926 % alternative heading text (e.g.\ `Proof of Lemma 4.3')
4927 % instead of the default `Proof'. For all these reasons we define the
4928 % proof environment here instead of leaving it for authors to define.
4929 % Text after the end of a proof, like that after the end of a theorem,
4930 % begins a new paragraph. This differs from basic \latex/ behavior.
4931 % [bnb, 1999/09/27]
4932 % \begin{macrocode}
4933 \newenvironment{proof}[1][\proofname]{\par
4934 \pushQED{\qed}%
4935 \normalfont \topsep6\p@\@plus6\p@\relax
4936 \trivlist
4937 %<amsbook|amsproc> \itemindent\normalparindent
4938 \item[\hskip\labelsep
4939 %<amsbook|amsproc> \scshape
4940 %<amsart|amsthm> \itshape
4941 #1\@addpunct{.}]\ignorespaces
4942 }{%
4943 \popQED\endtrivlist\@endpefalse
4944 }
4945 % \end{macrocode}
4946 % Default for \cn{proofname}:
4947 % \begin{macrocode}
4948 \providecommand{\proofname}{Proof}
4949 % \end{macrocode}
4950 %
4951 % For reference:
4952 %\begin{verbatim}
4953 % From: [email protected] (Timothy Y. Chow)
4954 % Subject: Suppressing theorem numbering in LaTeX
4955 % Message-ID: <[email protected]>
4956 % Date: Thu, 11 Aug 94 23:47:54 GMT
4957 % To: [email protected]
4958 %
4959 % A friend of mine wants numbering of theorems, conjectures, and so on
4960 % suppressed if there is only one of them in his article. In other words
4961 % he wants "Conjecture 1" to appear as simply "Conjecture" if there is no
4962 % Conjecture 2. What is the best way to go about doing this?
4963 % ...
4964 %\end{verbatim}
4965 % Maybe something clever can be done to make the desired behavior
4966 % happen automatically. Note that this would seem to be a general
4967 % numbering problem rather than a theorem-specific one, because
4968 % similar behavior would be desirable for appendixes: according to
4969 % standard publishing practice, if there's only one it is titled just
4970 % `Appendix', and if there are more than one they are titled
4971 % `Appendix A', `Appendix B', and so on.
4972 %
4973 % \begin{macrocode}
4974 %</amsthm|classes>
4975 %<*classes>
4976 % \end{macrocode}
4977 %
4978 % \subsection{Utility commands used with AMS author packages}
4979 %
4980 % \begin{macro}{\bb@skip}
4981 % Skip to result in base-to-base distance from previous to next box.
4982 % \begin{macrocode}
4983 \def\bb@skip#1{%
4984 \skip@#1\relax \advance\skip@-\prevdepth \advance\skip@-\baselineskip
4985 \vskip\skip@}
4986 % \end{macrocode}
4987 % \end{macro}
4988 %
4989 % \begin{macro}{\markleft}
4990 % Basic \latex/ has \cn{markright} and \cn{markboth}, but sometimes
4991 % it's necessary to change just the left running head. This macro
4992 % completes the set. From the \pkg{altxext.sty} module of Klaus
4993 % Lagally's \pkg{arabtex}. [bnb, 2004/03/25]
4994 % \begin{macrocode}
4995 \def\markleft#1{{\let\protect\noexpand
4996 \let\label\relax \let\index\relax \let\glossary\relax
4997 \expandafter\@markleft\@themark{#1}%
4998 \mark{\@themark}}%
4999 \if@nobreak\ifvmode\nobreak\fi\fi}
5000 \def\@markleft#1#2#3{\gdef\@themark{{#3}{#2}}}
5001 % \end{macrocode}
5002 % \end{macro}
5003 %
5004 % \begin{macro}{\DH}
5005 % \begin{macro}{\dh}
5006 % \begin{macro}{\DJ}
5007 % \begin{macro}{\dj}
5008 % The Icelandic thorn and eth and the Croatian barred D are part of
5009 % the T1 font encoding, but aren't available in OT1. However, they
5010 % are needed (rarely) in the author names or bibliographies. Provide
5011 % emulations, using the thorn in \fn{msbm} or D's barred with a macron.
5012 % The lowercase eth requires an \cs{edef} to access \fn{msbm} properly.
5013 % Define it separately to permit checking for small caps. [bnb, 2004/04/05]
5014 % \begin{macrocode}
5015 \@ifundefined{symAMSb}{%
5016 \def\@dh{dh}%
5017 \ClassWarning{\@classname}{\string\dh\space unavailable without amsfonts;
5018 replaced by 'dh'}%
5019 }{%
5020 \edef\@dh{\noexpand\mathhexbox{\hexnumber@\symAMSb}67}%
5021 }
5022 \DeclareTextCommand{\dh}{OT1}{%
5023 \edef\@tempb{\scdefault}%
5024 \ifx\f@shape\@tempb
5025 \leavevmode
5026 \raisebox{-.8ex}{\makebox[\z@][l]{\hskip-.08em\accent"16\hss}}d%
5027 \else
5028 \@dh
5029 \fi
5030 }
5031 \DeclareTextCommand{\DH}{OT1}{%
5032 \leavevmode\raisebox{-.5ex}{\makebox[\z@][l]{\hskip-.07em\accent"16\hss}}D}
5033 \DeclareTextCommand{\DJ}{OT1}{%
5034 \leavevmode\raisebox{-.5ex}{\makebox[\z@][l]{\hskip-.07em\accent"16\hss}}D}
5035 \DeclareTextCommand{\dj}{OT1}{%
5036 \edef\@tempa{\f@shape}\edef\@tempb{\scdefault}%
5037 \ifx\@tempa\@tempb
5038 \leavevmode
5039 \raisebox{-.75ex}{\makebox[\z@][l]{\hskip-.08em\accent"16\hss}}d%
5040 \else
5041 \leavevmode\raisebox{.02ex}{\makebox[\z@][l]{\hskip.1em\accent"16\hss}}d%
5042 \fi}
5043 % \end{macrocode}
5044 % \end{macro}
5045 % \end{macro}
5046 % \end{macro}
5047 % \end{macro}
5048 %
5049 % \subsection{Hyphenation exceptions}
5050 % Some common hyphenation exceptions, based on the listing in
5051 % TUGboat vol 10, no 3, November 1989, pp.~336--341. Many words from
5052 % the TUGboat list that seemed less likely to occur in mathematical
5053 % text have been omitted because hyphenation exceptions use up memory
5054 % (most versions of \tex/ currently have a limit of 307 on hyphenation
5055 % exceptions; each added hyphenation exception uses up something like
5056 % 2 extra words of main memory as well). The list of hyphenations for
5057 % proper names could be expanded forever if room permitted; we
5058 % restrict ourselves to a rather short, extremely arbitrary list.
5059 % Note that the hyphenation rules of British English differ in some
5060 % particulars from the US rules, so some of the hyphenations
5061 % given below may need to be overridden for proper UK hyphenation.
5062 %
5063 % \begin{macrocode}
5064 \hyphenation{acad-e-my acad-e-mies af-ter-thought anom-aly anom-alies
5065 an-ti-deriv-a-tive an-tin-o-my an-tin-o-mies apoth-e-o-ses
5066 apoth-e-o-sis ap-pen-dix ar-che-typ-al as-sign-a-ble as-sist-ant-ship
5067 as-ymp-tot-ic asyn-chro-nous at-trib-uted at-trib-ut-able bank-rupt
5068 bank-rupt-cy bi-dif-fer-en-tial blue-print busier busiest
5069 cat-a-stroph-ic cat-a-stroph-i-cally con-gress cross-hatched data-base
5070 de-fin-i-tive de-riv-a-tive dis-trib-ute dri-ver dri-vers eco-nom-ics
5071 econ-o-mist elit-ist equi-vari-ant ex-quis-ite ex-tra-or-di-nary
5072 flow-chart for-mi-da-ble forth-right friv-o-lous ge-o-des-ic
5073 ge-o-det-ic geo-met-ric griev-ance griev-ous griev-ous-ly
5074 hexa-dec-i-mal ho-lo-no-my ho-mo-thetic ideals idio-syn-crasy
5075 in-fin-ite-ly in-fin-i-tes-i-mal ir-rev-o-ca-ble key-stroke
5076 lam-en-ta-ble light-weight mal-a-prop-ism man-u-script mar-gin-al
5077 meta-bol-ic me-tab-o-lism meta-lan-guage me-trop-o-lis
5078 met-ro-pol-i-tan mi-nut-est mol-e-cule mono-chrome mono-pole
5079 mo-nop-oly mono-spline mo-not-o-nous mul-ti-fac-eted mul-ti-plic-able
5080 non-euclid-ean non-iso-mor-phic non-smooth par-a-digm par-a-bol-ic
5081 pa-rab-o-loid pa-ram-e-trize para-mount pen-ta-gon phe-nom-e-non
5082 post-script pre-am-ble pro-ce-dur-al pro-hib-i-tive pro-hib-i-tive-ly
5083 pseu-do-dif-fer-en-tial pseu-do-fi-nite pseu-do-nym qua-drat-ic
5084 quad-ra-ture qua-si-smooth qua-si-sta-tion-ary qua-si-tri-an-gu-lar
5085 quin-tes-sence quin-tes-sen-tial re-arrange-ment rec-tan-gle
5086 ret-ri-bu-tion retro-fit retro-fit-ted right-eous right-eous-ness
5087 ro-bot ro-bot-ics sched-ul-ing se-mes-ter semi-def-i-nite
5088 semi-ho-mo-thet-ic set-up se-vere-ly side-step sov-er-eign spe-cious
5089 spher-oid spher-oid-al star-tling star-tling-ly sta-tis-tics
5090 sto-chas-tic straight-est strange-ness strat-a-gem strong-hold
5091 sum-ma-ble symp-to-matic syn-chro-nous topo-graph-i-cal tra-vers-a-ble
5092 tra-ver-sal tra-ver-sals treach-ery turn-around un-at-tached
5093 un-err-ing-ly white-space wide-spread wing-spread wretch-ed
5094 wretch-ed-ly Eng-lish Euler-ian Feb-ru-ary Gauss-ian
5095 Hamil-ton-ian Her-mit-ian Jan-u-ary Japan-ese Kor-te-weg
5096 Le-gendre Mar-kov-ian Noe-ther-ian No-vem-ber Rie-mann-ian Sep-tem-ber}
5097 % \end{macrocode}
5098 %
5099 % \subsection{Initialization}
5100 % We define a function to do the normal calculations that we want for
5101 % \cn{textheight} and \cn{textwidth}
5102 %
5103 % \begin{macro}{\calclayout}
5104 % Subtract the height of the running heads:
5105 % \begin{macrocode}
5106 \def\calclayout{\advance\textheight -\headheight
5107 \advance\textheight -\headsep
5108 % \end{macrocode}
5109 % We set \cn{oddsidemargin} and \cn{evensidemargin} to
5110 % center the text on the page.
5111 % \begin{macrocode}
5112 \oddsidemargin\paperwidth
5113 \advance\oddsidemargin -\textwidth
5114 \divide\oddsidemargin\tw@
5115 % \end{macrocode}
5116 % Now we subtract the default margin provided by standard DVI
5117 % drivers. But first we make sure that the final margin will
5118 % be at least .5 inch.
5119 % \begin{macrocode}
5120 \ifdim\oddsidemargin<.5truein \oddsidemargin.5truein \fi
5121 \advance\oddsidemargin -1truein
5122 \evensidemargin\oddsidemargin
5123 % \end{macrocode}
5124 % And we set \cn{topmargin} to get vertical centering as well.
5125 % \begin{macrocode}
5126 \topmargin\paperheight \advance\topmargin -\textheight
5127 \advance\topmargin -\headheight \advance\topmargin -\headsep
5128 % \end{macrocode}
5129 % Height of running foot ignored: not present.
5130 % \begin{macrocode}
5131 \divide\topmargin\tw@
5132 % \end{macrocode}
5133 % We provide a minimum of .5in (after compensating for the default
5134 % margin---see next step).
5135 % \begin{macrocode}
5136 \ifdim\topmargin<.5truein \topmargin.5truein \fi
5137 % \end{macrocode}
5138 % Now subtract the default margin provided by standard DVI
5139 % drivers.
5140 % \begin{macrocode}
5141 \advance\topmargin -1truein\relax
5142 }
5143 % \end{macrocode}
5144 % \end{macro}
5145 %
5146 % Initialize the dimensions, page numbering, etc. For inhouse use,
5147 % administrative stuff is isolated in separate files.
5148 % \begin{macrocode}
5149 %<amsart>\InputIfFileExists{amsart.cfg}{}{%
5150 %<amsproc>\InputIfFileExists{amsproc.cfg}{}{%
5151 %<amsbook>\InputIfFileExists{amsbook.cfg}{}{%
5152 \calclayout % initialize
5153 \pagenumbering{arabic}%
5154 \pagestyle{headings}%
5155 \thispagestyle{plain}%
5156 }
5157 % \end{macrocode}
5158 %
5159 % If we are in compatibility mode, add some backward compatibility
5160 % stuff below. Otherwise quit here.
5161 % \begin{macrocode}
5162 \if@compatibility \else\endinput\fi
5163 % \end{macrocode}
5164 %
5165 % Compensate for changed meaning of \cn{tiny}:
5166 % \begin{macrocode}
5167 \def\tiny{\Tiny}
5168 % \end{macrocode}
5169 %
5170 % The macro \cn{defaultfont} was provided in version 1.1 of amsart;
5171 % retained for compatibility as a synonym of \cn{normalfont}. Resets
5172 % everything except for size.
5173 % \begin{macrocode}
5174 \def\defaultfont{\normalfont}
5175 % \end{macrocode}
5176 %
5177 % Macro for making non-slanted numbers and punctuation in italic
5178 % or slanted text. This is to avoid visual inconsistencies
5179 % between numbers or parentheses in math and adjacent numbers or
5180 % parentheses in text.
5181 % \begin{macrocode}
5182 \def\rom{\textup}
5183 % \end{macrocode}
5184 %
5185 % For backward compatibility with version 1.1 of \cls{amsart}, we
5186 % define \env{pf}, \env{pf*} environments. And undefine \cn{proof}
5187 % just in case an existing document contains a \cn{newenvironment} or
5188 % \cn{newcommand} for it, as that would now cause an error.
5189 % \begin{macrocode}
5190 \let\@newpf\proof \let\proof\relax \let\endproof\relax
5191 \newenvironment{pf}{\@newpf[\proofname]}{\popQED\endtrivlist}
5192 \newenvironment{pf*}[1]{\@newpf[#1]}{\popQED\endtrivlist}
5193 % \end{macrocode}
5194 %
5195 % The usual \cn{endinput} to ensure that random garbage at the end of
5196 % the file doesn't get copied by \fn{docstrip}.
5197 % \begin{macrocode}
5198 \endinput
5199 %</classes>
5200 % \end{macrocode}
5201 %
5202 % \changes{v1.2a}{1995/02/01}{Added global init for @secnumber}
5203 % \changes{v1.2a}{1995/02/01}{Made psamsfonts option pass cmex10 to
5204 % amsmath}
5205 % \changes{v1.2a}{1995/02/01}{Added missing endpar after authors in
5206 % amsbook @maketitle}
5207 %
5208 % \changes{v1.2b}{1995/02/20}{Improve handling of abstract}
5209 % \changes{v1.2b}{1995/02/20}{Allow titlepage option for articles}
5210 % \changes{v1.2b}{1995/02/20}{Suppress logo and copyright info for
5211 % generic AMS classes}
5212 % \changes{v1.2b}{1995/02/20}{Use `Date' instead of `Received by...' in
5213 % the generic AMS classes}
5214 %
5215 % \changes{v2.13}{2002/12/06}{Added a warning for thanks inside author}
5216 %
5217 % \Finale