aboutsummaryrefslogtreecommitdiff
path: root/dissertation.cls
blob: 74cd49b3d2f1275054baf500c6c4b0f07e2ed3a9 (plain)
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
% https://grad.wisc.edu/currentstudents/doctoralguide/

\ProvidesClass{dissertation}

% --- basic ---------------------------------------------------------------------------------------

% required: 10 to 12 point font

\LoadClass[11pt, twoside, openright]{report}
\RequirePackage[letterpaper, margin=1in]{geometry}  % 1 inch margins required
\RequirePackage{setspace}
\RequirePackage{afterpage}
\RequirePackage{color}
\RequirePackage{array} 

% --- headers -------------------------------------------------------------------------------------

% required: page number in upper right, nothing else

\RequirePackage{fancyhdr}
\fancypagestyle{plain}{
	\fancyhf{}
	\fancyhead[R]{\thepage}
	\fancyfoot{}
	\renewcommand{\headrulewidth}{0pt}
	\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{plain}{\rhead{\thepage}}

% --- text ----------------------------------------------------------------------------------------

% text
\RequirePackage[utf8]{inputenc}
\setlength\parindent{0pt}
\setlength{\parskip}{1em}
\renewcommand{\familydefault}{\sfdefault}

\newcommand{\RomanNumeral}[1]{\textrm{\uppercase\expandafter{\romannumeral #1\relax}}}
\RequirePackage{etoolbox}
\AtBeginEnvironment{verse}{\singlespacing}

\newenvironment{dquote}
  {
  \singlespacing
  \it
  }
  {
  }

\newcommand{\dsignature}[1]{\hfill \normalfont{-- #1}}
  
% THE FOLLOWING IS DARK MAGIC THAT I DON'T UNDERSTAND
% I'M SURE I COULD DO BETTER...
% - Blaise 2018-03-06
\RequirePackage[shortlabels]{enumitem}
\setlist[enumerate, 1]{nosep}
\setlist[enumerate, 2]{nosep, topsep=-5ex}
\setlist[enumerate, 3]{nosep, topsep=-5ex}
\setlist[enumerate, 4]{nosep, topsep=-5ex}
\newenvironment{denumerate}
  {
  \begin{enumerate}
  \singlespacing  
  }
  {
  \end{enumerate}
  }

\newenvironment{ditemize}
  {
  \begin{enumerate}
  \singlespacing  
  }
  {
  \end{enumerate}
  }  

% --- code environment ----------------------------------------------------------------------------

\RequirePackage{etoolbox}
\RequirePackage[chapter]{minted}
\usemintedstyle{colorfuli}
\BeforeBeginEnvironment{minted}{\begin{singlespace}}
\AfterEndEnvironment{minted}{\end{singlespace}}
\setminted[python]{linenos=false, frame=lines}

% --- tables --------------------------------------------------------------------------------------

\newenvironment{dtable}
  {
  \clearpage
  \begin{table}
  \centering
  }
  {
  \end{table}
  \clearpage
  }

% --- graphics ------------------------------------------------------------------------------------

\RequirePackage{graphics}
\RequirePackage{graphicx}
\RequirePackage{epsfig}
\RequirePackage{epstopdf}
\RequirePackage{etoc}
\RequirePackage{tikz}

\newenvironment{dfigure}
  {
  \clearpage
  \begin{figure}
  \centering
  }
  {
  \end{figure}
  \clearpage}

% --- math ----------------------------------------------------------------------------------------

\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage[cm]{sfmath}
\RequirePackage{bm} % bold mathtype
\DeclareMathOperator{\me}{e}

% --- misc / ? ------------------------------------------------------------------------------------

\RequirePackage[nottoc]{tocbibind}
\RequirePackage{fixltx2e}
\RequirePackage{pdfpages}
\RequirePackage[utf8]{inputenc}

% --- hyperref ------------------------------------------------------------------------------------

\RequirePackage[colorlinks=true, linkcolor=black, urlcolor=blue, citecolor=black,
anchorcolor=black]{hyperref}
\RequirePackage[all]{hypcap}  % helps hyperref work properly

% --- bibliography --------------------------------------------------------------------------------

\RequirePackage[backend=biber, natbib=true, sorting=none, maxbibnames=99, isbn=false]{biblatex}
\bibliography{bibliography}

% --- glossary ------------------------------------------------------------------------------------

\RequirePackage[acronym, nopostdot, nogroupskip]{glossaries}
\newcommand{\comma}{,\penalty \exhyphenpenalty}
\newlength\glsnamewidth
\setlength{\glsnamewidth}{0.3\hsize}
\setlength{\glsdescwidth}{1\hsize}
\newglossarystyle{myglossarystyle}{
	\setglossarystyle{super}
	\renewenvironment{theglossary}{
		\tablehead{}
		\tabletail{}
		\begin{supertabular}{p{\glsnamewidth}p{\glsdescwidth}}}{\end{supertabular}}
	\renewcommand{\glossentry}[2]{
		\raggedleft
		\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
		\glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline}}
\renewcommand{\arraystretch}{1}
\setglossarystyle{myglossarystyle}
\newglossary[slg]{symbolslist}{syi}{syg}{Symbols}
\makeglossaries
\include{glossary}

\RequirePackage{tocloft}
 
\setlength\cftparskip{0pt}
\setlength\cftbeforechapskip{-5pt}
\setlength\cftbeforesecskip{-7pt}
\setlength\cftbeforesubsecskip{-10pt}