-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminim.cls
239 lines (191 loc) · 5.16 KB
/
minim.cls
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{minim}[2020 Minimal thesis class based on tufte]
%%
\LoadClass[oneside,
pagesize,
12pt,
DIV=10,
BCOR=0mm,
cleardoublepage=empty,
numbers=noenddot,
pagenumber=left,
titlepage,
toc=bibliography,
toc=listof,
toc=index]{scrartcl}
%%
% There can only be one main language
% Secondary languages can be added to setotherlanguages
\RequirePackage{polyglossia}
\setdefaultlanguage{spanish}
\setotherlanguages{english}
\RequirePackage{csquotes}% Better quotations
\RequirePackage{optparams}% Macros with optional parameters
%%
% Definitions of margins and geometry
\RequirePackage{geometry}
\geometry{
a4paper,
left=24.8mm,
top=27.4mm,
headsep=2\baselineskip, % Gap between body and header
textwidth=107mm,
marginparsep=8.2mm, % Gap between body and margin notes
marginparwidth=49.4mm, % Width of the margin notes
textheight=42\baselineskip, % Height of the body
headheight=\baselineskip, % Height of the header
}
\usepackage[automark]{scrlayer-scrpage}% Sets pagestyle scrheadings automatically
\clearpairofpagestyles% Remove the default page header and footer
% Remove page numbers on TOC, LOF and LOT
\AfterTOCHead{\thispagestyle{empty}}
\lofoot*{\pagemark}% Page number on the left part
\RequirePackage{ifpdf}
\RequirePackage{ifxetex}
\RequirePackage{ifluatex}
\newif\ifxetexorluatex
\ifxetex
\xetexorluatextrue
\else
\ifluatex
\xetexorluatextrue
\else
\xetexorluatexfalse
\fi
\fi
\ifxetexorluatex
\RequirePackage{fontspec}
\else
\RequirePackage[utf8]{inputenc}
\fi
%%
% Custom colors
\RequirePackage[usenames,dvipsnames]{xcolor}
\colorlet{accent}{Maroon}
\colorlet{highlight}{RedOrange}
\definecolor{bleu}{RGB}{12,127,172}
% Remove indentation
\setlength{\parindent}{0pt}
\RequirePackage[strict]{changepage} % Temporalely change page margins
\RequirePackage{sidenotes} % Notes and figures in the margin
%%
% Table related
\RequirePackage{array}
\RequirePackage{booktabs}
\RequirePackage{multirow}
%%
% List related
% \RequirePackage{enumitem}
%%
\RequirePackage{graphicx}
\graphicspath{%
{Figures/}
{Images/}
{./}
}
%%
% Glossaries, Acronyms and Index
\RequirePackage[%
acronym,
automake,
nogroupskip,
nopostdot,
toc,
]{glossaries}
\renewcommand{\glsnamefont}[1]{\normalfont{\color{accent}#1}} %Change acronym name font
\RequirePackage{makeidx}% Create index
%%
\RequirePackage{ragged2e}% For text justification
\RequirePackage{setspace}% 1.5 line spacing
\onehalfspacing
\RequirePackage{placeins}% For \FloatBarrier
\renewcommand{\raggedpart}{\flushleft}
%%
% For Headers and footers
% TODO: Edit header and footer with KOMA
%%
% Mathematical notation
\RequirePackage[binary-units=true]{siunitx}
\sisetup{%
detect-all = true,
detect-family = true,
detect-mode = true,
detect-shape = true,
detect-weight = true,
detect-inline-weight = math,
}
%%
% Hyperlinks
\usepackage[
colorlinks=true,
linkcolor=highlight,
urlcolor=highlight,
citecolor=bleu,
pdfusetitle]{hyperref}
%%
% Custom lengths
\newlength{\marginhang}
\newlength{\fullwidthtext}
% Set the length to their default value
\AtBeginDocument{
\setlength{\marginhang}{\marginparwidth}
\addtolength{\marginhang}{\marginparsep}
\setlength{\fullwidthtext}{\textwidth}
\addtolength{\fullwidthtext}{\marginparsep}
\addtolength{\fullwidthtext}{\marginparwidth}
\renewcommand*{\listtablename}{Índice de tablas}
\renewcommand*{\acronymname}{Lista de acrónimos}
}
\RequirePackage{etoolbox}
\BeforeBeginEnvironment{figure*}{%
\FloatBarrier%
}
%%
% Full width text area
\newenvironment{fullwidth}{%
\FloatBarrier% Make sure all floats are placed in the document
\begin{adjustwidth}{}{-\marginhang}
}
{\end{adjustwidth}}
%%
% Bibliography
\usepackage[backend=biber,
natbib=true,
style=ieee,
defernumbers=false,
sortcites]{biblatex}
\usepackage{xargs}
%%
% Custom formatting
\renewcommand\sectionformat{
\fontsize{40}{40}\selectfont\color{accent}\thesection\enskip
}
\renewcommand\subsectionformat{
\fontsize{20}{10}\selectfont\color{accent}\thesubsection\enskip
}
\renewcommand\subsubsectionformat{
\normalfont\color{accent}\thesubsubsection\enskip
}
\setkomafont{section}{\LARGE\normalfont\MakeUppercase}
\setkomafont{subsection}{\large\normalfont\MakeUppercase}
\setkomafont{subsubsection}{\normalfont\MakeUppercase}
\setkomafont{paragraph}{\color{accent}\normalfont\MakeUppercase}
\newcommand{\myparagraph}[1]{\paragraph{#1}\mbox{}\\}
\setkomafont{caption}{\small}
\setkomafont{captionlabel}{\normalfont\color{bleu}}
\setkomafont{sectionentry}{\large\normalfont\color{accent}}
\usepackage{caption}
\captionsetup[table]{name=Tabla}
\DeclareCaptionStyle{marginfigure}{labelfont={color=accent},font=footnotesize}
\DeclareCaptionStyle{margintable}{labelfont={color=accent},font=footnotesize}
\DeclareCaptionStyle{widefigure}{
labelfont={color=accent},
margin={0cm,\marginhang},
oneside
}
\DeclareCaptionStyle{sidecaption}{
labelfont={color=accent}
}
\DeclareCaptionStyle{sidefigure}{
font=large
}