% ========== Template by IC\M/T Institute of Creative\Media/Technologies =============
% ==========  M. Wagner and K. Blumenstein, 2025 ============= 
% ==========  Based on the LaTeX Thesis Template for the University of Applied Sciences St.Pölten by P. Lechner https://github.com/hrtlacek/ThesisTemplate-FH-StP        ============= 
% ========== 
% Updates:
% 2025-02-21 updates caption for declaration, sets german and english abstract depending on the language chosen
% 2025-01-10 updates declaration in German and English, changes documenttype to report instead of scrreport
% 2024-04-30 changes header on Title page, updates citation
% 2024-04-17 Changes declaration in German and English
% 2024-04-23 Adds if/else for signature in declaration
% =============
%----------------------------------------------------------------
% TODO List
%----------------------------------------------------------------
% ============= Settings for the Work =============
\input{Settings}
%Dokumentklasse without end dot ;-)
%\documentclass[a4paper,twoside,11pt, numbers=noenddot]{scrreprt
%\PassOptionsToPackage[english,ngerman]{babel}
\ifUseOneSide
    \documentclass[
        a4paper,
        oneside,
        11pt,
        numbers=noenddot
    ]{report}%{scrreprt}%{book}
\else
    \documentclass[
        a4paper,
        twoside,
        11pt,
        numbers=noenddot
    ]{report}%{scrreprt}%{book}{report}
\fi
% ============= Packages =============
\usepackage[utf8]{inputenc} % encode as UTF-8
\usepackage[english, ngerman]{babel} % use english and german languages
\usepackage[left= 3.5cm,right = 3cm, bottom = 3.5 cm, top = 3 cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{fancyhdr}
\usepackage[T1]{fontenc}
% Document information
\usepackage[
	pdftitle={\workTitle},
	pdfsubject={},
	pdfauthor={\studentFirstName \studentLastName},
	pdfkeywords={}
	pdftex=true, 
	colorlinks=true,
 	breaklinks=true,
	citecolor=black,
	linkcolor=black,	
	menucolor=black,	
	urlcolor=black
]{hyperref}
\hypersetup{
    %bookmarks=true,         % show bookmarks bar?
    unicode=false,          % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,        % show Acrobat’s toolbar?    pdfmenubar=true,        % show Acrobat’s menu?
    pdffitwindow=false,     % window fit to page when opened
    pdfstartview={FitH},    % fits the width of the page to the window
    pdftitle={My title},    % title
    pdfauthor={Author},     % author
    pdfsubject={Subject},   % subject of the document
    pdfcreator={Creator},   % creator of the document
    pdfproducer={Producer}, % producer of the document
    pdfkeywords={keyword1} {key2} {key3}, % list of keywords
    pdfnewwindow=true,      % links in new window
    colorlinks=false,       % false: boxed links; true: colored links
    linkcolor=black,          % color of internal links (change box color with linkbordercolor)
    citecolor=black,        % color of links to bibliography
    filecolor=black,      % color of file links
    urlcolor=black           % color of external links
}
\usepackage{csquotes}
\usepackage{graphicx, subfigure}
\usepackage{lmodern}
\usepackage{color}
\usepackage{transparent}
\usepackage[style=apa, backend=biber]{biblatex}
%\usepackage[backend=biber, style=apa, citestyle=authoryear, sorting=nyt]{biblatex}
%\usepackage[backend=biber, style=ieee, citestyle=numeric, sorting=nyt]{biblatex}
%\usepackage[backend=biber, style=ieee, sorting=nyt]{biblatex}
% Usable sorting styles are:
% nty = Sort by name, title, year.
% nyt = Sort by name, year, title.
% nyvt = Sort by name, year, volume, title.
% anyt = Sort by alphabetic label, name, year, title.
% anyvt = Sort by alphabetic label, name, year, volume, title.
% ynt = Sort by year, name, title.
% ydnt = Sort by year (descending), name, title.
% none = Do not sort at all. All entries are processed in citation order.
% debug = Sort by entry key. This is intended for debugging only.
% Switch the language
\ifUseGermanVersion
    \DeclareLanguageMapping{ngerman}{ngerman-apa}
\else
    \DeclareLanguageMapping{english}{english-apa}
\fi
\addbibresource{biblatex.bib}
% Additional letters from the American Mathematical Society
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage[export]{adjustbox}
% Block Diagram Drawing Package
% ---tikz
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepackage{textcomp}
%Package for using the [H] option on graphics to force them into place
\usepackage{float}
%iPython packages:
%\usepackage{graphicx} % Used to insert images
\usepackage{adjustbox} % Used to constrain images to a maximum size 
\usepackage{color} % Allow colors to be defined
\usepackage{enumerate} % Needed for markdown enumerations to work
\usepackage{geometry} % Used to adjust the document margins
\usepackage{amsmath} % Equations
\usepackage{enumitem,amssymb} % Equations
\newlist{todolist}{itemize}{2} % for declaration
\setlist[todolist]{label=$\square$}
%\usepackage[mathletters]{ucs} % Extended unicode (utf-8) support
% \usepackage[utf8x]{inputenc} % Allow utf-8 characters in the tex document
\usepackage{pifont}
\newcommand{\done}{\rlap{\raisebox{0.3ex}{\hspace{0.4ex}\tiny \ding{52}}}$\square$}
\usepackage{fancyvrb} % verbatim replacement that allows latex
\usepackage{grffile} % extends the file name processing of package graphics 
                         % to support a larger range 
    % The hyperref package gives us a pdf with properly built
    % internal navigation ('pdf bookmarks' for the table of contents,
    % internal cross-reference links, web links for URLs, etc.)
\usepackage{hyperref}
\usepackage{longtable} % longtable support required by pandoc >1.10
% embedding of audio/video files etc.
% \usepackage{attachfile}
% \usepackage{movie15}
% \usepackage{media9}
% \usepackage{menukeys}
\usepackage[labelfont=it, labelsep=period, format=plain,justification=raggedright, singlelinecheck=false]{caption}
\captionsetup[figure]{justification=centering}
\definecolor{light-gray}{gray}{0.85}
% Switch between German and English based on the Settingx.tex. file
\usepackage{ifthen}
% =============== Block Diagram Drawing Config
\usetikzlibrary{shapes,arrows}
% Definition of blocks:
\tikzset{%
  block/.style    = {draw, thick, rectangle, minimum height = 3em,
    minimum width = 3em},
  sum/.style      = {draw, circle, node distance = 2cm}, % Adder
  input/.style    = {coordinate}, % Input
  output/.style   = {coordinate}, % Output
  mult/.style	  = {draw, isosceles triangle, minimum height=1cm, minimum width =1cm}
}
%mult/.style	  = {isosceles triangle, sharp corners, anchor=center, xshift=-4mm, minimum height=1.5cm, minimum width =0.05cm}
%isosceles triangle, fill=gray!25, minimum width=1.5cm
% Defining string as labels of certain blocks.
\newcommand{\suma}{\Large$+$}
\newcommand{\inte}{$\displaystyle \int$}
\newcommand{\derv}{\huge$\frac{d}{dt}$}
\newcommand{\conv}{\huge$\ast$}
% ============================================
% -- Settings für Code abbildungen
\usepackage{listings,lstautogobble}
\lstset{backgroundcolor=\color{light-gray},frame=single, framerule=0pt, showspaces=false, showtabs=false, numbers=left, numbersep=5pt, breaklines=false, autogobble=true, language=C++}
% Setze arial font
\usepackage[scaled]{helvet}
\renewcommand*{\familydefault}{\sfdefault}
% FH-green blue
\definecolor{FH}{rgb}{0.10, 0.57, 0.68}
% FH-green blue 2
\definecolor{FH2}{rgb}{0.0392, 0.666, 0.549}
% No indention afer a paragraph
\setlength{\parindent}{0cm}
% Paragraph
\setlength{\parskip}{0.3cm}
% ============= Header and Footer =============
\renewcommand{\chaptermark}[1]{\markboth{\thechapter~ #1}{}}
\ifUseOneSide
\fancypagestyle{icmt}{%
  \fancyhf{}% Clear header and footer
  \fancyhead[L]{\leftmark}
  \fancyfoot[R]{\thepage}% Custom footer
  \renewcommand{\headrulewidth}{0.4pt}% Line at the header visible
  \renewcommand{\footrulewidth}{0.0pt}% Line at the footer visible
}
% Redefine the plain page style
\fancypagestyle{plain}{%
  \fancyhf{}%
  \fancyfoot[R]{\thepage}%
  \renewcommand{\headrulewidth}{0.0pt}% Line at the header invisible
  \renewcommand{\footrulewidth}{0.0pt}% Line at the footer visible
}
\else
\fancypagestyle{icmt}{%
  \fancyhf{}% Clear header and footer
  \fancyhead[L]{\leftmark}
  \fancyfoot[RO,LE]{\thepage}% Custom footer
  \renewcommand{\headrulewidth}{0.4pt}% Line at the header visible
  \renewcommand{\footrulewidth}{0.0pt}% Line at the footer visible
}
% Redefine the plain page style
\fancypagestyle{plain}{%
  \fancyhf{}%
  \fancyfoot[RO,LE]{\thepage}%
  \renewcommand{\headrulewidth}{0.0pt}% Line at the header invisible
  \renewcommand{\footrulewidth}{0.0pt}% Line at the footer visible
  }
\fi
\setlength{\headheight}{13.59999pt}
\addtolength{\topmargin}{-1.59999pt}
% ============= Package Settings & Others ============= 
% Special Spellings
\hyphenation{De-zi-mal-tren-nung St-rei-fen-licht-scan-nern}
% Roman itemization \RM{<Number>}
\newcommand{\RM}[1]{\MakeUppercase{\romannumeral #1}}
% ============= Dokumentbeginn =============
\begin{document}
\ifUseGermanVersion
	\selectlanguage{ngerman}
\else
	\selectlanguage{english}
\fi
% Select the right main page ;-)
\ifUseGermanVersion
	\include{TemplateElements/TitelPage_de}
\else
	\include{TemplateElements/TitelPage_en}
\fi
% \part No numbering in the table of contend
\makeatletter
\let\partbackup\l@part
\renewcommand*\l@part[2]{\partbackup{#1}{}}
% Restart of the page numbering, Numbers [arabic], Roman numbers [roman,Roman], letters [alph,Alph]
\pagenumbering{Roman}
   
\pagestyle{plain}
\ifUseGermanVersion
	\include{TemplateElements/a_Erklaerung}
\else
	\include{TemplateElements/a_Declaration}
\fi
\newpage
\ifUseGermanVersion
    \include{Chapters/b_Kurzfassung}
	\include{Chapters/b_Abstract}
\else
	\include{Chapters/b_Abstract}
    \include{Chapters/b_Kurzfassung}
\fi
\newpage
% Table of Contend
\tableofcontents
\newpage
% Restart of the page numbering, Numbers [arabic], Roman numbers [roman,Roman], letters [alph,Alph]
\pagenumbering{arabic}
% Activate page style for the whole document
\pagestyle{icmt}
\newpage
% /*================================
% =            EXAMPLE            =
% ================================*/
% Delete this include at the end
\include{Example}
% /*================================
% =            CONTENTS            =
% ================================*/
\include{Chapters/01_Introduction}
\include{Chapters/02_Method}
\include{Chapters/03_Results}
\include{Chapters/04_Discussion}
\include{Chapters/05_Conclusion}
\pagestyle{plain} 
% References
\newpage
\addcontentsline{toc}{chapter}{Bibliography}
\printbibliography
\ifUseGermanVersion
    % Figures
    \newpage
    \addcontentsline{toc}{chapter}{Abbildungsverzeichnis}
    \listoffigures
    % Tables
    \newpage
    \addcontentsline{toc}{chapter}{Tabellenverzeichnis}
    \listoftables
    % Listings
    \newpage
    \addcontentsline{toc}{chapter}{Quellcodeverzeichnis}
    \lstlistoflistings
    \newpage
\else
	% Figures
    \newpage
    \addcontentsline{toc}{chapter}{List of Figures}
    \listoffigures
    % Tables
    \newpage
    \addcontentsline{toc}{chapter}{List of Tables}
    \listoftables
    % Listings
    \newpage
    \addcontentsline{toc}{chapter}{List of Listings}
    \lstlistoflistings
    \newpage
\fi
% ============================================
\include{Chapters/Appendix}
% ============================================
\end{document}