-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path21-theorems.tex
132 lines (112 loc) · 4.58 KB
/
21-theorems.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
% Provides: Definitions and styling for theorem-like environments
% Requires: the math-header for \newtheorem, one of the language-headers
\iftoggle{20-math}{
\newtoggle{framedTheorems}
% Change this to ‘true’ if you want the theorem environments to be beautifully framed
\settoggle{framedTheorems}{false}
% shortcut for defining both numbered and unnumbered versions of an environment in a signle command
% Usage: \newoptionalnumberedtheroem{envName}{counterLike}{Display Name}
\NewDocumentCommand{\newoptionalnumberedtheorem}{ m m m }{
\newtheorem{#1} [#2]{#3}
\newtheorem*{#1*} {#3}
}
% theorems need to be defined even when they are not visually surrounded
\nottoggle{framedTheorems}{
\theoremstyle{definition}
% the definition counter by which all other counted environments will be counted
% needs to be defined by a different syntax -> cannot use \newoptionalnumberedtheorem{…}
% number by [chapter].[counter] in documentclasses with the \chapter command
% and by [section].[counter] in documentclasses without it
\ifdef\chapter
{\newtheorem{definition} {Definition} [chapter]}
{\newtheorem{definition} {Definition} [section]}
\newtheorem*{definition*} {Definition}
\newoptionalnumberedtheorem{proposition} {definition} {Proposition}
\newoptionalnumberedtheorem{lemma} {definition} {Lemma}
\newoptionalnumberedtheorem{axiom} {definition} {Axiom}
\iftoggle{02-language-english}{
\newoptionalnumberedtheorem {theorem} {definition} {Theorem}
\newoptionalnumberedtheorem {corollary} {definition} {Corollary}
}{}
\iftoggle{02-language-german}{
\newoptionalnumberedtheorem {theorem} {definition} {Satz}
\newoptionalnumberedtheorem {corollary} {definition} {Korollar}
}{}
}{
% Frame the environments Definition, Proposition, Lemma, Axiom, Theorem, Corollary, and Example
% For frames around theorems
% Loads xcolor if it has not previously been loaded
\usepackage{mdframed}
% Default values for all frames
\mdfsetup{
skipabove=\baselineskip,
skipbelow=\baselineskip,
}
% styling for almost all frames
\mdfdefinestyle{theoremstyle}{
roundcorner=2pt,
linewidth=0.6pt,
frametitlerule=true,%
frametitleaboveskip=7pt,
frametitlebelowskip=7pt,
frametitlerulewidth=0.4pt,%
innertopmargin=\topskip,
innerbottommargin=\topskip,
nobreak=true,
% frametitlebackgroundcolor=gray!30,
}
% Same for both languages
% Definitions define the numbering name of nev printed name numbering resets with
\mdtheorem[style=theoremstyle] {definition} {Definition} [section]
% Everything else follows it name of env numbered like printed name
\mdtheorem[style=theoremstyle] {proposition} [definition] {Proposition}
\mdtheorem[style=theoremstyle] {lemma} [definition] {Lemma}
\mdtheorem[style=theoremstyle] {axiom} [definition] {Axiom}
\iftoggle{02-language-english}{
\mdtheorem[style=theoremstyle] {theorem} [definition] {Theorem}
\mdtheorem[style=theoremstyle] {corollary} [definition] {Corollary}
}{}
\iftoggle{02-language-german}{
\mdtheorem[style=theoremstyle] {theorem} [definition] {Satz}
\mdtheorem[style=theoremstyle] {corollary} [definition] {Korollar}
}{}
}
% \proofname is language-aware (but I don't know whether babel or some ams-package sets it)
\NewDocumentEnvironment {subproof} { O{\proofname} +b}{%
\renewcommand{\qedsymbol}{$\blacksquare$}%
\begin{proof}[#1]%
#2
\end{proof}%
}{}
% In-text environments, need to be defined no matter what.
% They all use the ‘remark’-theorem-style, i.e. italic theorem name.
\theoremstyle{remark}
\newoptionalnumberedtheorem{problem} {definition}{Problem}
\newoptionalnumberedtheorem{notation} {definition}{Notation}
\iftoggle{02-language-english}{
\newoptionalnumberedtheorem{terminology} {definition}{Terminology}
\newoptionalnumberedtheorem{remark} {definition}{Remark}
\newoptionalnumberedtheorem{example} {definition}{Example}
}{}
\iftoggle{02-language-german}{
\newoptionalnumberedtheorem{terminology} {definition}{Terminologie}
\newoptionalnumberedtheorem{remark} {definition}{Anmerkung}
\newoptionalnumberedtheorem{example} {definition}{Beispiel}
}{}
\iftoggle{framedTheorems}{
% examples have a lightgrey background and a darkgray left-line
\mdfdefinestyle{examplestyle}{%
topline=false,
bottomline=false,
rightline=false,
linewidth=4pt,
linecolor=lightgray!70,
backgroundcolor=lightgray!40,
innertopmargin=7pt,
innerbottommargin=7pt,
}
\surroundwithmdframed[style=examplestyle]{example}
\surroundwithmdframed[style=examplestyle]{example*}
}{}
\toggletrue{21-theorems}
}{}