-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathntua-ece-thesis.cls
402 lines (328 loc) · 14.1 KB
/
ntua-ece-thesis.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Filename: ntua-ece-thesis.cls
%% Description: NTUA ECE Thesis class - simplified
%%
%% Sections:
%% - Class info
%% - Text control
%% - Math fonts
%% - Control Flow
%% - Page styles
%% - Langauges
%% - Images
%% - Links
%% - Bibliography
%% - Arguments
%% - Title page
%% - Blank page
%% - Examination page
%% - Copyright page
%%
%%
%% Class arguments:
%% - LICENCE: "crerativecommons" (default) or "nonprofituse"
%% -"creativecommons" = CC licence
%% -"nonprofituse" = Only non-profit use allowed
%%
%% - Bibliography Style: "apa" or "ieee" (default)
%% - "apa" = APA style references
%% - "ieee" = IEEE style references
%%
%%
%%
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Class info
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
% Class Information
\newcommand\filename{ntua-ece-thesis}
\newcommand\fileversion{1.0}
\newcommand\filedate{2022/12/20}
\ProvidesClass{ntua-ece-thesis}[\filedate\space v\fileversion\space NTUA ECE Thesis class.]
% Defining licence type
\newcommand{\@license}{0}
\DeclareOption{nonprofituse}{\renewcommand{\@license}{1}}
\DeclareOption{creativecommons}{\renewcommand{\@license}{0}}
% Defining bibliography style
\newcommand{\@bibstyle}{apa}
\DeclareOption{apa}{\renewcommand{\@bibstyle}{apa}}
\DeclareOption{ieee}{\renewcommand{\@bibstyle}{ieee}}
\ProcessOptions\relax
\LoadClass[11pt, twoside, a4paper]{report}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Text control- ragged2e needs to be loaded first
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[document]{ragged2e}
\RequirePackage{csquotes}
\RequirePackage{parskip}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Math Fonts - need to be loaded second
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{amsmath}
\RequirePackage{amssymb}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Control Flow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{etoolbox} % ifdefempty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Page styles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[a4paper, total={15cm, 20cm}]{geometry}
% https://latexref.xyz/_005craggedbottom.html
\raggedbottom
% Use Arabic numerals (1, 2, 3, etc.) for all pages.
% The title page counts as page 1.
\pagenumbering{arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Languages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[english, greek]{babel} % Greek and english
\RequirePackage{alphabeta}
% typeset short english phrases
\newcommand{\en}[1]{\foreignlanguage{english}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[LGR, T1]{fontenc} % Set the font (output) encodings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Images
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{graphicx} % Package for images
% Set the \pyrforos command to return the image.
\newcommand{\pyrforos}{logo/pyrforos.eps}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Links
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=black,
filecolor=magenta,
urlcolor=blue,
pdftitle={\@title},
}
\urlstyle{same}
\NewCommandCopy{\oldurl}{\url}
\renewcommand{\url}[1]{\en{\oldurl{#1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[
backend=biber, % Default liblatex backend
style=\@bibstyle, % Depending on the cls parameters
sorting=ynt, % Year Name Title sorting
autolang=other % Use babel for language selection on bibliography
]{biblatex}
\addbibresource{thesis.bib}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Arguments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Implementation from:
% https://stackoverflow.com/questions/2833954/how-do-i-create-a-command-like-title-in-latex
% School sector
\newcommand\thesissector[1]{\renewcommand\@thesissector{#1}}
\newcommand\@thesissector{\ClassError{ntua-ece-thesis}{No \noexpand\thesissector given}}
% Lab of the sector (optional)
\newcommand\thesislab[1]{\renewcommand\@thesislab{#1}}
\newcommand\@thesislab{}
% Pronoun of the author
\newcommand\thesisauthorpronoun[1]{\renewcommand\@thesisauthorpronoun{#1}}
\newcommand\@thesisauthorpronoun{\ClassError{ntua-ece-thesis}{No \noexpand\thesisauthorpronoun given}}
% Genetive of the authors name
\newcommand\authorgenitive[1]{\renewcommand\@authorgenitive{#1}}
\newcommand\@authorgenitive{\ClassError{ntua-ece-thesis}{No \noexpand\authorgenitive given}}
% Name of the supervisor
\newcommand\thesissupervisorname[1]{\renewcommand\@thesissupervisorname{#1}}
\newcommand\@thesissupervisorname{\ClassError{ntua-ece-thesis}{No \noexpand\thesissupervisorname given}}
% Title of the supervisor
\newcommand\thesissupervisortitle[1]{\renewcommand\@thesissupervisortitle{#1}}
\newcommand\@thesissupervisortitle{\ClassError{ntua-ece-thesis}{No \noexpand\thesissupervisortitle given}}
% Date of submission
\newcommand\thesissubmissiondate[1]{\renewcommand\@thesissubmissiondate{#1}}
\newcommand\@thesissubmissiondate{\ClassError{ntua-ece-thesis}{No \noexpand\thesissubmissiondate given}}
% Year of submission
\newcommand\submissionyear[1]{\renewcommand\@submissionyear{#1}}
\newcommand\@submissionyear{\ClassError{ntua-ece-thesis}{No \noexpand\submissionyear given}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Title Page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\maketitle}%
{
\begin{titlepage}
% Set the pagestyle to "empty"
\thispagestyle{empty}
\begin{center}
\includegraphics[width=2.5cm]{\pyrforos}\\
\Large{Ε}\large{ΘΝΙΚΟ}
\Large{Μ}\large{ΕΤΣΟΒΙΟ}
\Large{Π}\large{ΟΛΥΤΕΧΝΕΙΟ} \\
\normalsize{Σ}\small{ΧΟΛΗ}
\normalsize{Η}\small{ΛΕΚΤΡΟΛΟΓΩΝ}
\normalsize{Μ}\small{ΗΧΑΝΙΚΩΝ}
\normalsize{Κ}\small{ΑΙ}
\normalsize{Μ}\small{ΗΧΑΝΙΚΩΝ}
\normalsize{Υ}\small{ΥΠΟΛΟΓΙΣΤΩΝ} \\
\@thesissector \\
% If lab is not defined don't show anything, else show the lab.
\ifdefempty{\@thesislab}{}{\@thesislab \\}
\vspace{8ex}
\large \textbf{\@title} \\
\vspace{10ex}
\large
ΔΙΠΛΩΜΑΤΙΚΗ ΕΡΓΑΣΙΑ \\
\vspace{2ex}
\normalsize
\@thesisauthorpronoun \\
\vspace{2ex}
\parbox[c]{0.5\textwidth}{\center\textbf{\@authorgenitive}}
\vspace{10ex}
\end{center}
\begin{tabbing}
\textbf{Επιβλέπων}: \= \@thesissupervisorname \\
\> \@thesissupervisortitle
\end{tabbing}
\vspace{2ex}
\begin{center}
\@date
\end{center}
\end{titlepage}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Blank Page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Code from:
% https://tex.stackexchange.com/questions/36880/insert-a-blank-page-after-current-page
\newcommand{\blankpagecount}{%
\clearpage%
\thispagestyle{empty}%
\null%
\clearpage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Examination Page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Defence date
\newcommand\thesisdefencedate[1]{\renewcommand\@thesisdefencedate{#1}}
\newcommand\@thesisdefencedate{\ClassError{ntua-ece-thesis}{No \noexpand\thesisdefencedate given}}
% First examiner name
\newcommand\firstexaminername[1]{\renewcommand\@firstexaminername{#1}}
\newcommand\@firstexaminername{\ClassError{ntua-ece-thesis}{No \noexpand\firstexaminername given}}
% First examiner title
\newcommand\firstexaminertitle[1]{\renewcommand\@firstexaminertitle{#1}}
\newcommand\@firstexaminertitle{\ClassError{ntua-ece-thesis}{No \noexpand\firstexaminertitle given}}
% Second examiner name
\newcommand\secondexaminername[1]{\renewcommand\@secondexaminername{#1}}
\newcommand\@secondexaminername{\ClassError{ntua-ece-thesis}{No \noexpand\secondexaminername given}}
% Second examiner title
\newcommand\secondexaminertitle[1]{\renewcommand\@secondexaminertitle{#1}}
\newcommand\@secondexaminertitle{\ClassError{ntua-ece-thesis}{No \noexpand\secondexaminertitle{} given}}
% Third examiner name
\newcommand\thirdexaminername[1]{\renewcommand\@thirdexaminername{#1}}
\newcommand\@thirdexaminername{\ClassError{ntua-ece-thesis}{No \noexpand\thirdexaminername given}}
% Third examiner title
\newcommand\thirdexaminertitle[1]{\renewcommand\@thirdexaminertitle{#1}}
\newcommand\@thirdexaminertitle{\ClassError{ntua-ece-thesis}{No \noexpand\thirdexaminertitle given}}
\newcommand{\examinationpage}{%
\thispagestyle{empty}
\begin{center}
\begin{minipage}{0.2\textwidth}
\includegraphics[width=2.5cm]{\pyrforos}
\end{minipage}%
%
\begin{minipage}{0.6\textwidth}
\textbf{%
\normalsize{Ε}\small{ΘΝΙΚΟ}
\normalsize{Μ}\small{ΕΤΣΟΒΙΟ}
\normalsize{Π}\small{ΟΛΥΤΕΧΝΕΙΟ}} \\
\small
ΤΜΗΜΑ ΗΛΕΚΤΡΟΛΟΓΩΝ ΜΗΧΑΝΙΚΩΝ ΚΑΙ \\
ΜΗΧΑΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ \\
\@thesissector \\
% If lab is not defined don't show anything, else show the lab.
\ifdefempty{\@thesislab}{}{\@thesislab \\}
\end{minipage}
\vspace{8ex}
\large \textbf{\@title} \\
\vspace{10ex}
\large
ΔΙΠΛΩΜΑΤΙΚΗ ΕΡΓΑΣΙΑ \\
\vspace{2ex}
\normalsize
\@thesisauthorpronoun \\
\vspace{2ex}
\parbox[c]{0.5\textwidth} { \center\textbf{\@authorgenitive}}
\vspace{10ex}
\begin{tabbing}
\textbf{Επιβλέπων}: \= \@thesissupervisorname \\
\> \@thesissupervisortitle
\end{tabbing}
\end{center}
\vspace{2ex}
Εγκρίθηκε από την τριμελή εξεταστική επιτροπή την \@thesisdefencedate.
\vspace{6ex}
\begin{center}
\scriptsize
\parbox[b]{0.3\textwidth} {\center
........................................\\
\@firstexaminername\\
\@firstexaminertitle
}
\parbox[b]{0.3\textwidth} {\center
........................................\\
\@secondexaminername\\
\@secondexaminertitle
}
\parbox[b]{0.3\textwidth} {\center
........................................\\
\@thirdexaminername\\
\@thirdexaminertitle
}
\end{center}
\vspace{10ex}
\normalsize\center\@date.
\newpage
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyrights Page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\@creativecommons}{%
Η Εργασία διατίθεται με άδεια \en{Creative Commons} Αναφορά Δημιουργού 4.0 Διεθνές.
Για να δείτε ένα αντίγραφο αυτής της άδειας, επισκεφθείτε το \url{http://creativecommons.org/licenses/by/4.0/}
ή στείλετε επιστολή στο \en{Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.}
}
\newcommand{\@nonprofituse}{%
Απαγορεύεται η αντιγραφή, αποθήκευση και διανομή της παρούσας Εργασίας,
εξ ολοκλήρου ή τμήματος αυτής, για εμπορικό σκοπό. Επιτρέπεται η ανατύπωση,
αποθήκευση και διανομή για σκοπό μη κερδοσκοπικό, εκπαιδευτικής ή
ερευνητικής φύσης, υπό την προϋπόθεση να αναφέρεται η πηγή προέλευσης και
να διατηρείται το παρόν μήνυμα. Ερωτήματα που αφορούν τη χρήση της Εργασίας
για κερδοσκοπικό σκοπό πρέπει να απευθύνονται προς τον συγγραφέα.
}
\newcommand{\copyrightspage}{%
\thispagestyle{empty}
\vspace*{35ex}
\begin{FlushLeft}
\
................................... \\
\textbf{\@author} \\
Διπλωματούχος Ηλεκτρολόγος Μηχανικός και Μηχανικός Υπολογιστών Ε.Μ.Π. \\
\vspace{30ex}
\small \en{\copyright} \hspace{0.5em} \@author, \@submissionyear.\\
\end{FlushLeft}
\vspace{5ex}
\begin{justify}
\ifnum \@license=0
\noindent \@creativecommons
\else
\noindent \@nonprofituse
\fi
\end{justify}
\begin{justify}
\noindent
Οι απόψεις και τα συμπεράσματα που περιέχονται σε αυτό το έγγραφο εκφράζουν
τον συγγραφέα και δεν πρέπει να ερμηνευθεί ότι αντιπροσωπεύουν τις επίσημες θέσεις του
Εθνικού Μετσόβιου Πολυτεχνείου.
\end{justify}
}