forked from patriciobos/Plantilla-memoria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MastersDoctoralThesis.cls
475 lines (382 loc) · 16 KB
/
MastersDoctoralThesis.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
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
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Masters/Doctoral Thesis
% Class File
% Version 1.4 (25/3/16)
%
% This class has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Authors:
% Vel ([email protected])
% Johannes Böttcher
%
% Notes:
% 1) This class file defines the structure and layout of the template file (main.tex).
% 2) It has been written in such a way that under most circumstances you should not need
% to edit it. Updates would be harder. If you do make changes, please change the name of
% the file and add a comment to make your changes more visible.
%
% Class license:
% LPPL v1.3c (http://www.latex-project.org/lppl)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% CLASS DEFINITION AND PARAMETERS
%----------------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\newcommand{\classname}{MastersDoctoralThesis}
\ProvidesClass{\classname}[2016/03/25 v1.4 LaTeXTemplates.com]
\providecommand{\baseclass}{book}
\RequirePackage{etoolbox}
\RequirePackage{xparse}
\newbool{nolistspace}
\newbool{codirector}
%\booltrue{codirector}
\newbool{chapteroneline}
\newbool{listtoc}
\newbool{toctoc}
\newbool{parskip}
\newbool{headsepline}
\DeclareOption{codirector}{\booltrue{codirector}}
\DeclareOption{nolistspacing}{\booltrue{nolistspace}}
\DeclareOption{liststotoc}{\booltrue{listtoc}}
\DeclareOption{chapterinoneline}{\booltrue{chapteroneline}}
\DeclareOption{toctotoc}{\booltrue{toctoc}}
\DeclareOption{parskip}{\booltrue{parskip}}
\DeclareOption{headsepline}{\booltrue{headsepline}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\ProcessOptions\relax
\LoadClass{\baseclass}
%----------------------------------------------------------------------------------------
% CLASS OPTIONS
%----------------------------------------------------------------------------------------
\ifbool{parskip}{\RequirePackage{parskip}} % If the parskip option is passed to the class, require the parskip package
\newcommand{\abovechapterspace}{\vspace*{50pt}}
\patchcmd{\@makechapterhead}{\vspace*{50\p@}}{\abovechapterspace}{}{}
\patchcmd{\@makeschapterhead}{\vspace*{50\p@}}{\abovechapterspace}{}{}
\newcommand{\autodot}{}
\newcommand{\mdtChapapp}{}
\ifbool{chapteroneline}{%
\patchcmd{\@makechapterhead}{%
\if@mainmatter
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
}{%
\if@mainmatter
\Huge\bfseries \mdtChapapp\thechapter\autodot\enspace
\fi
}{}{}
}
\ifbool{listtoc}{% If the liststotoc option has been passed to the class, add the lists to the table of contents
\patchcmd{\listoftables}{\@starttoc{lot}}{%
\addchaptertocentry{\listtablename}\@starttoc{lot}}{}{}%
\patchcmd{\listoffigures}{\@starttoc{lof}}{%
\addchaptertocentry{\listfigurename}\@starttoc{lof}}{}{}%
}
\ifbool{toctoc}{% If the toctotoc options has been passed to the class, add the table of contents to the table of contents
\patchcmd{\tableofcontents}{\@starttoc{toc}}{%
\addchaptertocentry{\contentsname}\@starttoc{toc}}{}{}%
}
\patchcmd{\tableofcontents}{\MakeUppercase}{\MakeMarkcase}{}{}
\patchcmd{\tableofcontents}{\MakeUppercase}{\MakeMarkcase}{}{}
\patchcmd{\listoffigures}{\MakeUppercase}{\MakeMarkcase}{}{}
\patchcmd{\listoffigures}{\MakeUppercase}{\MakeMarkcase}{}{}
\patchcmd{\listoftables}{\MakeUppercase}{\MakeMarkcase}{}{}
\patchcmd{\listoftables}{\MakeUppercase}{\MakeMarkcase}{}{}
% If the option `nolistspacing' is given, the spacing in the different lists is reduced to single spacing. This option is only useful, if the spacing of the document has been changed to onehalfspacing or doublespacing.
\ifbool{nolistspace}{
\patchcmd{\listoffigures}{%
\@starttoc{lof}}{%
\begingroup%
\singlespace\@starttoc{lof}\endgroup%
}{}{}%
\patchcmd{\listoftables}{%
\@starttoc{lot}}{%
\begingroup%
\singlespace\@starttoc{lot}\endgroup%
}{}{}%
\patchcmd{\tableofcontents}{%
\@starttoc{toc}}{%
\begingroup%
\singlespace\@starttoc{toc}\endgroup%
}{}{}%
}{}
% Addchap provides unnumbered chapters with an entry in the table of contents as well as an updated header
\ProvideDocumentCommand{\addchap}{ s o m }{%
\chapter*{#3}%
\markboth{}{}%
\IfBooleanTF{#1}{%
}{%
\IfNoValueTF{#2}{%
\addchaptertocentry{#3}%
\markboth{\MakeMarkcase{#3}}{\MakeMarkcase{#3}}%
}{%
\addchaptertocentry{#2}%
\markboth{\MakeMarkcase{#2}}{\MakeMarkcase{#2}}%
}%
}%
}%
\ProvideDocumentCommand{\addsec}{ s o m }{%
\section*{#3}%
\markright{}%
\IfBooleanTF{#1}{%
}{%
\IfNoValueTF{#2}{%
\addcontentsline{toc}{section}{#3}%
\markright{\MakeMarkcase{#3}}%%
}{%
\addcontentsline{toc}{section}{#2}%
\markright{\MakeMarkcase{#2}}%
}%
}%
}%
%----------------------------------------------------------------------------------------
% DEFINE CUSTOM THESIS INFORMATION COMMANDS
%----------------------------------------------------------------------------------------
\def\authorname{}
\def\ttitle{}
\newcommand*{\director}[1]{\def\dirname{#1}}
\newcommand*{\codirector}[1]{\def\codirname{#1}}
\newcommand*{\thesistitle}[1]{\def\@title{#1}\def\ttitle{#1}}
\newcommand*{\examiner}[1]{\def\examname{#1}}
\newcommand*{\posgrado}[1]{\def\degreename{#1}}
\renewcommand*{\author}[1]{\def\authorname{#1}}
\newcommand*{\ciudad}[1]{\def\ciudadname{#1}}
\newcommand*{\addresses}[1]{\def\addressname{#1}}
\newcommand*{\university}[1]{\def\univname{#1}}
\newcommand*{\department}[1]{\def\deptname{#1}}
\newcommand*{\group}[1]{\def\groupname{#1}}
\newcommand*{\faculty}[1]{\def\facname{#1}}
\newcommand*{\subject}[1]{\def\subjectname{#1}}
\newcommand*{\keywords}[1]{\def\keywordnames{#1}}
%comandos para CESE
\newcommand*{\juradoUNO}[1]{\def\jurunoname{#1}}
\newcommand*{\juradoDOS}[1]{\def\jurdosname{#1}}
\newcommand*{\juradoTRES}[1]{\def\jurtresname{#1}}
\newcommand*{\fechaINICIO}[1]{\def\fechaINICIOname{#1}}
\newcommand*{\fechaFINAL}[1]{\def\fechaFINALname{#1}}
%----------------------------------------------------------------------------------------
% REQUIRED PACKAGES
%----------------------------------------------------------------------------------------
\RequirePackage{babel} % Required for automatically changing names of document elements to languages besides english
\RequirePackage{scrbase} % Required for handling language-dependent names of sections/document elements
\RequirePackage{scrhack} % Loads fixes for various packages
\RequirePackage{setspace} % Required for changing line spacing
\RequirePackage{longtable} % Required for tables that span multiple pages (used in the symbols, abbreviations and physical constants pages)
\RequirePackage{siunitx} % Required for \SI commands
\RequirePackage{graphicx} % Required to include images
\graphicspath{{Figures/}{./}} % Specifies where to look for included images
\RequirePackage{booktabs} % Required for better table rules
\RequirePackage{caption} % Required for customising the captions
\captionsetup{justification=centerlast,font=small,labelfont=sc,margin=50pt}
\RequirePackage{listings}
\RequirePackage[utf8]{inputenc} % Required for inputting international characters
\RequirePackage[T1]{fontenc} % Output font encoding for international characters
\RequirePackage{palatino} % Use the Palatino font by default
\RequirePackage[backend=bibtex,natbib=true, style=numeric, sorting=none]{biblatex} % Use the bibtex backend for bibliography
\RequirePackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography
\RequirePackage{xcolor}
\RequirePackage{subcaption}
\addbibresource{references.bib} % The filename of the bibliography
\urlstyle{same}
\hyphenation{biblatex}
\RequirePackage[
bookmarks=true, % show bookmarks bar?
unicode=false, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
colorlinks = true,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}]{hyperref}
%\def\@title{Memoria técnica de proyecto de Trabajo Final} %TODO ver si se puede agregar el campo con el nombre del autor acá
%TODO Revisar colores de los hipervinculos
\AtBeginDocument{
\addtolength{\footnotesep}{2mm} % Espacio adicional en los footnotes
\university{Universidad de Buenos Aires} % Your university's name and URL, this is used in the title page and abstract, print it elsewhere with \univname
\faculty{{Facultad de Ingeniería}} % Your faculty's name and URL, this is used in the title page and abstract, print it elsewhere with \facname
\department{Departamento de Electrónica} % Your department's name and URL, this is used in the title page and abstract, print it elsewhere with \deptname
\group{{Laboratorio de Sistemas Embebidos}} % Your research group's name and URL, this is used in the title page, print it elsewhere with \groupname
\subject{Memoria del Trabajo Final de la \degreename\hspace{1pc} de la \univname\hspace{1pc} de \authorname} % Your subject area, print it elsewhere with \subjectname
\hypersetup{
pdftitle = {\ttitle},
pdfauthor = {\authorname},
pdfkeywords={\keywordnames},
pdfsubject={\subjectname},
pdfcreator={Taller de escritura del trabajo final}, % creator of the document
pdfproducer={\groupname} % producer of the document
}
}
%----------------------------------------------------------------------------------------
\newcommand{\checktoopen}{% New command to move content to the next page which prints to the next odd page if twosided mode is active
\if@openright\cleardoublepage\else\clearpage\fi
\ifdef{\phantomsection}{\phantomsection}{}% The \phantomsection command is necessary for hyperref to jump to the correct page
}
\newcommand\bhrule{\typeout{--------------------}}
\newcommand\tttypeout[1]{\bhrule\typeout{\space #1}\bhrule}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % New command to make the lines in the title page
\newcommand{\decoRule}{\rule{.8\textwidth}{.4pt}} % New command for a rule to be used under figures
\renewcommand{\abovechapterspace}{\vspace*{10pt}} % Reduce the whitespace above a chapter heading
\setcounter{tocdepth}{3} % The depth to which the document sections are printed to the table of contents
\providecommand\addchaptertocentry[1]{%
\addcontentsline{toc}{chapter}{#1}%
}
%----------------------------------------------------------------------------------------
% MARGINS
%----------------------------------------------------------------------------------------
\RequirePackage{geometry}
\geometry{
headheight=4ex,
includehead,
includefoot,
paper=a4paper, % Change to letterpaper for US letter
inner=2cm, % Inner margin
outer=3.3cm, % Outer margin
bindingoffset=2cm, % Binding offset
top=1.5cm, % Top margin
bottom=1.5cm % Bottom margin
}
\raggedbottom
%----------------------------------------------------------------------------------------
% PENALTIES
%----------------------------------------------------------------------------------------
\doublehyphendemerits=10000 % No consecutive line hyphens
\brokenpenalty=10000 % No broken words across columns/pages
\widowpenalty=9999 % Almost no widows at bottom of page
\clubpenalty=9999 % Almost no orphans at top of page
\interfootnotelinepenalty=9999 % Almost never break footnotes
%----------------------------------------------------------------------------------------
% HEADERS AND FOOTERS
%----------------------------------------------------------------------------------------
\RequirePackage[markcase=used]{scrlayer-scrpage}
\providepairofpagestyles{thesisSimple}{%
\clearpairofpagestyles%
\automark[chapter]{chapter}
\ihead{\headmark}% Inner header
\ohead[\pagemark]{\pagemark}% Outer header
}
\ifoot{}% Inner footer
\ofoot{}% Outer footer
\pagestyle{thesisSimple}
\providepairofpagestyles[thesisSimple]{thesis}{%
\automark*[section]{}%
}
\providepairofpagestyles[thesisSimple]{review}{%
\ofoot[\ttitle/\authorname]{\ttitle/\authorname}
\ifoot[\today]{\today}
}
\pagestyle{thesis}
\ifbool{headsepline}{\KOMAoption{headsepline}{true}}{}
\PreventPackageFromLoading[\ClassError{\classname}{Package `fancyhdr' is
incompatible\MessageBreak with this class}{The pagesyles are defined
using package `scrlayer-scrpage', please consult the\MessageBreak
KOMA-script documentation for details.}]{fancyhdr}
\newcommand{\blank@p@gestyle}{empty}
\newcommand{\blankpagestyle}[1]{\def\blank@p@gestyle{#1}}
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{\blank@p@gestyle}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
%----------------------------------------------------------------------------------------
% DEDICATION PAGE DESIGN
%----------------------------------------------------------------------------------------
\newcommand\dedicatory[1]{
\checktoopen
\tttypeout{Dedicatory}
\null\vfil
\thispagestyle{plain}
\begin{center}{\Large\slshape #1}\end{center}
\vfil\null
}
%----------------------------------------------------------------------------------------
% PORTADA
%----------------------------------------------------------------------------------------
\AtBeginDocument{
\begin{titlepage}
\begin{center}
\includegraphics[width=.8\textwidth]{./Figures/logoFIUBA.pdf}
\vspace{2cm}
\textsc{\huge{\degreename}}
\vspace{.5cm}
\textsc{\Large Memoria del Trabajo Final}\\[1cm]
{\huge \bfseries \ttitle\par}\vspace{0.4cm}
\vfill
\vspace{2cm}
\LARGE\textbf{Autor:\\
\authorname}\\ % Author name
\vspace{1.5cm}
\large
{Director:} \\
{\dirname} \\% Supervisor name
\ifbool{codirector}{% If the codirector class option has been specified
\vspace{10px}
{Codirector:} \\
{\codirname} % Supervisor name
}{\vspace{2pc}%nothing
}
\vspace{1cm}
Jurados:\\
\jurunoname\\
\jurdosname\\
\jurtresname
\vfill
\textit{Este trabajo fue realizado en la \ciudadname,\\ entre \fechaINICIOname \hspace{1px} y \fechaFINALname.}
\end{center}
\end{titlepage}
}
%----------------------------------------------------------------------------------------
% ABSTRACT PAGE DESIGN
%----------------------------------------------------------------------------------------
\newenvironment{abstract}{
\checktoopen
\tttypeout{\abstractname}
\null\vfil
\thispagestyle{plain}
\begin{center}
{\huge\textit{\abstractname} \par}
\bigskip
\bigskip
\end{center}
}
{
\vfil\vfil\vfil\null
}
%----------------------------------------------------------------------------------------
% ACKNOWLEDGEMENTS PAGE DESIGN
%----------------------------------------------------------------------------------------
\newcommand{\acknowledgementname}{Acknowledgements}
\providecaptionname{american,australian,british,canadian,english,newzealand,UKenglish,USenglish} {\acknowledgementname}{Acknowledgements} % Acknowledgement text for English countries
\providecaptionname{german,ngerman,austrian,naustrian}{\acknowledgementname}{Danksagung} % Acknowledgement text for Germanic countries
\NewDocumentEnvironment{acknowledgements}{}{%
\checktoopen
\tttypeout{\acknowledgementname}
\thispagestyle{plain}
\begin{center}{\huge\textit{\acknowledgementname}\par}\end{center}
}
{
\vfil\vfil\null
}
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
% DEFINE NEW CAPTION NAMES
%----------------------------------------------------------------------------------------
\newcaptionname{spanish}{\lstlistingname}{C\'{o}digo} %Listing
\newcaptionname{spanish}{\acknowledgementname}{Agradecimientos}
\newcaptionname{spanish}{\authorshipname}{Declaración de Autoría}
\newcaptionname{spanish}{\abbrevname}{Glosario}
\newcaptionname{spanish}{\byname}{por}
\addto\captionsspanish{%
\renewcommand{\listtablename}{\'{I}ndice de tablas}
\renewcommand{\tablename}{Tabla}
}
\captionsetup[figure]{labelformat=simple, labelsep=period}
\captionsetup[table]{labelformat=simple, labelsep=period}
\captionsetup[lstlisting]{labelformat=simple, labelsep=period}
%----------------------------------------------------------------------------------------
\endinput
% lazyLizardTracer