udelar.cls 31.3 KB
Newer Older
mberguer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
%%
%% This is file `udelar.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% coppe.dtx  (with options: `class')
%% 
%% This is the `udelar' document class used for composition of LaTeX
%% monographs (master and PhD thesis, and PhD qualifying exams)
%% satisfying the requirements of the Comisión Académica de Posgrado (CAP)
%% at the Universidad de la República (UdelaR).
%% 
%% Copyright (C) 2015 Pablo Castrillo Green   URL http://www.fing.edu.uy/~pabloc/
15
%% Copyright (C) 2015-2017 Mihdí Anthony Caballero Baher   URL http://www.fing.edu.uy/~mcaballero/
mberguer committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29
%% 
%% This program is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License version 3 as
%% published by the Free Software Foundation.
%% 
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%% GNU General Public License version 3 for more details.
%% 
%% You should have received a copy of the GNU General Public License
%% version 3 along with this package (see COPYING file).
%% If not, see <http://www.gnu.org/licenses/>.
%% 
30
%% Author(s): Pablo Castrillo Green  / Mihdí Caballero
Mihdí Caballero committed
31 32
%%
%% Current developer: Mihdí Caballero
mberguer committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
%% 
%% {1417}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\def\filename{udelar.dtx}
52
\def\fileversion{v2.3.2}
53
\def\filedate{2015/10/10}
mberguer committed
54 55
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{udelar}[\filedate\ \fileversion\ Fing Dissertations and Thesis]
56
\LoadClass[12pt,a4paper]{book}
mberguer committed
57 58 59 60 61

%=========================
%==== INICIO PAQUETES ====
%=========================

62
\RequirePackage[markup=underlined]{changes} % Para configurar control de cambios
63

mberguer committed
64
\RequirePackage{color}
65
\RequirePackage[perpage]{footmisc}
mberguer committed
66

67

mberguer committed
68 69 70 71 72 73 74 75
\RequirePackage{hyphenat}
\RequirePackage[toc]{appendix}
\RequirePackage{lastpage}
\RequirePackage[english,spanish,es-nodecimaldot]{babel}
\RequirePackage[utf8x]{inputenc}
\RequirePackage{amsmath,amssymb}
\RequirePackage{ifthen}
\RequirePackage{graphicx}
76 77
\RequirePackage{float}
\RequirePackage{caption}
mberguer committed
78 79 80 81 82 83 84 85
\RequirePackage[font=small,labelfont=bf]{caption}
\RequirePackage{setspace}
\RequirePackage{tabularx}
\RequirePackage{eqparbox}
\RequirePackage{ltxcmds}
\RequirePackage{titletoc}
\RequirePackage[colorlinks,
            citecolor=blue,
86 87 88 89
            urlcolor=cyan,
            linkcolor=blue,
            citebordercolor=blue,
            urlbordercolor=cyan,
mberguer committed
90 91 92 93
            linktocpage,
            hyperfootnotes=true
            ]{hyperref} %[colorlinks]
\RequirePackage[a4paper,bindingoffset=0.0cm,vcentering=true,%
94
top=4cm,bottom=3cm,left=4.0cm,right=3.0cm]{geometry} %showframe para ver los margins
mberguer committed
95 96 97 98 99 100 101
\RequirePackage[pagewise]{lineno}
\RequirePackage[printwatermark]{xwatermark}
\RequirePackage{xcolor}
\RequirePackage[nottoc]{tocbibind}

\DeclareFontShape{OT1}{cmr}{bx}{sc}{<-> cmbcsc10}{} % Magia por error con 0T1 --> http://tex.stackexchange.com/questions/37618/a-problem-with-textsc

102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
%% Control de cambios
	\definecolor{bluetex}{rgb}{0.01, 0.28, 1.0}
	\definecolor{redtex}{rgb}{0.82, 0.1, 0.26}
	\definecolor{greentex}{rgb}{0.0, 0.5, 0.0}
	
	%%% Alternative definition to have the remarks
	%%% in the margins instead of footnotes
	\RequirePackage{todonotes}
	\setlength{\marginparwidth}{2.5cm}
%	\makeatletter
	\setremarkmarkup{\todo[color=Changes@Color#1!20,size=\scriptsize]{#1: #2}}
%	\makeatother
	
	%% Rather hacky definition of a plain remark/note
	%% by riding on \added
	\newcommand{\note}[2][]{\added[#1,remark={#2}]{}}
%%


mberguer committed
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
%======================
%==== FIN PAQUETES ====
%======================

\DeclareOption{oneside}{
\setboolean{@twoside}{false}}

\DeclareOption{twoside}{
\setboolean{@twoside}{true}}

\newboolean{linenumbers}
\newboolean{watermark}

\DeclareOption{linenumbers}{
\setboolean{linenumbers}{true}}

\DeclareOption{watermark}{
\setboolean{watermark}{true}}

%================================
%==== INICIO NUEVOS COMANDOS ====
%================================

\addto\captionsspanish{\renewcommand{\tablename}{Tabla}}
\addto\captionsspanish{\renewcommand{\listtablename}{Lista de tablas}}
\addto\captionsspanish{\renewcommand{\listfigurename}{Lista de figuras}}
\addto\captionsspanish{\renewcommand{\contentsname}{Tabla de contenidos}}
\addto\captionsspanish{\renewcommand{\bibname}{Referencias bibliográficas}}

150 151 152 153
% Comandos para control de cambios
\newcommand{\revision}[1]{{\color{blue}{}#1}} % Para escribir texto nuevo de la revisión.
\newcommand{\eliminar}[1]{{\color{red}\sout{#1}}} % Para marcar como eliminado el texto actual.

mberguer committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
%%==== APACITE ====
%\renewcommand{\BOthers}[1]{et al.\hbox{}}
%\renewcommand{\BBAA}{\&}% Letra que va entre los autores en las referencias
%\renewcommand{\BBAB}{and}% Entre autores en el texto
%%=================

%==== Comando UdelaRTeX ====
\def \UdelaRTeX {{\rm U{\hbox{dela}}\rm R\kern-.05em}\kern-.08em T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\spacefactor1000}
%===========================


%==== Tolerancias ====
\tolerance=10000 % Pueden ser modificadas
\hbadness=10000 % Pueden ser modificadas
%=====================

%=============================
%==== FIN NUEVOS COMANDOS ====
%=============================

%=============================
%==== INICIO INTERLINEADO ====
%=============================

178
\onehalfspacing % separación entre lineas (interlineado)
mberguer committed
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

\let\oldenumerate\enumerate %cambiar el entorno enumerate
\renewcommand{\enumerate}{
  \oldenumerate
  \setlength{\itemsep}{1pt} %separación entre items
  \setlength{\parskip}{0pt} 
  \setlength{\parsep}{0pt}
}

\let\olditemize\itemize %cambiar el entorno itemize
\renewcommand{\itemize}{
  \olditemize
  \setlength{\itemsep}{1pt} %separación entre items
  \setlength{\parskip}{0pt} 
  \setlength{\parsep}{0pt}
}

\let\olddescription\description %cambiar el entorno itemize
\renewcommand{\description}{
  \olddescription
  \setlength{\itemsep}{1pt} %separación entre items
  \setlength{\parskip}{0pt} 
  \setlength{\parsep}{0pt}
}

%==========================
%==== FIN INTERLINEADO ====
%==========================



%==== Opción de Maestría para la clase ===
\DeclareOption{msc}{%
  \newcommand{\@degree}{M.Sc.}
  \newcommand{\@degreename}{Maestr{\'i}a}
214
  \newcommand{\local@degname}{Magíster}
mberguer committed
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
  \newcommand\local@doctype{Tesis}
}
%=========================================
%==== Opción de Examen de Doctorado para la clase ===
\DeclareOption{dscexam}{%
  \newcommand{\@degree}{D.Sc.}
  \newcommand{\@degreename}{Doctorado}
  \newcommand{\local@degname}{Doctor}
  \newcommand\local@doctype{Examen de Calificaci{\'o}n}
}
%====================================================
%==== Opción de Doctorado para la clase ===
\DeclareOption{dsc}{%
  \newcommand{\@degree}{Dr.}
  \newcommand{\@degreename}{Doctorado}
  \newcommand{\local@degname}{Doctor}
  \newcommand\local@doctype{Tesis}
}
%==========================================

%=== Comando para incluir el glosario ====
\newcommand\loadglossary{%
	\makenoidxglossaries 
	%cambio en el nombre de la lista de siglas
	\addto\captionsspanish{\renewcommand{\acronymname}{Lista de siglas}} 
	%cambio en el nombre del glosario
	\addto\captionsspanish{\renewcommand{\glossaryname}{Glosario}} 
	\newglossary*{simbolos}{Lista de símbolos} 
	\newglossary*{notacion}{Lista de notaciones}
	\newglossary*{glosario}{Glosario}
	\loadglsentries{glosario_listas_indices/simbolos}
	\loadglsentries{glosario_listas_indices/siglas}
	\loadglsentries{glosario_listas_indices/notacion}
	\loadglsentries{glosario_listas_indices/glosario}
}
%=======================================

%==== Titulo y subtitulo ====
\renewcommand\title[1]{%
  \global\def\local@title{#1}%
}
\newcount\@subtitle\@subtitle0
\newcommand\subtitle[1]{%
  \global\def\local@subtitle{#1}%
  \global\advance\@subtitle by 1
}
%============================

%==== Logo institución ====

\newcount\@institutelogo\@institutelogo0
266 267
\newcommand\institutelogo[1]{%
  \global\def\@instituteslogos{#1}
mberguer committed
268 269 270 271 272 273 274 275 276 277 278
  \global\advance\@institutelogo by 1
}

%==========================

%==== Autor, director de tesis, codirectores y director académico ====
\renewcommand\author[2]{% Comando para el autor
  \global\def\@authname{#1}
  \global\def\@authsurn{#2}
}

Mihdí Caballero committed
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
%==== Pongo si quiero que sea un posgrado "en" algo o "de" algo ====
\newcommand\escritura[1]{% Comando para el tipo de posgrado
	\global\def\@tipoescritura{#1}
}

% Creo la opcion de tener varios directores de carrera
\newcommand\local@directorstring{Director}
\newcommand\foreign@directorstring{Director}

\newcount\@director\@director0
\newcommand\director[4]{% Comando para los directores
	\global\@namedef{UdelarDirectorTitle:\expandafter\the\@director}{#1}
	\global\@namedef{UdelarDirectorName:\expandafter\the\@director}{#2}
	\global\@namedef{UdelarDirectorSurname:\expandafter\the\@director}{#3}
	\global\@namedef{UdelarDirectorDegree:\expandafter\the\@director}{#4}
	\global\advance\@director by 1
	\ifnum\@director>1
	\renewcommand\local@directorstring{Directores}
	\renewcommand\foreign@directorstring{Directors}
	\fi
mberguer committed
299 300
}

Mihdí Caballero committed
301

mberguer committed
302
\newcommand\local@codirectorstring{Codirector}
303
\newcommand\foreign@codirectorstring{Co-advisor}
mberguer committed
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

\newcount\@codirector\@codirector0
\newcommand\codirector[4]{% Comando para los codirectores
  \global\@namedef{UdelarCoAdvisorTitle:\expandafter\the\@codirector}{#1}
  \global\@namedef{UdelarCoAdvisorName:\expandafter\the\@codirector}{#2}
  \global\@namedef{UdelarCoAdvisorSurname:\expandafter\the\@codirector}{#3}
  \global\@namedef{UdelarCoAdvisorDegree:\expandafter\the\@codirector}{#4}
  \global\advance\@codirector by 1
  \ifnum\@codirector>1
    \renewcommand\local@codirectorstring{Codirectores}
    \renewcommand\foreign@codirectorstring{Co-dvisors}
  \fi
}

\newcount\@directoracademico\@directoracademico0
\newcommand\directoracademico[4]{% Comando para el director académico
  \global\def\@academicotitle{#1}
  \global\def\@academiconame{#2}
  \global\def\@academicosurn{#3}
  \global\def\@academicodegree{#4}
  \global\advance\@directoracademico by 1
}
%=====================================================================

%==== Examinadores ====
\newcount\@examiner\@examiner0
\newcommand\examiner[4]{% Acá se definen los examinadores del tribunal
  \global\@namedef{UdelarExaminerTitle:\expandafter\the\@examiner}{#1}
    \global\@namedef{UdelarExaminerName:\expandafter\the\@examiner}{#2}
    \global\@namedef{UdelarExaminerSurname:\expandafter\the\@examiner}{#3}
    \global\@namedef{UdelarExaminerDegree:\expandafter\the\@examiner}{#4}
  \global\advance\@examiner by 1
}
%======================

%==== Variables del posgrado ====
\ProcessOptions\relax
\newcommand\graduatename[1]{% Nombre del posgrado
  \global\def\local@graduatename{#1}
}

\newcount\@institute\@institute0
\newcounter{institute}
\newcommand\institute[2]{% Acá se definen los institutos del posgrado
  \global\@namedef{InstituteName:\expandafter\the\@institute}{#1}
  \global\@namedef{AbbrevInstituteName:\expandafter\the\@institute}{#2}
  \global\advance\@institute by 1
  \global\addtocounter{institute}{1}
}

\count1=0
\global\def\local@maininstitute{\csname InstituteName:\the\count1 \endcsname}
\global\def\local@abbrevmaininstitute{\csname AbbrevInstituteName:\the\count1\endcsname}

Mihdí Caballero committed
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
\newcount\@seconduniversity\@seconduniversity0
\newcounter{seconduniversity}
\newcommand\seconduniversity[1]{% Acá se definen los institutos del posgrado
	\global\@namedef{SecondUniversityName:\expandafter\the\@seconduniversity}{#1}
	\global\advance\@seconduniversity by 1
	\global\addtocounter{seconduniversity}{1}
}

\newcount\@thirduniversity\@thirduniversity0
\newcounter{thirduniversity}
\newcommand\thirduniversity[1]{% Acá se definen los institutos del posgrado
	\global\@namedef{ThirdUniversityName:\expandafter\the\@thirduniversity}{#1}
	\global\advance\@thirduniversity by 1
	\global\addtocounter{thirduniversity}{1}
}


mberguer committed
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397
\newcommand\graduatelocation[2]{% Nombre del posgrado
  \global\def\local@cityname{#1}
  \global\def\local@countryname{#2}
}

%================================

%=== Fecha ====
\renewcommand\date[3]{% Fecha
  \day=#1
  \month=#2
  \year=#3
}
\newcommand\local@monthname{\ifcase\month\or
  Enero\or Febrero\or Marzo\or Abril\or Mayo\or Junio\or
  Julio\or Agosto\or Setiembre\or Octubre\or Noviembre\or Diciembre\fi}
\newcommand\foreign@monthname{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi}
%==============

%==== Palabras claves ====
\newcounter{keywords}
398
\newcommand\keyword[1]{% Palabras claves en español
mberguer committed
399 400 401
  \global\@namedef{UdelarKeyword:\expandafter\the\c@keywords}{#1}
  \global\addtocounter{keywords}{1}
}
402 403 404 405 406 407 408
%
\newcounter{foreignkeywords}
\newcommand\foreignkeyword[1]{% Palabras claves en inglés
  \global\@namedef{UdelarForeignKeyword:\expandafter\the\c@foreignkeywords}{#1}
  \global\addtocounter{foreignkeywords}{1}
}

mberguer committed
409 410 411 412 413 414 415 416 417
%=========================

%==== Página I ====
\renewcommand\maketitle{%
  \ifthenelse{\boolean{watermark}}{\newwatermark[allpages,color=gray!50,angle=35,scale=3,xpos=0,ypos=0]{En revisión}}{}
  \begin{titlepage}
  \pagenumbering{roman}
  \pagestyle{empty}
  \setcounter{page}{1}
418
  \hspace{-0.5cm} \includegraphics[height=0.08\textheight]{imagenes/logo_udelar} \hfill
mberguer committed
419
  \ifnum\@institutelogo>0
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436
	  \ifnum\@instituteslogos>2
		  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion1}  \hfil
		  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion2}  \hfil
		  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion3}
	  \else
		  \ifnum\@instituteslogos>1
			  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion1}  \hfil
			  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion2}
		  \else
		      \ifnum\@instituteslogos>0
			  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion1}
			  \else
			  %
			  \fi
		  \fi
      \fi
  \fi	
mberguer committed
437 438 439
	  \vspace{1.05cm}
	  \begin{center}
	      \vspace*{3cm}
440
	      \doublespacing
441
		  \nohyphens{\huge{\local@title}}\par
mberguer committed
442 443
		  \vspace*{0.3cm}
		  \ifnum\@subtitle>0
Mihdí Caballero committed
444
			  \nohyphens{\Large{\local@subtitle}}\par
mberguer committed
445 446
		  \fi
		  \vspace*{2cm}
447
		  \nohyphens{\large{\@authname\ \@authsurn}}\par
mberguer committed
448 449 450
	  \end{center}
	  \vspace{\fill}
	  \begin{center}
Mihdí Caballero committed
451
	  Programa de Posgrado \@tipoescritura~\local@graduatename\\
mberguer committed
452 453
	  \count1=0
	  \count2=1
Mihdí Caballero committed
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
 	  \nohyphens{\@whilenum \count1<\@institute \do {
 	  \ifnum\count2<\value{institute}
	 		\csname InstituteName:\the\count1\endcsname,
 	  \else
	 		\csname InstituteName:\the\count1\endcsname\\
 	  \fi
      \advance\count1 by 1
 	  \advance\count2 by 1}}
	\ifnum\@seconduniversity>0
		\ifnum\@thirduniversity>0
			Universidad de la Rep{\'u}blica - \csname SecondUniversityName:\the\count1\endcsname - \csname ThirdUniversityName:\the\count1\endcsname \\
		\else
			Universidad de la Rep{\'u}blica - \csname SecondUniversityName:\the\count1\endcsname \\
		\fi
	\else 
		\ifnum \@thirduniversity>0
			Universidad de la Rep{\'u}blica - \csname ThirdUniversityName:\the\count1\endcsname \\
		\else
			Universidad de la Rep{\'u}blica  \\
	    \fi
	\fi
	
mberguer committed
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494
	  \frontpage@bottomtext
	  \end{center}
  \end{titlepage}
  \global\let\maketitle\relax%
\global\let\and\relax}
%====================

%==== Páginas II, III y IV ====
\renewcommand\frontmatter{%
\thispagestyle{empty}
  \@mainmatterfalse
  \pagenumbering{roman}
  \setcounter{page}{2}
  \makefrontpage
}

\newcommand\makefrontpage{%
\cleardoublepage
\pagestyle{empty}
495
  \hspace{-0.5cm} \includegraphics[height=0.08\textheight]{imagenes/logo_udelar} \hfill
mberguer committed
496
  \ifnum\@institutelogo>0
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
	  \ifnum\@instituteslogos>2
		  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion1}  \hfil
		  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion2}  \hfil
		  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion3}
	  \else
		  \ifnum\@instituteslogos>1
			  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion1}  \hfil
			  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion2}
		  \else
			  \ifnum\@instituteslogos>0
				  \includegraphics[height=0.08\textheight]{imagenes/logo_institucion1}
			  \else
				  %
			  \fi
		  \fi
	  \fi
  \fi
mberguer committed
514 515
\vspace{1.05cm}
\begin{center}
516
     \doublespacing
517
	 \nohyphens{\huge{\local@title}}\par
mberguer committed
518 519 520 521 522
	 \vspace*{0.3cm}
	 \ifnum\@subtitle>0
	 \nohyphens{\Large{\local@subtitle}}\par
	 \fi
	 \vspace*{2cm}
523
	 \nohyphens{\large{\@authname\ \@authsurn}}\par
mberguer committed
524 525 526 527 528 529 530
\end{center}
\vspace*{1cm}
\begin{flushright}
	\begin{minipage}{9.5cm}
		\frontcover@maintext
		
		\vspace{7.5mm}
Mihdí Caballero committed
531 532 533 534 535 536 537 538 539 540 541 542
%		Director de tesis: \\
%		\hspace*{0.3cm}\nohyphens{\@directordegree\ \@directortitle\ \@directorname\ \@directorsurn}
%		\vspace{5mm}
		%
		\ifnum\@director>0
			\local@directorstring: \\
			\count1=0
			\nohyphens{\@whilenum \count1<\@director \do {
			\hspace*{0.3cm}\csname UdelarDirectorDegree:\the\count1 \endcsname\space\csname UdelarDirectorTitle:\the\count1 \endcsname\space\csname UdelarDirectorName:\the\count1 \endcsname\space\csname UdelarDirectorSurname:\the\count1 \endcsname
			\\
			\advance\count1 by 1}}
		\fi
mberguer committed
543 544
		
		\ifnum\@codirector>0
Mihdí Caballero committed
545 546 547 548 549 550
			\local@codirectorstring: \\
			\count1=0
			\nohyphens{\@whilenum \count1<\@codirector \do {
			\hspace*{0.3cm}\csname UdelarCoAdvisorDegree:\the\count1 \endcsname\space\csname UdelarCoAdvisorTitle:\the\count1 \endcsname\space\csname UdelarCoAdvisorName:\the\count1 \endcsname\space\csname UdelarCoAdvisorSurname:\the\count1 \endcsname
			\\
			\advance\count1 by 1}}
mberguer committed
551 552 553
		\fi
		
		\ifnum\@directoracademico>0
Mihdí Caballero committed
554 555
			Director académico: \\
			\hspace*{0.3cm}\nohyphens{\@academicodegree\ \@academicotitle\ \@academiconame\ \@academicosurn}
mberguer committed
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572
		\fi
	\end{minipage}\par
\end{flushright}
\vspace*{\fill}	  
\frontpage@bottomtext
\pagestyle{empty}
\cleardoublepage
\makecatalog
\cleardoublepage
\pagestyle{plain}
\begin{center}
	INTEGRANTES DEL TRIBUNAL DE DEFENSA DE {\MakeUppercase\local@doctype}
\end{center}
\vspace*{15mm}
\begin{flushright}
\count1=0
\nohyphens{\@whilenum \count1<\@examiner \do {
573 574
\eqparbox{signture@list}{\rule{0.5\textwidth}{.4pt}}\\
%\eqparbox{signture@list}{\hrulefill}\\ 
mberguer committed
575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601
\eqparbox{signture@list}%
{
\vspace{0.3cm}
\ \ \ \csname 
UdelarExaminerDegree:\the\count1 \endcsname\space\csname 
UdelarExaminerTitle:\the\count1 \endcsname\space\csname 
UdelarExaminerName:\the\count1 \endcsname\space\csname 
UdelarExaminerSurname:\the\count1 \endcsname\\\\ \ \ \ %
}
\advance\count1 by 1}}
\end{flushright}
\vspace*{\fill}
\frontpage@bottomtext
}

\newcommand\makecatalog{%

  \begin{center}
    \setlength{\fboxsep}{5mm}
    \framebox[120mm][c]{\makebox[5mm][c]{}%
      \begin{minipage}[c]{105mm}
      \setlength{\parindent}{5mm}
      \noindent\sloppy\nohyphens\@authsurn,
      \nohyphens\@authname\par
      \nohyphens{\local@title\ / \@authname\ \@authsurn.\ -\ \local@cityname:
      \count1=0
      \count2=1
Mihdí Caballero committed
602 603 604 605 606 607 608 609 610 611 612 613 614 615
  	  \ifnum\@seconduniversity>0
	  	  \ifnum\@thirduniversity>0
		  	  Universidad de la Rep{\'u}blica, \csname SecondUniversityName:\the\count1\endcsname, \csname ThirdUniversityName:\the\count1\endcsname, 
	  	  \else
		  	  Universidad de la Rep{\'u}blica, \csname SecondUniversityName:\the\count1\endcsname, 
	  	  \fi
  	  \else 
	  	  \ifnum \@thirduniversity>0
		  	  Universidad de la Rep{\'u}blica, \csname ThirdUniversityName:\the\count1\endcsname, 
	  	  \else
		  	  Universidad de la Rep{\'u}blica,
	  	  \fi
  	  \fi 	  
  	  \nohyphens{\@whilenum \count1<\@institute \do {
mberguer committed
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
  	  \ifnum\count2<\value{institute}
      \csname InstituteName:\the\count1\endcsname,
      \else
      \hspace*{-0.15cm}\space\csname InstituteName:\the\count1\endcsname, \number\year.
  	  \fi
  	  \advance\count1 by 1
      \advance\count2 by 1}}}\par
      {\footnotesize \pageref{front:pageno}},
      \pageref{LastPage}
      p.\@ifundefined{r@cat:lofflag}{}{\pageref{cat:lofflag}} $29,7$cm.
      \par
      % There is an issue here. When the last entry must be split between lines,
      % the spacing between it and the next paragraph becomes smaller.
      % Should we manually introduce a fixed space? But how could we know that
      % a name was split? Is this happening yet?
Mihdí Caballero committed
631 632 633 634 635 636 637 638 639 640 641
%      Director de tesis:\par
%	  \nohyphens{\@directorname\ \@directorsurn}\par
	  %
	  \ifnum\@director>0
	  \local@directorstring:\par
	  \count1=0
	  \nohyphens{\@whilenum \count1<\@director \do {
	  		\csname UdelarDirectorName:\the\count1 \endcsname\space\csname UdelarDirectorSurname:\the\count1 \endcsname\par
	  		\advance\count1 by 1}}
	  \fi
	  %
mberguer committed
642 643 644 645 646 647 648
	  \ifnum\@codirector>0
	  \local@codirectorstring:\par
	  \count1=0
	  \nohyphens{\@whilenum \count1<\@codirector \do {
	  \csname UdelarCoAdvisorName:\the\count1 \endcsname\space\csname UdelarCoAdvisorSurname:\the\count1 \endcsname\par
	  \advance\count1 by 1}}
	  \fi
Mihdí Caballero committed
649
	  %
mberguer committed
650 651 652 653 654 655
	  \ifnum\@directoracademico>0
	  Director académico:\par
	  \nohyphens{\@academiconame\ \@academicosurn}
	  \fi
      \par
      \nohyphens{\local@doctype\ de \@degreename\ --
Mihdí Caballero committed
656
       Universidad de la Rep{\'u}blica,\ Programa \@tipoescritura~\local@graduatename,\ \number\year.}\par
mberguer committed
657 658 659 660 661 662 663 664 665 666 667
      Referencias bibliográficas: p. \pageref{bib:begin} -- \pageref{bib:end}.\par  
      \count1=0
      \count2=1
      \nohyphens{\@whilenum \count1<\value{keywords} \do {%
      \ifnum\count2<\value{keywords}
      \number\count2.~\csname UdelarKeyword:\the\count1 \endcsname,
      \else
      \number\count2.~\csname UdelarKeyword:\the\count1 \endcsname.
      \fi
      \advance\count1 by 1
      \advance\count2 by 1}} 
Mihdí Caballero committed
668 669 670 671 672 673 674 675 676 677 678 679
%      \nohyphens{I.~\@directorsurn,%
%      \ \@directorname
   	  %
   	  \ifnum\@director>0
   	  \count1=0
   	  \nohyphens{I.~\@whilenum \count1<\@director \do {
   	  		\csname UdelarDirectorSurname:\the\count1 \endcsname, \space \csname UdelarDirectorName:\the\count1 \endcsname , 
   	  		\advance\count1 by 1}
   	  \fi
   	  %
      \ifthenelse{\@codirector>0}{\hspace{-2mm}\emph{et~al.}{}}.
      II.~Universidad de la Rep{\'u}blica, Programa de Posgrado \@tipoescritura~\local@graduatename.
mberguer committed
680 681 682 683 684 685 686 687 688
      III.~T{\'i}tulo.}
    \end{minipage}}
  \end{center}
\vspace*{\fill}}
%============================

%==== Parte de la página II y III ====
\newcommand\frontcover@maintext{
  \sloppy\nohyphens{\local@doctype\ de \@degreename\
Mihdí Caballero committed
689
  presentada al Programa de Posgrado \@tipoescritura~\local@graduatename, \local@maininstitute\ de la Universidad de la Rep{\'u}blica, como parte de los requisitos
mberguer committed
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760
  necesarios para la obtenci{\'o}n del t{\'i}tulo de
  \local@degname\ en \local@graduatename.}
}

\newcommand\frontpage@bottomtext{%
  \begin{center}
  {\local@cityname\ -- \local@countryname}\par
  {\local@monthname\ de \number\year}
  \end{center}%
}
%=====================================

%==== Página V, puede ir o no ====
\newcommand\dedication[1]{
  \gdef\@dedic{#1}
    \cleardoublepage
    \vspace*{\fill}
    \begin{flushright}
      \begin{minipage}{60mm}
        \raggedleft  \normalsize \@dedic
      \end{minipage}
    \end{flushright}
}
%=================================

%==== Página VII, puede ir o no ====
\newcommand\epigrafe[2]{
  \gdef\@epig{#1}
  \gdef\@epigs{#2}
    \cleardoublepage
    \begin{flushright}
      \begin{minipage}{60mm}
      \begin{flushright}
        \textit{\@epig} 
        \vspace{0.5cm}
        
        \@epigs
        \end{flushright}
      \end{minipage}
    \end{flushright}
}
%===================================

%==== Página VIII, Resumen en español ====
\newenvironment{abstract}{%
  \cleardoublepage
  \thispagestyle{plain}
  \begin{center}
  	RESUMEN
  \end{center}
  \vspace*{20mm}
  }{
\vspace*{20mm}
\ifnum\value{keywords}>1
\noindent
Palabras claves:\\ 
\else
\noindent
Palabra clave:\\
\fi
\count1=0
\count2=1
\nohyphens{\@whilenum \count1<\value{keywords} \do {%
\ifnum\count2<4
	\ifnum\count2<\value{keywords}
	\csname UdelarKeyword:\the\count1 \endcsname,
	\else
	\csname UdelarKeyword:\the\count1 \endcsname.
	\fi
\else
	\ifnum\count2<\value{keywords}
761
	\csname UdelarKeyword:\the\count1 \endcsname,
mberguer committed
762
	\else
763
	\csname UdelarKeyword:\the\count1 \endcsname.
mberguer committed
764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781
	\fi
\fi
\advance\count1 by 1
\advance\count2 by 1}}
\vspace*{\fill}}
%=========================================
  
%==== Página IX, Resumen en ingles ====
\newenvironment{foreignabstract}{ %
  \cleardoublepage
  \thispagestyle{plain}
  \begin{otherlanguage}{english}
  \begin{center}
  	ABSTRACT
  \end{center}
   \vspace*{20mm}
\end{otherlanguage}}{%
\vspace*{20mm}
782
\ifnum\value{foreignkeywords}>1
mberguer committed
783 784 785 786 787 788 789 790
\noindent
Keywords:\\ 
\else
\noindent
Keyword:\\
\fi
\count1=0
\count2=1
791
\nohyphens{\@whilenum \count1<\value{foreignkeywords} \do {%
mberguer committed
792
\ifnum\count2<4
793 794
	\ifnum\count2<\value{foreignkeywords}
	\csname UdelarForeignKeyword:\the\count1 \endcsname,
mberguer committed
795
	\else
796
	\csname UdelarForeignKeyword:\the\count1 \endcsname.
mberguer committed
797 798
	\fi
\else
799 800
	\ifnum\count2<\value{foreignkeywords}
	\csname UdelarForeignKeyword:\the\count1 \endcsname,
mberguer committed
801
	\else
802
	\csname UdelarForeignKeyword:\the\count1 \endcsname.
mberguer committed
803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848
	\fi
\fi
\advance\count1 by 1
\advance\count2 by 1}}
\vspace*{\fill}}
%========================================

%==== Página X, lista de figuras, puede ir o no ====
\renewcommand\listoffigures{%
	\if@twoside
	  \cleardoublepage
	  \fi
	\udelar@hasLof
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename}%
      \addcontentsline{toc}{chapter}{\listfigurename}%
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
}
%===================================================

%==== Página XI, lista de tablas, puede ir o no ====    
\renewcommand\listoftables{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename}%
      \addcontentsline{toc}{chapter}{\listtablename}%
      \@mkboth{%
          \MakeUppercase\listtablename}%
         {\MakeUppercase\listtablename}%
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
}
%===================================================

%==== Lista de símbolos, Página XII, puede ir o no ====
\newcommand\listadesimbolos{%
849
	\printnoidxglossary[sort=case,type=simbolos]\addcontentsline{toc}{chapter}{Lista de símbolos}
mberguer committed
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986
}
%======================================================

%==== Lista de acrónimos, Página XIII, puede ir o no ====
\newcommand\listadesiglas{%
	\printnoidxglossary[sort=case,type=acronym]\addcontentsline{toc}{chapter}{Lista de siglas}
}
%========================================================

%==== Lista de notación, Página XIV, puede ir o no ====
\newcommand\listadenotaciones{%
	\printnoidxglossary[sort=case,type=notacion]\addcontentsline{toc}{chapter}{Notaciones}
}
%======================================================

%==== Contenido general del texto ===
\renewcommand\mainmatter{%
  \ifthenelse{\boolean{linenumbers}}{\linenumbers}{\nolinenumbers}
  \if@twoside
  \clearpage
  \fi
  \udelar@mainBegin
  \cleardoublepage
  \@mainmattertrue
  \pagestyle{plain}
  \pagenumbering{arabic}
}
%====================================

%==== Final del texto ====
\renewcommand\backmatter{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
    
\fi
\udelar@bibBegin}
%=========================
    
%==== Algunos labels importantes ====
\AtBeginDocument{%
  \ltx@ifpackageloaded{hyperref}{
  	\def\udelar@bibBegin{%
        \immediate\write\@auxout{%
          \string\newlabel{bib:begin}{{}{\arabic{page}}{}{page.\arabic{page}}{}}}}%
    \def\udelar@bibEnd{%
      \immediate\write\@auxout{%
        \string\newlabel{bib:end}{{}{\arabic{page}}{}{page.\arabic{page}}{}}}}%
    \def\udelar@mainBegin{%
          \immediate\write\@auxout{%
            \string\newlabel{front:pageno}{{}{\Roman{page}}{}{page.\Roman{page}}{}}}}%
    \def\udelar@hasLof{%
      \immediate\write\@auxout{%
        \string\newlabel{cat:lofflag}{{}{:~il.;}{}{page.\Roman{page}}{}}}}%
  }{%
    \def\udelar@bibEnd{%
      \immediate\write\@auxout{%
      \string\newlabel{bib:end}{{}{\arabic{page}}{}}}}%
    \def\udelar@bibBegin{%
      \immediate\write\@auxout{%
      \string\newlabel{bib:begin}{{}{\arabic{page}}{}}}}%
    \def\udelar@mainBegin{%
      \immediate\write\@auxout{%
        \string\newlabel{front:pageno}{{}{\Roman{page}}{}}}}%
    \def\udelar@hasLof{%
      \immediate\write\@auxout{%
        \string\newlabel{cat:lofflag}{{}{:~il.;}{}}}}%
  }%
}
%====================================

%==== Bibliografía ====


\newdimen\bibindent%
\setlength\bibindent{1.5em}%
\renewenvironment{thebibliography}[1]%
     {\onehalfspacing%
      \chapter*{\bibname}%
      \addcontentsline{toc}{chapter}{\bibname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\setlength{\labelwidth}{0ex}%
            \setlength{\leftmargin}{0.0ex}%
            \setlength{\itemindent}{-2.5ex}%
            \advance\leftmargin\labelsep%
            \@openbib@code%
            \usecounter{enumiv}%
            \let\p@enumiv\@empty%
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy%
      \clubpenalty4000%
      \@clubpenalty \clubpenalty%
      \widowpenalty4000%
      \sfcode`\.\@m}%
     {\def\@noitemerr%
       {\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\newcommand\bibend{\udelar@bibEnd}
%======================

%==== Glosario ====
\newcommand\glosario{%
	\printnoidxglossary[sort=case,type=glosario]\addcontentsline{toc}{chapter}{Glosario} 
}
%==================

\newcount\@apenarabicnumbering\@apenarabicnumbering0
\newcommand\apenarabicnumbering{%
  \global\advance\@apenarabicnumbering by 1
}

\newcount\@anexarabicnumbering\@anexarabicnumbering0
\newcommand\anexarabicnumbering{%
  \global\advance\@anexarabicnumbering by 1
}

%==== Apéndices ====
\newcommand\apenmatter{%
	\appendix
	\renewcommand\appendixpagename{APÉNDICES}
	\renewcommand\appendixtocname{\textbf{Apéndices}}
	\appendixpage
	\ifnum\@apenarabicnumbering>0
	\renewcommand{\thechapter}{\arabic{chapter}}
	\fi
	\titlecontents{chapter}% <section-type>
		[13pt]% <left>
		{}% <above-code>
		{ Apéndice\ \thecontentslabel\quad}% <numbered-entry-format>
		{}% <numberless-entry-format>
		{\titlerule*[1pc]{.}\contentspage}% <filler-page-format>
}


%===================

987 988 989
%==== Anexos ==== % Editado 21/09/2016 Pablo Castrillo
\newcommand{\annexname}{Anexo}
\newcommand\anexmatter{\par
990 991
	\setcounter{chapter}{0}
	\setcounter{section}{0}
mberguer committed
992 993 994 995 996
	\appendix
	\renewcommand\appendixpagename{ANEXOS}
	\renewcommand\appendixtocname{\textbf{Anexos}}
	\renewcommand\appendixname{Anexo}
	\titlecontents{chapter}% <section-type>
997 998 999 1000 1001
	[0pt]% <left>
	{\vspace*{0.45cm}}% <above-code>
	{\thecontentslabel\quad}% <numbered-entry-format>
	{}% <numberless-entry-format>
	{\bfseries\hfill\contentspage}% <filler-page-format>
mberguer committed
1002 1003
	\appendixpage
	\ifnum\@anexarabicnumbering>0
1004 1005 1006 1007
	\renewcommand{\thechapter}{\arabic{chapter}}
	\else
	\renewcommand{\thechapter}{\Alph{chapter}}
	\fi
mberguer committed
1008
	\titlecontents{chapter}% <section-type>
1009 1010 1011 1012 1013 1014
	[13pt]% <left>
	{}% <above-code>
	{ Anexo\ \thecontentslabel\quad}% <numbered-entry-format>
	{}% <numberless-entry-format>
	{\titlerule*[1pc]{.}\contentspage}% <filler-page-format>
	\renewcommand{\theHchapter}{\annexname.\thechapter}
mberguer committed
1015
}
1016
%===================
mberguer committed
1017

1018 1019 1020



mberguer committed
1021 1022 1023
%% 
%%
%% End of file `udelar.cls'.