-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreportFormat.sty
197 lines (141 loc) · 5.64 KB
/
reportFormat.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
\ProvidesPackage{reportFormat}
%% ============================= General packages =============================
% Referencing
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[colorlinks=false]{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{parskip}
% \usepackage{geometry} % [margin=1.2in]
\usepackage{changepage}
\usepackage{pdfpages}
%% ----------------------------- General commands -----------------------------
\newcommand{\defaultwidemargin}{20mm}
\newcommand{\padding}[1]{\dimexpr #1 - (\paperwidth - \textwidth) / 2 \relax}
%% ============================================================================
%% ============================== Maths packages ==============================
\usepackage{
amsmath, amssymb,
amsthm, amsfonts
}
\usepackage[ % SI Units
per-mode=symbol, % e.g. \SI{8314}{\kJ\per\kg\per\K},
separate-uncertainty=true, % \num{1e6}, \ang{45}, etc...
multi-part-units=single
]{siunitx}
\sisetup{separate-uncertainty}
\usepackage[super]{nth} % \nth{1} = 1\textsuperscript{st}
\usepackage[version=4]{mhchem} % Chemical equations -> e.g. \ch{H20}
\usepackage{bm} % Bold maths symbols -> e.g. \bm{\alpha}
\usepackage{xfrac} % Use \sfrac{}{} for slanted fractions
\usepackage{esint} % Gives nicer integration symbols
\usepackage{cancel} % Gives \cancelto{val}{var}
\numberwithin{equation}{section}
%% ------------------------------ Maths commands ------------------------------
\newcommand{\chemrate}[1]{\frac{\mathrm{d}[#1]}{\mathrm{d}t}}
\newcommand{\deriv}[1]{\frac{\mathrm{d}}{\mathrm{d}x} (#1)}
\newcommand{\pderiv}[2]{\frac{\partial}{\partial #2} #1}
\newcommand{\intd}[1]{\;\mathrm{d}#1}
\renewcommand*{\i}{\(i\)}
\renewcommand*{\vec}[1]{\bm{#1}}
%% ============================================================================
%% ============================= Figure packages ==============================
\usepackage{graphicx}
\graphicspath{ {../../Graphs/} }
\usepackage{tikz}
\usetikzlibrary{scopes}
\usepackage{float}
\usepackage{adjustbox}
\usepackage[ % Custom captions under/above floats
hang, small, up, % in tables or figures.
figurewithin=section,
tablewithin=section
]{caption}
\captionsetup{justification=raggedright}
\usepackage{subcaption}
%% ----------------------------- Figure commands ------------------------------
\newenvironment{widefigure}[1][\defaultwidemargin]{
\begin{figure}[H]
\begin{adjustwidth}{\padding{#1}}{\padding{#1}}
}{
\end{adjustwidth}
\end{figure}
}
%% ============================================================================
%% ============================== Table packages ==============================
\usepackage{tabu} % Better formatting of columns & widths
\usepackage{longtable} % Tables that go over multiple pages
\usepackage{booktabs} % Horizontal rules in tables
\usepackage{multirow}
\usepackage{array} % For customisation of tables
\usepackage{makecell, rotating} % Robust table cells -> e.g. \makecell
\global\tabulinesep=1mm
\renewcommand{\arraystretch}{1} % More spacing between rows
%% ------------------------------ Table commands ------------------------------
\newenvironment{widetable}[1][\defaultwidemargin]{
\begin{table}[H]
\begin{adjustwidth}{\padding{#1}}{\padding{#1}}
}{
\end{adjustwidth}
\end{table}
}
\newenvironment{hugetable}[1][\defaultwidemargin]{
\centering
\small
\setlength\LTleft{\padding{#1}}
\setlength\LTright{\padding{#1}}
\makeatletter
\g@addto@macro\tabu@setup{\def\tabu@aligndefault{x}}
\makeatother
}{
}
\newcolumntype{U}[2]{%
>{\adjustbox{angle=#1,lap=\width-(#2)}\bgroup}%
l%
<{\egroup}%
}
\newcommand*\slant{\multicolumn{1}{U{60}{1em}}}%
%% ============================================================================
%% ============================== List packages ===============================
\usepackage{enumitem} % For customisation of lists
%% ------------------------------ List commands -------------------------------
% Better formatting of lists within table cells.
% Use \compress at the start of the table.
\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother
%% ============================================================================
%% ============================== Code packages ===============================
\usepackage{minted}
\setminted[python]{
tabsize=4,
obeytabs,
fontsize=\footnotesize,
frame=lines,
framesep=0.5em,
linenos
}
\usemintedstyle{friendly}
\usepackage{algpseudocode}
%% ------------------------------ Code commands -------------------------------
\renewcommand\listoflistingscaption{List of source codes}
\usepackage{etoolbox, xpatch}
\makeatletter
\AtBeginEnvironment{minted}{\dontDoFColorBox}
\def\dontDoFColorBox{\renewcommand\fcolorbox[4][]{##4}}
\xpatchcmd{\inputminted}{\minted@fvset}{\minted@fvset\dontDoFColorBox}{}{}
\makeatother
%% ============================================================================
%% =================== Bibliography & Referencing packages ====================
\usepackage[
backend=biber,
style=authoryear,
citestyle=authoryear
% style=bwl-FU
]{biblatex}
\urlstyle{same}
\DeclareLanguageMapping{english}{english-apa}
\setcounter{biburlucpenalty}{10000}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[bottom]{footmisc} % Gives the \footref command
%% ============================================================================