generated from exaexa/better-mff-thesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.tex
178 lines (141 loc) · 5.03 KB
/
macros.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
%%% This file contains definitions of various useful macros and environments %%%
%%% Please add more macros here instead of cluttering other files with them. %%%
%%% Switches based on thesis type
\def\TypeBc{bc}
\def\TypeMgr{mgr}
\def\TypePhD{phd}
\def\TypeRig{rig}
\ifx\ThesisType\TypeBc
\def\ThesisTypeName{bachelor}
\def\ThesisTypeTitle{BACHELOR THESIS}
\fi
\ifx\ThesisType\TypeMgr
\def\ThesisTypeName{master}
\def\ThesisTypeTitle{MASTER THESIS}
\fi
\ifx\ThesisType\TypePhD
\def\ThesisTypeName{doctoral}
\def\ThesisTypeTitle{DOCTORAL THESIS}
\fi
\ifx\ThesisType\TypeRig
\def\ThesisTypeName{rigorosum}
\def\ThesisTypeTitle{RIGOROSUM THESIS}
\fi
\ifx\ThesisTypeName\undefined
\PackageError{thesis}{Unknown thesis type.}{Please check the definition of ThesisType in metadata.tex.}
\fi
%%% Switches based on study program language
\def\LangCS{cs}
\def\LangEN{en}
\ifx\StudyLanguage\LangCS
\else\ifx\StudyLanguage\LangEn
\else\PackageError{thesis}{Unknown study language.}{Please check the definition of StudyLanguage in metadata.tex.}
\fi\fi
%%% Minor tweaks of style
% These macros employ a little dirty trick to convince LaTeX to typeset
% chapter headings sanely, without lots of empty space above them.
% Feel free to ignore.
\makeatletter
\def\@makechapterhead#1{
{\parindent \z@ \raggedright \normalfont
\Huge\bfseries \thechapter\quad #1
\par\nobreak
\vskip 20\p@
}}
\def\@makeschapterhead#1{
{\parindent \z@ \raggedright \normalfont
\Huge\bfseries #1
\par\nobreak
\vskip 20\p@
}}
\makeatother
% This macro defines a chapter, which is not numbered, but is included
% in the table of contents.
\def\chapwithtoc#1{
\chapter*{#1}
\addcontentsline{toc}{chapter}{#1}
}
% Draw black "slugs" whenever a line overflows, so that we can spot it easily.
\overfullrule=1mm
%%% Macros for definitions, theorems, claims, examples, ... (requires amsthm package)
\theoremstyle{plain}
\newtheorem{thm}{Theorem}
\newtheorem{lemma}[thm]{Lemma}
\newtheorem{claim}[thm]{Claim}
\newtheorem{defn}{Definition}
\theoremstyle{remark}
\newtheorem*{cor}{Corollary}
\newtheorem*{rem}{Remark}
\newtheorem*{example}{Example}
%%% Style of captions of floating objects (figures etc.)
\ifcsname DeclareCaptionStyle\endcsname
\DeclareCaptionStyle{thesis}{style=base,font=small,labelfont=bf,labelsep=quad}
\captionsetup{style=thesis}
\captionsetup[algorithm]{style=thesis,singlelinecheck=off}
\captionsetup[listing]{style=thesis,singlelinecheck=off}
\fi
%%% An environment for typesetting of program code and input/output
%%% of programs.
\DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small, frame=single}
% Settings for lstlisting -- program listing with syntax highlighting
\ifcsname lstset\endcsname
\lstset{
language=C++,
tabsize=2,
showstringspaces=false,
basicstyle=\footnotesize\tt\color{black!75},
identifierstyle=\bfseries\color{black},
commentstyle=\color{green!50!black},
stringstyle=\color{red!50!black},
keywordstyle=\color{blue!75!black}}
\fi
% Floating listings, used in the same way as the figure environment
\ifcsname DeclareNewFloatType\endcsname
\DeclareNewFloatType{listing}{}
\floatsetup[listing]{style=ruled}
\floatname{listing}{Program}
\fi
%%% The field of all real and natural numbers
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
%%% Useful operators for statistics and probability
\DeclareMathOperator{\pr}{\textsf{P}}
\DeclareMathOperator{\E}{\textsf{E}}
\DeclareMathOperator{\var}{\textrm{var}}
\DeclareMathOperator{\sd}{\textrm{sd}}
%%% Transposition of a vector/matrix
\newcommand{\T}[1]{#1^\top}
%%% Asymptotic "O"
\def\O{\mathcal{O}}
%%% Various math goodies
\newcommand{\goto}{\rightarrow}
\newcommand{\gotop}{\stackrel{P}{\longrightarrow}}
\newcommand{\maon}[1]{o(n^{#1})}
\newcommand{\abs}[1]{\left|{#1}\right|}
\newcommand{\dint}{\int_0^\tau\!\!\int_0^\tau}
\newcommand{\isqr}[1]{\frac{1}{\sqrt{#1}}}
%%% TODO items: remove before submitting :)
\newcommand{\xxx}[1]{\textcolor{red!}{#1}}
%%% Detailed settings of bibliography
\ifx\citet\undefined\else
% Maximum number of authors of a single work. If exceeded, "et al." is used.
%\ExecuteBibliographyOptions{maxnames=2}
% The same setting specific to citations using \citet{...}
\ExecuteBibliographyOptions{maxcitenames=2}
% The same settings specific to the list of literature
%\ExecuteBibliographyOptions{maxbibnames=2}
% Shortening first names of authors: "E. A. Poe" instead of "Edgar Allan Poe"
%\ExecuteBibliographyOptions{giveninits}
% The same without dots ("EA Poe")
%\ExecuteBibliographyOptions{terseinits}
% If your bibliography entries are hard to break into lines, try this mode:
%\ExecuteBibliographyOptions{block=ragged}
% Possibly reverse the names of the authors with the non-ISO styles:
%\DeclareNameAlias{default}{family-given}
% Use caps-and-small-caps for family names in ISO 690 style.
\let\familynameformat=\textsc
% We want to separate multiple authors in citations by commas
% (while we use semicolons in the bibliography as per the ISO standard)
\DeclareDelimFormat[textcite]{multinamedelim}{\addcomma\space}
\DeclareDelimFormat[textcite]{finalnamedelim}{\space and~}
\fi