Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download
Project: Peter's Files
Views: 3893
Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu1804
1
\usepackage[english]{babel} % English language hyphenation
2
3
\usepackage{microtype} % Better typography
4
5
\usepackage{amsmath,amsfonts,amsthm} % Math packages for equations
6
7
\usepackage[svgnames]{xcolor} % Enabling colors by their 'svgnames'
8
9
\usepackage[hang, small, labelfont=bf, up, textfont=it]{caption} % Custom captions under/above tables and figures
10
11
\usepackage{booktabs} % Horizontal rules in tables
12
13
\usepackage{lastpage} % Used to determine the number of pages in the document (for "Page X of Total")
14
15
\usepackage{graphicx} % Required for adding images
16
17
\usepackage{enumitem} % Required for customising lists
18
\setlist{noitemsep} % Remove spacing between bullet/numbered list elements
19
20
\usepackage{sectsty} % Enables custom section titles
21
\allsectionsfont{\usefont{OT1}{phv}{b}{n}} % Change the font of all section commands (Helvetica)
22
23
%----------------------------------------------------------------------------------------
24
% MARGINS AND SPACING
25
%----------------------------------------------------------------------------------------
26
27
\usepackage{geometry} % Required for adjusting page dimensions
28
29
\geometry{
30
top=1cm, % Top margin
31
bottom=1.5cm, % Bottom margin
32
left=2cm, % Left margin
33
right=2cm, % Right margin
34
includehead, % Include space for a header
35
includefoot, % Include space for a footer
36
%showframe, % Uncomment to show how the type block is set on the page
37
}
38
39
\setlength{\columnsep}{7mm} % Column separation width
40
41
%----------------------------------------------------------------------------------------
42
% FONTS
43
%----------------------------------------------------------------------------------------
44
45
\usepackage[T1]{fontenc} % Output font encoding for international characters
46
\usepackage[utf8]{inputenc} % Required for inputting international characters
47
48
\usepackage{XCharter} % Use the XCharter font
49
50
%----------------------------------------------------------------------------------------
51
% HEADERS AND FOOTERS
52
%----------------------------------------------------------------------------------------
53
54
\usepackage{fancyhdr} % Needed to define custom headers/footers
55
\pagestyle{fancy} % Enables the custom headers/footers
56
57
\renewcommand{\headrulewidth}{0.0pt} % No header rule
58
\renewcommand{\footrulewidth}{0.4pt} % Thin footer rule
59
60
\renewcommand{\sectionmark}[1]{\markboth{#1}{}} % Removes the section number from the header when \leftmark is used
61
62
%\nouppercase\leftmark % Add this to one of the lines below if you want a section title in the header/footer
63
64
% Headers
65
\lhead{} % Left header
66
\chead{\textit{\thetitle}} % Center header - currently printing the article title
67
\rhead{} % Right header
68
69
% Footers
70
\lfoot{} % Left footer
71
\cfoot{} % Center footer
72
\rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}} % Right footer, "Page 1 of 2"
73
74
\fancypagestyle{firstpage}{ % Page style for the first page with the title
75
\fancyhf{}
76
\renewcommand{\footrulewidth}{0pt} % Suppress footer rule
77
}
78
79
%----------------------------------------------------------------------------------------
80
% TITLE SECTION
81
%----------------------------------------------------------------------------------------
82
83
\newcommand{\authorstyle}[1]{{\large\usefont{OT1}{phv}{b}{n}\color{DarkBlue}#1}} % Authors style (Helvetica)
84
85
\newcommand{\institution}[1]{{\footnotesize\usefont{OT1}{phv}{m}{sl}\color{Black}#1}} % Institutions style (Helvetica)
86
87
\usepackage{titling} % Allows custom title configuration
88
89
\newcommand{\HorRule}{\color{DarkGoldenrod}\rule{\linewidth}{1pt}} % Defines the gold horizontal rule around the title
90
91
\pretitle{
92
\raggedright
93
\vspace{15pt} % Move the entire title section up
94
95
\HorRule
96
97
\vspace{40pt} % Horizontal rule before the title
98
\fontsize{47}{47}\usefont{OT1}{phv}{b}{n}\selectfont % Helvetica
99
\color{DarkBlue} % Text colour for the title and author(s)
100
}
101
102
\posttitle{\par\vskip 40pt} % Whitespace under the title
103
104
\preauthor{} % Anything that will appear before \author is printed
105
106
\postauthor{ % Anything that will appear after \author is printed
107
\vspace{40pt} % Space before the rule
108
109
\par\HorRule % Horizontal rule after the title
110
\vspace{15pt} % Space after the title section
111
}
112
113
%----------------------------------------------------------------------------------------
114
% ABSTRACT
115
%----------------------------------------------------------------------------------------
116
117
\usepackage{lettrine} % Package to accentuate the first letter of the text (lettrine)
118
\usepackage{fix-cm} % Fixes the height of the lettrine
119
120
\newcommand{\initial}[1]{ % Defines the command and style for the lettrine
121
\lettrine[lines=3,findent=4pt,nindent=0pt]{% Lettrine takes up 3 lines, the text to the
122
\begin{verbatim}
123
124
\end{verbatim}
125
right of it is indented 4pt and further indenting of lines 2+ is stopped
126
\color{DarkGoldenrod}% Lettrine colour
127
{#1}% The letter
128
}{}%
129
}
130
131
\usepackage{xstring} % Required for string manipulation
132
133
\newcommand{\lettrineabstract}[1]{
134
\StrLeft{#1}{1}[\firstletter] % Capture the first letter of the abstract for the lettrine
135
\initial{\firstletter}\textbf{\StrGobbleLeft{#1}{1}} % Print the abstract with the first letter as a lettrine and the rest in bold
136
}
137
138
%----------------------------------------------------------------------------------------
139
% BIBLIOGRAPHY
140
%----------------------------------------------------------------------------------------
141
142
\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA)
143
144
\addbibresource{example.bib} % The filename of the bibliography
145
146
\usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography
147
148
149
150
151
152
153
154
155
\usepackage{amssymb}
156
157
158
159
160
161
162
163
164
165
166
167
168
169