-
Notifications
You must be signed in to change notification settings - Fork 2
/
dissertation_packages.sty
134 lines (118 loc) · 4.36 KB
/
dissertation_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
% custom list of packages to load
% this is the standard list of packages to use. Can customize and rename this for specific use/templates
\ProvidesPackage{dissertation_packages}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DEFINE USEFUL PACKAGES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% OBSOLETE PACKAGE CHECK
\RequirePackage[l2tabu,orthodox]{nag}
%------------------------FONTS-------------------------------------------------
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{microtype} % better fonts/apperance
\usepackage{bm} % boldface
% -------------------MATH PACKAGES --------------------------------------
\usepackage[binary-units=true]{siunitx} % SI units
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage[shortlabels]{enumitem}
%----------------------------- GRAPHICS PACKAGES--------------------------
\usepackage[]{geometry}
\usepackage{graphicx} % for pdf, bitmapped graphics files
\usepackage{subcaption} % make it possible to include more than one captioned figure/table in a single float
\graphicspath{{./figures/}}% path to images
% TIKZ
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{groupplots,external}
\usepackage{tikz-3dplot}
\usetikzlibrary{decorations.markings,decorations.pathreplacing,calc}
\usetikzlibrary{decorations.shapes}
\usetikzlibrary{plotmarks,positioning}
\usetikzlibrary{arrows.meta,shapes,decorations.pathmorphing,fit}
\usetikzlibrary{shadows.blur}
% externalize tikz plots for speed
\tikzexternalize[
prefix=build/,
mode=list and make,
% optimize=false,
]
\usepackage{environ}
%------------- CITATION PACKAGES------------------------------
\usepackage[style=numeric,backend=bibtex8]{biblatex}
\ExecuteBibliographyOptions{}
\AtEveryBibitem{%
\clearfield{url}%
\clearfield{doi}%
\clearfield{issn}%
\clearfield{isbn}%
}
\usepackage{color}
\usepackage[]{hyperref} % links to stuff
\hypersetup{
colorlinks = false, %Colours links instead of ugly boxes
urlcolor = blue, %Colour for external hyperlinks
linkcolor = red, %Colour of internal links
citecolor = green %Colour of citations
}
% --------------------------------------
% MUST BE AFTER HYPERREF!!!!!!!!!
%------------------------------------------
\usepackage[noabbrev,capitalize]{cleveref} % get fancy referencing
% \tikzexternaldisable
% \tikzset{help lines/.style={very thin,color=gray!50}} % modify the help lines style
% \tikzset{->-/.style={decoration={
% markings,
% mark=at position .5 with {\arrow{>}}},postaction={decorate}}}
% \tikzset{decorate sep/.style 2 args=
% {decorate,decoration={shape backgrounds,shape=circle,shape size=#1,shape sep=#2}}}
% \tikzset{>={Latex[width=3mm,length=3mm]}}
\makeatletter
\newsavebox{\measure@tikzpicture}
\NewEnviron{scaletikzpicturetowidth}[1]{%
\def\tikz@width{#1}%
\def\tikzscale{1}\begin{lrbox}{\measure@tikzpicture}%
\BODY
\end{lrbox}%
\pgfmathparse{#1/\wd\measure@tikzpicture}%
\edef\tikzscale{\pgfmathresult}%
\BODY
}
\makeatother
% Tikz macros
% Draw an arc denoting an angle using start and delta angles
\newcommand{\drawarcdelta}[4]{
\draw ($#1+(#2:#4)$) arc[start angle=#2, delta angle=#3, radius=#4];
}
% Draw an arc with label denoting an angle using start and delta angles
\newcommand{\drawlabeledarcdelta}[6]{
\drawarcdelta{#1}{#2}{#3}{#4}
\node at ($#1+(#2+#3/2:#6)$) {#5};
}
% These packages should come last for real
% \usepackage{refcheck} % check for unused references/labels
% \usepackage[]{showlabels} % show labels for referencing
% Get refcheck to work with cleveref
% \makeatletter
% \newcommand{\refcheckize}[1]{%
% \expandafter\let\csname @@\string#1\endcsname#1%
% \expandafter\DeclareRobustCommand\csname relax\string#1\endcsname[1]{%
% \csname @@\string#1\endcsname{##1}\@for\@temp:=##1\do{\wrtusdrf{\@temp}\wrtusdrf{{\@temp}}}}%
% \expandafter\let\expandafter#1\csname relax\string#1\endcsname
% }
% \newcommand{\refcheckizetwo}[1]{%
% \expandafter\let\csname @@\string#1\endcsname#1%
% \expandafter\DeclareRobustCommand\csname relax\string#1\endcsname[2]{%
% \csname @@\string#1\endcsname{##1}{##2}\wrtusdrf{##1}\wrtusdrf{{##1}}\wrtusdrf{##2}\wrtusdrf{{##2}}}%
% \expandafter\let\expandafter#1\csname relax\string#1\endcsname
% }
% \makeatother
% \refcheckize{\cref}
% \refcheckize{\Cref}
% \refcheckizetwo{\crefrange}
% \refcheckizetwo{\Crefrange}