-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.tex
90 lines (78 loc) · 2.85 KB
/
setup.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
\usepackage[
citestyle=ieee,
bibstyle=ieee,
style=numeric-comp,
sorting=nty,
% sortcites=true
]{biblatex}
% Makes the last name first in the bibliography.
\DeclareNameAlias{author}{last-first}
% Specify the margins
\usepackage[a4paper, margin=3cm]{geometry}
\usepackage{eso-pic} % Packages for layout and graphics
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{setspace}
\usepackage{tocloft} % Fixing a bug with page style changes for toc
\tocloftpagestyle{fancy}
\usepackage{etoc} %Separate tocs for appendix and the rest
\usepackage{chngcntr} % Count figures within chapters
\counterwithin{figure}{section}
\counterwithin{table}{section}
\usepackage{booktabs} % Table formatting
\usepackage{fancyhdr} % Setting the style for header and footer.
\usepackage[hidelinks]{hyperref} % Clickable links
\usepackage{nameref} % References with names
\usepackage[parfill]{parskip} % New line instead of indent for sections
\usepackage{subfig} % Package for putting figures side by side
\usepackage{tcolorbox} % Create boxes around content
\tcbset{colback=white,arc=0mm}
% Specifying fonts
\usepackage{fontspec}
\setmainfont{Georgia}
\setsansfont{Arial}
\newfontfamily\footerfont{Georgia}
\usepackage{sectsty}
\sectionfont{\sffamily\fontsize{14}{15}}
\subsectionfont{\sffamily\fontsize{13}{15}}
\subsubsectionfont{\sffamily\fontsize{12}{15}}
% Remove the title and make sure that the text is adjusted
\usepackage{abstract}
\setlength{\absleftindent}{0mm}
\renewcommand{\abstractname}{\vspace{-\baselineskip}}
\renewcommand{\abstractnamefont}{\sffamily\fontsize{14}{15}}
\renewcommand{\abstracttextfont}{\normalfont\fontsize{12}{13}}
% Renaming and setting style of table of contents
\usepackage{tocloft}
\renewcommand*\contentsname{Contents}
\renewcommand*\cfttoctitlefont{\fontsize{16}{0}\bf\sffamily}
\renewcommand\cftsecfont{\fontsize{12}{0}\bf\sffamily}
\renewcommand\cftsecpagefont{\fontsize{12}{0}\bf\sffamily}
% Styling the header and footer
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[R]{\footerfont\thepage}
% Making the command for placing text in random locations
\newcommand\PlaceText[3]{%
\begin{tikzpicture}[remember picture,overlay]
\node[outer sep=0pt,inner sep=0pt,anchor=south west]
at ([xshift=#1,yshift=-#2]current page.north west) {#3};
\end{tikzpicture}%
}
% Disable hyphenation
\pretolerance=10000
\tolerance=2000
\emergencystretch=500pt
% Custom toc for cleaner main document
\newcommand{\customtoc}{
\etocdepthtag.toc{mtchapter}
\etocsettagdepth{mtchapter}{subsection}
\etocsettagdepth{mtappendix}{none}
\newpage
\thispagestyle{fancy}
\tableofcontents
% Fixing a bug where the page number would randomly fail to be right justified.
\thispagestyle{fancy}
\newpage
}