-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
119 lines (89 loc) · 3.77 KB
/
main.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
% memoir is a documentclass based on book.
% The memoir class incorporates the functions of a large number of commonly used packages
% to provide a more consistent interface, and is designed to be easy to customize.
% So instead of loading a dozen possibly conflicting packages---geometry to change margins,
% and setspace to change line spacing, and titlesec to format
% section headings, etc., etc.---you just specify memoir
% as your document class and use its settings
%%% IMPORTANT: oneside vs twoside
%%% twoside:
%%% The twoside flag to memoir generates a PDF where even and odd pages are treated differently.
%%% Specifically the margin is handled differently depending if it is an odd or even page.
%%%
%%% PROS: The twoside flag is specifically useful for generating PDFs that should then be prepressed
%%% into an actual physical book.
%%% The first page of a chapter always starts in a odd page.
%%% CONS: Digital reading of the pdf becomes awkard since when scrolling the text constantly
%%% shifts left and right depending on the page index
%%%
%%% oneside:
%%% All pages are handled with the same margin, and are all treated the same
%%%
%%% PROS: PDF better suited for digital reading on a computer
%%% CONS: Prepressing on an actual book will lead to a lower quality result compared to the twoside.
%%% Chapter first page can start at even an odd pages
%%% Memoir by default assumes twoside PDF if nothing is specified.
\documentclass[12pt,
a4paper,
twoside,
openright, % Set chapter to begin on the right page
italian,english,
extrafontsizes]
{memoir}
\usepackage[utf8]{inputenc} % Better handling of inputencoding, i.e. for the actual latex file
% Better font encoding, i.e. for the actual output
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{mathptmx} % Times new roman font
\usepackage{etoolbox} % Useful for programmatically perform actions in latex: booleans, conditions, string comparisons, lists, iterations, etc
\usepackage[dvipsnames]{xcolor} % To use colors for specific texts, provides the \color{<COLOR>} to color text
\input{Config/flags_decls.tex}
\input{Config/config.tex}
\title{\Title{}}
\author{\AuthorName{} \AuthorSurname{}}
\date{\GraduationDate{}}
\input{Config/pdf_metadata.tex}
%%
%% Metadata that will be used by the pdfx package to encode the metadate in the final PDF-A2B format.
%% NOTE: Must precede \begin{document}....\end{document} environment
%%
\begin{filecontents*}[overwrite]{\jobname.xmpdata}
\Title{\PdfMetadataTitle}
\Author{\PdfMetadataAuthor}
\Copyright{\PdfMetadaCopyright}
\Subject{\PdfMetadataSubject}
\Language{\PdfMetadataLanguage}
\Keywords{\PdfMetadataKeywords}
\Publisher{\PdfMetadataPublisher}
\CoverDisplayDate{\PdfMetadataCoverDisplayDate}
\CoverDate{\PdfMetadataCoverDate}
\end{filecontents*}
\input{Config/packages.tex}
\input{Config/after_package_load.tex}
\input{Config/fix_latex_quirks.tex}
\input{Config/custom_commands.tex}
\input{Utils/math_definitions.tex}
\addbibresource{biblio.bib}
\ifbool{GenerateGlossary}{
\input{Content/Preamble/glossary.tex}
}{}
%%
%% Start the document
%%
\begin{document}
%% To allow breaking long ```\begin{align} \end{align}``` equations over multiple pages.
%% Allows for better text reflows
\allowdisplaybreaks
% turns off chapter numbering and uses roman numerals for page numbers
\frontmatter
\input{Content/preamble.tex}
\pagebreak
% Turns on arabic numbering for the main content
\pagenumbering{arabic}
\mainmatter
\input{Content/main_content.tex}
\pagebreak
\backmatter
\printbibliography
\end{document}