% Created by Anders Wettergreen Gundersen -----------------
% 2021-01-13: Ownership transferred to Endre Bjørndal, Programme Manager MScEBA
% 2023-01-05: Added hyperref package
% 2023-06-12: Replaced natbib package with biblatex to simplify referencing and enable referencing according to APA 7. Replaced code for appendix headings/numbering with appropriate macros. Simplified various parts of the code.
\documentclass[english, a4paper, 12pt, twoside]{article}
% -------------- Setup, do not change these ---------------
\usepackage{textcomp}
\usepackage[T1]{fontenc, url}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\setcounter{secnumdepth}{4}
\usepackage{multirow}
\usepackage{minted} % Code highlighting
\usepackage{adjustbox}
\usepackage{graphicx}
\usepackage{amsmath, amssymb, amsthm} % Mathematical packages
\usepackage{parskip} % Removing indenting in new paragraphs
\urlstyle{sf}
\usepackage{color}
\usepackage{subcaption}
\usepackage{appendix}
\usepackage{chngcntr} % needed for correct table numbering
\counterwithin{table}{section} % numbering of tables
\counterwithin{figure}{section} % numbering of figures
\numberwithin{equation}{section} % numbering of equations
\hyphenpenalty=100000 % preventing splitting of words
\sloppy
\raggedbottom
\usepackage{xparse,nameref}
\usepackage[bottom]{footmisc} % Fotnotes are fixed to bottom of page
\usepackage{lipsum} % For genereating dummy text
% --------- You can edit from this point on --------
% ----- Appearance and language -----
\usepackage[english]{babel} % document language
\graphicspath{{Images/}{../Images/}} % path to images
\usepackage[margin=2.54cm]{geometry} % sets margins for the document
\usepackage{setspace}
\linespread{1.5} % line spread for the document
\usepackage{microtype}
% ----- Sections -----
\titleformat*{\section}{\LARGE\bfseries} % \section heading
\titleformat*{\subsection}{\Large\bfseries} % \subsection heading
\titleformat*{\subsubsection}{\large\bfseries} % \subsubsection heading
% next three lines creates the \paragraph command with correct heading
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
% ----- Figures and tables -----
\usepackage{fancyhdr}
\usepackage{subfiles}
\usepackage{array}
\usepackage[rightcaption]{sidecap}
\usepackage{wrapfig}
\usepackage{float}
\usepackage[labelfont=bf]{caption} % bold text for captions
\usepackage[para]{threeparttable} % fancy tables, check these before you use them
\usepackage{url}
\usepackage[table,xcdraw]{xcolor}
\usepackage{makecell}
\usepackage{hhline}
% ----- Sources -----
\usepackage[style=apa,backend=biber]{biblatex}
\usepackage{csquotes}
\addbibresource{References.bib}
% ----- Hyperlinks -----
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
%linkcolor=blue,
%filecolor=magenta,
%urlcolor=cyan,
}
\urlstyle{same}
% ----- Header and footer -----
\pagestyle{fancy}
\fancyhead[RO,LE]{\thepage} % page number on right for odd pages and left for even pages in the header
\fancyhead[RE,LO]{\nouppercase{\rightmark}} % chapter name and number on the right for even pages and left for odd pages in the header
%\renewcommand{\headrulewidth}{0pt} % sets thickness of header line
\fancyfoot{} % removes page number on bottom of page
% ----- Header of the frontpage -----
\fancypagestyle{frontpage}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\vspace*{1\baselineskip}
\fancyhead[R]{Norwegian School of Economics
\linebreak Bergen, Spring 2023\vspace*{5\baselineskip}}
\fancyhead[L]{ \includegraphics[width=0.7in]{nhhlogo2.png}} % change to nhhlogo1.png for golden NHH logo
}
% ----- Document starts here -----
\begin{document}
\include{NHH-Frontpage}
\restoregeometry % restores the margins after frontpage
%\nocite{*} % uncomment if you want all sources to be printed in the reference list, including the ones which are not cited in the text
\pagenumbering{gobble} % suppress page numbering
\thispagestyle{plain} % suppress header
\clearpage\mbox{}\clearpage % add blank page
\pagenumbering{roman} % starting roman page numbering
\newpage
\section*{Acknowledgements}
\subfile{Chapters/Acknowledgements}
\newpage
\section*{Abstract}
\subfile{Chapters/Abstract}
\newpage
{\setstretch{1.0} % line spacing for the list
\tableofcontents
}
\newpage
{\setstretch{1.0}
\listoffigures}
\newpage
{\setstretch{1.0}
\listoftables}
\newpage
\addtocontents{toc}{\protect\setcounter{tocdepth}{4}} % sets depth of toc to 4, 1.1.1.1
\pagenumbering{arabic} % Starting arabic page numbering
\setcounter{page}{1} % sets pagecounter to 1
\section{Introduction} % section/chapter name
\subfile{Chapters/01Introduction} % including the subfile for the chapter
\clearpage % clears the page after the chapter is finished
\section{Background}
\subfile{Chapters/02Background}
\clearpage
\section{Data}
\subfile{Chapters/03Data}
\clearpage
\section{Methodology}
\subfile{Chapters/04Methodology}
\clearpage
\section{Analysis}
\subfile{Chapters/05Analysis}
\clearpage
\section{Discussion}
\subfile{Chapters/06Discussion}
\clearpage
\section{Conclusion}
\subfile{Chapters/07Conclusion}
\clearpage
\newpage
\renewcommand\refname{References} % name for the reference list
{\setstretch{1.0} % linespacing for the references
\addcontentsline{toc}{section}{References} % to change the name of the references in the TOC
\printbibliography % adds the references to the document
}
% % The macros on the next 5 lines controls the numbering of and within the appendices - DO NOT CHANGE
\newpage
\appendix %numbering of appendices, subsections, figures and tables
\appendixpage %inserts a first page with a main title for the appendices
\noappendicestocpagenum %no page number for the main title of the appendices
\addappheadtotoc %adds the first page of the appendices to the TOC
% ----------------------------------
\section{Test}
\begin{figure}[h]
\centering
\caption{NHH logo}
\includegraphics[width=0.2\columnwidth]{nhhlogo2.png}
\label{fig:logo2}
\end{figure}
\newpage
% TIPS AND TRICKS - REMOVE WHEN YOU DON'T NEED IT ANYMORE
\section{Tips and tricks to get you started}
\subfile{Chapters/Tips}
\end{document}