% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode

%\documentclass[11pt, a4paper, twoside]{scrreprt}
\let\ACMmaketitle=\maketitle
\renewcommand{\maketitle}{\begingroup\let\footnote=\thanks \ACMmaketitle\endgroup}

% nummerierung von Abbildungen und Tabellen fortlaufend
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}

\setkomafont{disposition}{\normalfont}

\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)

%%% Examples of Article customizations
% These packages are optional, depending whether you want the features they provide.
% See the LaTeX Companion or other references for full information.

%%% PAGE DIMENSIONS
\usepackage{marginnote}
% http://tex.stackexchange.com/questions/30473/specifying-font-size-in-a-newcommand
\renewcommand*{\marginfont}{\scriptsize}
%\usepackage[left=3.2cm, right=3.2cm, top=2.8cm, bottom=3cm, marginparwidth=2cm, marginparsep=0.3cm]{geometry}
\geometry{a4paper} % or letterpaper (US) or a5paper or....
%\geometry{margin=1in} % for example, change the margins to 2 inches all round
% \geometry{landscape} % set up the page for landscape
%   read geometry.pdf for detailed page layout information
\usepackage{lastpage}

\usepackage{graphicx} % support the \includegraphics command and options
\usepackage{mdframed}
\usepackage{textcomp}
\usepackage{color, colortbl}
%\definecolor{blue}{rgb}{0.91,0.78,1}
\definecolor{grey}{rgb}{0.67,0.67,0.67}
\definecolor{white}{rgb}{1.0,1.0,1.0}
\definecolor{black}{rgb}{0.0,0.0,0.0}
\definecolor{mauve}{rgb}{0.88,0.69,1.0}
\definecolor{dkgreen}{rgb}{0.0,0.2,0.13}
\usepackage{listings}
\lstset{ %
	language=python,
	basicstyle=\footnotesize,
	numbers=left,
	numberstyle=\tiny\color{grey},
	stepnumber = 1,
	numbersep=5pt,
	backgroundcolor=\color{white},
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	frame=single,
	rulecolor=\color{black},
	tabsize=2,
	captionpos=b,
	breaklines=true,
	breakatwhitespace=false,
	title=\lstname,
	keywordstyle=\color{blue},
	commentstyle=\color{dkgreen},
	stringstyle=\color{mauve},
	% escapeinside = {\%*}{*)},
	% morekeywords={*,...}
}

\usepackage{setspace}
\usepackage{csquotes}
\usepackage{tabularx}
\usepackage{multirow}
\makeatletter% Set distance from top of page to first float
\setlength{\@fptop}{5pt}
\makeatother

%%% PACKAGES
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
\usepackage{amsmath}
\usepackage{bbding}
\usepackage{float}

%%% HEADERS & FOOTERS
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}
\fancyhead[EL,OR]{\marginnote{
    Bundesanstalt für \\
    Gewässerkunde \\
    ~ \\
    \begin{center}
    \textbf{hydflood} \\
    - \\
    Vignette
    \end{center}
    }[0cm]
}
% make all pages fancy
%\usepackage{etoolbox}
%\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}

% literature
\usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex} %biblatex mit biber laden
\ExecuteBibliographyOptions{
    sorting=nyt, %Sortierung Autor, Titel, Jahr
    bibwarn=true, %Probleme mit den Daten, die Backend betreffen anzeigen
    isbn=false, %keine isbn anzeigen
    url=false %keine url anzeigen
}

%% Listings



%%% SECTION TITLE APPEARANCE
%\usepackage{sectsty}
%\allsectionsfont{\rmfamily\mdseries\upshape} % (See the fntguide.pdf for font help)
%\allsectionsfont{\rmfamily\mdseries\upshape} % (See the fntguide.pdf for font help)
% (This matches ConTeXt defaults)

%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters

%\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
%\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!

\onehalfspacing

% get rid of page breaks for every chapter
%\renewcommand{\cleardoublepage}{}
%\renewcommand{\clearpage}{}

\usepackage{rotating}
\usepackage{booktabs}
\usepackage[absolute]{textpos}
\usepackage{mathptmx}

% german date format
\usepackage{datetime2}
\DTMnewdatestyle{mydate}{
    \renewcommand{\DTMdisplaydate}[4]{%
        \DTMtwodigits{##3}.\DTMtwodigits{##2}.\number##1 }
        \renewcommand{\DTMDisplaydate}{\DTMdisplaydate}
}
\DTMsetdatestyle{mydate}

\def\mytoday{\leavevmode\hbox{\twodigits\day.\twodigits\month.\the\year}}
\def\twodigits#1{\ifnum#1<10 0\fi\the#1}

% get the number of the last page
\usepackage{lastpage}

\AtBeginDocument{\let\maketitle\relax}
\newcommand{\inlinecode}{\texttt}

