2 \usepackage[utf8
]{inputenc}
18 \usepackage[T1,T2A
]{fontenc}
21 \usepackage{microtype
}
23 % No more room for a new \write
24 \usepackage{morewrites
}
26 % Internationalisation
27 \usepackage[british
]{babel
}
28 %\babelfont[russian]{rm}{Liberation Serif}
31 % TODO is this necessary?
32 \usepackage[titletoc
]{appendix
}
35 %\usepackage[pagebackref]{hyperref}
36 \usepackage[pagebackref
]{hyperref
}
37 % Setup pdf parameters: TODO
40 pdfauthor=
{\myauthor},
44 pdfkeywords=
{task oriented programming, functional programming, domain specific languages, internet of things
},
56 % Automatically wrapping tables
59 % Use a fixed document date
60 \usepackage[nodayofweek
]{datetime
}
63 \usepackage{stmaryrd
} % Short arrow
65 % General listings settings
68 basicstyle=
\linespread{0.9}\tt\footnotesize,
69 breakatwhitespace=false,
74 escapeinside=
{(+
}{+)
},
% chktex 9
78 postbreak=
\mbox{\textcolor{gray
}{$
\hookrightarrow$
}\space},
80 showstringspaces=false,
87 {->
}{{$
\shortrightarrow$
}}2
88 {<-
}{{$
\shortleftarrow$
}}2
89 {=>
}{{$
\Rightarrow$
}}2
92 {...
}{{$
\cdots$
}}1 %chktex 11
93 {a0
}{{a
\textsubscript{0}}}2
94 {a1
}{{a
\textsubscript{1}}}2
95 {a2
}{{a
\textsubscript{2}}}2
96 % {an}{{a\textsubscript{n}}}2
97 {c0
}{{c
\textsubscript{0}}}2
98 {c1
}{{c
\textsubscript{1}}}2
99 {c2
}{{c
\textsubscript{2}}}2
100 {cn
}{{c
\textsubscript{n
}}}2
101 {f0
}{{f
\textsubscript{0}}}2
102 {f1
}{{f
\textsubscript{1}}}2
103 {f2
}{{f
\textsubscript{2}}}2
104 {fn
}{{f
\textsubscript{n
}}}2
105 {t0
}{{t
\textsubscript{0}}}2
106 {t1
}{{t
\textsubscript{1}}}2
107 {t2
}{{t
\textsubscript{2}}}2
108 {tn
}{{t
\textsubscript{n
}}}2
109 {v0
}{{v
\textsubscript{0}}}2
110 {v1
}{{v
\textsubscript{1}}}2
111 {v2
}{{v
\textsubscript{2}}}2
112 {vn
}{{v
\textsubscript{n
}}}2
113 {C0
}{{C
\textsubscript{0}}}2
114 {C1
}{{C
\textsubscript{1}}}2
115 {C2
}{{C
\textsubscript{2}}}2
116 {Cn
}{{C
\textsubscript{n
}}}2
117 {R0
}{{R
\textsubscript{0}}}2
118 {R1
}{{R
\textsubscript{1}}}2
119 {R2
}{{R
\textsubscript{2}}}2
120 {Rn
}{{R
\textsubscript{n
}}}2
122 \lstdefinestyle{haskell
}{%
124 deletekeywords=
{True,False,Bool,Int,Float,Double,zip,length,Show,show,Num,Eq,print,String
},
126 \lstdefinelanguage{Clean
}{%
127 alsoletter=
{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_`
1234567890},
128 alsoletter=
{~!@\#$\%^\&*-+=?<>:|\\.
},
129 morekeywords=
{generic,implementation,definition,dynamic,module,import,from,where,in,of,case,let,infix,infixr,infixl,class,instance,with,if,derive,code,In,qualified,otherwise
},
132 morecomment=
[n
]{/*
}{*/
},
133 morestring=
[b
]",
% chktex 18
134 morestring=
[s
]{['
}{'
]},
% chktex 9
136 \newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=
]|
#1|
}
137 \newcommand{\haskellinline}[1]{\lstinline[language=Haskell,style=haskell,postbreak=
]|
#1|
}
138 % Fix list of listings title
139 \renewcommand{\lstlistlistingname}{List of Listings
}
140 % Fix list of listings chapter separator
142 \let\my@chapter\@chapter
%
143 \renewcommand*
{\@chapter
}{%
144 \addtocontents{lol
}{\protect\addvspace{10pt
}}%
148 \lstnewenvironment{lstClean
}[1][]
150 \lstset{language=Clean,
#1}
151 \renewcommand*
{\lstlistingname}{Listing (Clean)
}
154 \lstnewenvironment{lstHaskell
}[1][]
156 \lstset{language=Haskell,style=haskell,
#1}%
157 \renewcommand*
{\lstlistingname}{Listing (Haskell)
}
161 % Glossaries and acronyms
162 \usepackage[acronym,nonumberlist
]{glossaries
}
163 % Fix gls in hyperlink errors
164 \pdfstringdefDisableCommands{%
179 \def\glsentrytext#1{}%
182 \def\Glsentrytext#1{}%
187 \usepackage{titlecaps
}
189 % Titlecase glossary command
190 \newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}}
191 \newcommand{\Glst}[1]{\glst{#1}}
194 \usepackage[algochapter
]{algorithm2e
}
195 % Fix the algorithm font
196 \renewcommand\AlCapFnt{\normalfont}
203 % Custom enumerations
204 \usepackage[inline,shortlabels
]{enumitem
}
206 \setlist[description
]{leftmargin=
\parindent}
208 % Epigraph (lovecraft)
209 \usepackage{epigraph
}
211 % Thumb marks on the page
216 topthumbmargin=
{auto
},
217 bottomthumbmargin=
{auto
},
218 eventxtindent=
{.5cm
},
219 oddtxtexdent=
{.3cm
}]{thumbs
}
221 % Custom headers and footers
222 \usepackage{fancyhdr
}
225 % Tables spanning pages
226 \usepackage{longtable
}
229 \usepackage{cleveref
}
235 % To patch the chapter command
236 \usepackage{etoolbox
}
237 % Have better page numbering in chapters
238 \patchcmd{\chapter}{plain
}{headings
}{}{}
240 % Increase the depth for the table of contents
241 \setcounter{secnumdepth
}{3}
242 \renewcommand{\contentsname}{Table of Contents
} % change the name of the TOC
243 \AtBeginDocument{\addtocontents{toc
}{\protect\thispagestyle{empty
}}} % to remove page numbering from the TOC
245 % Initialize the glossaries
250 \newcommand{\GHCmod}[1]{\texttt{#1}}
251 \newcommand{\requiresGHCmod}[1]{\footnote{Requires
\GHCmod{#1} to be enabled.
}}
252 \newcommand{\etc}{{\fontfamily{cmr
}\selectfont{\itshape\/\&c
}}}