-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy paththud.cls
198 lines (179 loc) · 6.59 KB
/
thud.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
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{thud}[2020/01/21]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{prefix={\@currname @opt@}}
\def\thud@tmpcmd{\relax}
\DeclareStringOption[\relax]{beamer}[]
\DeclareStringOption{target}
\DeclareStringOption{aauheader}
\DeclareStringOption{style}
\ProcessKeyvalOptions{\@currname}
\newif\ifthud@beamer
\ifx\thud@opt@beamer\thud@tmpcmd\else\thud@beamertrue\fi
\def\thud@save#1{\expandafter\let\csname thud@save@#1\expandafter\endcsname\csname#1\endcsname}
\def\thud@restore#1{\expandafter\let\csname#1\expandafter\endcsname\csname thud@save@#1\endcsname}
\def\@ifplus#1{\@ifnextchar+{\@firstoftwo{#1}}}
\def\thud@tmpcmd{bach}
\ifx\thud@opt@target\thud@tmpcmd
\chardef\thud@target\z@\relax
\else
\def\thud@tmpcmd{mst}
\ifx\thud@opt@target\thud@tmpcmd
\chardef\thud@target\@ne\relax
\else
\def\thud@tmpcmd{phd}
\ifx\thud@opt@target\thud@tmpcmd
\chardef\thud@target\tw@\relax
\else
\ClassError{\@currname}{Invalid value for the \protect"target\protect" option}
{Specify one of \protect"bach\protect", \protect"mst\protect" or \protect"phd\protect"}
\fi
\fi
\fi
\newif\ifthud@phd
\ifnum\thud@target=\tw@\relax\thud@phdtrue\fi
\ifthud@beamer
\LoadClass[\thud@opt@beamer]{beamer}
\else
\LoadClass[onecolumn,twoside,\ifthud@phd 10\else 11\fi pt]{book}
\fi
\RequirePackage{helvet}
\def\thud@nonegiven#1{\ClassError{thud}{No \expandafter\string\csname#1\endcsname\space given}{Provide an \expandafter\string\csname#1\endcsname.}}
\def\@author{\thud@nonegiven{author}}
\def\@date{\begingroup\expandafter\advance\expandafter\year\ifnum\month>3 -1 \else -2 \fi\the\year-\advance\year1 \the\year\endgroup}
\RequirePackage{graphicx}
% localizzazione
\RequirePackage[\thudbabelopt]{babel}
\ifthud@beamer\else
\RequirePackage{setspace}
\RequirePackage[\ifthud@phd c5paper\else a4paper\fi]{geometry}
\fi
\addto\captionsenglish{%
\def\abstractname{Abstract}%
\def\acknowledgementsname{Acknowledgements}%
\def\authorcontactsname{Author's Contacts}%
\def\candidatename{Candidate}%
\def\chairname{Chair}%
\def\conclusionsname{Conclusions}%
\def\cosupervisorname{Co-Supervisor}%
\def\cosupervisorsname{Co-Supervisors}%
\def\cyclename{Cycle}%
\def\datename{Academic Year}%
\def\indexname{Index}%
\def\institutecontactsname{Institute Contacts}%
\def\introductionname{Introduction}%
\def\prefacename{Preface}%
\def\reviewername{Reviewer}%
\def\reviewersname{Reviewers}%
\def\shortdatename{A.Y.}%
\def\summaryname{Summary}%
\def\supervisorname{Supervisor}%
\def\supervisorsname{Supervisors}%
\def\thesisname{\ifcase\thud@target Bachelor\space\or Master\space\or Ph.D.~\fi Thesis in \\ \thud@course}%
\def\tutorname{Tutor}%
\def\tutorsname{Tutors}%
}
\addto\captionsitalian{%
\def\abstractname{Sommario}%
\def\acknowledgementsname{Ringraziamenti}%
\def\authorcontactsname{Contatti dell'autore}%
\def\candidatename{Candidato}%
\def\chairname{Direttore}%
\def\conclusionsname{Conclusioni}%
\def\cosupervisorname{Correlatore}%
\def\cosupervisorsname{Correlatori}%
\def\cyclename{Ciclo}%
\def\datename{Anno accademico}%
\def\indexname{Indice analitico}%
\def\institutecontactsname{Contatti dell'Istituto}%
\def\introductionname{Introduzione}%
\def\prefacename{Prefazione}%
\def\reviewername{Controrelatore}%
\def\reviewersname{Controrelatori}%
\def\shortdatename{A.A.}%
\def\summaryname{Riassunto}%
\def\supervisorname{Relatore}%
\def\supervisorsname{Relatori}%
\def\thesisname{Tesi di \ifcase\thud@target Laurea\or Laurea Magistrale\or Dottorato\fi \ in \\ \thud@course}%
\def\tutorname{Tutor aziendale}%
\def\tutorsname{Tutor aziendali}%
}
\gdef\thud@universityA{%
\includegraphics[width=\textwidth]{banners\ifx\thud@opt@style\@empty\else/old\fi/banner_uniud_\languagename.pdf}\\
}
\gdef\thud@universityAaau{%
\includegraphics[width=\textwidth]{banners\ifx\thud@opt@style\@empty\else/old\fi/banner_aau_\thud@opt@aauheader.pdf}\\
}
\gdef\thud@universityB{%
Dipartimento di Scienze Matematiche, Informatiche e Fisiche\\%
Universit\`a degli Studi di Udine\\
Via delle Scienze, 206\\
33100 Udine --- Italia\\
+39 0432 558400\\
\@ifundefined{url}\texttt\url{https://www.dmif.uniud.it/}
}
\gdef\thud@rights{%
\textcopyright\ \the\year\ \@author\\ This work is shared under the Creative Commons 4.0 License Attribution-NonCommercial-ShareAlike.%
}
\def\@true{true}
\define@key{defentry}{long}[true]{%
\def\thud@de@a{#1}%
\ifx\@true\thud@de@a\let\thud@de@b\long\fi%
}
\define@key{defentry}{phd}[true]{%
\def\thud@de@a{#1}%
\ifx\@true\thud@de@a%
\expandafter\let\csname ifthud@de@c\expandafter\endcsname\csname ifthud@phd\endcsname%
\fi%
}
\define@key{defentry}{nonempty}[true]{%
\def\thud@de@a{#1}%
\ifx\@true\thud@de@a%
\expandafter\let\csname ifthud@de@d\expandafter\endcsname\csname iftrue\endcsname%
\fi%
}
\newcommand\thud@defentry[2][]{
\let\thud@de@b\relax
\let\ifthud@de@c\iftrue
\let\ifthud@de@d\iffalse
\setkeys{defentry}{#1}%
\ifthud@de@d%% Either \iftrue or \iffalse
\@namedef{thud@#2}{\thud@nonegiven{#2}}
\else
\expandafter\let\csname thud@#2\endcsname\@empty
\fi
\expandafter\thud@de@b\ifthud@de@c%% Either \iftrue or \ifthud@phd
\@namedef{#2}##1{\expandafter\gdef\csname thud@#2\endcsname{##1}}
\else
\@namedef{#2}##1{\ClassWarning{\@currname}{\expandafter\string\csname#2\endcsname\space in non-PhD thesis}}
\fi%
}
\thud@defentry{chair}
\thud@defentry[phd,long]{contacts}
\thud@defentry{cosupervisor}
\thud@defentry[nonempty]{course}
\thud@defentry[phd]{email}
\thud@defentry[phd]{homepage}
\thud@defentry[phd]{phdnumber}
\thud@defentry[phd]{reviewer}
%\thud@defentry{rights}
\thud@defentry{supervisor}
\thud@defentry[phd]{telephone}
\thud@defentry[phd]{cycle}
\thud@defentry{tutor}
\newsavebox\thud@tmpbox
\def\thud@showentry@#1#2{%
\expandafter\ifx\csname thud@#2\endcsname\@empty\else%
\def\thud@varname{\@nameuse{#2name}}%
#1%% Either \iftrue or \iffalse
\def\and{\\[\thud@se@and]\gdef\thud@varname{\@nameuse{#2sname}}}%
\else%
\let\and\@undefined
\fi%
\begin{lrbox}{\thud@tmpbox}\parbox[t]{\linewidth}{\@nameuse{thud@#2}}\end{lrbox}%
\textsc{\thud@varname}\\[\thud@se@qual]%
\usebox{\thud@tmpbox}\\[\thud@se@sep]\null%
\fi%
}
\def\thud@showentry{\@ifstar{\expandafter\thud@showentry@\noexpand\iffalse}{\expandafter\thud@showentry@\noexpand\iftrue}}
\input{\ifthud@beamer beamer\else book\fi.thud.tex}