Debian Codegraph @

texmf-dist/tex/latex/amscls/amsthm.sty

raw
1 %%
2 %% This is file `amsthm.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% amsclass.dtx (with options: `amsthm')
8 %% This is a generated file.
9 %%
10 %% Copyright 1995, 1999, 2004, 2009-2020 American Mathematical Society.
11 %%
12 %% American Mathematical Society
13 %% Technical Support
14 %% Publications Technical Group
15 %% 201 Charles Street
16 %% Providence, RI 02904
17 %% USA
18 %% tel: (401) 455-4080
19 %% (800) 321-4267 (USA and Canada only)
20 %% fax: (401) 331-3842
21 %% email: [email protected]
22 %%
23 %% This work may be distributed and/or modified under the
24 %% conditions of the LaTeX Project Public License, either version 1.3c
25 %% of this license or (at your option) any later version.
26 %% The latest version of this license is in
27 %% http://www.latex-project.org/lppl.txt
28 %% and version 1.3c or later is part of all distributions of LaTeX
29 %% version 2005/12/01 or later.
30 %%
31 %% This work has the LPPL maintenance status `maintained'.
32 %%
33 %% The Current Maintainer of this work is the American Mathematical
34 %% Society.
35 %%
36 %% ========================================================================
37 %%
38 \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
39 [1995/06/01]% LaTeX date must be June 1995 or later
40 \ProvidesPackage{amsthm}[2020/05/29 v2.20.6]
41 \let\@xp=\expandafter
42 \let\@nx=\noexpand
43 \def\@oparg#1[#2]{\@ifnextchar[{#1}{#1[#2]}}
44 \long\def\@ifempty#1{\@xifempty#1@@..\@nil}
45 \long\def\@xifempty#1#2@#3#4#5\@nil{%
46 \ifx#3#4\@xp\@firstoftwo\else\@xp\@secondoftwo\fi}
47 \long\def\@ifnotempty#1{\@ifempty{#1}{}}
48 \def\setboxz@h{\setbox\z@\hbox}
49 \def\@addpunct#1{%
50 \relax\ifhmode
51 \ifnum\spacefactor>\@m \else#1\fi
52 \fi}
53 \def\nopunct{\spacefactor 1007 }
54 \def\frenchspacing{\sfcode`\.1006\sfcode`\?1005\sfcode`\!1004%
55 \sfcode`\:1003\sfcode`\;1002\sfcode`\,1001 }
56 \DeclareOption*{\input{\CurrentOption .thm}}
57 \ProcessOptions
58
59 \newcommand{\theoremstyle}[1]{%
60 \@ifundefined{th@#1}{%
61 \PackageWarning{amsthm}{Unknown theoremstyle `#1'}%
62 \thm@style{plain}%
63 }{%
64 \thm@style{#1}%
65 }%
66 }
67 \newtoks\thm@style
68 \thm@style{plain}
69 \newtoks\thm@bodyfont \thm@bodyfont{\itshape}
70 \newtoks\thm@headfont \thm@headfont{\bfseries}
71 \newtoks\thm@notefont \thm@notefont{}
72 \newtoks\thm@headpunct \thm@headpunct{.}
73 \newskip\thm@preskip \newskip\thm@postskip
74 \def\thm@space@setup{%
75 \thm@preskip=\topsep \thm@postskip=\thm@preskip
76 }
77 \renewcommand{\newtheorem}{\@ifstar{\@xnthm *}{\@xnthm \relax}}
78 \def\@xnthm#1#2{%
79 \let\@tempa\relax
80 \@xp\@ifdefinable\csname #2\endcsname{%
81 \global\@xp\let\csname end#2\endcsname\@endtheorem
82 \ifx *#1% unnumbered, need to get one more mandatory arg
83 \edef\@tempa##1{%
84 \gdef\@xp\@nx\csname#2\endcsname{%
85 \@nx\@thm{\@xp\@nx\csname th@\the\thm@style\endcsname}%
86 {}{##1}}}%
87 \else % numbered theorem, need to check for optional arg
88 \def\@tempa{\@oparg{\@ynthm{#2}}[]}%
89 \fi
90 }%
91 \@tempa
92 }
93 \def\@ynthm#1[#2]#3{%
94 \ifx\relax#2\relax
95 \def\@tempa{\@oparg{\@xthm{#1}{#3}}[]}%
96 \else
97 \@ifundefined{c@#2}{%
98 \def\@tempa{\@nocounterr{#2}}%
99 }{%
100 \@xp\xdef\csname the#1\endcsname{\@xp\@nx\csname the#2\endcsname}%
101 \toks@{#3}%
102 \@xp\xdef\csname#1\endcsname{%
103 \@nx\@thm{%
104 \let\@nx\thm@swap
105 \if S\thm@swap\@nx\@firstoftwo\else\@nx\@gobble\fi
106 \@xp\@nx\csname th@\the\thm@style\endcsname}%
107 {#2}{\the\toks@}}%
108 \let\@tempa\relax
109 }%
110 \fi
111 \@tempa
112 }
113 \def\@xthm#1#2[#3]{%
114 \ifx\relax#3\relax
115 \newcounter{#1}%
116 \else
117 \newcounter{#1}[#3]%
118 \@xp\xdef\csname the#1\endcsname{\@xp\@nx\csname the#3\endcsname
119 \@thmcountersep\@thmcounter{#1}}%
120 \fi
121 \toks@{#2}%
122 \@xp\xdef\csname#1\endcsname{%
123 \@nx\@thm{%
124 \let\@nx\thm@swap
125 \if S\thm@swap\@nx\@firstoftwo\else\@nx\@gobble\fi
126 \@xp\@nx\csname th@\the\thm@style\endcsname}%
127 {#1}{\the\toks@}}%
128 }
129 \def\@thm#1#2#3{%
130 \ifhmode\unskip\unskip\par\fi
131 \normalfont
132 \trivlist
133 \let\thmheadnl\relax
134 \let\thm@swap\@gobble
135 \thm@notefont{\fontseries\mddefault\upshape}%
136 \thm@headpunct{.}% add period after heading
137 \thm@headsep 5\p@ plus\p@ minus\p@\relax
138 \thm@space@setup
139 #1% style overrides
140 \@topsep \thm@preskip % used by thm head
141 \@topsepadd \thm@postskip % used by \@endparenv
142 \def\@tempa{#2}\ifx\@empty\@tempa
143 \def\@tempa{\@oparg{\@begintheorem{#3}{}}[]}%
144 \else
145 \refstepcounter{#2}%
146 \def\@tempa{\@oparg{\@begintheorem{#3}{\csname the#2\endcsname}}[]}%
147 \fi
148 \@tempa
149 }
150 \def\@restorelabelsep{\relax}
151 \let\@ythm\relax
152 \let\thmname\@iden \let\thmnote\@iden \let\thmnumber\@iden
153 \providecommand\@upn{\textup}
154 \def\thmhead@plain#1#2#3{%
155 \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
156 \thmnote{ {\the\thm@notefont(#3)}}}
157 \let\thmhead\thmhead@plain
158 \def\swappedhead#1#2#3{%
159 \thmnumber{#2}%
160 \thmname{\@ifnotempty{#2}{~}#1}%
161 \thmnote{ {\the\thm@notefont(#3)}}}
162 \let\swappedhead@plain=\swappedhead
163 \let\thmheadnl\relax
164 \let\thm@indent\noindent
165 \let\thm@swap\@gobble
166 \def\@begintheorem#1#2[#3]{%
167 \deferred@thm@head{\the\thm@headfont \thm@indent
168 \@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}%
169 \@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}%
170 \@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}%
171 \thm@swap\swappedhead\thmhead{#1}{#2}{#3}%
172 \the\thm@headpunct
173 \thmheadnl % possibly a newline.
174 \hskip\thm@headsep
175 }%
176 \ignorespaces}
177 \newskip\thm@headsep
178 \thm@headsep=5pt plus1pt minus1pt\relax
179 \let\adjust@parskip@nobreak=\@nbitem
180 \newtoks\dth@everypar
181 \dth@everypar={%
182 \@minipagefalse \global\@newlistfalse
183 \@noparitemfalse
184 \if@inlabel
185 \global\@inlabelfalse
186 \begingroup \setbox\z@\lastbox
187 \ifvoid\z@ \kern-\itemindent \fi
188 \endgroup
189 \unhbox\@labels
190 \fi
191 \if@nobreak \@nobreakfalse \clubpenalty\@M
192 \else \clubpenalty\@clubpenalty \everypar{}%
193 \fi
194 }%
195 \def\deferred@thm@head#1{%
196 \if@inlabel \indent \par \fi % eject a section head if one is pending
197 \if@nobreak
198 \adjust@parskip@nobreak
199 \else
200 \addpenalty\@beginparpenalty
201 \addvspace\@topsep
202 \addvspace{-\parskip}%
203 \fi
204 \global\@inlabeltrue
205 \everypar\dth@everypar
206 \sbox\@labels{\normalfont#1}%
207 \ignorespaces
208 }
209 \def\nonslanted{\relax
210 \@xp\let\@xp\@tempa\csname\f@shape shape\endcsname
211 \ifx\@tempa\itshape\upshape
212 \else\ifx\@tempa\slshape\upshape\fi\fi}
213 \def\swapnumbers{\edef\thm@swap{\if S\thm@swap N\else S\fi}}
214 \def\thm@swap{N}%
215 \let\@opargbegintheorem\relax
216 \def\th@plain{%
217 %% \let\thm@indent\noindent % no indent
218 %% \thm@headfont{\bfseries}% heading font is bold
219 %% \thm@notefont{}% same as heading font
220 %% \thm@headpunct{.}% add period after heading
221 %% \let\thm@swap\@gobble
222 %% \thm@preskip\topsep
223 %% \thm@postskip\theorempreskipamount
224 \itshape % body font
225 }
226 \def\th@definition{%
227 \normalfont % body font
228 }
229 \def\th@remark{%
230 \thm@headfont{\itshape}%
231 \normalfont % body font
232 \thm@preskip\topsep \divide\thm@preskip\tw@
233 \thm@postskip\thm@preskip
234 }
235 \def\@endtheorem{\endtrivlist\@endpefalse }
236 \newcommand{\newtheoremstyle}[9]{%
237 \@ifempty{#5}{\dimen@\z@skip}{\dimen@#5\relax}%
238 \ifdim\dimen@=\z@
239 \toks@{#4\let\thm@indent\noindent}%
240 \else
241 \toks@{#4\def\thm@indent{\noindent\hbox to#5{}}}%
242 \fi
243 \def\@tempa{#8}\ifx\space\@tempa
244 \toks@\@xp{\the\toks@ \thm@headsep\fontdimen\tw@\font\relax}%
245 \else
246 \def\@tempb{\newline}%
247 \ifx\@tempb\@tempa
248 \toks@\@xp{\the\toks@ \thm@headsep\z@skip
249 \def\thmheadnl{\newline}}%
250 \else
251 \toks@\@xp{\the\toks@ \thm@headsep#8\relax}%
252 \fi
253 \fi
254 \begingroup
255 \thm@space@setup
256 \@defaultunits\@tempskipa#2\thm@preskip\relax\@nnil
257 \@defaultunits\@tempskipb#3\thm@postskip\relax\@nnil
258 \xdef\@gtempa{\thm@preskip\the\@tempskipa
259 \thm@postskip\the\@tempskipb\relax}%
260 \endgroup
261 \@temptokena\@xp{\@gtempa
262 \thm@headfont{#6}\thm@headpunct{#7}%
263 }%
264 \@ifempty{#9}{%
265 \let\thmhead\thmhead@plain
266 }{%
267 \@namedef{thmhead@#1}##1##2##3{#9}%
268 \@temptokena\@xp{\the\@temptokena
269 \@xp\let\@xp\thmhead\csname thmhead@#1\endcsname}%
270 }%
271 \@xp\xdef\csname th@#1\endcsname{\the\toks@ \the\@temptokena}%
272 }
273 \DeclareRobustCommand{\qed}{%
274 \ifmmode \mathqed
275 \else
276 \leavevmode\unskip\penalty9999 \hbox{}\nobreak\hfill
277 \quad\hbox{\qedsymbol}%
278 \fi
279 }
280 \let\QED@stack\@empty
281 \let\qed@elt\relax
282 \newcommand{\pushQED}[1]{%
283 \toks@{\qed@elt{#1}}\@temptokena\expandafter{\QED@stack}%
284 \xdef\QED@stack{\the\toks@\the\@temptokena}%
285 }
286 \newcommand{\popQED}{%
287 \begingroup\let\qed@elt\popQED@elt \QED@stack\relax\relax\endgroup
288 }
289 \def\popQED@elt#1#2\relax{#1\gdef\QED@stack{#2}}
290 \newcommand{\qedhere}{%
291 \begingroup \let\mathqed\math@qedhere
292 \let\qed@elt\setQED@elt \QED@stack\relax\relax \endgroup
293 }
294 \newif\ifmeasuring@
295 \newif\iffirstchoice@ \firstchoice@true
296 \def\setQED@elt#1#2\relax{%
297 \ifmeasuring@
298 \else \iffirstchoice@ \gdef\QED@stack{\qed@elt{}#2}\fi
299 \fi
300 #1%
301 }
302 \def\qed@warning{%
303 \PackageWarning{amsthm}{The \@nx\qedhere command may not work
304 correctly here}%
305 }
306 \newcommand{\mathqed}{\quad\hbox{\qedsymbol}}
307 \def\linebox@qed{\hfil\hbox{\qedsymbol}\hfilneg}
308 \@ifpackageloaded{amsmath}{%
309 \def\math@qedhere{%
310 \@ifundefined{\@currenvir @qed}{%
311 \qed@warning\quad\hbox{\qedsymbol}%
312 }{%
313 \@xp\aftergroup\csname\@currenvir @qed\endcsname
314 }%
315 }
316 \def\displaymath@qed{%
317 \relax
318 \ifmmode
319 \ifinner \aftergroup\linebox@qed
320 \else
321 \eqno
322 \let\eqno\relax \let\leqno\relax \let\veqno\relax
323 \hbox{\qedsymbol}%
324 \fi
325 \else
326 \aftergroup\linebox@qed
327 \fi
328 }
329 \@xp\let\csname equation*@qed\endcsname\displaymath@qed
330 \def\equation@qed{%
331 \iftagsleft@
332 \hbox{\phantom{\quad\qedsymbol}}%
333 \gdef\alt@tag{%
334 \rlap{\hbox to\displaywidth{\hfil\qedsymbol}}%
335 \global\let\alt@tag\@empty
336 }%
337 \else
338 \gdef\alt@tag{%
339 \global\let\alt@tag\@empty
340 \vtop{\ialign{\hfil####\cr
341 \tagform@\theequation\cr
342 \qedsymbol\cr}}%
343 \setbox\z@
344 }%
345 \fi
346 }
347 \def\qed@tag{%
348 \global\tag@true \nonumber
349 &\omit\setboxz@h {\strut@ \qedsymbol}\tagsleft@false
350 \place@tag@gather
351 \kern-\tabskip
352 \ifst@rred \else \global\@eqnswtrue \fi \global\advance\row@\@ne \cr
353 }
354 \def\split@qed{%
355 \def\endsplit{\crcr\egroup \egroup \ctagsplit@false \rendsplit@
356 \aftergroup\align@qed
357 }%
358 }
359 \def\align@qed{%
360 \ifmeasuring@ \tag*{\qedsymbol}%
361 \else \let\math@cr@@@\qed@tag
362 \fi
363 }
364 \@xp\let\csname align*@qed\endcsname\align@qed
365 \@xp\let\csname gather*@qed\endcsname\align@qed
366 %% Needs some patching up for amsmath 1.2
367 }{% end of amsmath branch, start plain LaTeX branch
368 \def\math@qedhere{%
369 \@ifundefined{\@currenvir @qed}{%
370 \qed@warning \aftergroup\displaymath@qed
371 }{%
372 \@xp\aftergroup\csname\@currenvir @qed\endcsname
373 }%
374 }
375 \def\displaymath@qed{%
376 \relax
377 \ifmmode
378 \ifinner \aftergroup\aftergroup\aftergroup\linebox@qed
379 \else
380 \eqno \def\@badmath{$$}%
381 \let\eqno\relax \let\leqno\relax \let\veqno\relax
382 \hbox{\qedsymbol}%
383 \fi
384 \else
385 \aftergroup\linebox@qed
386 \fi
387 }
388 \@ifundefined{[email protected]}{%
389 \def\equation@qed{\displaymath@qed \quad}%
390 }{%
391 \def\equation@qed{\displaymath@qed}%
392 }
393 \def\@tempa#1$#2#3\@nil#4{%
394 \def#4{#1$#2\def\@currenvir{displaymath}#3}%
395 }%
396 \expandafter\ifx\csname[ \endcsname\relax
397 \expandafter\@tempa\[\@nil\[%
398 \else
399 \expandafter\expandafter\expandafter\@tempa\csname[
400 \expandafter\endcsname\expandafter\@nil
401 \csname[ \endcsname
402 \fi
403 }
404 \@ifpackageloaded{amstex}{%
405 \def\@tempa{TT}%
406 }{%
407 \@ifpackageloaded{amsmath}{%
408 \def\@tempb#1 v#2.#3\@nil{#2}%
409 \ifnum\@xp\@xp\@xp\@tempb\csname [email protected]\endcsname v0.0\@nil
410 <\tw@
411 \def\@tempa{TT}%
412 \else
413 \def\@tempa{TF}%
414 \fi
415 }{%
416 \def\@tempa{TF}
417 }%
418 }
419 \if\@tempa
420 \renewcommand{\math@qedhere}{\quad\hbox{\qedsymbol}}%
421 \fi
422 \newcommand{\openbox}{\leavevmode
423 \hbox to.77778em{%
424 \hfil\vrule
425 \vbox to.675em{\hrule width.6em\vfil\hrule}%
426 \vrule\hfil}}
427 \DeclareRobustCommand{\textsquare}{%
428 \begingroup \usefont{U}{msa}{m}{n}\thr@@\endgroup
429 }
430 \providecommand{\qedsymbol}{\openbox}
431 \newenvironment{proof}[1][\proofname]{\par
432 \pushQED{\qed}%
433 \normalfont \topsep6\p@\@plus6\p@\relax
434 \trivlist
435 \item[\hskip\labelsep
436 \itshape
437 #1\@addpunct{.}]\ignorespaces
438 }{%
439 \popQED\endtrivlist\@endpefalse
440 }
441 \providecommand{\proofname}{Proof}
442 \endinput
443 %%
444 %% End of file `amsthm.sty'.