-
Notifications
You must be signed in to change notification settings - Fork 4
/
SSEthesisLayout.sty
247 lines (211 loc) · 8.56 KB
/
SSEthesisLayout.sty
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
%%%% file SSE_thesis.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{SSEThesisLayout}[2018/02/14 v0.01 SSE Thesis]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Paper size
% With trims (extra 3 mm on each size)
% \setstocksize{248mm}{171mm}
% \settrimmedsize{242mm}{165mm}{*}
% \settrims{3mm}{3mm} % {top}{foredge}
% Without trims
\setstocksize{242mm}{165mm}
\settrimmedsize{242mm}{165mm}{*}
\settrims{0pt}{0pt}
\setlrmarginsandblock{20mm}{17.5mm}{*} % left right margins
\setulmarginsandblock{24mm}{27mm}{*} % top bottom margins
\setheadfoot{\onelineskip}{2\onelineskip} % {headheight}{footskip}
\setheaderspaces{15mm}{*}{*} % {headdrop}{headsep}{ratio}
%%%%%%%%%%%%%%%%%%
% Spacing
% Paragraph Indent
\setlength{\parindent}{2em} % indentation for new paragraphs
% Line spacing
\setSingleSpace{1.1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Dealing with widows and orphans
\clubpenalty=9996
\widowpenalty=9999
\brokenpenalty=4991
\predisplaypenalty=10000
\postdisplaypenalty=1549
\displaywidowpenalty=1602
%%%%%%%%%%%%%%%%
% PAGE Breaking
%\flushbottom % to stretch vboxes to cover full page
% (but won't always work when we have figures)
% Instead we can use the following:
\raggedbottom % allow textheight to vary somewhat between pages
\feetatbottom % to ensure footnotes are still at bottom with \raggedbottom
% Allowing the bottom to extend to avoid widows/orphans (WARNING, uneven lower margin)
%\setlength{\topskip}{1.6\topskip}
%\checkandfixthelayout
%\sloppybottom
% Since we use raggedbottom we can use fixed, it just sets textheight to the
\checkandfixthelayout[fixed] % use fixed to ensure margin sizes
% If we instead want to use flishbottom, we should probably set "lines" instead
%\checkandfixthelayout[lines]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Using Memoir Chapter styles instead
\makechapterstyle{ssethesis}{%
\renewcommand*{\chaptitlefont}{\sffamily\LARGE}
\renewcommand*{\chapnamefont}{\sffamily\huge}
\renewcommand*{\chapnumfont}{\chapnamefont}
\renewcommand*{\printchaptername}{\centering\chapnamefont \@chapapp}
\renewcommand*{\printchapternonum}{\centering\chapnamefont}
\setlength{\beforechapskip}{4\onelineskip}
\setlength{\midchapskip}{2\onelineskip}
\setlength{\afterchapskip}{2\onelineskip}
}
\chapterstyle{ssethesis}
\aliaspagestyle{chapter}{empty}
%%%%%%%%%%%%%%%%
% Abstracts
\renewcommand{\abstractnamefont}{\sffamily\large} %\small\normalfont\bfseries
\renewcommand{\abstracttextfont}{\vspace*{-2.5ex}\normalfont\normalsize\noindent\ignorespaces} %\small
\setlength{\absleftindent}{0pt}
\setlength{\absrightindent}{0pt}
\setlength{\absparindent}{0pt}
\setlength{\absparsep}{0pt}
\setlength{\abstitleskip}{0pt}
%%%%%%%%%%%%%%%%
% Section styles
% end section numbers with period
\setsecnumformat{\csname the#1\endcsname.\quad}
% negative ensures no indentation after
\setsecheadstyle{\sffamily\Large\raggedright}
\setbeforesecskip{-3.5ex plus -1ex minus -0.4ex}
\setaftersecskip{2ex plus 0.4ex}
\setsubsecheadstyle{\sffamily\large\raggedright}
\setbeforesubsecskip{-2.8ex plus -1ex minus -0.4ex}
\setaftersubsecskip{1.3ex plus 0.3ex}
\setsubsubsecheadstyle{\sffamily\normalsize\raggedright}
\setbeforesubsubsecskip{-2.8ex plus -1ex minus -0.4ex}
\setaftersubsubsecskip{1.3ex plus 0.3ex}
%%%%%%%%%%%%%%%%
% Float styles
\setfloatadjustment{figure}{\centering}
\setfloatadjustment{table}{\footnotesize\centering}
%%%%%%%%%%%%%%%%%
% Figure captions
% Alternative 1: Use roman fonts
% \captionstyle[\centering]{\raggedright} % [short caption]{long caption}
% \captiondelim{. }
% \captionnamefont{\footnotesize} %
% \captiontitlefont{\footnotesize} %
% Alt 2: Linebreak after centered figure name (doesn't work very well)
% \captionnamefont{\sffamily\normalsize\hfill}
% \captiondelim{\hfill\hfill}
% \captionstyle{\\\centerlastline}
% \captiontitlefont{\rmfamily\footnotesize}
% Alt 3: Use notes below tables and have short titles in SF font
\captionstyle[\centering]{\raggedright} % [short caption]{long caption}
\captiondelim{. }
\captionnamefont{\normalsize\sffamily} % \sffamily
\captiontitlefont{\normalsize\sffamily} % \sffamily
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PAGE STYLE: HEADERS AND FOOTERS
% see more here: https://tug.org/pracjourn/2008-2/madsen/madsen.pdf and memoir manual
\makepagestyle{ssethesis}
% Alternative 1: Serif font (as in Word template)
% \makeevenhead{ssethesis}{\small\lsstyle\MakeUppercase{\thepage}}{\small\lsstyle\MakeUppercase{\thetitle}}{}
% \makeoddhead{ssethesis}{}{\small\lsstyle\MakeUppercase{\leftmark}}{\small\MakeUppercase\lsstyle\thepage}
% Alternative 2: Sans-serif font
\makeevenhead{ssethesis}{\normalfont\lsstyle\sffamily\thepage}{\normalfont\lsstyle\sffamily\MakeUppercase{\thetitle}}{}
\makeoddhead{ssethesis}{}{\normalfont\lsstyle\sffamily\MakeUppercase{\leftmark}}{\normalfont\lsstyle\sffamily\thepage}
\makeevenfoot{ssethesis}{}{}{}
\makeoddfoot{ssethesis}{}{}{}
\makepsmarks{ssethesis}{%
\nouppercaseheads % use smallcaps instead of uppercase
\createmark {chapter} {left} {nonumber} {\@chapapp\ }{. \ }
\createmark {section} {right}{nonumber} {} {. \ }
\createplainmark {toc} {both} {\contentsname}
\createplainmark {lof} {both} {\listfigurename}
\createplainmark {lot} {both} {\listtablename}
\createplainmark {bib} {both} {\bibname}
\createplainmark {index} {both} {\indexname}
\createplainmark {glossary} {both} {\glossaryname}
}
\setsecnumdepth{subsection}
\pagestyle{ssethesis}
% TITLE PAGE
%\DeclareTextFontCommand{\texttitle}{\sffamily} % Create the font style for the title page.
% FOOT NOTES
% Footnote with no number
\newcommand\blindfootnote[1]{%
\begingroup
\renewcommand\thefootnote{}\footnote{#1}%
\addtocounter{footnote}{-1}%
\endgroup
}
% %%%%%%%%
% % Tables
% Siunitx table setup
\sisetup{
group-digits = integer, % group integers in groups of 3 (not decimals)
input-decimal-markers = {.},
table-number-alignment = center, % requires defining pre post spacing
input-open-uncertainty = {},
input-close-uncertainty = {},
table-align-text-pre = false,
table-align-text-post = false
}
\newsubfloat{figure} % creates figure environment for subfloats (memoir)
%%%%%%%%%%%%%%
% BIBLIOGRAPHY
\setlength{\bibitemsep}{0.5\baselineskip} % small space between items in bib
\DeclareFieldFormat[legislation]{citetitle}{{#1}} % no italics of title of legislation in text
\DeclareFieldFormat[thesis]{title}{\mkbibitalic{#1}}% italics thesis title in bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Links
%\definecolor{myblue}{RGB}{100,110,150}
\hypersetup{
%colorlinks=true,
%citecolor=myblue,
%filecolor=myblue,
%linkcolor=myblue,
%linkbordercolor=myblue,
%urlcolor=myblue,
hidelinks,
unicode=true,
pdfauthor={\theauthor},
pdftitle={\thetitle},
bookmarksnumbered=true,
bookmarksopen=true,
breaklinks=true
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Useful commands
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\newcommand{\ubar}[1]{\underaccent{\bar}{#1}}
\newcommand{\Var}[1]{\mathbb{V}\text{ar}\kern-.2em\left[{#1}\right]}
\newcommand{\Cov}[1]{\mathbb{C}\text{ov}\kern-.2em\left[{#1}\right]}
\newcommand{\E}[1]{\mathbb{E}\kern-.2em\left[{#1}\right]}
\newcommand{\Es}[2]{\mathbb{E}_{{#1}}\kern-.2em\left[{#2}\right]} % Exp operator w. subscript
\newcommand{\CVar}[2]{\mathbb{V}\text{ar}\kern-.2em\left[{#1}\middle\vert{#2}\right]}
\newcommand{\CCov}[2]{\mathbb{C}\text{ov}\kern-.2em\left[{#1}\middle\vert{#2}\right]}
\newcommand{\CE}[2]{\mathbb{E}\kern-.2em\left[{#1}\middle\vert{#2}\right]} % conditional expectations
\newcommand{\plim}{\mathrm{plim}}
%\newcommand{\Pr}[1]{\mathbb{P}\left({#1}\right)} % already defined
\newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}}
\def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}}
% To add a note below the figure use \figurenotes{}
\newcommand{\figurenotes}[1]{%
\captionstyle[\centering]{} % \raggedright
\captiontitlefont{\footnotesize\rmfamily}
\legend{Notes: #1}}
% Special bibliography with sloppy linebreaks, in toc etc
\newcommand{\SSEprintbibliography}[1]{%
\begingroup%
\hbadness=10000
\setlength{\emergencystretch}{10em}% amoung of sloppyness to allow
\printbibliography[heading=#1]%
\endgroup%
}
% Special new section heading that looks like a new unnumbered chapter but shows
% up as section in the TOC
\newcommand{\SSEfakechapter}[2]{%
\chapter*{#1~#2}%
\addcontentsline{toc}{section}{\numberline{#1}#2}
\refstepcounter{section}
}