Debian Codegraph @

texmf-dist/tex/latex/beamer/beamerbasetheorems.sty

raw
1 % Copyright 2003--2007 by Till Tantau
2 % Copyright 2010 by Vedran Mileti\'c
3 % Copyright 2017 by Joseph Wright
4 %
5 % This file may be distributed and/or modified
6 %
7 % 1. under the LaTeX Project Public License and/or
8 % 2. under the GNU Public License.
9 %
10 % See the file LICENSE.md for more details.
11
12 \mode
13 <presentation>
14
15 \ifbeamer@ams
16
17 \RequirePackage{amsmath}
18 \RequirePackage{amsthm}
19
20 % For old versions of amsthm
21 \providecommand\thm@space@setup{}
22 \providecommand\pushQED[1]{\def\beamer@qed{#1}}
23 \providecommand\popQED{\beamer@qed}
24 \providecommand\qedhere{\qed}
25
26 % Redfine certain amsthm internals:
27 \def\@thm#1#2#3{%
28 \ifhmode\unskip\unskip\par\fi
29 \normalfont
30 \let\thmheadnl\relax
31 \let\thm@swap\@gobble
32 \thm@headpunct{.}% add period after heading
33 \thm@space@setup
34 #1% style overrides
35 \def\inserttheoremname{#3}
36 \def\inserttheorempunctuation{\the\thm@headpunct}
37 \def\@tempa{#2}%
38 \ifx\@empty\@tempa
39 \def\inserttheoremnumber{}
40 \else
41 \refstepcounter{#2}%
42 \expandafter\def\expandafter\inserttheoremnumber\expandafter{ \csname the#2\endcsname}
43 \fi
44 \beamer@begintheorem%
45 }
46
47 \let\beamer@origxthm=\@xthm
48 \def\@xthm#1{\resetcounteronoverlays{#1}\beamer@origxthm{#1}}
49
50 \def\inserttheoremheadfont{\the\thm@headfont}
51 \def\inserttheoremblockenv{block}
52
53 \def\th@example{%
54 \normalfont % body font
55 \def\inserttheoremblockenv{exampleblock}
56 }
57
58 \newcommand<>\beamer@begintheorem[1][]{%
59 \ifblank{#1}
60 {\def\inserttheoremaddition{}}
61 {\def\inserttheoremaddition{#1}}
62 \usebeamertemplate{theorem begin}#2}
63 \def\@endtheorem{\usebeamertemplate{theorem end}}
64
65 \renewenvironment<>{proof}[1][\proofname]{%
66 \par
67 \def\insertproofname{#1\@addpunct{.}}%
68 \pushQED{\qed}
69 \usebeamertemplate{proof begin}#2}
70 {\popQED\usebeamertemplate{proof end}}
71
72 \fi
73
74 \def\qedsymbol{\leavevmode\hbox{\usebeamertemplate*{qed symbol}}}
75
76
77 \mode
78 <article>
79 {
80 \ifbeamer@ams
81 \RequirePackage{amsmath}
82 \RequirePackage{amsthm}
83
84 \renewenvironment<>{proof}[1][\proofname]
85 {\begin{actionenv}#2\begin{originalproof}[{#1}]}{\end{originalproof}\end{actionenv}}
86
87 % Make new theorem overlay-specification-aware
88 \let\beamer@origthm=\@thm
89 \def\@thm#1#2#3{\def\beamer@store{{#1}{#2}{#3}}\beamer@readspec}
90 \def\beamer@storeaction{\begin{actionenv}}
91 \newcommand<>\beamer@readspec[1][]{\def\beamer@storeaction{\begin{actionenv}#2}%
92 \expandafter\beamer@origthm\beamer@store[{#1}]}
93
94 \let\beamer@origbegintheorem=\@begintheorem
95 \def\@begintheorem{\beamer@storeaction\beamer@origbegintheorem}
96
97 \let\beamer@origendtheorem=\@endtheorem
98 \def\@endtheorem{\beamer@origendtheorem\end{actionenv}}
99 \fi
100
101 \def\th@example{\th@remark}
102
103 \newcommand{\ExampleInline}[1]{\translate{Example}: \ignorespaces#1}
104
105 % Compatibility:
106 \newcommand{\BeispielInline}[1]{Beispiel: \ignorespaces#1}
107 }
108
109 \mode
110 <all>
111 {
112 \ifbeamer@blocks
113 \ifbeamer@countsect
114 \newtheorem{theorem}{\translate{Theorem}}[section]
115 \else
116 \newtheorem{theorem}{\translate{Theorem}}
117 \fi
118 \newtheorem{corollary}[theorem]{\translate{Corollary}}
119 \newtheorem{fact}[theorem]{\translate{Fact}}
120 \newtheorem{lemma}[theorem]{\translate{Lemma}}
121 \newtheorem{problem}[theorem]{\translate{Problem}}
122 \newtheorem{solution}[theorem]{\translate{Solution}}
123
124 \theoremstyle{definition}
125 \newtheorem{definition}[theorem]{\translate{Definition}}
126 \newtheorem{definitions}[theorem]{\translate{Definitions}}
127
128 \theoremstyle{example}
129 \newtheorem{example}[theorem]{\translate{Example}}
130 \newtheorem{examples}[theorem]{\translate{Examples}}
131
132
133 % Compatibility
134 \newtheorem{Beispiel}[theorem]{Beispiel}
135 \newtheorem{Beispiele}[theorem]{Beispiele}
136 \theoremstyle{plain}
137 \newtheorem{Loesung}[theorem]{L\"osung}
138 \newtheorem{Satz}[theorem]{Satz}
139 \newtheorem{Folgerung}[theorem]{Folgerung}
140 \newtheorem{Fakt}[theorem]{Fakt}
141 \newenvironment{Beweis}{\begin{proof}[Beweis.]}{\end{proof}}
142 \newenvironment{Lemma}{\begin{lemma}}{\end{lemma}}
143 \newenvironment{Proof}{\begin{proof}}{\end{proof}}
144 \newenvironment{Theorem}{\begin{theorem}}{\end{theorem}}
145 \newenvironment{Problem}{\begin{problem}}{\end{problem}}
146 \newenvironment{Corollary}{\begin{corollary}}{\end{corollary}}
147 \newenvironment{Example}{\begin{example}}{\end{example}}
148 \newenvironment{Examples}{\begin{examples}}{\end{examples}}
149 \newenvironment{Definition}{\begin{definition}}{\end{definition}}
150 \fi
151 }
152
153 \mode
154 <all>