X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=preamble.tex;h=c4a3c62278597056189a97c32269763a04847e45;hb=3044eec5a52dcd464ecfe502a521d09689f48f06;hp=49722c2ba04731cb57f3572add99f2861104700f;hpb=a944020914b1ddbe8286962e3ea50ee1d3fd7a45;p=phd-thesis.git diff --git a/preamble.tex b/preamble.tex index 49722c2..c4a3c62 100644 --- a/preamble.tex +++ b/preamble.tex @@ -1,154 +1,57 @@ -% Papersize -\usepackage{geometry} -\geometry{ - inner=25mm, - outer=20mm, - marginparsep=3mm, - marginparwidth=13mm, - top=25mm, - bottom=20mm, - paperwidth=17cm, - paperheight=24cm, -} - -% Font encoding -\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} % Input encoding +\usepackage[X2,T1]{fontenc} % Font encoding +\usepackage{ifxetex} +\ifxetex% + \usepackage{amsmath} % extra math + \usepackage{fontspec} + \usepackage{polyglossia} + \setmainlanguage[variant=british]{english} + \setotherlanguage{dutch} + \setotherlanguage{russian} + \newfontfamily{\cyrillicfont}{Liberation Serif} +\else + \usepackage{lmodern} % Nicer font + \usepackage{microtype} % Better kerning + \usepackage{amsmath} % extra math + \usepackage{amssymb} % extra math symbols + + \usepackage[dutch,russian,british]{babel} +% \babelfont[russian]{rm}{Liberation Serif} +\fi + +% Typography, widows, orphans, fonts +\input{preamble/typography} % Internationalisation -\usepackage[british]{babel} +\input{preamble/internationalisation} + +% Papersize and layout +\input{preamble/layout} -% Appendices -% TODO is this necessary? -\usepackage[titletoc]{appendix} +% Tables +\input{preamble/table} -% Hyperlinks -\usepackage{hyperref} -% Setup pdf parameters: TODO -\hypersetup{% - pdftitle={}, - pdfauthor={M. Lubbers}, - pdfsubject={}, -% pdfcreator={}, -% pdfproducer={}, - pdfkeywords={}, - pagebackref, - hidelinks, -} +% Listings +\input{preamble/listings} % Graphics -\usepackage{graphicx} -% Images directory -\graphicspath{{img/}} +\input{preamble/graphics} -% Nice tables -\usepackage{booktabs} +% Crossreferences, urls and hyperlinks +\input{preamble/crossref} -% Automatically wrapping tables -\usepackage{tabularx} +% Bibliography +\input{preamble/bibliography} -% Use a fixed document date -\usepackage[nodayofweek]{datetime} -% Code -\usepackage{listings} -% 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, -} -% 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 +% Custom commands +\input{preamble/commands} % Glossaries and acronyms -\usepackage[acronym,nonumberlist]{glossaries} -% Fix gls in hyperlink errors -\pdfstringdefDisableCommands{% - \def\acrlong#1{}% - \def\acrlongpl#1{}% - \def\acrshort#1{}% - \def\acrshortpl#1{}% - \def\acrfull#1{}% - \def\acrfullpl#1{}% - \def\Acrlong#1{}% - \def\Acrlongpl#1{}% - \def\Acrshort#1{}% - \def\Acrshortpl#1{}% - \def\Acrfull#1{}% - \def\Acrfullpl#1{}% - \def\gls#1{}% - \def\glspl#1{}% - \def\Gls#1{}% - \def\Glspl#1{}% - \def\titlecap#1{}% -} - -% Titlecase commands -\usepackage{titlecaps} -\Addlcwords{of} -% Titlecase glossary command -\newcommand{\glst}[1]{\titlecap{\glsentrylong{#1}}} -\newcommand{\Glst}[1]{\glst{#1}} - -% Pseudocode -\usepackage[algochapter]{algorithm2e} -% Fix the algorithm font -\renewcommand\AlCapFnt{\normalfont} - -% Index -\usepackage{makeidx} -% Enable the index -\makeindex% - -% Custom enumerations -\usepackage[inline,shortlabels]{enumitem} -\setlist{noitemsep} -\setlist[description]{leftmargin=\parindent} - -% Epigraph (lovecraft) -\usepackage{epigraph} - -% Thumb marks on the page -\usepackage[ - height={1.5cm}, - width={12mm}, - distance={1.55cm}, - topthumbmargin={auto}, - bottomthumbmargin={auto}, - eventxtindent={.5cm}, - oddtxtexdent={.3cm}]{thumbs} - -% Custom headers and footers -\usepackage{fancyhdr} -\pagestyle{fancy} - -% To patch the chapter command -\usepackage{etoolbox} -% Have better page numbering in chapters -\patchcmd{\chapter}{plain}{headings}{}{} +\input{preamble/glossaries} -% Increase the depth for the table of contents -\setcounter{secnumdepth}{3} -\renewcommand{\contentsname}{Table of Contents} % change the name of the TOC -\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} % to remove page numbering from the TOC +% File structure, this must be last of the preamble +\usepackage{subfiles} -% Initialize the glossaries -\makeglossaries% -\input{glossaries} +% Metadata (only works in main document) and should go after subfiles +%\input{preamble/metadata}