<reponame>The-Makers-of-things/thesis-computational-artificial-market

% PDF Latex version:
%    pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX)
%    kpathsea version 6.3.1
%    Compiled with libpng 1.6.36; using libpng 1.6.36
%    Compiled with zlib 1.2.11; using zlib 1.2.11
%    Compiled with xpdf version 4.01


% Setting document properties
\documentclass[a4paper,twoside,12pt,notitlepage,openright,12pt]{article}


% Load relevant packages
% ----------------------

\usepackage[ansinew]{inputenc}
\usepackage{graphicx} %[dvips] to used with .eps figures
\usepackage{natbib} % https://www.overleaf.com/learn/latex/natbib_citation_styles
\usepackage[nottoc,notlof,notlot]{tocbibind} % Include references to TOC but exclude list of figures & tables
\usepackage{lastpage}   % page count
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[english]{babel}
\usepackage[intoc]{nomencl} % Includes nomencl (scientific listing of figures, list of tables etc.) to table of contents
\usepackage{ifthen}
\usepackage[hmargin=3.0cm,vmargin=3.6cm]{geometry} % setting marginals
\usepackage{fancyhdr,extramarks}  % header ja footer manipulation
\usepackage{times}  % to change font to times
\usepackage{setspace} % for linespacing
\usepackage{caption}
\usepackage{booktabs}
\usepackage{subcaption}
\usepackage{url}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{makecell}
\usepackage{geometry}

\usepackage[ruled,vlined]{algorithm2e}
\usepackage{algpseudocode} 
\usepackage[toc,page,title]{appendix}

% Putting empty line after each paragraph
\usepackage[parfill]{parskip}

% To put figures pericsely where they are in the code
\usepackage{float}

% Setup
% -----

\newcommand{\nomunit}[1]{\renewcommand{\nomentryend}{\hspace*{\fill}#1}} % Inserts units on the right at symbol list
\renewcommand{\nomgroup}[1]{%
 \ifthenelse{\equal{#1}{C}}{\item[\textbf{Latin alphabet}]\item}{%
 \ifthenelse{\equal{#1}{G}}{\item\item[\textbf{Greek alphabet}]\item}{}}{%
 \ifthenelse{\equal{#1}{L}}{\item\item[\textbf{Subscripts}]\item}{}}{%
 \ifthenelse{\equal{#1}{H}}{\item\item[\textbf{Superscripts}]\item}{}}{%
 \ifthenelse{\equal{#1}{W}}{\item\item[\textbf{Abbreviations}]\item}{}}{}}

\singlespacing


% HEADING
% -------

\pagestyle{empty} % Alternatives: fancy, empty
\fancyhf{} % clearing the header and footer
\fancyhead[RE,RO]{\thepage}

\renewcommand{\headrulewidth}{0pt}      % ruler thickness between head and body
\renewcommand{\footrulewidth}{0pt}      % no ruler between body and footer

\setlength{\nomitemsep}{-\parsep}       % removing default extra skip between entries at nomenclature
\linespread{1.25}                       % Set line spacing to 1.5 https://tex.stackexchange.com/a/65985
\numberwithin{equation}{section}        % equation numbers with section numbers
\numberwithin{table}{section}           % table numbers with section numbers
\numberwithin{figure}{section}          % figure numbers with section numbers

% To rename "bibliography" to "References". 
% For some reason having references in TOC (with tocbibind) renames the references title
\addto{\captionsenglish}{\renewcommand{\bibname}{References}}  

% makeindex command needs to run at command prompt to create nomenclature list file
\makenomenclature % makeindex main_v2.nlo -s nomencl.ist -o main_v2.nls

% Instead of trying to fit the text to the page evenly, the content of a page has variable height.
% This prevent the effect of huge amount of white spaces between paragraphs or especially after images
\raggedbottom

\usepackage[T1]{fontenc}
\usepackage{beramono}
\usepackage{listings}
\usepackage[usenames,dvipsnames]{xcolor}


% Bibliography & citation style
% -----------------------------

\bibliographystyle{LUTapa_modif}


% Programming language definitions
% --------------------------------

%%
%% Python definition (c) 2014 Jubobs
%%

% Default fixed font does not support bold face
\DeclareFixedFont{\ttb}{T1}{txtt}{bx}{n}{12} % for bold
\DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{12}  % for normal

% Custom colors
\usepackage{color}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}

\newcommand\pythonstyle{\lstset{
    language=Python,
    basicstyle=\ttm,
    otherkeywords={self},             % Add keywords here
    keywordstyle=\ttb\color{deepblue},
    emph={MyClass,__init__},          % Custom highlighting
    emphstyle=\ttb\color{deepred},    % Custom highlighting style
    stringstyle=\color{deepgreen},
    frame=tb,                         % Any extra options here
    showstringspaces=false            % 
}}

% Python environment
\lstnewenvironment{python}[1][]
{
\pythonstyle
\lstset{#1}
}
{}

%%
%% Julia definition (c) 2014 Jubobs
%%

\lstdefinelanguage{Julia}%
  {morekeywords={abstract,break,case,catch,const,continue,do,else,elseif,%
      end,export,false,for,function,immutable,import,importall,if,in,%
      macro,module,otherwise,quote,return,switch,true,try,type,typealias,%
      using,while},%
   sensitive=true,%
   alsoother={$},%
   morecomment=[l]\#,%
   morecomment=[n]{\#=}{=\#},%
   morestring=[s]{"}{"},%
   morestring=[m]{'}{'},%
}[keywords,comments,strings]%

\lstset{%
    language         = Julia,
    basicstyle       = \ttfamily,
    keywordstyle     = \bfseries\color{blue},
    stringstyle      = \color{magenta},
    commentstyle     = \color{ForestGreen},
    showstringspaces = false,
}


% Actual document
% ---------------

\begin{document}
\pagenumbering{gobble}


\include{cover} 
\include{abstract}
\inputencoding{utf8}
\include{abstract_finnish}
\inputencoding{ansinew}

\include{acknowledgments}

% Contents, figures and tables
\tableofcontents
\listoffigures
\listoftables

\thispagestyle{empty}
\pagestyle{fancy}

%\cleardoublepage%
\printnomenclature[2.0cm]%


% Page numbering
% --------------
\newpage               % Informing Latex to start the numbering from new page (start of introduction page)
\pagenumbering{arabic} % Setting page numbering to arabic numbers (1, 2, 3, etc.)
\setcounter{page}{1}   % Force page numbering starting from 1 from here on


% Content of the Thesis
% ---------------------

\include{content/introduction}

\include{content/microstructure}
\include{content/artificial_stock_market}
\include{content/literature_review}

\include{content/empirics}
\include{content/results}
\include{content/conclusion}

\bibliography{ref}

\newpage
\pagenumbering{gobble}

\fancyhead[LO]{\nouppercase{\bfseries\firstleftxmark}}
\fancyhead[RE]{\nouppercase{\bfseries\lastrightxmark}}

\end{document}
