\RequirePackage{snapshot} % stats of included files: $filename.dep

\documentclass[10pt,a5paper,twoside,openright,twocolumn,ngerman]{book}
\usepackage[ngerman]{babel}

%%%%% Formatting and encoding %%%%%
% encoding
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

% page
\usepackage[columnsep=.75cm,lmargin=.75cm,rmargin=.75cm,tmargin=1.5cm,bmargin=1.5cm]{geometry}
\setlength{\parindent}{0pt}

\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\cfoot{}
\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\fancyhead[LE,RO]{\leftmark}
\fancyfoot[LE,RO]{\thepage}

% Use sans serif font.
\renewcommand*{\familydefault}{\sfdefault}

% change heading fontsizes.
\usepackage{sectsty}
\subsectionfont{\normalsize}
\subsubsectionfont{\small}

% \chapter hacks
% Create \Hide command (used for chapters)
\usepackage[explicit]{titlesec}
\newcommand*\Hide{\titleformat{\chapter}[display]{}{}{0pt}{\Huge}\titleformat{\part}{}{}{0pt}{}}

% inhibit creation of new double page on new chapter.
\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother

% change heading margins.
\titlespacing*{\chapter}{0pt}{0pt}{-40pt}
\titlespacing*{\section}{0pt}{9pt}{3pt}
\titlespacing*{\subsection}{0pt}{6pt}{0pt}
\titlespacing*{\subsubsection}{0pt}{0pt}{0pt}

% make \paragraph do newlines
\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}
  {-.75ex \@plus -1ex \@minus -0.2ex}
  {0.01pt}
  {\normalfont\normalsize\bfseries}
}
\makeatother

%%% TOC changes %%%
% inhibit "Contents" Head in TOC
\makeatletter
\renewcommand\tableofcontents{\@starttoc{toc}}
\makeatother

%make toc consider Chapter and section only.
\setcounter{tocdepth}{1}

% disable chapter, section, ... numbering
\setcounter{secnumdepth}{-1}

% change margin above chapter.
\usepackage[titles]{tocloft}
\setlength{\cftbeforechapskip}{4pt}
%%% /TOC changes %%%

% make footnote numbering reset on every page.
\usepackage[hang,flushmargin,perpage]{footmisc}
%%%%% / Formatting %%%%%

% includable git commit info
\usepackage[missing=run\ build.sh\ or\ gitinfohook.sh]{gitinfo}

% Fürs "last generated" Datum
\usepackage[iso]{isodate}

% Image import stuff
\usepackage[absolute]{textpos}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}

% clickable references/links/...
\usepackage{hyperref}

% euro-sign
\usepackage{eurosym}
\DeclareUnicodeCharacter{20AC}{\euro}

% frames
\usepackage[framemethod=default]{mdframed}
\newmdenv[linecolor=red,backgroundcolor=white]{whiteframe}
\newmdenv[linecolor=red,backgroundcolor=yellow]{yellowframe}

% quotes
\usepackage[babel,german=quotes]{csquotes}


% START DOCUMENT
\begin{document}\thispagestyle{empty}
\begin{textblock*}{\paperwidth}(0mm,0mm)\noindent\includegraphics[width=\paperwidth,height=\paperheight]{images/cover_front.png}
\end{textblock*}
\mbox{}\newpage

%hack to have more characters per page.
\small

\onecolumn
\thispagestyle{empty}
\input{articles/_adressen.tex}\vspace{\fill}\newpage

\twocolumn
\thispagestyle{empty}
\input{articles/_impressum.tex}
\subsection{Version}
\begin{footnotesize}
\url{https://git.somenet.org/fsinf/basics.git}\\
Current maintainer: \href{mailto:someone@fsinf.at}{someone@fsinf.at}\\
This is revision: \textbf{\gitAbbrevHash}\\
Document (.tex) compiled on: \textbf{\today}
\end{footnotesize}\vspace{\fill}\newpage

\section*{Inhalt}\begin{footnotesize}\tableofcontents\end{footnotesize}\vspace{\fill}\newpage
% header.maxsize: 3 (3) pages.

% chapter.maxsize: 2 (5) pages.
\clearpage\Hide\chapter{Einleitung}\thispagestyle{fancy}
\input{articles/die_fsinf.tex}\vspace{\fill}\newpage

% chapter.maxsize: 8 (13) pages.
\clearpage\Hide\chapter{Erstes Semester}\thispagestyle{fancy}
\input{articles/es_prolog.tex}\vspace{\fill}\newpage
\input{articles/es_estuts.tex}\vspace{\fill}\newpage
\input{articles/es_stundenplan.tex}\vspace{\fill}\newpage
\input{articles/es_aufbau_des_studiums.tex}\vspace{\fill}\newpage
\input{articles/es_lvas.tex}\vspace{\fill}\newpage
\input{articles/es_steop.tex}\vspace{\fill}\newpage
\input{articles/es_ticket.tex}\vspace{\fill}\newpage

% chapter.maxsize: 6 (19) pages.
\clearpage\Hide\chapter{Unialltag}\thispagestyle{fancy}
\input{articles/unialltag_bibliothek.tex}\vspace{\fill}\newpage
\input{articles/unialltag_lernraume.tex}\vspace{\fill}\newpage
\input{articles/unialltag_zid.tex}\vspace{\fill}\newpage
\onecolumn
\input{articles/unialltag_tiss.tex}\vspace{\fill}\newpage
\twocolumn
\input{articles/unialltag_vowi.tex}\vspace{\fill}\newpage

% chapter.maxsize: 4 (23) pages.
\clearpage\Hide\chapter{Uni für Fortgeschrittene}\thispagestyle{fancy}
\input{articles/advuni_anerkennung.tex}\vspace{\fill}\newpage
\input{articles/advuni_mitbelegen.tex}\vspace{\fill}\newpage
\input{articles/advuni_pruefungsrecht.tex}\vspace{\fill}\newpage
\input{articles/advuni_erasmus.tex}\vspace{\fill}\newpage

% chapter.maxsize: 6 (29) pages.
\clearpage\Hide\chapter{Finanzierung}\thispagestyle{fancy}
\input{articles/finanz_allgemein.tex}\vspace{\fill}\newpage
\input{articles/finanz_familienbeihilfe.tex}\vspace{\fill}\newpage
\input{articles/finanz_studienbeihilfe.tex}\vspace{\fill}\newpage
\input{articles/finanz_studiengebuehren.tex}\vspace{\fill}\newpage
\input{articles/finanz_studarb.tex}\vspace{\fill}\newpage
\input{articles/finanz_stipendium.tex}\vspace{\fill}\newpage

% cover.maxsize: 1 (30) pages.
\clearpage
\onecolumn
\mbox{}\thispagestyle{empty}
\begin{tiny}\begin{center}\noindent\includegraphics[width=0.9\columnwidth]{fillers/commitstrip_in_a_paralell_universe2.jpg}\newline\url{http://www.commitstrip.com/en/2015/09/17/meanwhile-in-a-parallel-universe-2/}\\Meanwhile, in a parallel universe…\end{center}\end{tiny}
\vspace{\fill}
\newpage

% cover.maxsize: 2 (32) pages.
\clearpage
\onecolumn
\begin{tiny}\begin{center}\noindent\includegraphics[width=\columnwidth]{fillers/xkcd_1357.png}\newline\url{http://xkcd.com/1357/} (CC BY-NC 2.5)\end{center}\end{tiny}

\mbox{}\thispagestyle{empty}
\clearpage
\mbox{}\thispagestyle{empty}
\begin{textblock*}{\paperwidth}(0mm,0mm)\noindent\includegraphics[width=\paperwidth,height=\paperheight]{images/cover_back.png}
\end{textblock*}
\end{document}
