-
Notifications
You must be signed in to change notification settings - Fork 0
/
preamble.tex
295 lines (273 loc) · 13.9 KB
/
preamble.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
%--------------------------------------------------------------------------------------------------
% Preamble: Packages Used and Format Settings
%--------------------------------------------------------------------------------------------------
%--------------------------------------------------------------------------------------------------
% General Packages Used
%--------------------------------------------------------------------------------------------------
\usepackage{a4} % Set paper size to A4
\usepackage{ragged2e} % Better alignment options
\usepackage{amsmath,amssymb} % Enhanced mathematical typesetting
\usepackage{caption} % Customizing captions for figures and tables
\usepackage[export]{adjustbox} % Adjusting positioning and scaling of boxes (e.g., figures)
\usepackage{stackengine} % Stack items vertically or horizontally
\usepackage{graphicx} % Enhanced support for graphics
\usepackage{caption} % Customizing captions for figures and tables (continued)
\captionsetup{justification=centering, singlelinecheck=false} % Centering figure and table captions
\usepackage{amsfonts} % Additional mathematical fonts
\usepackage{bm} % Bold mathematical symbols
\usepackage{multirow} % Multi-row cells in tables
\usepackage{float} % Improved float placement options
\usepackage{rotating} % Rotating objects (e.g., figures, tables)
\usepackage[version=4]{mhchem} % Typesetting chemical formulas
\usepackage{physics} % Simplifies typesetting of common mathematical physics notation
\usepackage{blindtext} % Generates dummy text for testing purposes
\usepackage{braket} % Typesetting bra-ket notation used in quantum mechanics
\usepackage{enumerate} % Customizing enumeration lists
\usepackage{color} % Adding color support
\usepackage{tikz} % Comprehensive support for creating graphics programmatically
\usepackage{pgfplots} % High-quality plots and diagrams
\renewcommand{\familydefault}{\rmdefault} % Switch to default (Roman) font
% --- If You want to use Helvetica Font, uncomment the following 3 lines:
% \usepackage{helvet} % Uncomment to use Helvetica font
% \renewcommand{\familydefault}{\sfdefault} % Set default font family to sans-serif (Helvetica)
% \usepackage[helvet]{sfmath} % Use Helvetica font for math symbols
\usepackage[ruled,vlined]{algorithm2e} % Typesetting algorithms
\usepackage{fancybox} % Produces simple frames and boxes
\usepackage{verbatim} % Supports multiline comments
\usepackage[version=4]{mhchem} % Typesetting chemical formulas (continued)
\pgfplotsset{compat=1.16} % Set compatibility level for pgfplots
\usepackage{setspace} % Customizing line spacing
\onehalfspacing % Set line spacing to 1.5
\usepackage{fancyhdr} % Customizing page headers and footers
% \pagestyle{plain} % Set page style to plain (page number centered at the bottom)
% note: if you want to use the plain page style, you need to:
% 1. uncomment the plain page style line above
% 2. comment out the fancy page style section below
% --- fancy page style ---
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1} }
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{\sffamily{ \nouppercase{\leftmark}} }
\fancyhead[LO]{\sffamily{ \nouppercase{\rightmark}} }
\fancypagestyle{plain}{ %
\fancyhf{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[LE,RO]{\thepage}
}
% --- fancy page style ---
\usepackage[sorting=none]{biblatex} % Enhanced bibliography management
\bibliography{src/contents/backmatter/references/references} % Specify bibliography file
\usepackage{sectsty} % Package for customizing section titles
\usepackage{acronym} % Package for managing acronyms
\usepackage{booktabs} % For professional-looking tables
\usepackage{imakeidx} % Package for creating index
% Activate hyperlinks for the index
\makeindex[columns=2, title=Index, intoc=true]
%--------------------------------------------------------------------------------------------------
% Table of Contents Packages
%--------------------------------------------------------------------------------------------------
% \usepackage{titletoc} % For customizing TOC formatting
% % Redefine TOC font to sffamily
% \titlecontents{part}[0em]{\vspace{1em}\sffamily\bfseries\large}{\thecontentslabel\hspace{1em}}{}{\titlerule*[0.5pc]{}\contentspage}
% \titlecontents{chapter}[0em]{\vspace{1em}\sffamily\bfseries}{\thecontentslabel\hspace{1em}}{}{\titlerule*[0.5pc]{}\contentspage}
% \titlecontents{section}[1em]{\vspace{0.5em}\sffamily}{\thecontentslabel\hspace{1em}}{}{\titlerule*[0.5pc]{}\contentspage}
% \titlecontents{subsection}[2em]{\vspace{0.5em}\sffamily}{\thecontentslabel\hspace{1em}}{}{\titlerule*[0.5pc]{.}\contentspage}
% \titlecontents{subsubsection}[3em]{\vspace{0.5em}\sffamily}{\thecontentslabel\hspace{1em}}{}{\titlerule*[0.5pc]{.}\contentspage}
\usepackage{tocbibind} % Include table of contents, list of figures, etc., in table of contents
%--------------------------------------------------------------------------------------------------
% Code Block Formatting and Syntax Highlighting
%--------------------------------------------------------------------------------------------------
\usepackage{listings} % Package for typesetting code
\usepackage{xcolor} % Package for defining colors
% Redefine the heading of the list of listings
\renewcommand{\lstlistlistingname}{List of Code Snippets}
% --------------Themes------------------
% Themes were generated using chatgpt
% Define colors for a light themed C++ code
\definecolor{codegreen}{rgb}{0,0.6,0} % Define color for comments
\definecolor{codegray}{rgb}{0.5,0.5,0.5} % Define color for line numbers
\definecolor{codepurple}{rgb}{0.58,0,0.82} % Define color for keywords
\definecolor{backcolour}{rgb}{0.95,0.95,0.92} % Define background color
% Define listing style for light theme
\lstdefinestyle{cpplight}{
language=C++, % Set code language
backgroundcolor=\color{backcolour}, % Set background color
commentstyle=\color{codegreen}, % Set comment style
keywordstyle=\color{magenta}, % Set keyword style
numberstyle=\tiny\color{codegray}, % Set line number style
stringstyle=\color{codepurple}, % Set string style
basicstyle=\footnotesize\ttfamily, % Set basic code style
breakatwhitespace=false, % Don't break lines at whitespace
breaklines=true, % Break lines if too long
captionpos=b, % Set caption position
keepspaces=true, % Keep spaces
numbers=left, % Show line numbers on left
numbersep=5pt, % Set space between line numbers and code
showspaces=false, % Don't show spaces
showstringspaces=false, % Don't show spaces in strings
showtabs=false, % Don't show tabs
tabsize=4 % Set tab size
}
% Dracula colors (RGB)
\definecolor{dracula-bg}{RGB}{40, 42, 54} % Background color
\definecolor{dracula-fg}{RGB}{248, 248, 242} % Foreground color
\definecolor{dracula-comment}{RGB}{98, 114, 164} % Comment color
\definecolor{dracula-cyan}{RGB}{80, 250, 123} % Cyan color
\definecolor{dracula-green}{RGB}{80, 250, 123} % Green color
\definecolor{dracula-orange}{RGB}{255, 184, 108} % Orange color
\definecolor{dracula-pink}{RGB}{255, 121, 198} % Pink color
\definecolor{dracula-purple}{RGB}{189, 147, 249} % Purple color
\definecolor{dracula-red}{RGB}{255, 85, 85} % Red color
\definecolor{dracula-yellow}{RGB}{241, 250, 140} % Yellow color
% Dracula style for Python
\lstdefinestyle{python-dracula}{
language=Python, % Set code language
backgroundcolor=\color{dracula-bg}, % Background color
basicstyle=\color{dracula-fg}\ttfamily, % Basic code style
commentstyle=\color{dracula-comment}, % Comment style
keywordstyle=\color{dracula-pink}, % Keyword style
stringstyle=\color{dracula-yellow}, % String style
numbers=left, % Show line numbers on left
numberstyle=\color{black}, % Line number style
numbersep=10pt, % Space between line numbers and code
breaklines=true, % Break lines if too long
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
showspaces=false, % Don't show spaces
showstringspaces=false, % Don't show spaces in strings
frame=single, % Add frame around code
tabsize=4, % Set tab size
breakatwhitespace=true % Break lines at whitespace
rulecolor=\color{dracula-bg}, % Set rule color to background color
aboveskip=2em, % Set space above code block
belowskip=2em % Set space below code block
}
% Dracula style for C++
\lstdefinestyle{cpp-dracula}{
language=C++, % Set code language
backgroundcolor=\color{dracula-bg}, % Background color
basicstyle=\color{dracula-fg}\ttfamily, % Basic code style
commentstyle=\color{dracula-comment}, % Comment style
keywordstyle=\color{dracula-pink}, % Keyword style
stringstyle=\color{dracula-yellow}, % String style
numbers=left, % Show line numbers on left
numberstyle=\color{black}, % Line number style
numbersep=10pt, % Space between line numbers and code
breaklines=true, % Break lines if too long
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
showspaces=false, % Don't show spaces
showstringspaces=false, % Don't show spaces in strings
frame=single, % Add frame around code
tabsize=4, % Set tab size
breakatwhitespace=true % Break lines at whitespace
rulecolor=\color{dracula-bg}, % Set rule color to background color
aboveskip=2em, % Set space above code block
belowskip=2em % Set space below code block
}
% Light theme for Python (color-blind friendly)
\lstdefinestyle{python-github-light}{
language=Python,
backgroundcolor=\color{white},
basicstyle=\small\ttfamily\color{black},
keywordstyle=\color{blue},
commentstyle=\color{green!60!black},
stringstyle=\color{red!70!black},
numbers=left,
numberstyle=\color{gray},
numbersep=5pt,
showspaces=false,
showstringspaces=false,
tabsize=4,
breaklines=true,
frame=single,
rulecolor=\color{black},
captionpos=t, % Caption at the top
aboveskip=2em,
belowskip=2em
}
% Light theme for C++ (color-blind friendly)
\lstdefinestyle{cpp-github-light}{
language=C++,
backgroundcolor=\color{white},
basicstyle=\small\ttfamily\color{black},
keywordstyle=\color{blue},
commentstyle=\color{green!60!black},
stringstyle=\color{red!70!black},
numbers=left,
numberstyle=\color{gray},
numbersep=5pt,
showspaces=false,
showstringspaces=false,
tabsize=4,
breaklines=true,
frame=single,
rulecolor=\color{black},
captionpos=t, % Caption at the top
aboveskip=2em,
belowskip=2em
}
% Dark theme for Python (color-blind friendly)
\lstdefinestyle{python-github-dark}{
language=Python,
backgroundcolor=\color{black},
basicstyle=\small\ttfamily\color{white},
keywordstyle=\color{cyan},
commentstyle=\color{green!60!black},
stringstyle=\color{orange},
numbers=left,
numberstyle=\color{gray},
numbersep=5pt,
showspaces=false,
showstringspaces=false,
tabsize=4,
breaklines=true,
frame=single,
rulecolor=\color{white},
captionpos=t, % Caption at the top
aboveskip=2em,
belowskip=2em
}
% Dark theme for C++ (color-blind friendly)
\lstdefinestyle{cpp-github-dark}{
language=C++,
backgroundcolor=\color{black},
basicstyle=\small\ttfamily\color{white},
keywordstyle=\color{cyan},
commentstyle=\color{green!60!black},
stringstyle=\color{orange},
numbers=left,
numberstyle=\color{gray},
numbersep=5pt,
showspaces=false,
showstringspaces=false,
tabsize=4,
breaklines=true,
frame=single,
rulecolor=\color{white},
captionpos=t, % Caption at the top
aboveskip=2em,
belowskip=2em
}
% --------------Themes------------------
%--------------------------------------------------------------------------------------------------
% Multifile Package
%--------------------------------------------------------------------------------------------------
\usepackage{standalone} % Handling standalone files
\usepackage{import} % Improved handling of import commands
%--------------------------------------------------------------------------------------------------
% Hyperreferences packages
%--------------------------------------------------------------------------------------------------
% NOTE: use hyperref as the last package
\usepackage[hidelinks]{hyperref} % Enhancements for hyperlinks and cross-references
% \hypersetup{
% colorlinks = true, %Colours links instead of ugly boxes
% urlcolor = blue, %Colour for external hyperlinks
% linkcolor = blue, %Colour of internal links
% citecolor = red %Colour of citations
% }
\usepackage{bookmark}
% Custom command for referencing figures with custom text
\newcommand{\figref}[1]{\hyperref[#1]{Figure~\ref*{#1}}}