forked from tomdjong/MGS-domain-theory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
146 lines (128 loc) · 5.04 KB
/
main.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
\documentclass[a4paper, oneside, 12pt, openany]{book}
\pdfoutput=1
\usepackage{packages}
\usepackage{macros}
% Label tables just like equations, theorems, definitions, etc.
%
% NB: This can be confusing if LaTeX does not place the table at the point of
% writing (e.g. for lack of space)!
\numberwithin{equation}{chapter}
\numberwithin{table}{chapter}
\makeatletter
\let\c@equation\c@table
\makeatother
% Setting up the coloured environments
%
\newbool{shade-envs}
% This can be used to toggle the coloured environments on or off.
\setboolean{shade-envs}{true}
%%
\ifthenelse{\boolean{shade-envs}}{%
% Colours are as in Andrej Bauer's notes on realizability:
% https://github.com/andrejbauer/notes-on-realizability
\colorlet{ShadeOfPurple}{blue!5!white}
\colorlet{ShadeOfYellow}{yellow!5!white}
\colorlet{ShadeOfGreen} {green!5!white}
\colorlet{ShadeOfBrown} {brown!10!white}
% But we also shade proofs
\colorlet{ShadeOfGray} {gray!10!white}
% For exercises
\colorlet{ShadeOfRed} {red!10!white}
}
% If we don't want to have shaded environments, then we use a closing symbol
% \lozenge to mark the end of remarks, definitions and examples.
{%
\declaretheoremstyle[
spaceabove=6pt,
spacebelow=6pt,
bodyfont=\normalfont,
qed=\(\lozenge\)
]{definitionwithbox}
\declaretheoremstyle[
headfont=\itshape,
bodyfont=\normalfont,
qed=\(\lozenge\)
]{remarkwithbox}
}
% Now we set the shading using the tcolorbox package.
%
% The related thmtools' option "shaded" and the package mdframed seem to have
% issues: the former does not allow for page breaks in shaded environments and
% the latter puts double spacing between two shaded environments.
\tcbset{shadedenv/.style={
colback={#1},
frame hidden,
enhanced,
breakable,
boxsep=0pt,
left=2mm,
right=2mm,
% LaTeX thinks this is too wide (as becomes clear from the many "Overfull
% \hbox" warnings, but optically it looks spot on.
add to width=1.1mm,
enlarge left by=-0.6mm}
}
% Keep a count of the number of exercises
\newtotcounter{allexercises}
\ifthenelse{\boolean{shade-envs}}{%
\declaretheorem[sibling=equation]{theorem}
\declaretheorem[unnumbered,title=Theorem]{theorem*}
\declaretheorem[sibling=theorem]{lemma,proposition,corollary}
\declaretheorem[unnumbered,title=Lemma]{lemma*}
\declaretheorem[sibling=theorem,style=definition]{definition}
\declaretheorem[sibling=theorem,style=definition]{example}
\declaretheorem[sibling=theorem,style=remark]{remark}
\declaretheorem[sibling=theorem,style=definition,postheadhook=\stepcounter{allexercises}]{exercise}
%
\tcolorboxenvironment{theorem} {shadedenv={ShadeOfPurple}}
\tcolorboxenvironment{theorem*} {shadedenv={ShadeOfPurple}}
\tcolorboxenvironment{lemma} {shadedenv={ShadeOfPurple}}
\tcolorboxenvironment{lemma*} {shadedenv={ShadeOfPurple}}
\tcolorboxenvironment{proposition}{shadedenv={ShadeOfPurple}}
\tcolorboxenvironment{corollary} {shadedenv={ShadeOfPurple}}
\tcolorboxenvironment{definition} {shadedenv={ShadeOfYellow}}
\tcolorboxenvironment{example} {shadedenv={ShadeOfGreen}}
\tcolorboxenvironment{remark} {shadedenv={ShadeOfBrown}}
\tcolorboxenvironment{proof} {shadedenv={ShadeOfGray}}
\tcolorboxenvironment{exercise} {shadedenv={ShadeOfRed}}
}{% Use closing symbols if we don't have colours
\declaretheorem[sibling=equation]{theorem}
\declaretheorem[sibling=theorem]{lemma,proposition,corollary}
\declaretheorem[unnumbered,title=Theorem]{theorem*}
\declaretheorem[unnumbered,title=Lemma]{lemma*}
\declaretheorem[sibling=theorem,style=definitionwithbox]{definition}
\declaretheorem[sibling=theorem,style=definitionwithbox]{example}
\declaretheorem[sibling=theorem,style=remarkwithbox]{remark}
\declaretheorem[sibling=theorem,style=definitionwithbox,postheadhook=\stepcounter{allexercises}]{exercise}
\tcolorboxenvironment{theorem} {shadedenv={white}}
\tcolorboxenvironment{theorem*} {shadedenv={white}}
\tcolorboxenvironment{lemma} {shadedenv={white}}
\tcolorboxenvironment{lemma*} {shadedenv={white}}
\tcolorboxenvironment{proposition}{shadedenv={white}}
\tcolorboxenvironment{corollary} {shadedenv={white}}
\tcolorboxenvironment{definition} {shadedenv={white}}
\tcolorboxenvironment{example} {shadedenv={white}}
\tcolorboxenvironment{remark} {shadedenv={white}}
\tcolorboxenvironment{proof} {shadedenv={white}}
\tcolorboxenvironment{exercise} {shadedenv={white}}
}
\declaretheorem[sibling=theorem,style=remark,numbered=no]{claim}
% Note that proofs will still have the \qed symbol at the end, even when shaded,
% because we prefer to keep up the tradition.
\begin{document}
\frontmatter
\include{frontmatter/titlepage}
\restoregeometry%
\include{frontmatter/abstract}
\include{frontmatter/acknowledgements}
\setcounter{tocdepth}{2}
\tableofcontents
\mainmatter%
\include{mainmatter/introduction}
\include{mainmatter/pcf}
\include{mainmatter/domains}
\include{mainmatter/scott-model}
\include{mainmatter/adequacy}
\backmatter%
\printbibliography[heading=bibintoc]%
\end{document}