generated from alexlyttle/uob-thesis-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages.sty
274 lines (233 loc) · 7.99 KB
/
packages.sty
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
% packages.sty
%
% Copyright 2022 Alexander Lyttle.
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL) version 1.3 or later.
%
% The latest version of this license is in
% https://www.latex-project.org/lppl.txt and version 1.3 or later is part of
% all distributions of LaTeX version 2005/12/01 or later.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{packages}[2023/03/16 v1.0 Thesis Packages]
\newif\ifthesis@print\thesis@printfalse
\DeclareOption{print}{\thesis@printtrue}
\newif\ifthesis@editor\thesis@editorfalse
\DeclareOption{editor}{\thesis@editortrue}
\DeclareOption*{\OptionNotUsed}
\ProcessOptions\relax
%% LANGUAGE & FONTS
%
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% Serif and math fonts
\usepackage{newtxtext,newtxmath}
% Sans-serif font
% \usepackage[scaled=0.95,book]{FiraSans}
% \renewcommand*\oldstylenums[1]{{\firaoldstyle #1}}
% \usepackage[oldstyle,scale=0.95]{opensans}
% \usepackage{roboto}
% \usepackage{noto}
\usepackage[scaled=0.85]{inter}
% Typewriter font
\usepackage[zerostyle=b]{newtxtt}
\usepackage{csquotes} % When loading babel with biblatex
\usepackage{anyfontsize} % For custom font sizes
%% HEADERS & SPACING
%
% Fancy headers
\usepackage{fancyhdr}
\pagestyle{fancy}
% Headers setup
\fancypagestyle{main}{%
\fancyhf{}
% \fancyhead[LE,RO]{\sffamily\nouppercase{\rightmark}}
% \fancyhead[LO,RE]{\sffamily\nouppercase{\leftmark}}
\fancyhead[RO]{\itshape\rightmark}
\fancyhead[LE]{\itshape\leftmark}
\fancyfoot[C]{\thepage}
% \fancyfoot[RO]{\thepage}
% \fancyfoot[LE]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[C]{\thepage}
% \fancyfoot[RO]{\thepage}
% \fancyfoot[LE]{\thepage}
}
\pagestyle{main}
% Set spacing
% \usepackage{setspace}
% \doublespacing
% Short titles only for headers, TOC use long titles
% 'sf' option for sans-serif headings
% \usepackage[toctitles,sf,bf]{titlesec}
\usepackage[toctitles,bf]{titlesec}
% \titleformat*{\subsubsection}{\sffamily\bfseries} % modify subsubsection headings separately
% \titleformat*{\paragraph}{\sffamily\bfseries}
% OLD STYLE
% \titleformat{\chapter}[display]
% {\sffamily\bfseries\fontsize{64}{72}\selectfont} % Careful with custom font if change size
% {\filleft\thechapter}
% {20pt}
% {\filright\huge}
% CENTERED NORMAL FONT
\titleformat{\chapter}[display]
{\normalfont\LARGE\centering} % Careful with custom font if change size
{\chaptertitlename\ \thechapter}
{20pt}
{\MakeUppercase}
% CENTERED SANS SERIF
% \titleformat{\chapter}[display]
% {\sffamily\bfseries\LARGE\centering} % Careful with custom font if change size
% {\chaptertitlename\ \thechapter}
% {20pt}
% {\MakeUppercase}
% CENTERED NORMAL FONT + SANS
% \titleformat{\chapter}[display]
% {\sffamily\bfseries\LARGE\centering} % Careful with custom font if change size
% {\chaptertitlename\ \thechapter}
% {20pt}
% {\MakeUppercase}
%% HYPERLINKS
%
\usepackage{url} % Nice URL typesetting and line breaks
\urlstyle{rm} % Roman URL font style
% To include a link in your pdf use \href{URL}{Text to be displayed}.
% If your display text is the URL, you could use the \url{} command.
\usepackage{hyperref}
\hypersetup{
colorlinks=true, % Colours links instead of ugly boxes
urlcolor=blue, % Colour for external hyperlinks
linkcolor=blue, % Colour of internal links
citecolor=blue % Colour of citation links
}
\ifthesis@print
\hypersetup{hidelinks=true}
\fi
%% UNITS
%
% SI Units package
% Customise this depending on your field
\usepackage{siunitx}
\sisetup{
range-units=single,
separate-uncertainty=true,
multi-part-units=single
}
% Examples of custom units commonly used in astronomy
%
\DeclareSIUnit\year{yr}
\DeclareSIUnit\solarmass{\ensuremath{\mathrm{M}_\odot}}
\DeclareSIUnit\solarradius{\ensuremath{\mathrm{R}_\odot}}
\DeclareSIUnit\solarluminosity{\ensuremath{\mathrm{L}_\odot}}
\DeclareSIUnit\parsec{pc}
\DeclareSIUnit\dex{dex}
\DeclareSIUnit\magnitude{mag}
\DeclareSIUnit\aarcsec{as}
%% LICENSE
%
% This example package lets you choose a Creative Commons license to pass to \license command in' thesis.tex'
% Feel free to uncomment and use/change this to the license of your choice
\usepackage[
type={CC}, % Creative Commons
modifier={by}, % Attribution and Non-Commercial
version={4.0},
]{doclicense}
%% CITATIONS
%
\usepackage[%
style=authoryear-comp,
natbib=true,
url=false,
sorting=ynt, % Allow for year sorting in text, then use refcontext to print bibliography
giveninits=true, % Given name as initials only, uncomment if no compile
uniquename=init, % Very useful, use initials for unique names
% uniquename=false, % Uncomment this if don't care about unique author names in text.
uniquelist=false % Uncomment this if don't care about author lists in text.
]{biblatex}
% Allow for ynt sorting in text (https://tex.stackexchange.com/a/361042)
\newcommand{\serenelli}{S17}
\defcitealias{Serenelli.Johnson.ea2017}{\serenelli}
%% FIGURES & TABLES
%
\usepackage{float}
\usepackage{subcaption}
% \captionsetup{labelfont+={sf,bf}} % Uncomment for small captions and sans-serif bold labels
\captionsetup{labelfont+=bf}
% \captionsetup{font+=sf} % Uncomment for sans-serif captions
% Sans serif math in captions
% \DeclareCaptionFont{sansmath}{\sansmath}
% \captionsetup{font+={sf,sansmath}}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{lscape}
\usepackage{multirow}
%% OTHER PACKAGES
%
\usepackage{amsmath} % Mathematical symbols
\usepackage{bm} % Bold math
\usepackage{emptypage} % Make skipped pages blank
\usepackage{tocbibind} % Add TOC and bibliography to TOC
\usepackage{lipsum} % For placeholder text
\usepackage{nicefrac}
\usepackage{CJKutf8} % Chinese/Japanese/Korean characters
\usepackage{pgfornament} % Fancy ornaments and borders
% \usepackage[tagged, highstructure]{accessibility} % For accessible tagging
% \usepackage{axessibility} % For accessible math (screen reader friendly) doesn't work :(
\usepackage{epigraph} % Epigraphs - quotes at beginning of chapters
\setlength\epigraphwidth{.66\textwidth}
\setlength\epigraphrule{0pt}
\usepackage{tikz} % Diagrams
\usetikzlibrary{decorations.pathreplacing}
% For line numbers
\ifthesis@editor
\usepackage{lineno}
\linenumbers
\fi
\usepackage[acronym,toc]{glossaries}
\makeglossaries
%% NEW COMMANDS
%
% Define your new commands here, e.g.
%
\newcommand{\dd}{\mathrm{d}} % For the derivative 'd'
\newcommand{\ee}{\mathrm{e}} % For Euler's constant 'e'
\newcommand{\numax}{\ensuremath{{\nu_\mathrm{max}}}}
\newcommand{\dnu}{\ensuremath{{\Delta\nu}}}
\newcommand{\metallicity}{\ensuremath{[\mathrm{M}/\mathrm{H}]}}
\newcommand{\teff}{\ensuremath{{T_\mathrm{eff}}}}
\newcommand{\mlt}{\ensuremath{{\alpha_\mathrm{MLT}}}}
\newcommand{\real}{\ensuremath{{\mathrm{Re}}}}
\newcommand{\imag}{\ensuremath{{\mathrm{Im}}}}
\newcommand{\hydrogen}{\ensuremath{{\mathrm{H}}}}
\newcommand{\helium}{\ensuremath{{\mathrm{He}}}}
\newcommand{\heI}{\ensuremath{{\mathrm{I}}}}
\newcommand{\heII}{\ensuremath{{\mathrm{II}}}}
\newcommand{\bcz}{\ensuremath{{\mathrm{cz}}}}
\newcommand{\asy}{\ensuremath{{\mathrm{asy}}}}
\newcommand{\obs}{\ensuremath{{\mathrm{obs}}}}
\newcommand*{\todo}[1]{{\color{red}(TODO: #1)}}
\newcommand*{\needcite}[1][]{{\color{red}(\def\temp{#1}\ifx\temp\empty\else\temp,~\fi citation needed)}}
% Vector calculus
% Vector:
\newcommand*{\vect}[1]{\bm{#1}} % Bold
% \newcommand*{\vect}[1]{\vec{#1}} % Over-arrow
% Divergence:
% \newcommand*{\dive}[1]{\nabla \cdot #1} % Del-dot
\newcommand*{\dive}[1]{\mathrm{div} #1} % Roman text
%% LINKS
\newcommand{\gitremote}{https://github.com/alexlyttle/thesis}
\newcommand{\gitbranch}{glitch} % TODO: automate
% \listfiles
%% INFO
% Layout and Margins
% A4 paper: 21 x 29.7 cm (8.27 x 11.69 in)
% Margins (in, out, top, bottom): 3, 2, 2, 2 cm
% Usable space: 16 x 25.7 cm (6.3 x 10.1 in)
% Max figure width (suggested): 15.2 cm (~ 6 in)
% Max figure height (suggested): 22.8 cm (~ 9 in)