1 | % A document class built from the uw-ethesis template, 2017-06-14 version. |
---|
2 | % This link should get to the regulations: |
---|
3 | % https://uwaterloo.ca/graduate-studies/thesis. |
---|
4 | % |
---|
5 | % WIP I am still moving things out of the provided template. |
---|
6 | % |
---|
7 | % This is approximately (check regulations to be sure) the required set up for |
---|
8 | % a thesis at UW. It also adds some other pieces that are likely to be useful. |
---|
9 | % |
---|
10 | % There are several formats you may choose from. These adjust the settings so |
---|
11 | % the document comes out a little better for different uses. "digital" is for |
---|
12 | % pdf documents that will remain on a computer while "print" is for printing |
---|
13 | % paper copies. |
---|
14 | % |
---|
15 | % Options: |
---|
16 | % <format> |
---|
17 | % All the formats are options, sets the document's format to that format. |
---|
18 | % If no format is given digital is the default. |
---|
19 | % |
---|
20 | % Exported Names: |
---|
21 | % \ifformat{<format>}{<true>}{<false>} |
---|
22 | % If the document's format is <format> than expands to <true> otherwise |
---|
23 | % expands to <false>. |
---|
24 | % |
---|
25 | % \usehyperrefpackage[<options>]{<setup>} |
---|
26 | % Loads the hyperref package with <options> and preforms set up. The |
---|
27 | % initial setup depends on the document format but they can be overriden |
---|
28 | % with options in <setup> (set hyperref's \hypersetup for details). |
---|
29 | \NeedsTeXFormat{LaTeX2e} |
---|
30 | \ProvidesClass{uw-ethesis}[2020/03/24 v0.1 UW-eThesis Template Document Class] |
---|
31 | |
---|
32 | \RequirePackage{etoolbox} |
---|
33 | |
---|
34 | % Requested Format: |
---|
35 | \newrobustcmd*{\ethesis@format}{digital} |
---|
36 | \DeclareOption{print}{\renewrobustcmd*{\ethesis@format}{print}} |
---|
37 | \DeclareOption{digital}{\renewrobustcmd*{\ethesis@format}{digital}} |
---|
38 | |
---|
39 | \ProcessOptions\relax |
---|
40 | |
---|
41 | \newcommand\ifformat[3]{\ifdefstring{\ethesis@format}{#1}{#2}{#3}} |
---|
42 | |
---|
43 | \ifformat{print}{% |
---|
44 | \LoadClass[letterpaper,12pt,titlepage,openright,twoside,final]{book}% |
---|
45 | }{% |
---|
46 | \LoadClass[letterpaper,12pt,titlepage,twoside,final]{book}% |
---|
47 | } |
---|
48 | |
---|
49 | % Setting up the page margins. These are the minimum margins in the uWaterloo |
---|
50 | % thesis requirements. 1in (72pt) on the top, bottom and outside and |
---|
51 | % 1 1/8in (81pt) on the inside/gutter/binding side. Only required for |
---|
52 | % printing but here set for all formats. |
---|
53 | |
---|
54 | % If margin notes are used, you must adjust \textwidth, \marginparwidth and |
---|
55 | % \marginparsep so space between the margin notes and page edge is less than |
---|
56 | % 15mm (0.6in). I don't actually understand that instruction. |
---|
57 | |
---|
58 | \setlength{\marginparwidth}{0pt} |
---|
59 | |
---|
60 | % Width of space between body text and margin notes. |
---|
61 | \setlength{\marginparsep}{0pt} |
---|
62 | |
---|
63 | % Set width of margin on binding side. With oneside all pages are odd. |
---|
64 | \setlength{\evensidemargin}{0.125in} |
---|
65 | \setlength{\oddsidemargin}{0.125in} |
---|
66 | |
---|
67 | % Assuming US letter paper (8.5 in. x 11 in.) and side margins as above. |
---|
68 | \setlength{\textwidth}{6.375in} |
---|
69 | \raggedbottom |
---|
70 | |
---|
71 | % The following statement specifies the amount of space between paragraphs. |
---|
72 | % Other reasonable specifications are \bigskipamount and \smallskipamount. |
---|
73 | \setlength{\parskip}{\medskipamount} |
---|
74 | |
---|
75 | % The following statement controls the line spacing. You should not change |
---|
76 | % this value significantly (e.g. perhaps "1.2"). |
---|
77 | \renewcommand{\baselinestretch}{1} |
---|
78 | |
---|
79 | % Normally every chapter will start on a recto (right-hand side) page. This |
---|
80 | % command is used to make sure the each section of the front pages starts on |
---|
81 | % a recto page. This will often require an empty verso (left-hand side) page |
---|
82 | % that should not have the page number printed on it. |
---|
83 | \let\origdoublepage\cleardoublepage |
---|
84 | \newcommand{\clearemptydoublepage}{% |
---|
85 | \clearpage{\pagestyle{empty}\origdoublepage}} |
---|
86 | \let\cleardoublepage\clearemptydoublepage |
---|
87 | |
---|
88 | % Change the default name of the bibliography. |
---|
89 | \renewcommand*{\bibname}{References} |
---|
90 | |
---|
91 | % Configurations |
---|
92 | \def\setThesisTitle#1{\newrobustcmd*{\ethesis@title}{#1}} |
---|
93 | \def\setThesisAuthor#1{\newrobustcmd*{\ethesis@author}{#1}} |
---|
94 | \def\setThesisSubject#1{\newrobustcmd*{\ethesis@subject}{#1}} |
---|
95 | \def\setThesisKeywords#1{\newrobustcmd*{\ethesis@keywords}{#1}} |
---|
96 | |
---|
97 | % Includes the hyperref package loading a number of defaults. |
---|
98 | \newrobustcmd*{\usehyperrefpackage}[2][]{% |
---|
99 | \usepackage[#1]{hyperref} |
---|
100 | \hypersetup{ |
---|
101 | plainpages=false, % Needed for Roman numbers in frontpages. |
---|
102 | unicode=false, % Non-Latin characters in Acrobat ^ ^ s bookmarks. |
---|
103 | pdftoolbar=true, % Show Acrobat ^ ^ s toolbar? |
---|
104 | pdfmenubar=true, % Show Acrobat ^ ^ s menu? |
---|
105 | pdffitwindow=false, % Window is not fit to page when opened. |
---|
106 | pdfstartview={FitH}, % Fits the width of the page to the window. |
---|
107 | } |
---|
108 | \ifdef{\ethesis@title}{\hypersetup{pdftitle={\ethesis@title}}}{} |
---|
109 | \ifdef{\ethesis@author}{\hypersetup{pdfauthor={\ethesis@author}}}{} |
---|
110 | \ifdef{\ethesis@subject}{\hypersetup{pdfsubject={\ethesis@subject}}}{} |
---|
111 | \ifdef{\ethesis@keywords}{\hypersetup{pdfkeywords={\ethesis@keywords}}}{} |
---|
112 | \ifformat{print}{ |
---|
113 | \hypersetup{ |
---|
114 | %colorlinks=false, |
---|
115 | colorlinks=true, % I think there is a style difference here. |
---|
116 | citecolor=black, |
---|
117 | filecolor=black, |
---|
118 | linkcolor=black, |
---|
119 | urlcolor=black |
---|
120 | } |
---|
121 | }{ |
---|
122 | \hypersetup{ |
---|
123 | colorlinks=true, % false: boxed links; true: colored links |
---|
124 | linkcolor=blue, % colour of internal links |
---|
125 | citecolor=green, % colour of links to bibliography |
---|
126 | filecolor=magenta, % colour of file links |
---|
127 | urlcolor=cyan % colour of external links |
---|
128 | } |
---|
129 | } |
---|
130 | \notblank{#2}{\hypersetup{#2}}{} |
---|
131 | } |
---|
132 | |
---|
133 | % Includes the glossaries-extra package and sets up some helpers. |
---|
134 | % Except right now I don't really have any helpers to add. |
---|
135 | %\newrobustcmd*{\useglossariesextrapackage}[2][]{% |
---|
136 | % \usepackage[#1]{glossaries-extra} |
---|
137 | %} |
---|
138 | |
---|
139 | \let\colour=\color |
---|