%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ELS PHD Thesis 
% Version 1.0 (31.01.2019)
% created by Johannes Ziegmann
% mail: Johannes.Ziegmann@gmail.com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[12pt,
				a4paper,
				twoside, 						% oneside, twoside
        % parskip=half,  		% put space between paragraphs, and at the same time remove the indentation
				parskip=false,
				titlepage,
				openright, 					% Chapter immer ungerade (odd) seiten
				chapterprefix=true, % Chapter 1 ... dann Überschrift
				%	toc = listofnumbered,
				numbers=noenddot, 	% p= ointlessnumbers
        % ngerman  					% language setting; default: nothing
				]{scrbook} 					% report, scrreprt, scrbook


% change headers to roman font
\addtokomafont{disposition}{\rmfamily}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%include extra definitions, e.g. added packages, own commands, ...

\input{inputs/packages} 	% packages
\input{inputs/rgb_colors} % rgb colors 
\input{inputs/macros} 		% macros
\input{inputs/acros} 			% loading ... input/acros + input/syms
\input{inputs/page_style}

%\usepackage{mathpazo}  	% switch the roman font to Palatino
%\usepackage{newpxtext,newpxmath}  % switch to Palatino, alternative package

\graphicspath{{figures/}} 	% {logos/}}
\addbibresource{mybib.bib} 	% only with biblatex
\newcounter{savepage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\includeonly{
%chapters/a01_titlepage,
%chapters/a02_preamble,
%chapters/a03_abstract,
%chapters/b01_symbols,
%chapters/b02_acronyms,
%chapters/ch01_introduction,
%chapters/ch02_xxx,
%chapters/ch03_xxx,
%chapters/ch04_xxx,
%chapters/ch05_xxx,
%chapters/ch06_conclusion,
%%chapters/chapter_stuff,
%chapters/d01_appendix
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\selectlanguage{english}

\setcounter{page}{1}
\pagenumbering{roman}

% \shorthandoff{"}  % very tricky: disable manipulation of the double quote by babel to retain the possibility to quote file paths for tikz

%\pagestyle{empty}  % switch to empty headers etc. for the first pages
\packagesHeadFootStart

\include{chapters/a01_titlepage}

% optional: preamble and acknowledgments
\include{chapters/a02_preamble}
% abstract (english and german)
\include{chapters/a03_abstract}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\pagestyle{fancy}  % now enable the fancy headers etc.


% overview of content
\pdfbookmark{\contentsname}{toc}  % uncomment for hyperref; adds the TOC to pdf bookmarks, but not to the TOC
\tableofcontents 

\cleardoublepage
\phantomsection %uncomment for hyperref
\addcontentsline{toc}{chapter}{\listfigurename} %to show in table of contents
\listoffigures

\cleardoublepage
\phantomsection %uncomment for hyperref
\addcontentsline{toc}{chapter}{\listtablename} %to show in table of contents
\listoftables

% list of symbols:
%\cleardoublepage
\phantomsection %uncomment for hyperref
%%\addcontentsline{toc}{chapter}{Symbols} %to show in table of contents
\include{chapters/b01_symbols}

% list of acronyms:
%\cleardoublepage
\phantomsection %uncomment for hyperref
%%\addcontentsline{toc}{chapter}{Acronyms} %to show in table of contents
\include{chapters/b02_acronyms}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\cleardoublepage
\setcounter{savepage}{\arabic{page}}
\pagenumbering{arabic}

% set chapter counter back to 1
%\setcounter{chapter}{0} %reset chapter counter 
%\renewcommand{\thechapter}{\arabic{chapter}}

\packagesHeadFootMain
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% content
\setstretch{1.2} % Line spacing (AS: 1.3)
\include{chapters/ch01_introduction}
\include{chapters/ch02_xxx}
\include{chapters/ch03_xxx}
\include{chapters/ch04_xxx}
\include{chapters/ch05_xxx}
\include{chapters/ch06_conclusion}
\include{chapters/chapter_stuff}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% appendix
\packagesHeadFootEnde
\appendix
\include{chapters/d01_appendix}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\cleardoublepage
% Page numbering
\pagenumbering{Roman}
\setcounter{page}{\thesavepage}

\phantomsection %uncomment for hyperref
\addcontentsline{toc}{chapter}{Bibliography}

% bibliography with biblatex:
\packagesHeadFootBib
\vspace{\stretch{1}}
\printbibliography

% bibliography with bibtex:
%\bibliographystyle{IEEEtranS}
%\bibliography{mybib}
 
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%