1 %%% This file contains definitions of various useful macros and environments %%%
2 %%% Please add more macros here instead of cluttering other files with them. %%%
4 %%% Switches based on thesis type
11 \ifx\ThesisType\TypeBc
12 \def\ThesisTypeName{bachelor}
13 \def\ThesisTypeTitle{BACHELOR THESIS}
16 \ifx\ThesisType\TypeMgr
17 \def\ThesisTypeName{master}
18 \def\ThesisTypeTitle{MASTER THESIS}
21 \ifx\ThesisType\TypePhD
22 \def\ThesisTypeName{doctoral}
23 \def\ThesisTypeTitle{DOCTORAL THESIS}
26 \ifx\ThesisType\TypeRig
27 \def\ThesisTypeName{rigorosum}
28 \def\ThesisTypeTitle{RIGOROSUM THESIS}
31 \ifx\ThesisTypeName\undefined
32 \PackageError{thesis}{Unknown thesis type.}{Please check the definition of ThesisType in metadata.tex.}
35 %%% Switches based on study program language
40 \ifx\StudyLanguage\LangCS
41 \else\ifx\StudyLanguage\LangEn
42 \else\PackageError{thesis}{Unknown study language.}{Please check the definition of StudyLanguage in metadata.tex.}
45 %%% Minor tweaks of style
47 % These macros employ a little dirty trick to convince LaTeX to typeset
48 % chapter headings sanely, without lots of empty space above them.
49 % Feel free to ignore.
51 \def\@makechapterhead#1{
52 {\parindent \z@ \raggedright \normalfont
53 \Huge\bfseries \thechapter. #1
57 \def\@makeschapterhead#1{
58 {\parindent \z@ \raggedright \normalfont
65 % This macro defines a chapter, which is not numbered, but is included
66 % in the table of contents.
69 \addcontentsline{toc}{chapter}{#1}
72 % Draw black "slugs" whenever a line overflows, so that we can spot it easily.
75 %%% Macros for definitions, theorems, claims, examples, ... (requires amsthm package)
78 \newtheorem{thm}{Theorem}
79 \newtheorem{lemma}[thm]{Lemma}
80 \newtheorem{claim}[thm]{Claim}
83 \newtheorem{defn}{Definition}
86 \newtheorem*{cor}{Corollary}
87 \newtheorem*{rem}{Remark}
88 \newtheorem*{example}{Example}
90 %%% An environment for proofs
92 \newenvironment{myproof}{
97 \rightline{$\qedsymbol$}
100 %%% An environment for typesetting of program code and input/output
101 %%% of programs. (Requires the fancyvrb package -- fancy verbatim.)
103 \DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small, frame=single}
105 %%% The field of all real and natural numbers
106 \newcommand{\R}{\mathbb{R}}
107 \newcommand{\N}{\mathbb{N}}
109 %%% Useful operators for statistics and probability
110 \DeclareMathOperator{\pr}{\textsf{P}}
111 \DeclareMathOperator{\E}{\textsf{E}\,}
112 \DeclareMathOperator{\var}{\textrm{var}}
113 \DeclareMathOperator{\sd}{\textrm{sd}}
115 %%% Transposition of a vector/matrix
116 \newcommand{\T}[1]{#1^\top}
118 %%% Various math goodies
119 \newcommand{\goto}{\rightarrow}
120 \newcommand{\gotop}{\stackrel{P}{\longrightarrow}}
121 \newcommand{\maon}[1]{o(n^{#1})}
122 \newcommand{\abs}[1]{\left|{#1}\right|}
123 \newcommand{\dint}{\int_0^\tau\!\!\int_0^\tau}
124 \newcommand{\isqr}[1]{\frac{1}{\sqrt{#1}}}
126 %%% Various table goodies
127 \newcommand{\pulrad}[1]{\raisebox{1.5ex}[0pt]{#1}}
128 \newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}
130 %%% TODO items: remove before submitting :)
131 \newcommand{\xxx}[1]{\textcolor{red!}{#1}}
134 % Parts marked as SPECIMEN are used for building the example PDF.
135 % When the official template is generated by ./mkdist, all such parts
136 % are deleted, as well as all calls of \X and \XXX macros.
137 \def\X#1{\textcolor{red}{[#1]}}
138 \def\XXX#1{\par\smallskip\noindent \textcolor{red}{[#1]}}