-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.tex
185 lines (156 loc) · 4.55 KB
/
common.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
% PDF links
\usepackage{hyperref}
% amsmath with improvements
\usepackage{mathtools}
% use GoMono as typewriter font
\usepackage[
% otherwise bold is not available ("undefined font shape" warnings)
type1,
% scale to match main font size
scale=0.88,
]{GoMono}
% need T1 font encoding for Charter,
% otherwise there will be "undefined font shape" warnings
\usepackage[T1]{fontenc}
% silence warnings
\usepackage{silence}
% use Bitstream Charter as main font,
% suppress warning due to https://github.com/latex3/latex2e/issues/299
\WarningFilter{latex}{Font shape declaration has incorrect series value `mc'.}
\usepackage[bitstream-charter]{mathdesign}
% specify fonts to use
\usepackage{fontspec}
% symbols and names of CC licenses
\usepackage[type=CC,modifier=by-sa,version=4.0]{doclicense}
% control enumerate and itemize
\usepackage{enumitem}
% micro-typographic adjustments
\usepackage{microtype}
% colors
\usepackage{xcolor}
% graphics
\usepackage{graphicx}
% drawings
\usepackage{tikz}
% contours
\usepackage[outline]{contour}
% output stuff after the current page
\usepackage{afterpage}
\usetikzlibrary{
% text along circle
decorations.text,
}
% set thickness of contours
\contourlength{0.01em}
% set Charter as main font (otherwise, sz ligature will be typeset as "SS")
\setmainfont{XCharter}
% don't use sans-serif font for headings
\setkomafont{disposition}{\normalcolor\bfseries}
% define colors (mix between MATLAB and matplotlib colors)
\definecolor{C0}{rgb}{0.000,0.447,0.741}
\definecolor{C1}{rgb}{0.850,0.325,0.098}
% set up hyperref
\hypersetup{
pdfauthor={Julian Valentin},
pdfcreator={LaTeX, KOMA-Script, hyperref},
% underline links instead of putting a framed box around them
pdfborderstyle={/S/U/W 1},
% set link colors
citebordercolor=C1,
filebordercolor=C1,
linkbordercolor=C1,
menubordercolor=C1,
runbordercolor=C1,
urlbordercolor=C0,
% prepend bookmarks with section number
bookmarksnumbered,
}
% number sets
\newcommand*{\nat}{\mathbb{N}}
\newcommand*{\integer}{\mathbb{Z}}
% notation
\newcommand*{\field}[1]{\integer/n\integer}
\newcommand*{\powerset}[1]{\mathcal{P}(#1)}
% binary relations
\newcommand*{\ceq}{\coloneqq}
\newcommand*{\dcup}{\mathbin{\dot{\cup}}}
% commands
\newcommand*{\term}[1]{\emph{#1}}
\newcommand*{\theda}[1]{%
\texorpdfstring{$\vartheta$}{ϑ}~--~\textsc{Das~Spiel}%
\if\relax\detokenize{#1}\relax%
\else%
~--~#1%
\fi%
}
% macros for including pages
\newcommand*{\pageSize}{8.1}
\newcommand*{\truncationAngle}{30}
\pgfmathsetmacro{\pageRadius}{\pageSize/sqrt(2)}
\pgfmathsetmacro{\truncationPointTopX}{\pageRadius*cos(180-\truncationAngle)}
\pgfmathsetmacro{\truncationPointTopY}{\pageRadius*sin(180-\truncationAngle)}
% include a single right page
\newcommand*{\rightPage}[4]{
\if\relax\detokenize{#4}\relax
\else
\node at (#1,#2) {\includegraphics[page=#4]{#3}};
\draw (#1-\pageSize/2,#2+\pageSize/2)
-- (#1+\pageSize/2,#2+\pageSize/2)
-- (#1+\pageSize/2,#2-\pageSize/2)
-- (#1-\pageSize/2,#2-\pageSize/2)
arc[start angle=225,end angle=180+\truncationAngle,radius=\pageRadius]
-- (#1+\truncationPointTopX,#2+\truncationPointTopY)
arc[start angle=180-\truncationAngle,end angle=135,radius=\pageRadius];
\fi
}
\newcommand*{\leftPage}[4]{
\if\relax\detokenize{#4}\relax
\else
\node at (#1,#2) {\includegraphics[page=#4]{#3}};
\draw[white] (#1+\pageSize/2,#2+\pageSize/2)
-- (#1-\pageSize/2,#2+\pageSize/2)
-- (#1-\pageSize/2,#2-\pageSize/2)
-- (#1+\pageSize/2,#2-\pageSize/2)
arc[start angle=-45,end angle=-\truncationAngle,radius=\pageRadius]
-- (#1-\truncationPointTopX,#2+\truncationPointTopY)
arc[start angle=\truncationAngle,end angle=45,radius=\pageRadius];
\fi
}
% place six right pages on one sheet of paper
\newcommand*{\nupRightPage}[7]{%
\vspace*{\fill}%
%
\begin{center}%
\begin{tikzpicture}
\rightPage{0}{18}{#1}{#2}
\rightPage{10}{18}{#1}{#3}
\rightPage{0}{9}{#1}{#4}
\rightPage{10}{9}{#1}{#5}
\rightPage{0}{0}{#1}{#6}
\rightPage{10}{0}{#1}{#7}
\end{tikzpicture}%
\end{center}%
%
\vspace*{\fill}%
\pagebreak%
\par%
}
% place six left pages on one sheet of paper
\newcommand*{\nupLeftPage}[7]{%
\vspace*{\fill}%
%
\begin{center}%
\begin{tikzpicture}
\leftPage{0}{18}{#1}{#2}
\leftPage{10}{18}{#1}{#3}
\leftPage{0}{9}{#1}{#4}
\leftPage{10}{9}{#1}{#5}
\leftPage{0}{0}{#1}{#6}
\leftPage{10}{0}{#1}{#7}
\end{tikzpicture}%
\end{center}%
%
\vspace*{\fill}%
\pagebreak%
\par%
}