-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariantex.sty
More file actions
411 lines (364 loc) · 13.8 KB
/
variantex.sty
File metadata and controls
411 lines (364 loc) · 13.8 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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
%%%% CLASS OPTIONS
\KOMAoptions{
fontsize=10pt, % set default font size
DIV=calc,
titlepage=false,
paper=150mm:220mm,
twoside=true,
twocolumn=false,
toc=chapterentryfill, % for dots: chapterentrydotfill
parskip=false, % space between paragraphs. "full" gives more space; "false" uses indentation instead
headings=small,
bibliography=leveldown, % turns the Bibliography into a \section rather than a \chapter (so it appears on the same page)
}
%%%% PAGE SIZE
\usepackage[
top=23mm,
left=20mm,
height=173mm,
width=109mm,
head=21.0pt,
]{geometry}
\setlength{\marginparwidth}{1.25cm} % sets up acceptable margin for \todonotes package (see preamble/packages.tex).
%%%% PACKAGES
\usepackage[dvipsnames]{xcolor}
\usepackage[unicode]{hyperref} % hyperlinks
\usepackage{booktabs} % professional-quality tables
\usepackage{nicefrac} % compact symbols for 1/2, etc.
%\usepackage{microtype} % microtypography
\usepackage{lipsum} % lorem ipsum at the ready
\usepackage{graphicx} % for figures
\usepackage{footmisc} % makes symbol footnotes possible
\usepackage{ragged2e}
\usepackage{changepage} % detect odd/even pages
\usepackage{array}
\usepackage{float} % get figures etc. to stay where they are with [H]
\usepackage{subcaption} % replaces deprecated `subfigure` package
\usepackage{longtable} % allows for tables that stretch over multiple pages
\setlength{\marginparwidth}{2cm}
\usepackage[textsize=footnotesize]{todonotes} % enables \todo's for editors
\usepackage{etoolbox} % supplies commands like \AtBeginEnvironment and \atEndEnvironment
\usepackage{ifdraft} % switches on proofreading options in the draft mode
\usepackage{rotating} % provides sidewaysfigure environment
\usepackage{media9} % allows for video in the pdf
\usepackage{xurl} % allows URLs to (line)break ANYWHERE
\usepackage{multicol} % allows for multiple columns
\usepackage{tikz} % allows for the 'graphics' on the cover page
\usepackage{scrlayer-scrpage} % allows for the header/footers
%%%% ENCODING
\usepackage[full]{textcomp} % allows \textrightarrow etc.
% LANGUAGES
\usepackage{fontspec}
\setmainfont{Liberation Serif}[Ligatures=TeX]
\newfontfamily\cyrillicfont{Liberation Serif}[Script=Cyrillic,Ligatures=TeX]
\usepackage{polyglossia}
\setmainlanguage{english} % Continue using english for rest of the document
\setotherlanguages{italian, russian}
% If necessary, the following lets you use \texthindi. Note, however, that BibLaTeX does not support it and will report a 'warning'.
%\setotherlanguages{hindi}
%\newfontfamily\hindifont{Noto Sans Devanagari}[Script=Devanagari]
% biblatex
\usepackage[
authordate,
backend=biber,
natbib=true,
]{biblatex-chicago}
\usepackage{csquotes}
% special characters
\usepackage{textalpha} % allows for greek characters in text
%%%% FONTS
\usepackage{scalefnt} % allows more font sizes through scaling
% Palatino font options
\usepackage{unicode-math}
\setmainfont{TeX Gyre Pagella}
\let\circ\undefined
\let\diamond\undefined
\let\bullet\undefined
\let\emptyset\undefined
\let\owns\undefined
\setmathfont{TeX Gyre Pagella Math}
\let\ocirc\undefined
\let\widecheck\undefined
\addtokomafont{disposition}{\rmfamily} % Palatino for titles etc.
\setkomafont{descriptionlabel}{ % font for description lists
\usekomafont{captionlabel}\bfseries % Palatino bold
}
\setkomafont{caption}{\footnotesize} % smaller font size for captions
\usepackage{mathabx} % allows for nicer looking \cup, \curvearrowbotright, etc. !!IMPORTANT!! These are math symbols and should be surrounded by $dollar signs$
\usepackage[normalem]{ulem} % allows for strikethrough with \sout etc.
\usepackage{anyfontsize} % fixes font scaling issue
%%%% ToC
% No (sub)sections in TOC
\setcounter{tocdepth}{0}
% a bit more space between titles and page numbers in TOC
\makeatletter
\renewcommand\@pnumwidth{2.5em}
\makeatother
%%%% CONTRIBUTOR
% Title and Author of individual contributions
\makeatletter
% paper/review author = contributor
\newcommand\contributor[1]{\renewcommand\@contributor{#1}}
\newcommand\@contributor{}
\newcommand\thecontributor{\@contributor}
% paper/review title = contribution
\newcommand\contribution[1]{\renewcommand\@contribution{#1}}
\newcommand\@contribution{}
\newcommand\thecontribution{\@contribution}
% short contributor for running header
\newcommand\shortcontributor[1]{\renewcommand\@shortcontributor{#1}}
\newcommand\@shortcontributor{}
\newcommand\theshortcontributor{\@shortcontributor}
% short title for running header
\newcommand\shortcontribution[1]{\renewcommand\@shortcontribution{#1}}
\newcommand\@shortcontribution{}
\newcommand\theshortcontribution{\@shortcontribution}
% define contribution type
\newcommand\contributiontype[1]{\renewcommand\@contributiontype{#1}}
\newcommand\@contributiontype{}
\newcommand\thecontributiontype{\@contributiontype}
\makeatother
%%%% COPYRIGHT
% choose copyright license
\usepackage[
type={CC},
modifier={by},
version={4.0},
]{doclicense}
% define \copyrightstatement for ease of use
\newcommand{\copyrightstatement}{
\doclicenseLongText \\ % includes a link
\doclicenseIcon \ \theyear \ \theshortcontributor
}
%%%% ENVIRONMENTS
% Environments
\AtBeginEnvironment{quote}{\footnotesize\vskip 1em}
\AtEndEnvironment{quote}{\vskip 1em}
\setkomafont{caption}{\footnotesize}
% Preface
\newenvironment{preface}{
\newrefsection
\phantomsection
\cleardoublepage
\addcontentsline{toc}{part}{\theshortcontribution}
% enable running title
\pagestyle{preface}
% \chapter*{Editors' Preface}
% reset the section counter for each paper
\setcounter{section}{0}
% no running title on first page, page number center bottom instead
\thispagestyle{plain.preface}
}{}
\AtEndEnvironment{preface}{%
% safeguard section numbering
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
%last page running header fix
\protect\thispagestyle{preface}
}
% Essays
\newenvironment{paper}{
\newrefsection
\phantomsection
% start every new paper on an uneven page
\cleardoublepage
% enable running title
\pagestyle{paper}
% change section numbering FROM [\chapter].[\section].[\subsection] TO [\section].[\subsection] ETC.
\renewcommand{\thesection}{\arabic{section}}
% add name and title to the toc
\addcontentsline{toc}{chapter}{\normalfont\textbf{\emph{\thecontributor}}: \thecontribution}
% mark the beginning of chapter add the title to the titlepage
\addchap*{\justifying{\Large\normalfont\thecontribution}}
% add the author names and contribution type
\begin{flushright}
\emph{\normalsize\thecontributor}\linebreak
\linebreak\emph{\footnotesize\thecontributiontype}
\end{flushright}
% reset the section counter for each paper
\setcounter{section}{0}
% reset the figure counter for each paper
\setcounter{figure}{0}
% reset the table counter for each paper
\setcounter{table}{0}
% reset the footnote counter for each paper
\setcounter{footnote}{0}
% no running title on first page, page number center bottom instead, include copyright statement
\thispagestyle{plain.paper}
}{}
\AtBeginEnvironment{paper}{
% keeps running title from the first page:
\renewcommand*{\pagemark}{}%
}
\AtEndEnvironment{paper}{
% safeguard section numbering
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
% last page running header fix
\protect\thispagestyle{paper}%
}
% Reviews
\newenvironment{review}{
\newrefsection
\phantomsection
% start every new paper on an uneven page
\cleardoublepage
% enable running title
\pagestyle{review}
% change section numbering FROM [\chapter].[\section].[\subsection] TO [\section].[\subsection] ETC.
\renewcommand{\thesection}{\arabic{section}}
% add name and title to the toc
\addcontentsline{toc}{chapter}{\normalfont\textbf{\emph{\thecontributor}}: \thecontribution}
% mark the beginning of chapter
\addchap*{}
% reset the section counter for each paper
\setcounter{section}{0}
% reset the figure counter for each paper
\setcounter{figure}{0}
% reset the table counter for each paper
\setcounter{table}{0}
% reset the footnote counter for each paper
\setcounter{footnote}{0}
% no running title on first page, page number center bottom instead, include copyright statement
\thispagestyle{plain.review}
}{}
\AtBeginEnvironment{review}{
% keeps running title from the first page
\renewcommand*{\pagemark}{}%
}
\AtEndEnvironment{review}{
% author name(s)
\begin{flushright}\emph{\thecontributor}\end{flushright}
% safeguard section numbering
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
% last page running header fix
\protect\thispagestyle{review}
}
% Abstract
\newenvironment{abstract}{%
\setlength{\parindent}{0pt} \begin{adjustwidth}{2em}{2em}\footnotesize\emph{\abstractname}: }{%
\vskip 1em\end{adjustwidth}
}{}
% Keywords
\newenvironment{keywords}{
\setlength{\parindent}{0pt} \begin{adjustwidth}{2em}{2em}\footnotesize\emph{Keywords}: }{%
\vskip 1em\end{adjustwidth}
}{}
% Review Abstract
\newenvironment{reviewed}{%
\setlength{\parindent}{0pt}
\begin{adjustwidth}{2em}{2em}\footnotesize}{%
\vskip 1em\end{adjustwidth}
}{}
% Motto
\newenvironment{motto}{%
\setlength{\parindent}{0pt} \small\raggedleft}{%
\vskip 2em
}{}
% Example
\newcounter{example}[chapter]
\newenvironment{example}[1][]{\refstepcounter{example}\begin{quote} \rmfamily}{\begin{flushright}(Example~\theexample)\end{flushright}\end{quote}}
%%%% SECTIONOPTIONS
% command for centering section headings
\newcommand{\centerheading}[1]{
\hspace*{\fill}#1\hspace*{\fill}
}
% Remove "Part #." from \part titles
% KOMA default: \newcommand*{\partformat}{\partname~\thepart\autodot}
\renewcommand*{\partformat}{}
% No dots after figure or table numbers
\renewcommand*{\figureformat}{\figurename~\thefigure}
\renewcommand*{\tableformat}{\tablename~\thetable}
% paragraph handling
\setparsizes%
{1em}% indent
{0pt}% maximum space between paragraphs
{0pt plus 1fil}% last line not justified
% In the "Authors" section, author names are put in the \paragraph{} headings. To reduce the space after these headings, the default {-1em} has been changed to {-.4em} below.
\makeatletter
\renewcommand\paragraph{\@startsection {paragraph}{4}{\z@ }{3.25ex \@plus 1ex \@minus .2ex}{-.4em}{\normalfont \normalsize \bfseries }
}
\makeatother
% add the following (uncommented) in environments where you want to count paragraph numbers in the margin
% \renewcommand*{\paragraphformat}{%
% \makebox[-4pt][r]{\footnotesize\theparagraph\autodot\enskip}
% }
% \renewcommand{\theparagraph}{\arabic{paragraph}}
% \setcounter{paragraph}{0}
% \setcounter{secnumdepth}{4}
%%%% HEADERFOOTER
% Undo default slant in the header of footer areas
\renewcommand{\headfont}{\itshape}
% style for papers/essays
\defpairofpagestyles{paper}{
\lohead[]{\small\emph{\theshortcontributor} \hspace*{.5em} \theshortcontribution}
\rehead[]{\textsc{\small\theissue}}
\lehead[]{\small\thepage}
\rohead[]{\small\thepage}
\chead[\scriptsize\centering\copyrightstatement]{}
\cfoot[\small\thepage]{}
}
% style for book reviews
\defpairofpagestyles{review}{
\lohead[]{\small\textit{Reviews}}
\lehead[]{\small\thepage}
\rehead[]{\textsc{\small\theissue}}
\rohead[]{\small\thepage}
\chead[\scriptsize\centering\copyrightstatement]{}
\cfoot[\small\thepage]{}
}
% style for prefaces
\defpairofpagestyles{preface}{
\lohead[]{\small\textit{Editors' Preface}}
\lehead[]{\small\thepage}
\rehead[]{\textsc{\small\theissue}}
\rohead[]{\small\thepage}
\rohead[]{\small\thepage}
\chead[\scriptsize\centering\copyrightstatement]{}
}
% style for authors pages
\defpairofpagestyles{authors}{
\lohead[]{\small\textit{Authors}}
\lehead[]{\small\thepage}
\rehead[]{\textsc{\small\theissue}}
\rohead[]{\small\thepage}
\cfoot[\small\thepage]{}
}
% no page numbers on \part pages
\renewcommand*{\partpagestyle}{empty}
%%%% FOOTNOTEFORMAT
% footnotes
\renewcommand{\footnoterule}{%
\kern .5em % call this kerna
\hrule height 0.4pt width .2\columnwidth % the .2 value made the footnote ruler (horizontal line) smaller (was at .4)
\kern .5em % call this kernb
}
\usepackage{footmisc}
\renewcommand{\footnotelayout}{
\hspace{1.5em} % space between footnote mark and footnote text
}
\newcommand{\mytodo}[1]{\textcolor{red}{#1}}
%%%% CODESNIPPETS
% colours for code notations
\usepackage{listings}
\renewcommand\lstlistingname{Quelltext}
\lstset{ % basic formatting (bash etc.)
basicstyle=\ttfamily,
showstringspaces=false,
commentstyle=\color{BrickRed},
keywordstyle=\color{RoyalBlue}
}
\lstdefinelanguage{XML}{ % specific XML formatting overrides
basicstyle=\ttfamily,
morestring=[s]{"}{"},
morecomment=[s]{?}{?},
morecomment=[s]{!--}{--},
commentstyle=\color{OliveGreen},
moredelim=[s][\color{Black}]{>}{<},
moredelim=[s][\color{RawSienna}]{\ }{=},
stringstyle=\color{RoyalBlue},
identifierstyle=\color{Plum}
}
% HOW TO USE? BASH EXAMPLE
% \begin{lstlisting}[language=bash]
% #some comment
% cd Documents
% \end{lstlisting}