Merge branch 'master' of git.martlubbers.net:msc-thesis1617
[msc-thesis1617.git] / thesis.pre
index 69a3ddd..e7fef0f 100644 (file)
-\documentclass[a4paper]{book}
+\documentclass[twoside,a4paper,titlepage]{book}
 
-\usepackage{geometry}
-\usepackage{rutitlepage/rutitlepage}
-\usepackage{hyperref}
+\usepackage{geometry}                % Papersize
+\usepackage[british]{babel}          % Internationalization
+\usepackage[titletoc]{appendix}      % Appendices
+\usepackage{hyperref}                % Hyperlinks
+\usepackage{booktabs}                % Better looking tables
+\usepackage{caption}                 % Captions
+\usepackage{subcaption}              % Subcaptions
+\usepackage{listings}                % source code
+\usepackage{float}                   % floating images
+\usepackage{lmodern}                 % Better teletype fonts
+\usepackage{textcomp}                % Nice listings quotes
+\usepackage{pgf-umlsd}               % Connection diagrams
+\usepackage{graphicx}                % Graphics
+\usepackage{epstopdf}                % Eps graphics
+\usepackage{etoolbox}                % Patch chapter command
+\usepackage[nodayofweek]{datetime}   % Use a fixed document date
 
-\hypersetup{
-       pdftitle={iTasks and the Internet of Things},
+% Fix fonts
+\normalfont
+\DeclareFontShape{OT1}{lmr}{bx}{sc} { <-> ssub * lmr/bx/n }{}
+
+% Have better page numbering in chapters
+\patchcmd{\chapter}{plain}{headings}{}{}
+
+% Arrows for communication diagrams
+\usetikzlibrary{arrows,shadows}
+
+% Images directory
+\graphicspath{{img/}}
+
+% Fix list of listings title
+\renewcommand{\lstlistlistingname}{List of Listings}
+
+% Fix list of listings chapter separator
+\makeatletter
+\let\my@chapter\@chapter
+\renewcommand*{\@chapter}{%
+  \addtocontents{lol}{\protect\addvspace{10pt}}%
+  \my@chapter}
+\makeatother
+
+% Always have url in teletype
+\urlstyle{tt}
+
+% Setup pdf parameters
+\hypersetup{%
+       pdftitle={Task Oriented Programming and the Internet of Things},
        pdfauthor={Mart Lubbers},
-       pdfsubject={iTasks and the Internet of Things},
+       pdfsubject={Task Oriented Programming and the Internet of Things},
        pdfcreator={Mart Lubbers},
        pdfproducer={Mart Lubbers},
        pdfkeywords={TOP,iTasks,Clean,Function Programming,IoT},
        hidelinks=true
 }
 
-\title{iTasks and the Internet of Things}
-\author{Mart Lubbers BSc.\\{\small\url{mart@martlubbers.net}}}
-\date{\today}
+% Fix gls in hyperlink errors
+\pdfstringdefDisableCommands{%
+       \def\acrlong#1{}%
+       \def\acrlongpl#1{}%
+       \def\acrshort#1{}%
+       \def\acrfull#1{}%
+       \def\gls#1{}%
+       \def\glspl#1{}%
+       \def\Gls#1{}%
+       \def\Glspl#1{}%
+}
+
+% Clean language spec for listings
+\lstdefinelanguage{Clean}{%
+       alsoletter={ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_`1234567890},
+       alsoletter={~!@\#$\%^\&*-+=?<>:|\\.},
+       morekeywords={generic,implementation,definition,dynamic,module,import,from,where,in,of,case,let,infix,infixr,infixl,class,instance,with,if,derive,::},
+       sensitive=true,
+       morecomment=[l]{//},
+       morecomment=[n]{/*}{*/},
+       morestring=[b]",
+       morestring=[b]',
+       emptylines=1,
+       basewidth=0.45em,
+       columns=[c]fixed,
+       texcl=true,
+       upquote=true,
+       literate=%
+               % Basic Clean constructs
+               {\\}{{$\lambda\:$}}1
+               {A.}{{$\forall\;\,$}}1
+               {E.}{{$\exists\;\,$}}1
+               {*}{{$^*$}}1
+}
+
+% Handy shortcut for inline Clean code
+\newcommand{\CI}[1]{\lstinline[language=Clean,basicstyle=\ttfamily\fontseries{l}\normalsize]|#1|}
+
+% General listings settings
+\lstset{%
+       breakatwhitespace=false,
+       breaklines=true,
+       captionpos=b,
+       keepspaces=true,
+       basicstyle=\ttfamily\fontseries{l}\footnotesize,
+       commentstyle=\slshape\fontseries{m},
+       keywordstyle=\bfseries\fontseries{b},
+       stringstyle=\ttfamily,
+       showspaces=false,
+       showstringspaces=false,
+       showtabs=false,
+       tabsize=4,
+       frame=L,
+}
+
+% Increase the depth for the table of contenst
+\setcounter{secnumdepth}{3}
+
+% Document info
+\title{Task Oriented Programming and the Internet of Things}
+\author{Mart Lubbers BSc.\\
+       {\small\href{mailto:mart@martlubbers.net}{mart@martlubbers.net}}}
+\date{\formatdate{10}{7}{2017}}