-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsapienzathesis.sty
More file actions
238 lines (216 loc) · 5.91 KB
/
sapienzathesis.sty
File metadata and controls
238 lines (216 loc) · 5.91 KB
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
% ============================================== %
% Author: edoardottt <edoardottt.com>
%
% Original code taken from FronteSpizioSapienza by Michele Laurenti <[email protected]>
%
% Simple package for thesis title pages compliant
% to the Sapienza's requirements.
% Reference taken from La Sapienza's website.
%
% Package is provided as-is under GPL-3.0 license.
%
% https://github.com/edoardottt/sapienza-latex-thesis
% ============================================== %
\ProvidesPackage{SapienzaThesis}[2023/04/16]
\RequirePackage[a4paper]{geometry}
\RequirePackage[utf8]{inputenc}
\RequirePackage{color}
\RequirePackage{anyfontsize}
\RequirePackage{ifthen}
\RequirePackage{tabularx}
\RequirePackage{graphicx}
% Sapienza's color
\definecolor{SapienzaTColorRed}{RGB}{111,10,25}
% set sans serif font to arial
\renewcommand{\sfdefault}{phv}
% declare default lengths
\newlength{\SapienzaTTitleSpace}
\newlength{\SapienzaTFacultySpace}
\newlength{\SapienzaTCandidateSpace}
\newlength{\SapienzaTSupervisorSpace}
\newlength{\SapienzaTAcademicYearSpace}
\newlength{\SapienzaTTabularLength}
% set default lengths
\setlength{\SapienzaTTitleSpace}{6.15cm}
\setlength{\SapienzaTFacultySpace}{7cm}
\setlength{\SapienzaTCandidateSpace}{1cm}
\setlength{\SapienzaTSupervisorSpace}{1cm}
\setlength{\SapienzaTAcademicYearSpace}{.5cm}
% length for Supervisor/co-Supervisor table
\setlength{\SapienzaTTabularLength}{0.9\textwidth}
\makeatletter
% commands to get info from the user
\newcommand{\STTitle}[1]{\def\@ST@Title{#1}\title{#1}}
\newcommand{\STFaculty}[1]{\def\@ST@Faculty{#1}}
\newcommand{\STBCourse}[1]{\def\@ST@BCourse{#1}}
\newcommand{\STMCourse}[1]{\def\@ST@MCourse{#1}}
\newcommand{\STChair}[1]{\def\@ST@Chair{#1}}
\newcommand{\STCandidate}[1]{\def\@ST@Candidate{#1}\author{#1}}
\newcommand{\STMatricola}[1]{\def\@ST@Matricola{#1}}
\newcommand{\STSupervisor}[1]{\def\@ST@Supervisor{#1}}
\newcommand{\STCoSupervisor}[1]{\def\@ST@CoSupervisor{#1}}
\newcommand{\STAcademicYear}[1]{\def\@ST@AcademicYear{#1}}
% commands to set text for Supervisor/CoSupervisor
\newcommand{\STTextSupervisor}[1]{\def\@ST@Text@Supervisor{#1}}
\newcommand{\STTextCoSupervisor}[1]{\def\@ST@Text@CoSupervisor{#1}}
% empty defaults
\def\@ST@Chair{}
\def\@ST@MCourse{}
\def\@ST@CoSupervisor{}
% text default for Supervisor/CoSupervisor
\def\@ST@Text@Supervisor{Supervisor}
\def\@ST@Text@CoSupervisor{Co-Supervisor}
% print info commands
\def\SapienzaTPrintTitle{\@ST@Title}
\def\SapienzaTPrintFaculty{\@ST@Faculty}
\def\SapienzaTPrintBCourse{\@ST@BCourse}
\def\SapienzaTPrintMCourse{\@ST@MCourse}
\def\SapienzaTPrintChair{\@ST@Chair}
\def\SapienzaTPrintCandidate{\@ST@Candidate}
\def\SapienzaTPrintMatricola{\@ST@Matricola}
\def\SapienzaTPrintSupervisor{\@ST@Supervisor}
\def\SapienzaTPrintCoSupervisor{\@ST@CoSupervisor}
\def\SapienzaTPrintAcademicYear{\@ST@AcademicYear}
\def\SapienzaTPrintTextSupervisor{\@ST@Text@Supervisor}
\def\SapienzaTPrintTextCoSupervisor{\@ST@Text@CoSupervisor}
% check if info available
\def\skipChair{\equal{\@ST@Chair}{}}
\def\skipMCourse{\equal{\@ST@MCourse}{}}
\def\skipCoSupervisor{\equal{\@ST@CoSupervisor}{}}
\makeatother
\newcommand{\SapienzaTMakeLogo}{%
\hspace*{-2cm}% -2cm horizontal skip to align logo with text
\includegraphics[width=4cm]{./logo-sapienza.eps}%
\par%
}
\newcommand{\SapienzaTMakeTitle}{%
\vspace{\SapienzaTTitleSpace}%
{%
\fontsize{20pt}{24pt}\selectfont%
\noindent%
\sffamily%
\color{SapienzaTColorRed}%
\SapienzaTPrintTitle%
\par%
}%
}
\newcommand{\SapienzaTMakeFacultyCourseChair}{%
\vspace{\SapienzaTFacultySpace}%
% faculty
{%
\fontsize{10pt}{12pt}\selectfont%
\noindent%
\sffamily%
\bfseries%
\color{SapienzaTColorRed}%
Faculty of \SapienzaTPrintFaculty%
\par%
}%
% Degree course
\ifthenelse{\skipMCourse}{%
{%
\fontsize{10pt}{12pt}\selectfont%
\noindent%
\sffamily%
\bfseries%
\color{SapienzaTColorRed}%
Bachelor's Degree in \SapienzaTPrintBCourse%
\par%
}%
}%
{%
{%
\fontsize{10pt}{12pt}\selectfont%
\noindent%
\sffamily%
\bfseries%
\color{SapienzaTColorRed}%
Master's Degree in \SapienzaTPrintMCourse%
\par%
}%
}%
% chair (optional)
\ifthenelse{\skipChair}{}{%
{%
\fontsize{10pt}{12pt}\selectfont%
\noindent%
\sffamily%
Chair of \SapienzaTPrintChair%
\par%
}%
}%
}
\newcommand{\SapienzaTMakeCandidate}{%
\vspace{\SapienzaTCandidateSpace}%
{%
\fontsize{10pt}{12pt}\selectfont%
\noindent%
\sffamily%
\SapienzaTPrintCandidate%
\protect\newline%
\SapienzaTPrintMatricola%
\par%
}%
}
\newcommand{\SapienzaTMakeSupervisorCoSupervisor}{%
\vspace{\SapienzaTSupervisorSpace}%
\noindent%
\ifthenelse{\skipCoSupervisor}{%
{%
\fontsize{10pt}{12pt}\selectfont%
\sffamily%
\SapienzaTPrintTextSupervisor%
\protect\newline%
\sffamily%
\SapienzaTPrintSupervisor%
}%
}{%
\begin{tabularx}{\SapienzaTTabularLength}{@{}Xl}%
\fontsize{10pt}{12pt}\selectfont%
\sffamily%
\SapienzaTPrintTextSupervisor%
&%
\fontsize{10pt}{12pt}\selectfont%
\sffamily%
\SapienzaTPrintTextCoSupervisor \\%
\fontsize{10pt}{12pt}\selectfont%
\sffamily%
\SapienzaTPrintSupervisor%
&%
\fontsize{10pt}{12pt}\selectfont%
\sffamily%
\SapienzaTPrintCoSupervisor \\%
\end{tabularx}%
}%
\par%
}
\newcommand{\SapienzaTMakeAcademicYear}{%
\vspace{\SapienzaTAcademicYearSpace}%
{%
\fontsize{10pt}{12pt}\selectfont%
\noindent%
\sffamily%
Academic Year \SapienzaTPrintAcademicYear%
\par%
}%
}
\renewcommand{\maketitle}{%
% margins as suggested by Sapienza
\newgeometry{left=4cm,top=2.75cm,right=2.5cm,bottom=1cm}%
% no page number
\thispagestyle{empty}%
% Sapienza's logo
\SapienzaTMakeLogo%
% title
\SapienzaTMakeTitle%
% faculty, degree and (optionally) course
\SapienzaTMakeFacultyCourseChair%
% candidate and matricola
\SapienzaTMakeCandidate%
% Supervisor and (optionally) co-Supervisor
\SapienzaTMakeSupervisorCoSupervisor%
% academic year
\SapienzaTMakeAcademicYear%
% restore document geometry
\restoregeometry%
}