]> mj.ucw.cz Git - diplomky.git/blobdiff - macros.tex
Bibliography: A little \hfuzz
[diplomky.git] / macros.tex
index d1ecf27e1deeb33c98af09672bad56a4f58a7628..a4c7bb629429ed5d7b2925a4e73f9f2b89367ab9 100644 (file)
@@ -1,7 +1,7 @@
-%%% This file contains definitions of various useful macros and environments %%%
-%%% Please add more macros here instead of cluttering other files with them. %%%
+%%% Tento soubor obsahuje definice různých užitečných maker a prostředí %%%
+%%% Další makra připisujte sem, ať nepřekáží v ostatních souborech.     %%%
 
-%%% Switches based on thesis type
+%%% Přepínače podle typu práce
 
 \def\TypeBc{bc}
 \def\TypeMgr{mgr}
@@ -9,44 +9,41 @@
 \def\TypeRig{rig}
 
 \ifx\ThesisType\TypeBc
-\def\ThesisTypeName{bachelor}
-\def\ThesisTypeTitle{BACHELOR THESIS}
+\def\ThesisTypeName{bakalářská}
+\def\ThesisTypeGenitive{bakalářské}
+\def\ThesisTypeAccusative{bakalářskou}
+\def\ThesisTypeTitle{BAKALÁŘSKÁ PRÁCE}
 \fi
 
 \ifx\ThesisType\TypeMgr
-\def\ThesisTypeName{master}
-\def\ThesisTypeTitle{MASTER THESIS}
+\def\ThesisTypeName{diplomová}
+\def\ThesisTypeGenitive{diplomové}
+\def\ThesisTypeAccusative{diplomovou}
+\def\ThesisTypeTitle{DIPLOMOVÁ PRÁCE}
 \fi
 
 \ifx\ThesisType\TypePhD
-\def\ThesisTypeName{doctoral}
-\def\ThesisTypeTitle{DOCTORAL THESIS}
+\def\ThesisTypeName{disertační}
+\def\ThesisTypeGenitive{disertační}
+\def\ThesisTypeAccusative{disertační}
+\def\ThesisTypeTitle{DISERTAČNÍ PRÁCE}
 \fi
 
 \ifx\ThesisType\TypeRig
-\def\ThesisTypeName{rigorosum}
-\def\ThesisTypeTitle{RIGOROSUM THESIS}
+\def\ThesisTypeName{rigorozní}
+\def\ThesisTypeGenitive{rigorozní}
+\def\ThesisTypeAccusative{rigorozní}
+\def\ThesisTypeTitle{RIGOROZNÍ PRÁCE}
 \fi
 
 \ifx\ThesisTypeName\undefined
-\PackageError{thesis}{Unknown thesis type.}{Please check the definition of ThesisType in metadata.tex.}
+\PackageError{thesis}{Neznámý typ práce.}{Zkontrolujte prosím definici makra ThesisType v souboru metadata.tex.}
 \fi
 
-%%% Switches based on study program language
+%%% Drobné úpravy stylu
 
-\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.
+% Tato makra přesvědčují mírně ošklivým trikem LaTeX, aby hlavičky kapitol
+% sázel příčetněji a nevynechával nad nimi spoustu místa. Směle ignorujte.
 \makeatletter
 \def\@makechapterhead#1{
   {\parindent \z@ \raggedright \normalfont
 }}
 \makeatother
 
-% This macro defines a chapter, which is not numbered, but is included
-% in the table of contents.
+% Toto makro definuje kapitolu, která není očíslovaná, ale je uvedena v obsahu.
 \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
+% Trochu volnější nastavení dělení slov, než je default.
+\lefthyphenmin=2
+\righthyphenmin=2
 
-%%% Macros for definitions, theorems, claims, examples, ... (requires amsthm package)
+% Zapne černé "slimáky" na koncích řádků, které přetekly, abychom si
+% jich lépe všimli.
+\overfullrule=1mm
 
-\theoremstyle{plain}
-\newtheorem{thm}{Theorem}
-\newtheorem{lemma}[thm]{Lemma}
-\newtheorem{claim}[thm]{Claim}
+%%% Makra pro definice, věty, tvrzení, příklady, ... (vyžaduje baliček amsthm)
 
 \theoremstyle{plain}
-\newtheorem{defn}{Definition}
+\newtheorem{veta}{Věta}
+\newtheorem{lemma}[veta]{Lemma}
+\newtheorem{tvrz}[veta]{Tvrzení}
+\newtheorem{definice}{Definice}
 
 \theoremstyle{remark}
-\newtheorem*{cor}{Corollary}
-\newtheorem*{rem}{Remark}
-\newtheorem*{example}{Example}
-
-%%% An environment for proofs
-
-\newenvironment{myproof}{
-  \par\medskip\noindent
-  \textit{Proof}.
-}{
-\newline
-\rightline{$\qedsymbol$}
-}
+\newtheorem*{dusl}{Důsledek}
+\newtheorem*{pozn}{Poznámka}
+\newtheorem*{prikl}{Příklad}
+
+% Alias pro prostředí proof s českým názvem
+\newenvironment{dukaz}{\begin{proof}}{\end{proof}}
 
-%%% An environment for typesetting of program code and input/output
-%%% of programs. (Requires the fancyvrb package -- fancy verbatim.)
+%%% Styl popisek obrázků
+
+\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
+
+%%% Prostředí pro sazbu kódu, případně vstupu/výstupu počítačových
+%%% programů.
 
 \DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small, frame=single}
 
-%%% The field of all real and natural numbers
+% Nastavení pro lstlisting -- výpisy programů se zvýrazňováním syntaxe
+\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
+
+% Plovoucí výpisy kódu, používá se stejně jako figure
+\ifcsname DeclareNewFloatType\endcsname
+\DeclareNewFloatType{listing}{}
+\floatsetup[listing]{style=ruled}
+\floatname{listing}{Výpis kódu}
+\fi
+
+%%% Prostor reálných, resp. přirozených čísel
 \newcommand{\R}{\mathbb{R}}
 \newcommand{\N}{\mathbb{N}}
 
-%%% Useful operators for statistics and probability
+%%% Užitečné operátory pro statistiku a pravděpodobnost
 \DeclareMathOperator{\pr}{\textsf{P}}
 \DeclareMathOperator{\E}{\textsf{E}\,}
 \DeclareMathOperator{\var}{\textrm{var}}
 \DeclareMathOperator{\sd}{\textrm{sd}}
 
-%%% Transposition of a vector/matrix
+%%% Příkaz pro transpozici vektoru/matice
 \newcommand{\T}[1]{#1^\top}
 
-%%% Various math goodies
+%%% Asymptotické "O"
+\def\O{\mathcal{O}}
+
+%%% Vychytávky pro matematiku
 \newcommand{\goto}{\rightarrow}
 \newcommand{\gotop}{\stackrel{P}{\longrightarrow}}
 \newcommand{\maon}[1]{o(n^{#1})}
 \newcommand{\dint}{\int_0^\tau\!\!\int_0^\tau}
 \newcommand{\isqr}[1]{\frac{1}{\sqrt{#1}}}
 
-%%% Various table goodies
+%%% Vychytávky pro tabulky
 \newcommand{\pulrad}[1]{\raisebox{1.5ex}[0pt]{#1}}
 \newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}
 
-%%% TODO items: remove before submitting :)
+%%% Zvýraznění údajů, které je potřeba doplnit: před odevzdáním práce odstraňte :)
 \newcommand{\xxx}[1]{\textcolor{red!}{#1}}