X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=macros.tex;h=a4c7bb629429ed5d7b2925a4e73f9f2b89367ab9;hb=0a465f6178b771ea49824330fb7ee440dcc67a93;hp=a260bfbb10dbc12c8675a26dde183550e0353c4d;hpb=677b190d60cea9853f918c8bf6a12e555fe4b8b7;p=diplomky.git diff --git a/macros.tex b/macros.tex index a260bfb..a4c7bb6 100644 --- a/macros.tex +++ b/macros.tex @@ -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 @@ -62,60 +59,87 @@ }} \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. +% Trochu volnější nastavení dělení slov, než je default. +\lefthyphenmin=2 +\righthyphenmin=2 + +% Zapne černé "slimáky" na koncích řádků, které přetekly, abychom si +% jich lépe všimli. \overfullrule=1mm -%%% Macros for definitions, theorems, claims, examples, ... (requires amsthm package) +%%% Makra pro definice, věty, tvrzení, příklady, ... (vyžaduje baliček amsthm) \theoremstyle{plain} -\newtheorem{thm}{Theorem} -\newtheorem{lemma}[thm]{Lemma} -\newtheorem{claim}[thm]{Claim} - -\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} -%%% An environment for typesetting of program code and input/output -%%% of programs. (Requires the fancyvrb package -- fancy verbatim.) +% Alias pro prostředí proof s českým názvem +\newenvironment{dukaz}{\begin{proof}}{\end{proof}} + +%%% 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})} @@ -123,18 +147,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}} -%%% 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}} - -%% SPECIMEN -% Parts marked as SPECIMEN are used for building the example PDF. -% When the official template is generated by ./mkdist, all such parts -% are deleted, as well as all calls of \X and \XXX macros. -\def\X#1{\textcolor{red}{[#1]}} -\def\XXX#1{\par\smallskip\noindent \textcolor{red}{[#1]}} -\def\XOverlap#1{\dimen0=\prevdepth\nointerlineskip{\vbox to 0pt{\XXX{#1}\vss}}\prevdepth=\dimen0} -%% NEMICEPS