-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathformatting.sty
More file actions
252 lines (189 loc) · 6.71 KB
/
formatting.sty
File metadata and controls
252 lines (189 loc) · 6.71 KB
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
\ProvidesPackage{formatting}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Required Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage[hmargin=2.5cm, vmargin=2.5cm]{geometry}
\usepackage{setspace}
\usepackage{tocloft}
\usepackage{datetime}
\usepackage{titlesec}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
\usepackage{hyperref}
% Ensures that quotes go 66 99
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% URL Formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\hypersetup{
colorlinks=true,
linkcolor=black,
filecolor=magenta,
urlcolor=blue,
}
\urlstyle{same}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Dates
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newdateformat{noDay}{\monthname, \THEYEAR}
\newdateformat{Letter}{\monthname \, \THEDAY, \THEYEAR}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% "University of Waterloo" must be bold
% "University of Waterloo" must be in all capital letters
% Faculty must be written out correctly in full (not a plan name)
% Report title must be bold (italics is acceptable)
% Employer’s name and location must be included
% Full name must be included
% ID number must be included
% All text must be centred
% All text must be single-spaced
% Images, colours or borders must not be included
% https://uwaterloo.ca/math/sites/ca.math/files/uploads/files/title-page.pdf
\newcommand{\FirstPage}{
\begin{titlepage}
\begin{center}
\vskip 50pt
\textbf{\scshape UNIVERSITY OF WATERLOO} \\
Faculty of Mathematics
\vskip 130pt
\textbf{\WTT}
\vskip 130pt
\compName \\
\compCity, \compProvince
\vskip 130pt
\name \\
\term \program \\
ID \studentNumber \\
\noDay\today
\end{center}
\end{titlepage}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Letter Head Formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Must contain sender’s address with full province (Ontario)
% Date must be in written out in full
% Date must be consistent with date on the Title Page
% Must include a Statement of Endorsement in the final paragraph
% Must be left justified
\newcommand{\LetterHead}{
\singlespacing
\pagestyle{empty}
\yourStreet\\
\yourCity, \yourProvince\\
\yourPostalCode\\
\Letter\today\\
\supervisorsName\\
\supervisorsRole\\
\compName\\
\compStreet\\
\compCity, \compProvince\\
\compPostalCode\\
Dear \supervisorsName,
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page Formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Spacing and Paragraphs
% Report body must be double-spaced
% Indentation and spacing between paragraphs must be consistent
% Headings and Section Numbers (H)
% Headings must be emphasized using bold, not italicized or underlined
% Headings must be consistent with Table of Contents
% Format (F)
% Fonts and Margins (M)
% Entire report must be written in 12pt font
% Ensure margins are consistent on all sides in all sections
% Page Numbers (PN)
% No page number appears on the Title Page, it is considered page “i”
% No page number appears on the Letter of Submittal, it is not considered a part of the report itself
% Table of Contents must have Roman numeral 'ii' centred at the bottom
% If included, List of Table and Figures must have Roman numeral 'iii' centred at the bottom
% Summary must have Roman numeral 'iv' (or 'iii' if no List of Tables and Figures included) centred at the bottom
% The page with the introduction must be numbered '1' and the others must follow in order
% Arabic numerals (1, 2, 3, etc.) must be right-aligned at the bottom
% Page numbers in report must match those in the Table of Contents
\newcommand{\pageFormatting}{
\doublespacing
\pagenumbering{roman}
\setcounter{page}{2}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\thepage}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[C]{\thepage}
}
% removes default line
\renewcommand{\headrulewidth}{0pt}
}
% No indentation
\setlength{\parindent}{0pt}
% Spacing between paragraphs
\setlength{\parskip}{1em}
\newcommand{\formattingForRestOfReport}{
\newpage
\pagenumbering{arabic}
\fancyhf{}
\fancyfoot[R]{\thepage}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Section Formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Numbering
\renewcommand*\thesection{ \normalsize \arabic{section}.0}
\renewcommand*\thesubsection{\normalsize \arabic{section}.\arabic{subsection} \ }
\renewcommand*\thesubsubsection{\normalsize \arabic{section}.\arabic{subsection}.\arabic{subsubsection} }
% Sections without Numbers
\newcommand{\sectionNoNumber}[1]{
\newpage
\phantomsection
\addcontentsline{toc}{section}{#1}
\section*{#1}
}
% Ensure that all headings are normalsize after getting penalized for this
\titleformat*{\section}{\normalsize\bfseries}
\titleformat*{\subsection}{\normalsize\bfseries}
\titleformat*{\subsubsection}{\normalsize\bfseries}
%https://tex.stackexchange.com/questions/53338/reducing-spacing-after-headings
\titlespacing\section{0pt}{0pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsection{0pt}{0pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsubsection{0pt}{0pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Table of Contents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% "Table of Contents" must be bold
% "Table of Contents" must be centred
% Must include decimal numbers before appropriate headings
% Major words in headings/subheadings must be capitalized
% Subheadings must be indented
% Page numbers must be right aligned
% Must contain tab leaders
% Must not include bold, italics, extras
% Command that gets called
\newcommand{\toc}{
\newpage
\pageFormatting
\tableofcontents
\listoffigures
}
% Commands about toc, lot, lof headings
\renewcommand{\cfttoctitlefont}{\hspace*{\fill}\Large\bfseries}
\renewcommand{\cftaftertoctitle}{\hspace*{\fill}}
\renewcommand{\cftlottitlefont}{\hspace*{\fill}\Large\bfseries}
\renewcommand{\cftafterlottitle}{\hspace*{\fill}}
\renewcommand{\cftloftitlefont}{\hspace*{\fill}\Large\bfseries}
\renewcommand{\cftafterloftitle}{\hspace*{\fill}}
% Indentation
\renewcommand*\l@subsubsection{\@dottedtocline{1}{6.2em}{3.2em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{3.1em}{3.2em}}
\renewcommand*\l@section{\@dottedtocline{1}{0em}{3.2em}}
% Ensure proper labeling
\renewcommand{\contentsname}{\normalsize Table of Contents}
\renewcommand{\listfigurename}{\normalsize List of Figures}