]> mj.ucw.cz Git - diplomky.git/blob - en/macros.tex
Fixed multi-line \XXX in English version, which is broken by mkdist
[diplomky.git] / en / macros.tex
1 %%% This file contains definitions of various useful macros and environments %%%
2 %%% Please add more macros here instead of cluttering other files with them. %%%
3
4 %%% Minor tweaks of style
5
6 % These macros employ a little dirty trick to convince LaTeX to typeset
7 % chapter headings sanely, without lots of empty space above them.
8 % Feel free to ignore.
9 \makeatletter
10 \def\@makechapterhead#1{
11   {\parindent \z@ \raggedright \normalfont
12    \Huge\bfseries \thechapter. #1
13    \par\nobreak
14    \vskip 20\p@
15 }}
16 \def\@makeschapterhead#1{
17   {\parindent \z@ \raggedright \normalfont
18    \Huge\bfseries #1
19    \par\nobreak
20    \vskip 20\p@
21 }}
22 \makeatother
23
24 % This macro defines a chapter, which is not numbered, but is included
25 % in the table of contents.
26 \def\chapwithtoc#1{
27 \chapter*{#1}
28 \addcontentsline{toc}{chapter}{#1}
29 }
30
31 % Draw black "slugs" whenever a line overflows, so that we can spot it easily.
32 \overfullrule=1mm
33
34 %%% Macros for definitions, theorems, claims, examples, ... (requires amsthm package)
35
36 \theoremstyle{plain}
37 \newtheorem{thm}{Theorem}
38 \newtheorem{lemma}[thm]{Lemma}
39 \newtheorem{claim}[thm]{Claim}
40
41 \theoremstyle{plain}
42 \newtheorem{defn}{Definition}
43
44 \theoremstyle{remark}
45 \newtheorem*{cor}{Corollary}
46 \newtheorem*{rem}{Remark}
47 \newtheorem*{example}{Example}
48
49 %%% An environment for proofs
50
51 \newenvironment{myproof}{
52   \par\medskip\noindent
53   \textit{Proof}.
54 }{
55 \newline
56 \rightline{$\qedsymbol$}
57 }
58
59 %%% An environment for typesetting of program code and input/output
60 %%% of programs. (Requires the fancyvrb package -- fancy verbatim.)
61
62 \DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small, frame=single}
63
64 %%% The field of all real and natural numbers
65 \newcommand{\R}{\mathbb{R}}
66 \newcommand{\N}{\mathbb{N}}
67
68 %%% Useful operators for statistics and probability
69 \DeclareMathOperator{\pr}{\textsf{P}}
70 \DeclareMathOperator{\E}{\textsf{E}\,}
71 \DeclareMathOperator{\var}{\textrm{var}}
72 \DeclareMathOperator{\sd}{\textrm{sd}}
73
74 %%% Transposition of a vector/matrix
75 \newcommand{\T}[1]{#1^\top}
76
77 %%% Various math goodies
78 \newcommand{\goto}{\rightarrow}
79 \newcommand{\gotop}{\stackrel{P}{\longrightarrow}}
80 \newcommand{\maon}[1]{o(n^{#1})}
81 \newcommand{\abs}[1]{\left|{#1}\right|}
82 \newcommand{\dint}{\int_0^\tau\!\!\int_0^\tau}
83 \newcommand{\isqr}[1]{\frac{1}{\sqrt{#1}}}
84
85 %%% Various table goodies
86 \newcommand{\pulrad}[1]{\raisebox{1.5ex}[0pt]{#1}}
87 \newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}