% Packages
%% standard language & encoding
\usepackage[ngermanb]{babel}
\usepackage[utf8]{inputenc}
%% graphics
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
%% math
\usepackage{amsmath}
\usepackage[amssymb]{SIunits}
\usepackage{amsthm}
\usepackage{esvect}
\usepackage{caption}
\usepackage{colonequals}
\usepackage{mathtools}

%% layout
\usepackage{setspace}
\usepackage[normalem]{ulem}
\usepackage[unicode,a4paper,pdfusetitle]{hyperref} 
\usepackage{fancyhdr}
\usepackage{chemfig}
%% custom font (Garamond)
\usepackage[T1]{fontenc}
%\usepackage{xltxtra}
%\setmainfont[Mapping=tex-text]{URW Garamond No8}
\usepackage[urw-garamond]{mathdesign}

% Layout
\setlength{\captionmargin}{10pt} %extra left and right margin for the captions
\renewcommand{\captionfont}{\footnotesize}	%smaller captions
\hypersetup{linkcolor=black,urlcolor=black,citecolor=black,breaklinks=true,colorlinks=true} %hyperref, uncoloured links
\onehalfspacing
%\parindent 0pt % no paragraph indentation

% Commands
\newcommand{\dd}[2][]{\frac{d#1}{d#2}}                                          % \dd[x]{y}       -> \frac{dx}{dy}
\newcommand{\ddx}{\dd{x}}                                                       % \dd             -> \frac{d}{dx}
\newcommand{\pp}[2][]{\frac{\partial #1}{\partial #2}}                          % \pp[a]{x}       -> \frac{\partial a}{\partial x}
\newcommand{\ppt}{\pp{t}}                                                       % \ppt            -> \frac{\partial}{\partial t}
\newcommand{\Ve}{\Vert}                                                         % \Ve             -> \Vert
\newcommand{\ve}{\vert}                                                         % \ve             -> \vert
\newcommand{\ra}[1][]{\ensuremath{\xrightarrow{#1}}}                            % \ra[a]          -> \xrightarrow{a} (a above right arrow, the latter scaled)
\newcommand{\Ra}[1][]{\ensuremath{\xRightarrow{#1}}}                            % \Ra[a]          -> \xRightarrow{a} (a above doubled right arrow, - " -)
\newcommand{\LRa}[1][]{\ensuremath{\xLeftrightarrow{#1}}}                       % \LRa[a]         -> \xLeftrightarrow{a} (a above <=>, - " -)
\newcommand{\lra}[1][]{\ensuremath{\xleftrightarrow{#1}}}                       % \lra[a]         -> \xleftrightarrow{a} (a above <->, - " -)
\newcommand{\twov}[2]{\ensuremath{\begin{pmatrix} #1 \\ #2 \end{pmatrix}}}      % \twov{a}{b}     -> two-row-matrix with the rows a and b
\newcommand{\threev}[3]{\ensuremath{\begin{pmatrix} #1 \\ #2 \\ #3 \end{pmatrix}}} %\threev{a}{b}{c} -> see above
\newcommand{\fourv}[4]{\ensuremath{\begin{pmatrix} #1 \\ #2 \\ #3 \\ #4 \end{pmatrix}}} % see above
\newcommand{\fivev}[5]{\ensuremath{\begin{pmatrix} #1 \\ #2 \\ #3 \\ #4 \\ #5 \end{pmatrix}}} % see above
\newcommand{\scp}[1]{\langle #1 \rangle}
\newcommand{\eq}[1]{\begin{equation}#1\end{equation}}
\newcommand{\eqnl}[2]{\begin{equation} \label{#2} #1 \end{equation}}
%% Note: \threev{a & b & c}{d & e & f}{g & h & i} is perfectly valid and defines a 3x3-matrix
\renewcommand{\mapsto}[1][]{\ensuremath{\xmapsto{#1}}}                          % redefines the mapsto-command to be scalable 
\newcommand{\eps}{ \ensuremath{\varepsilon} }                                   % shortcut for \vareps
\newcommand{\vph}{\ensuremath{\varphi} }                                        % shortcut for \varphi
\newcommand{\KR}{\ensuremath{\mathbb{R}} }                                      % symbol for the set of real numbers
\newcommand{\KC}{\ensuremath{\mathbb{C}} }                                      % symbol for the set of complex numbers
\newcommand{\KN}{\ensuremath{\mathbb{N}} }                                      % symbol for the set of natural numbers
\newcommand{\N}[1]{\ensuremath{\left\Ve #1 \right\Ve}}                          % \N x or \N{abc} -> ||x|| or ||abc||
\newcommand{\n}[1]{\ensuremath{\left\ve #1 \right\ve}}                          % \n x or \n{abc} ->  |x|  or  |abc|
\newcommand{\cdef}{\colonequals}                                                % := with the ":" at the correct height
\newcommand{\tv}{\uline}                                                        % underlines the argument, used for vectors
\newcommand{\mt}{\uuline}                                                       % double underline, used for matrices 
\DeclareMathOperator{\sech}{sech}                                               % declares a sech (secant hyperbolicus) operator
\DeclareMathOperator{\Graph}{Graph}                                             % declares a Graph operator
\DeclareMathOperator{\grad}{grad}                                               % declares a grad (gradient) operator
\DeclareMathOperator{\Div}{div}                                                 % declares a div (divergence) operator
\DeclareMathOperator{\rot}{rot}                                                 % declares a rot (curl/rotor) operator
\DeclareMathOperator{\Hess}{Hess}
\DeclareMathOperator{\Sym}{Sym}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\tr}{tr}
% Environments
%% "7e1-them" -> 0.5em above and below the environment, no special font, indented by 1em, bold head, ":" between head and body
\newtheoremstyle{7e1-them}% name of the style to be used
  {0.5em}% measure of space to leave above the theorem.
  {0.5em}% measure of space to leave below the theorem.
  {}% name of font to use in the body of the theorem
  {1em}% measure of space to indent
  {\bfseries}% name of head font
  {:\nopagebreak\\}% punctuation between head and body
  { }% space after theorem head; " " = normal interword space
  {}% Manually specify head
\theoremstyle{7e1-them}
\newtheorem{thm}{Satz}[section]                       % declares a thm-environment, label "Satz", counter reset with section
\newtheorem{lem}[thm]{Lemma}                          % declares a lem-environment, label "Lemma", same counter as thm
\newtheorem{prp}[thm]{Proposition}                    % declares a prp-environment, label "Proposition", same counter as thm
\newtheorem{cor}[thm]{Korollar}                       % declares a cor-environment, label "Korollar", same counter as thm
\newtheorem{dfn}[thm]{Definition}                     % declares a dfn-environment, label "Definition", same counter as thm
\newtheorem{prf}{Beweis}[thm]                         % declares a prf-environment, label "Beweis", counter reset with thm
\newtheorem{exm}[prf]{Beispiel}                       % declares an exm-environment, label "Beispiel", same counter as prf
\newtheorem{rmk}[prf]{Bemerkung}                      % declares a rmk-environment, label "Bemerkung", same counter as prf

