X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=macros.tex;h=6d82c71349865351db12976bf5ea57b645edfb74;hb=88a6305940fd7137d6738d5b3a38b142db89f1d3;hp=d2d261660f29f01a770e095c49ebd7f51c127554;hpb=15947963d1b48a2b887caead949827e33cde25b6;p=diplomky.git diff --git a/macros.tex b/macros.tex index d2d2616..6d82c71 100644 --- a/macros.tex +++ b/macros.tex @@ -1,11 +1,49 @@ -%%% This file contains definitions of various useful macros and environments %%% -%%% Please add more macros here instead of cluttering other files with them. %%% - -%%% 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. +%%% 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. %%% + +%%% Přepínače podle typu práce + +\def\TypeBc{bc} +\def\TypeMgr{mgr} +\def\TypePhD{phd} +\def\TypeRig{rig} + +\ifx\ThesisType\TypeBc +\def\ThesisTypeName{bakalářská} +\def\ThesisTypeGenitive{bakalářské} +\def\ThesisTypeAccusative{bakalářskou} +\def\ThesisTypeTitle{BAKALÁŘSKÁ PRÁCE} +\fi + +\ifx\ThesisType\TypeMgr +\def\ThesisTypeName{diplomová} +\def\ThesisTypeGenitive{diplomové} +\def\ThesisTypeAccusative{diplomovou} +\def\ThesisTypeTitle{DIPLOMOVÁ PRÁCE} +\fi + +\ifx\ThesisType\TypePhD +\def\ThesisTypeName{disertační} +\def\ThesisTypeGenitive{disertační} +\def\ThesisTypeAccusative{disertační} +\def\ThesisTypeTitle{DISERTAČNÍ PRÁCE} +\fi + +\ifx\ThesisType\TypeRig +\def\ThesisTypeName{rigorozní} +\def\ThesisTypeGenitive{rigorozní} +\def\ThesisTypeAccusative{rigorozní} +\def\ThesisTypeTitle{RIGOROZNÍ PRÁCE} +\fi + +\ifx\ThesisTypeName\undefined +\PackageError{thesis}{Neznámý typ práce.}{Zkontrolujte prosím definici makra ThesisType v souboru metadata.tex.} +\fi + +%%% Drobné úpravy stylu + +% 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 @@ -21,60 +59,94 @@ }} \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} +\newtheorem*{dusl}{Důsledek} +\newtheorem*{pozn}{Poznámka} +\newtheorem*{prikl}{Příklad} -%%% An environment for proofs +%%% Prostředí pro důkazy -\newenvironment{myproof}{ +\newenvironment{dukaz}{ \par\medskip\noindent - \textit{Proof}. + \textit{Důkaz}. }{ \newline \rightline{$\qedsymbol$} } -%%% 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})} @@ -82,6 +154,9 @@ \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}} + +%%% Zvýraznění údajů, které je potřeba doplnit: před odevzdáním práce odstraňte :) +\newcommand{\xxx}[1]{\textcolor{red!}{#1}}