% "Constants" {{{
% ===============
% These definitions are needed in the bdsa class, that is why they are set
% before the documentclass. If you do remove them, you must remove the
% corresponding occurrences in all other files. Alternatively, you may just
% remove the commands' contents (e.g. `\newcommand*{\Versions}{}`), although
% that might lead to an unexpected and/or unwanted result with whitespace.
%
\newcommand*{\CourseFull}{Exam Spring 2022}
\newcommand*{\CourseCode}{Supervisor:}
\newcommand*{\CourseTeacher}{REDACTED}
\newcommand*{\CourseAbbrev}{REDACTED}
%
\newcommand*{\DocumentTitle}{REDACTED}
%
\newcommand*{\PdfKeywords}{SDD,{System Design Document},design,documentation}
%
\newcommand*{\GroupName}{REDACTED}
\newcommand*{\AuthorsShort}{REDACTED}

\newcounter{oldtocdepth}

\newcommand{\hidefromtoc}{%
  \setcounter{oldtocdepth}{\value{tocdepth}}%
  \addtocontents{toc}{\protect\setcounter{tocdepth}{-10}}%
}

\newcommand{\unhidefromtoc}{%
  \addtocontents{toc}{\protect\setcounter{tocdepth}{\value{oldtocdepth}}}%
}



% (future revisions may include a way to just define these once, but for now
%  this will have to suffice).
%
% ====================
% End of constants }}}
%
% Here begins the "normal" document. This is based, partially, at least, on a
% template that was provided to students attending the BDSA course in 2016,
% written by REDACTED and, partially, on my own templates and
% LaTeX experiences. I hope it works for you.
% If, however, that is not the case, you may direct questions to me, REDACTED by either mail, via Slack or in the exercise classes (which is
% preferred).
\documentclass[english,a4paper,oneside,12pt]{lib/bdsa}

\newlist{questions}{enumerate}{2}
\setlist[questions,1]{label=\textbf{RQ\arabic*}.,ref=RQ\arabic*}
\setlist[questions,2]{label=(\alph*),ref=\thequestionsi(\alph*)}

% Package Imports {{{
% ===================
\usepackage{subfiles}
\usepackage[backend=biber,
            url=true,
            isbn=true,
            block=none]{biblatex}
\usepackage[font=small,
            labelfont=bf,
            textfont={it,small},
            format=hang,
            justification=RaggedRight,
            width=0.875\textwidth,
            skip={2mm},
            position=below]{caption}
\usepackage{lib/umlucs}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage{titlesec}
\usepackage{pdfpages}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{algorithm,algpseudocode}
\usepackage{subfigure}
\usepackage{placeins}
\usepackage{layout}
%\usepackage[compact]{titlesec}


\usepackage[svgpath=../imgs/]{svg}

\graphicspath{{image/}{\main/image/}}

\titleformat{\chapter}[display]
  {\normalfont\bfseries}{}{0pt}{\Huge}
  
% Since you are required to include a glossary in your SDD, you should
% definately have a look at this package. Beware, though, that its
% documentation is rather huge and the package can be a little "temperamental".
% This template makes use of the package to provide you easy referencing
% capabilities to the glossary (use the `\Gls{key}`, `\gls{key}`, `\Glspl{key}`
% or `\glspl{key}` commands to reference your keys from any of the glossary
% files, which can be found (or made) in the glossary subdirectory (remember
% to input them into this file).
\usepackage[acronym]{glossaries-extra}

%%%YOUR ADDITIONAL PACKAGES HERE...%%%
%\usepackage{someotherpackage}

% ===================
% End of packages }}}

\title{%
  \pagenumbering{Alph} % So you don't get a warning about page 1 already being                     % defined.
  \date{}
  %\vspace{3cm}
  \begin{center}
    \HRule{0.5pt}\\
    {\large \DocumentSubject}\\
    \Huge{\DocumentTitle}\\
    \HRule{2pt}\\
    {\textbf{\CourseAbbrev}}\\
    %{\small :}
    %\vspace{-3mm}%
    \vspace{3 cm}
    %\Versions{%
      %\Version{1.0}{\printdate{2019-09-17}}{First release}
      %\Version{0.2}{\printdate{2018-09-14}}{Minor changes in layout}
      %\Version{3.0}{\printdate{2019-05-08}}{Review 3}
      %\Version{2.0}{\printdate{2019-04-04}}{Review 2}
      %\Version{0.1}{\printdate{2020-04-22}}{Draft 1}
    %}
    \\
    \LARGE{Authored by:} \\
    \Large{REDACTED}\\
    \Large{REDACTED}\\
    \Large{REDACTED}\\
    \vspace{0.5cm}
    {\textbf{\CourseCode}~\CourseTeacher}

  \end{center}
}

%% Bibliography - can't really remember what this is for... hmm
\DefineBibliographyStrings{english}{%
  bibliography = {References},
}
%%% Include bibliographic resources 
%\addbibresource{main.bib}
\addbibresource{segy.bib}
\bibliographystyle{plain}

\hypersetup{%
   citecolor=black
}

%%% Include glossary definitions
\makeglossaries%
\input{./glossary/tech}
\input{./glossary/terms}

\setglossarysection{section}

%%% Pagestyle
\pagestyle{plain}


%%%%Table of Contents + minitoc
%The depth of headers to show in "main" toc
\setcounter{tocdepth}{3}
%The depth of headers to keep track of (needed for proper labels)
\setcounter{secnumdepth}{4}

%%% General line spacing
\singlespacing%
%\onehalfspacing%
%\doublespacing%

\titlespacing*{\section} {0pt}{1pt}{1pt}

\begin{document}

% Some setup that is best done after document has started.
% Number floating environments like <chapter.section.floatidx>
\numberwithin{table}{section}
\numberwithin{figure}{section}
\numberwithin{lstlisting}{section}

% Title page
\maketitle
\pagenumbering{arabic} % change back to "normal" integer numbering

\subfile{./chapter/01-Abstract}
% Table of contents
\dominitoc%
\dominilot%
\tableofcontents
\fakelistoffigures%
\fakelistoftables%
\clearpage

% The actual document contents
\layout
\subfile{./chapter/02-Introduction}
\subfile{./chapter/03-Background}
%\subfile{./chapter/04-RelatedWork}
\subfile{./chapter/05-Methodology}
\subfile{./chapter/06-Experiments}
\subfile{./chapter/07-Discussion}
\subfile{./chapter/08-Conclusion}
%\subfile{./chapter/08-ReferenceList}


%\subfile{./chapter/05-Appendix}
%\subfile{./chapter/05-Glossary}

% Include bibliographical references as the last part of the document (but
% before a potential appendix)
%\newpage
\nocite{*}
\phantomsection{}\label{chapter:references}
\begin{multicols}{2}[\printbibheading]
    \printbibliography[heading=none]
    
\end{multicols}


%\subfile{./chapter/09-Appendix}

% MAYBE you wish include an appendix
\appendix 
% \subfile{./appendix/01-results}

\end{document}
% vim: ft=tex ts=2 sts=2 sw=2 tw=80

