Debian Codegraph @

texmf-dist/source/latex/toptesi/toptesi.dtx

raw
1 % \iffalse meta-comment
2 % !TEX TS-program = pdflatex
3 % !TEX encoding = UTF-8 Unicode
4 %<*internal>
5 \begingroup
6 \input docstrip.tex
7 \keepsilent
8
9
10 \preamble
11 ______________________________________________________
12 The TOPtesi bundle
13 Copyright (C) 1989-2025 Claudio Beccari
14 All rights reserved
15
16 License information appended
17
18 \endpreamble
19 \postamble
20
21 Copyright 2005-2025 Claudio Beccari
22
23 Distributable under the LaTeX Project Public
24 License, version 1.3c or higher (your choice).
25 The latest version of this license is at:
26 http://www.latex-project.org/lppl.txt
27
28 For important further details see the English or
29 the Italian documentation.
30
31 This work is "author-maintained"
32
33 This work consists of this file toptesi.dtx, a README file
34 the manifest.txt file, and the derived files:
35 toptesi.cls,
36 toptesi.sty,
37 topfront.sty,
38 topcommand.sty,
39 toptesi-scudo.sty,
40 toptesi.cfg,
41 toptesi-monografia.sty,
42 toptesi-sss.sty,
43 toptesi-magistrale.sty,
44 toptesi-dottorale.sty,
45 and the English documentation toptesi.pdf.
46
47 Furthermore the bundle contains the documentation
48 source file toptesi-it.tex and the derived file
49 toptesi-it.pdf.
50
51 The toptesi-example.tex source file is just an
52 example that shows how to use the various commands;
53 by commenting or uncommenting certain source lines
54 it is possible to typeset different kind of theses
55 and their front pages.
56
57 The topfront-example.tex source file is an example
58 of how to produce just the title page with TOPtesi
59 and the external package frontespizio.
60
61 The toptesi-scudo-example.tex source file is an
62 example that shows the particular features
63 available with TOPtesi, when a doctoral thesis is
64 produced for the Scuola di Dottorato (ScuDo) of
65 Politecnico di Torino.
66
67 The toptesi.cfg file is a sample of a local
68 configuration file that can be copied to another
69 file with different name and its copy freely
70 edited and customised.
71
72 The other toptesi-*.sty files are extension modules
73 for typesetting the specific thesis kinds described
74 by the suffix that replaces the asterisk.
75
76 By running pdflatex on toptesi.dtx the user gets
77 the class, sty and cfg files and the English
78 documentation file in PDF format.
79
80 The source file of the Italian documentation file
81 toptesi-it.pdf is another example of how to use
82 TOPtesi. This file toptesi-it.tex may be typeset
83 with pdfLaTeX, XeLaTeX, and LuaLateX; see the first
84 comment lines of the file for how-to information.
85 In spite of being mainly written in Italian, it
86 contains several sections in English for the
87 benefit of foreign students attending the Doctoral
88 School of Turin.
89 \endpostamble
90
91 \askforoverwritefalse
92
93 \generate{\file{toptesi.cls}{\from{toptesi.dtx}{class}}
94 \file{toptesi.sty}{\from{toptesi.dtx}{topsty}}
95 \file{topcoman.sty}{\from{toptesi.dtx}{topcmn}}
96 \file{topfront.sty}{\from{toptesi.dtx}{topfrn}}
97 \file{toptesi.cfg}{\from{toptesi.dtx}{topcfg}}
98 \file{toptesi-scudo.sty}{\from{toptesi.dtx}{topscu}}
99 \file{toptesi-monografia.sty}{\from{toptesi.dtx}{topmon}}
100 \file{toptesi-sss.sty}{\from{toptesi.dtx}{topsss}}
101 \file{toptesi-magistrale.sty}{\from{toptesi.dtx}{topmag}}
102 \file{toptesi-dottorale.sty}{\from{toptesi.dtx}{topdoc}}
103 }
104
105 \def\tmpa{plain}
106 \ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
107 \endgroup
108 %</internal>
109 %
110 % Copyright 1989--202% Claudio Beccari
111 %
112 % This file is part of the TOPtesi bundle
113 % -------------------------------------------
114 %
115 % It may be distributed and/or modified under the
116 % conditions of the LaTeX Project Public License,
117 % either version 1.3 of this license or (at your
118 % option) any later version.
119 % The latest version of this license is in
120 % http://www.latex-project.org/lppl.txt
121 % and version 1.3 or later is part of all
122 % distributions of LaTeX version 2003/12/01 or
123 % later.
124 %
125 % This file has the LPPL maintenance status
126 % "author-maintained".
127 %
128 % The list of all files belonging to the TOPtesi
129 % bundle is given in the file `REASME.txt'.
130 %
131 % The set of derived (unpacked) files belonging to
132 % the distribution
133 % and covered by LPPL is created by the self
134 % unpacking file toptesi.dtx which is the principal
135 % part of the distribution.
136 %
137 % \fi
138 %
139 % \iffalse
140 %^^A The following trick uses the same date for every file header.
141 %<class,topsty,topcmn,topfrn,topscu,topmon,topsss,topmag>\NeedsTeXFormat{LaTeX2e}[2018/01/01]
142 %<*driver>
143 \ProvidesFile{toptesi.dtx}[%
144 %</driver>
145 %<class>\ProvidesClass{toptesi}[%
146 %<topsty>\ProvidesPackage{toptesi}[%
147 %<topcmn>\ProvidesPackage{topcoman}[%
148 %<topfrn>\ProvidesPackage{topfront}[%
149 %<topscu>\ProvidesPackage{toptesi-scudo}[%
150 %<topmon>\ProvidesPackage{toptesi-monografia}[%
151 %<topsss>\ProvidesPackage{toptesi-sss}[%
152 %<topmag>\ProvidesPackage{toptesi-magistrale}[%
153 %<topdoc>\ProvidesPackage{toptesi-dottorale}[%
154 %<*driver,class,topsty,topcmn,topfrn,topscu,topmon,topsss,topmag,topdoc>
155 2025-01-15 v.6.4.07
156 %<class>Class for typesetting university theses]
157 %<topsty>Extension for toptesi.cls]
158 %<topcmn>Additional commands for the TOPtesi bundle]
159 %<topfrn>Title page for TOPtesi and other classes]
160 %<topscu>Extension for ScuDo theses]
161 %<topmon>Bachelor degree title page]
162 %<topsss>High school title page]
163 %<topmag>Master degree title page]
164 %<topdoc>Ph.D. degree title page]
165 %</driver,class,topsty,topcmn,topfrn,topscu,topmon,topsss,topmag,topdoc>
166 %<*driver>
167 ]
168 %</driver>
169 %<*driver>
170 \documentclass{ltxdoc}
171 \GetFileInfo{toptesi.dtx}
172 \title{The TOPtesi bundle}
173 \date{\fileversion\space--- \filedate}
174 \author{\makebox[\textwidth]{Claudio Beccari --- \texttt{claudio dot beccari at gmail dot com}}}
175 \usepackage[utf8]{inputenc}
176 \usepackage[LGR,T1]{fontenc}
177 \usepackage{metalogo,multicol,enumitem,xspace,
178 xparse,curve2e,etoolbox,FramedSyntax}
179 \let\originalmeta\meta
180 \renewcommand\meta[1]{{\normalfont\originalmeta{#1}}}
181 \providecommand\cs{}
182 \def\cs#1{\textnormal{\ttfamily\char92 #1}}
183 \def\prog#1{\textsf{#1}}
184 \def\pack#1{\textsf{\slshape#1}}
185 \def\env#1{\textit{#1}}\let\amb\env
186 \def\file#1{\texttt{#1}}\let\class\file
187 \def\marg#1{{\normalfont\texttt{\{}\meta{#1}\texttt{\}}}}
188 \def\Marg#1{{\texttt{\{#1\}}}}
189 \def\opz#1{{\normalfont\textsl{#1}}}
190 \def\oarg#1{{\normalfont\texttt{[\meta{#1}]}}}
191 \def\Oarg#1{{\normalfont\texttt{[#1]}}}
192 \def\parg#1{{\normalfont\texttt{(\meta)}}}
193 \def\Parg#1{{\normalfont\texttt{(#1)}}}
194 \def\TeXLive{TeXLive\xspace}
195 \def\pdfLaTeX{pdf\/\LaTeX\unskip\xspace}
196 \newcommand*\Bambiente[1]{\texttt{\char92begin}\Marg{#1}}
197 \newcommand*\Eambiente[1]{\texttt{\char92end}\Marg{#1}}
198 \DeclareRobustCommand\sigla[1]{\lowercase{\textsc{#1}}}
199 \newenvironment{ttsintassi}{\flushleft\ttfamily\obeylines}{\endflushleft}
200 %
201 %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
202 % Some macros to typeset a framed box of natural or specified
203 % width and height within the picture environment.
204 % Needs packages curve2e, etoolbox, and xparse.
205 % Syntax:
206 % \Zbox(<position>)(<dimensions>)[<alignment>]{<box contents>}
207 % The first and fourth arguments are mandatory; the second
208 % and third arguments are optional; their default values are
209 % (0,0) and [bl]. Furthermore the <position> and <dimension>
210 % values are a comma separated pair of numbers representing
211 % measures in \unitlength units, as well as it is done within the
212 % picture environment. No provision is coded to take the measure
213 % of the <box contents>. This contents should be some text, and when
214 % <dimensions> are specified larger than zero, a \parbox is used
215 % to typeset it. The <alignment> value(s) define the reference point
216 % that is \put at the <position> coordinates.
217 %
218 \def\TOPsplitArgs(#1,#2)#3#4{\edef#3{#1}\edef#4{#2}}
219 \providecommand\Zbox{}
220 \RenewDocumentCommand\Zbox{R(){0,0} D(){0,0} O{bl} m}{%
221 \TOPsplitArgs(#2)\ZboxX\ZboxY % separa la x e la y della scatola
222 \fboxsep=2\unitlength
223 \ifnum\ZboxX=\csuse{z@}
224 \def\ZTesto{\fbox{#4}}%
225 \else
226 \ifnum\ZboxY=\csuse{z@}
227 \def\ZTesto{\fbox{\parbox{\ZboxX\unitlength}{#4}}}%
228 \else
229 \def\ZTesto{%
230 \setbox2560=\hbox{\fbox{%
231 \parbox[c][\ZboxY\unitlength][c]{\ZboxX\unitlength}{#4}}}%
232 \dimen2560=\dimexpr(\ht2560 +\dp2560)/2\relax
233 \ht2560=\dimen2560\relax
234 \dp2560=\dimen2560\relax
235 \box2560%
236 }%
237 \fi
238 \fi
239 \put(#1){\makebox(0,0)[#3]{\ZTesto}}}
240
241 \NewDocumentCommand\fileicon{R(){0,0} m}{%
242 \put(#1){\moveto(0,-10)
243 \curveto(7.5,-10)(7.5,-7.5)(15,-7.5)
244 \lineto(15,10)
245 \curveto(7.5,10)(7.5,7.5)(0,7.5)
246 \lineto(0,-10)
247 \strokepath}\put(#1){\put(7.5,0){\makebox(0,0){\ttfamily#2}}}
248 }
249
250 \def\ifTOPnextchar{\csuse{@ifnextchar}}
251
252 \def\polyvector(#1){\def\TOPlastpoint{#1}\TOPpolyvector}
253
254 \def\TOPpolyvector(#1){\ifTOPnextchar({\segment(\TOPlastpoint)(#1)%
255 \def\TOPlastpoint{#1}\TOPpolyvector}{\VECTOR(\TOPlastpoint)(#1)}} % )
256
257
258 %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
259
260 \begin{document}\errorcontextlines=9
261 \maketitle
262 \begin{multicols}{2}
263 \tableofcontents
264 \end{multicols}
265 \setlength\hfuzz{20pt}
266 \DocInput{toptesi.dtx}
267 \end{document}
268 %</driver>
269 % \fi
270 %
271 % \CheckSum{8004}
272 %
273 % \begin{abstract}
274 % This file describes the TOPtesi bundle; it consists of a set
275 % of files designed to typeset a university final report that in
276 % Italian is generally called “tesi”; it was originally
277 % developed at the Technical Institute of Turin (Politecnico di
278 % Torino) but it was adapted for typesetting theses in any
279 % Italian university.
280 % Well\dots\ since the Erasmus student mobility is very extended
281 % and many Italian students participate in the so called
282 % \textit{double degree} programs, their theses, or whatever
283 % they are called in other countries, may be typeset so as to
284 % comply also with the host university rules; therefore this set
285 % of files has the ambition to be suited for typesetting theses
286 % in any university in the world\dots\ This ambition can't be
287 % fulfilled, though, because of the complexity of the title
288 % page (and possibly of the copyright page) requirements.
289 %
290 % This version is compliant with the \XeLaTeX\ and the
291 % \LuaLaTeX\ programs. Up to now the few conflicts that have
292 % been spotted have been solved with suitable corrections or
293 % additions. The most important feature with \XeLaTeX\ is that
294 % the option \opz{pdfa} cannot be used any more; this is due to
295 % the fact that the typesetting engine \XeTeX\ does not directly
296 % produce any \sigla{PDF} output but a modified, extended DVI
297 % one, that is immediately converted into a \sigla{PDF} file
298 % through |xdvipdfmx|, a special version of the conversion
299 % program. Another minor \XeLaTeX\ feature is that it cannot
300 % fully exploit the typesetting facilities of the |microtype|
301 % package, but the wide choice of OpenType font properties
302 % replaces almost completely such missing |microtype| features.
303 %
304 % With version~6.xx, the bundle has been modularised in a
305 % (hopefully) more efficient way, although it is backwards
306 % compatible, so that version~5.xx functionalities are still
307 % available.
308 %
309 % A totally new module is the one that allows to typeset the
310 % Italian high school “tesina”, a document that is examined by
311 % the graduation exam committee at the end of secondary studies.
312 %
313 % Users should not be scared by the number of pages of this
314 % documentation; they should read part of the first 31 pages,
315 % those that concern their theses. The rest is just the code
316 % and its documentation; it is useful mostly for me, as the
317 % author, and to other programmers and/or curious users.
318 % “Normal” users should not spend their time to read
319 % unnecessary information.
320 %
321 % \textcolor{red}{This bundle is distributed under the \LaTeX\
322 % Project Public Licence (LPPL) which is appended to the Italian
323 % documentation file \texttt{toptesi-it.pdf} included in this
324 % bundle; personal customisation of parts of this bundle are
325 % discouraged but are permitted only in conformance with the
326 % LPPL. See also section~\ref{sec:LPPL} in this document.}
327 % \end{abstract}
328 %
329 % \section{History}
330 % The TOPtesi bundle at its very beginning in the early nineties
331 % was just one |.sty| file to be used with the |report| class.
332 % At that time there was only \LaTeX{\,209} and extension
333 % packages were called “style files”; the |.sty| extension
334 % is still used today for backwards compatibility, but |.sty|
335 % files are not any more used to change the style of the
336 % document.
337 %
338 % With version 2.x, suitable for \LaTeXe, the bundle was
339 % modified in order to have a class of its own,
340 % |toptesi.cls|, which provided to collect the necessary
341 % options and to pass them to the |report| class; it
342 % loaded the |toptesi.sty| package just afterwords.
343 %
344 % The latter file was not monolithic any more; it was split
345 % in three parts: |toptesi.sty| contained most settings and
346 % the macros to be used in the body of the document;
347 % |topfront.sty| provided the commands for entering all the
348 % necessary and optional data for the title page and actually
349 % typeset the title page in different styles; |topcoman.sty|
350 % contained the definitions of several useful commands; actually
351 % this module could be used without reference to the TOPtesi
352 % bundle, being suitable as an extension to any class.
353 %
354 % The general scheme may be represented by the flow diagram
355 % in figure~\ref{fig:simple-flow-diagram}.
356 %\begin{figure}\centering
357 %\unitlength=0.00925\textwidth
358 %\begin{picture}(106,20)
359 %\fileicon(0,10){.tex}\VECTOR(15,10)(20,10)
360 %\Zbox(20,10)(18,0)[l]{\ttfamily toptesi.cls\\toptesi.sty}\VECTOR(41.5,10)(47,10)
361 %\Zbox(47,10)[l]{\ttfamily topfront}\VECTOR(63.5,10)(70,10)
362 %\Zbox(70,10)[l]{\ttfamily topcoman}\VECTOR(86.5,10)(91,10)
363 %\fileicon(91,10){.pdf}
364 %\end{picture}
365 %\caption{Quasi original TOPtesi bundle flow diagram}
366 %\label{fig:simple-flow-diagram}
367 %\end{figure}
368 %
369 % Version 3.x was modified, on request of several users, in
370 % order to avoid the |toptesi.cls| class file, but to allow
371 % the other files, from |toptesi.sty| on, to be used with
372 % any standard or custom class.
373 %
374 % On request of other users, after other upgrades, the bundle
375 % was upgraded to version 5.85; the purpose was to introduce the
376 % possibility of typesetting the thesis title page with a
377 % package totally independent from the TOPtesi bundle.
378 % particular the |frontespizio| package by Enrico Gregorio was
379 % considered a fancy choice for most Italian users, but the new
380 % approach was open to any other package. The choice was made by
381 % setting suitable switches (boolean variables). The solution
382 % opened the bundle to other external contributions, although
383 % the mechanism was sort of tricky. The bundle was made
384 % compatible with other packages, for example |caption|
385 % and/or |geometry|, while before this change such packages
386 % produced option clashes and/or other errors, so that their use
387 % was explicitly forbidden. Meanwhile the |topfront| module
388 % was configured to be loaded just after the preamble end,
389 % so as to be able to check if the user loaded packages that
390 % required special attention in order to avoid conflicts;
391 % see figure~\ref{fig:toptesi+frontspizio}.
392 %
393 %\begin{figure}\centering\unitlength=0.009\textwidth
394 %\begin{picture}(115,45)(0,-3)
395 %\fileicon(0,10){.tex}\VECTOR(15,10)(20,10)
396 %\Zbox(20,10)(18,0)[l]{\ttfamily toptesi.cls\\toptesi.sty}
397 %\Zbox(20,30)(18,0)[l]{\centering\ttfamily user loaded\\packages}
398 %\VECTOR(42,10)(50,10)
399 %\VECTOR(31,23)(31,15)
400 %\polygon(50,10)(55,5)(60,10)(55,15)
401 %\polyvector(55,5)(55,0)(60,0)
402 %\Zbox(60,0)[l]{\ttfamily topfront}
403 %\polyvector(55,15)(55,20)(60,20)
404 %\Zbox(60,20)[l]{\ttfamily frontespizio}
405 %\VECTOR(42,30)(47,30)\put(49,30){\circle{4}}\VECTOR(51,30)(60,30)
406 %\polyvector(42,12)(49,12)(49,28)
407 %\Zbox(60,30)[l]{\ttfamily topcoman}
408 %\put(87,10){\circle{4}}\VECTOR(89,10)(95,10)
409 %\polyvector(84,20)(87,20)(87,12)
410 %\polyvector(77,0)(87,0)(87,8)
411 %\polyvector(77,30)(90,30)(90,15)(95,15)
412 %\fileicon(95,10){.pdf}
413 %\end{picture}
414 %\caption{Advanced TOPtesi bundle flow diagram}
415 %\label{fig:toptesi+frontspizio}
416 %\end{figure}
417 %
418 % Version 5.x introduced a new feature: the specific settings
419 % for the doctoral theses written at Politecnico di Torino
420 % (Technical Institute of Turin); after all the bundle was
421 % born in that university. The switching mechanism to select
422 % the various thesis title page settings still worked with
423 % suitable boolean variables, but it was becoming a little
424 % too clumsy.
425 %
426 % In order to put some order in this situation I decided to
427 % upgrade to version 6.x; the class options now use the
428 % \emph{key\,$=$\,value} syntax (of course the value
429 % |true| is the default setting for boolean variables).
430 % This allows to select the thesis type with a
431 % \emph{key\,$=$\,value} option, therefore the selection and
432 % configuration of the title page should be simpler than before.
433 %
434 % The new situation flow diagram is represented in
435 % figure~\ref{fig:key-value-option}; the diagram is
436 % complicated but, once selected a specific option
437 % for the thesis type, the diagram reduces to a linear one.
438 %
439 %\begin{figure}[p]\centering
440 %\unitlength=0.010\textwidth
441 %\makebox[\textwidth]{\begin{picture}(112.5,140)
442 %\fileicon(0,33){.tex}
443 %\polyvector(15,33)(20,33)(20,48)(0,48)(0,58)(5,58)
444 %\Zbox(5,58)(18,0)[l]{\small\ttfamily toptesi.cls\\toptesi.sty}
445 %\VECTOR(27,58)(32,58)
446 %\put(36.5,57){\rotatebox[origin=Bl]{90}{%
447 % \makebox(0,0){\fboxsep=2\unitlength
448 % \framebox(116,9){\parbox[c][5\unitlength][c]{112\unitlength}%
449 % {\centering Options\\\texttt{tipotesi\,=\,}\emph{value}}}}}}
450 %\VECTOR(41,6)(45,6)\Zbox(45,6)(25,0)[l]{%
451 %\centering\texttt{topfront} (\emph{default})}
452 %\VECTOR(41,22)(45,22)\Zbox(45,22)(31,0)[l]{\centering\texttt{toptesi-triennale}}
453 %\VECTOR(41,37)(45,37)\Zbox(45,37)(33,0)[l]{\centering\texttt{toptesi-magistrale}}
454 %\VECTOR(41,52)(45,52)\Zbox(45,52)(31,0)[l]{\centering\texttt{toptesi-dottorale}}
455 %\VECTOR(41,67)(45,67)\Zbox(45,67)(31,0)[l]{\centering\texttt{toptesi-scudo}}
456 %\VECTOR(41,81)(45,81)\Zbox(45,81)(32,0)[l]{\centering\texttt{toptesi-sss}}
457 %\VECTOR(41,96)(45,96)\Zbox(45,96)(32,0)[l]{\centering\texttt{frontespizio}}
458 %\VECTOR(41,111)(45,111)\Zbox(45,111)(32,0)[l]{\centering\texttt{custom}}
459 %\Zbox(5,129.5)(18,0)[l]{\centering\ttfamily user loaded\\packages}
460 %\VECTOR(16,125)(16,63)
461 %\VECTOR(27,129.5)(35,129.5)\put(37,129.5){\circle{4}}
462 %\VECTOR(39,129.5)(45,129.5)
463 %\Zbox(45,129.5)(16,0)[l]{\centering\ttfamily topcoman}
464 %\polyvector(27,61)(29,61)(29,120)(37,120)(37,127.5)
465 %\put(90,67){\circle{4}}\VECTOR(92,67)(97.5,67)
466 %\polyvector(65,129.5)(93,129.5)(93,70)(97.5,70)^^A topcomand
467 %\polyvector(81,111)(90,111)(90,69)^^A custom
468 %\polyvector(81,96)(88,96)(88,72)(89,68.4)^^A frontespizio
469 %\polyvector(81,81)(86,81)(86,70)(88.4,68.2)^^A secondaria
470 %\VECTOR(80,67)(88,67)^^A scudo
471 %\polyvector(80,52)(86,52)(86,63)(88.4,65.6)^^A dottorale
472 %\polyvector(82,37)(88,37)(88,60)(89,65.2)^^A magistrale
473 %\polyvector(80,22)(90,22)(90,65)^^A triennale
474 %\polyvector(74,6)(92,6)(92,62)(91,65.1)^^A topfront
475 %\fileicon(97.5,68.5){.pdf}
476 %\end{picture}}
477 %\caption{Version 6.x TOPtesi bundle flow diagram}
478 %\label{fig:key-value-option}
479 %\end{figure}
480 %
481 % Special care was paid to maintain backwards compatibility; if
482 % desired the various |.sty| module-files (with descriptive
483 % names) should be usable also with other classes.
484 % It is possible to specify a |custom| value for a thesis type;
485 % in this case users are required to explicitly load their
486 % personal package, or to avoid loading anything and use
487 % either a different typesetting program to produce a title
488 % page (in \sigla{pdf} format to be included by means of
489 % the |pdfpages| package), or even create their personal
490 % title page by means of the standard |titlepage| environment.
491 %
492 % All this implied rewriting both the English and
493 % Italian documentation files; the user can find useful
494 % information in the English file |toptesi.pdf| included
495 % in the bundle; this file is pretty lengthy because it
496 % contains also the documented code. The Italian documentation
497 % in |toptesi-it.pdf|, is also part of this bundle; it is
498 % partly written in English for the benefit of the many foreign
499 % students that study in the doctoral school of Politecnico di
500 % Torino; it contains many examples enriched with graphic
501 % “demonstrations”. These two documentation files complement
502 % one another.
503 %
504 % \section{Introduction}
505 % The new TOPtesi bundle contains a certain number of files.
506 % \begin{enumerate}[noitemsep]
507 % \item
508 % A class file \texttt{toptesi.cls} to be used as the main
509 % document class; the main document may be any of a certain
510 % number of reports that in Italy are called with various
511 % names: “monografia”, “monografia di laurea”, “tesi di
512 % laurea”, “tesi di laurea triennale”, “tesi di laurea
513 % specialistica”, “tesi di laurea magistrale”, “tesi di
514 % dottorato”, “dissertazione di dottorato”, and so on.
515 % All these documents have in common the fact that they all
516 % conclude a period of university education. Moreover since
517 % they may conclude a double degree university program, they
518 % may receive foreign names such as, for example, “Projet
519 % de fin d'études”, “Master thesis”, and the like.
520 % \item
521 % An extension package \texttt{toptesi.sty} that contains most
522 % of the code for the real typesetting; it might be used as an
523 % extension to other classes, although this use is seldom
524 % necessary.
525 % \item
526 % A second extension package \texttt{topfront.sty} that
527 % contains the commands and the typesetting macros for the
528 % title page; this file may be used as an independent
529 % extension package to be added to, say, the report or the
530 % book class files for typesetting just the title page; this
531 % file might be used as a template for setting up the title
532 % page fixed information in languages different from
533 % Italian. This package is part of the bundle, but it is
534 % automatically loaded only if the user did not specify the
535 % |tipotesi=|\meta{thesis type} option to the class; if the
536 % |toptesi=frontespizio| option is specified, the external
537 % package |frontespizio| gets loaded; if the |toptesi=custom|
538 % option is specified users should do everything by
539 % themselves.
540 % The |tipotesi=custom| is very tolerant; in the sense that
541 % users are allowed to avoid loading any custom package, and
542 % simply create the title page by means of the standard
543 % |titlepage| environment. The available thesis kinds are the
544 % following; for each value of the |tipotesi|key e different
545 % titlepage is typeset as the following list specifies.
546 % \begin{itemize}[noitemsep]
547 % \item \opz{tipotesi=triennale} (or \opz{monografia} for
548 % backwards compatibility) for the bachelor degree
549 % final work;
550 % \item \opz{tipotesi=magistrale} for the master thesis;
551 % \item \opz{tipotesi=dottorale} for a generic Ph.D.\
552 % thesis;
553 % \item \opz{tipotesi=scudo} for the special version of the
554 % Ph.D.\ thesis at Politecnico di Torino;
555 % \item \opz{tipotesi=secondaria} for the high school
556 % “tesina”;
557 % \item \opz{tipotesi=custom} for using another title page
558 % package, possibly a customised one users may create
559 % in accordance with a certain template that implements
560 % their university requirements.
561 % \item \opz{tipotesi=frontespizio} for typesetting a
562 % title page according to the style of the
563 % |frontespizio| package.
564 % \end{itemize}
565 % Users who need a different title page style is neither
566 % obliged to create a custom module, nor to create their title
567 % page “by hand” within the |titlepage| environment: before
568 % this decision we suggest to use the package |frontespizio|
569 % and we address the user to its documentation.
570 %
571 % It is important to recall that if the |topfront| package has
572 % to be loaded, it is only at the execution of the
573 % |\begin{document}| command. Therefore no title page commands
574 % of any kind (those defined by |topfront| or by the other
575 % modules) can be used in the preamble.
576 % \item
577 % A third extension package \texttt{topcoman.sty} that defines
578 % a certain number of user commands suitable for typesetting
579 % technical matters.
580 % \item
581 % Several extension files are available by means of the
582 % |toptesi=|\meta{module} option. They share the \meta{module}
583 % name in the form \texttt{toptesi=\meta{module}}.
584 % The \meta{module} may assume the following values:
585 % \begin{itemize}
586 % \item |monografia| or |triennale|,
587 % \item |magistrale|,
588 % \item |dottorale|,
589 % \item |scudo|,
590 % \item |sss|.
591 % \end{itemize}
592 % These modules are specifically designed to typeset
593 % particular thesis kinds; |scudo| refers to the particular
594 % doctoral school of Politecnico di Torino, whose official
595 % name is \emph{Scuola di Dottorato}, whence the acronym
596 % “ScuDo”. Such ScuDo theses must be typeset only in English,
597 % and must have a special title page, very different from the
598 % other ones that can be typeset with the various options of
599 % the TOPtesi bundle, and by the commands contained in the
600 % various modules. In all cases where specific modules exists;
601 % a specific module switch is set such that
602 % \texttt{topfront.sty} does not get loaded, and another set
603 % of commands is made available to set up the necessary
604 % information.
605 % \item
606 % Previous versions of this bundle contained also the logos of
607 % a set of universities; these logos are not distributed
608 % anymore because of legal constraints. All users who are
609 % working on their degree course final report may retrieve the
610 % logo of their university, but they should pay attention to
611 % use it in accordance with the rules and limitations of the
612 % university.
613 % \item
614 % A documentation file \texttt{toptesi-it.pdf} written mostly
615 % in Italian, explains in detail every feature; essential
616 % information is given in this Italian documentation.The
617 % source file of the documentation \texttt{toptesi-it.tex} may
618 % be used as a sample or template for typesetting one's thesis
619 % with any typesetting program among \pdfLaTeX, \XeLaTeX, or
620 % \LuaLaTeX.
621 % \end{enumerate}
622 %
623 % The above files are complemented with a configuration file
624 % that any user may customise at will; this customisation file
625 % makes it easy to configure the bundle so as to make it
626 % suitable for another language; in facts the \textsf{babel} and
627 % \textsf{polyglossia} packages contain localisations for many
628 % languages, but such localisations deal with the standard infix
629 % \LaTeX\ names and phrases and do not cope with the thesis
630 % title page requirements. This configuration file is usable
631 % only when no custom or external files are used for typesetting
632 % the title page; but they may be used for all standard modules
633 % of this bundle.
634 %
635 % TOPtesi was specifically conceived for typesetting theses
636 % with the \LaTeX\ mark-up, and initially it was using the
637 % \prog{tex} typesetting engine; later on this engine was
638 % substantially substituted by the \prog{pdftex} one, which
639 % was capable of direct output of \sigla{PDF} files. Since about
640 % 2006 the typesetting engine \XeTeX\ has been available; the
641 % most important feature of this engine is its capability of
642 % using OpenType fonts, among which those that are available to
643 % the operating system of the specific platform where the
644 % document is being typeset. Since 2017 a stable version of
645 % \LuaTeX\ is available that does much more than \XeTeX.
646 %
647 % For what concerns theses, these programs might be of essential
648 % importance when they deal with specific languages that use
649 % different scripts (Greek, Russian, Bulgarian, Chinese,
650 % Japanese, Korean, Hebrew, Arabic, Farsi, Thai, and so on). Of
651 % course \LuaLaTeX\ has many more functionalities and can
652 % perform very well where the other engines are sort of limited;
653 % in particular \LuaLaTeX\ can produce \sigla{ISO}-compliant
654 % archivable-documents more easily than the other typesetting
655 % engines; but the users do not have to learn too many more
656 % concepts in order to typeset a “normal” thesis.
657 %
658 % This version of TOPtesi has been tested also with \XeLaTeX\
659 % and \LuaLaTeX. Some conflicts have been spotted and solved;
660 % maybe there are still hidden ones, so that feedback from users
661 % is particularly welcome. The only main drawback still present
662 % when running \XeLaTeX\ is the fact that this program cannot
663 % still \emph{directly} produce the output file in \sigla{PDF}
664 % format, although it automatically transforms its specific
665 % output file into that format.
666 % This implies that the specific \prog{pdftex} features required
667 % to produce a \sigla{PDF/A} compliant output \sigla{PDF} file
668 % suitable for long term archiving cannot be used. But with some
669 % attention the \sigla{PDF} file output by \XeLaTeX\ may be
670 % converted to \sigla{PDF/A} by using the \pack{pdfpages}
671 % package.
672 %
673 % \section{User commands}
674 % The \texttt{toptesi.cls} is basically an extension of the
675 % standard class \texttt{report.cls}; it redefines the page
676 % typesetting grid, the headers and the footers, and the title
677 % page layout and commands. \texttt{toptesi.cls} does not set
678 % such crazy settings as “double spaced” text; it is intended
679 % to typeset the thesis with the quality of a \LaTeX\ well
680 % typeset document, not as a typewriter written one.
681 %
682 % Very often theses are full of specialised material: formulas,
683 % diagrams and pictures, texts written in non Latin alphabets,
684 % special symbols for philological mark-up, and the like; a
685 % common typewriter would not be suitable because the specific
686 % contents requires professional typesetting; this is why
687 % I strongly believe that instructions on typesetting styles
688 % that refer to the “good, old, gone-by times” of mechanical
689 % typewriters should be banned.
690 %
691 % At the same time the class allows to typeset theses on any
692 % paper format; nowadays, in facts, Universities are requesting
693 % theses in smaller formats than A4 or letter paper. With
694 % smaller paper sizes the layout changes automatically, but the
695 % title page might require some more attention. The default
696 % paper size is A4, but the user can set any paper size among
697 % those accepted by the |report| standard class. If the
698 % \opz{tipotesi=frontespizio} option is specified so that
699 % package |frontespizio| gets loaded, it is necessary to remind
700 % that it can easily create pretty nice title pages, but by
701 % default it is preset to use A4 paper, onto which it can
702 % typeset the title page in two styles, one so called
703 % “standard”, and the other called “elements”; the latter one
704 % mimics that of the famous book \emph{Elements of typographic
705 % style} by Robert Bringhurst; this is so at least with
706 % |frontespizio| version dated 2011/09/21 or earlier. It is
707 % possible to use |frontespizio| to use a different paper size,
708 % but it is necessary to use certain customisation commands
709 % described in its documentation.
710 %
711 % Therefore if you want to typeset your thesis while typesetting
712 % the title page by means of the functionalities of package
713 % |frontespizio|, you have to follow carefully how to use that
714 % package options in the proper way as to bypass the two fixed
715 % styles it can produce. See also the Italian documentation
716 % contained in the document |toptesi-it.pdf|.
717 %
718 % Most new commands refer themselves to the information that
719 % should be typeset in the title page; some class options
720 % specify special stylistic page details; the rest is simple and
721 % traditional \LaTeX\ mark-up as it is implemented in the
722 % \LaTeX\ kernel and in the report class. If \XeLaTeX\ or
723 % \LuaLaTeX\ has to be used, some essential preamble specific
724 % commands are to be used, but the body of the thesis has the
725 % same mark-up.
726 %
727 % For theses to be typeset for the ScuDo doctoral school,
728 % all necessary commands become available when the class
729 % option \opz{tipotesi=scudo} is specified; such commands are
730 % available \emph{only} with that option.
731
732 % Notice that only the ScuDo module of TOPtesi contains a setup
733 % for typesetting the bibliography. For other thesis kinds
734 % users are in charge of loading the suitable extension
735 % packages they like best in order to customise their
736 % bibliography/ies. Instructions for customisation are given
737 % only in the specific section~\ref{sec:scudo}. Other suitable
738 % sections describe the other special thesis modules and their
739 % specific options.
740 %
741 % \subsection{Class options}
742 % The class accepts all the options valid for the |report|
743 % document class plus the ones defined here:
744 % \begin{description}[noitemsep]\def\Item[#1]{\item[\opz{#1}]}
745 %
746 % \Item[chapterbib] Allows to typeset a list of references at
747 % the end of each chapter and the bibliography items are
748 % numbered with a \emph{chapter.item} indication. This implies a
749 % manual build up of each end-of-chapter bibliography by means
750 % of a specific |thebibliography| environment. This work may be
751 % avoided if the user relies on the various packages already
752 % available in any complete \TeX\ system distribution and the
753 % facilities offered by packages such as \pack{biblatex}, and on
754 % the sorting and formatting engines such as \prog{biber}. The
755 % use of this option, retained for backwards compatibility, is
756 % \emph{strongly deprecated}.
757 %
758 % \Item[stile=classica] Specifies a general modification of
759 % certain details that are supposed to be more adequate for
760 % theses in humanities; specifically this option lets old style
761 % numbers to be used for some numerical pieces of information;
762 % some variations are also introduced in the title page. This
763 % option is active also when using some of the modules for
764 % specific theses, in particular with the |dottorale| thesis
765 % option. Some of the following options may be valid or may
766 % remain inactive when this thesis style is specified.
767 %
768 % \Item[cucitura=\meta{displacement}] In two sided printing
769 % it might be necessary to move the typesetting grid towards the
770 % outer edge so as to cope with the thesis binding that is
771 % generally not made up by sewing together a number of
772 % signatures; the default outer displacement is fixed to~7mm,
773 % but it can be customised by means of a proper value to the
774 % class option |cucitura=|\meta{displacement} or by using an
775 % explicit command in the preamble:
776 % \cs{setbindingcorrection}\marg{displacement}.
777 % The \meta{displacement} specification is necessary but it
778 % remains inactive if the key \texttt{cucitura} is absent while
779 % using the \cs{setbindingcorrection} command.
780 %
781 % \Item[corpo=\meta{font size}] Extends the normal size
782 % choice to the chosen \meta{font size}; it is
783 % appreciated in certain fields of humanities, but I would
784 % discourage this use in a technical thesis, where the default
785 % 10 point size sometimes might be too small, but 11 point or
786 % 12 point typesetting may be adequate. In any case the
787 % \meta{font size} may be specified in any units the \TeX\
788 % system accepts, and any value, even fractional, may be used.
789 % Please, do not exaggerate with small sized normal fonts, where
790 % I would say that 9.5pt is the absolute minimum acceptable size
791 % for normal text. Do not exaggerate with large sizes; 14pt is
792 % acceptable for certain theses where unusual signs are
793 % used above or below some alphabetic strings, otherwise 14pt
794 % is already too much; let us say that 12.5pt or 13pt are
795 % the maximum normally accepted; larger sizes are used only
796 % for books to be used in the first years of the elementary
797 % school or for people with various types of visual impairment.
798 %
799 % \Item[autoretitolo] This option modifies the left hand (even
800 % numbered) pages in two side typesetting; normally the even
801 % numbered page headings contain the chapter title, while the
802 % odd numbered ones contain the current section title.
803 % If and only if the \opz{classica} option has been specified,
804 % then the |autoretitolo| option makes even numbered page
805 % headings contain the author's name and the thesis title, while
806 % the odd numbered ones contain the chapter title.
807 % Since the thesis title might be too long to fit into the
808 % header together with the author's name, the |\title| macro as
809 % been redefined so as to accept an optional short title: this
810 % feature mimics the ordinary sectioning commands.
811 %
812 % \Item[oldstyle] Also this option works only if \opz{classica}
813 % had already been specified; it typesets several numerical data
814 % with the old style numbers.
815 %
816 % \Item[numerazioneromana] Sets the front matter folios in Roman
817 % numerals; if this option is not used, the folios are in Arabic
818 % numerals and do not restart from~1 when the first main matter
819 % chapter is typeset. The traditional Roman numbering of front
820 % matter folios had its explanation when typesetters used metal
821 % type; with this technique they could produce all the front
822 % matter material, including references, tables of contents, and
823 % the like, only when the main matter was complete, corrected
824 % and stable. Nowadays with electronic typesetting there is no
825 % need to to use this artifice, but in some disciplines it is
826 % still considered a touch of elegance.
827 % \Item[folioinhead] Folios by default are typeset at the center
828 % of the footer. With thei options they are placed in the
829 % margin, aligned with the header; this feature has been
830 % requested by some universities, but admittedly is not
831 % particularly elegant; may be it can be used only when the
832 % header is centred in the measure, certainly not when is is
833 % moved to the outer side of the header. No particular
834 % functionality is provided to avoid this particular choice; it
835 % is up to the user to avoid this error. Ineffective if
836 % the |stile=classica| option is specified.
837 %
838 % \Item[nocenterhead] The header text is normally centred in the
839 % measure. If this option is specified, the header text is moved
840 % to the outer side. No option has been requested to move the
841 % header text towards the inner side; therefore do not look for
842 % any such keyword. Ineffective is the |stile=classica| option
843 % is specified.
844 %
845 % \Item[nocenterfolio] Normally the folio is typeset centred in
846 % the footer; by specifying the option the folio is flushed to
847 % the outer side of the footer. Ineffective is the
848 % |stile=classica| option is specified. These last three options
849 % comply with the |oneside| or |twoside| global class options.
850 %
851 %\end{description}
852 %
853 % Since version 6.xx.yy options to the TOPtesi class follow the
854 % syntax \emph{key${}={}$value}; depending on the kind of thesis
855 % there are some values that are particularly significant;
856 % the key for all of them is |tipotesi| (\emph{thesis kind});
857 % the values are indicated hereafter.
858 %
859 %\begin{description}[noitemsep]\def\Item[#1]{\item[\opz{#1}]}
860 %
861 % \Item[tipotesi-topfront] is the default and it is not necessary
862 % to specify it. This means that if you specify |tipotesi| without
863 % a value, or if you completely omit this option, the generic
864 % |topfront| module is used to typeset the title page.
865 %
866 % \Item[tipotesi=frontespizio] omits loading the generic module
867 % |topfront| and loads the external package |frontespizio|'
868 % without any option; this implies that the user should read its
869 % documentation and use it accordingly.
870 %
871 % \Item[tipotesi=scudo] sets up the suitable switches and allows
872 % loading the specific extensions to typeset doctoral theses for
873 % the ScuDo doctoral school. This implies that not only the title
874 % page is typeset according to this School regulations, but that
875 % some other packages get preloaded; the user can read further
876 % on what actually becomes available with this option; the most
877 % relevant difference is that the default language becomes English
878 % also for the naming of the user commands.
879 %
880 % \Item[tipotesi=triennale] and \opz{tipotesi=monografia}
881 % (aliases of one another) load the specific module to
882 % typeset the bachelor degree final-work title-page. Some
883 % user commands are redefined so as to be more user friendly
884 % than those of the generic package |topfront|.
885 %
886 % \Item[tipotesi=magistrale] loads the specific module
887 % to typeset the master degree thesis title-page. This module
888 % is substantially equivalent to the generic module |topfront|
889 % except that typesets only the master-degree thesis title-page.
890 %
891 % \Item[tipotesi=dottorale] loads the specific
892 % module to typeset doctoral thesis title-pages. This module is
893 % very basilar and has nothing to do with the module for the
894 % ScuDo doctoral theses that require a particular title-page
895 % layout; we suggest to customise this module through a suitable
896 % configuration file, rather than tweaking the ScuDo module.
897 %
898 % \Item[tipotesi=secondaria] loads the module to typeset the
899 % secondary school (high school) final work title page. The
900 % default language, also for the user commands, is Italian.
901 % Of course the secondary school final work title page is very
902 % different from the one suited for university theses. In any
903 % case, except for few additional packages, the body of the
904 % TOPtesi functionality is maintained intact.
905 %
906 %\Item[topotesi=frontespizio] By specifying this option the default
907 % module |topfront| to typeset the title page is not loaded; in its
908 % place the \pack{frontespizio} package is loaded, and the user can
909 % directly use this latter package commands. Of course the user must
910 % know pretty well ho this particular package works; if not s/he
911 % should reat its documentation. Notice: the documentation is written
912 % in Italian; probably its author assumed that it would be used only
913 % by Italian students; actually the author provided commands to
914 % customise the infix words in other languages. Again the author
915 % assumed that some Italian students had to typeset their theses in
916 % various languages; this is generally true for doctoral theses that
917 % are requested in English; but this is true also for Erasmus student
918 % who might need to write their theses in the language of the host
919 % universities.
920 %
921 % \Item[tipotesi=custom]
922 % is a very simple option: sets the various internal switches
923 % so as not to load any internal module or external file.
924 % If the user explicitly loads one before the |\begin{document}|
925 % statement, this file becomes the one that the user must follow
926 % to create his/her own title page; otherwise if the user wants
927 % a custom title page s/he may use the |titlepage| environment;
928 % in this case the user is completely free to write what s/he
929 % wants, where s/he prefers, using the fonts s/he likes, and
930 % so on. In alternative the user prepares the title page in
931 % \sigla{pdf} format with some other program and includes it
932 % in his/her thesis by means of the functionalities of the
933 % |pdfpages| package. In any case the user is not forced by
934 % this TOPtesi bundle to use any of its title page facilities;
935 % its title page facilities are highly recommended for theses
936 % to be submitted to the Student Office of Politecnico di Torino,
937 % and for the ScuDo doctoral theses; in other universities and
938 % in disciplines different from those connected with Politecnico
939 % di Torino, the user is free to follow his/her University
940 % prescriptions without any constraint by the TOPtesi bundle.
941 %
942 % \item[Warning!] It goes without saying that each one of the last
943 % options does not load the generic module |topfront|, therefore
944 % some commands provided by this standard module are not available
945 % any more. Every effort has been made in the various modules to
946 % maintain the same commands, but in certain thesis types they
947 % might behave differently than expected.
948 %
949 % The user therefore is strongly urged to consult the documentation
950 % files, both |toptesi.pdf| and |toptesi-it.pdf|, in order to
951 % avoid problems with commands that are not suited for a particular
952 % thesis type. Please examine also the examples that accompany
953 % this bundle
954 % \end{description}
955 %
956 % \subsection{Title page commands}
957 % Note: Skip this section if you decide to use external package
958 % |frontespizio|, or you selected the |tipotesi=custom| option for
959 % typesetting the title~page. Notice also that if you want to load
960 % an external package for this task, you should load it \emph{after}
961 % specifying the input encoding you use for your text files.\bigskip
962 %
963 % \noindent The user must specify a certain number of commands
964 % in order to have the title page contain all the required
965 % information. It must be specified that most of these commands
966 % may be used in the configuration file so as to avoid repeating
967 % the same data for different “final reports”: a university
968 % student might write a bachelor's “monografia”, then a master
969 % thesis and finally a doctoral dissertation; why should s/he
970 % repeat his/her name, the name of the institution, and so on?
971 %
972 % Many user commands for the title page redefine default
973 % values or strings; they are particularly useful when the thesis is
974 % typeset in a different language; if none of the required information
975 % is given, the default values and strings are typeset, possibly
976 % with hilarious results\dots
977 %
978 % Except for the self made customised module for the title-page,
979 % all the modules accept the same commands as those available in
980 % the |topfront| module. Pay attention, though, that some commands are
981 % meaningless in certain theses, therefore do not reverse the
982 % statement: for example the doctoral cycle command (|\cycle|)
983 % is meaningless in a bachelor degree final-work title-page.
984 %
985 % Since most users are supposed to be Italian, the user commands
986 % are mostly in Italian; the following description gives their
987 % names and meanings; every command receives one argument; only
988 % the command |\title| accepts an optional argument according to
989 % the usual \LaTeX\ syntax:
990 % \[
991 % \makebox[0pt]{%
992 % \texttt{\char92}\meta{command}\oarg{opt-arg}\marg{req-arg}\relax
993 % }
994 % \]
995 % Since the only language allowed in the ScuDo doctoral thesis is
996 % English, all its commands are in English; this was done to help
997 % the high number of foreign Ph.D.\ students in that school.
998 % Therefore, for example, the general environment |frontespizio|
999 % becomes |ThesisTitlePage|\footnote{Actually
1000 % \texttt{ThesisTitlePage} is a wrapper to a particular instance
1001 % of environment \texttt{frontespizio}. Similar wrappers are
1002 % defined in the other specific thesis modules.}. Except this
1003 % module, and, possibly, the personal customised module, the
1004 % other ones use mostly the same commands for the same purposes.
1005 %
1006 % \begin{description}[noitemsep]
1007 %^^A \def\cs#1{\texttt{\char92#1}}
1008 % \def\Item[#1]{\item[\cs{#1}]}
1009 %^^A
1010 % \item[\textnormal{\ttfamily frontespizio}] and
1011 % \texttt{frontespizio*} are two environments that typeset the
1012 % title page with two opposite styles: with the university logo
1013 % in the header vs the university logo in the lower part of the
1014 % front page. The commands described in the following items shall
1015 % be used either in the configuration file or within the body of
1016 % these environments.
1017 %
1018 % \Item[frontespizio] {\tolerance=6000 Even if the above
1019 % environments are strongly recommended, the command
1020 % |\frontespizio|, defined in the previous versions of the
1021 % TOPtesi bundle, is still usable. It typesets the title page
1022 % according to the actual status of the boolean |\topTPTlogos|;
1023 % the user, before issuing the |\frontespizio| command, may set
1024 % this boolean by means of the |\topTPTlogostrue|
1025 % or |\topTPTlogosfalse|, or with either one of the equivalent commands
1026 % |\booltrue{topTPTlogos}| and |\boolfalse{topTPTlogos}|.\par}
1027 %
1028 % \Item[monografia\marg{title}] sets the bachelor's report style and
1029 % retrieves its title; the command\cs{titolo} that is not available for
1030 % this purpose with the standard module |TOPfront|, is available when
1031 % the specific module has been loaded by means of the
1032 % \opz{monografia} or \opz{triennale} options.
1033 %
1034 % \Item[titolo\oarg{shorttitle}\marg{title}] gets the master
1035 % or PhD thesis title and an optional thesis short title.
1036 %
1037 % \Item[sottotitolo\marg{subtitle}] gets the thesis subtitle if any.
1038 %
1039 % \Item[materia\marg{discipline}] or the alias
1040 % \cs{Materia}\marg{discipline} get the name of the discipline the
1041 % thesis deals with.
1042 %
1043 % \Item[direttore\marg{director's name}] gets the name of the
1044 % Doctoral School Director.
1045 %
1046 % \Item[coordinatore\marg{coordinator's name}] gets the name
1047 % of the Doctoral School Coordinator
1048 % \Item[QualificaDirettore\marg{director's function}]
1049 % gets the phrase that describes the
1050 % director or coordinator official position; by
1051 % using the command \cs{direttore} the default phrase
1052 % “Direttore della Scuola di Dottorato” is printed
1053 % above the “director's” name; if \cs{coordinatore}
1054 % is used the default phrase “Coordinatore della
1055 % Scuola di Dottorato” is printed instead.
1056 % If neither one is applicable or a description
1057 % in another language is required, this macro is
1058 % available for specifying such position.
1059 %
1060 % \Item[relatore\marg{supervisor name}] gets the name of the
1061 % thesis principal supervisor.
1062 %
1063 % \Item[secondorelatore\marg{second supervisor's name}] gets the name
1064 % of the second supervisor if any.
1065 % \Item[terzorelatore\marg{third supervisor's name}]
1066 % gets the name of the third supervisor,
1067 % if any; it is assumed that the number of
1068 % supervisors never exceeds three; in case follow
1069 % one of the tricks exemplified
1070 % in the example file \file{toptesi-example.tex} in
1071 % order to manage such situation.
1072 % \Item[tutore\marg{tutor's name}]
1073 % gets the name of the doctorate tutor; there is no
1074 % difference with regards to the \cs{relatore}, but
1075 % the default phrase “Tutore” is printed above this
1076 % person's name.
1077 % \Item[TutorName\marg{tutor's position}]
1078 % gets the phrase that describes the tutor
1079 % position, possibly in a different language.
1080 % \Item[AdvisorName\marg{supervisors' formal title}]
1081 % gets the string that qualifies the
1082 % supervisor(s); the default string
1083 % is “Relatore:” or “Relatori:” for the plural;
1084 % in another language this command is used to
1085 % define the string, say, “Supervisors:” if the
1086 % thesis has been supervised by more than one
1087 % person.
1088 % \Item[CoAdvisorName\marg{co-supervisors' formal title}]
1089 % gets the string that qualifies the
1090 % co-supervisor(s); the default string is
1091 % “Correlatore:” or “Correlatori:” in the
1092 % plural; this command may be used to define the
1093 % string, say, “Corapporteur:” in a French Projet
1094 % de fin d'\'etudes. This command may be used also
1095 % for setting an Italian singular name when the
1096 % tricks exemplified in file
1097 % \file{toptesi-example.tex} are used.
1098 % \Item[candidato\marg{candidate' name (man)}]
1099 % gets the name and surname of an author (M).
1100 % \Item[candidata\marg{candate's name (woman))}]
1101 % gets the name and surname name of an author (W).
1102 % \Item[secondocandidato\marg{second candidate's name (man)}]
1103 % gets the name and surname of the second M author.
1104 % \Item[secondacandidata\meta{second candidate's name (woman)}]
1105 % gets the name and surname of the second W author.
1106 % \Item[terzocandidato\marg{third candidate's name (man)}]
1107 % gets the name and surname of the third M author.
1108 % \Item[terzacandidata\marg{third candidate's name ()woman}]
1109 % gets the name and surname of the third W author;
1110 % most often the thesis author is just one person;
1111 % but there are some institutions where group final
1112 % works are accepted; it is assumed that the group
1113 % does not contain more than three authors. The
1114 % specification of the gender allows the software
1115 % to determine the correct labelling phrase in
1116 % the proper gender and proper number.
1117 % For different languages there might be no
1118 % difference in gender but there is a difference
1119 % in plural.
1120 % \Item[CandidateName\marg{candate's status}]
1121 % gets the string that describes the student
1122 % status in a foreign
1123 % language or even in Italian; the default string
1124 % is `Candidato:” (with colons) adjusted to
1125 % masculine or feminine, singular or plural; with
1126 % option \opz{classica} the string becomes
1127 % “Laureando:”; in other languages it is
1128 % necessary to specify this string in the proper
1129 % gender and number.
1130 % \Item[sedutadilaurea\marg{thsis defense date}]
1131 % gets the date of the final exam, or
1132 % presentation, or defence of the thesis; if this
1133 % date is omitted the default date is the current
1134 % month and year in the current language (generally
1135 % Italian).
1136 % \Item[esamedidottorato\marg{Ph.D. defense date}]
1137 % an alias for \cs{sedutadilaurea} to be used
1138 % for doctoral dissertations.
1139 % \Item[ciclodidottorato\marg{cycle}]
1140 % gets the ordinal numeral that specifies
1141 % the doctoral cycle.
1142 % \Item[CycleName\marg{cycle name}]
1143 % redefines the string that expresses the name of
1144 % the doctoral cycle; by default this is “ciclo”
1145 % but this command is useful to set the name in a
1146 % different language.
1147 % \Item[corsodilaurea\marg{degree course proper name}]
1148 % gets the proper name of the degree course;
1149 % the phrase that describes the degree course is
1150 % specified, if necessary, with the next command;
1151 % with this one you specify just, say,
1152 % “Electrical Engineering”.
1153 % \Item[CorsoDiLaureaIn\marg{degree course generic name}]
1154 % gets the generic name of the degree course,
1155 % for example “Bachelor Degree in”.
1156 % \Item[TesiDiLaurea\marg{thesis generic name}]
1157 % gets the generic phrase that describes the
1158 % thesis; by default it is “Tesi di Laurea”; in
1159 % English one might set it to “Master Thesis”.
1160 % \Item[NomeMonografia\marg{bachelor's report name}]
1161 % gets the phrase that describes the
1162 % bachelor's final report; by default this
1163 % package sets it tois “Monografia di Laurea”.
1164 % In some Italian universities it might be called
1165 % “Tesi di Laurea”, so that the master thesis
1166 % should be given another qualification, for
1167 % example “Tesi di Laurea Magistrale”.
1168 % \Item[NomeDissertazione\marg{Ph.D. thesis name}]
1169 % gets the phrase that describes the
1170 % doctoral thesis; by default this package sets it to
1171 % “Tesi di Dottorato”.
1172 % \Item[InName\marg{‘in’ name}]
1173 % infix strings often require that their prepositions
1174 % are adjusted the; this macro gets the preposition
1175 % that stands for “in” (the default). In German
1176 % it might become “auf”.
1177 % \Item[NomeAnnoAccademico\marg{academic year name}]
1178 % defines the infix string that stands for
1179 % “Academic year”. This macro is defined only if
1180 % the option \opz{classica} is in force;
1181 % after all the command |\annoaccademico| is
1182 % defined only with that option. In any case, even
1183 % without the \opz{classica} option you can use
1184 % any string in the field of \cs{sedutadilaurea}.
1185 % \Item[logosede\marg{logo file name}]
1186 % specifies the name of the file or the files that
1187 % contain the university logos; no default is
1188 % defined; rather a warning message is issued if
1189 % no name is given or the file is missing, but
1190 % typesetting goes on without the inclusion of any
1191 % logo. A list of logos can be specified, useful
1192 % when a thesis is carried on in a multiple
1193 % University environment such as, for example, in
1194 % a double degree Erasmus program; or under the
1195 % Erasmus Mundus program. The “string” of
1196 % logos is scaled properly so that they may fit
1197 % in |\textwidth|.
1198 % \Item[setbindingcorrection\marg{binding correction}]
1199 % sets up the length to displace the text
1200 % block to the external margin so as to have a
1201 % wider internal margin to accommodate the binding
1202 % correction. Its argument is not optional and is
1203 % used to modify the default correction of 7\,mm.
1204 % Notice that 7\,mm is already a large
1205 % displacement; most often than not the binding
1206 % correction is unnecessary.
1207 % \Item[retrofrontespizio\marg{copyright page text}]
1208 % with its argument, made up of one or more
1209 % paragraphs, defines what should be printed on the
1210 % verso of the title page, generally named
1211 % “copyright page”; if this command is specified
1212 % with an empty text or if it is not used at all,
1213 % no copyright page is assumed.
1214 % \end{description}
1215 %
1216 % Since the infix strings are all memorised into control sequences
1217 % and for each of them it is possible to use a defining command,
1218 % all strings can be modified at will, so that there is no
1219 % difficulty to localise the package in another language; this
1220 % comes particularly handy for the Erasmus students on double
1221 % degree programs.
1222
1223 % As a final remark notice that the commands for typesetting the
1224 % title page and the copyright page are contained in the
1225 % package \texttt{topfront.sty}, which can be used as an autonomous
1226 % extension to the \texttt{report} document class. One could easily
1227 % typeset either just the title page with a separate \TeX\ source
1228 % so as to test the completeness of the commands and coherence of the
1229 % configuration file, or for just printing the isolated title and
1230 % copyright pages (if any). The same applies if you use the special
1231 % modules for each thesis type.
1232 %
1233 % \section{ScuDo doctoral theses}\label{sec:scudo}
1234 % Theses at the ScuDo doctoral school require special facilities
1235 % that are described in the code description section; here we
1236 % focus on the title page.
1237 %
1238 % \subsection{The ScuDo titlepage}
1239 % The title page for such special theses is typeset by making
1240 % use of a specific environment within which the following
1241 % commands are available to set up the necessary information.
1242 % \begin{description}[noitemsep]
1243 % \def\Item[#1]{\item[\cs{#1}]}
1244 %
1245 % \item[\normalfont\ttfamily ThesisTitlePage] is the environment
1246 % within which the title page data are specified; some data are
1247 % preset to default values; some data receive global definitions
1248 % so that they remain available for setting up some metadata.
1249 % In the following every command with its argument is described
1250 % and it is specified which is the preset value, if any. If a
1251 % preset value is specified, the user does not need to use the
1252 % command, unless s/he wants to change the preset value. If an
1253 % empty preset value is specified, the command and its value
1254 % may be optional; but personal data are never preset because,
1255 % obviously, they are mandatory.
1256 %
1257 % \Item[PhDschoolLogo\meta{logo file name}] (preset: Logo-Scudo)
1258 % selects an image specified with \meta{logo file name} to insert the
1259 % school logo; a file logo \file{Logo-Scudo.jpg} is available from the
1260 % ScuDo doctoral school; the students must ask such logo file from
1261 % the Student Office, because such file is a legal property of
1262 % the School and can be used only with permission. In any case
1263 % the logo file must be of one of the allowed formats: \sigla{PDF},
1264 % \sigla{EPS}, \sigla{JPG}, \sigla{PNG}; vector files are generally
1265 % preferred, but they might not be available; raster files should
1266 % be of a minimum definition of 150 pixels per inch.
1267 %
1268 % \Item[Ndissertation\marg{dissertation name}] (preset: Doctoral
1269 % Dissertation) specifies the specific name of the document.
1270 %
1271 % \Item[Ndoctoralprogram\marg{doctoral program}] (preset: Doctoral
1272 % Program in) specifies the degree course name prefix.
1273 %
1274 % \Item[ProgramName\marg{program name}] (mandatory: preset empty)
1275 % specifies the degree course name.
1276 %
1277 % \Item[CycleNumber\oarg{ordinal number}] (optional; preset
1278 % empty) specifies the ordinal number of the program cycle; at
1279 % ScuDo it is a mandatory information. In other doctoral schools
1280 % it might be useless.
1281 %
1282 % \Item[title\marg{dissertation title}] (preset empty) sets the
1283 % specific title of the dissertation; it is better to keep it
1284 % short, and use the sub title to add further titling information.
1285 %
1286 % \Item[subtitle\marg{dissertation subtitle}] (the whole command with its
1287 % argument is optional) if used, it adds a subtitle.
1288 %
1289 % \Item[author\marg{author's name}] (mandatory: preset
1290 % empty); it is recommended to pay attention to insert proper
1291 % name(s) first and surname(s) second.
1292 %
1293 % \Item[Nsupervisor\meta{Supervisor(s) heading}] (preset:
1294 % Supervisor:) specifies the short heading to the list
1295 % of supervisors; the preset value is singular and followed by
1296 % a colon. In case of more than one supervisor, it is necessary
1297 % to specify a plural name; the colon sign is optional.
1298 %
1299 % \Item[SupervisorList\marg{list of supervisors}] (mandatory:
1300 % preset empty) specifies the list of supervisors, one per line,
1301 % with a |\\| at the end of each line; the name(s) and surname(s)
1302 % are preceded by their academic title, and followed by their
1303 % role as supervisor, or co-supervisor.
1304 %
1305 % \Item[NExaminationCommittee\marg{examination committee
1306 % heading}] (preset: Doctoral Examination Committee:) specifies
1307 % the list-of-examiners heading.
1308 %
1309 % \Item[ExaminerList\marg{list of examiners}] (preset empty)
1310 % specifies the list of examiners, one per line, each line
1311 % terminated by |\\|; each line contains the academic title,
1312 % the name(s) and surname(s), the role (referee for the
1313 % supervisors; nothing for the other examiners), the academic
1314 % institution they belong to -- full official institution name,
1315 % city and country.
1316 %
1317 % \Item[Nlocation\marg{examination location}] (preset:
1318 % Politecnico di Torino) specifies the institution where the
1319 % examination takes place.
1320 %
1321 % \Item[ExaminationDate\marg{examination date}] (preset empty)
1322 % specifies the date when the examination is to take place.
1323 %
1324 % \Item[Disclaimer\marg{disclaimer statement}] (preset: some long
1325 % sentences agreed upon with the ScuDo doctoral school) mandatory
1326 % in most universities; the specific statement(s) may be different
1327 % in different universities.
1328 %
1329 % \Item[Signature\marg{the author's signature field}] (preset: a few
1330 % lines where the city is preset to “Turin”, and the date is
1331 % assumed to be equal to the examination date; also the signer
1332 % name is assumed equal to that of the dissertation author)
1333 % specifies a different layout of the signature field.
1334 %
1335 % \end{description}
1336 %
1337 % Several examples of thesis title-page are shown in the
1338 % \texttt{toptesi-it.pdf} Italian"-English documentation.
1339 %
1340 % \subsection{Languages}
1341 % The TOPtesi bundle and the |toptesi| document class accept
1342 % all \LaTeX\ commands provided by the \LaTeX\ \texttt{kernel},
1343 % the \texttt{report} document class, and the \texttt{graphicx}
1344 % extension package, besides those provided by the \texttt{babel}
1345 % package. If the source thesis file is being typeset by means
1346 % of \XeLaTeX\ or \LuaLaTeX\ the \texttt{babel} package is not
1347 % loaded; in its place the \texttt{polyglossia} package gets
1348 % loaded; it should implement in \XeLaTeX\ and \LuaLaTeX\ most of
1349 % the functionality provided by \texttt{babel} in \pdfLaTeX.
1350 % “Most” means that not all the functionality is available,
1351 % therefore it is better to consult the documentation of
1352 % \texttt{polyglossia} before using its built-in commands.
1353 %
1354 % With this respect it must be underlined that the Italian and
1355 % English languages are specified by default, the Italian one
1356 % being the main language. Only with the \opz{tipotesi=scudo} option
1357 % in force, the main language is English. An initial specification
1358 % of |\selectlanguage{english}| sets the English language as the
1359 % default (unnecessary when \opz{scudo} is in force).
1360 %
1361 % Should a student typeset the thesis in French by means of
1362 % \prog{pdflatex}, it would be necessary to specify the option
1363 % \opz{french} among the \emph{class} options, and then start
1364 % the document by specifying |\selectlanguage{french}|.
1365 % But the user should pay attention to use \texttt{babel} in the
1366 % proper way.
1367 % \begin{enumerate}[noitemsep]
1368 % \item Due to the way \LaTeX\ classes load the requested files,
1369 % and to the fact that the \texttt{babel} package has already
1370 % been loaded by the \texttt{toptesi} class, the user cannot
1371 % reload it with a different list of language options; therefore
1372 % the latter language options \emph{must be specified} as a global
1373 % class options; so if the thesis has to be typeset, for example,
1374 % in French, is is necessary to do the following:
1375 %\begin{verbatim}
1376 %\documentclass[...,french,...]{toptesi}
1377 %...
1378 %\begin{document}
1379 %\selectlanguage{french}
1380 %\end{verbatim}
1381 % But if the thesis should be typeset in French by means of
1382 % \XeLaTeX\ or \LuaLaTeX, then it is perfectly legal to specify the
1383 % auxiliary language in this way:
1384 %\begin{verbatim}
1385 %\documentclass[...]{toptesi}
1386 %\setotherlanguage{french}
1387 %...
1388 %\begin{document}
1389 %\selectlanguage{french}
1390 %\end{verbatim}
1391 %
1392 % \item With the 2010 \TeX\ system complete distributions,
1393 % both \TeXLive and MiKTeX, all language hyphenation rules
1394 % known (to \LaTeX) are preloaded; with other less up to date
1395 % \TeX\ system distributions this might not be true. With both
1396 % distributions also the language hyphenation rules known to
1397 % \XeLaTeX\ are all preloaded. On the opposite \LuaLaTeX\
1398 % loads the hyphenation rules at run time and only for the
1399 % declared languages of the current document.
1400 %
1401 % Remember that \texttt{babel} and \texttt{polyglossia} macros
1402 % select the language typesetting rules, but hyphenation is
1403 % activated only if the program format file has been generated
1404 % with the pertinent language hyphenation rules. You can check
1405 % this detail by reading the first dozen lines of your thesis
1406 % \texttt{.log} file; it contains the list of all language
1407 % hyphenation rules that are available in the format file.
1408 %
1409 % While (American) English is the default language and almost
1410 % any \emph{basic} distribution of the \TeX\ system has several
1411 % preloaded languages, it is more likely that French is preloaded
1412 % while Italian is not. Complete distributions don't exhibit
1413 % this~flaw.
1414 %
1415 % Should the required language(s) be missing, the user is forced
1416 % to read his/her distribution instructions, so as to find out
1417 % how to configure his/her system in order to preload the
1418 % languages s/he wants to work with, and finally s/he must recreate
1419 % the format files.
1420 %
1421 % The user is invited to carefully investigate on these fine
1422 % points and to properly configure the system; it would be very
1423 % upsetting to use fine software to produce a perfectly typeset
1424 % thesis that, unfortunately, has wrong hyphenation points!
1425 % Luckily enough, most recent distributions of the \TeX\
1426 % system have all the known hyphenation rules preloaded; in any
1427 % case, even older distributions have available command-line
1428 % commands or graphical user interfaces that make it easy to
1429 % perform the tasks of changing the list of preloaded hyphenation
1430 % rules and rebuilding all the format files, moving them to the
1431 % proper places.
1432 % \end{enumerate}
1433 %
1434 % \subsection{Bibliography}
1435 % \textcolor{red}{The ScuDo module is the only one that preloads some
1436 % suitable packages to typeset one or more bibliographies. None of the
1437 % other modules preloads any bibliography management utility.} This is due
1438 % to the fact that the module was originally developed for
1439 % typesetting PhD theses in the scientific domains related to the
1440 % Institute of Electrical and Electronics Engineers (IEEE); such
1441 % module was in facts used primarily by PhD students in those fields.
1442 % The ScuDo doctoral School does not manage doctoral curriculums only
1443 % for the “electrically oriented doctorands”, therefore alternatives
1444 % had to be offered to the other PhD students in order to typeset
1445 % their bibliographies according to the styles normally used in their
1446 % scientific domains. The procedure is better described in
1447 % section~\ref{sec:scudo} but it is suitable with minimal
1448 % modifications also for the other thesis types.
1449 %
1450 %\subsection{Typesetting commands provided by \pack{topcoman}}
1451 % The TOPtesi bundle adds very little to the user commands defined
1452 % by the |report| class; nevertheless the package \texttt{topcoman.sty},
1453 % that is part of this bundle and is automatically loaded, defines some
1454 % useful commands for typesetting technical matters in such a way as to
1455 % fulfil some (not all) \sigla{ISO} regulations.
1456 % Some of these commands are already defined with the \texttt{babel}
1457 % Italian option, but if your thesis is written in different languages
1458 % it may happen that such commands are not available any more when you
1459 % select another language; with the presence of the definitions contained
1460 % in \texttt{topcoman.sty} such useful commands should remain available
1461 % with every language. The \texttt{polyglossia} package does not
1462 % produce any useful additional command for writing in an almost
1463 % \sigla{ISO} compliant way\footnote{Nevertheless, when typesetting with
1464 % \XeLaTeX\ or \LuaLaTeX\ and using OpenType fonts, even for
1465 % typesetting math, the calling of the |unicode-math| package with
1466 % option \opz{mathstyle=\sigla{ISO}} lets you typeset in an \sigla{ISO}
1467 % compliant way almost everything you need.}, therefore the macros
1468 % contained in the \texttt{topcoman.sty} package may come handy.
1469 %
1470 % The following description specifies these particular commands.
1471 % \begin{description}[noitemsep]
1472 % \def\Item[#1]{\item[\cs{#1}]}
1473 %
1474 % \Item[DeclareSlantedCapitalGreekLetters] does exactly what
1475 % its name means: it changes the definitions of the mathematical
1476 % capital Greek letters so that they are typeset in “italics”;
1477 % they are actually taken from the math italic alphabet,
1478 % instead of the default roman one. This command is useful with
1479 % \LaTeX, while with \XeLaTeX\ and \LuaLaTeX\ it is unnecessary
1480 % due to the larger set of glyphs and math font commands
1481 % that are available with proper \sigla{UNICODE} math fonts and
1482 % options.
1483 %
1484 % \Item[ensuremath] should be already defined in the \LaTeX\ kernel;
1485 %should you miss it for any reason, thei package provides it.
1486 % %
1487 % \Item[ohm] typesets an upright capital omega even if the
1488 % capital Greek letters are in italics; another good point
1489 % is that |\ohm| can be used also in text mode.
1490 % %
1491 % \Item[ped] inserts an index/subscript in upright type; the \sigla{ISO}
1492 % regulations require the use of italics for physical or
1493 % mathematical variables, and upright type for anything that
1494 % is not a variable, from the names of functions (such as sin,
1495 % cos, log, etc.), to the indices that contain information
1496 % on something that is not variable. This means that $V_i$
1497 % requires an italic index to imply that the object $V$ is
1498 % the $i$-th in a set, while, say, $V_{\mathrm{max}}$
1499 % indicates the maximum value of the variable $V$. This
1500 % command |\ped| may be used in both math and text mode.
1501 % %
1502 % \Item[ap] similarly |\ap| inserts an apex/superscript in
1503 % upright type, in both math and text mode.
1504 % %
1505 % \Item[unit] sets the unit of measure close to the numerical
1506 % measure value by inserting a non breakable thin space and
1507 % by setting the units of measure in upright type; this works
1508 % both in math and text mode. Of course it is necessary to
1509 % input the |\unit| command without intervening spaces in the
1510 % source file; it's necessary to typeset, say, |35\unit{km}|
1511 % while avoiding a form such as \verb*+35 \unit{km}+.
1512 % This command, as it is defined, conflicts with the definition
1513 % of the homonymous command |\unit| as defined by some packages such as
1514 % \texttt{unitx}, \texttt{siunitx}, etc., but since one of these
1515 % packages is necessarily input in the preamble, while
1516 % \texttt{topcomand.sty} is read at the execution of |\begin{document}|,
1517 % the latter file has provisions to test if any of those packages has
1518 % already been loaded, so as not to overwrite the latter package
1519 % definition and to avoid every possible conflict.
1520 % %
1521 % \Item[micro] sets the decimal prefix $\mu$ (providing, if
1522 % possible, the sign with serifs, \textmu, taken from the Text
1523 % Companion font or any other font that contains this variety
1524 % of the Greek letter {\usefont{LGR}{lmr}{m}{rs}m}) when typesetting
1525 % units of measure.
1526 % %
1527 % \Item[gradi] sets the small circle that defines the sexagesimal
1528 % degrees, for example $35^\circ$; it may be used also for the
1529 % celsius degrees by writing in the source file, say,
1530 % |35\unit{\gradi C}| in order to get $35\,^\circ\mathrm{C}$;
1531 % notice the difference with |35\gradi|, that yields $35^\circ$
1532 % without any space between the measure and the “degree” little
1533 % circle; this is what the \sigla{ISO} regulations require; the small
1534 % space inserted by |\unit| is required when the unit of measure
1535 % symbol contains at least one letter.
1536 % %
1537 % \Item[gei] inserts the imaginary unit in upright type with the
1538 % “spelling” used by the Italian technologists: “j”. This command
1539 % may be redefined, of course, but this strange name is due to the fact
1540 % that nowadays the letter “j” in Italian is called with the
1541 % one-syllable English name (much shorter than the traditional
1542 % Italian three syllable name “i~lunga”) and the indicated spelling
1543 %“gei” is the phonetic Italian rendering of the English word.
1544 % The imaginary unit is not a variable, and the \sigla{ISO} regulations
1545 % require it is typeset with an upright serifed font.
1546 % %
1547 % \Item[eu] inserts the Napier number symbol “e” in upright
1548 % type; since this entity is not a variable, but it is
1549 % a mathematical constant, the \sigla{ISO} regulations require it to
1550 % be typeset in upright type. The \sigla{ISO} regulations require the
1551 % upright type for “e” and any other mathematical constant, but
1552 % requires that the electron charge $e$ is typeset in math italics
1553 % because this is a physical “constant”, not a mathematical one.
1554 % \XeTeX\ and \LuaLaTeX\ allow to typeset upright math Greek
1555 % letters, so there is the facility to typeset an upright
1556 % “{\usefont{LGR}{lmr}{m}{rs}p}” (the number) to be distinguished
1557 % from a slanted “$\pi$” (the angle).
1558 % %
1559 % \Item[goodpagebreak\oarg{n}] inserts a conditional page break after
1560 % the point where this command appears; it is not equivalent to
1561 % the |\raggedbottom| declaration that does not vertically
1562 % justify \emph{any single} page; this command tests the amount of space
1563 % remaining on the page, and if it is less than a given number
1564 % of lines, it inserts a page break; the result is a ragged
1565 % bottom \emph{single} page, that sometimes is better than excessive
1566 % spacing between paragraphs, or within items of a list, or
1567 % before or after displayed material. It is handy also to use
1568 % before starting a new section, because at least four
1569 % lines are required by \LaTeX\ in order to avoid orphan lines.
1570 % \cs{goodpagebreak} accepts an optional argument\meta{n} that sets the
1571 % number of lines to test the necessary space for a break;
1572 % by default this number is~4.
1573 %
1574 % \Item[listing\meta{filename}] requires for its argument the name of a file
1575 % and typesets it in verbatim mode; this command is very useful
1576 % for typesetting the listings of the programs that were written
1577 % for the thesis; for best results it is recommended that the
1578 % source program has lines not longer than 80 characters.
1579 %
1580 % The original definition of command |\listing| dates back to the
1581 % old times of \LaTeX\,209; it has become \textcolor{red}{obsolete}; for
1582 % backwards compatibility it is maintained but as {\color{red}an alias
1583 % to the command |\VerbatimInput| of package |fancyvrb|}; its
1584 % functionality may be configured with the same commands
1585 % specified in the |fancyvrb| documentation for the original
1586 % command. The |fancyvrb| package was preferred to the |listings|
1587 % one, because it typesets verbatim material even while
1588 % using font with multibyte encoded characters (therefore it works fine
1589 % with \XeLaTeX\ and \LuaLaTeX), while the fancier package
1590 % |listings| performs correctly only with \sigla{ascii}
1591 % characters and requires special settings to use selected characters
1592 % encoded with more than 7~bits.
1593 % \end{description}
1594 %
1595 % All these commands are defined into the separate package
1596 % \texttt{topcoman.sty} that might be used as an independent
1597 % extension package with any document class.
1598 %
1599 % \section{The monografia module}
1600 %
1601 % The |toptesi-monografia| module gets loaded if one of the
1602 % \opz{tipotesi=triennale} or \opz{tipotesi=monografia} options
1603 % was specified to the |TOPtesi| class. It can be used as a
1604 % standalone module, as well as the |topfront| general one, although
1605 % supposedly, it is used most often with its mother class.
1606 %
1607 % In order to use it as a standalone module, some definitions
1608 % must be established in order to have available at least some
1609 % if not all of the settings and the switches that are available
1610 % when the module is used with |TOPtesi|. Of course suitable
1611 % tests are made in order to check if certain packages are
1612 % already loaded and if certain switches are already defined;
1613 % and some options are defined.
1614 %
1615 % The rest of the module is a subset of the |topfront| package;
1616 % all commands that refer to information used for other types
1617 % of theses are eliminated and the title page is typeset by means
1618 % of another environment that does not rely on the environment
1619 % |frontespizio| (with or without asterisk). The new environment
1620 % |ThesisTitlePage| is more or less the only difference compared
1621 % to the way a bachelor thesis title page is typeset with the
1622 % |topfront| package. It will be described later on; but, with
1623 % the due differences, this environment mimics the one defined
1624 % in the |toptesi-scudo| module.
1625 %
1626 % The commands contained in this module are divided in three sorts.
1627 % \begin{enumerate}[noitemsep]
1628 % \item
1629 % The commands to define the infix words, so as to use them
1630 % explicitly within the |ThesisTitlePage| environment or
1631 % within a configuration file either to change the default
1632 % strings or to define them for languages different from
1633 % Italian; no attempt was made to establish such strings
1634 % for English, because is is supposed that most often than
1635 % not this module is used by Italian students to write their
1636 % bachelor degree final works in Italian universities;
1637 % nevertheless the possibility to change these strings is
1638 % always available.
1639 % \item
1640 % The commands that define the default values for every
1641 % command that may be used or may be skipped while setting
1642 % up the title page.
1643 % \item
1644 % The commands that define the values for the variable
1645 % information necessary for every individual thesis.
1646 % \end{enumerate}
1647 % As explained above the first group is used essentially to
1648 % define or redefine the infix strings. The second group is to
1649 % define most default values for information that might or
1650 % might not be entered by the user; these values are tested
1651 % against the |\empty| value in order to decide if using or
1652 % neglecting them. The third group is the one that the user
1653 % directly or through a configuration file uses for his/her
1654 % personal data and his/her specific thesis.
1655 %
1656 % \subsection{The configuration file}
1657 % This module for the bachelor thesis final work searches
1658 % for a configuration file with the same name as the thesis
1659 % main file and with extension |.cfg|. Internally this main
1660 % file name is stored in the internal variable |\jobname|;
1661 % therefore this module searches the file |\jobname.cfg|. If
1662 % this file does not exist, the typesetting engine does
1663 % not use any specific setup, except what has been defined
1664 % in this module for the default settings.
1665 %
1666 % Such configuration file might contains the redefining commands
1667 % for the infix strings, and/or the other commands that can be
1668 % used within the |ThesisTitlePage| environment.
1669 %
1670 % If a configuration file was loaded, the commands it contains
1671 % are overwritten by those that are specified within the
1672 % |ThesisTitlePage| environment body. So the user should pay attention
1673 % to what the configuration file contains and to what s/he writes
1674 % within the |ThesisTilePage| environment, but if s/he uses again
1675 % a command already used in the configuration file, it should be
1676 % for a good reason; simply s/he should remember that the last
1677 % setting is the one that is actually used.
1678 %
1679 % \subsection{Module options}
1680 % If the module is loaded by |toptesi|, it receives the necessary
1681 % options by |toptesi| itself. If the module is used as a self
1682 % standing one and called by another class, it may be called with
1683 % specific options that are listed here. In general they behave
1684 % as the |toptesi| options; should they perform differently the
1685 % details are explained hereafter.
1686 % \begin{description}[noitemsep]
1687 %\def\Item[#1]{\item[\opz{#1}]}
1688 %
1689 % \Item[evenboxes] The box containing the supervisor name(s)
1690 % and that containing the candidate name(s) are typeset by
1691 % aligning their first lines; if this option is not specified
1692 % the boxes are skewed, so that there is enough place to set
1693 % the supervisor signature(s) on the right and the candidate
1694 % signature on the left; if the bachelor degree final work does
1695 % not imply a supervisor, the candidate name is centred and
1696 % there is no question of aligning any box.
1697 %
1698 % \Item[cucitura]
1699 % Specifies a displacement of the text body towards
1700 % the outer margin. See the |toptesi| description. This option,
1701 % differently from the one defined in |toptesi| and |topfront|
1702 % is not of the type \emph{key\,$=$\,value}; therefore in
1703 % order to change its preset value it is necessary to use
1704 % the \cs{setbindingcorrection} command. This remark applies
1705 % only to the case when this module is called by another class.
1706 %
1707 % \Item[classica]
1708 % Uses some \opz{classica} features; see the |toptesi|
1709 % description.
1710 %
1711 % \Item[autoretitolo]
1712 % Similarly with the main stream |toptesi| bundle, this
1713 % questionable option is for changing the internal page
1714 % style; it is useless for this module, but there are some
1715 % tests that derive from the general |topfront| package,
1716 % so that the option is maintained for compatibility purposes.
1717 %
1718 % \Item[oldstyle] On the opposite this option is maintained,
1719 % at least to typeset the academic year interval with old
1720 % style numbers.
1721 % \end{description}
1722 %
1723 % \subsection{User commands and environments}
1724 %
1725 % The only user environment defined by this module is
1726 % |ThesisTitlePage|. It plays the same role as the |frontespizio|
1727 % environment, but it is incompatible with the |\frontespizio|
1728 % command. In other words if this module is used, the user must
1729 % use the |ThesisTitlePage| environment only and does not have
1730 % available the various title page environments and commands
1731 % available with the |topfront| package.
1732 %
1733 % This environment accepts an optional asterisk as an argument;
1734 % the syntax is the following:
1735 %\begin{ttsintassi}
1736 %\cs{begin}\Marg{ThesisTitlePage}\meta{*}
1737 %\meta{thesis definition commands}
1738 %\cs{end}\Marg{ThesisTitlePage}
1739 %\end{ttsintassi}
1740 % where, differently from other \LaTeX\ environments that accept
1741 % an optional asterisk, this optional token is not within the
1742 % opening (and closing) environment braces, but it is the very
1743 % first entered element into the environment body. Its function
1744 % is the following: if the asterisk is missing, the university
1745 % logo(s) are typeset at the top of the page; if the asterisk
1746 % is present, the logo(s) are set in the page lower half, below
1747 % the possible subtitle.
1748 %
1749 % The commands available with this module, divided into the three
1750 % groups described above, are the following.
1751 % \begin{description}[noitemsep]
1752 % \def\Item[#1]{\item[\cs{#1}]}
1753 % \item[String settings]
1754 % \begin{description}[noitemsep]
1755 % \Item[NomeAnnoAccademico\marg{academicyear string}]
1756 % Sets the default string for the
1757 % “Academic Year”; by default it is “Anno accademico”.
1758 % \Item[NomeCorso\marg{Degree course name}] sets the default string
1759 % “Corso di laurea in” followed by an intelligent space |\xspace|.
1760 % \Item[AnnoAccademico\marg{substitute string for academic year}]
1761 % Sets a different string in place of the default “Anno Accademico”
1762 % one.
1763 % \Item[Struttura di\marg{structure prefix}] sets the default
1764 % structure prefix; for example, this prefix might be “Department of”,
1765 % while the structure name entered with \cs{struttura}
1766 % might be “Electrical Engineering”; therefore the
1767 % title page is typeset with the complete string
1768 % “Department of “Electrical Engineering”. The default
1769 % string is in Italian, but by using this command,
1770 % remember to enter the string you need terminated by
1771 % the intelligent space macro \cs{xspace}.
1772 % \Item[CorsoDiStudi\marg{degree course name}] sets the default
1773 % string for the degree course type; it might be “Laurea triennale”,
1774 % or “Bachelor degree” or similar strings in other
1775 % languages. It replaces the \emph{obsolete} following command:
1776 % \Item[CorsoDiLaureaIn\marg{degree course name}]
1777 % Remains available to be backwards compatible with
1778 % |topfront| standard module command; its use is \emph{discouraged}.
1779 % \Item[NomeElaborato\marg{thesis name}]
1780 % Sets the name that qualifies the
1781 % document; by default it is “Monografia”, but this
1782 % user command may be used to set it, for example, to
1783 % “Tesi di laurea triennale”, or anything else in
1784 % Italian, in English, or the used main language.
1785 % The |topfront| command |\NomeMonografia| is let to
1786 % to |\NomeElaborato| for backwards compatibility and its
1787 % use is evidently \emph{discouraged}.
1788 % \Item[CandidateNames\marg{candidate list headings}]
1789 % Sets the labelling command for the
1790 % list of the candidate names; by default these names are the
1791 % masculine, feminine, singular and plural Italian names
1792 % starting with “Candidato”; if the \opz{classica} option
1793 % is in force they start with “Laureando”;
1794 % the user could use this command which has a non standard syntax
1795 % (delimited arguments); therefore it is suggested that
1796 % end users refrain from using it, unless they know how to handle
1797 % the delimited argument commands.
1798 % This command sets the four strings to any desired value,
1799 % if, as in English, there is no difference between masculine
1800 % and feminine, repeat the same names for the feminine positions,
1801 % the last ones; the syntax in facts is the following:
1802 %\begin{ttsintassi}
1803 %\cs{CandidateNames}\%
1804 %\qquad\marg{masculine singular},\%
1805 %\qquad\marg{masculine plural},\%
1806 %\qquad\marg{feminine singular},\%
1807 %\qquad\marg{feminine plural},!
1808 %\end{ttsintassi}
1809 % \Item[TitoloListaCandidati\marg{candidate list headings}]
1810 % is a much simpler command the user should prefer to the
1811 % previous one; in facts it accepts a single argument formed
1812 % by a comma separated list of names; from zero up to four names
1813 % (in the same order as described above).
1814 % Therefore the following commands are all valid ones:
1815 %\begin{ttsintassi}\small%
1816 %\cs{TitoloListaCandidati}\Marg{}
1817 %\cs{TitoloListaCandidati}\Marg{\'Etudiant}
1818 %\cs{TitoloListaCandidati}\Marg{Estudiante,Estudiantes}
1819 %\cs{TitoloListaCandidati}\Marg{Kandidat,Kandidaten,Kandidatin,Kandidatinen}
1820 %\end{ttsintassi}
1821 % \Item[CandidateName\marg{candidate list heading}]
1822 % This command used to be the default one
1823 % with the standard |topfront| module, and remains available
1824 % with this package; it sets just one name to substitute
1825 % the default ones. Please notice that this command is not
1826 % available with the other thesis type options.
1827 % \Item[Relatore\marg{advisor list heading}]
1828 % Sets the string that labels the supervisor box; by default
1829 % it is the Italian name “Relatore”; the command may be used to set
1830 % any different string.
1831 % \Item[Correlatore\marg{co-advisor list heading}]
1832 % Sets the string that labels the list of co-superpervisor when
1833 % there is just one “second” supervisor; in facts, with just one
1834 % co-supervisor the heading it the singular name “Correlatore”.
1835 % \Item[Correlatori\marg{co-advisor list heading}]
1836 % Sets the heading of the list of co-supervisors when there are
1837 % a supervisor and two co-supervisors.
1838 % \end{description}
1839 % \item[Variable data settings]
1840 % \begin{description}[noitemsep]
1841 % \Item[titolo\marg{title}]
1842 % Sets the bachelor degree final work title.
1843 % The main module |topfront| uses in its place the command
1844 % \cs{monografia}; the user can still use the old command,
1845 % but |\titolo| is more descriptive.
1846 % \Item[sottotitolo\marg{subtitle}] Sets an optional subtitle.
1847 % \Item[corsodistudi] and \cs{corsodilaurea} specify the actual
1848 % name of the degree course; \cs{corsodistudi} should be
1849 % preferred; \cs{corsodilaurea} is \emph{deprecated}, but is
1850 % maintained for backwards compatibility.
1851 % \Item[materia\marg{discipline}] and \cs{Materia}\marg{discipline}
1852 % set the optional discipline the thesis deals with.
1853 % \Item[relatore\marg{advisor's name}] sets the name of the only
1854 % or the principal supervisor.
1855 % \Item[secondorelatore\marg{second advisor's name}] sets the
1856 % name of a second supervisor, if any.
1857 % \Item[terzorelatore\marg{third advisor name}] sets the name of
1858 % a third supervisor, if any.
1859 % \Item[candidato\marg{candidate name (man)}] sets the name of the
1860 % first or only ‘M’ candidate; in general bachelor degree final
1861 % works are done by just one candidate but, in case, there are
1862 % available also the commands for a second and a third
1863 % candidate. Masculine and feminine commands are available
1864 % and the heading of the candidates list is labelled accordingly.
1865 % \Item[candidata\marg{candidate name (woman)}] sets the name of the
1866 % first or only ‘W’ candidate.
1867 % \Item[secondocandidato\marg{second M candidate}] or
1868 % \cs{secondacanddata}\marg{second W candidate}
1869 % set the name for a possible second ‘M’ or ‘W’ candidate.
1870 % \Item[terzocandidato\marg{third M candidate}] or
1871 % \cs{terzacandidata}\marg{third W can\-didate}
1872 % set the name for a possible ‘M’ or ‘W’ third candidate.
1873 % \Item[ID\marg{ID code}] to be used just after the candidate's name,
1874 % but as part of the setting command argument, establishes the
1875 % candidate's ID label string |\IDlabel| that prefixes the
1876 % candidate's ID number. The user should not worry about this string,
1877 % unless s/he wants to modify it; by default it is set to
1878 % \verb+\\\quad matricola\ +; in other words, the ID number is set
1879 % indented under the candidate's name and a space is put between
1880 % the string and the number.
1881 % \Item[sedutadilaurea\marg{examination date}]
1882 % sets the date of the final examination;
1883 % by default the current month and year are typeset if this
1884 % command is not specified; but the user can specify anything;
1885 % s/he can even prefix the year range with the
1886 % \cs{AnnoAccademico} command, that typesets (in the current
1887 % language if localisation has been made by means of the
1888 % suitable command of group~1) a string equivalent to
1889 % “Academic Year”; in any case the user can write down what
1890 % s/he likes best in place of the predefined value.
1891 % \Item[NomeAteneo\marg{University name}]
1892 % sets the proper name of a specific university; it will be
1893 % typeset in suitable uppercase type under the generic name of the
1894 % university; if this command is not used, no name gets typeset
1895 % in the title page.
1896 % \Item[struttura\oarg{ordinal number}\marg{Structure name}]
1897 % sets the name of the university entity
1898 % that supervises the development of the degree course;
1899 % it may be a “faculty”, a “department”, a “school”,
1900 % it depends from the specific university. Some universities
1901 % do not require this information on the title page. In any
1902 % case if this command is used it accepts two arguments:
1903 % the first one is optional, and, if used, is an uppercase
1904 % roman ordinal numeral that distinguishes the structure;
1905 % the second argument is the complete structure name.
1906 % \Item[setlogodistance\marg{distance}] sets the distance between
1907 % adjacent university logos, if more than one are used.
1908 % \Item[logosede\oarg{height}\marg{logo file name}]
1909 % sets the name of a graphics file that
1910 % contains the logo of the university; the default value of
1911 % this command il \cs{empty}; this macro may be used several
1912 % times, in case the bachelor degree final work is developed
1913 % within a multiple degree Erasmus program; this might be
1914 % unusual with bachelor degree courses but not impossible.
1915 % In any case if no logo file
1916 % name is specified, no logos are printed and no space
1917 % is used in the title page; if one or more logos are used
1918 % they are assembled with the same height into a horizontal
1919 % box, that before being printed is measured; if the width
1920 % exceeds the text width, the whole box is scaled down by
1921 % preserving the aspect ratio so as to fit it inside the
1922 % text width; after these tests and possible scaling down,
1923 % the logo box is printed. The logo distance my be varied
1924 % from its 3em default value by using \cs{setlogodistance}, but
1925 % it is suggested not to vary it too much. The \cs{logosede}
1926 % accepts an optional value that is the common height of the
1927 % logos; this possibility does exist but it is strongly
1928 % \emph{discouraged}.
1929 % \Item[tutoreaziendale\marg{company tutor name}]
1930 % set the name of a possible company tutor, in case the final
1931 % work is developed in a Company external to the university
1932 % \end{description}
1933 % \end{description}
1934 %
1935 % \section{The module for a master degree thesis}
1936 %\label{sec:topmagistrale}
1937 %
1938 % The module for the master degree thesis, |toptesi-magistrale.sty|
1939 % is almost identical to the generic module |topfront|; the obvious
1940 % differences are that it lacks the latter module commands that refer
1941 % to the bachelor degree or the Ph.D.~theses. Evidently such specific
1942 % commands are useless in a master degree thesis.
1943 %
1944 % \begin{sloppypar}
1945 % Such eliminated commands include |\manografia|,
1946 % |\sedutadidottorato|, |\ciclo|, |\Direttore|, and so forth.
1947 % \end{sloppypar}
1948 %
1949 % A tricky situation arises if the thesis is typeset in several
1950 % tomes. There are substantially two different situations with
1951 % different implementations with the generic module |topfront|
1952 % and this specific module |toptesi-magistrale|.
1953 %\begin{enumerate}[noitemsep]
1954 %\item
1955 % Setting the tome number on each tome title-page is realised by means
1956 % of the |\tomo| command that requires a preliminary
1957 % specification of all the necessary data before |\tomo|
1958 % can play its role; it actually uses the |\frontespizio|
1959 % environment, but before the |tomo| counter is stepped up.
1960 %
1961 % This allows to typeset the various tomes in a single
1962 % document, so that the user can cross-reference elements
1963 % belonging to different tomes. When the single multi\-tome
1964 % document is completed the user can split its \sigla{PDF} file
1965 % in separate files (by means of the |pdfpages| package
1966 % functionalities) and print them; in printed pages the
1967 % cross-references do not require hyperlinking, while
1968 % the single document file may be completely hyperlinked;
1969 % reading the printed tomes is correct, and reading the
1970 % whole thesis in a single document on the screen allows
1971 % the cross-linked navigation from one point to another.
1972 %
1973 % The draw back of this procedure is that splitting the
1974 % single \sigla{PDf} file in several files requires another processing
1975 % job, and any editing of the source thesis files may require
1976 % repeating this splitting job because the number of pages
1977 % may be modified and/or cross references do not point
1978 % to the correct page number.
1979 %
1980 %\item
1981 % With the |ThesisTitlePage| environment of this
1982 % |toptesi-magistrale| module the |\tomo| command is used
1983 % before or within within the environment and it just
1984 % steps up the |tomo| counter while allowing typesetting
1985 % the necessary tome information on the title page.
1986 %
1987 % In this way it is necessary to typeset each tome with
1988 % its own source file(s) to produce different output \sigla{PDF}
1989 % files; when printed they are substantially identical to
1990 % the split documents obtained with the previous approach
1991 % but it simply avoids splitting the single document file
1992 % in several files. The drawback is that if hyperlinked cross-referencing
1993 % is used, each tome is correctly hyperlinked to its
1994 % internal targets, but no cross-referencing can
1995 % automatically be done to items in other tomes. I do not
1996 % think this is a real draw back in practical situations,
1997 % but of course it produces a limitation to reading the
1998 % tomes on the screen.
1999 %\end{enumerate}
2000 %
2001 % I assume that multi\-tome theses are very rare; \LaTeX can
2002 % handle the production of different documents (different
2003 % tomes/volumes) maintaining correct cross references also to
2004 % material external to any specific volume, but the handling
2005 % of the whole job becomes very complicated not to mention
2006 % the programming difficulties. For master theses I would avoid
2007 % splitting one's thesis is several tomes; nevertheless this
2008 % functionality has been asked for, so that this bundle
2009 % realises a couple of solutions that require some compromise
2010 % and some manual work by the author. A better solution
2011 % is on the TODO list, but it is not to come in a short time.
2012 %
2013 % In summary this |toptesi-magistrale| module keeps all the
2014 % commands defined on the |topfront| module; modifies the
2015 % definition of the |\tomo| command; adds the |ThesisTitlePage|
2016 % environment within which the configuration file is read and where all
2017 % commands for the title page data are to be inserted. The
2018 % peculiarity of this environment is that the possible asterisk
2019 % necessary to switch from the the logos set in the title page
2020 % lower half (no asterisk) to the logos at the page top
2021 % (asterisk) must be inserted the same way as in the other
2022 % modules, that is as the first token at the beginning of
2023 % the environment.
2024 %
2025 % \section{The Ph.D.\ module for general use}
2026 %
2027 % Except for the ScuDo theses, for which the University
2028 % specified the necessary requirements for both contents
2029 % and appearance of the title page, we provide a generic
2030 % module for Ph.D.\ theses for other universities. It goes
2031 % by itself that if the specifications cannot be customised
2032 % by using the customising commands of the ScuDo module,
2033 % nor by this module, it is necessary to use a custom
2034 % module that the user must create as specified in the next
2035 % section.
2036 %
2037 % This module is generic as much as the |topfront| one.
2038 % It differs only for the elimination of the title page commands
2039 % that refer to other thesis types and the only addition is
2040 % the |ThesisTitlePage| environment, just as it has been done
2041 % for the other bundle modules.
2042 %
2043 % The data insertion or modification commands are a subset
2044 % of those described in subsection~\ref{sec:topfront},
2045 % of course without those that are specific to other thesis
2046 % types; therefore we do not repeat them here.
2047 %
2048 % Special care should be dedicated to the university
2049 % specifications; in some universities the supervisor(s)
2050 % should not be indicated and in such a case the (unique)
2051 % candidate may be indicated without any legend on top of
2052 % it. The University logo might already contain the explicit
2053 % wording with the the university name and in this case
2054 % repeating the name would be pleonastic. At my level I
2055 % cannot foresee the user requirements therefore it is up
2056 % to the user to take care of inputting the correct
2057 % fixed word data and the specific thesis data. I hope
2058 % this module is useful for most Ph.D.\ students, but if
2059 % the user compares the title page requirements with those
2060 % prescribed for the ScuDo theses, s/he sees how much such
2061 % requirement might be different from one university to the other.
2062 %
2063 % May be in such circumstances the user might prefer to create
2064 % his/her custom title page and would not use this module at all.
2065 %
2066 % \section{The custom module for the title-page}\label{sec:custom}
2067 %
2068 % The construction of the customised title page module is the full
2069 % responsibility of the user.
2070 % In facts the user, beyond specifying the |tipotesi=custom| option
2071 % to the |toptesi| class class, at the beginning of the
2072 % document explicitly inputs a personal package file, say
2073 % |mycustomfile.sty| by means of the simple
2074 % |\usepackage{mycustomfile}| command, and this is all the user
2075 % needs. Of course this is an understatement; in facts s/he
2076 % should select a package form the many existing ones, s/he
2077 % can create him/herself a new package branched on other existing
2078 % software; s/he may refrain form using external packages,
2079 % and simply insert his/her title page data within a |titlepage|
2080 % environment where s/he wants, with the fonts families, series,
2081 % shapes, and sizes s/he prefers and so on.
2082 %
2083 % Needless to say that in order to create a custom title page
2084 % module the user must perfectly know the intricacies of the
2085 % \LaTeX\ language. It may be helpful to read the Italian
2086 % documentation |toptesi-it.pdf| where an example of landscape
2087 % title page is already described in full detail. Of course a
2088 % landscape title page requires a custom layout and is no
2089 % surprise that the example deals with this particular one.
2090 % Nevertheless that example gives a good idea on how to create
2091 % a custom title page.
2092 %
2093 % We don't go further in describing the |tipotesi=custom| option,
2094 % except remembering that this option just inhibits loading both
2095 % the standard default module, and any other predefined module, unless the
2096 % user directly loads one with or without the specific module options.
2097 %
2098 % \section{The high school final work module}
2099 %
2100 % The suffix |sss| is the acronym for the Italian name of
2101 % “High School”, \emph{Scuola Secondaria Superiore}.
2102 % Elegance of bureaucratic language: the elementary school
2103 % now is `Scuola Primaria', and junior high school is `Scuola
2104 % Secondaria Inferiore'. As well as it was in Germany and
2105 % in some Swiss Cantons, the total number of school years
2106 % is 13 instead of 12, as it is in most countries. The advantage
2107 % is that no general education is taught in university, no
2108 % \emph{classes pr\'eparatoires}, because it is assumed that
2109 % the high school diploma assures a sufficient level of general
2110 % education.
2111 %
2112 % Differently from most high school systems in the world,
2113 % in Italy each school has a special “mission” and receives
2114 % different names, all under the general definition of Scuola
2115 % Secondaria Superiore. But it s possible to distinguish
2116 % between Licei (University preparatory), Istituti tecnici
2117 % with various specialisation (for technical education in
2118 % different domains); Istituti professionali (for vocational
2119 % training); all of them end with a state examination, and
2120 % almost all of them allow entrance in University, although
2121 % a certain level of auto\-selection is actually performed.
2122 % Many university Schools, formerly Faculties, submit applicants
2123 % to entrance tests intended mostly to let them perform a
2124 % conscious choice of their future studies; sometimes the
2125 % tests are intended also to form ranks in those schools where
2126 % the \emph{numerus clausus} is applied.
2127 %
2128 % This off topic is necessary to let the general reader
2129 % understand the importance of the \emph{esame di maturità}
2130 % and the important role that the high school final work
2131 % (nicknamed \emph{thesina}, `little thesis') plays in this
2132 % generally difficult exam; statistics say that the percentage of
2133 % flunking students is very low, but the final passing grade
2134 % (a numerical value in the range from 60 to 100 with honours)
2135 % plays also an important role in the following career, therefore
2136 % students work very hard to pass with good grades.
2137 %
2138 % The above off topic explains why in Italy the final high
2139 % school state exam includes the evaluation of a personal
2140 % written report on some subject chosen by each student;
2141 % this choice is often performed with
2142 % an initial support by a teacher, that gives help in
2143 % choosing the subject, and, maybe, offers some initial input.
2144 % They do not supervise the student work; but this work is
2145 % submitted to the examining committee (the members of which
2146 % are external to the specific school) that after due reading,
2147 % ask questions on the work and investigate the depth to which
2148 % the student has gone into his/her chosen subject.
2149 %
2150 % Certainly this final work has not the importance of a
2151 % university thesis, but it is the first time when the
2152 % student is asked questions on a subject of his/her choice,
2153 % where the examining committee assumes s/he has examined all
2154 % the facets with the approach of a young adult, not that
2155 % of an old teenager.
2156 %
2157 % Some high school students have discovered \LaTeX, and some
2158 % of them do really appreciate the typesetting results all
2159 % \LaTeX\ users love; therefore they like the idea of
2160 % typesetting their final high school work with the powerful
2161 % \LaTeX\ functionalities.
2162 %
2163 % Of course their title page must be very different from those
2164 % suitable for university theses, therefore a special module is
2165 % necessary, and we decided to to add such a module to this bundle.
2166 %
2167 % Actually high school students require less information on the
2168 % title page; the school generic and proper names, obviously the
2169 % title and a possible subtitle, their name, maybe the logo of
2170 % their school, the examination date, and such similar data.
2171 %
2172 % They certainly do not need the advanced features needed for
2173 % the functionalities of the |topfront| extension package;
2174 % nevertheless the title page must have a professional look,
2175 % not just what they may achieve by using a word processor.
2176 %
2177 % The contents of the \emph{tesina} may also have a professional
2178 % look if the students do not tickle the typesetting program
2179 % to behave as a word processor. Several guides are available
2180 % for high school students, as well for university ones, to
2181 % recall how a “technical report” should be properly written;
2182 % unfortunately today students prefer to read their smartphones,
2183 % rather than real printed or electronic books; but those
2184 % students who use \LaTeX\ know very well that they need reading
2185 % suitable guides for using the program \emph{and} for structuring
2186 % their document.
2187 %
2188 % Mirko Mondini suggested to extend the TOPtesi bundle to
2189 % include the title page for high school final works. He
2190 % also suggested the layout of the page. This module may be
2191 % considered “work in progress” because we both have little
2192 % experience with the requirements of such final works.
2193 % As the maintainer of this bundle I thank him very much;
2194 % Marco may suggest specific changes in the near future;
2195 % his contributions are very welcome. I would add that
2196 % commentaries and suggestions by the students to whom this
2197 % module is dedicated are very welcome just as well.
2198 %
2199 % We assume the student already knows the fundamentals of \LaTeX;
2200 % we assume the Italian student has read the companion
2201 % documentation |toptesi-it.pdf| distributed with this bundle;
2202 % we assume also that the student has already a valid
2203 % installation of the \TeX\ system, preferably \TeXLive,
2204 % that is available for all most popular operating systems,
2205 % Windows included of course, although for Windows there is
2206 % also the alternative installation MiKTeX. As my personal opinion,
2207 % I think that \TeXLive may be updated more easily than MiKTeX
2208 % and, not negligibly, its default installation is complete,
2209 % while MiKTeX by default has a basic installation, so that very
2210 % often offline MiKTeX users suffer from “missing package” errors.
2211 %
2212 % Since this module is going to be used only by Italian high
2213 % school students, all user commands are in Italian.
2214 %
2215 % Here we concentrate on the title page. But before entering
2216 % this subject let us recall that this module already loads a
2217 % certain number of packages.
2218 % \begin{enumerate}[noitemsep]
2219 %\item
2220 % Packages |amsmath|, |amssymb| (only \pdfLaTeX) and |amsthm|
2221 % are already loaded, but a test is made to verify if the user
2222 % has loaded in his/her preamble the math packages |newtxmath|
2223 % or |newpxmath| (possibly together with their companions
2224 % |new...text|), because the latter packages already provide
2225 % for their functionalities.
2226 %\item
2227 % If they typeset with \LuaLaTeX\ or \XeLaTeX, the suitable
2228 % packages are already loaded, in particular the |unicode-math|
2229 % one; the user, though, should load a matching OpenType Math
2230 % font among those available with the \TeXLive distribution.
2231 %\item
2232 % Service packages such as |xparse|, |xspace|, and |xcolor|
2233 % are already loaded for the benefit of this bundle and this
2234 % module, but the user is free to use their functionalities,
2235 % in particular those of |xcolor|.
2236 %\item
2237 % Packages |calc| and |ifthen| are functional for the module;
2238 % supposedly the end users should not have any necessity to use
2239 % them, but, of course, they can if they need to.
2240 %\item
2241 % Package |multirow| has been loaded, because many users like
2242 % to imitate word processor functionalities; this package allows
2243 % to create table cells that span several rows; as a general
2244 % rule this practice should be avoided.
2245 %\item
2246 % Package |booktabs|, is very useful to set professional
2247 % tables (reading its documentation is necessary).
2248 %\item
2249 % No particular package has been loaded to create a specialised
2250 % bibliography; either the student directly uses its own
2251 % |thebibliography| environment, or provides to chose whatever
2252 % style s/he likes best and, if s/he decides to load package
2253 % |biblatex|, s/he should specify the desired options. In the first
2254 % case one of the most useful packages is |natbib|; in the
2255 % second case |biblatex| supports other bibliographic style
2256 % files. Both approaches require the preparation of a
2257 % bibliography database by means of programs |jabref|,
2258 % |bibdesk|, or similar applications: but with |natbib|
2259 % the |bibtex| database handler is required, while with
2260 % |biblatex| case the |biber| handler yields the best
2261 % performances. In both cases it is required the careful
2262 % reading of either package documentation.
2263 %\end{enumerate}
2264 %
2265 % The commands the user can use for the title page follow.
2266 %
2267 % Remember that they may be used directly within the
2268 % |FrontespizioTesina| environment; if the user prefers, s/he
2269 % can write them in a configuration file; such file must be
2270 % named with the same name as the document main file, and
2271 % it must be saved in the same folder; the information
2272 % read from the configuration file is possibly overridden
2273 % by the same commands, with different data, specified within
2274 % the |FrontespizioTesina| environment.
2275 % Just to be sure to be clear, if your document main file is
2276 % named |LaMiaBellaTesina.tex|, the configuration file should
2277 % be named |LaMiaBellaTesina.cfg| and both files should be
2278 % saved in the same folder.
2279 %
2280 % The title page commands are the following:
2281 %\begin{description}\def\Item[#1]{\item[\cs{#1}]}
2282 %\Item[SSSLogo\marg{school logo file name}]
2283 % is used to define the name of the graphic file containing
2284 % the high school logo; not necessarily the school allows to
2285 % use its logo; in any case if such command is not used, the
2286 % logo information is ignored.
2287 % Remember that the graphic file must have one of these
2288 % extensions: |.pdf|, |.eps|, |.png|, or |.jpg|; the first
2289 % two may contains vector images and give the best results;
2290 % the second two are bitmapped, therefore their rendering
2291 % depends very much on the pixel density of the file contents.
2292 %\Item[NomeTesina\marg{document name}]
2293 % sets the name of the document; the default value
2294 % is “Tesina di maturità”.
2295 %\Item[NomeCandidato\marg{heading over the candidate name}]
2296 % is used to set the heading over the author's name; since
2297 % the “tesina” is individual, the default value is
2298 % “Studente” or “Studentessa” depending on his/her gender.
2299 % See below the \cs{studente} and \cs{studentessa} command descriptions.
2300 % This command might be used also to set the heading with a different
2301 % name in the correct gender.
2302 %\Item[IndirizzoMiur\marg{Ministry of Education special address}]
2303 % sets the Ministry of Education special address. If this
2304 % command is omitted, this address, considered optional,
2305 % is neglected.
2306 %\Item[OpzioneMiur\marg{Ministry of Education option}]
2307 % sets the specification that distinguishes the school
2308 % mission, if any.
2309 %\Item[TipoScuola\marg{generic school name}]
2310 % sets the specific generic name of the school; default
2311 % none; therefore use of this commands is mandatory;
2312 % the user might specify “Liceo classico”, or “Istituto
2313 % tecnico industriale di stato”, or whatever applies for
2314 % the students' specific school.
2315 %\Item[NomeScuola\marg{specific school name}]
2316 % sets the specific name of the school; generally schools
2317 % are dedicated to famous scientists or heroes, or presidents,
2318 % or kings/queens, or writers, et cetera; default “empty”.
2319 %\Item[SedeScuola\marg{school address}]
2320 % sets the actual location of the school; it may be just the
2321 % city or a full postal address; it may contain new line
2322 % commands in order to format a full address of several lines;
2323 % no default.
2324 %\Item[AnnoScolastico\marg{school year}]
2325 % sets the school year at the end of which the state
2326 % examination is undertaken; no default.
2327 %\Item[titolo\marg{document main title}]
2328 % sets the title of the document; please don't use long titles;
2329 % if a short sentence is not descriptive enough, use the
2330 % |\sottotitolo| argument to add specifications to the title;
2331 % no default.
2332 %\Item[sottotitolo\marg{document substitle}]
2333 % sets an optional subtitle; if this command is not used
2334 % the subtitle field is ignored; no default.
2335 % The subtitle, if any, is typeset in a normal sized font,
2336 % therefore it can be several lines long; nevertheless pay
2337 % attention to use the tie command |~| to connect with an
2338 % unbreakable space to the following ones such words as
2339 % prepositions, articles, short adverbs, and such similar
2340 % items.
2341 %\Item[studente\marg{student name (Man)}] or
2342 % \cs{studentessa}\marg{student name {Woman}}, depending on the gender
2343 % of the student, sets the name of the author of the
2344 % document, i.e.\ the name of the student undergoing the
2345 % examination; no default.
2346 % Remember: \textbf{never ever use the surname(s) before the name(s)}.
2347 % If the \cs{NomeCandidato} macro has not been used, these commands
2348 % set the proper status to the |femminile| switch, so that the
2349 % proper default heading is used.
2350 %\Item[Presidente\marg{chairperson name}]
2351 % sets the name of the chairperson of the examining committee;
2352 % no default.
2353 % Again remember to write the necessary academic titles
2354 % in lowercase, and the name(s) before the surname(s).
2355 %\Item[NumeroCommissione\marg{Examining committee ID number}]
2356 % sets the examining committee ID number; no default.
2357 %\end{description}
2358 %
2359 % The actual title page is created within the environment
2360 % |FrontespizioTesina|. This environment first reads a the
2361 % configuration file if one exists, then it analyses the
2362 % commands set within the environment by the author,
2363 % possibly superseding the information read from the
2364 % configuration file; the environment closing command actually
2365 % typesets the title page; the schematic working is the
2366 % following:
2367 %\begin{Sintassi}
2368 %\Bambiente{FrontespizioTesina} \% reads the config.\ file if any
2369 %\meta{user commands with user data}
2370 %\Eambiente{FrontespizioTesina} \% typesets the title page
2371 %\end{Sintassi}
2372 % There are no options to specify; the title page is sort
2373 % of rigid in the sense that every piece of information goes
2374 % where it should and interlaced with proper spaces so as to fill
2375 % up the text grid in a sensible way. No doubt some users may
2376 % complain that the title page does not allow to do this or
2377 % that; that the spacings should be different from what they
2378 % actually are; and so on.
2379 %
2380 % There are work-arounds to these complains.
2381 %\begin{enumerate}[noitemsep]
2382 % \item
2383 % Instead of using the above environment, s/he uses the |titlepage|
2384 % environment within which s/he inserts what s/he wants and
2385 % where s/he likes best, with the typefaces s/he prefers,
2386 % with the vertical spacings that accomodate his/her aesthetical
2387 % feelings. Of corse it is necessary to know what is being done;
2388 % if not, the results may be worse than the predefined layout.
2389 %\item
2390 % Even better: the user may use a custom layout and set it
2391 % following the instructions described in section~\ref{sec:custom}.
2392 % \end{enumerate}
2393 %
2394 %^^A PDFA/A
2395 %
2396 % \section{\sigla{PDF/A} archivable format}
2397 % This section in general applies also if the thesis is typeset
2398 % by means of \LuaLaTeX\ or \XeLaTeX, but with \XeLaTeX\ special
2399 % attention should be paid to the details of the procedure as
2400 % described in the documentation of the \pack{pdfx} package. Even
2401 % better, \LuaLaTeX, whose source file is practically the same as
2402 % that of \XeLaTeX, may produce in a simpler way a \sigla{PDF/A}
2403 % compliant output file if the users follow attentively the
2404 % instructions contained in the documentation of the \pack{pdfx}
2405 % package.
2406 %
2407 % More details are given in the Italian documentation contained
2408 % in the \texttt{toptesi\discretionary{-}{}{-}it} which is part
2409 % of the TOPtesi bundle.
2410 %
2411 % Politecnico di Torino and several other Italian and foreign
2412 % universities are moving towards archiving theses in electronic
2413 % format, specifically in the \sigla{PDF} one. The problem of
2414 % course is: “Will it be possible to read the archived documents,
2415 % say, fifty years from now?”
2416 %
2417 % This essential question has been answered by the International
2418 % Standards Organisation (\sigla{ISO}) that in 2005 published the
2419 % regulation \sigla{ISO}~19005-1; in 2011 and 2012 enhancements of
2420 % this regulation have been published. This regulation defines
2421 % a \sigla{PDF} variant suitable for archiving, named \sigla{PDF/A}, that
2422 % has two sub-formats distinguished as \sigla{PDF/A}-1a, and
2423 % \sigla{PDF/A}-1b, \sigla{PDF/A-2a}, \sigla{PDF/A-2b}. and so on.
2424 % The `a' sub-format is more exacting, while the `b' one is less
2425 % stringent. In spite of the recently published upgrades,
2426 % here we stick to the PFD/A-b and PDF/A-2b, that are a sub set of the
2427 % newer ones, and for which suitable software is available.
2428 %
2429 % The requirements for the `a' sub-format imply not only those
2430 % requested for the `b' one, but also that the logical structure
2431 % of the document be accessible from outside (Tagged \sigla{PDF}).
2432 % The requirements for the `b' sub-format are that the
2433 % document must be reproducible without modifications exactly
2434 % as it was at the moment of archiving. All sub-formats must
2435 % contain \emph{metadata} that are searchable even without
2436 % decompressing the normally compressed \sigla{PDF} file, and that
2437 % contain information useful for archive maintenance; among
2438 % these informations, of course, the \sigla{PDF/A} category the document
2439 % belongs to, the document title, the authors, and few other
2440 % optional pieces of information, such as the keywords that
2441 % ease up library searches.
2442 %
2443 % Since version 1.40, the program \texttt{pdflatex} is capable
2444 % of producing \sigla{PDF/A}-1b compliant files, provided that some
2445 % attention is put into editing of the thesis source file. Since the
2446 % year 2008 the \TeX\ system, the executable \texttt{pdflatex} has
2447 % version number 1.40.9 (or higher); therefore today there is no
2448 % difficulty in producing \sigla{pdf/a} compliant documents, even at
2449 % level~2.
2450 %
2451 % The particular attention needed to avoid problems with the
2452 % \sigla{PDF/A} compliance is summarised as follows:
2453 % \begin{enumerate}[noitemsep]
2454 % \item
2455 % The preliminary essential requirement is that the
2456 % \texttt{pdflatex} or \texttt{lualatex} engine used
2457 % to typeset the thesis be sufficiently recent to support
2458 % the \sigla{PDF/A} requirements.
2459 % It's better to have the most recent distribution of
2460 % the \TeX\ system installed on your PC. Do not try to
2461 % typeset the thesis with the `old' \prog{latex}; you
2462 % \emph{must} process the input thesis file(s) with
2463 % \texttt{pdflatex} or with \prog{lualatex} or with \prog{xelatex};
2464 % in the following, no specific check will be made in
2465 % order to verify if you are actually using \texttt{pdflatex}.
2466 % If you really need to use the `old' \LaTeX, you get a DVI
2467 % file and you need to transform it with |dvips| into a
2468 % PS file; at this point you have lost the possibility of
2469 % exploiting the internal commands of |pdflatex|
2470 % version~1.40.9 or later. You can still produce a \sigla{PDF/A}
2471 % final document, but you have to transform it by means of the
2472 % procedures described in the Italian documentation; such
2473 % documentation describes several more or less effective
2474 % methods to transform a non compliant \sigla{PDF/A} file into a
2475 % compliant one, and how to correct the “imperfections”
2476 % that forbid any valid transformation.
2477 %
2478 % \item
2479 % Since 2016 the TeXLive distribution contains a new version
2480 % of \pack{pdfx} and now \sigla{PDF} documents produced with
2481 % \prog{lualatex} may be fully compatible with the standard
2482 % \sigla{PDF/A}. With some special care and some post"processing,
2483 % even \prog{xelatex} can now produce \sigla{PDF/A} compliant output
2484 % files.
2485 %
2486 % \item
2487 % Your up-to-date complete \TeX\ distribution should
2488 % contain the package \textsf{pdfx}; if it does not,
2489 % upgrade your \TeX\ system complete distribution. Be sure
2490 % that the version number of the \pack{pdfx} package has
2491 % version number~1.6.0 or higher.
2492 %
2493 %
2494 % \item
2495 % If your thesis main file, the one you run your typesetting
2496 % program on, is named, say, \texttt{JohnSmithMasterThesis.tex},
2497 % prepare in the same directory another file named
2498 % \texttt{JohnSmithMasterThesis.xmpdata} that contains the
2499 % \emph{metadata} relative to the thesis.
2500 % Pay attention to follow the stringent metadata syntax described
2501 % and exemplified in the \textsf{pdfx} documentation. A minimal
2502 % example set of \emph{metadata} would be the following one:
2503 % \begin{verbatim}
2504 % \Title{Experiments in Trichotetratomy}
2505 % \Author{John Smith}
2506 % \end{verbatim}
2507 % The keyword list requires a specific format that can be
2508 % examined in the |pdfx| package documentation. The best way to
2509 % be sure that this file accompanies the thesis main file,
2510 % is to put its contents inside a \env{filecontents*} environment.
2511 % The details are in the documentation of the \pack{pdfx} package and
2512 % examples are shown in the Italian documentation of |TOPtesi|.
2513 % The environment may used within the preamble, in any case before
2514 % loading the |pdfx| package. Actually this does not forbid to use the
2515 % environment before the |\documentclass| statement, as it was in the
2516 % previous versions of TOPtesi. The new version of environment
2517 % \env{filecontents} is backwards compatible with the previous
2518 % ones with this “simple” difference: it accepts some options
2519 % the most important of which are \opz{overwrite} and \opz{noheader};
2520 % the latter avoids inserting header comment lines into the saved
2521 % file, while the former allows overwriting it at each
2522 % compilation. Omitting \opz{overwrite} the environment does not
2523 % overwrite an existing |.xmpdata| file; so that if some modification
2524 % has been made to the source lines within the environment, such
2525 % modifications do not get saved in the metadata file. \textcolor{red}{Such
2526 % behaviour of the |filecontents| environment was introduced by the
2527 % end of 2019; therefore if you are using the options but have a
2528 % vintage version of the \TeX system you get errors. You are warned:
2529 % never use vintage versions of the \TeX system, but be careful to
2530 % maintain your (complete) installation up to date}. To avoid this
2531 % situation and be totally transparent with respect to the date of
2532 % the \LaTeX kernel date, we introduce a new environment named
2533 % \env{pdfxmetadata} that performs the necessary controls and hides
2534 % such differences to the user.
2535 %
2536 % \item
2537 % Some mathematical symbol commands obtained from the standard
2538 % \LaTeX\ set-up and the standard mathematical fonts require
2539 % some patching that is already included in this \texttt{TOPtesi}
2540 % bundle; but it is not excluded that with other fonts similar
2541 % patches might be requested. The \sigla{UNICODE} math fonts used
2542 % by \XeLaTeX\ and \LuaLaTeX\ do not require any patch. If you seek
2543 % conformance with level~2, this patch is not needed.
2544 %
2545 % \item
2546 % Use only \sigla{PNG} and \sigla{JPG} images with \sigla{RGB} color
2547 % profiles. But if a \sigla{PNG} image file contains some transparencies,
2548 % the document \sigla{PDF} cannot be validated as \sigla{PDF/A}-1b
2549 % compliant, but it can with \sigla{pdf/a-2b}.
2550 %
2551 % \item
2552 % If you include \sigla{PDF} images that contain some text, be sure
2553 % that the fonts for this text are completely embedded in
2554 % the included files. Should the \sigla{PDF} files come from external
2555 % drawing programs, be sure to configure that program so that
2556 % it embeds all the fonts used in each image. If you don't
2557 % succeed, open the \sigla{PDF} file with the free software
2558 % \texttt{inkscape} and save it back in \sigla{PDF} format; the
2559 % missing fonts will be replaced with their outlines and
2560 % this will not disturb the \sigla{PDF/A} conformity. Pay attention,
2561 % because Inkscape might save your file with some
2562 % specifications for transparency; but transparency specifications
2563 % destroy the \sigla{PDF/A-1b} compliance, not the \sigla{pdf/a-2b} one.
2564 % Should this inconvenience take place, instead of asking
2565 % \texttt{inkscape} to save in \sigla{PDF} format, ask to save in
2566 % \sigla{EPS} format; this format does not support transparencies,
2567 % therefore they get abolished from the very beginning. This is useful
2568 % also when \texttt{inkscape} is used to change the color
2569 % profile of an image. Once this program is used to convert an
2570 % image to \sigla{EPS} format without transparencies and/or with the
2571 % accepted \sigla{RGB} color profile, import the image as usual with
2572 % |\includegraphics|; all the suggested typesetting programs,
2573 % \prog{pdflatex} included, can import \sigla{EPS} files, therefore
2574 % these problems, thanks \texttt{inkscape} may be easily overridden.
2575 % Even better, once you got the corrected EPS file, you might distill
2576 % it to PDF, so as to compress it in a compatible way; EPS files are
2577 % generally human readable so they are very large in terms of memory size.
2578 %
2579 % \item
2580 % Verify your final \sigla{PDF} file with a suitable program and
2581 % do not give up doing the necessary corrections or
2582 % modifications while the verification program keeps saying
2583 % that this or that is not compliant with the \sigla{PDF/A}
2584 % specification. A suitable program is the Preflight module
2585 % of Adobe Acrobat Pro~XI (or later); this is the most
2586 % authoritative, but it is a commercial program; probably your
2587 % university has special facilities for this task. In any
2588 % case you can install the \prog{veraPDF} free and open software
2589 % from the Internet, and use this handy verification program
2590 % (since 2017 the program is stable).
2591 %
2592 %\end{enumerate}
2593 %
2594 % Warning: if you are using Adobe Reader X (or later), this
2595 % program will open a \sigla{PDF} file beginning with an information
2596 % header stating that the file claims to be \sigla{PDF/A} compliant;
2597 % maybe it's true, but do not trust this information too much,
2598 % at least don't believe that this information is a
2599 % “certification” of the \sigla{PDF/A} compliance. I have seen
2600 % files with this comforting information that did not pass
2601 % the Preflight test! Actually the Reader is correct in saying
2602 % that “\dots\ the program claims to be \sigla{PDF/A} compliant\dots”;
2603 % the Reader just notices that the metadata contain such a claim,
2604 % but this does not imply that the claim is true.
2605 %
2606 % Up to today the realisation of \sigla{PDF/A} conforming files sets
2607 % forth several problems that are of great concern for
2608 % large Institutions that have thousands of documents a year
2609 % to archive; it is not a question implied in the free nature
2610 % of the \prog{pdflatex}, \prog{xelatex}, and \prog{lualatex}
2611 % programs, that, on the opposite, according to my experience,
2612 % have a very high rate of success in producing \sigla{PDF/A}
2613 % compliant documents. If you stick to the default \TeX\ system
2614 % Type~1, 256-glyph fonts, or to the \sigla{UNICODE} encoded OpenType
2615 % or TrueType fonts and use this version of the TOPtesi bundle
2616 % you should be able to avoid most problems.
2617 %
2618 % \section{Customisation}\label{sec:LPPL}
2619 % Customisation of parts of this bundle is discouraged, but is not
2620 % forbidden, provided that it is done according to the \LaTeX\ Project
2621 % Public Licence (LPPL). The full text of this licence is contained at the
2622 % end of the Italian documentation file \texttt{toptesi-it.pdf},
2623 % besides being available from the \sigla{ctan} web site.
2624 %
2625 % The parts of this bundle already contain several customising
2626 % commands and environments; other parts are not directly
2627 % customisable; for example the geometry of the page; the various
2628 % standard title pages (where the \texttt{tipotesi=custom} option
2629 % already allows complete customisation of the title page); the
2630 % super sectioning of the final document by means of |\frontmatter|,
2631 % |\mainmatter|, and |\backmatter|; what appears in the table of
2632 % contents; and so on.
2633 %
2634 % Nevertheless, in spite of being discouraged, some user might
2635 % want to customise some details. There are several ways to do
2636 % such customisation that conform the LPPL.
2637 %
2638 % \textcolor{red}{The main restriction set by the LPPL is that
2639 % the bundle files may be modified, but their names must be changed,
2640 % although the original author and licence are maintained in their
2641 % initial comments, and that the file maintainer name is changed so
2642 % that any user of the modified version knows to whom address
2643 % him/herself in case of need; the original author is not responsible
2644 % of any modified file.}
2645 %
2646 % \paragraph{Direct modification}
2647 % In order to make a direct modification to any original file, first
2648 % duplicate the original file and change name to the duplicated file;
2649 % then modify this copy name and make the changes that are deemed
2650 % necessary, without forgetting to delete my name as the maintainer
2651 % while adding your name; it would be useful if some comments are
2652 % added so as to describe what has been modified, why and how.
2653 %
2654 % Remember to change accordingly the references to the modified
2655 % file(s) in the other bundle files; this implies that all the
2656 % bundle files get modified and that their names must be changed
2657 % accordingly while modifying the initial comment lines so as to
2658 % delete my name as the maintainer.
2659 %
2660 % \paragraph{Modification of single commands and/or environments}
2661 % Another way to perform some customisation that does not infringe
2662 % the LPPL licence is the following.
2663 %
2664 % In facts a simpler way to customise some commands and or
2665 % environments is to copy their code from the original bundle
2666 % files, and paste it into a personal \texttt{.sty} file to be
2667 % input with a |\usepackage| command inside the argument of
2668 % another |\AtBeginDocument| command; modify your personal file
2669 % the way you like, and test the result.
2670 %
2671 % If your modifications do not produce any difference in the
2672 % output PDF file, then you have to load your modified file after
2673 % the |\begin{document}| line. In this case you have to change
2674 % your file extension from \texttt{.sty} to \texttt{.tex}, and
2675 % you probably have to start your file with a |\makeatletter| and
2676 % finish it with a |\makeatother| commands, since many macros
2677 % used inside the original code are “protected” with an |@| sign
2678 % with its category code changed to “letter”. Needless to say that
2679 % in order to use this |.tex| file after the |begin{document}|
2680 % statement, the |\input| command must be used in place of the
2681 % |\usepackage| one.
2682 %
2683 % \paragraph{Command patching}
2684 % A third way to modify some commands and/or environments is to
2685 % patch their definitions by means of the patching commands provided
2686 % by the |etoolbox| package, that is already loaded by this bundle.
2687 % Such |etoolbox| commands allow to add or to append some code to
2688 % selected macros; other |etoolbox| commands allow to insert some code
2689 % in the middle of a replacement text of selected macros or to replace
2690 % some code in any position of its replacement text.
2691 %
2692 % The use of these patching commands requires some attention and
2693 % is not recommended for \LaTeX\ beginners; nevertheless it is the
2694 % best way to apply personal modifications to existing commands.
2695 % The details of this procedure must be examined in the |etoolbox|
2696 % documentation.
2697 %
2698 % \StopEventually{}
2699 %
2700 % \newpage
2701 %
2702 % \section{Documented code}
2703 % \subsection{The class code}
2704 %
2705 % Here begins the usual machinery for stating the required
2706 % \TeX\ format and for sharing some code between the driver
2707 % and the class part of the code, since they are supposed to
2708 % carry the same date and version number, besides their specific
2709 % description string.For these reasons such machinery has already been set at the very beginning of this \file{.dtx} file.
2710 % \iffalse
2711 %<*class>
2712 % \fi
2713 %
2714 % The class itself is very simple since it loads just the
2715 % \texttt{report} document class and some packages with a few
2716 % default options. All options specified to the \texttt{toptesi}
2717 % class are passed on to the \texttt{report} class; the
2718 % |a4paper| option is made the default, but the user can invoke
2719 % the class with any valid \LaTeX\ paper size. According to the
2720 % \LaTeX\ and |xkeyval| machinery of option passing, the |\ExecuteOptionX|
2721 % command assures that |a4paper| is the default size, but it
2722 % is not used if another paper size code is specified to the class.
2723 %
2724 % The same holds true for the other class options, except for
2725 % the encoding string because their option passing machinery does
2726 % not hold true for the \pack{inputenc} package; therefore this
2727 % package is not loaded any more as it was in previous versions
2728 % of the class\footnote{Thanks to Enrico Gregorio who pointed
2729 % out this feature.}.
2730 %
2731 % On the opposite, while typesetting with
2732 % |pdfLaTeX|, if another language is specified in the list of
2733 % \pack{toptesi} class options this language is appended to the
2734 % \pack{babel} package default options and, beware!, it would
2735 % become the default language; with XeLaTeX and LuaLaTeX a
2736 % language option is useless (and harmless) due to their way of
2737 % specifying languages; with these programs other languages must
2738 % be specified with their |\setotherlanguage| or |\setotherlanguages|
2739 % commands which do not change the preset main language.
2740 %
2741 % The |filecontents| package used to be loaded in the previous versions
2742 % of TOPtesi, in oder to create the |.xmpdata| file containing the
2743 % metadata necessary to produce PDF/A compliant files. Its
2744 % functionalities are now included in the \LaTeX kernel |filecontents|
2745 % environment; therefore it is no longer needed; in any case it is
2746 % easier to use an environment defined in TOPtesi for this specific
2747 % task; it relies on some low level native \TeX code contained
2748 % in package |fancyvfb|; here we load it: the new environment
2749 % |pdfxmetadata| is defined further on.
2750 % \begin{macrocode}
2751 \RequirePackage{fancyvrb}
2752 % \end{macrocode}
2753 % Remember: this new environment must be loaded between the
2754 % |\documentclass| and the |usepackage[a-1b]{pdfx}| statements.
2755 %
2756 % Another piece of code follows in order to abort the job if the
2757 % |toptesi| date, contained in it |\ProvidePacckage| argument is
2758 % older than the class date. Should this happen, the job is aborted
2759 % with a strong message on the console. In order to work properly
2760 % the |toptesi| package is loaded and its date is fetched by means
2761 % of the defined |\GetFileInfo| macro. This macro is almost identical
2762 % to the one that is available when this documented file is processed;
2763 % it simply differs in the sense that the |v.| prefix to the file
2764 % version number is taken as a separator; should be necessary to
2765 % compare also the version number, the |\fileversion| macro gets
2766 % defined properly without any prefix. The |\@parse@version| macro
2767 % is a \LaTeX\ kernel one; in spite of its name, it extracts
2768 % from the first macro token the data in a form suitable for comparison
2769 % with the second macro token, so that a numerical test can be performed
2770 % without the intervention of non digit symbols. The prominent class
2771 % error message is output only if the numerical value of the package
2772 % date is strictly lower than the class date. This version control was
2773 % necessary because apparently there are some vintage versions still
2774 % on the web, and some newbie \TeX{}ies fetch them instead of using
2775 % the most recent \TeX\ system complete and updated installation.
2776 % \begin{macrocode}
2777 \usepackage{trace}
2778 \usepackage{xkeyval}
2779 \DeclareOptionX{formato}[a4paper]{\PassOptionsToClass{#1}{report}}
2780 \DeclareOptionX*{\PassOptionsToClass{\CurrentOption}{report}}
2781 \ExecuteOptionsX{formato}
2782 \ProcessOptionsX*\relax
2783 \LoadClass{report}
2784
2785 \usepackage{iftex}
2786 \ifPDFTeX
2787 \usepackage[english,italian]{babel}
2788 \else
2789 \usepackage{fontspec}
2790 \defaultfontfeatures{Ligatures=TeX}
2791 \usepackage{polyglossia}
2792 \setmainlanguage{italian}
2793 \setotherlanguage{english}
2794 \renewcommand*{\iflanguage}[1]{%
2795 \ifnum\the\language=\csname l@#1\endcsname
2796 \expandafter\@firstoftwo\else
2797 \expandafter\@secondoftwo\fi}
2798 \fi
2799 \providecommand\GetFileInfo[1]{%
2800 \def\filename{#1}%
2801 \def\@tempb##1 v.##2 ##3\relax##4\relax{%
2802 \def\filedate{##1}%
2803 \def\fileversion{##2}%
2804 \def\fileinfo{##3}}%
2805 \edef\@tempa{\csname ver@#1\endcsname}%
2806 \expandafter\@tempb\@tempa\relax? ? \relax\relax}
2807
2808 \usepackage{toptesi}
2809 \GetFileInfo{toptesi.sty}\let\stydate\filedate
2810 \GetFileInfo{toptesi.cls}\let\classdate\filedate
2811
2812 \ifnum\expandafter\@parse@version\stydate//00\@nil<%
2813 \expandafter\@parse@version\classdate//00\@nil
2814 \ClassError{toptesi}{\MessageBreak
2815 ******************\MessageBreak
2816 This class requires a sty file not older than the class\MessageBreak
2817 This class has a date of \classdate\space while\MessageBreak
2818 the sty file you are using has a date of \stydate\MessageBreak
2819 \MessageBreak
2820 This job is therefore aborted\MessageBreak\@gobble
2821 ******************\MessageBreak
2822 \MessageBreak
2823 Update your TeX system installation and/or \MessageBreak
2824 avoid using vintage toptesi.sty files%
2825 }{%
2826 }
2827 \expandafter\stop
2828 \fi
2829 %
2830 % \end{macrocode}
2831 % \iffalse
2832 %</class>
2833 % \fi
2834 % \subsection{The \texttt{toptesi.sty} code}
2835 % The greatest part of the \texttt{toptesi} class code is
2836 % saved into a separate file partly for backward compatibility
2837 % reasons (before version 3.x \texttt{toptesi} was just an
2838 % extension to the \texttt{report} class) and partly because
2839 % it might be used as a stand alone package, but, take
2840 % notice, it might create some conflicts with other
2841 % classes internal code, although with the latest versions
2842 % of |toptesi| we did not notice any conflict with the |book|
2843 % class; it is certainly incompatible with the \texttt{article}
2844 % class.
2845 %
2846 % This package |toptesi.sty| must contain its own \TeX\ format
2847 % declaration in view that it might be used as an extension to
2848 % other classes
2849 %
2850 % \iffalse
2851 %<*topsty>
2852 % \fi
2853 %
2854 % We start by defining the debugging macros; these trace
2855 % commands and macros are the usual ones I used for debugging.
2856 % I know the \texttt{trace} package is supposed to be much better,
2857 % but sometimes I use these ones, especially when I want to
2858 % trace math snippets, where the tracing functionalities of
2859 % \pack{trace} are turned off.
2860 % \begin{macrocode}
2861 \def\TRON{\tracingcommands \tw@ \tracingmacros \tw@}
2862 \def\TROFF{\tracingcommands\z@ \tracingmacros \z@}
2863 \let\TROF\TROFF
2864
2865 % \end{macrocode}
2866 %
2867 % Now we define the specific package options: \texttt{classica} and
2868 % \texttt{trieste} are identical; the use of \texttt{trieste} is
2869 % deprecated, but this option is maintained for backward
2870 % compatibility.
2871 %
2872 % The option \opz{scudo} is used only to typeset doctoral
2873 % dissertations with the special look required by the “Scuola
2874 % di Dottorato” of Politecnico di Torino. The other options for
2875 % specific thesis types, \opz{triennale}, \opz{monografia},
2876 % \opz{magistrale}, \opz{dottorale}, \opz{secondaria}, are
2877 % described further on; options \opz{frontespizio} and
2878 % \opz{custom} avoid loading the default module |topfront| or any
2879 % of the previous listed modules; they are used to create title pages
2880 % different from the ones that are available with TOPtesi.
2881 %
2882 % The |corpo = value| option can receive “any” value; if this
2883 % value is not lower than 14\,pt , the |\if@xixpt| switch is
2884 % set to true; the value assigned to |corpo| specifies the normal
2885 % size; the TOPtesi bundle uses the |\changefontsizes| macro
2886 % provided by package |scrextend|, that is part of any \TeX\
2887 % system complete and up-to-date TeXLive or MiKTeX installation.
2888 %
2889 % Option \opz{chapterbib} allows to set a list of references at
2890 % the end of each chapter. The option is maintained for backward
2891 % compatibility, but we discourage its use, because of the amount
2892 % of manual work involved; it is much better to use the |biblatex|
2893 % functionalities and/or other packages created for this purpose.
2894 %
2895 % For other options some boolean variables are
2896 % defined and the option definitions set some of them to the value
2897 % “true”.
2898 % \begin{macrocode}
2899 \newif\ifevenboxes \evenboxesfalse
2900 \newif\if@utoretitolo \@utoretitolofalse
2901 \newif\if@ldstyle \@ldstylefalse
2902 \newif\if@xivpt \@xivptfalse
2903 \newif\iflibro \librofalse
2904 \newif\ifT@Pfrontespizio \T@Pfrontespiziofalse
2905 \newif\ifTOPfront \TOPfronttrue
2906 %
2907 \newif\ifScuDo \ScuDofalse
2908 \newif\ifmonografia\monografiafalse
2909 \newif\iftriennale\monografiafalse
2910 \newif\ifmagistrale\magistralefalse
2911 \newif\ifdottorato\dottoratofalse
2912 \newif\ifsecondaria\secondariafalse
2913 \newif\ifcustom\customfalse
2914 \newif\ifTOPnumerazioneromana\TOPnumerazioneromanafalse
2915 \newif\ifTOPnocenterfolio \TOPnocenterfoliofalse
2916 \newif\ifTOPnocenterhead \TOPnocenterheadfalse
2917 \newif\ifTOPfolioinhead \TOPfolioinheadfalse
2918 % \end{macrocode}
2919 %
2920 % A binding correction is established; its default value is
2921 % parametrised to the paper dimensions, even if this correction
2922 % should actually not depend on the paper size; the paper
2923 % flexibility at the spine margin should be independent from
2924 % its width; nevertheless large sizes allow for larger default
2925 % corrections. In any case the user can override this setting by
2926 % using the specific command |\setbindingcorrection|.
2927 % The recommendation to the user is to not exaggerate with this
2928 % correction. In particular the user is warned not to use this
2929 % option in order to move che text body grid towards the outer
2930 % edge, simply because s/he does not understand why two side
2931 % typesetting uses an inner margin smaller than the outer one.
2932 % In any case see further on a deeper explanation about margins
2933 % and binding correction.
2934 %
2935 % The options concerning the folio position and the header text
2936 % position have been requested after version 6.3.06. Beware! While
2937 % the folio position close to the outer edge is acceptable, it turns
2938 % to be quite bad looking if also the header text is moved to the
2939 % fore edge; therefore avoid this position pair.
2940 %
2941 % The options |usefrontespizio| and |noTOPfront| are set by the
2942 % specific “function” executed by the |tipotesi=|\meta{value} options.
2943 % \begin{macrocode}
2944 \newlength\T@Pbinding
2945 \def\setbindingcorrection#1{\T@Pbinding=#1}
2946 \newif\if@binding \@bindingfalse
2947 \newif\ifchapterbibliography \chapterbibliographyfalse
2948 \newif\ifclassica \classicafalse
2949
2950 \IfPackageLoadedF{xkeyval}{\RequirePackage{xkeyval}}
2951 \IfPackageLoadedF{scrextend}{\RequirePackage{scrextend}}
2952 \IfPackageLoadedF{iftex}{\RequirePackage{iftex}}
2953 \IfPackageLoadedF{xspace}{\RequirePackage{xspace}}
2954 \IfPackageLoadedF{xparse}{\RequirePackage{xparse}}
2955
2956 \DeclareOptionX{cucitura}[7mm]{\setlength\T@Pbinding{#1}\@bindingtrue}
2957 \DeclareOptionX{corpo}[10pt]{\unless\ifdim#1<\@xivpt\p@\@xivpttrue\fi
2958 \changefontsizes{#1}}
2959 \DeclareOptionX{chapterbib}[true]{\chapterbibliographtrue}
2960 \DeclareOptionX{evenboxes}[true]{\evenboxestrue}
2961 \DeclareOptionX{libro}[true]{\librotrue}
2962 \DeclareOptionX{stile}[standard]{\setkeys{toptesi}{stile=#1}}
2963 \define@choicekey{toptesi}{stile}[\val\nr]{standard,classica,trieste}{%
2964 \ifcase\nr
2965 \typeout{valore=\number\nr}\classicafalse
2966 \or
2967 \typeout{valore=\number\nr}\classicatrue
2968 \or
2969 \typeout{valore=\number\nr}\classicatrue
2970 \else
2971 \typeout{valore=\number\nr}\classicafalse
2972 \fi}
2973 \DeclareOptionX{autoretitolo}[true]{\ifclassica\@utoretitolotrue\fi}
2974 \DeclareOptionX{oldstyle}[true]{\ifclassica\@ldstyletrue\fi}
2975 \DeclareOptionX{nocenterfolio}[true]%
2976 {\unless\ifclassica\TOPnocenterfoliotrue\fi}
2977 \DeclareOptionX{nocenterhead}[true]%
2978 {\unless\ifclassica\TOPnocenterheadtrue\fi}
2979 \DeclareOptionX{folioinhead}[true]{\unless\ifclassica\TOPfolioinheadtrue\fi}
2980 \DeclareOptionX{pdfa}{\PackageWarning{toptesi}{%
2981 ***********************************************\MessageBreak%
2982 Option pdfa ignored.\MessageBreak%
2983 Read documentation toptesi-it-*.pdf,\MessageBreak%
2984 because package pdfx has changed\MessageBreak%
2985 ***********************************************\MessageBreak%
2986 }}
2987
2988 \DeclareOptionX{numerazioneromana}[true]{\TOPnumerazioneromanatrue}
2989
2990 \newcommand\NoValidTipo[1]{%
2991 \PackageError{toptesi}{Option value `#1' not defined\MessageBreak
2992 }{Type `X' to exit and check your input}}
2993
2994
2995 \DeclareOptionX{tipotesi}[topfront]{%
2996 \ifstrequal{#1}{frontespizio}{\TOPfrontfalse\T@Pfrontespiziotrue
2997 \AtEndOfPackage{\RequirePackage{frontespizio}}%
2998 }{%
2999 \ifstrequal{#1}{topfront}{\TOPfronttrue\T@Pfrontespiziofalse
3000 \AtEndOfPackage{\RequirePackage{topfront}}%
3001 }{%
3002 \TOPfrontfalse\T@Pfrontespiziofalse
3003 \ifstrequal{#1}{custom}{\relax}{%
3004 \ifstrequal{#1}{triennale}{%
3005 \def\TPT@tipo{toptesi-monografia}% opz: monografia
3006 }{\ifstrequal{#1}{secondaria}{% opz: secondaria
3007 \edef\TPT@tipo{toptesi-sss}%
3008 }{%
3009 \edef\TPT@tipo{toptesi-#1}% opz: triennale,
3010 }% % magistrale, dottorale
3011 }%
3012 \AtEndOfPackage{%
3013 \IfFileExists{\[email protected]}%
3014 {\RequirePackage{\TPT@tipo}}{\NoValidTipo{#1}}%
3015 }%
3016 }% opz: custom
3017 }% opz: topfront
3018 }% opz: frontespizio
3019 }
3020 \ProcessOptionsX*
3021
3022 % \end{macrocode}
3023 % The \texttt{graphicx} package is loaded by default; it is
3024 % required to insert the university logo(s); if the user
3025 % forgets that this package has already been loaded nothing
3026 % dramatic happens, because the |\usepackage| and |\RequirePackage|
3027 % macros perform the necessary tests in order to avoid
3028 % reloading the same packages again and again.
3029 % On the occasion of loading package|etoolbox|, we define
3030 % |\ifempty| that controls if its argument is a void or empty
3031 % string; it is not sufficient to use |\ifdefempty| or |\ifdefvoid|,
3032 % because the argument generally is not a macro; neither it is
3033 % possible to check the string by means of |\ifcsempty| or
3034 % |\ifcsvoid|, because sometimes it is a macro and in any case
3035 % there might be situations when the argument string happens
3036 % to equal an existing control sequence name; therefore first
3037 % we expand the possible argument into an internal macro, then we test
3038 % such macro for emptiness.
3039 %
3040 % \begin{macrocode}
3041 \RequirePackage{graphicx}
3042 \RequirePackage{etoolbox}
3043 \newcommand*\ifempty[1]{\edef\@tempA{#1}%
3044 \ifx\@tempA\@empty\expandafter\@firstoftwo
3045 \else\expandafter\@secondoftwo\fi}
3046 % \end{macrocode}
3047 %
3048 % The |\textheight| is parametrised to the paper height and
3049 % adjusted so as to contain an integer number of normal text
3050 % lines. A new dimension is defined to hold the actual value
3051 % of the inner/spine margin.
3052 %
3053 % \begin{macrocode}
3054 \newlength\interno
3055 \normalsize% necessary to have the correct value for \baselineskip
3056 \textheight=\paperwidth
3057 \setlength{\textheight}{%
3058 \dimexpr\textheight*\baselineskip/\baselineskip+\topskip}
3059 % \end{macrocode}
3060 % The inner margin is parametrised to the paper width, but
3061 % a small correction is made if the extra size of 14pt is
3062 % chosen. Also |\footskip| is parametrised to the paper height
3063 % in a slightly different way when the large normal font size
3064 % is not smaller than 14\,pt; the |\if@xivpt| switch is set to true
3065 % when the value is assigned to the key |corpo|.
3066 % \begin{macrocode}
3067 \iflibro
3068 \unless\if@xivpt
3069 \textwidth=\dimexpr0.70711\paperwidth\relax
3070 \setlength\interno{\dimexpr\paperwidth/8}
3071 \footskip=1.5\baselineskip
3072 \else
3073 \textwidth=\dimexpr0.79549875\paperwidth\relax
3074 \setlength\interno{\dimexpr\paperwidth/9}
3075 \footskip=2\baselineskip
3076 \fi
3077 \else
3078 \unless\if@xivpt
3079 \textwidth=\dimexpr0.70711\paperwidth\relax
3080 \setlength\interno{\dimexpr\paperwidth/6}
3081 \footskip=1.5\baselineskip
3082 \else
3083 \textwidth=\dimexpr0.79549875\paperwidth\relax
3084 \setlength\interno{\dimexpr\paperwidth/7}
3085 \footskip=2\baselineskip
3086 \fi
3087 \fi
3088
3089 % \end{macrocode}
3090 % The convenience of holding the spine margin within a
3091 % dimensional register becomes really useful now in order
3092 % to define the other text-body-grid dimensions.
3093 % Without binding correction the inner and outer margin
3094 % are chosen equal, but the grid is moved outwards if the
3095 % binding correction option is specified. With the |libro|
3096 % option in force, the outer and the lower margin are larger than
3097 % the corresponding inner and top margins. Without such
3098 % option, the margins are initially set equal, unless the
3099 % binding correction is specified.
3100 % \begin{macrocode}
3101 \iflibro
3102 \interno=\dimexpr\paperwidth-\textwidth\relax
3103 \oddsidemargin=0.414214\interno\relax
3104 \evensidemargin=\dimexpr\paperwidth-\textwidth-\oddsidemargin\relax
3105 \else
3106 \oddsidemargin=\dimexpr(\paperwidth-\textwidth)/2\relax
3107 \evensidemargin=\oddsidemargin
3108 \fi
3109 \marginparwidth=\dimexpr\evensidemargin-2.5\marginparsep
3110 \oddsidemargin=\dimexpr\oddsidemargin-1in\relax
3111 \evensidemargin=\dimexpr\evensidemargin-1in\relax
3112 \AtBeginDocument{%
3113 \if@binding
3114 \PackageInfo{TOPtesi}{Margin width recalculation}
3115 \PackageInfo{TOPtesi}{Before:\MessageBreak
3116 oddsidemargin\space\space \the\oddsidemargin\MessageBreak
3117 evensidemargin\space \the\evensidemargin}
3118 \advance\oddsidemargin \T@Pbinding
3119 \advance\evensidemargin -\T@Pbinding
3120 \advance\marginparwidth -\T@Pbinding
3121 \PackageInfo{TOPtesi}{After:\MessageBreak
3122 oddsidemargin\space\space \the\oddsidemargin\MessageBreak
3123 evensidemargin\space \the\evensidemargin}
3124 \fi}
3125
3126 % \end{macrocode}
3127 %
3128 % We now establish the page style. We start by setting to
3129 % “empty” the tokens that keep the left and the right
3130 % marks; we define a box so as to set the headers inside
3131 % this box.
3132 %
3133 % By defining |\lapagina| to be equivalent to |\thepage|
3134 % we can later on redefine |\lapagina| the way we like; we
3135 % actually do so with option \texttt{classica}.
3136 % Since there are options for setting the head information in a
3137 % centred or lateral (external) position and similarly for the folios,
3138 % plus the possibility to have the folio in the head or in the foot,
3139 % we need to redefine the |plain| and |headings| page styles according
3140 % to the options chosen by the user through the available keys.
3141 % \begin{macrocode}
3142 \def\lapagina{\thepage}
3143 \mark{{}{}}
3144 \newbox\@intesta
3145 %
3146 \def\ps@plain{\let\@mkboth\@gobbletwo
3147 \let\@oddhead\@empty\let\@evenhead\@empty%
3148 \if@twoside
3149 \ifTOPnocenterfolio
3150 \def\@oddfoot{\makebox[\textwidth][r]{\scshape\lapagina}}
3151 \def\@evenfoot{\makebox[\textwidth][l]{\scshape\lapagina}}
3152 \else
3153 \def\@oddfoot{\makebox[\textwidth][c]{\scshape\lapagina}}%
3154 \def\@evenfoot{\makebox[\textwidth][c]{\scshape\lapagina}}%
3155 \fi
3156 \else
3157 \ifTOPnocenterfolio
3158 \def\@oddfoot{\makebox[\textwidth][r]{\scshape\lapagina}}%
3159 \let\@evenfoot\@oddfoot
3160 \else
3161 \def\@oddfoot{\makebox[\textwidth][c]{\scshape\lapagina}}%
3162 \let\@evenfoot\@oddfoot
3163 \fi
3164 \fi
3165 }
3166
3167 % \end{macrocode}
3168 % Other page styles are defined in a different way according
3169 % to the choice of one side or two side printing. In any case
3170 % the header is set without the uppercasing that is done in
3171 % all the default document classes, and it is underlined at
3172 % a fixed distance from the base line. If the chapter or section
3173 % heading exceed the |\textwidth| a warning is issued so as
3174 % to invite the user to exploit the sectioning commands
3175 % optional short argument.
3176 % \begin{macrocode}
3177 \if@twoside % two side
3178 \def\ps@headings{\let\@mkboth\markboth% autoretitolo
3179 \let\@oddhead\@empty\let\@evenhead\@empty
3180 \unless\ifTOPfolioinhead % folio in head
3181 \ifTOPnocenterfolio
3182 \def\@oddfoot{\makebox[\textwidth][r]{\scshape\lapagina}}
3183 \def\@evenfoot{\makebox[\textwidth][l]{\scshape\lapagina}}
3184 \else
3185 \def\@oddfoot{\makebox[\textwidth][c]{\scshape\lapagina}}
3186 \def\@evenfoot{\makebox[\textwidth][c]{\scshape\lapagina}}
3187 \fi
3188 \def\@oddhead{\setbox\@intesta\hbox{\footnotesize\slshape
3189 \rightmark}%
3190 \ifdim\wd\@intesta>\textwidth \headWarn{\chapter}\fi%
3191 \ifTOPnocenterhead
3192 \underline{\makebox[\textwidth][r]{\footnotesize\slshape
3193 \strut\rightmark}}%
3194 \else
3195 \underline{\makebox[\textwidth][c]{\footnotesize\slshape
3196 \strut\rightmark}}%
3197 \fi}%
3198 \def\@evenhead{\setbox\@intesta\hbox{\footnotesize\slshape
3199 \rightmark}%
3200 \ifdim\wd\@intesta>\textwidth \headWarn{\section}\fi%
3201 \ifTOPnocenterhead
3202 \underline{\makebox[\textwidth][r]{\footnotesize\slshape
3203 \strut\leftmark}}%
3204 \else
3205 \underline{\makebox[\textwidth][c]{\footnotesize\slshape
3206 \strut\leftmark}}%
3207 \fi}%
3208 \else % folio in foot
3209 \let\@oddfoot\@empty\let\@evenfoot\@empty
3210 \def\@oddhead{\setbox\@intesta\hbox{\footnotesize\slshape
3211 \rightmark}%
3212 \ifdim\wd\@intesta>\textwidth \headWarn{\section}\fi%
3213 \ifTOPnocenterhead
3214 \underline{\makebox[\textwidth][r]{\footnotesize\slshape
3215 \strut\rightmark}}\rlap{\quad\scshape\lapagina}%
3216 \else
3217 \underline{\makebox[\textwidth][c]{\footnotesize\slshape
3218 \strut\rightmark}}\rlap{\quad\scshape\lapagina}%
3219 \fi}
3220 \def\@evenhead{\setbox\@intesta\hbox{\footnotesize\slshape
3221 \rightmark}%
3222 \ifdim\wd\@intesta>\textwidth \headWarn{\chapter}\fi%
3223 \ifTOPnocenterhead
3224 \underline{\llap{\scshape\lapagina\quad}%
3225 \makebox[\textwidth][l]{\footnotesize\slshape\strut\rightmark}}%
3226 \else
3227 \underline{\llap{\scshape\lapagina\quad}%
3228 \makebox[\textwidth][c]{\footnotesize\slshape\strut\rightmark}}%
3229 \fi}
3230 \fi
3231 \def\chaptermark##1{\markboth{\thechapter\ -- ##1}{\thechapter\ -- ##1}}
3232 \def\sectionmark##1{\markright{\ifnum\c@secnumdepth>\z@
3233 \thesection\ -- \fi ##1}}%
3234 }
3235 \else% oneside
3236 \def\ps@headings{%
3237 \let\@mkboth\markboth\let\@oddhead\@empty\let\@evenhead\@empty
3238 \let\@oddfoot\@empty\let\@evenfoot\@empty
3239 \def\@evenfoot{}\def\@evenhead{}%
3240 \unless\ifTOPfolioinhead % folio in head
3241 \ifTOPnocenterfolio
3242 \def\@oddfoot{\makebox[\textwidth][r]{\scshape\lapagina}}
3243 \else
3244 \def\@oddfoot{\makebox[\textwidth][c]{\scshape\lapagina}}
3245 \fi
3246 \def\@oddhead{%
3247 \setbox\@intesta\hbox{\footnotesize\slshape
3248 \rightmark}%
3249 \ifdim\wd\@intesta>\textwidth \headWarn{\chapter}\fi%
3250 \ifTOPnocenterhead
3251 \underline{\makebox[\textwidth][r]{\footnotesize\slshape
3252 \strut\rightmark}}%
3253 \else
3254 \underline{\makebox[\textwidth][c]{\footnotesize\slshape
3255 \strut\rightmark}}%
3256 \fi
3257 }%
3258 \else % folio in foot
3259 \let\@oddfoot\@empty\let\@evenfoot\@empty
3260 \def\@oddhead{\setbox\@intesta\hbox{\footnotesize\slshape
3261 \rightmark}%
3262 \ifdim\wd\@intesta>\textwidth \headWarn{\chapter}\fi%
3263 \ifTOPnocenterhead
3264 \underline{\makebox[\textwidth][r]{\footnotesize\slshape
3265 \strut\rightmark}}\makebox[\z@][l]{\enspace\scshape\lapagina}%
3266 \else
3267 \underline{\makebox[\textwidth][c]{\footnotesize\slshape
3268 \strut\rightmark}}\makebox[\z@][l]{\enspace\scshape\lapagina}%
3269 \fi}
3270 \fi
3271 \def\chaptermark##1{\markright{\thechapter\ -- ##1}}%
3272 }
3273 \fi
3274
3275 \def\headWarn#1{\PackageWarning{toptesi}{%
3276 *******************************************\MessageBreak
3277 THE HEADING IS TOO LONG\MessageBreak
3278 Use the optional argument of command \string#1\MessageBreak
3279 See the LaTeX Handbook (1994) on section C.4.1\MessageBreak
3280 *******************************************\MessageBreak}}
3281 % \end{macrocode}
3282 % It is also necessary to redefine the format of the unnumbered
3283 % chapter entries in the table of contents so as to have page
3284 % numbers in small caps.
3285 % \begin{macrocode}
3286 \renewcommand\l@chapter[2]{%
3287 \ifnum \c@tocdepth >\m@ne
3288 \addpenalty{-\@highpenalty}%
3289 \vskip 1.0em \@plus\p@
3290 \setlength\@tempdima{1.5em}%
3291 \begingroup
3292 \parindent \z@ \rightskip \@pnumwidth
3293 \parfillskip -\@pnumwidth
3294 \leavevmode \bfseries
3295 \advance\leftskip\@tempdima
3296 \hskip -\leftskip
3297 #1\nobreak\hfil \nobreak
3298 \hb@xt@\@pnumwidth{\hss\ifPDFTeX\normalfont\fi\scshape{#2}}\par
3299 \penalty\@highpenalty
3300 \endgroup
3301 \fi}
3302
3303 % \end{macrocode}
3304 % The various tables of contents, or figures, or tables
3305 % require some boolean variables to be defined; in facts,
3306 % although the \sigla{ISO} regulations require that every technical
3307 % report contains the list of figures and/or tables,
3308 % in Italy theses rarely contain these lists; the question is: “is a
3309 % thesis a technical report?”. In Italy, in most cases, the answer
3310 % is “no”.
3311 %
3312 % We require also some other boolean variables to handle the
3313 % difference between front matter and main matter; these
3314 % differences are already defined in the \texttt{book}
3315 % document class, but not in the \texttt{report} one.
3316 % \begin{macrocode}
3317 \newif\iffigurespage
3318 \newif\iftablespage
3319 \newif\ifnumeriromani
3320 \newif\if@mainmatter
3321 \newif\iffrontmatter
3322 % \end{macrocode}
3323 % The |\frontmatter| and |\mainmatter| commands are defined
3324 % and at the beginning of the document the default situation
3325 % of front matter is established. For the |\backmatter|
3326 % command it suffices to turn out sectional numbering, and
3327 % to allow opening chapters also on even numbered pages.
3328 % \begin{macrocode}
3329 \def\frontmatter{\clearpage\ps@plain\@mainmatterfalse
3330 \ifTOPnumerazioneromana\numeriromanitrue\fi
3331 \frontmattertrue\@openrightfalse\c@secnumdepth=-2\relax
3332 }
3333
3334 \def\mainmatter{\@mainmattertrue
3335 \if@twoside\@openrighttrue\fi
3336 \ifTOPnumerazioneromana\numeriromanifalse\fi
3337 \frontmatterfalse
3338 \c@secnumdepth=2
3339 \clearpage\ps@headings
3340 \ifTOPnumerazioneromana\pagenumbering{arabic}\fi
3341 }
3342 \newcommand\backmatter{\cleardoublepage[empty]%
3343 \@mainmatterfalse
3344 \setcounter{secnumdepth}{-1}\if@twoside\@openrightfalse\fi}
3345
3346 \AtBeginDocument{%
3347 \ifTOPnumerazioneromana\pagenumbering{roman}\fi\frontmatter
3348 }
3349 % \end{macrocode}
3350 %
3351 % The main matter is automatically established with the
3352 % first |\chapter| command issued by the user; this means
3353 % that every command that starts a section at the
3354 % “chapter” level within the front matter must be
3355 % executed without an explicit call to |\chapter|. This
3356 % refers especially to the |\sommario|/|\summary| and
3357 % |\ringraziamenti|/|\acknowledgements| sections. On the
3358 % contrary even an unnumbered chapter (for example a preface)
3359 % turns on the main matter typesetting style.
3360 %
3361 % By default we set to false the boolean variables that
3362 % control the typesetting of the list of figures and the list
3363 % of tables.
3364 % \begin{macrocode}
3365 \figurespagefalse
3366 \tablespagefalse
3367
3368 % \end{macrocode}
3369 %
3370 % Before going further on, we redefine the |\cleardoublepage|
3371 % command so that it uses by default the plain page style
3372 % for the blank page to be possibly inserted if chapters
3373 % should start on an odd page: but with the |\blankpagestyle|
3374 % command can be set to any other style, for example the
3375 % |empty| page style.
3376 % \begin{macrocode}
3377 \let\ps@blank\ps@plain
3378 \newcommand*\blankpagestyle[1]{%
3379 \expandafter\let\expandafter\ps@blank\csname ps@#1\endcsname}
3380 \renewcommand\cleardoublepage[1][blank]{\clearpage
3381 \unless\ifodd\value{page}
3382 \if@twoside
3383 \if@openright
3384 \null\thispagestyle{#1}\clearpage
3385 \fi\fi\fi}
3386
3387 % \end{macrocode}
3388 %
3389 % We have to define the front matter sectioning names |\sommario|
3390 % (alias |\summary|) and |\ringraziamenti| (alias
3391 % |\acknowledgements|) so as to remain in the front matter.
3392 % \begin{macrocode}
3393 \def\sommario{%
3394 \iffrontmatter\else\frontmattertrue\fi
3395 \chapter*{\summaryname}}
3396 \let\summary\sommario
3397
3398 \def\ringraziamenti{%
3399 \iffrontmatter\else\frontmattertrue\fi
3400 \chapter*{\acknowledgename}}
3401 \let\acknowledgements\ringraziamenti
3402
3403 % \end{macrocode}
3404 % The strings |\summaryname| and |\acknowledgename| are not
3405 % defined for every language option to \texttt{babel}. Default
3406 % definitions are given below, and the user must define new
3407 % names for localising the package in a language different
3408 % from Italian and English.
3409 %
3410 % When and if a PDF/A compliant file has to be produced, it is
3411 % necessary to load the \pack{pdfx} package in the document to
3412 % be typeset and to create a special metadata file. The Italian
3413 % documentation |toptesi-it| explains how to do these actions,
3414 % in particular how to generate the necessary metadata and how
3415 % to prepare the |\jobname.xmpdata| file; it was suggested
3416 % to use the |filecontents| environment as redefined by package
3417 % \pack{filecontents}. But the situation has become a little
3418 % clumsy by the end of 2019 because the functionalities of the
3419 % package have been introduced into the \LaTeX kernel. But the
3420 % new upgraded kernel definition of the |filecontents|
3421 % environment as redefined by the previous version of
3422 % \pack{filecontents} becomes available only trough suitable
3423 % options. This makes previous versions of theses typeset with
3424 % the previous versions behave as if the \pack{filecontents}
3425 % package was not loaded. In other words what was made in the
3426 % examples accompanying this class and package does not work
3427 % anymore as it used to do, when they are typeset with an
3428 % updated version of the \TeX system; with the 2020 \TeXLive
3429 % version, they do not perform as they used to do, since they do
3430 % not update the metadata without deleting the previous file
3431 % that contained the previous version. You get the previous
3432 % functionality if you edit the files and add the suitable
3433 % options: \opz{noheader} and \opz{overwrite} to the opening
3434 % environment statement.
3435 % For new files we suggest to use a new environment in order to
3436 % create the proper metadata file, with the proper name and
3437 % contents. This new environment can be used in the thesis
3438 % preamble anywhere before using the \pack{pdfx} package.
3439 %
3440 % The new environment has a very descriptive name:
3441 % \env{pdfxmetadata};
3442 % it does not require asterisks or options; its contents are the
3443 % metadata. Its use is a such:
3444 %\begin{Sintassi}
3445 %\cs{documentclass}\oarg{options}\Marg{toptesi}
3446 %\meta{special packages}
3447 %\Bambiente{pdfxmetatada}
3448 %\meta{metada}
3449 %\Eambiente{pdfxmetadata}
3450 %...
3451 %\cs{usepackage}\Oarg[a-1b]\Marg{pdfx}
3452 %\meta{other packages}
3453 %\meta{settings and definitions}
3454 %\Bambiente{document}
3455 %\end{Sintassi}
3456 % Here is the very simple code thanks to the |VerbatimOut|
3457 % environment defined by the |fancyvrb| package, invoked
3458 % without the \cs{begin} and \cs{end} commands that may not perform
3459 % correctly within other environments.
3460 % \begin{macrocode}
3461 \newenvironment{pdfxmetadata}{%
3462 \VerbatimOut{\jobname.xmpdata}}{\endVerbatimOut}
3463 % \end{macrocode}
3464 %
3465 % We have to modify the |\chapter| and |\part| commands so
3466 % that as the user first uses one of these commands the
3467 % typesetting style is switched to that of the main matter.
3468 % But by exploiting certain facilities of the |xparse| package,
3469 % some delicate tests could be developed by |xparse| itself;
3470 % therefore the whole commands were redefined so that the new
3471 % syntax is the following:
3472 %\begin{Sintassi}
3473 %\cs{chapter}\meta{$\star$}\oarg{toc entry}\oarg{headings entry}\marg{title}\oarg{pagestyle}
3474 %\end{Sintassi}
3475 % The \meta{$\star$} is optional, and simply implies that no toc
3476 % entry will be generated and the chapter title will not be
3477 % numbered. In this way the previous \LaTeX\ kernel macros
3478 % |\chapter| and |\chapter*| maintain their usual behaviour:
3479 %\begin{Sintassi}
3480 %\cs{chapter}\oarg{toc entry}\marg{title}
3481 %\cs{chapter*}\marg{title}
3482 %\end{Sintassi}
3483 % But the various optional arguments play different roles and
3484 % implement new functionalities. The star itself now is a
3485 % special argument, numbered |#1|, therefore the total number of
3486 % arguments is five. Their meaning is the following.
3487 %\begin{description}
3488 %
3489 %\item[\meta{$\star$}]
3490 % Controls the chapter numbering and the
3491 % toc entry; its absence implies numbering and toc entry;
3492 % its presence implies no numbering and no toc entry;
3493 % nevertheless is does not cancels the possibility of having
3494 % an header (if the page style accepts left and right marks);
3495 % for example, a command such as this one\\[1ex]
3496 %\cs{chapter*}\Oarg{Short entry}\Marg{Long title}\\[1ex]
3497 % does not number the chapter with the |Long title|, but gets
3498 % the string |Short entry|; lacking the optional argument both
3499 % headers (see below) will contain the string |Long title|.
3500 % If you want an empty header, you have to specify an empty
3501 % optional argument; or before using the command, you specify
3502 % an empty or a plain page style.
3503 %\item[\meta{toc entry}]
3504 % is the entry for the table of contents;
3505 % its default value is \meta{title}, but since more often than
3506 % not the actual \meta{title} is a long string, it is better
3507 % to use such optional argument: of course, if the optional
3508 % star is used, its \meta{toc entry} is passed on as a default
3509 % value for the \meta{headings entry}.
3510 %\item[\meta{headings entry}]
3511 % contains the string to be inserted
3512 % in both left and right headers, if the page style uses such
3513 % pieces of information; this is a deliberate choice in order
3514 % to have both headers correctly indicating the chapter title
3515 % even if the “chapter” contains no sections, for example
3516 % indices, lists of figures and/or tables, forewords and
3517 % similar thesis items. Of course if sections are used, their
3518 % entries replace that chapter entry in the right header. This
3519 % choice of defining both headings is useful also for those
3520 % numbered chapters that have a longish text preceding the
3521 % first section.
3522 %\item[\meta{title}]
3523 % with no surprise is the chapter title that
3524 % is printed in its opening page. It defines also the default
3525 % \meta{toc entry} and therefore the \meta{headings entry} if
3526 % these optional arguments are not specified.
3527 %\item[\meta{pagestyle}]
3528 % solves a problem that arises more often than not: by default
3529 % the chapter opening page is typeset with the |plain| page
3530 % style; sometimes a different style is desired, for example
3531 % the |empty| one. The use of this optional argument with
3532 % |empty| allows to have an opening page without both a header
3533 % and a printed folio. Actually the user can specify any page
3534 % style, provided it satisfies the typographical best practice.
3535 %
3536 %\end{description}
3537 %
3538 % Actually the commands to typeset the Summary and the
3539 % Acknowledgements chapters, as defined above, are regularly
3540 % typeset in the front matter style, opening on any page
3541 % (even or odd) and possibly with folios numbered with small
3542 % caps roman numerals. The |\chapter*| does not switch from
3543 % front to main matter; while the unstarred one does.
3544 % Moreover |\chapter*|, besides avoiding numbering the specific
3545 % chapter, inhibits its entry in the |toc| file.
3546 % In previous versions of this bundle the |\chapter*| command
3547 % would set the |secnumdepth| counter to $-3$ in a global
3548 % manner. This did not produce any effects while in front or
3549 % back matters, except avoiding the chapter entry in the |toc|
3550 % file, but it inhibited chapter numbering in all following
3551 % chapters while in main matter.
3552 % This had no consequences if a final main matter unnumbered
3553 % chapter, such as a |Conclusions| one, or a postface had to be
3554 % typeset; but if numbered appendices had to conclude the main
3555 % matter, these could not be numbered\footnote{Thanks to Damiano
3556 % Del Sarto who spotted this bug.}. To avoid this “feature”, the
3557 % user had to mask the |\chapter*| command and its argument(s)
3558 % within a group, like this:
3559 %\begin{Sintassi}
3560 %\Marg{\cs{chapter}*\oarg{header entry}\marg{chapter title}}
3561 %\end{Sintassi}
3562 % With the new definition there is no need to employ such
3563 % (actually simple) trick, because the |secnumdepth| counter
3564 % value is saved, and this previous value is restored after the
3565 % |\chapter| command is fully completed.
3566 % \begin{macrocode}
3567
3568 \newcount\TOPsecnumdepth
3569 \newif\iftoc
3570
3571 \RenewDocumentCommand{\chapter}{s O{#4} O{#2} m O{plain}}{%
3572 \if@openright\cleardoublepage
3573 \else\clearpage\fi
3574 \thispagestyle{#5}%
3575 \global\@topnum\z@
3576 \@afterindentfalse
3577 \IfBooleanTF{#1}{%
3578 \TOPsecnumdepth=\c@secnumdepth
3579 \c@secnumdepth=-3\relax
3580 \tocfalse
3581 }{%
3582 \iffrontmatter\mainmatter\fi
3583 \toctrue
3584 }%
3585 \ifnum \c@secnumdepth >\m@ne
3586 \if@mainmatter % where \if@mainmatter is defined
3587 % (e.g. book.cls, toptesi.cls)
3588 \refstepcounter{chapter}%
3589 \typeout{\@chapapp\space\thechapter.}%
3590 \iftoc
3591 \addcontentsline{toc}{chapter}{%
3592 \protect\numberline{\thechapter}#2}%
3593 \else %
3594 \addcontentsline{toc}{chapter}{#2}%
3595 \fi
3596 \else % When \mainmatter is not defined (e.g.report.cls)
3597 \refstepcounter{chapter}%
3598 \typeout{\@chapapp\space\thechapter.}%
3599 \iftoc
3600 \addcontentsline{toc}{chapter}{%
3601 \protect\numberline{\thechapter}#2}%
3602 \else %
3603 \addcontentsline{toc}{chapter}{#2}%
3604 \fi
3605 \fi
3606 \fi
3607 %
3608 \markboth{#3}{#3}% No \MakeUppercase
3609 \iftoc
3610 \addtocontents{lof}%
3611 {\protect\addvspace{10\p@}}%
3612 \addtocontents{lot}%
3613 {\protect\addvspace{10\p@}}%
3614 \fi
3615 %
3616 \if@twocolumn
3617 \@topnewpage[\@makechapterhead{#4}]%
3618 \else
3619 \@makechapterhead{#4}%
3620 \@afterheading
3621 \fi
3622 \IfBooleanTF{#1}{\c@secnumdepth=\TOPsecnumdepth}{}%
3623 }
3624
3625 % \end{macrocode}
3626 % It would be possible to redefine in a similar manner also
3627 % the |\part| command, but originally it was deemed unnecessary,
3628 % since theses are seldom divided into parts; now with the
3629 % options on the folio position it is necessary to redefine
3630 % also the |part| command.
3631 % \begin{macrocode}
3632 \RenewDocumentCommand\part{s O{#3} m}{\iffrontmatter\mainmatter\fi
3633 \if@openright \cleardoublepage \else \clearpage \fi
3634 \thispagestyle{plain}\if@twocolumn \onecolumn \@tempswatrue \else \@tempswafalse \fi \null \vfil \IfBooleanTF{#1}{\@spart{#3}}{\@part[#2]{#3}}}
3635 \def\@part[#1]#2{\iffrontmatter\mainmatter\fi
3636 \ifnum \c@secnumdepth >-2\relax
3637 \refstepcounter{part}%
3638 \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
3639 \else
3640 \addcontentsline{toc}{part}{#1}%
3641 \fi
3642 \markboth{}{}%
3643 {\centering
3644 \interlinepenalty \@M
3645 \normalfont
3646 \ifnum \c@secnumdepth >-2\relax
3647 \huge\bfseries \partname\nobreakspace\thepart
3648 \par
3649 \vskip 20\p@
3650 \fi
3651 \Huge \bfseries #2\par}%
3652 \@endpart}
3653 % \end{macrocode}
3654 % The syntax is the following
3655 %\begin{ttsintassi}
3656 %\cs{part}\meta{*}\oarg{short title}{title}
3657 %\end{ttsintassi}
3658 % where the optional star implies no toc entry; in absence of the
3659 % star, the toc entry is the \meta{short title} which, in turn,
3660 % if not specified, assumes the same value as \meta{title}.
3661 % The starred version of |\part|, contrary to the starred version
3662 % of |\chapter|, switches from front to main matter.
3663 %
3664 % At the same time we have to make sure that |\tableofcontents|,
3665 % |\listoftables| and |\listoffigures| do not exit from the
3666 % front matter style. We assume these commands are issued
3667 % while in front matter, the default at the begin document phase,
3668 % so we use starred |\chapter| commands but add the necessary
3669 % toc entries with the native commands. We need not define the
3670 % headers, because the default title is good for this purpose;
3671 % but since such thesis elements are typeset with the front
3672 % matter page style (|plain|), no headers are used; with long
3673 % indices and/or lists of tables and/or figures, the user might
3674 % desire to have headers, so that the declaration
3675 % |\pagestyle{headings}| should be specified before using the
3676 % |\indici| or |\allcontents| commands.
3677 %
3678 % The table of contents itself is not linked at all, but in order
3679 % to link the lists of tables and figures, that are listed into
3680 % the toc, it is better that such lists contain a possible
3681 % target; the |\phantomsection| macro defined by the |hyperref|
3682 % package is used; in case |hyperref| is not loaded, a dummy
3683 % definition avoids “Undefined control sequence” error messages.
3684 % \begin{macrocode}
3685 \renewcommand\tableofcontents{%
3686 \chapter*{\contentsname}%
3687 \@starttoc{toc}%
3688 \clearpage
3689 \if@restonecol\twocolumn\fi
3690 }
3691
3692 \providecommand\phantomsection{}% in case \hyperref was not loaded
3693
3694 \renewcommand\listoffigures{%
3695 \phantomsection
3696 \chapter*{\listfigurename}%
3697 \addcontentsline{toc}{chapter}{\listfigurename}
3698 \@starttoc{lof}%
3699 \clearpage
3700 \if@restonecol\twocolumn\fi
3701 }
3702
3703 \renewcommand\listoftables{%
3704 \phantomsection
3705 \chapter*{\listtablename}%
3706 \addcontentsline{toc}{chapter}{\listtablename}
3707 \@starttoc{lot}%
3708 \clearpage
3709 \if@restonecol\twocolumn\fi
3710 }
3711 % \end{macrocode}
3712 %
3713 % We need to define |\indici| (alias |\allcontents|) that typesets
3714 % the table of contents and, optionally, the lists of tables and/or
3715 % figures while softly maintaining the front matter style for
3716 % typesetting.
3717 %
3718 % The various tables and lists are typeset by default with the |plain|
3719 % page style; if another style is desired the |\indici| command accepts
3720 % an optional argument; the user may specify any (already defined) page
3721 % style that will apply to all lists: table of contents, and if the
3722 % suitable switches are |true|, also to the list of tables and/or the
3723 % list of figures.
3724 % \begin{macrocode}
3725 \NewDocumentCommand\indici{O{plain}}{%
3726 \iffrontmatter\else\frontmattertrue\fi
3727 \pagestyle{#1}%
3728 \tableofcontents
3729 \iftablespage
3730 {\addvspace{10pt}
3731 \let\saveaddvspace=\addvspace
3732 \def\addvspace##1{}
3733 \listoftables
3734 \let\addvspace=\saveaddvspace}
3735 \fi
3736 \iffigurespage%
3737 {\addvspace{10pt}
3738 \let\saveaddvspace=\addvspace
3739 \def\addvspace##1{}
3740 \listoffigures
3741 \let\addvspace=\saveaddvspace}
3742 \fi
3743 \ifbool{@twoside}{\cleardoublepage[empty]}{}}
3744 \let\allcontents\indici
3745
3746 % \end{macrocode}
3747 %
3748 % Command |\onecolumn| is not actually necessary; it simply
3749 % overrides the possible misused option \texttt{twocolumn}
3750 % in the opening document class statement; no thesis should
3751 % be typeset in two columns.
3752 % \begin{macrocode}
3753 \onecolumn
3754 % \end{macrocode}
3755 %
3756 % Here come some declarations for vertical justification
3757 % and for avoiding an hyphenated word at the bottom of a page
3758 % \begin{macrocode}
3759 \if@twoside
3760 \unless\ifScuDo
3761 \flushbottom
3762 \else
3763 \raggedbottom
3764 \fi
3765 \else
3766 \ifx\@xivpt\f@size
3767 \raggedbottom
3768 \else
3769 \flushbottom
3770 \fi
3771 \fi
3772 \brokenpenalty=10000
3773 % \end{macrocode}
3774 %
3775 % Now a questionable command and/or environment is defined; good
3776 % typesetting requires the baseline skip to be proportioned
3777 % to the font size, generally it is some 10--20\% larger
3778 % than the font size. In some reasonable instances a larger
3779 % or a smaller baseline skip might be required; the \LaTeX\
3780 % kernel allows to use the |\linespread| command; in the
3781 % previous versions of this bundle a command |\interlinea|
3782 % and an environment \texttt{interlinea} were defined so as
3783 % to allow setting the line spread factor. The experience has
3784 % shown that some students tend to use this command so as
3785 % to typeset a poor and thin thesis on more pages. Well, every
3786 % instrument can be judiciously or maliciously used; this is
3787 % one of those double sided instruments.
3788 % \begin{macrocode}
3789 \def\interlinea#1{\linespread{#1}\selectfont}
3790 \def\endinterlinea{\par}
3791 % \end{macrocode}
3792 % But whatever might be the current line spread factor within
3793 % figures and tables we reset this factor to the unit value;
3794 % floating bodies do not belong to this or that section
3795 % of text where a different spread factor might be reasonable.
3796 % \begin{macrocode}
3797 \def\@floatboxreset{%
3798 \reset@font
3799 \linespread{1}%
3800 \normalsize
3801 \@setminipage
3802 }
3803 % \end{macrocode}
3804 % Since we are at it we define the floating bodies placing
3805 % parameters; not only the values “here”, “page top”
3806 % and “page bottom”, that we set as the default ones
3807 % leaving to the user to explicitly specify the
3808 % “page of floats”, but also the numerical and geometrical
3809 % parameters that control the float placements.
3810 % These geometrical parameters are critical and everybody
3811 % has his/her own ideas of what are the best values for them.
3812 % According to my experience the parameters set by this
3813 % extension file work quite well but I would not claim
3814 % that they are suitable for any typewritten document.
3815 %
3816 % In particular the zero value for the text fraction appears
3817 % strange, but students have the tendency to create large figures
3818 % (more often than large tables) and these tend to clog the
3819 % figures queue. A 100\% space for the top of page figures
3820 % and a requirement of 0\% text allows large floats
3821 % to exit the queue provided they do not exceed the
3822 % text height.
3823 % \begin{macrocode}
3824 \def\fps@figure{htb} \def\fps@table{htb}
3825 %
3826 \setcounter{topnumber}{2}
3827 \def\topfraction{1}
3828 \setcounter{bottomnumber}{1}
3829 \def\bottomfraction{.5}
3830 \setcounter{totalnumber}{2}
3831 \def\textfraction{0}
3832 \def\floatpagefraction{0}
3833 \setcounter{dbltopnumber}{2}
3834 \def\dbltopfraction{1}
3835 \def\dblfloatpagefraction{0}
3836
3837 % \end{macrocode}
3838 % One command that the default definition does not satisfy
3839 % me very much is the |\caption| command; of course it is
3840 % possible to configure the caption styles by means of the
3841 % \pack{caption} package and its handy set of option styles
3842 % specified by means of the \textit{key$=$value} syntax;
3843 % but if this package is not used, then it is convenient
3844 % to redefine the internal |\@makecaption| macro that
3845 % performs the job as explained hereafter. Since it does
3846 % not cost much I add also the definition of |\captionof|.
3847 %
3848 % The issue is that I prefer a narrower justified caption
3849 % rather than one where the last line is just a short word
3850 % or the right segment of a hyphenated last word. If one
3851 % sets the |\finalhyphendemerits| parameter to an extremely
3852 % high value, one might succeed in avoiding a hyphenated
3853 % penultimate caption line, but this might lead to a very
3854 % loose typesetting of the caption paragraph, especially
3855 % if the horizontal box that contains it hardly exceeds the
3856 % caption width. I initially set the caption width (a new
3857 % length) to the overall text width diminished by 3em; then
3858 % if the caption text, inclusive of the caption label and
3859 % number, is shorter than this text width, it is typeset as
3860 % centred text; if it exceeds the text width, it is set as
3861 % a justified paragraph whose line length equals the
3862 % established caption width; but in any case the last
3863 % line of the paragraph is measured and, if it is shorter
3864 % than one third of the caption width, this width is
3865 % shortened a little bit and the paragraph is set again
3866 % with this shortened caption width; in order to be sure
3867 % that one iteration is sufficient, the caption width
3868 % shrinking must be computed according to the number of
3869 % lines the paragraph occupies.
3870 %
3871 % In order to count the number of lines of the caption
3872 % paragraph, it is necessary to recall that the first line
3873 % occupies a vertical space that equals |\topskip| while
3874 % the other lines occupy a vertical space equal to
3875 % |\baselineskip|; the latter one is generally larger
3876 % than |\topskip| therefore the integer division of the
3877 % height of the vertical box divided by the |\baselineskip|
3878 % is truncated to count one line less than the true value.
3879 % In our case if the caption does not stay in one line,
3880 % its text is typeset in a vertical box with a line spread
3881 % of~0.95 so as to make the caption a little more compact
3882 % than the regular text.
3883 % Therefore the baseline skip is a little shorter than the
3884 % regular one, but it should still exceed the default
3885 % |\topskip|; when we first typeset the caption in a
3886 % vertical box we strip off the last line and we must
3887 % remember the presence of this line in our arithmetics.
3888 %
3889 % If the length of the stripped last line is larger that
3890 % one third of the caption width, then the vertical box
3891 % is recomposed by re\-stacking the individual lines,
3892 % but if this last line is shorter than one third of the
3893 % caption width, this width is recomputed in this way:
3894 % let $N-1$ be the number of lines obtained with the
3895 % integer division, i.e.\ one line less than those
3896 % actually contained in the vertical box. Let $x$ be
3897 % the initial caption width, and $x_2$ the last line
3898 % width; let $y$ be the new caption width; then the total
3899 % length of the caption of width $x$ is $Nx+x_2$ and this
3900 % should be distributed over $N+1$ lines; if we obtained
3901 % the new caption width $y$ by dividing the total length
3902 % by $N+1$ we should be able to typeset the whole
3903 % caption with all the lines of equal length. This does
3904 % not actually take place because the new lines do not
3905 % necessarily contain the same amount of inter word space,
3906 % some words might have been hyphenated in a different way,
3907 % and so on.
3908 %
3909 % Moreover we do not want a caption that barely exceeds the
3910 % length of |\captionwidth| to be retyped into a two
3911 % line caption width that is about one half of the width of
3912 % the other captions.
3913 %
3914 % Therefore we allow for some white space in the last
3915 % line by computing the new caption width with the following formula
3916 % \[ y=\frac{(N+0.5)x + x_2}{N+1} \]
3917 % By the way, if the package \pack{caption} has been loaded
3918 % in the preamble, this specific recalculation must not be
3919 % executed at all; it is necessary to delay this definition
3920 % at |\AtBeginDocument| so we know for sure if that package
3921 % has been actually loaded. Of course if the \pack{caption} package
3922 % has not been loaded the |\captionsetup| macro is not
3923 % defined and its use (for example, as a leftover of some
3924 % experiments with the \pack{caption} package) would produce
3925 % an error; for this reason we define it as a gobbling macro
3926 % so as to neutralise its presence.
3927 %
3928 % At this point it is very simple to add the |\captionof|
3929 % command in order to use a caption also for figures that
3930 % are set outside floating bodies; it might be useful when
3931 % small figures or tables are inserted in unusual places,
3932 % such as a table, a |minipage|, or similar non floating
3933 % environments. The only thing that suffices to insert is
3934 % the name of the corresponding not used float.
3935 % \begin{macrocode}
3936 \AtBeginDocument{\@ifpackageloaded{caption}{}{%
3937 \providecommand\captionsetup{}\renewcommand\captionsetup[2][]{}%
3938 \providecommand\captionof[1]{\def\@captype{#1}\caption}
3939
3940 \let\originalcaption\caption
3941 \newdimen\captionwidth
3942 \newdimen\fullwidth
3943 \if@twocolumn\fullwidth=\columnwidth\else\fullwidth=\textwidth\fi
3944 \belowcaptionskip=\abovecaptionskip
3945 \long\def\@makecaption#1#2{%
3946 \begingroup
3947 \small \parskip\z@ \parindent\z@
3948 \finalhyphendemerits 100000\relax
3949 \linespread{0.95}\selectfont
3950 \vskip \abovecaptionskip
3951 \ifdim\hsize<\fullwidth \captionwidth=\hsize\else
3952 \captionwidth=\dimexpr\hsize-3em\fi
3953 \setbox0 \hbox{\ifblank{#1}{}{#1.\quad}#2}%
3954 \ifdim\wd0>\hsize
3955 \setbox1 \vbox{\hsize=\captionwidth
3956 \unhbox0\par\global\setbox2\lastbox}%
3957 \setbox2\hbox{\unhbox2}%
3958 \ifdim\wd2<0.333333\captionwidth
3959 \count255=\ht1 \advance\count255 \dp1
3960 \divide\count255\baselineskip
3961 \advance\count255\@ne
3962 \@tempdima=\wd2
3963 \advance\@tempdima \count255\captionwidth
3964 \advance\@tempdima 0.5\captionwidth
3965 \advance \count255\@ne
3966 \divide \@tempdima \count255
3967 \captionwidth=\@tempdima
3968 \setbox0 \vbox{\hsize\captionwidth
3969 #1.\quad#2}
3970 \else
3971 \setbox2\hbox to\captionwidth{\unhbox2 \hfill}%
3972 \setbox0\vbox{\unvbox1\box2}%
3973 \fi
3974 \fi
3975 \makebox[\hsize]{\box0}%
3976 \vskip \belowcaptionskip
3977 \endgroup
3978 }}}
3979
3980 % \end{macrocode}
3981 %
3982 % ^^A SDFIGURE
3983 % Always delayed to the |\begin{document}| statement execution,
3984 % we define a new (possibly floated) environment
3985 % |SD| that creates a box where there is the main environment
3986 % contents with its caption to a side, precisely to the side
3987 % close to the outer margin of the page. This implies that
3988 % in one side printing the caption is always on the right,
3989 % while in two side printing the caption is on the right in
3990 % right/odd pages and on the left in left/even pages.
3991 %
3992 % The environment opening statements requires the name of
3993 % a floating object, even if this environment does not float
3994 % anything, but the name is just used to describe its contents;
3995 % it is possible therefore to specify \verb|\begin{SD}{figure}|
3996 % or \verb|\begin{SD}{table}|, or whatever other environment
3997 % name defined with the \pack{float} package functionality;
3998 % this little repetition is for using the correct prefix to
3999 % the caption text even when the environment is used outside
4000 % a formal floating one. In the following paragraphs we speak
4001 % about an “image” to mean the “environment main contents”.
4002 %
4003 % This new special environment box gets actually floated if
4004 % explicitly inserted within a formal floating environment;
4005 % but this special environment box is usable even as
4006 % a standalone environment, or as an object in a fixed position,
4007 % such as when it is set within a mini-page or another similar
4008 % environment; in such situations it is not required to use
4009 % |\captionof|; actually this command is simulated within this
4010 % very \amb{SD} environment.
4011 %
4012 % The actual commands for inserting
4013 % the image and its caption within the |figure| environment
4014 % have names starting with |SD|, namely |\SDcaption| and
4015 % |\SDimage|. Its syntax is as follows:
4016 %\begin{Sintassi}
4017 %\Bambiente{SD}\marg{contents kind}\meta{*}\oarg{fraction}
4018 %\cs{SDimage}\marg{image commands}
4019 %\cs{SDcaption}\oarg{lof entry}\marg{caption}\marg{label}
4020 %\Eambiente{SDfigure}
4021 %\end{Sintassi}
4022 % The \meta{contents kind} equals one of the formal floating
4023 % environments; this information is used to prefix the
4024 % caption text with the proper name and number.
4025 %
4026 % The meaning of the optional asterisk is that its presence
4027 % allows protrusion of the box into the external margin,
4028 % while its absence forces the box width to equal the text
4029 % width. The optional \meta{fraction} is used to specify the
4030 % fraction of the current object width that is dedicated to the
4031 % caption, the remaining space being dedicated to the image;
4032 % actually both widths are reduced a little bit to allow a space
4033 % between the caption and image boxes. But remember this simple
4034 % rule: a small value of this \meta{fraction} implies a narrow
4035 % caption.
4036 %
4037 % Since it is necessary to maintain in separate independent
4038 % areas the picture and the caption, and we need to shuffle
4039 % them when odd or even pages are involved, their handling
4040 % is particular. The |\SDimage| (or |\SDtabular| as an alias
4041 % of |\SDimage|) command syntax is very simple:
4042 %\begin{Sintassi}
4043 %\cs{SDimage}\marg{image commands}
4044 %\end{Sintassi}
4045 % where the \meta{image commands} may be anything suitable so be
4046 % used within a a floating environment; a picture, a tabular,
4047 % a drawing, a box, any command to place the object in the
4048 % correct position within the dedicated space; any argument
4049 % is substantially valid with the caution that this “anything”
4050 % remains local to that particular “image”. In any case when
4051 % the “image” is a real picture and has to be resized to a
4052 % relative dimension, remember that both the picture and its
4053 % caption are typeset within boxes narrower than the total text
4054 % width or the total environment width; the best way to access
4055 % the width is to use its |\hsize| value.
4056 %
4057 % The |\SDcaption| is very similar to that of |\caption| except
4058 % for a small detail; its syntax is the following:
4059 %\begin{Sintassi}
4060 %\cs{SDcaption}\oarg{lof entry}\marg{image}\marg{label}
4061 %\end{Sintassi}
4062 % where the parameters have the following meanings.
4063 %\begin{enumerate}
4064 %\item The \oarg{lof entry} optional bracket delimited argument
4065 % contains the usual short caption entry for the list of
4066 % figures or tables or specific other floats.
4067 %\item The \marg{caption} mandatory brace delimited argument
4068 % contains the image caption text.
4069 %\item The \marg{label} mandatory brace delimited argument
4070 % contains the string that is usually passed to the |\label|
4071 % command; this string is mandatory in the sense that it
4072 % is the |\SDcaption| command that takes care of issuing
4073 % the |\label|\marg{label} command but, since this
4074 % \meta{label} is used to recover the page number (possibly
4075 % after a second compilation run) in order to establish the
4076 % page number parity, it is necessary that the |\label|
4077 % command is issued at the proper moment and that at the same
4078 % time the \meta{label} string is globally saved into a
4079 % suitable macro so as to use it at the right moment.
4080 %\end{enumerate}
4081 % Remember: the TOPtesi caption setting differs from the
4082 % standard one and from its redefinitions with other packages
4083 % such as the |caption| one. The TOPtesi particular redefinition
4084 % tries to adjust the caption with in such a way as to avoid an
4085 % unusually short last line in multi line captions. Therefore
4086 % it may be noticed that sometimes some captions are slightly
4087 % less wide than expected. It is not a bug, it may be considered
4088 % a feature.
4089 %
4090 % Here comes its documented code. First some dimension
4091 % registers, counters and boxes must be defined.
4092 % \begin{macrocode}
4093
4094 \newdimen\SDcaptionwidth
4095 \newdimen\SDfigurewidth
4096 \newdimen\SDlinewidth
4097 \newbox\SDfigbox \setbox\SDfigbox\hbox{}%
4098 \newbox\SDcapbox \setbox\SDcapbox\hbox{}%
4099 \newcounter{SDpage}%
4100 \newcounter{NumberSD} \setcounter{NumberSD}{0}
4101 \providecommand*\theNumberSD{\value{NumberSD}}
4102 \newif\ifNumberFloat \NumberFloattrue
4103 % \end{macrocode}
4104 %
4105 % Then we redefine the |\caption| command in order to add
4106 % the |\caption*| variety that prints just the caption
4107 % without any numbering and any prefix; of course it does
4108 % not increment the suitable float counter nor it adds any
4109 % entry to the list of any float.
4110 % We have to memorise the original definition and add
4111 % the |xparse| extended new definition. Notice that this
4112 % new |\caption| macro accepts the same syntax as the
4113 % original one when no asterisk is specified, while when
4114 % the |\caption*| command is used only the long caption
4115 % argument is used, and the list of floats entry, if
4116 % present, is neglected. This new command may be directly
4117 % used by the final user in those rare circumstances where
4118 % just an explanation is required and the object being
4119 % explained does not require to be cross referenced.
4120 %
4121 % \begin{macrocode}
4122 \NewDocumentCommand\captionSD{s O{} m}{%
4123 % O: optional arg. with null default
4124 \IfBooleanTF{#1}%
4125 {%
4126 \@makecaption{}{#3}%
4127 }{%
4128 \ifempty{#2}%
4129 {%
4130 \originalcaption{#3}%
4131 }{%
4132 \originalcaption[#2]{#3}%
4133 }%
4134 }%
4135 }
4136 % \end{macrocode}
4137
4138 % Then the environment |SDbox| is defined by means of the
4139 % facilities of the |xparse| package; this allows the use of
4140 % the “non delimited” asterisk argument. It also requires other
4141 % arguments, the first of which is mandatory and specifies the
4142 % contents kind, be it a figure, or a table, or an algorithm,
4143 % or anything else that has been introduced with the facilities
4144 % of the |float| package; \dots\ or nothing, in the sense that
4145 % the float should not be numbered and therefore its caption
4146 % should have no number. Among the opening commands we deal
4147 % with the (optional) asterisk dependent box width; with the
4148 % asterisk the SD environment protrudes into the external
4149 % margin.
4150 % \begin{macrocode}
4151 \DeclareDocumentEnvironment{SDbox}{ G{} s O{0.5} }{%------OPENING
4152 \NumberFloattrue
4153 \ifempty{#1}%
4154 {\NumberFloatfalse}%
4155 {\def\@captype{#1}}%
4156 \IfBooleanTF{#2}%
4157 {\SDlinewidth=\dimexpr\textwidth+0.8\marginparwidth}%
4158 {\SDlinewidth=\textwidth}%
4159 % \end{macrocode}
4160 % Then we fix our attention to the correct use of the optional
4161 % third argument, whose descriptor assigns it a default value
4162 % of |0.5|:
4163 % \begin{macrocode}
4164 \SDcaptionwidth=#3\SDlinewidth
4165 \ifdim\SDcaptionwidth<0.3\SDlinewidth
4166 \SDcaptionwidth=0.3\SDlinewidth
4167 \fi
4168 \ifdim\SDcaptionwidth>0.7\SDlinewidth
4169 \SDcaptionwidth=0.7\SDlinewidth
4170 \fi
4171 \SDfigurewidth=\dimexpr\SDlinewidth-\SDcaptionwidth\relax
4172 \SDcaptionwidth=\dimexpr\SDcaptionwidth-\columnsep\relax
4173 \SDfigurewidth=\dimexpr\SDfigurewidth-\columnsep\relax
4174 % \end{macrocode}
4175 % We add some test to verify if the environment is used within
4176 % the |figure| floating environment, or it is used as a fixed
4177 % object; we first test if we are within a floating environment;
4178 % if not we define |\@captype| to contain the string `figure';
4179 % if yes, we have to test if we are really within the |figure|
4180 % environment: if not, we locally define |\@captype| else
4181 % we relax. This means that we can insert the |SDfigure| even
4182 % within a |table| environment as sometimes a tabular and a
4183 % drawing should float together (may be because a drawing with
4184 % its own caption represents the tabular entries).
4185 %
4186 % And this is all for the opening commands; all these settings
4187 % shall be used by |\SDimage| and |\SDcaption| described
4188 % hereafter;
4189 % here we describe the environment closing commands,
4190 % taking into account that the above commands have saved the
4191 % \meta{label} string into the |\@tempSD| macro and have set
4192 % their image and caption-text respectively into boxes
4193 % |\SDfigbox| and |\SDcapbox|.
4194 %
4195 % The code tests if the saved \meta{label} string is empty;
4196 % this should never take place, but it is better to perform
4197 % such task. If the string is empty, a fall back value equal
4198 % to the page number of the page that is still open at
4199 % processing time is used; may be a warning message would
4200 % be helpful, but since this empty string should never be
4201 % empty, it appears as a super luxury feature, that we can
4202 % do without.
4203 %
4204 % But if the string is not empty, we test if the saved
4205 % |\label| data, possibly read from the |.aux| file on a second
4206 % typesetting run, has the normal \LaTeX\ structure or the
4207 % |hyperref| modified one; the former contains two braced
4208 % arguments, while the latter contains five such arguments;
4209 % in both cases the interesting page number is the second
4210 % argument. The existence of a |[email protected]| macro
4211 % allows to know if the |hyperref| package has been invoked
4212 % in the preamble, therefore upon testing this macro we
4213 % know if we should use |\@secondoffive| or |\@secondoftwo|
4214 % to read the real page number of the current |SDfigure|
4215 % environment. Before reading the actual value of the
4216 % |.aux| file |\label| saved data, we must access the
4217 % string that contains these data but we have to expand
4218 % several times the saved macros until we have the real
4219 % string in |\@tempD|.
4220 % \begin{macrocode}
4221 }{%---------------------------------------------------CLOSING
4222 {\ifcsdef{r@\@tempSD}%
4223 {%
4224 \edef\@tempD{r@\@tempSD}%
4225 \edef\@tempD{\expandafter\csuse\expandafter{\@tempD}}%
4226 \edef\@tempD{\@tempD}%
4227 \IfPackageLoadedTF{hyperref}%
4228 {%
4229 \edef\@tempD{\noexpand\@secondoffive\@tempD}%
4230 }%
4231 {%
4232 \edef\@tempD{\noexpand\@secondoftwo\@tempD}%
4233 }%
4234 \edef\@tempD{\@tempD}%
4235 \setcounter{SDpage}{\@tempD}%
4236 }%
4237 {%
4238 \setcounter{SDpage}{\thepage}%
4239 }%
4240 }%
4241 % \end{macrocode}
4242 % At this point we have all the necessary pieces of information
4243 % and we can shuffle the caption and image boxes depending
4244 % on one or two side typesetting, and on the parity of the
4245 % correct page number.
4246 % \begin{macrocode}
4247 \ifbool{@twoside}%
4248 {%
4249 \ifnumodd{\value{SDpage}}%
4250 {%
4251 \makebox[\textwidth][l]{\makebox[\SDlinewidth]{%
4252 \usebox{\SDfigbox}\hfill\usebox{\SDcapbox}}}%
4253 }{%
4254 \makebox[\textwidth][r]{\makebox[\SDlinewidth]{%
4255 \usebox{\SDcapbox}\hfill\usebox{\SDfigbox}}}%
4256 }%
4257 }{%
4258 \makebox[\textwidth][l]{\makebox[\SDlinewidth]{%
4259 \usebox{\SDfigbox}\hfill\usebox{\SDcapbox}}}%
4260 }
4261 }
4262 % \end{macrocode}
4263 %
4264 % The |\SDcaption| code appears to be strangely complicated;
4265 % but it actually performs several actions; the first
4266 % (optional) argument is intended to collect the “short
4267 % caption” to be used, if specified, for the list of floats
4268 % entry; if not specified, as usual, the “long caption”
4269 % second argument is used for this entry. The third (optional)
4270 % brace delimited argument, on the contrary, is the label
4271 % string that usually is passed as the argument of the
4272 % |\label| command. If specified it is this |\SDcaption|
4273 % macro duty to enter this command at the proper moment;
4274 % the caption prefix is established by the value of the
4275 % first (optional) argument of the |SDbox| environment,
4276 % or by the floating environment where the |SDbox| one is
4277 % nested. On the opposite if this macro |\SDcaption| argument
4278 % is not specified, the caption is not numbered nor prefixed,
4279 % and cannot be cross referenced; there are circumstances
4280 % when this situation is very useful, but it is up to the
4281 % user to decide when it is useful for his/her needs.
4282 %
4283 % In this macro definition the boolean switch |NumberSD|
4284 % has been already set by the opening statement commands
4285 % of the |SDbox| environment; it is true only if the first
4286 % environment (optional) argument has been specified or
4287 % the environment is nested within a floating environment.
4288 % Therefore if this boolean is false the unnumbered caption
4289 % gets typeset, otherwise a second boolean is tested, the
4290 % contents of the third (optional) argument of this macro
4291 % |\SDcaption|. If it is specified, the numbered and prefixed
4292 % caption gets typeset and this argument is used to label
4293 % this caption; otherwise an unnumbered and not prefixed
4294 % caption gets typeset with an internally generated label
4295 % that allows to fetch the final page number so as to decide
4296 % if the caption has to be typeset to the right or to the
4297 % left side of the object depending on the page number parity.
4298 % \begin{macrocode}
4299 \NewDocumentCommand\SDcaption{ O{} m G{} }{%
4300 \notbool{NumberFloat}%
4301 {%
4302 \stepcounter{NumberSD}%
4303 \edef\@tempSD{SD\the\c@NumberSD}%
4304 \begin{lrbox}{\SDcapbox}%
4305 \parbox[t]{\SDcaptionwidth}%
4306 {%
4307 \captionSD*{#2}\relax
4308 \expandafter\label\expandafter{\@tempSD}%
4309 }%
4310 \end{lrbox}%
4311 }%
4312 {%
4313 \ifempty{#3}%
4314 {%
4315 \NumberFloatfalse
4316 \stepcounter{NumberSD}%
4317 \edef\@tempSD{SD\the\c@NumberSD}%
4318 \begin{lrbox}{\SDcapbox}%
4319 \parbox[t]{\SDcaptionwidth}%
4320 {%
4321 \captionSD*{#2}\relax
4322 \expandafter\label\expandafter{\@tempSD}%
4323 }%
4324 \end{lrbox}%
4325 }{%
4326 \begin{lrbox}{\SDcapbox}%
4327 \parbox[t]{\SDcaptionwidth}%
4328 {%
4329 \captionSD[#1]{#2}\label{#3}\gdef\@tempSD{#3}%
4330 }%
4331 \end{lrbox}%
4332 }%
4333 }%
4334 }
4335 % \end{macrocode}
4336 %
4337 % We call the object to be shown within the |SDbox| with the
4338 % name “image” which can be anything that can be enclosed
4339 % in a parbox or a minipage; it can be an actual picture
4340 % imported with an |includegraphics| command, it can be a
4341 % drawing or a diagram created with the |picture|, or |tikz|,
4342 % or |pgfplots|, or |pstricks| commands/environments; it can be
4343 % a table, an algorithm, an example, a theorem; anything that can
4344 % be typeset within a box. With this name in mind we create
4345 % the |SDimage| command to insert the object into our |SDbox|.
4346 % A |\SDtabular| command is an alias to |\SDimage|; the user
4347 % may define other such aliases for inserting other objects
4348 % that suit his/her preferences and the logical contents.
4349 %
4350 % Also the |\SDimage| command is not so simple; in order to
4351 % have both caption and image boxes aligned at the top, we
4352 % must be sure that such boxes have their reference points
4353 % at their top left corner; due to the heterogeneity of such
4354 % “images”, we need to lower the image box to have the
4355 % upper left corner raised with respect to the base line the
4356 % amount of a capital `M' in the current font.
4357 % \begin{macrocode}
4358 \newcommand\SDimage[1]{%
4359 \setbox0\hbox{M}\dimen0\ht0\relax
4360 \begin{lrbox}{\SDfigbox}\parbox[t]{\SDfigurewidth}{#1}\end{lrbox}%
4361 \dimen2\dimexpr\ht\SDfigbox+\dimen0\relax
4362 \setbox\SDfigbox\hbox{\raisebox{-\dimen2}{\box\SDfigbox}}%
4363 }
4364 \let\SDtabular\SDimage
4365 % \end{macrocode}
4366 % We do not suggest to use a floating or a fixed |SDbox|
4367 % environment for all figures, tables or what else; its
4368 % use simply depends on the box contents; this environment
4369 % may be useful when a normal setting would cause a lot of white
4370 % space around the displayed material.
4371 %
4372 % We define the |\goodpagepbreak| command; we have to
4373 % distinguish if the command is issued in vertical or in
4374 % horizontal mode; in the former instance we assume it
4375 % has been issued between two paragraphs and a
4376 % potential page break is required before the second
4377 % paragraph; while in the latter case we assume that
4378 % a |\vadjust| element should be inserted so that a page
4379 % break takes place after the current line has been typeset.
4380 % The command accepts an optional argument that represents
4381 % the maximum number of lines that should be available on
4382 % the page in order to issue a |\newpage| command; in other
4383 % words if the number of lines available on the page are
4384 % less or equal to the optional number, then a |\newpage|
4385 % command is issued, otherwise noting is done; the test
4386 % |\ifhmode| is used in order to avoid any action if in math mode.
4387 % \begin{macrocode}
4388 \newcommand\goodpagebreak[1][4]{\ifvmode
4389 \unless\ifdim\dimexpr\pagegoal-\pagetotal>#1\baselineskip\newpage\fi
4390 \else\ifhmode\vadjust{\newpage}\fi\fi}
4391 % \end{macrocode}
4392 %
4393 % The (deprecated) option \opz{chapterbib} requires a redefinition
4394 % of the \texttt{thebibliogrpahy} environment in case a
4395 % separate reference list is required for every chapter.
4396 % The point is that for this task the reference key must
4397 % contain also the chapter number; the rest is simply a
4398 % redefinition of the environment that behaves differently
4399 % according to the chosen option. In any case the bibliography
4400 % goes to the table of contents as an unnumbered chapter or
4401 % section.
4402 % \begin{macrocode}
4403 \def\redef@bibitem{\def\@bibitem##1{\item\if@filesw
4404 \immediate\write\@auxout
4405 {\string\bibcite{##1}{\thechapter.\the\c@enumi}}\fi\ignorespaces}}
4406 %
4407 \def\thebibliography#1{%
4408 \ifchapterbibliography\section*{\bibname}\relax
4409 \if@twoside\markright{\bibname}\fi
4410 \addcontentsline{toc}{section}{\bibname}\relax
4411 \redef@bibitem
4412 \list{[\thechapter.\arabic{enumi}]}{%
4413 \settowidth\labelwidth{[\thechapter.#1]}\leftmargin\labelwidth
4414 \advance\leftmargin\labelsep\itemsep\z@ plus 1pt\parsep\z@
4415 \usecounter{enumi}}
4416 \else
4417 \chapter*{\bibname}\relax
4418 \addcontentsline{toc}{chapter}{\bibname}\relax
4419 \list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
4420 \leftmargin\labelwidth
4421 \advance\leftmargin\labelsep\itemsep\z@ plus 1pt\parsep\z@
4422 \usecounter{enumi}}
4423 \fi
4424 \def\newblock{\hskip .11em plus .33em minus -.07em}
4425 \sloppy
4426 \sfcode`\.=1000\relax}
4427
4428 \let\endthebibliography=\endlist
4429 % \end{macrocode}
4430 %
4431 % For what regards footnotes nothing is changed except
4432 % resetting the line spread to one, in case the current
4433 % value is different.
4434 % \begin {macrocode}
4435 \long\def\@footnotetext#1{\insert\footins{\linespread{1}\footnotesize
4436 \interlinepenalty\interfootnotelinepenalty
4437 \splittopskip\footnotesep
4438 \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
4439 \hsize\columnwidth \@parboxrestore
4440 \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
4441 \@makefntext{\rule{\z@}{\footnotesep}\ignorespaces#1\strut}}}
4442 % \end{macrocode}
4443 %
4444 % The following last heterogeneous definitions are partly important
4445 % and partly residues of the good old times of MS-DOS~v.3
4446 % when a Ctrl-Z character would be placed at the end of files.
4447 % It's a long time that such DOS version is not being used,
4448 % but some old time files might still be around.
4449 %
4450 % The cryptic code that redefines the comma in math mode
4451 % establishes that this character is a normal math character,
4452 % instead of a math punctuation mark. Actually the code
4453 % that defines the mathematical active comma is a new
4454 % addition that lets the comma perform correctly in its
4455 % double function (decimal separator and punctuation mark).
4456 % The only point where this code fails is when a list of
4457 % numbers is typeset: when a numeric list must be typeset,
4458 % such as, for example, $\forall i=0,\,1,\,2,\,3, n$, in the
4459 % source code a space \emph{must} be inserted after every
4460 % punctuating comma while no space follows a decimal comma:
4461 % for example \verb*+$\forall i=0, 1, 2, 3,n$+. The space
4462 % before the |n| is not necessary (but it wouldn't hurt)
4463 % because |n| is not recognised as a digit, therefore the
4464 % “intelligent” comma inserts the necessary space by itself.
4465 %
4466 % \begin{macrocode}
4467 \DeclareMathSymbol{\virgola}{\mathpunct}{letters}{"3B}
4468 \DeclareMathSymbol{\virgoladecimale}{\mathord}{letters}{"3B}
4469 \AtBeginDocument{\mathcode`\,=\string"8000}
4470 {\catcode `,=\active \gdef,{\futurelet\let@token\m@thcomma}}
4471 \def\m@thcomma{\let\@tempB\virgola
4472 \@tfor\@tempA:=0123456789\do{%
4473 \expandafter\ifx\@tempA\let@token\let\@tempB\virgoladecimale
4474 \@break@tfor\fi}\@tempB}
4475 %
4476 \catcode`\^^Z=10
4477 \topmargin 0pt
4478 % \end{macrocode}
4479 %
4480 % {\tolerance=3000\relax
4481 % The TOPtesi bundle contains two new chapter-like sections
4482 % activated with the commands |\sommario| (alias |\summary|)
4483 % and |\ringraziamenti| (alias |\acknowledgements|) respectively.
4484 % The infix strings that start these sections depend on the
4485 % used language.\par}
4486 %
4487 % Because of this, it is necessary to extend the list of infix
4488 % string definitions provided by the |\captions|\meta{language}
4489 % macros defined by the \texttt{babel} or \texttt{polyglossia}
4490 % language description files; for this purpose we define
4491 % a macro for adding new items for these two new sectioning
4492 % commands. This macro receives three arguments: the first
4493 % is the babel language name, the second is the string for
4494 % the summary name, and finally the third is the string for
4495 % the acknowledgements name; everything is contained within
4496 % a group and only the relevant sectioning macro is globally
4497 % redefined. The token register `0' is normally for scratch
4498 % usage, but the fact that its value is restored upon exiting
4499 % the group provides the necessary protection against an
4500 % involuntary reassignment to this register. At the same
4501 % time if a specific language option was not specified, a
4502 % warning message is issued, but compilation goes on any way
4503 % without the sectioning string names. To be sure, no
4504 % other `undefined' error messages are issued, and the |\summaryname|
4505 % and |\acknowledgename| are let to |\empty|.
4506 % \begin{macrocode}
4507 \providecommand*\summaryname{}
4508 \providecommand*\acknowledgename{}
4509 \newcommand*\ExtendCaptions[3]{{%
4510 \@ifundefined{captions#1}{%
4511 \PackageWarning{toptesi}{%
4512 Language option #1 not specified\MessageBreak
4513 Skipping any redefinition\MessageBreak}%
4514 }{%
4515 \expandafter\let\expandafter\@tempA\csname captions#1\endcsname
4516 \toks0=\expandafter{\@tempA%
4517 \def\summaryname{#2}%
4518 \def\acknowledgename{#3}}%
4519 \expandafter\xdef\csname captions#1\endcsname{\the\toks0}%
4520 }}}%
4521 % \end{macrocode}
4522 % For Italian and English there are no problems; we provide
4523 % immediately these extensions by means of the newly available macros:
4524 % \begin{macrocode}
4525 \ExtendCaptions{italian}{Sommario}{Ringraziamenti}
4526 \ExtendCaptions{english}{Summary}{Acknowledgements}
4527 % \end{macrocode}
4528 % In facts the \texttt{babel} and \texttt{polyglossia}
4529 % options for Italian and English have already been loaded
4530 % by default; therefore both caption macros |\captionsitalian|
4531 % and |\captionsenglish| are already defined and can be
4532 % freely extended. For any other language the corresponding
4533 % language option must be entered in the class opening
4534 % statement if babel is used, or it must be set with |polyglossia|
4535 % |\setotherlanguage| when the latter language handler is being used;
4536 % otherwise a warning is issued but compilation
4537 % is not stopped. Therefore if, for example, the user wants
4538 % to write the thesis in Spanish, the thesis main file shall
4539 % start like this:
4540 % \begin{Sintassi}
4541 % \begin{verbatim}
4542 % \documentclass[...,spanish]{toptesi}
4543 % \ExtendCaptions{spanish}{Resumen}{Agradecimientos}
4544 % ...
4545 % \begin{document}
4546 % \selectlanguahe{spanish}
4547 % ...
4548 % \end{verbatim}
4549 % \end{Sintassi}
4550 % and the rest of the thesis will be typeset correctly in
4551 % Spanish. similarly, if |polyglossia| is being used The code
4552 % is:
4553 % \begin{Sintassi}
4554 %\begin{verbatim}
4555 % \documentclass[...]{toptesi}
4556 % ...
4557 % \setotherlanguage{spanish}
4558 % \ExtendCaptions{spanish}{Resumen}{Agradecimientos}
4559 % ...
4560 % \begin{document}
4561 % \selectlanguahe{spanish}
4562 % ...
4563 %\end{verbatim}
4564 % \end{Sintassi}
4565 % Remember that Italian is the main language and
4566 % nothing is necessary to set up the Italian defaults.
4567 % If English is desired, then after |\begin{document}| it
4568 % is necessary to specify the default language; for ease
4569 % of use the following macros are defined so they can be
4570 % used instead of the lengthy \texttt{babel} or
4571 % \texttt{polyglossia} command; after the beginning of the
4572 % document it is then possible to specify |\inglese| or
4573 % |\english|, and the default language is changed to English.
4574 % These shorthand commands can be alternated so as to switch
4575 % from one language to the other; nevertheless remember that
4576 % there are more correct ways to switch languages with the
4577 % \texttt{babel} and \texttt{polyglossia} commands without
4578 % changing the infix strings.
4579 % \begin{macrocode}
4580 \def\italiano{\selectlanguage{italian}}%
4581 \def\english{\selectlanguage{english}}%
4582 \let\inglese\english
4583 % \end{macrocode}
4584 % At the beginning of the document the following commands are
4585 % executed; the general macro |\italiano| sets the summary
4586 % and the acknowledgements names in Italian, as the main
4587 % language; and the |\@chapapp| macro is redefined so as to
4588 % agree with the default language. If a different default
4589 % language is desired, we recall it again, it is necessary to
4590 % do the following:
4591 % \begin{itemize}[noitemsep]
4592 % \item
4593 % specify |\english| \emph{after} the |\begin{document}|
4594 % statement, if English is supposed to be the main language, or
4595 % \item
4596 % if babel is being used, specify the language name, other than Italian
4597 % or English, among the class options; use the |\ExtendCaptions| macro
4598 % for extending the list of sectioning commands infix strings as
4599 % explained above; specify with |\selectlanguage| the new language as
4600 % the default one \emph{after} the |\begin{document}| statement;
4601 % \item
4602 % if \XeLaTeX\ or LuaLaTeX\ is being used for typesetting, it
4603 % suffices to specify in the preamble the name of the other
4604 % language to be used, by means of the |setotherlanguage|
4605 % command, and to define the summary and acknowledgments names
4606 % in the same way as with \pdfLaTeX; the same must be done
4607 % at the beginning of the document to declare the new language
4608 % as the default one.
4609 % \end{itemize}
4610 % \begin{macrocode}
4611 \AtBeginDocument{%
4612 \italiano
4613 \renewcommand\@chapapp{\chaptername}%
4614 }
4615 % \end{macrocode}
4616 %
4617 % At last the subsidiary and independent packages
4618 % \texttt{topcoman} and \texttt{topfront} are requested
4619 % for input; the latter is loaded only when the switch |noTOPfront|
4620 % has NOT been set |true| by using any \texttt{tipotesi=\meta{option}}.
4621 % This action, therefore has to be delayed till the “begin
4622 % document” step, in order to be sure that other packages
4623 % have possibly been loaded to typeset the title page, and/or
4624 % other packages have been loaded to properly use the units
4625 % of measure. This delayed loading implies that the
4626 % commands defined in |topfront| and in |topcomand| cannot
4627 % be used in the preamble. Notice that also the \textsl{scudo}
4628 % option value implies that the title page is typeset with its
4629 % special commands and environments, therefore it sets the
4630 % suitable switches so as to avoid loading the |topfront|
4631 % module. This applies also to the other modules specific for
4632 % special thesis types.
4633 % \begin{macrocode}
4634 \AtBeginDocument{%
4635 \unless\ifT@Pfrontespizio\ifTOPfront
4636 \RequirePackage{topfront}
4637 \fi\fi
4638 \RequirePackage{topcoman}%
4639 }
4640 % \end{macrocode}
4641 %
4642 % Last but not least, here comes the specification set for the
4643 % \sigla{PDF/A}-1b format.
4644 %
4645 % First of all the patches to the macros |\not| and
4646 % |\mapstochar| that produce problems with that format,
4647 % because they have a declared width of 0\,pt; this
4648 % is no problem for \texttt{pdflatex}, but it is a problem
4649 % for the \sigla{PDF/A} format. Therefore, and only when
4650 % \texttt{pdflatex} is used for typesetting the document,
4651 % these commands must be replaced by equivalent ones that
4652 % do not use zero-width glyphs. For |\not|, another slash can
4653 % be used, but in order to have it the right size in all math
4654 % typesetting modes it is necessary to have a different
4655 % command for every mode; this is achieved with the |\mathchoice|
4656 % primitive as such:
4657 % \begin{macrocode}
4658 \ifPDFTeX
4659 \renewcommand*\not{\mathrel{\mathchoice%
4660 {\rlap{$\displaystyle\mkern2.5mu\mathnormal{/}$}}%
4661 {\rlap{$\textstyle\mkern2.5mu\mathnormal{/}$}}%
4662 {\rlap{$\scriptstyle\mkern2.5mu\mathnormal{/}$}}%
4663 {\rlap{$\scriptscriptstyle\mkern2.5mu\mathnormal{/}$}}%
4664 }}
4665 % \end{macrocode}
4666 % Actually the zero-width property of the slash must be
4667 % simulated with a zero-width box but within this box it
4668 % is necessary to specify the typesetting style of the math
4669 % mode material.
4670 %
4671 % A similar trick is used to patch the |\mapstochar| command
4672 % but no other glyph was found suitable for substituting
4673 % the original one; therefore we had to make it up with the
4674 % |picture| environment:
4675 % \begin{macrocode}
4676 \renewcommand\mapstochar{\mathrel{\mathchoice
4677 {\displaystyle\unitlength=0.0555\fontdimen6\font
4678 \picture(0,0)\put(1,1.5){\linethickness{0.72\unitlength}%
4679 \line(0,1){6}}\endpicture}
4680 {\textstyle\unitlength=0.0555\fontdimen6\font
4681 \picture(0,0)\put(1,1.5){\linethickness{0.72\unitlength}%
4682 \line(0,1){6}}\endpicture}
4683 {\scriptstyle\unitlength=0.0555\fontdimen6\font
4684 \picture(0,0)\put(1,0.55){\linethickness{0.61\unitlength}%
4685 \line(0,1){5}}\endpicture}
4686 {\scriptscriptstyle\unitlength=0.0555\fontdimen6\font
4687 \picture(0,0)\put(1,0.2){\linethickness{0.56\unitlength}%
4688 \line(0,1){4}}\endpicture}
4689 }}\fi
4690 % \end{macrocode}
4691 % The above patches are introduced irrespective of using
4692 % \texttt{pdflatex} for producing a \sigla{PDF/A} compliant file;
4693 % one might need to produce a traditional \sigla{PDF} file, or even
4694 % a DVI file, to be converted to the \sigla{PDF} format, in order to
4695 % possibly further transform it into a \sigla{PDF/A} one by means
4696 % of other useful packages, such as \pack{pdfpages}.
4697 %
4698 % \subsection{The \opz{classica} option}
4699 %
4700 % As mentioned above, the \opz{classica} option was
4701 % devised in order to cope with theses in humanities and
4702 % the specifications came from Paolo Ciacchi, a student
4703 % of the University of Trieste, who was preparing a master
4704 % thesis in classical Greek philology. The necessity
4705 % of the large normal size derived from the necessity of
4706 % having clear mark-up signs among the myriad signs
4707 % philologists use; sometimes I believe that the
4708 % philological mark-up requires typesetting environments
4709 % similar to the mathematical ones: in facts the material
4710 % to be typeset does not form linear sequences, as in plain
4711 % text, but bi-dimensional structures as in mathematics.
4712 %
4713 % The other requirements involve the title page and I agreed
4714 % to implement them, since they are likely to be useful
4715 % for other universities as well; the effort for localising
4716 % this bundle makes this point less stringent compared to
4717 % previous versions, but there are other layout fine points
4718 % that cannot be solved with a simple substitution of infix
4719 % strings.
4720 %
4721 % The singular and plural masculine and feminine strings
4722 % for “candidate” are redefined in the |topfront| module.
4723 % For other languages using the configuration file is very handy.
4724 %
4725 % Since theses in humanities may end up to occupy several
4726 % volumes\footnote{Classically “tomo” in Italian means “volume”,
4727 % although the latter word is valid also in Italian with
4728 % the same meaning but appears to be neglected by the
4729 % humanists; in English “tome” indicates a “large book”;
4730 % in Italian the meaning nuance of “tomo” is a little
4731 % different because it is used to indicate each of the volumes into
4732 % which a large printed work is divided; the humanists, as
4733 % usual, know well their words and use them properly!} a
4734 % mechanism is set up to create a different title page for
4735 % each volume; we need a volume counter and a command to
4736 % start each volume.
4737 %
4738 % The localisation allows to change the infix string that
4739 % is going to be printed in the title page. But when several
4740 % tomes are involved, instead of using the |\frontespizio|
4741 % macro or |frontespizio| environment, use the |\tomo| macro.
4742 % This |classica| thesis style does no allow to use a title page
4743 % environment; therefore all necessary data necessary for the
4744 % title pages of each tome must be specified before using the
4745 % \cs{tomo} macro. This macro provides to stepping up the volume
4746 % counter before actually printing the new tome title page.
4747 % \begin{macrocode}
4748 \newcounter{tomo}
4749 \newcommand*{\tomo}{\clearpage\stepcounter{tomo}\boolfalse{topTPTlogos}%
4750 \fr@ntespizio}
4751 % \end{macrocode}^^A>>>>>>>>>>>
4752 % Folios as well are to be redefined and also the page styles
4753 % require a redefinition so as to being able to use old style
4754 % numbers. The macro |\lapagina| (it's not a case that this
4755 % macro name is the direct translation of “thepage”)
4756 % contains the folio number; if it is in roman numerals
4757 % nothing happens, but if the old style numbers are required
4758 % the folio is surrounded by the proper macros so as to expand
4759 % the folio macro before typesetting it in old style. The page
4760 % style does not need an actual redefinition, because the
4761 % original definition in file \texttt{toptesi.sty}
4762 % already uses |\lapagina| as the typeset folio indicator.
4763 % \begin{macrocode}
4764 \renewcommand*{\lapagina}{%
4765 \ifnumeriromani
4766 \thepage
4767 \else
4768 \if@ldstyle
4769 \expandafter\oldstylenums\expandafter{\thepage}%
4770 \else
4771 \thepage
4772 \fi
4773 \fi
4774 }
4775 % \end{macrocode}
4776 % But we actually have to redefine the page style for the new
4777 % headings because the \texttt{classica} option changes
4778 % completely the left and the right headers depending on the
4779 % option \opz{autoretitolo}; in this case the left header
4780 % contains the candidate's name and the (short) version of the
4781 % thesis title, while the right heading contains the chapter
4782 % (short) title; if this option is not in force, headings
4783 % appear as usual, but without using the settings relative to
4784 % the folio position and the header text position.
4785 %
4786 % The redefinition of the \texttt{headings}
4787 % page style is made only if this option is in force. In case
4788 % of two-sided printing where the left head and the right
4789 % heads are different, the left heading contains the author
4790 % name and the short title name; if there are other authors
4791 % the first author name is printed followed by “et al.”;
4792 % if the overall header string exceeds the text width, a
4793 % message is printed so as to suggest the user to
4794 % use the optional |\titolo| argument, the one that is
4795 % supposed to contain the short title. In the right heading
4796 % there is the chapter title; again if the header turns out
4797 % to be too wide, a message is issued to the user.
4798 %
4799 % More complicated things are done when typesetting on one
4800 % side; in facts the author name (possibly followed by
4801 % “et al.”) and the short thesis title are typeset on the
4802 % left of the only header while the chapter title is typeset
4803 % on the right; in the unlikely situation where these two
4804 % elements separated by at least 2em of white space do not
4805 % exceed the text width, they are printed, but if they do,
4806 % as it is likely to happen, then my suggestion would be not
4807 % to use the \opz{autoretitolo} option; but if the user
4808 % absolutely wants this layout, then the author's name,
4809 % possibly followed by “et al.”, and the short thesis title
4810 % are set in a vertical box; the same happens for the
4811 % chapter title in another box; these texts are set with
4812 % ragged margins, and eventually these boxes are set one
4813 % next to the other with an intermediate glob of infinitely
4814 % stretchable glue, and finally set in the header box with
4815 % a rule underneath both of them. The result might be
4816 % barely acceptable if both vertical boxes do not exceed
4817 % two lines and no words have to be hyphenated, but in
4818 % general I believe it is an ugly layout; the user is warned!
4819 % Remember also that |\@@author| contains the author's name
4820 % without the ID number if any.
4821 % \begin{macrocode}
4822 \if@utoretitolo
4823 \if@twoside
4824 %
4825 \renewcommand*{\ps@headings}{\let\@mkboth\markboth%
4826 \def\@oddfoot{\null \hfill \textbf{\lapagina} \hfill \null}%
4827 \let\@evenfoot\@oddfoot
4828 \def\@evenhead{%
4829 \setbox\@intesta\hbox{\ifPDFTeX\latintext\fi
4830 \footnotesize\strut\textsc{%
4831 \@@author\ifcsvoid{@secondauthor}{\ et al.}: \@stitle}%
4832 }%
4833 \ifdim\wd\@intesta>\textwidth\headwrn{\titolo}\fi
4834 \underline{\makebox[\textwidth]{\box\@intesta}}}%
4835 \def\@oddhead{\ifPDFTeX\latintext\fi
4836 \setbox\@intesta\hbox{%
4837 \footnotesize\strut\textsl{\rightmark}}%
4838 \ifdim\wd\@intesta>\textwidth \headWarn{\section}\fi%
4839 \underline{\makebox[\textwidth]{\box\@intesta}}}%
4840 \def\chaptermark##1{\markright{\thechapter\ -- ##1}}%
4841 \def\sectionmark##1{}}%
4842 \else
4843 \renewcommand*{\ps@headings}{\let\@mkboth\markboth
4844 \def\@oddfoot{\null \hfill \textbf{\lapagina}\hfill \null}%
4845 \let\@evenfoot\empty\let\@evenhead\empty
4846 \def\@oddhead{{\setbox\z@\hbox{\ifPDFTeX\latintext\fi
4847 \footnotesize\textsc{%
4848 \@@author\ifcsvoid{@secondauthor}{}{\ et al.}: \@stitle}}%
4849 \setbox\tw@\hbox{\ifPDFTeX\latintext\fi
4850 \footnotesize\textsl{\rightmark}}%
4851 \dimen@=\dimexpr2em + \wd\z@ + \wd\tw@\relax
4852 \unless\ifdim\dimen@<\textwidth
4853 \setbox\z@\vbox{\hsize.48\textwidth\parindent\z@
4854 \raggedright
4855 \ifPDFTeX\latintext\fi
4856 \footnotesize\textsc{%
4857 \@@author\ifcsvoid{@secondauthor}{}{\ et al.}: \@stitle
4858 }}%
4859 \setbox\tw@\vbox{\hsize.48\textwidth\parindent\z@
4860 \raggedleft
4861 \ifPDFTeX\latintext\fi\footnotesize
4862 \textsl{\rightmark}}%
4863 \fi
4864 \setbox\@intesta\vbox to\z@{%
4865 \vss\hbox to\textwidth{\strut\box\z@\hfill\box\tw@}}%
4866 \underline{\box\@intesta}}}%
4867 \def\chaptermark##1{\markright{\thechapter\ -- ##1}}}
4868 \fi
4869 \fi
4870 % \end{macrocode}
4871 %
4872 % The footnote rule separator is also longer than the default
4873 % one. Dealing with notes the footnote separator is also
4874 % changed as well as the footnote skip. But the humanists
4875 % like to have also unnumbered notes within numbered
4876 % ones, as if they were two separate sets; of course
4877 % specialised extension modules, such as, for example,
4878 % the |eledmac|, |reledmac|, or |xreledmac| packages, are
4879 % available in \TeXLive and MiKTeX, but as a poor man
4880 % solution the command |\nota| was introduced that inserts
4881 % a note with a symbol as a note mark; the symbol \emph{must}
4882 % be a mathematical one as the dagger or the double dagger;
4883 % by default it is the asterisk. At the same time the default
4884 % definition of the mathematical asterisk is that of a binary
4885 % operator; I have experienced that the note symbol gets a
4886 % better positioning if it is used as an ordinary symbol
4887 % through |\mathord|. This is why its math code is redefined.
4888 %
4889 % A final unusual request was to be able to put a blank
4890 % unnumbered note, as a (rather wide) note separator.
4891 % The command |\NoteWhiteLine| has to be used at the end
4892 % of the text of the preceding note.
4893 % \begin{macrocode}
4894 \renewcommand\footnoterule{%
4895 \kern-6\p@
4896 \hrule\@width.4\columnwidth
4897 \kern5.6\p@}
4898 \setlength\footnotesep{12\p@}
4899 \setlength{\skip\footins}{24\p@ \@plus 4\p@ \@minus 2\p@}
4900 \newcommand*\nota[1][\mathord{*}]{%
4901 \xdef\@thefnmark{\ensuremath{\m@th#1}}\@footnotemark\@footnotetext
4902 }
4903 \newcommand*{\NoteWhiteLine}{\par\vspace*{-.3\baselineskip}}
4904 % \end{macrocode}
4905 %
4906 % The humanists asked me to create some other simple macros:
4907 % one for skipping a whole page, without header and footer;
4908 % another to compose a dedication page; a third one for
4909 % typesetting a page with one or more witty sentences.
4910 % The first request has a trivial solution, but at least
4911 % |\paginavuota| (alias |\emptypage|) is much shorter to
4912 % type than its expansion.
4913 %
4914 % The environments \texttt{dedica} (alias \texttt{dedication})
4915 % for the dedication, and \texttt{citazioni} (alias
4916 % \texttt{wittysentences}) for the witty sentences are almost
4917 % identical; both typeset their content with a reduced text
4918 % width, half of the normal one; this column is typeset
4919 % on the right of the page. The \texttt{dedica}/\texttt{dedication}
4920 % environment is supposed to be used in the front matter,
4921 % while the witty sentence environment may be used anywhere.
4922 %
4923 % The dedication is typeset in |\Large| font size and in
4924 % italics; if the author wants a different size and/or a
4925 % different shape s/he must specify it at the beginning
4926 % of the dedication text.
4927 % The \texttt{citazioni}/\texttt{wittysentences}
4928 % environment typesets its material with the default font
4929 % shape series and size, so the author has to specify any
4930 % change s/he desires.
4931 %
4932 % These three commands and environments, though, are
4933 % available irrespective of the \texttt{classica} option,
4934 % so that they can be used also for theses outside the
4935 % field of humanities.
4936 %
4937 % \begin{macrocode}
4938 \newcommand*\paginavuota{\clearpage\thispagestyle{empty}\null\clearpage}
4939 \let\emptypage\paginavuota
4940 %
4941 \newenvironment{dedica}{\clearpage
4942 \if@twoside
4943 \ifodd\c@page\else\thispagestyle{empty}\null\clearpage\fi
4944 \fi
4945 \thispagestyle{empty}%
4946 \list{}{\labelwidth\z@
4947 \leftmargin.5\textwidth
4948 \parindent\z@
4949 \raggedright\LARGE\itshape}\item[]
4950 }{%
4951 \endlist\clearpage
4952 }
4953 \let\dedication\dedica \let\enddedication\enddedica
4954 %
4955 \newenvironment{citazioni}{%
4956 \clearpage\thispagestyle{empty}
4957 \list{}{\labelwidth\z@
4958 \leftmargin.5\textwidth
4959 \parindent\z@
4960 \raggedright}\item[]
4961 }{%
4962 \endlist\clearpage
4963 }
4964 \let\wittysentences\citazioni \let\endwittysentences\endcitazioni
4965 % \end{macrocode}
4966 % \iffalse
4967 %</topsty>
4968 % \fi
4969 %
4970 % \subsection{The \texttt{topfront.sty} code}\label{sec:topfront}
4971 %
4972 % This file is input by \texttt{toptesi}, version 6 and higher
4973 % provided that no title page or thesis type options have been
4974 % specified by the user; it can also be used as an independent
4975 % extension module with (hopefully) any document class.
4976 %
4977 % It contains all the definitions for the composition of just
4978 % the title page of “standard” theses along the style
4979 % requirements of \texttt{toptesi}, version 5.x or higher. It is not
4980 % loaded by |toptesi| even when typesetting the title page
4981 % for theses made according the requirements of the ScuDo
4982 % doctoral school; with the \textsf{scudo} option to
4983 % |toptesi| loading of |topfront| is inhibited and in its
4984 % place another extension module, |toptesi-scudo|, is loaded.
4985 % The same holds true with the other special thesis modules.
4986 % This latter files are described in subsequent sections.
4987 %
4988 % The |topfront| package makes use of an optional configuration file
4989 % where the user can define a lot of default information and
4990 % all the infix language dependent strings that are peculiar
4991 % to the title page. Among other things it can typeset
4992 % also the copyright page on the verso of the title page if the
4993 % |\retrofrontespizio| macro argument is not empty.
4994 %
4995 % This file specifies that it requires the \LaTeXe\ format
4996 % and identifies itself. Since this module might be
4997 % used to extend the performances of other classes, this
4998 % file does not specify any input encoding, on the assumption
4999 % that the calling class already provided this information.
5000 % \iffalse
5001 %<*topfrn>
5002 % \fi
5003 %
5004 % In oder to use |topfront| as a stand-alone extension package
5005 % with other classes it is necessary to verify if the \opz{classica}
5006 % option corresponds to a valid setting of |\ifclassica|;
5007 % since this test is defined in the |toptesi| class,
5008 % here we need to verify its existence and, in case, to set
5009 % its value to |false|. This implies two points: we need a
5010 % powerful macro package to test a “switch”, and, when this
5011 % |topfront| module is used as a stand-alone one, the settings
5012 % of the \opz{classica} options are not available. This requires
5013 % to define switches and counters, besides options for this
5014 % package, even if they may be specified to the |toptesi|
5015 % class; of course when |topfront| is used as a standalone
5016 % package, the class might not be |toptesi| therefore a complete
5017 % set up even with the \opz{classica} option must be set again.
5018 % \begin{macrocode}
5019 \IfPackageLoadedF{etoolbox}{\RequirePackage{etoolbox}}
5020 \IfPackageLoadedF{xspace}{\RequirePackage{xspace}}
5021 \IfPackageLoadedF{xparse}{\RequirePackage{xparse}}
5022
5023 \ifcsundef{ifclassica}{\newif\ifclassica \classicafalse}{}
5024 \ifcsundef{if@utoretitolo}{\newif\if@utoretitolo\@utoretitolofalse}{}
5025 \ifcsundef{if@ldstyle}{\newif\if@ldstyle\@ldstylefalse}{}
5026 \ifcsundef{if@xivpt}{\newif\if@xivpt \@xivptfalse}{}
5027 \ifcsundef{if@binding}{\newif\if@binding\@bindingfalse}{}
5028 \ifcsundef{ifScuDo}{\newif\ifScuDo \ScuDofalse}{}
5029 \ifcsundef{ifmonografia}{\newif\ifmonografia\monografiafalse}{}
5030 \ifcsundef{iftriennale}{\newif\iftriennale\triennalefalse}{}
5031 \ifcsundef{ifmagistrale}{\newif\ifmagistrale\magistralefalse}{}
5032 \ifcsundef{ifdottorale}{\newif\ifdottorale\dottoralefalse}{}
5033 \ifcsundef{ifsecondaria}{\newif\ifsecondaria\secondariafalse}{}
5034 \ifcsundef{ifplurale}{\newif\ifplurale\pluralefalse}{}
5035
5036 \ifcsundef{ifTOPfront}{\newif\ifTOPfront \TOPfronttrue}{}
5037 \ifcsundef{ifevenboxes}{\newif\ifevenboxes \evenboxesfalse}{}
5038
5039 \ifcsundef{c@tomo}{\newcounter{tomo}}{}
5040
5041 \DeclareOption{evenboxes}{\evenboxestrue}
5042 \DeclareOption{cucitura}{\@bindingtrue}
5043 \DeclareOption{14pt}{\@xivpttrue}
5044 \DeclareOption{classica}{\classicatrue}
5045 \DeclareOption{autoretitolo}{\ifclassica\@utoretitolotrue\fi}
5046 \DeclareOption{oldstyle}{\ifclassica\@ldstyletrue\fi}
5047 \ProcessOptions*\relax
5048
5049 % \end{macrocode}
5050 %
5051 % For the title page we need a special style, in order to
5052 % put some information in the header and some other in the
5053 % footer, without actually changing the page layout, except
5054 % for horizontally centring the grid in the page.
5055 % The headers, due to a specific request of Politecnico di
5056 % Torino, is to have the university logo(s) in the header;
5057 % other universities maintain their logo(s) in the lower part
5058 % of the page as it was done all the time in the past.
5059 % We need some device to switch position to the logos,
5060 % without actually changing the page layout. Since the
5061 % logo(s) are sort of large, the header must smash the
5062 % header contents, so as to avoid any modification of the
5063 % position and size of the other parts of the page.
5064 % The |\TPT@logobox| box shall be defined later on and
5065 % the |\logosede| command takes care of filling it up.
5066 % Besides these devices, the |\frontespizio| command and
5067 % the |frontespizio| environments (with or without asterisk)
5068 % produce either layout depending on the state of the boolean
5069 % |topTPTlogos|.
5070 % \begin{macrocode}
5071 \def\headstrut{\vrule \@depth4\p@ \@height\z@ \@width\z@}
5072 \def\ps@titlepage{\let\@mkboth\@gobbletwo
5073 \def\@oddfoot{\vbox to 0.05\paperheight{\vss
5074 \hbox to\hsize{\hfil{\Large{\@submitdate}}\hfil}}}%
5075 \let\@evenfoot\@oddfoot
5076 \def\@oddhead{%
5077 \vbox to\headheight{\vss
5078 \iftopTPTlogos
5079 \hbox to\textwidth{%
5080 \headstrut\hfil
5081 \raisebox{3\baselineskip}{\usebox\TPT@logobox}\hfil\null%
5082 }
5083 \fi\par
5084 \ifcsvoid{@ateneo}{}{%
5085 \hbox to\textwidth{\hss\LARGE\rule[-1ex]{0pt}{3.3ex}%
5086 \MakeUppercase{\@ateneo}\hss}}
5087 \vss
5088 }%
5089 }%
5090 \let\@evenhead\@oddhead
5091 \def\chaptermark##1{}\def\sectionmark##1{}%
5092 }
5093 % \end{macrocode}
5094 %
5095 % Similarly a different title page style for typesetting
5096 % the logos in the lower half of the page is defined; since
5097 % it is the only style usable with the \opz{classica} option, we
5098 % call it the |classica| page style:
5099 % \begin{macrocode}
5100 \def\ps@classica{\let\@mkboth\markboth
5101 \def\@oddhead{\vbox{%
5102 \setbox256=\hbox{\LARGE\MakeUppercase{\@ateneo}}
5103 \unless\ifdim\wd256<\textwidth
5104 \setbox256=\hbox{\resizebox{\textwidth}{!}{\box256}}%
5105 \fi
5106 \hbox to \hsize{\hss\box256\hss}%
5107 \ifclassica
5108 \hbox to \hsize{\hfil\vrule\@width\z@
5109 \@height2ex\vrule\@height1.4\p@\@depth-\p@\@width50mm\hfil}%
5110 \fi
5111 }}%
5112 \def\@oddfoot{\vbox to \dimexpr\paperheight/20\relax{\vss
5113 \ifclassica
5114 \hbox to \hsize{\hfil\raisebox{-.3ex}[\z@][\z@]{%
5115 \vrule\@height-2.6\p@\@depth3\p@\@width
5116 \dimexpr\textwidth/3}\hfil}%
5117 \fi
5118 \hbox to\hsize{\hfill{\Large{\@submitdate}}\hfill}}%
5119 }%
5120 \let\@evenhead\@oddhead
5121 \let\@evenfoot\@oddfoot
5122 }%
5123 % \end{macrocode}
5124 %
5125 % The title page information depends on the type of “thesis”
5126 % that is being typeset. The following commands specify the
5127 % kind of information that is going to be typeset. Some boolean
5128 % variables are automatically set by the commands in order
5129 % to change some formatting depending on the kind of thesis.
5130 % For languages that distinguish feminine from masculine
5131 % adjectives or qualifications, some automatic machinery is
5132 % set up in order to format some infix strings in a way
5133 % that copes with the singular or plural forms; in
5134 % particular when there is a multitude of authors (maximum
5135 % three) of different gender, the adjectives or qualifications
5136 % are set as masculine plural names, while when there is just
5137 % one author or the authors are of the same gender the
5138 % adjectives or qualifications are set according to number
5139 % and gender. All this is done by setting or resetting the
5140 % truth value associated to the boolean variable
5141 % \texttt{femminile}. The boolean variable \texttt{dottorato}
5142 % controls the Ph.D thesis format (except for the ScuDo
5143 % school), while the other variable \texttt{triennale}
5144 % controls the formatting of the bachelor's degree report.
5145 % All other theses are treated as master theses,
5146 % and in all cases the appropriate infix string is typeset
5147 % in the title page:
5148 % \begin{macrocode}
5149 \newif\iffemminile
5150 \newif\ifdottorato \dottoratofalse
5151 \newif\iftriennale \triennalefalse
5152 % \end{macrocode}
5153 %
5154 % The infix words for the |classica| option are redefined.
5155 % \begin{macrocode}
5156 \ifTOPfront
5157 \ifclassica
5158 \def\Candidato{Laureando}
5159 \def\Candidata{Laureanda}
5160 \def\Candidati{Laureandi}
5161 \def\Candidate{Laureande}
5162 \fi\fi
5163 % \end{macrocode}
5164 %
5165 % The thesis title is specified by means of the following
5166 % commands; |\monografia|, the name of the bachelors degree
5167 % final report, sets also the corresponding boolean variables
5168 % and redefines the command |\titolo| so as to avoid
5169 % duplications and inconsistencies; of course something might
5170 % still be inconsistent if the commands are given in the
5171 % wrong order.
5172 %
5173 % |\titolo| accepts an optional argument, the “short title”,
5174 % more or less as the standard sectioning commands; this is
5175 % due to the fact that with the class option \opz{autoretitolo}
5176 % the thesis title is written together with the author's
5177 % name in the even page headings; if the thesis full title
5178 % is too long it produces overfull headlines with ugly
5179 % results; a short title may solve the inconvenience.
5180 % The |\sottotitolo| command is another way to maintain
5181 % a short title; all the supplementary title information may be
5182 % typeset in the subtitle.
5183 % \begin{macrocode}
5184 \def\monografia#1{\global\triennaletrue
5185 \global\dottoratofalse
5186 \global\def\titolo##1{\PackageWarning{topfront}%
5187 {Il titolo e' gia' stato impostato con
5188 il comando \string\monografia}}%
5189 \gdef\@titolo{#1}}
5190
5191 \let\@stitle\empty
5192
5193 \providecommand\titolo{}
5194 \RenewDocumentCommand\titolo{O{#2} m}{%
5195 \ifbool{triennale}{%
5196 \PackageWarning{topfront}{Il titolo deve essere impostato con
5197 il comando \string\monografia}
5198 }{%
5199 \gdef\@stitle{#1}}\gdef\@titolo{#2}%
5200 }
5201 \def\sottotitolo#1{\gdef\@subtitle{#1}}
5202 % \end{macrocode}
5203 %
5204 % The |\materia| or its alias |\Materia| are used to
5205 % specify the subject of the thesis; as a silly example
5206 % a set of commands that reflects this subtle difference
5207 % might be the following:
5208 % \begin{Sintassi}
5209 % \begin{verbatim}
5210 % \materia{Applied Tetratricotomy}
5211 % \titolo{Tetratricotomy of blond hair}
5212 % \sottotitolo{Accurate measurements of the four fourths
5213 % of tetratricotomised blond hair}
5214 %\end{verbatim}
5215 % \end{Sintassi}
5216 % and the title page, for example, will contain something like
5217 this:\\[\bigskipamount]
5218 % \fbox{\begin{minipage}{\textwidth}\centering
5219 % {\Large Master Thesis\\ in\\ Applied Tetratricotomy\par}\bigskip
5220 % {\huge Tetratricotomy of blond hair\par}\bigskip
5221 % {\large Accurate measurements of the four fourths\\
5222 % of tetratricotomised blond hair}
5223 % \end{minipage}}\bigskip
5224 %
5225 % \begin{macrocode}
5226 \let\@materia\empty
5227 \def\Materia#1{\def\@materia{#1}}\let\materia\Materia
5228 % \end{macrocode}
5229 %
5230 % Things get more complicated for doctoral theses; in general
5231 % there is no supervisor; at most if a professor is assigned
5232 % to supervise or control the PhD student's work this may be
5233 % called in whatever mode but here we assume his name is input
5234 % with the command |\tutore| even if “tutor” does not appear
5235 % to be the best choice; in any case in Italian “tutore” does
5236 % not have the same meaning as the English word “tutor”.
5237 %
5238 % Most Doctoral Schools require to name the School's director
5239 % or coordinator instead of the tutor. This is why this
5240 % person's name can be introduced with |\direttore| or
5241 % |\coordinatore|; the actual label printed over this person
5242 % name is “Direttore” or “Coordinatore” but it can be
5243 % changed with |\QualificaDirettore|.
5244 % \begin{macrocode}
5245 \newif\ifDirettore \Direttorefalse
5246 \def\tutore#1{\gdef\@tutore{#1}}
5247 \def\direttore{\Direttoretrue\relatore}%
5248 \def\coordinatore{\Direttorefalse\relatore}%
5249 \def\QualificaDirettore#1{\gdef\@PhDdirector{#1}}%
5250 % \end{macrocode}
5251 %
5252 % For “normal” theses we may have from one to three
5253 % supervisors and from one to three authors; not all
5254 % universities accept a multitude of supervisors and/or
5255 % authors of the same thesis, but some do; this is why
5256 % this bundle accepts up to three names for each category.
5257 % The |\second...| commands set the plural forms of the
5258 % labels printed above the name lists. For the candidates
5259 % there are different commands to input women or men
5260 % names; according to the masculine (ending in `o')
5261 % or feminine (ending in `a') commands, the appropriate
5262 % true or false values are assigned to the boolean variable
5263 % \texttt{femminile} and the labels are set accordingly.
5264 %
5265 % Notice that in the case of bachelor degree final report
5266 % no supervisor name is printed even if one or more supervisor
5267 % names are specified. This must be kept in mind in order
5268 % to avoid surprises in finding missing information in the
5269 % title page. Further on, there are suggestions for
5270 % getting around this feature.
5271 % \begin{macrocode}
5272 \def\relatore#1{\gdef\@principaladviser{#1}}
5273 \def\secondorelatore#1{\gdef\@secondadviser{#1}}
5274 \def\terzorelatore#1{\gdef\@thirdadviser{#1}}
5275 % \end{macrocode}
5276 %
5277 % The next set of macros is used to typeset the “date” of
5278 % the thesis defence or presentation or whatever is done
5279 % for the final exam. The macro is sort of complicated
5280 % because the input format for this “date” may vary from
5281 % a single year, to a year range, to a month and year
5282 % specification so that different actions must be taken;
5283 % if the option \texttt{classica} is in force, then the
5284 % formatting of the “date” may be still different.
5285 % For PhD theses this command is aliased by |\esamendidottorato|
5286 % which literally means “defence of the doctoral dissertation”;
5287 % nevertheless both commands refer to a simple date
5288 % in one of those formats.
5289 %
5290 % |\getseduta| splits the date into its two components,
5291 % month and year; if the argument is a single string without
5292 % intervening spaces, the first one is the string itself
5293 % and the second is empty; this emptiness may be tested and,
5294 % in case, the date formatting is modified accordingly.
5295 % In particular if the string is a single spaceless one,
5296 % this string is assigned to |\@submitdate|; otherwise a
5297 % different treatment is made according to the fact that
5298 % \texttt{classica} is in force; if \texttt{classica} is not
5299 % in force the total string, including spaces, is assigned
5300 % to |\@submitade|. If \texttt{classica} is in force,
5301 % |\s@dutaclassica| is called with the whole string.
5302 % On turn |\s@dutaclassica| verifies if the date should be
5303 % typeset with old style numbers or with the usual lining
5304 % figures; in the latter case the whole string is assigned
5305 % to |\@submitdate|; in the former one the year part may
5306 % be either a single year or a year range; this separation
5307 % is tested by splitting the year part across one dash;
5308 % if the dash is present the extremes of the year range are
5309 % assigned to |\1| and |\2|, otherwise the year part is a
5310 % single year.
5311 % If a single year is given, this is simply typeset with
5312 % old style numbers and the appropriate commands are assigned
5313 % to the |\@submitdate| control sequence. If a year range is
5314 % given, this year range is also typeset with old style numbers,
5315 % and the dash is executed with a special en-dash surrounded
5316 % with white space.
5317 %
5318 % \begin{macrocode}
5319 \def\sedutadilaurea#1{\getseduta#1 !}
5320 \def\getseduta#1 #2!{%
5321 \def\@tempA{#2}%
5322 \ifx\@tempA\empty
5323 \def\@submitdate{#1}%
5324 \else
5325 \unless\ifclassica
5326 \def\@submitdate{#1 #2}%
5327 \else
5328 \s@dutaclassica#1 #2!%
5329 \fi
5330 \fi
5331 }%
5332 \def\s@dutaclassica#1 #2!{%
5333 \if@ldstyle
5334 \s@paranumeri#2-!%
5335 \ifx\2\empty
5336 \edef\@submitdate{\noexpand#1 \noexpand\oldstylenums{#2}}%
5337 \else
5338 \s@paranumeri#2!%
5339 \edef\@submitdate{\noexpand#1
5340 \noexpand\oldstylenums{\1} -- \noexpand\oldstylenums{\2}}%
5341 \fi
5342 \let\1\undefined
5343 \let\2\undefined
5344 \else
5345 \def\@submitdate{#1 #2}%
5346 \fi
5347 }
5348 \def\s@paranumeri#1-#2!{\def\1{#1}\def\2{#2}}%
5349 \let\esamedidottorato\sedutadilaurea
5350 % \end{macrocode}
5351 % Here |\annoaccademico| is defined to typeset the infix
5352 % string corresponding to “Anno accademico” followed by
5353 % the year range in old style numbers (irrespective of the
5354 % \texttt{oldstyle} option); localisation commands are
5355 % provided so as to set a different string, possibly
5356 % through the configuration file. In order to set an
5357 % adequate en-dash between the old style numbers a new
5358 % definition is given that takes care to set the dash
5359 % at a height above the base line that copes with the
5360 % specific shape of the old style numbers.
5361 % Notice that |\annoaccademico| and |\sedutadilaurea| do
5362 % not do the same things, besides the fact that |\annoaccademico|
5363 % works only with the |classica| option in force and a
5364 % special format is chosen. Therefore the user has to use
5365 % only one of these two commands, and if s/he uses
5366 % |\annoaccademico| while the |classica| option is not
5367 % in force, s/he gets an warning and the “date” gets
5368 % formatted in a special way so as to remember the user
5369 % that |\annoaccademico| requires the |classica| option.
5370 % \begin{macrocode}
5371 \newcommand*\NomeAnnoAccademico[1]{\gdef\AnnoAccademico{#1}}
5372 \@ifundefined{AnnoAccademico}{\gdef\AnnoAccademico{Anno accademico}}{}
5373 %
5374 \def\annoaccademico#1{\ifclassica
5375 \def\@submitdate{{\large\textsc{\AnnoAccademico}} {\Large\s@tanno#1!}}
5376 \else
5377 \PackageWarning{topfront}{\string\annoaccademico\space
5378 is usable only when the\MessageBreak
5379 `classica' option is in force}%
5380 \def\@submitdate{\AnnoAccademico\ #1 --- Needs the `classica' option}
5381 \fi}
5382 \def\s@tanno#1-#2!{\oldstylenums{#1}\EnDash\oldstylenums{#2}}
5383
5384 \def\EnDash{{\settowidth{\dimen@}{\large\scshape I}%
5385 \setbox\tw@\hbox{2}\dimen\[email protected]\ht\tw@\advance\dimen\[email protected]\dp\tw@
5386 \dimen4\dimen\tw@\advance\dimen4by.0385ex\relax
5387 \advance\dimen\[email protected]\relax
5388 \makebox[1.5\dimen@]{%
5389 \vrule\@width\dimen@\@height\dimen4\@depth-\dimen\tw@}}}
5390 % \end{macrocode}
5391 %
5392 % The next macros are used to assign strings to some
5393 % literal information to be typeset in the title page.
5394 % |\ciclodidottorato| requires an uppercase roman numeral
5395 % (in Italy), but it can accept anything that can precede
5396 % the infix word “cycle”. Notice: in many contries roman numerals
5397 % are generally used as ordinal adjectives; in other countries
5398 % roman numerals are just numbers; therefore the fortieth cycle
5399 % in Italy is marked as “XL ciclo”, while in France it is marked
5400 % as “XL\raise0.7ex\hbox{\scriptsize e} cycle”.
5401 % Macros |\corsodilaurea| and |\corsodidottorato| specify
5402 % the degree course qualification; you would specify just
5403 % “Elettronica”, for example, and the module will write
5404 % in the title page “Corso di Laurea in Elettronica”.
5405 % The infix part may be changed depending on the default
5406 % language and the configuration file.
5407 %
5408 % |\scuoladidottorato| gets the name of the PhD School;
5409 % |\ateneo| gets the generic name of the university;
5410 % |\nomeateneo| gets the proper name of the university.
5411 % In Italy Universities are generally named after the city they
5412 % are in; in large cities where there are several
5413 % universities, each one of them has a proper name.
5414 % For example the generic name might be “Universit\`a di
5415 % Roma” and the proper name might be “La Sapienza”.
5416 %
5417 % |\facolta| may receive an optional argument that is the
5418 % uppercase roman numeral specific of the faculty and
5419 % a compulsory argument that corresponds to the type of
5420 % faculty; for example, with |\facolta[II]{Ingegneria}|
5421 % the package typesets in the title page “II Facolt\`a di
5422 % Ingegneria”; if the optional argument is not specified,
5423 % no roman numeral is typeset; the infix string
5424 % \verb*+Facolt\`a di + may be changed with the configuration
5425 % file depending on the default language.
5426 % It might be necessary to define another name in place of
5427 % “Facolt\`a di\textvisiblespace”, since with recent bills,
5428 % the administrative structure of all Italian universities
5429 % has been changed and the activities formally assigned
5430 % to the Faculties may be now the responsibility of other
5431 % structures that may have different names in different
5432 % universities. If the internal command defined by
5433 % |\FacoltaDi| is empty, no name is printed at all and the
5434 % title page will not have any indication of a particular
5435 % faculty or other educational structure.
5436 % Therefore the Degree Course name, specified with
5437 % |\corsodilaurea| should always be specified.
5438 % The alias commands |\StrutturaDidattica| and |\struttura|
5439 % are defined as equivalent commands to |\FacoltaDi| and
5440 % |\facolta| respectively.
5441 %
5442 % Finally |\logosede| gets the name of the graphic file that
5443 % contains the information relative to the university logo;
5444 % it may receive also a comma separated list of logo file
5445 % names, as it might be necessary when a thesis
5446 % is developed in a multiple university environment.
5447 % If such logo file is not available, the user should not
5448 % specify this command; if the thesis is
5449 % typeset on smaller paper size than A4 or letter,
5450 % it would be much better to avoid inserting one or more logos
5451 % in the title page; this is particularly important when using
5452 % A5 paper size. Nevertheless this decision is left to
5453 % the user and this package neither controls this fact
5454 % nor outputs any warning.
5455 % If the user uses this command to insert one or more
5456 % university logo files but some file is not available,
5457 % the usual \texttt{graphicx} package warning is issued but
5458 % compilation may go on without the missing logo.
5459 %
5460 % The treatment of one or more logo files requires some extra
5461 % commands and control sequences suitable to store temporary
5462 % data or to specify style parameters: one is the name of
5463 % a save box; another is the default spacing between the
5464 % logos in the typeset page; the third is the height of the logos.
5465 % The default spacing may be set with the help of the
5466 % macro |\setlogodistance| -- notice that the default value
5467 % is |3em|, and if a different distance is desired, it should
5468 % not be much larger or much smaller than the default one;
5469 % the default logo height is specified as an option
5470 % command to the |\logosede| command, while the default
5471 % size is given by the |\T@Tlogoheight| length. This length
5472 % is specified in the main |toptesi| package in order
5473 % to compute the typesetting grid, so that if the |topfront|
5474 % module is used by itself with other classes, the existence
5475 % of the |\T@Tlogoheight| control sequence is tested and if it is
5476 % undefined, then and only then it is defined in this
5477 % module and assigned a default value.
5478 %
5479 % The save box name is just for internal workings and does
5480 % not require any customisation.
5481 %
5482 % The analysis and processing to the possible list of logo
5483 % file names is done through the usual means of the delimited
5484 % argument extraction of the single names from the list;
5485 % the “string” of logos is then composed in a save box;
5486 % as the list has been completely processed, the box is
5487 % measured; if its width is shorter than the |\textwidth|
5488 % it is typeset without further processing; if it is larger,
5489 % on the opposite, the box gets scaled down so that its width
5490 % equals the |\textwidth|.
5491 %
5492 % The |\tutoreaziendale| macro is the last title page
5493 % addition; several students, who work on their thesis
5494 % or final project in a company, want to have the company
5495 % supervisor name printed in the title page; this does not
5496 % preclude expressing the student's deepest thanks in the
5497 % acknowledgements section, but it does not harm to name
5498 % this person also in the title page.
5499 %
5500 % Eventually the |\retrofrontespizio| command, that by
5501 % default is empty, allows to typeset a copyright page;
5502 % the argument of this command is in total responsibility
5503 % to the user who must write it in the thesis main language;
5504 % the user can specify from zero to several paragraphs,
5505 % separated by the vertical spaces s/he thinks best; the
5506 % argument by default is typeset at the bottom of the text
5507 % block of the copyright page. The user can specify any
5508 % pertinent space at the bottom of his/her argument, so as
5509 % to set the text in the position s/he likes best.
5510 % In order to handle the copyright page in the proper way
5511 % we need to test if its definition is empty or blank so
5512 % we need the powerful advanced macros of the package
5513 % |etoolbox| that has already been loaded by this module or
5514 % by the main |toptesi| one.
5515 % \begin{macrocode}
5516 \def\ciclodidottorato#1{\gdef\@ciclo{#1 \@cyclename}}%
5517 \def\corsodilaurea#1{\global\dottoratofalse\gdef\@corso{#1}}
5518 \def\corsodidottorato#1{\global\dottoratotrue\global\triennalefalse
5519 \gdef\@corso{#1}}
5520 \def\scuoladidottorato#1{\global\dottoratotrue\global\triennalefalse
5521 \gdef\@phdschool{#1}}
5522 \def\ateneo#1{\gdef\@ateneo{#1}}
5523 \def\nomeateneo#1{\gdef\@nomeat{\expandafter\uppercase{\expandafter #1}}}
5524 \newcommand\facolta[2][]{\gdef\@facname{#2}\gdef\@facnumber{#1}}
5525 \let\struttura\facolta
5526
5527 \newlength{\TPT@logospace}\TPT@logospace=3em\relax
5528 \newsavebox{\TPT@logobox}
5529 \newdimen\TPT@logoheight
5530 \newcommand*\setlogodistance[1]{\TPT@logospace=#1}
5531 \providecommand*{\@logosede}{}
5532
5533 \ifcsundef{T@Tlogoheight}{%\
5534 \newlength\T@Tlogoheight
5535 \setlength\T@Tlogoheight{0.8\dimexpr(\paperwidth-\textwidth)/2}}{}
5536
5537 \newcommand\logosede[2][\T@Tlogoheight]%
5538 {\def\@logosede{#2}\TPT@logoheight=#1\relax
5539 \ifcsvoid{@logosede}{\sbox{\TPT@logobox}{}}{%
5540 \begin{lrbox}{\TPT@logobox}%
5541 \expandafter\fillup@TCP@logobox\@logosede,!}}
5542
5543 \def\fillup@TCP@logobox#1,#2!{%
5544 \ifblank{#1}{\end{lrbox}\ifdim\wd\TPT@logobox>\textwidth
5545 \sbox\TPT@logobox{\resizebox{\textwidth}{!}{\box\TPT@logobox}}\fi}%
5546 {\def\@logosede{#2}%
5547 \includegraphics[height=\TPT@logoheight]{#1}\hskip\TPT@logospace
5548 \expandafter\fillup@TCP@logobox\@logosede,!}}
5549
5550 \newcommand\printloghi{\unless\ifvoid\TPT@logobox\usebox{\TPT@logobox}\fi}
5551
5552 \def\tutoreaziendale#1{\gdef\@tutoreaziendale{#1}}
5553 \newcommand\retrofrontespizio[1]{\long\gdef\@retrofrontespizio{#1}}
5554 % \end{macrocode}
5555 %
5556 % The following commands are user commands that modify the
5557 % infix strings according to the language used and to the
5558 % specifications of the actual university. All these
5559 % commands can be put in the configuration file so as
5560 % to specify what is desired as a default.
5561 % If these commands are specifically used to redefine
5562 % something before issuing the |\frontespizio| command
5563 % or one of the title page environments, the new definitions
5564 % override the configuration ones.
5565 %
5566 % \begin{description}[noitemsep]
5567 % \def\Item[#1]{\item[\cs{\char92#1}] sets or changes the string}
5568 % \Item[FacoltaDi] “Facolt\`a di” in, say, “Faculty of”
5569 % \Item[DottoratoIn] “Dottorato in” in, say, “PhD in”
5570 % \Item[CorsoDiLaureaIn] “Corso di Laurea in” in, say,
5571 % “Master of Science in”
5572 % \Item[TesiDiLaurea] “Tesi di Laurea” in, say,
5573 % “Tesi di Laurea Magistrale”
5574 % \Item[NomeMonografia] “Monografia di Laurea” in, say,
5575 % “Tesi di Laurea”
5576 % \Item[NomeDissertazione] “Dissertazione” in, say,
5577 % “PhD dissertation”
5578 % \Item[InName] “in” in, say, “auf”
5579 % \Item[CandidateName] “Candidato” in, say, “Laureando”
5580 % \Item[AdvisorName] “Relatore” in, say, “Supervisors”
5581 % \Item[CoAdvisorName] “Correlatore” in, say, “Corapporteur”
5582 % \Item[NomeTutoreAziendale] “Supervisore aziendale” in, say,
5583 % “XYZ Company Supervisor”
5584 % \Item[TutorName] “Tutore” in, say, “Supervisor”
5585 % \Item[CycleName] “ciclo” in, say, “cycle”
5586 % \Item[NomePrimoTomo] “Tomo primo” in, say, “First volume”
5587 % \Item[NomeSecondoTomo] “Tomo secondo” in, say, “Second volume”
5588 % \Item[NomeTerzoTomo] “Tomo terzo” in, say, “Third volume”
5589 % \Item[NomeQuartoTomo] “Tomo quarto” in, say, “Fourth volume”
5590 % \end{description}
5591 % In the above description the first string is generally
5592 % the default one, while the second string is just an example
5593 % of the corresponding string to be set in another language
5594 % or to be changed in Italian. The last four commands clearly
5595 % show the difficulty of localising language strings: it
5596 % is necessary to localise the whole phrase, because of
5597 % the position of the adjectives.
5598 % \begin{macrocode}
5599 \newcommand\FacoltaDi[1]{\gdef\@faculty{#1}}
5600 \let\StrutturaDidattica\FacoltaDi
5601 \newcommand\DottoratoIn[1]{\gdef\@PhDname{#1}}
5602 \newcommand\CorsoDiLaureaIn[1]{\gdef\@laureaname{#1}}
5603 \newcommand\TesiDiLaurea[1]{\gdef\@TesiDiLaurea{#1}}
5604 \newcommand\NomeMonografia[1]{\gdef\@monografia{#1}}
5605 \newcommand\NomeDissertazione[1]{\gdef\@dissertazione{#1}}
5606 \newcommand\InName[1]{\gdef\@InName{#1}}
5607 \newcommand\CandidateName[1]{\gdef\@nomecandidato{#1}}
5608 \newcommand\AdvisorName[1]{\gdef\Relatore{#1}\gdef\Relatori{#1}}
5609 \newcommand\CoAdvisorName[1]{\gdef\Correlatore{#1}\gdef\Correlatori{#1}}
5610 \newcommand\TutorName[1]{\gdef\Tutore{#1}}
5611 \newcommand\NomeTutoreAziendale[1]{\gdef\@tutoreaziendalename{#1}}
5612 \newcommand\CycleName[1]{\gdef\@cyclename{#1}}
5613 \newcommand\NomePrimoTomo[1]{\gdef\PrimoTomo{#1}}
5614 \newcommand\NomeSecondoTomo[1]{\gdef\SecondoTomo{#1}}
5615 \newcommand\NomeTerzoTomo[1]{\gdef\TerzoTomo{#1}}
5616 \newcommand\NomeQuartoTomo[1]{\gdef\QuartoTomo{#1}}
5617 \providecommand\IDlabel{\\\quad matricola\ }
5618 % \end{macrocode}
5619 %
5620 % Now we can read the configuration file if it exists;
5621 % in any case what is possibly defined or redefined in the
5622 % configuration file must not be redefined in the following
5623 % Lines and this is why everything is subject to the test
5624 % |\@ifundefined|. Most default definitions are simply
5625 % “blank”; the others are in Italian. All of them, except
5626 % the supervisor and candidate strings may be individually
5627 % redefined in the configuration file or in the preamble.
5628 % Those that cannot be redefined such as the four
5629 % “candidate” strings may be actually redefined through
5630 % the single |\CandidateName| that should be used in a
5631 % language depended way and with the correct number and
5632 % gender once for all.
5633 % The four endings in the Italian strings used to allow
5634 % the correct selection only for Italian.
5635 % With the current of this TOPtesi bundle the tests work
5636 % in a different way, so as to perform correctly also in
5637 % other languages. The same is true for the supervisor
5638 % and the co-supervisor strings that may be changed once
5639 % for all with |\AdvisorName| and
5640 % |\CoAdvisorName|.
5641 % \begin{macrocode}
5642 \IfFileExists{\jobname.cfg}{\input{\jobname.cfg}}%
5643 {\IfFileExists{toptesi.cfg}{\input{toptesi.cfg}}{}}
5644 %
5645 \@ifundefined{@cyclename}{\def\@cyclename{ciclo}}{}
5646 \@ifundefined{@titolo}{\def\@titolo{}}{}
5647
5648 \providecommand\@author{}\providecommand\@@author{}
5649 \NewDocumentCommand\candidato{m o}{\gdef\@@author{#1}%
5650 \IfNoValueTF{#2}{\gdef\@author{#1}}%
5651 {\gdef\@author{#1\IDlabel#2}}
5652 \femminilefalse\pluralefalse}
5653 \NewDocumentCommand\candidata{m o}{\gdef\@@author{#1}%
5654 \IfNoValueTF{#2}{\gdef\@author{#1}}%
5655 {\gdef\@author{#1\IDlabel#2}}
5656 \femminiletrue\pluralefalse}
5657 \providecommand\@secondauthor{}
5658 \NewDocumentCommand\secondocandidato{m o}{%
5659 \IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
5660 {\gdef\@secondauthor{#1\IDlabel#2}}%
5661 \femminilefalse\pluraletrue}
5662 \NewDocumentCommand\secondacandidata{m o}{%
5663 \IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
5664 {\gdef\@secondauthor{#1\IDlabel#2}}%
5665 \pluraletrue}
5666 \providecommand\@thirdauthor{}
5667 \NewDocumentCommand\terzocandidato{m o}{%
5668 \IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
5669 {\gdef\@thirdauthor{#1\IDlabel#2}}%
5670 \femminilefalse\pluraletrue}
5671 \NewDocumentCommand\terzacandidata{m o}{%
5672 \IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
5673 {\gdef\@thirdauthor{#1\IDlabel#2}}%
5674 \pluraletrue}
5675 \providecommand\IDlabel{matricola\ }
5676
5677 \@ifundefined{@principaladviser}{\def\@principaladviser{}}{}
5678 \@ifundefined{@secondadviser}{\def\@secondadviser{}}{}
5679 \@ifundefined{@thirdadviser}{\def\@thirdadviser{}}{}
5680 \ifcsundef{@PhDdirector}{%
5681 \ifDirettore\def\@PhDdirector{Direttore del corso di dottorato}\else
5682 \def\@PhDdirector{Coordinatore del corso di dottorato}\fi}{}
5683 \@ifundefined{@tutore}{\def\@tutore{}}{}
5684 %
5685 \@ifundefined{@nomerelatore}{\def\@nomerelatore{}}{}
5686 \@ifundefined{@nomecandidato}{\def\@nomecandidato{}}{}
5687 \@ifundefined{Candidato}{\def\Candidato{Candidato}}{}
5688 \@ifundefined{Candidata}{\def\Candidata{Candidata}}{}
5689 \@ifundefined{Candidati}{\def\Candidati{Candidati}}{}
5690 \@ifundefined{Candidate}{\def\Candidate{Candidate}}{}
5691 \@ifundefined{Relatore}{\def\Relatore{Relatore}}{}
5692 \@ifundefined{Relatori}{\def\Relatori{Relatori}}{}
5693 \@ifundefined{Correlatore}{\def\Correlatore{Correlatore}}{}
5694 \@ifundefined{Correlatori}{\def\Correlatori{Correlatori}}{}
5695 \@ifundefined{Tutore}{\def\Tutore{Tutore}}{}
5696 \@ifundefined{@tutoreaziendale}{\def\@tutoreaziendale{}}{}
5697 \@ifundefined{@tutoreaziendalename}%
5698 {\def\@tutoreaziendalename{Supervisore Aziendale}}{}
5699 \@ifundefined{@retrofrontespizio}{\def\@retrofrontespizio{}}{}
5700 \@ifundefined{@subtitle}{\def\@subtitle{}}{}
5701 %
5702 \@ifundefined{@corso}{\def\@corso{}}{}
5703 \@ifundefined{@ciclo}{\def\@ciclo{}}{}
5704 \@ifundefined{@ateneo}{\def\@ateneo{POLITECNICO DI TORINO}}{}
5705 \@ifundefined{@nomeat}{\def\@nomeat{}}{}% Nome proprio dell'ateneo
5706 \@ifundefined{@facolta}{\def\@facname{}}{}
5707 \@ifundefined{@facnumber}{\def\@facnumber{}}{}
5708 \@ifundefined{@faculty}{\def\@faculty{}}{}
5709 %
5710 \@ifundefined{PrimoTomo}{\def\PrimoTomo{Tomo primo}}{}
5711 \@ifundefined{SecondoTomo}{\def\SecondoTomo{Tomo secondo}}{}
5712 \@ifundefined{TerzoTomo}{\def\TerzoTomo{Tomo terzo}}{}
5713 \@ifundefined{QuartoTomo}{\def\QuartoTomo{Tomo quarto}}{}
5714 % \end{macrocode}
5715 %
5716 % The infix word for the |classica| option are redefined.
5717 % \begin{macrocode}
5718 \ifTOPfront
5719 \ifclassica
5720 \def\Candidato{Laureando}
5721 \def\Candidata{Laureanda}
5722 \def\Candidati{Laureandi}
5723 \def\Candidate{Laureande}
5724 \fi
5725 \fi
5726 % \end{macrocode}
5727 % If the final exam date is not given, the default value is
5728 % the current month and the current year typeset in Italian;
5729 % therefore the user is strongly requested to enter a date
5730 % either with the |\sedutadilaurea| or the |\esamedidottorato|
5731 % commands. The default value of the university logo command has
5732 % already been defined “empty”.
5733 % \begin{macrocode}
5734 \@ifundefined{@submitdate}{\def\@submitdate{\ifcase\the\month\or%
5735 Gennaio\or Febbraio\or Marzo\or Aprile\or Maggio\or Giugno\or
5736 Luglio\or Agosto\or Settembre\or Ottobre\or Novembre\or Dicembre\fi
5737 \space \the\year}}{}
5738 %
5739 \@ifundefined{@TesiDiLaurea}{\def\@TesiDiLaurea{Tesi di Laurea}}{}
5740 \@ifundefined{@phdschool}{\def\@phdschool{SCUOLA DI DOTTORATO}}{}
5741 \@ifundefined{@PhDname}{\def\@PhDname{Dottorato in }}{}
5742 \@ifundefined{@laureaname}{\def\@laureaname{Corso di Laurea in }}{}
5743 \@ifundefined{@dissertazione}{\def\@dissertazione{Tesi di Dottorato}}{}
5744 \@ifundefined{@monografia}{\def\@monografia{Monografia di Laurea}}{}
5745 \@ifundefined{@InName}{\def\@InName{in}}{}
5746 % \end{macrocode}
5747 %
5748 % Finally we have the real macro |\frontespizio| and the
5749 % corresponding environments, the real macros or environments
5750 % that actually typeset the title page.
5751 %
5752 % I recommend to use the environments, a new feature of
5753 % version 5.85. But the legacy command |\frontespizio| is
5754 % still usable. The principle on which these environments
5755 % work is that the |frontespizio| environment typesets the
5756 % title page with logo(s) set in the page header, while the
5757 % |frontespizio*| environment typesets the logos after the
5758 % information on the title, the possible sub title and tome
5759 % information, i.e.\ in the lower half of the title page.
5760 % In order to achieve this result each environment sets the
5761 % boolean variable |topTPTlogos| to either value |true|
5762 % (for header logos) or |false| (otherwise).
5763 % The key of the different typesetting style is this
5764 % boolean-variable state.
5765 %
5766 % Now, since the internal |frontespizio| environment opening
5767 % command is |\frontespizio| how is it possible to distinguish
5768 % this opening statement from the homonymous user command?
5769 % The solution is a little tricky, but, after all, very simple.
5770 % The |\begin| command, with which an environment is started,
5771 % before calling the opening statement defines the internal
5772 % service macro |\@currenvir| to contain the environment name;
5773 % this is used by the |\end| statement to control that it is
5774 % closing the last opened environment.
5775 %
5776 % If the |\frontespizio| command is directly used, the
5777 % |\@currenvir| macro does not contain the name “frontespizio”;
5778 % therefore if in the opening environment definition we check
5779 % the contents of |\@currenvir| against the string
5780 % |frontespizio| we can decide if the user resorted to
5781 % the legacy command, or the environment was correctly
5782 % opened by means of |\begin|.
5783 % If the user resorted to the legacy command, the
5784 % service macro |\fr@ntespizio| is called that typesets
5785 % the title page according to the current status of the
5786 % boolean |topTPTlogos|, a boolean that has a default
5787 % value but the user can set at its will. Otherwise the
5788 % |frontespizio| environment is regularly executed.
5789 % Notice that the service macro |\fr@ntespizio| tests
5790 % the state of the boolean |classica| and accordingly
5791 % uses a different page style.
5792 % \begin{macrocode}
5793 \newbool{topTPTlogos} \booltrue{topTPTlogos}
5794
5795 \newenvironment{frontespizio*}{\boolfalse{topTPTlogos}}{\fr@ntespizio}
5796
5797 \newenvironment{frontespizio}{%
5798 \ifdefstring{\@currenvir}{frontespizio}
5799 {\booltrue{topTPTlogos}}{\TPTmaybestar}
5800 }{%
5801 \fr@ntespizio
5802 }
5803
5804 % \end{macrocode}
5805 %
5806 % With the new boolean |AteneoInHead| we can mark these
5807 % situations where the university common name goes into the
5808 % header; with the |classica| option the title page
5809 % \emph{must} have this name in the header and if the user
5810 % forgets to specify one, this module fakes it with a clear
5811 % message that the university name has been forgotten, but
5812 % at the same time this fake message fills up the header
5813 % position. On the other hand, when the |classica| option
5814 % has not been specified, the user can use either an empty
5815 % university name or a specific name. So only when the
5816 % |\@ateneo| macro remains empty the university name
5817 % in the header remains really blank; this is good when the
5818 % university name is part of the university logo (this is
5819 % the case for Politecnico di Torino, and for many other
5820 % universities). When no university name is set in the header
5821 % some little attention in formatting the title page is necessary.
5822 %
5823 % \begin{macrocode}
5824 \newbool{AteneoInHead}\boolfalse{AteneoInHead}
5825 % \end{macrocode}
5826 %
5827 % In order to use the command |\frontespizio*| as an isolated
5828 % command instead of the starting command of the |frontespizio*|
5829 % environment, we have to behave as with the |\frontespizio|
5830 % command, but we must test for a possible asterisk following
5831 % the command; for this reason we defined the |\TPTmaybestar|
5832 % that absorbs one following token: if the token is an
5833 % asterisk, we set the appropriate settings for the previous
5834 % behaviour of the isolated command, but if it is
5835 % not an asterisk we must set it back into the list after
5836 % finishing the execution of the |\fr@ntespizio| service macro,
5837 % whose function is to set the title page information at the
5838 % proper position, but must not contain any spurious material.
5839 % \begin{macrocode}
5840 \newcommand\TPTmaybestar[1]{\def\@tempA{#1}%
5841 \ifdefstring{\@tempA}{*}%
5842 {\boolfalse{topTPTlogos}\booltrue{AteneoInHead}\fr@ntespizio}
5843 {\booltrue{topTPTlogos}\fr@ntespizio\@tempA}
5844 }
5845 % \end{macrocode}
5846 %
5847 % We start defining the complex macro |\fr@ntespizio|. We start
5848 % with a group so that any settings performed by this command
5849 % remain local; if the title page environments had been
5850 % used, this group would be useless, but if the isolated
5851 % commands are used, then this group protects the rest of the
5852 % document from unusual local settings valid only for the
5853 % title page.
5854 % \begin{macrocode}
5855 \def\fr@ntespizio{%
5856 \begingroup\par
5857 % \end{macrocode}
5858 %
5859 % We want also the title page to be set in the middle of the
5860 % page irrespective of the binding correction; so we assign
5861 % the average of the two side margins to both
5862 % of them.
5863 % \begin{macrocode}
5864 \oddsidemargin=\dimexpr(\oddsidemargin+\evensidemargin)/2\relax
5865 \evensidemargin \oddsidemargin
5866 % \end{macrocode}
5867 % The |\null| command inserts a void horizontal box into
5868 % the vertical list; it is useful to act as a block against
5869 % which the vertical glue pushes for setting the subsequent
5870 % material. The normal font is chosen in case preceding
5871 % commands did change the font characteristics.
5872 % \begin{macrocode}
5873 \null
5874 \setcounter{page}{1}%
5875 \normalfont
5876 % \end{macrocode}
5877 % Depending on the style of the title page a different
5878 % |\pagestyle| is set with appropriate switches and settings.
5879 % If with the classica style a university name is blank,
5880 % it is set to an explicit string equivalent to “The
5881 % university name is missing”.
5882 % \begin{macrocode}
5883 \ifclassica
5884 \boolfalse{topTPTlogos}
5885 \thispagestyle{classica}
5886 \ifcsvoid{@ateneo}{\def\@ateneo{Manca il nome dell'ateneo}
5887 }{}
5888 \else
5889 \thispagestyle{titlepage}
5890 \fi
5891 \ifcsvoid{@ateneo}{}{\booltrue{AteneoInHead}}
5892 % \end{macrocode}
5893 %
5894 % The generic university name should already be in the header
5895 % either in the logo or in the header text; but in spite of
5896 % this we test if the university generic name macro is void,
5897 % if it contains something, then we typeset also the generic
5898 % name; some candidates might obey to university regulations
5899 % that require the name of the university be at the top, just
5900 % under the logo. The switch |\ifcsvoid| is true if |@ateneo|
5901 % is empty or blank, false otherwise; but even with page top
5902 % logos, no test is made in order to give the possibility to
5903 % repeat the university name. It is the user responsibility to
5904 % set an empty value to the |\ateneo| macro so as to avoid
5905 % repeating the university name possibly already present in
5906 % the logo itself.
5907 % \begin{macrocode}
5908 \ifcsvoid{@ateneo}{%
5909 \ifbool{topTPTlogos}
5910 {}{\booltrue{AteneoInHead}\def\@ateneo{Manca il nome dell'ateneo}}%
5911 }{%
5912 \booltrue{AteneoInHead}%
5913 }
5914
5915 \ifbool{AteneoInHead}{}{%
5916 {{\centering\LARGE \@ateneo\par}}
5917 }
5918 % \end{macrocode}
5919 %
5920 % If it is non blank the first thing we set on the page is
5921 % the university proper name and some vertical glue.
5922 % \begin{macrocode}
5923 \ifcsvoid{@nomeat}{}
5924 {\ifbool{topTPTlogos}{\vspace*{\dimexpr \headsep+2.5ex}}{\vspace*{-3ex}}%
5925 {\centering\@nomeat\par}\vfill}
5926
5927 % \end{macrocode}
5928 % Then the faculty name comes next; but for the doctoral
5929 % school it uses the doctoral school name entered with
5930 % |\scuoladidottorato|, otherwise it inserts the faculty
5931 % ordinal number or prefix and name already entered with
5932 % the optional and required arguments of |\facolta|.
5933 % \begin{macrocode}
5934 \begin{center}
5935 {\rmfamily\mdseries
5936 \ifdottorato
5937 \large \@phdschool\par\medskip
5938 \else
5939 \ifcsvoid{@faculty}{}{%
5940 \LARGE\ifx\@facnumber\empty\else\@facnumber\space\fi
5941 \@faculty\unskip\xspace\@facname\par\medskip
5942 }
5943 \fi
5944 }%
5945 % \end{macrocode}
5946 % Further specification: it inserts the field of the PhD
5947 % research or the degree course name; it inserts a line
5948 % such as, for example, “Philosophy Degree in Applied
5949 % Tetratricotomy~--~XVI~cycle” or “Master of Science
5950 % in Applied Tetratricotomy”.
5951 % \begin{macrocode}
5952 \ifcsvoid{@corso}{}{{\large
5953 \ifdottorato
5954 \@PhDname\unskip\xspace
5955 \@corso\ifx\@ciclo\empty\else~--~\@ciclo\fi
5956 \else
5957 \@laureaname\unskip\xspace\@corso
5958 \fi
5959 \par}}
5960 \end{center}
5961 % \end{macrocode}
5962 % It now centres the name of the report, be it “Doctoral
5963 % Dissertation” or “Master Thesis” or whatever; in case
5964 % the command |\materia| was used, it then centres the
5965 % discipline which the thesis deals with.
5966 % \begin{macrocode}
5967 \vspace{\stretch{0.2}}
5968 \begin{center}
5969 \LARGE
5970 \ifdottorato
5971 \@dissertazione%
5972 \else
5973 \iftriennale
5974 \@monografia%
5975 \else
5976 \@TesiDiLaurea%
5977 \fi
5978 \fi
5979 \unless\ifx\empty\@materia
5980 \\\@InName\\\@materia
5981 \fi
5982 \end{center}
5983 % \end{macrocode}
5984 %
5985 % Next comes the real title entered with |\titolo| or
5986 % |\monografia| and the possible subtitle.
5987 % \begin{macrocode}
5988 \vspace{\stretch{0.2}}
5989 \begin{center}
5990 {\huge\bfseries \baselineskip=0.95em plus 1pt
5991 \@titolo \par}
5992 \end{center}
5993 % \end{macrocode}
5994 % with the possible subtitle:
5995 % \begin{macrocode}
5996 \unless\ifx\@subtitle\empty
5997 \begin{center}%
5998 \large\textrm{\@subtitle}\par
5999 \end{center}%
6000 \fi
6001 % \end{macrocode}
6002 % If the option \texttt{classica} is in force the thesis
6003 % might be divided in several volumes; theses in humanities
6004 % apparently are often oversized. In this case the |\tomo|
6005 % command may be given at the beginning of every volume and the
6006 % counter \texttt{tomo} is stepped up; the volume number
6007 % is therefore printed in each title page; the infix string
6008 % may be redefined as it was shown above.
6009 % \begin{macrocode}
6010 \ifclassica
6011 \ifnum\value{tomo}>\z@
6012 \par\bigskip
6013 \noindent\makebox[\textwidth]{%
6014 \large\textbf{%
6015 \ifcase\c@tomo%
6016 \or \PrimoTomo%
6017 \or \SecondoTomo%
6018 \or \TerzoTomo%
6019 \or \QuartoTomo%
6020 \else
6021 \PackageWarning{toptesi}{%
6022 Counter tomo equals
6023 \the\c@tomo\MessageBreak
6024 We never considered a thesis might get
6025 divided in more than four volumes}%
6026 \fi}}%
6027 \fi
6028 \vspace{1em}
6029 \fi
6030 \par
6031 % \end{macrocode}
6032 % Going down in the title page, now comes the optional
6033 % insertion of the university logo(s); “optional” in both
6034 % meanings: one or more university logos are not generally
6035 % required in a thesis, and, in case, it depends if the
6036 % logo(s) have to be put in the header or here.
6037 % This is a simple task since the |\logosede| already
6038 % defined the contents to the box |\TPT@logobox|, and this
6039 % was done either with the explicit command |\logosede|
6040 % with its argument in a specific line of the configuration
6041 % file or within the |frontespizio| environment.
6042 % If such box |\TPT@logobox| is void, the already defined
6043 % |\printloghi| macro does not do anything.^^A >>>>>>
6044 % \begin{macrocode}
6045 \unless\iftopTPTlogos
6046 {\vfill\centering \printloghi\par}\fi
6047 % \end{macrocode}
6048 %
6049 % The final task is to typeset the possible supervisors'
6050 % names, the candidates' names and all the rest of the
6051 % bureaucratical terms. We have to distinguish between
6052 % a bachelor degree report that is not supposed to have
6053 % a supervisor, from the doctoral dissertation where we
6054 % do not indicate the supervisor, but the School Director,
6055 % and the master thesis where there might be one or more
6056 % supervisors; with the \texttt{classica} option in force
6057 % no label is printed over the supervisor's name, unless
6058 % there is a plurality of supervisors.
6059 % \begin{macrocode}
6060 \vfill
6061 \iftriennale
6062 \let\@nomerelatore\empty
6063 \else
6064 \ifdottorato
6065 \edef\@nomerelatore{\@PhDdirector}%
6066 \else
6067 \ifcsvoid{@principaladviser}{}{%
6068 \def\@nomerelatore{\Relatore}}
6069 \unless\ifclassica
6070 \ifcsvoid{@secondadviser}{}{%
6071 \def\@nomerelatore{\Relatori}}%
6072 \fi
6073 \fi
6074 \fi
6075 % \end{macrocode}
6076 % Similarly the label names for the exam candidates are
6077 % chosen; in Italian such names are infix strings that are
6078 % selected according to the gender and the number; if these
6079 % labels have to be set in a different language it is
6080 % necessary to define one string that has to be selected
6081 % by the user according to number and gender.
6082 % The label for the PhD candidate is left empty.
6083 % \begin{macrocode}
6084 \ifdottorato
6085 \let\@nomecandidato\empty
6086 \else
6087 \iflanguage{italian}{%
6088 \iffemminile
6089 \def\@nomecandidato{\Candidata}%
6090 \else
6091 \def\@nomecandidato{\Candidato}%
6092 \fi
6093 \ifcsvoid{@secondauthor}{}{%
6094 \iffemminile
6095 \def\@nomecandidato{\Candidate}%
6096 \else
6097 \def\@nomecandidato{\Candidati}%
6098 \fi}
6099 }{}%
6100 \fi
6101 % \end{macrocode}
6102 %
6103 % For the supervisor(s) and the candidate(s) name(s)
6104 % a different approach is used for each one of the three
6105 % categories of theses persons. If a bachelor degree
6106 % report is dealt with, the name of the \emph{single}
6107 % candidate is centred and written in caps-and-small-caps.
6108 % \begin{macrocode}
6109 \iftriennale
6110 \begin{center}%
6111 \large\mdseries\textsc{\@author}
6112 \end{center}%
6113 % \end{macrocode}
6114 % For doctoral and master theses two virtual boxes
6115 % (actually macros) are filled up so as to align the
6116 % supervisor name(s) and, respectively,
6117 % the candidate name(s). The label is set in the first
6118 % line with proper number and gender; in the second line
6119 % the first name, and in the subsequent lines,
6120 % if there are any, the other names. These virtual boxes
6121 % in reality contain a tabular environment each; these
6122 % environments shall be actually typeset when these virtual
6123 % box macros are executed. If the \texttt{classica} option
6124 % is in force no label is set over the principal advisor
6125 % name, but a label is set over the co-advisor name(s).
6126 % The type size is also a little different for the
6127 % \texttt{classica} option. The |\protect| command is used
6128 % to protect the names in case they contain accent macros
6129 % that might be expanded at the wrong moment.
6130 %
6131 % The candidate name(s) are typeset in another nested
6132 % tabular environment of two lines when the user typesets
6133 % the entry in such a way:
6134 %\begin{Sintassi}
6135 %\cs{candidato}\Marg{Mario Rossi}\Oarg{123456}
6136 %\end{Sintassi}
6137 % The optional argument contains the ID number of the candidate;
6138 % if it is specified, it is typeset below the candidate name,
6139 % with an indentation, and prefixed with the \verb*|matricola |
6140 % label; of course if the optional ID number (and the enclosing
6141 % brackets) is not specified, nothing is printed after or
6142 % below the candidate's name.
6143 % If the user wants it typeset on the same line and or with a
6144 % different label s/he has to redefine the macro |\IDlabel| by
6145 % means of the \cs{ID} macro described in previous sections.
6146 %
6147 % Example redefinitions are shown in the sample files.
6148 % Notice that with the new definition of the candidates' setting
6149 % macros it is guaranteed that the ID number, if specified, is
6150 % typeset in the title page, but not in the headers if the
6151 % |autoretitolo| option is in force.
6152 %
6153 % It is useful to recall that the ID number must be entered
6154 % only if required by the University regulations; it must
6155 % not be typeset in the title page just because it is possible
6156 % to do it.
6157 %
6158 % \begin{macrocode}
6159 \else
6160 % For theses of any kind that expect the supervisor and co-supervisor
6161 % names:
6162 \def\BoxRelatori{%
6163 \begin{tabular}[t]{l}%
6164 \hbox{\ifclassica\else\large\fi
6165 \textbf{\protect\@nomerelatore}}\\[.6ex]
6166 \hbox{\large\textrm{\protect\@principaladviser}}%
6167 \ifx\@secondadviser\empty \else
6168 \ifclassica
6169 \ifx\@thirdadviser\empty
6170 \ifx\@secondadviser\empty\else
6171 \\[1.5ex]\textbf{\Correlatore:}%
6172 \fi
6173 \else
6174 \\[1.5ex]\textbf{\Correlatori:}%
6175 \fi
6176 \fi
6177 \\[.6ex]\hbox{{\large\textrm{\protect\@secondadviser}}}%
6178 \fi
6179 \ifx\@thirdadviser\empty \else
6180 \\[.6ex] \hbox{{\large\textrm{\protect\@thirdadviser}}}%
6181 \fi
6182 \end{tabular}%
6183 }%
6184 % \end{macrocode}
6185 % A similar approach is taken for the candidate name(s),
6186 % although for code clarity I prefer to define two secondary
6187 % macros in order to format the other candidates names
6188 % and ID in a clearer way.
6189 % \begin{macrocode}
6190 \def\print@secondocandidato{\\\relax
6191 \hbox{\large\tabular{@{}l@{}}\@secondauthor\endtabular}}
6192 \def\print@terzocandidato{\\\relax
6193 \hbox{\large\tabular{@{}l@{}}\@thirdauthor\endtabular}}
6194 \def\BoxCandidati{%
6195 \begin{tabular}[t]{l}%
6196 \hbox{\unless\ifclassica\large\fi
6197 \textbf{\protect\@nomecandidato}}\\[.6ex]
6198 \hbox{\large\tabular{@{}l@{}}\@author\endtabular}%
6199 \ifcsvoid{@secondauthor}{}{\print@secondocandidato}%
6200 \ifcsvoid{@thirdauthor}{}{\print@terzocandidato}%
6201 \end{tabular}%
6202 }%
6203 % \end{macrocode}
6204 % The real typesetting of these name lists takes place now;
6205 % if the thesis is referred to the PhD school, one type of
6206 % layout is used, otherwise the default master thesis layout
6207 % is used; remember that the bachelor degree case has
6208 % already taken place. For the doctoral dissertation the
6209 % doctoral candidate name is typeset centred in one line
6210 % by itself and everything else is set 3em below into a three
6211 % column table extended to the |\hsize|, the first line
6212 % containing the applicable labels and the second line
6213 % containing the true names. The central column is used just
6214 % for spacing, but it does not contain anything.
6215 % \begin{macrocode}
6216 \ifdottorato
6217 \begin{center}\large
6218 \textbf{\@author}\\[3em]
6219 {\normalsize
6220 \begin {tabular*}{\hsize}{@{\extracolsep{\fill}}ccc}
6221 \ifcsvoid{@tutore}{}{\textbf{\Tutore}}
6222 &\relax&
6223 \ifcsvoid{@principaladviser}{}{\textbf{\@nomerelatore}}
6224 \\
6225 \ifcsvoid{@tutore}{}{\@tutore}
6226 &\relax&
6227 \ifcsvoid{@principaladviser}{}{\@principaladviser}
6228 \end{tabular*}
6229 }%
6230 \end{center}
6231 \else
6232 % \end{macrocode}
6233 % For the master thesis the two virtual boxes are set one
6234 % besides the other but skewed to the right or, respectively,
6235 % to the left of every name so that there is enough space
6236 % for the signature. With the \texttt{classica} option in force
6237 % the two boxes are simply aligned.
6238 % \begin{macrocode}
6239 \unless\ifclassica
6240 \unless\ifevenboxes
6241 \begin{flushleft}%
6242 \BoxRelatori
6243 \end{flushleft}\par\vspace*{-1.5\baselineskip}
6244 \begin{flushright}%
6245 \BoxCandidati
6246 \end{flushright}%
6247 \else
6248 \makebox[\textwidth]{\BoxRelatori\hfill\BoxCandidati}
6249 \fi
6250 \else
6251 \noindent
6252 \makebox[\textwidth]{%
6253 \BoxRelatori\hfill\BoxCandidati}\par
6254 \fi
6255 \fi
6256 \fi
6257 % \end{macrocode}
6258 % The final item is the optional name of the company supervisor.
6259 % \begin{macrocode}
6260 \ifcsvoid{@tutoreaziendale}{}{%
6261 \vfill\vfill
6262 {\centering \textbf{\@tutoreaziendalename}\\[.6ex]
6263 \@tutoreaziendale\par}}
6264 % \end{macrocode}
6265 % All the material now is on the page; we put some more
6266 % vertical glue and handle the copyright page; then we
6267 % close the page sending it to the output file; the final
6268 % |\endgroup| closes the |\begingroup| that was set at
6269 % the beginning of this long macro.
6270 % In order to handle the copyright page, we test if the
6271 % internal definition of the copyright page text is empty;
6272 % in this case no copyright page should be output, and
6273 % a |\cleardoublepage| works fine in both one and two side
6274 % printing; if the copyright page text is not empty, after
6275 % shipping out the title page, we set the copyright page
6276 % text flush bottom with the text block, and then we ship
6277 % out also this copyright page.
6278 % \begin{macrocode}
6279 \par\clearpage
6280 \ifcsvoid{@retrofrontespizio}{}%
6281 {\null\vfill\thispagestyle{empty}\@retrofrontespizio\par\clearpage}%
6282 \endgroup}
6283 % \end{macrocode}
6284 % \iffalse
6285 %</topfrn>
6286 % \fi
6287 %
6288 % \subsection{Further settings for the ScuDo doctoral school}
6289 %
6290 % Doctoral theses to be developed at the \emph{Scuola di
6291 % Dottorato} (ScuDo) doctoral school of Politecnico di
6292 % Torino require a particular set of other packages and
6293 % commands to be available by default to the student
6294 % writing his/her doctoral thesis. It requires also
6295 % a title page with a layout completely different from
6296 % those that can be typeset with the |topfront| extension
6297 % file and, as far as I can tell, different from what
6298 % is possible to create with the excellent |frontespizio|
6299 % package.
6300 %
6301 % This task is reached by selecting the thesis type
6302 % by means of the |tipotesi=scudo| option to the |toptesi|
6303 % class; this option sets on or off the necessary switches
6304 % and loads the |toptesi-scudo.sty| module in place of the
6305 % |topfront| one. This specific module loads the extra
6306 % packages, defines some special commands, provides the
6307 % customising commands to modify the title page infix
6308 % words and labels, and the commands to introduce the
6309 % specific thesis data; eventually it specifies the title
6310 % page layout and provides for its generation and to a
6311 % copyright and disclaimer sentence on its page verso.
6312 %
6313 % The module produces also a colophon where some data concerning
6314 % the thesis typesetting details are given. This colophon
6315 % is saved and used on the last even page of the complete thesis.
6316 %
6317 % Some if not all the data required for the title page may
6318 % be entered by means of a configuration file |\jobname.cfg|
6319 % that can be modelled on the |toptesi.cfg| file that is part of
6320 % this bundle. The user should remember to copy the sample file in
6321 % his/her thesis directory, change its name (not the extension)
6322 % to match that of the thesis, modify the data according
6323 % to his/her needs, and this extension file will read the
6324 % configuration file at the proper moment and acquire its data.
6325 %
6326 % This |toptesi-scudo.sty| module is meant to load a certain
6327 % number of packages in order to ease the user work when
6328 % typesetting a dissertation in an engineering doctorate
6329 % school such as ScuDo.
6330 %
6331 % The chosen packages are supposed to be sufficient to
6332 % typeset any technical thesis or dissertation; but this
6333 % does not limit its use to the fields of engineering;
6334 % anybody can load the packages
6335 % s/he needs for the particular discipline s/he is
6336 % working on. At the same time nobody forbids to load
6337 % other packages, in addition, not in substitution, of
6338 % the packages loaded by this extension file of the
6339 % |toptesi| class.
6340 %
6341 %\iffalse
6342 %<*topscu>
6343 %\fi
6344 % We start by loading the math packages produced by the
6345 % American Mathematical Society, differentiating what is
6346 % necessary to load when using \pdfLaTeX\ or the
6347 % OpenType-aware programs \XeLaTeX\ or \LuaLaTeX.
6348 % The extension file |iftex| that defines the switches
6349 % \cs{ifPDFTeX},, \cs{ifXeTeX}, and \cs{ifLuaTeX},
6350 % has already been loaded. The AMS fonts should
6351 % not be used when typesetting with \XeLaTeX\ or \LuaLaTeX,
6352 % because these programs get them directly from the
6353 % \sigla{UNICODE} math fonts, so that package |amssymb| has
6354 % to be loaded only when \pdfLaTeX\ is used.
6355 % \begin{macrocode}
6356 \ScuDotrue
6357 \ifPDFTeX
6358 \RequirePackage{amsmath,amssymb,amsthm}
6359 \else
6360 \RequirePackage{amsmath,amsthm}
6361 \RequirePackage{unicode-math}
6362 \fi
6363 % \end{macrocode}
6364 % The suitable macro for using the differential sign in the
6365 % proper \sigla{ISO} compliant way (upright font) with the suitable
6366 % spacing before and no space after, is the following:
6367 % \begin{macrocode}
6368 \AtBeginDocument{%
6369 \providecommand\diff{}\renewcommand{\diff}{\mathop{}\!\mathrm{d}}
6370 \providecommand{\iu}{\ensuremath{\mathop{\mathrm{\mathstrut i}}\nolimits}}
6371 \providecommand{\ju}{\ensuremath{\mathop{\mathrm{\mathstrut j}}\nolimits}}
6372 \providecommand{\eu}{\ensuremath{\mathop{\mathrm{e}}\nolimits}}
6373 \let\gei\ju}
6374 % \end{macrocode}
6375 % Such a definition allows to typeset math expression containing
6376 % integrals with a small space between the integrand and the
6377 % integrating differential; on the contrary the leading space does
6378 % not disturb typesetting differential equations. The above
6379 % definitions include also the \sigla{ISO} compliant ways of writing
6380 % the Napier number `e', and the two forms of imaginary unit |\iu|
6381 % and |\ju| that set an operator-like roman `i' or`j' as it is customary in
6382 % most engineering disciplines. The common alias |\gei| to the |\ju|
6383 % command may be redefined if the PhD student wants to use a common
6384 % phonetically transliterated name for the letter `j'; the example file
6385 % \texttt{toptesi-scudo-example.tex} uses the Greek ‘iota’ and specifies
6386 % that this use is \emph{wrong}!
6387 %
6388 % Next an option is defined, |mybibliostyle| which allows the user to
6389 % establish his own style for the bibliography. By default the
6390 % |toptesi-scudo| module loads |biblatex| with a set of options that
6391 % allow numerical listing and numerical citation according to the IEEE
6392 % standards for its Transactions. PhD students doing their theses in
6393 % other scientific domains may use different styles for bibliographics
6394 % listings and citation methods. By setting this option |mybibliostyle|
6395 % among the class ones, it is automatically treated as a global option
6396 % so that it is passed on to the called packages; in particular this
6397 % option reaches this |toptesi-scudo| module, that has the following
6398 % definition and handling lines:
6399 % \begin{macrocode}
6400
6401 \ifcsundef{ifmybibstyle}{\newif\ifmybibstyle\mybibstylefalse}{}
6402 \DeclareOption{mybibliostyle}{\mybibstyletrue}
6403 \ProcessOptions*\relax
6404
6405 % \end{macrocode}
6406 % The switch |mybibstyle| is used below when the |biblatex|
6407 % package is possibly loaded. Actually when this option is active
6408 % (i.e. when this switch is `true') nothing is loaded, and the user
6409 % is free to load the packages s/he likes best in order to handle the
6410 % bibliographic databases and to typeset one or more bibliographies
6411 % with different styles. Since in the other thesis types nothing
6412 % is preloaded for customising the user's bibliography, the user
6413 % does not need to specify the above |mybibliostyle| option, and
6414 % can proceed loading his/her preferred packages for bibliographic
6415 % styles. With the other thesis types if the user specifies this option,
6416 % nothing is done and it remains in the list of ‘unused options’.
6417 %
6418 % Some other packages are loaded next. Please take notice that
6419 % |xparse| is very useful to define advanced commands and
6420 % environments containing different kind of delimited
6421 % arguments; parameters entered as arguments to the
6422 % opening statement of an environment are available also
6423 % for the closing commands; read the documentation if you
6424 % want to use this package facilities. Since this package is
6425 % already loaded by the |toptesi| class, a test is performed
6426 % as to avoid reloading; but if this module is used independently
6427 % from the |toptesi| class, the package is actually loaded.
6428 %
6429 % Using the facilities of |setspace| may be tolerated only
6430 % while typesetting a thesis draft. It is bad typography
6431 % to use its facilities when doing the thesis final printing.
6432 %
6433 % Packages |ifthen| and |calc|, in spite of being the
6434 % standard traditional ones for accomplishing their tasks,
6435 % are preferred by many users who are not aware that
6436 % computations are now native of modern typesetting
6437 % programs\footnote{All the three typesetting programs we are dealing
6438 % with here. All modern programs may benefit from the
6439 % advances of the \LaTeX3 language, that has special facilities
6440 % to perform floating point calculations.}; also advanced
6441 % tests are natively available with such programs, but
6442 % since this class loads the |etoolbox|, its powerful
6443 % and robust commands are already available; therefore
6444 % these packages are loaded only for the user comfort,
6445 % although they are not really required.
6446 %
6447 % Packages |caption| and |subcaption| have been optional
6448 % for several TOPtesi versions before version 6.x; here they
6449 % are pre-loaded only with the \textsf{tipotesi=scudo} option.
6450 %
6451 % Package |tabularx| provides an alternative way to produce
6452 % tables of specified width by means of a new column type
6453 % |X|; this column type behaves as |p|\marg{width}, where
6454 % \meta{width} is computed by the package in order to expand
6455 % the column(s) so as to fill the specified table
6456 % width. It is very handy in a number of situations.
6457 %
6458 % For professional typesetting tables, package |booktabs|
6459 % is highly recommended; we load also package |multirow|,
6460 % although its use is deprecated by many professionals.
6461 %
6462 % The sample template file |toptesi-scudo-example.tex| shows a
6463 % couple of tables typeset with and without using
6464 % |multirow|; the results without using this package are
6465 % marginally more elegant, but the user is more free to specify
6466 % every detail, without the support of automatic (and
6467 % limited) typesetting macros.
6468 %
6469 % Package |siunitx| is highly recommended; its management
6470 % of fractional measures, of units of measure, and of table
6471 % columns that contain numerical values aligned on the decimal
6472 % separator is very useful.
6473 %
6474 % Package |float| is very handy to define new floating
6475 % environments; unfortunately many users load it in
6476 % order to have available the float positioning
6477 % option \textsf{H}, which should never be used,
6478 % especially while using this TOPtesi class, where
6479 % provisions for large floats are already taken care of.
6480 % \begin{macrocode}
6481 \@ifpackageloaded{xparse}{}{%
6482 \RequirePackage{xparse}}% Command and environment advanced definitions
6483 \RequirePackage{lscape} % Supports landscape Layout
6484 \RequirePackage{setspace} % Define line spacing in paragraph. Don't use it!
6485 \RequirePackage{calc} % Calculation macros
6486 \RequirePackage{ifthen} % Conditional statements
6487 \RequirePackage{caption} % Configure captions
6488 \RequirePackage{subcaption}% Defines env. subfigure and its caption
6489 \RequirePackage{tabularx} % Tables with expandable columns
6490 \RequirePackage{booktabs} % professional rules in tables
6491 \RequirePackage{multirow} % Multirow cells are not professional
6492 \RequirePackage{siunitx} % advanced management of units of measure
6493 \RequirePackage{float} % Use only to define new floating objects!
6494 % \end{macrocode}
6495 %
6496 % Package |nomencl| is loaded and a sample of nomenclature
6497 % groups is defined; they are mostly examples of “how to”;
6498 % and in particular they are models to define other
6499 % nomenclature groups. Notice that the string comparison
6500 % tests are made through the robust testing commands
6501 % provided by the |etoolbox| package.
6502 % \begin{macrocode}
6503 \usepackage[intoc]{nomencl}% Generate nomenclatures or glossaries
6504 \makenomenclature
6505 \renewcommand{\nomgroup}[1]{%
6506 \ifstrequal{#1}{A}{\item[\textbf{Roman Symbols}]}{%
6507 \ifstrequal{#1}{G}{\item[\textbf{Greek Symbols}]}{%
6508 \ifstrequal{#1}{Z}{\item[\textbf{Acronyms / Abbreviations}]}{%
6509 \ifstrequal{#1}{R}{\item[\textbf{Superscripts}]}{%
6510 \ifstrequal{#1}{S}{\item[\textbf{Subscripts}]}{%
6511 \ifstrequal{#1}{X}{\item[\textbf{Other Symbols}]}{}}}}}}}
6512
6513 \renewcommand{\nompreamble}{\markboth{\nomname}{\nomname}}
6514 % \end{macrocode}
6515 %
6516 % It is important to note that the nomenclature
6517 % raw file must be processed by means of program
6518 % \prog{makeindex} with special options. Assuming
6519 % that your thesis main file is named |MyPhDthesis.tex|,
6520 % after compiling with pdfLaTeX, you should open a
6521 % terminal, change the working directory into that
6522 % where your main file is stored, and
6523 % enter and execute the line command
6524 %\begin{Sintassi}\small
6525 %\begin{verbatim}
6526 %makeindex -s nomencl.ist -t MyPhDthesis.nlg -o MyPhDthesis.nls MyPhDthesis.nlo
6527 %\end{verbatim}
6528 %\end{Sintassi}
6529 % Afterwards you should have your processed nomenclature
6530 % ready and up to date, so that by running again the
6531 % typesetting program your nomenclature appears in the
6532 % back matter; a second typesetting run, as usual, updates
6533 % the table of contents with the entry and page number of
6534 % the Nomenclature section. It is important to do this
6535 % action before printing the final version of the thesis;
6536 % you do not need to update the nomenclature every time
6537 % you edit one of your thesis source files.
6538 %
6539 % All this fuzz is bypassed in the sense that all typesetting
6540 % programs can run safe OS commands, among which \prog{makeindex},
6541 % in order to do all these actions by themselves if we
6542 % procede by closing the auxiliary file that collect
6543 % nomenclature entries, and run \prog{makeindex} with
6544 % the proper options and file names directly through the
6545 % “magic command” |\write18|. Again all this is automatically
6546 % performed by the macros defined by the \file{toptesi-scudo}
6547 % module, therefore your nomenclature is up to date at each
6548 % run, without any need to explicitly use unusual undocumented
6549 % native \TeX\ commands. In facts we define a new command
6550 % to process the nomenclature files and print them out.
6551 %
6552 % Again the test for an empty optional argument is made by
6553 % means of a macro defined in |etoolbox|. When using LuaLaTeX
6554 % it is necessary a special treatment, because the typesetting
6555 % engine does not use the |\write18| functionality, but
6556 % accesses the operating system commands by means
6557 % of its own Lua facilities. The user is not obliged to
6558 % know these details, but this extension file must be
6559 % programmed accordingly.
6560 % \begin{macrocode}
6561 \newcommand{\printnomencl}[1][]{%
6562 \immediate\closeout\@nomenclaturefile
6563 \ifLuaTeX
6564 \chardef\T@T@shellescape\directlua{tex.write(os.execute())}
6565 \def\exec@makeindex{%
6566 \directlua{os.execute("\luaescapestring
6567 {makeindex -s nomencl.ist -t \jobname.nlg -o \jobname.nls \jobname.nlo}")}}
6568 \else
6569 \def\exec@makeindex{\immediate\write18{%
6570 makeindex -s nomencl.ist -t \jobname.nlg -o \jobname.nls \jobname.nlo}}
6571 \fi
6572 \exec@makeindex
6573 \ifblank{#1}{\printnomenclature}{\printnomenclature[#1]}%
6574 }
6575 % \end{macrocode}
6576 % The result is a synchronous typesetting of the nomenclature
6577 % in the same way as for the index.
6578 %
6579 % The bibliography by default is typeset through the facilities of
6580 % package |biblatex| with suitable options;
6581 % according to the tradition in scientific works, in particular
6582 % of the IEEE standards for its Transactions, the
6583 % references are labelled with bracketed numbers as well
6584 % as citations. Nevertheless some PhD students working in other
6585 % scientific domains ask for different styles for using |BiBTeX|
6586 % compatible bibliographies to be run also with |pdflatex|, or
6587 % bibliographies styled in a more humanistic way.
6588 %
6589 % In this case they should specify the specific option |mybibliostyle|
6590 % to the |toptesi| class, and the following code will not be loaded,
6591 % since the switch |mybibstyle| is set to `true' only when using
6592 % such an option. Therefore if the user uses the above option, the code
6593 % loads neither |biblatex| with its options, nor |csquotes|; furthermore
6594 % the bibliographic database remains unspecified. It is the user
6595 % responsibility to insert in his/her thesis preamble whatever necessary
6596 % to typeset his/her bibliography or bibliographies the way s/he prefers.
6597 % In the following code the module preloads the bibliographic database
6598 % |resources.bib|, if it exists; since a generic name is not recommended,
6599 % we suggest to name at least one of your databases with the same name
6600 % as the user's thesis master file with extension |.bib|; the |\jobname|
6601 % macro, actually contains the thesis master file name. If neither
6602 % |resources.bib| nor |\jobname.bib| exist or the typesetting engine
6603 % cannot find them, it is the user's responsibility to create a |.bib|
6604 % file and include it in his/her master file preamble as an argument to
6605 % |\addbibresource| or to move an his/her existing |.bib| file(s) to the
6606 % main file folder.
6607 %
6608 % \begin{macrocode}
6609 \unless\ifmybibstyle
6610 \usepackage[autostyle]{csquotes} % necessary for biblatex
6611 \usepackage[backend=biber,
6612 style=numeric-comp,
6613 citestyle=numeric,
6614 sorting=nty,
6615 natbib]{biblatex} % LaTeX specific bibliography handler
6616 \IfFileExists{references.bib}% bibliographic data base(s}
6617 {\addbibresource{references.bib}}%
6618 {\IfFileExists{\jobname.bib}%
6619 {\addbibresource{\jobname.bib}}%
6620 {\relax}}
6621 \fi
6622 % \end{macrocode}
6623 %
6624 % Package |imakeidx| is loaded, but it is up to the user
6625 % to specify command \texttt{\string\makeindex} with its
6626 % options; in the sample template file |toptesi-scudo-example.tex|
6627 % the index is made by configuring \cs{makeindex}
6628 % by specifying only the \textsf{intoc} option, so as to
6629 % have an entry for the index in the table of contents.
6630 % The user who wants to prepare an index for his/her thesis
6631 % is urged to read the |imakeidx| package documentation.
6632 % \begin{macrocode}
6633 \usepackage{imakeidx}% to generate automatic indices
6634 % \end{macrocode}
6635 %
6636 % Eventually while using \pdfLaTeX we require the |indentfirst|
6637 % package so as to indent the first paragraph after a
6638 % sectioning command, according to a common usage in Europe
6639 % and in Italy in particular.
6640 %
6641 % \begin{macrocode}
6642 \ifPDFTeX \usepackage{indentfirst}\fi
6643 \raggedbottom
6644
6645 \AfterEndPreamble{\english}% Set English as default language
6646
6647 % \end{macrocode}
6648 %
6649 % The |toptesi-scudo.sty| module contains also everything is
6650 % needed to typeset the Ph.D. title page and the disclaimer
6651 % page; remember that the \textsf{tipotesi=scudo} option to the
6652 % class sets the default language to English, and inhibits
6653 % loading the |topfront| extension file; therefore a
6654 % complete new set of commands and a complete new title
6655 % page environment are required to fill up the necessary
6656 % information.
6657 %
6658 % We start with the default values for all
6659 % pieces of information. Those macros that contain an empty
6660 % expansion are obviously for mandatory data. Those that
6661 % contain a text string insert default data, that can be
6662 % possibly modified by suitable commands. Those that
6663 % contain just macros insert into the title page the
6664 % expansions of these macros.
6665 % \begin{macrocode}
6666 \TOPfrontfalse
6667
6668 \providecommand*\@Ndissertation{Doctoral Dissertation}
6669 \providecommand*\@Ndoctoralprogram{Doctoral Program in\xspace}
6670 \providecommand*\@programname{}
6671 \providecommand\@Cyclenumber{}
6672 \providecommand*\@title{}
6673 \providecommand*\@subtitle{\vspace{\stretch{1}}}
6674 \providecommand*\@author{}
6675 \providecommand*\@Nsupervisor{Supervisor}
6676 \providecommand*\@Nsupervisors{Supervisors}
6677 \newcount\@supervisornumber
6678 \providecommand*\@supervisorlist{}
6679 \providecommand\@Nexaminationcommittee{Doctoral Examination Committee:}
6680 \providecommand*\@Examinerlist{}
6681 \providecommand*\@examlocation{Politecnico di Torino}
6682 \providecommand*\@examinationdate{}
6683 \providecommand*\@creativecommons{This thesis is licensed
6684 under a Creative Commons License, Attribution - Noncommercial-
6685 NoDerivative Works 4.0 International: see \url{www.creativecommons.org}.
6686 The text may be reproduced for non-commercial purposes, provided that
6687 credit is given to the original author.}
6688 \providecommand\@disclaimer{\noindent I hereby declare that
6689 the contents and organisation of this dissertation constitute
6690 my own original work and does not compromise in any way the
6691 rights of third parties, including those relating to the
6692 security of personal data.}
6693
6694 % \end{macrocode}
6695 % There are the user macros to change or define the
6696 % required data; of course the mandatory data must be
6697 % present in the student's thesis source file; the other
6698 % data may be changed, but don't need to be changed: it
6699 % depends on the university specifications, if any are given.
6700 %
6701 % In any case if the “examiner list” is not specified, so
6702 % that the default list remains empty, no label and no list
6703 % is typeset; therefore leaving this list empty is an easy
6704 % and logical method for completely omitting such a list.
6705 %
6706 % \begin{macrocode}
6707 \newcommand*\Ndissertation[1]{\gdef\@Ndissertation{#1}}
6708 \newcommand*\Ndoctoralprogram[1]{\gdef\@Ndoctoralprogram{#1\xspace}}
6709 \newcommand*\ProgramName[1]{\gdef\@programname{#1\xspace}}
6710 \newcommand*\CycleNumber[1]{\gdef\@Cyclenumber{\ifblank{#1}{}{(#1 cycle)}}}
6711 \renewcommand*\title[1]{\gdef\@title{#1}}
6712 \newcommand*\subtitle[1]{\gdef\@subtitle{\ifblank{#1}{}{\medskip\par
6713 {\Large #1\par}}\vspace{\stretch{1}}}}
6714 \renewcommand*\author[1]{\gdef\@author{#1}}
6715 \newcommand*\NSupervisor[2]
6716 {\gdef\@Nsupervisor{#1}\gdef\@Nsupervisors{#2}}
6717 \newcommand*\SupervisorList[1]{\gdef\@supervisorlist{#1}}
6718 \newcommand\SupervisorNumber[1]{%
6719 \ifblank{#1}{\@supervisornumber=0}{\@supervisornumber=#1}}
6720 \newcommand\Nexaminationcommittee[1]{\gdef\@Nexaminationcommittee{#1}}
6721 \newcommand*\ExaminerList[1]{\gdef\@Examinerlist{#1}}
6722 \newcommand*\Nlocation[1]{\gdef\@examlocation{#1}}
6723 \newcommand*\ExaminationDate[1]{\gdef\@examinationdate{#1}}
6724
6725 \newlength{\TPT@logospace}\TPT@logospace=3em\relax
6726 \newsavebox{\TPT@logobox} \setbox\TPT@logobox\hbox{}
6727 \newdimen\TPT@logoheight
6728 \newcommand*\setlogodistance[1]{\TPT@logospace=#1}
6729 \providecommand*{\@logosede}{}
6730
6731 \ifcsundef{T@Tlogoheight}{%\
6732 \newlength\T@Tlogoheight
6733 \setlength\T@Tlogoheight{0.8\dimexpr(\paperwidth-\textwidth)/2}}{}
6734
6735 \newcommand\PhDschoolLogo[2][\T@Tlogoheight]%
6736 {\def\@logosede{#2}\TPT@logoheight=#1\relax
6737 \ifcsvoid{@logosede}{\sbox{\TPT@logobox}{}}{\begin{lrbox}{\TPT@logobox}%
6738 \expandafter\fillup@TCP@logobox\@logosede,!}}
6739
6740 \def\fillup@TCP@logobox#1,#2!{%
6741 \ifblank{#1}{\end{lrbox}\ifdim\wd\TPT@logobox>\textwidth
6742 \sbox\TPT@logobox{\resizebox{\textwidth}{!}{\box\TPT@logobox}}\fi}%
6743 {\def\@logosede{#2}%
6744 \includegraphics[height=\TPT@logoheight]{#1}\hskip\TPT@logospace
6745 \expandafter\fillup@TCP@logobox\@logosede,!}}
6746
6747 \newcommand\printloghi{\unless\ifvoid\TPT@logobox\usebox{\TPT@logobox}\fi}
6748 % \end{macrocode}
6749 % The author/candidate name by defaukt is underlined by five spaced stars; This is the decoration approved by the ScuDo directors. After all, such a decoration might be a little soberer something else, such as a thin rule, or simply omitted; this is possible by redefining the following macro:
6750 % \begin{macrocode}
6751 \newcommand\fivestars{* * * * *}
6752 % \end{macrocode}
6753 %
6754 % Next the disclaimer and the signature macros are defined;
6755 % the disclaimer text and the signature layout may be changed
6756 % by these commands; but if the user does not use these
6757 % macros, the name of the person who undersigns the disclaimer
6758 % text is assumed to be the thesis author and the signature
6759 % date is assumed to equal the examination date.
6760 % The \cs{Signature} macro is intended to modify the signature layout
6761 % contained in the internal macro \cs{@signature}; the PhD student
6762 % can layout the signature part of the copyright page the way s/he
6763 % likes best; the default definition of \cs{@signature} is an example
6764 % from which the student can get a general idea of what is compulsory
6765 % in this field. The sample file \texttt{toptesi-scudo-example.tex}
6766 % contains also an example of modified signature.
6767 %
6768 % Remember: the disclaimer text is very important, in the
6769 % sense that the student writing his/her Ph.D.\ thesis must
6770 % be completely aware that by undersigning that statement
6771 % s/he assumes any legal liability for any event that
6772 % might betray other people rights. A kind of
6773 % infringement, of course, is plagiarism. Therefore the
6774 % under signer must be completely aware that his/her signature
6775 % is not just a simple bureaucratical action.
6776 % \begin{macrocode}
6777 \newcommand\Disclaimer[1]{\gdef\@disclaimer{#1}}
6778 \newcommand\CClicence[1]{\gdef\@creativecommons{#1}}
6779 \providecommand\@signature{%
6780 \begin{flushright}
6781 \parbox{0.5\textwidth}{\centering
6782 \dotfill\\
6783 \@author\\
6784 Turin, \@examinationdate
6785 }%
6786 \end{flushright}}
6787 \newcommand\Signature[1]{\gdef\@signature{#1}}
6788 % \end{macrocode}
6789 % The |ThesisTitlePage| environment is defined; in the
6790 % opening commands the configuration file is read;
6791 % this file may contain any kind of definition or
6792 % redefinition by using the above commands with suitable
6793 % arguments.
6794 %
6795 % The data possibly read from the configuration file now
6796 % are available, or they may be entered in the body of the
6797 % title page environment |ThesisTitlePage|. If some commands
6798 % are repeated, the last ones, i.e.~those entered in the
6799 % body of the environment, prevail.
6800 % \begin{macrocode}
6801 \newenvironment{ThesisTitlePage}{% Apertura
6802 \InputIfFileExists{\jobname.cfg}{\relax}{\relax}%
6803 }{%Chiusura
6804 \begin{titlepage}\parindent=0pt
6805 {\centering
6806 \raisebox{-1ex}[0pt][0pt]{\makebox[\textwidth]{\printloghi}}\par
6807 \vspace{\baselineskip}
6808 \@Ndissertation\\
6809 \@Ndoctoralprogram \@programname\@Cyclenumber
6810 \bigskip
6811
6812 {\Huge\bfseries \@title\par}
6813 \@subtitle
6814 {\Large\bfseries \@author\par}
6815 \smallskip
6816 \mbox{\fivestars}
6817 \vspace{\stretch{1}}
6818
6819 {\large\bfseries \ifcase\@supervisornumber
6820 \relax\or \@Nsupervisor\else\@Nsupervisors\fi\par}
6821 \@supervisorlist
6822 \par}
6823
6824 \vspace{\stretch{1}}
6825
6826 \ifcsvoid{@Examinerlist}{\relax}{%
6827 \noindent\begin{tabular}{@{}l}
6828 \bfseries \@Nexaminationcommittee\\
6829 \@Examinerlist
6830 \end{tabular}}
6831
6832 \begin{center}
6833 \raisebox{-3\baselineskip}[0pt][0pt]{%
6834 \parbox{0.5\textwidth}{\centering
6835 \@examlocation\\
6836 \@examinationdate}}
6837 \end{center}
6838 \end{titlepage}
6839 %
6840 \newpage\thispagestyle{empty}
6841 \vspace*{\stretch{1}}
6842 \@creativecommons
6843 \vspace{3\baselineskip}
6844
6845 \ifempty{\@keywords}{\relax}{Keywords: \@keywords\par
6846 \vspace{2\baselineskip}}
6847
6848 \@disclaimer
6849 \vspace{3\baselineskip}
6850
6851 \@signature}
6852
6853 % \end{macrocode}
6854 % The above code is almost everything is needed to enter
6855 % the relevant data and to typeset the doctoral thesis
6856 % and the signed disclaimer. But it is wise to enter
6857 % some basic metadata for a reasonably well typeset \sigla{PDF}
6858 % file. Notice that these metadata have nothing to do
6859 % with the metadata required for \sigla{PDF/A} compliance; for
6860 % the latter metadata it is necessary to load the |pdfx|
6861 % package and enter the required metadata in a special
6862 % way that is taken care of by |pdfx|. Read the details in
6863 % the Italian\discretionary{-}{}{-}English documentation
6864 % |toptesi-it.pdf| that is part of the TOPtesi bundle.
6865 % \begin{macrocode}
6866 \providecommand*\subject{}\providecommand*\@subject{}
6867 \renewcommand\subject[1]{\gdef\@subject{#1}}
6868 \providecommand*\keywords{}\providecommand*\@keywords{}
6869 \renewcommand\keywords[1]{\gdef\@keywords{#1}}
6870 \AtBeginDocument{% Set some metadata
6871 \hypersetup{%
6872 pdftitle = {\@title},
6873 pdfauthor = {\@author},
6874 pdfsubject = {\@subject},
6875 pdfkeywords= {\@keywords}
6876 }
6877 }
6878 % \end{macrocode}
6879 %
6880 % The School required also a colophon where it is explained
6881 % how the thesis has been typeset and who are the authors
6882 % of the \LaTeX\ code; my name appears there because the School
6883 % requested it in a formal way; mentioning the TOPtesi bundle
6884 % might have been sufficient for this colophon.
6885 %
6886 % Of course this colophon must be typeset in the last page,
6887 % possibly an even one if the thesis is typeset with the
6888 % |twoside| option in force.
6889 % \begin{macrocode}
6890 \AtEndDocument{%
6891 \clearpage
6892 \ifbool{@twoside}%
6893 {\ifodd\value{page}\thispagestyle{empty}\newpage\fi}{\relax}%
6894 \vspace*{\stretch{1}}%
6895 \noindent
6896 \begin{tabularx}{\textwidth}{Xp{0.45\textwidth}X}
6897 &
6898 This Ph.D.\ thesis has been typeset by means of the \TeX-system
6899 facilities. The typesetting engine was
6900 \ifPDFTeX
6901 \ifcsdef{pdfLaTeX}{\pdfLaTeX}{pdf\/\LaTeX}%
6902 \else
6903 \ifLuaTeX
6904 \ifcsdef{LuaLaTeX}{\LuaLaTeX}{Lua\/\LaTeX}%
6905 \else
6906 \ifcsdef{Xe}{\Xe\LaTeX}{Xe\/\LaTeX}
6907 \fi
6908 \fi.
6909 The document class was \texttt{toptesi}, by Claudio Beccari,
6910 with option \texttt{tipotesi\discretionary{}{=}{=}scudo}.
6911 This class is available in every up-to-date and complete
6912 \TeX-system installation.
6913 &
6914 \end{tabularx}
6915 \vspace*{\stretch{2}}%
6916 }
6917 % \end{macrocode}
6918
6919 %\iffalse
6920 %</topscu>
6921 %\fi
6922 %
6923 % \subsection{A configuration file}
6924 % The following code generates a sample configuration file
6925 % that the user can change at will after changing also its
6926 % name; it can be used as a template for generating a really
6927 % personal configuration file. Remember: this template file
6928 % is named |toptesi.cfg|, but in order to use it for a
6929 % specific thesis, whose main file is named
6930 % |JohnSmithMSthesis.tex|, the configuration file must be
6931 % named |JohnSmithMSthesis.cfg|.
6932 % \iffalse
6933 %<*topcfg>
6934 % \fi
6935 % \begin{macrocode}
6936 %%
6937 %%================================================================
6938 %% Use this file by copying the relevant section to another file
6939 %% to be named as the thesis main file and with extension .cfg.
6940 %% This copied and renamed file is the only file of the TOPtesi
6941 %% bundle that the user can modify without restrictions in order to
6942 %% customise the contents of this configuration file to his/her needs.
6943 %% The user can add or remove lines, comment or uncomment lines,
6944 %% change the arguments to macros, add definitions and so on.
6945 %% This bundle will try to read "\jobname.cfg"; if this file does
6946 %% not exist, the bundle files don't do anything. This implies that
6947 %% the provided file toptesi.cfg is to be used as a model, not to
6948 %% be used directly.
6949 %%================================================================
6950 %%
6951 \ifmagistrale
6952 \ateneo{}%% The PoliTO name is contained in its logo
6953 \facolta{}%% nessun nome di default/ no default name for PoliTO
6954 \FacoltaDi{}%% nessun prefisso per la facolta'/no default faculty
6955 %% label for PoliTO
6956 \CorsoDiLaureaIn{Corso di Laurea in\xspace}%%
6957 \TesiDiLaurea{Tesi di Laurea Magistrale}
6958 \InName{in}
6959 %%\retrofrontespizio{Questo testo e' soggetto alla
6960 %% Creative Commons Licence}
6961 \fi
6962 \ifsecondaria
6963 \relax
6964 \fi
6965 \ifScuDo
6966 \PhDschoolLogo{Logo-Scudo}
6967 \Ndissertation{Docoral Dissertation}
6968 \Ndoctoralprogram{Doctoral Program in\xspace}
6969 \NSupervisor{Supervisor}{Supervisors}
6970 \SupervisorNumber{1}
6971 \Nexaminationcommittee{Doctoral Examination Committee:}
6972 \Nlocation{Politecnico di Torino, Turin, Italy}
6973 \Disclaimer{\noindent I hereby declare that the
6974 contents and organisation of this dissertation
6975 constitute my own original work and does not
6976 compromise in any way the rights of third parties,
6977 including those relating to the security of personal
6978 data.}
6979 \CClicence{This thesis is licensed under a Creative Commons
6980 License, Attribution - Noncommercial- NoDerivative Works 4.0
6981 International: see \url{www.creativecommons.org}.
6982 The text may be reproduced for non-commercial purposes,
6983 provided that credit is given to the original author.}
6984 \fi
6985 % \end{macrocode}
6986 % \iffalse
6987 %</topcfg>
6988 % \fi
6989 %
6990 % \subsection{The \texttt{topcoman.sty} code}
6991 %
6992 % This file may be used as an independent extension package
6993 % for the \texttt{report} document class, and possibly for
6994 % other classes.
6995 % \iffalse
6996 %<*topcmn>
6997 % \fi
6998 %
6999 % The new command |\DeclareSlantedCapitalGreekLetters|
7000 % optionally sets the capital Greek letters in math mode
7001 % with the glyphs taken from the math italic fonts, not
7002 % from the math roman fonts, as it is by default; some
7003 % authors prefer to use both symbols with different
7004 % meanings, so this command lets them do so. This may be
7005 % useful unless the \XeTeX\ or \LuaTeX\ typesetting engine
7006 % is used; in facts the Unicode math defines specific
7007 % commands for setting any Latin or Greek mathematical
7008 % letter in any possible font shape and series.
7009 % Actually with \XeLaTeX\ and \LuaLaTeX\ it is possible to
7010 % invoke the |unicode-math| package with the
7011 % |math style=\sigla{ISO}| option; in this way the \sigla{ISO}
7012 % math typesetting becomes available; this includes the slanted
7013 % Greek letters and many other facilities necessary to fulfil
7014 % the \sigla{ISO} regulations for “physical sciences and
7015 % technology”.
7016 %
7017 % With \pdfLaTeX\ there are available several packages
7018 % and fonts suitable for typesetting math according to
7019 % the \sigla{ISO} regulations. The fonts Libertinus together
7020 % with the math fonts LibertinusT1math are the best
7021 % choice for this task; the |isomath| package can do
7022 % an excellent work with other fonts; a “poor man”
7023 % solution with the \pdfLaTeX\ typesetting program is
7024 % given by the |pm-isomath| package; this latter package
7025 % is, in facts, a poor man approach to the problem, so
7026 % it has several limitations, but it completely avoids
7027 % the problem of loading several other math alphabets,
7028 % therefore avoiding to exhaust the limited number of
7029 % math alphabets \pdfLaTeX\ can handle.
7030 %
7031 % This |topcoman| module offers another “poor man”
7032 % solution only for using by default slanted capital
7033 % Greek letters taken from the math italic font; the
7034 % upright ones are still available within the |\mathrm|
7035 % command argument.
7036 % Warning: \cs{DeclareSlantedCapitalGreekLetters} is defined
7037 % only when using \prog{pdflatex}; with the other two engines
7038 % it is disabled and produces a warning.
7039 % \begin{macrocode}
7040 \RequirePackage{iftex}
7041 \ifPDFTeX
7042 \newcommand*\DeclareSlantedCapitalGreekLetters{%
7043 \mathchardef\Gamma="7100
7044 \mathchardef\Delta="7101
7045 \mathchardef\Theta="7102
7046 \mathchardef\Lambda="7103
7047 \mathchardef\Xi="7104
7048 \mathchardef\Pi="7105
7049 \mathchardef\Sigma="7106
7050 \mathchardef\Upsilon="7107
7051 \mathchardef\Phi="7108
7052 \mathchardef\Psi="7109
7053 \mathchardef\Omega="710A
7054 }\else
7055 \newcommand*\DeclareSlantedCapitalGreekLetters{%
7056 \PackageWarning{toptesi}{%
7057 When using LuaLaTeX or XeLaTeX specify\MessageBreak
7058 option math-style=ISO to package unicode-math\MessageBreak}
7059 }
7060 \fi
7061 % \end{macrocode}
7062 % The |\ensuremath| command is defined in the \LaTeXe\
7063 % kernel from a certain version on; should the user employ
7064 % a really old \LaTeXe\ implementation, this definition
7065 % supplies the missing one. Should the |babel| package
7066 % not be loaded, then we provide the useful command
7067 % |\textormath| provided by |babel|. We define the text
7068 % version of the subscript and ensure also that the
7069 % |textcomp| package is loaded; of course if it is already
7070 % loaded the |\RequirePackage| command performs the
7071 % necessary tests and possibly does not load anything.
7072 % \begin{macrocode}
7073 \providecommand*\ensuremath[1]{\ifmmode#1\else$#1$\fi}%
7074 \providecommand*\textormath{}
7075 \renewcommand*\textormath{\ifmmode\expandafter\@secondoftwo\else
7076 \expandafter\@firstoftwo\fi}
7077 \providecommand*\textsubscript{\raisebox{-0.5ex}}
7078
7079 \ifPDFTeX
7080 \IfPackageLoadedF{textcomp}{\RequirePackage{textcomp}}
7081 \fi
7082 % \end{macrocode}
7083 % The following commands may be already defined; should
7084 % they be missing they are supplied here. Most of them
7085 % are already defined in the Italian option to the
7086 % \texttt{babel} language if the thesis is typeset with
7087 % \textsf{pdflatex} that loads that package; these commands
7088 % are not predefined if the thesis is typeset with \XeLaTeX\
7089 % or \LuaLaTeX\ that often load \pack{polyglossia} instead
7090 % of the \pack{babel} package;
7091 % but remember; this package may be used as a stand alone
7092 % one, without the initial call by the \texttt{toptesi}
7093 % document class, so that the language Italian might be
7094 % undefined. These commands are also defined by the various
7095 % \sigla{ISO} math compliant packages, in particular by |pm-isomath|;
7096 % no problem: if they already defined they don't get redefined.
7097 % \begin{macrocode}
7098 \providecommand{\ohm}{\textormath{\textohm}{\mathrm{\Omega}}}
7099 \@ifpackageloaded{toptesi}{%
7100 \providecommand\ped{}\providecommand\ap{}%
7101 \renewcommand*{\ped}[1]{\textormath{\textsubscript{#1}}{_{\mathrm{#1}}}}%
7102 \renewcommand*{\ap}[1]{\textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}%
7103 \providecommand\diff{}\renewcommand{\diff}{\mathop{}\!\mathrm{d}}
7104 %
7105 }{%
7106 \providecommand*{\ped}[1]{\textormath{\textsubscript{#1}}%
7107 {_{\mathrm{#1}}}}%
7108 \providecommand*{\ap}[1]{\textormath{\textsuperscript{#1}}%
7109 {^{\mathrm{#1}}}}%
7110 }
7111 %
7112 \@ifpackageloaded{siunitx}{%
7113 \def\unit#1{\si{\,#1}}
7114 }{%
7115 \providecommand\unit{}%
7116 \renewcommand\unit[1]{\ensuremath{{\mathrm{\,#1}}}}%
7117 }
7118 \providecommand{\gei}{\ensuremath{\mathop{\mathrm{\mathstrut j}}\nolimits}}
7119 \providecommand{\eu}{\ensuremath{\mathop{\mathrm{e}}\nolimits}}
7120 \providecommand{\micro}{%
7121 \textormath{\textmu}{%
7122 \ifPDFTeX
7123 \ifdefined\muup\muup\else\mbox{\textmu}\fi
7124 \else
7125 \mathup{\mu}%
7126 \fi
7127 }%
7128 }
7129 \providecommand{\gradi}{\textormath{\textdegree}{^\circ}}
7130 % \end{macrocode}
7131 %
7132 % Before this major version 6, this package used to define
7133 % the command |\listing| for listing program sources; those
7134 % definitions became obsolete compared to several packages
7135 % available for this task. For example the package
7136 % |listings|,that is very elegant also for the various configurations
7137 % it can use; un fortunately it works fine only for verbatim
7138 % sources that contain only \textsc{ascii} characters; yes,
7139 % it is possible the definition of special commands to typeset
7140 % isolated characters not belonging to the \textsc{ascii}
7141 % table, but it is an error prone process. Giving up the
7142 % niceties of |listings|, the |fancyvrb| works very well
7143 % with \sigla{UNICODE} and UTF-8 encoded characters.
7144 %
7145 % For backwards compatibility we maintain the command
7146 % |\listing| as a user interface to the |VerbatimInput|
7147 % of package |fancyvrb| with an initial setting of a
7148 % |\small| font size.
7149 % \begin{macrocode}
7150 \RequirePackage{fancyvrb}
7151 \fvset{fontsize=\small}
7152 \let\listing\VerbatimInput
7153 % \end{macrocode}
7154 %
7155 % Of course before using |\listing| the user can set any other
7156 % special configuration s/he desires among those usable with
7157 % package |fancyvrb|; the default set-up shown above is good
7158 % for \LaTeX\ code input, as well as for any programming language,
7159 % whose source lines are shorter than 75--80 characters, depending
7160 % on the normal font size and the document text width; the user
7161 % can edit the source file as well as setting a font
7162 % size smaller than |\small|. In certain circumstances the user
7163 % should accept protruding lines as well as a compromise
7164 % between editing the source file and selecting a smaller
7165 % font size. This is not a bug of the package, nor a fault
7166 % of the algorithm; verbatim typesetting is always problematic.
7167 %
7168 % Let us come to another specific typesetting problem: the
7169 % double role the comma character plays in math mode: a
7170 % decimal separator and a punctuation mark.
7171 %
7172 % Remember that the comma as a decimal separator is
7173 % required for all languages except English. If you
7174 % use this module outside TOPtesi, but as an extension
7175 % to other classes or modules, it's up to you to define
7176 % an “intelligent comma” macro or to load either the
7177 % |icomma.sty| or the |ncccomma.sty| modules that define
7178 % such a macro: the |icomma| package defines the comma
7179 % as a mathematical active character that recognises if the
7180 % subsequent token is a space token so as to insert a
7181 % punctuation comma; |ncccomma| behaves more or less as
7182 % the macro defined in TOPtesi and recognises if the
7183 % following token is a digit so as to use a decimal comma.
7184 %
7185 % This particular package |topcoman| does not define any
7186 % intelligent comma command; therefore it does not do
7187 % anything for other packages; the main |toptesi.sty|
7188 % packages already define a form of intelligent comma,
7189 % therefore |topcomand| does not have to add anything to
7190 % |toptesi|. But if this package is used independently
7191 % from |toptesi|, the user has two choices: either loads
7192 % one of the two packages mentioned above, or, if s/he
7193 % is typesetting in Italian, the |italian| module for
7194 % |babel| already defines the intelligent comma, but its
7195 % definition is disabled by default; the user can turn it
7196 % on and off by using the commands |\IntelligentComma|
7197 % and |\NoIntelligentComma|.
7198 %
7199 % The best solution would be using the |siunitx|
7200 % package; its |\num| command handles any fractional
7201 % decimal number in the proper way and also adds the
7202 % triplet digit separation when they exceed the number
7203 % of four before and/or after the decimal separator. In
7204 % many cases this might be a heavy burden to load a whole
7205 % complex package just for this task, but |siunitx|
7206 % offers many other functionalities, so that it would be
7207 % a good idea if the user loads that excellent package.
7208 %
7209 % The following commands are used to write the
7210 % “lower case” roman numerals with the small-caps font;
7211 % in order to avoid complications with missing fonts
7212 % or with math environments, we make sure to typeset these
7213 % numerals with script size capitals; this solution is
7214 % not probably the best one but it works; it typesets
7215 % these roman numerals with the current font; in TOPtesi
7216 % roman numerals are used only for folios, but in order
7217 % to comply with the |hyperref| module, I avoided using
7218 % this new macro for folios; in other situations there
7219 % are no problems with the choice of font shapes and
7220 % series. We need a robust command in order to set the
7221 % script math size and some attention to turn the operand
7222 % into uppercase letters to be typeset in script size.
7223 % \begin{macrocode}
7224 \DeclareRobustCommand*{\fakeSC}[1]{%
7225 {\dimen@=\f@size\p@\dimen@=0.75\dimen@
7226 \fontsize{\dimen@}{\f@baselineskip}\selectfont
7227 \expandafter{\uppercase{#1}}}}%
7228 \ifPDFTeX\let\simulatedSC\fakeSC\else\let\simulatedSC\textsc\fi
7229 % \end{macrocode}
7230 % For example, the \textsc{Bib\TeX} contains the string ‘ib’
7231 % in lowercase serifed small caps; if one wants to typeset it
7232 % with sans serif fonts, that lack the small caps shape,
7233 % the user could use the code
7234 %\begin{verbatim}
7235 %\textsf{B\simulatedSC{ib}\TeX}
7236 %\end{verbatim}
7237 % in order to get a decent approximation of small caps; this
7238 % poor man solution is not necessary when using OpenType
7239 % fonts that have their facilities to use fake small caps in case
7240 % this shape was missing from the selected font collection.
7241 % This is why the \cs{simulatedSC} macro is defined only if
7242 % |pdfLaTeX| is being used for typesetting.
7243 %
7244 % A user, Antonio Mele, suggested and requested the
7245 % possibility of having the figure and table names
7246 % inserted automatically when the |\ref| command is
7247 % issued. Actually this functionality is provided by
7248 % package |hyperref|, but, in my opinion, it works fine
7249 % in English, not in other languages. I do not think
7250 % the solution reported here solves the problems that
7251 % arise when a document is typeset in Italian. In any
7252 % case the definitions are here; they can be enabled and
7253 % disabled; by default they are disabled.
7254 %
7255 % For single citations the solution works fine,
7256 % but for range references it does not work. In Italian
7257 % the name must be lower case while in other languages,
7258 % specifically in English, the name has a capital initial.
7259 % Since this feature might be handy in certain
7260 % circumstances and annoying in other ones, this feature
7261 % can be turned on and off at will with the enabling
7262 % and disabling commands. As already said, by default the
7263 % feature is disabled.
7264 % \begin{macrocode}
7265 \def\ft@figure{\iflanguage{italian}{\MakeLowercase{\figurename}}%
7266 {\figurename}~}
7267 \def\ft@table{\iflanguage{italian}{\MakeLowercase{\tablename}}%
7268 {\tablename}~}
7269 %
7270 \newcommand*\EnableFigTabNames{%
7271 \let\p@figure\ft@figure\let\p@table\ft@table}
7272 \newcommand*\DisableFigTabNames{%
7273 \let\p@figure\empty\let\p@table\empty}
7274 %
7275 \DisableFigTabNames
7276 % \end{macrocode}
7277 % \iffalse
7278 %</topcmn>
7279 % \fi
7280 %
7281 %\iffalse
7282 %<*topmon>^^A MONOGRAFIA -- TRIENNALE
7283 %\fi
7284 %\subsection{The \texttt{toptesi-monografia} module code}
7285 %
7286 % We start by checking if certain files have ben loaded and in
7287 % case we load then. We check if certain switches are defined,
7288 % and in case we define such switches.
7289 % Notice that by loading this module for bachelor theses the facilities
7290 % for selecting the folio and/or the header text position are not
7291 % available if this module is used with any class different from
7292 % \class{toptesi}; after all this module defines mainly the way
7293 % of typesetting the title page.
7294 % \begin{macrocode}
7295 \monografiatrue
7296 \IfPackageLoadedF{etoolbox}{\RequirePackage{etoolbox}}
7297 \IfPackageLoadedF{xparse}{\RequirePackage{xparse}}
7298 \IfPackageLoadedF{xspace}{\RequirePackage{xspace}}
7299
7300 \ifcsundef{ifclassica}{\newif\ifclassica \classicafalse}{}
7301 \ifcsundef{if@autoretitolo}{\newif\if@utoretitolo \@utoretitolofalse}{}
7302 \ifcsundef{if@ldstyle}{\newif\if@ldstyle \@ldstylefalse}{}
7303 \ifcsundef{if@xivpt}{\newif\if@xivpt \@xivptfalse}{}
7304 \ifcsundef{if@binding}{\newif\if@binding \@bindingfalse}{}
7305
7306 \ifcsundef{ifTOPfront}{\newif\ifTOPfront \TOPfronttrue}{}
7307 \ifcsundef{ifevenboxes}{\newif\ifevenboxes \evenboxesfalse}{}
7308 % \end{macrocode}
7309 % We define the applicable options.
7310 % \begin{macrocode}
7311 \DeclareOption{evenboxes}{\evenboxestrue}
7312 \DeclareOption{cucitura}{\@bindingtrue}
7313 \DeclareOption{classica}{\classicatrue}
7314 \DeclareOption{autoretitolo}{\ifclassica\@utoretitolotrue\fi}
7315 \DeclareOption{oldstyle}{\ifclassica\@ldstyletrue\fi}
7316 \ProcessOptions\relax
7317
7318 % \end{macrocode}
7319 % We define the titling commands\dots
7320 % \begin{macrocode}
7321 \def\monografia#1{\gdef\@titolo{#1}}
7322 \let\titolo\monografia
7323 \let\@stitle\empty
7324 \let\@subtitle\empty
7325 \def\sottotitolo#1{\gdef\@subtitle{#1}}
7326 % \end{macrocode}
7327 % \dots and the other setting or resetting commands to be used
7328 % within the |ThesisTitlePage| environment. Remember that all
7329 % these commands may be used within the configuration file,
7330 % if the user wants to use such file.
7331 % \begin{macrocode}
7332 \providecommand\@materia{}
7333 \def\Materia#1{\gdef\@materia{#1}}
7334 \let\materia\Materia
7335 \providecommand\@nomerelatoresingolare{}
7336 \providecommand\@nomerelatoreplurale{}
7337 \newcommand\NomeRelatore[2]{%
7338 \gdef\@nomerelatoresingolare{#1}\gdef\@nomerelatoreplurale{#2}}
7339 \NomeRelatore{Relatore}{Relatori}
7340 \providecommand\@principaladviser{}
7341 \def\relatore#1{\gdef\@principaladviser{#1}}
7342 \providecommand\@secondadviser{}
7343 \def\secondorelatore#1{\gdef\@secondadviser{#1}}
7344 \providecommand\@thirdadviser{}
7345 \def\terzorelatore#1{\gdef\@thirdadviser{#1}}
7346
7347 \unless\ifcsname iffemminile\endcsname
7348 \newif\iffemminile\femminilefalse
7349 \fi
7350 \unless\ifcsname ifplurale\endcsname
7351 \newif\ifplurale\pluralefalse
7352 \fi
7353 \providecommand\@author{}\providecommand\@@author{}
7354 \NewDocumentCommand\candidato{m o}{\gdef\@@author{#1}%
7355 \IfNoValueTF{#2}{\gdef\@author{#1}}%
7356 {\gdef\@author{#1\IDlabel#2}}
7357 \femminilefalse\pluralefalse}
7358 \NewDocumentCommand\candidata{m o}{\gdef\@@author{#1}%
7359 \IfNoValueTF{#2}{\gdef\@author{#1}}%
7360 {\gdef\@author{#1\IDlabel#2}}
7361 \femminiletrue\pluralefalse}
7362 \providecommand\@secondauthor{}
7363 \NewDocumentCommand\secondocandidato{m o}{%
7364 \IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
7365 {\gdef\@secondauthor{#1\IDlabel#2}}%
7366 \femminilefalse\pluraletrue}
7367 \NewDocumentCommand\secondacandidata{m o}{%
7368 \IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
7369 {\gdef\@secondauthor{#1\IDlabel#2}}%
7370 \pluraletrue}
7371 \providecommand\@thirdauthor{}
7372 \NewDocumentCommand\terzocandidato{m o}{%
7373 \IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
7374 {\gdef\@thirdauthor{#1\IDlabel#2}}%
7375 \femminilefalse\pluraletrue}
7376 \NewDocumentCommand\terzacandidata{m o}{%
7377 \IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
7378 {\gdef\@thirdauthor{#1\IDlabel#2}}%
7379 \pluraletrue}
7380
7381 \providecommand\IDlabel{\\\quad matricola\ }
7382
7383 \edef\@submitdate{{\let\today\relax\unskip\today}}
7384
7385
7386 \def\sedutadilaurea#1{\getseduta#1 !}
7387 \def\getseduta#1 #2!{%
7388 \def\@tempA{#2}%
7389 \ifx\@tempA\empty
7390 \def\@submitdate{#1}%
7391 \else
7392 \unless\ifclassica
7393 \def\@submitdate{#1 #2}%
7394 \else
7395 \s@dutaclassica#1 #2!%
7396 \fi
7397 \fi
7398 }%
7399 \def\s@dutaclassica#1 #2!{%
7400 \if@ldstyle
7401 \s@paranumeri#2-!%
7402 \ifx\2\empty
7403 \edef\@submitdate{\noexpand#1 \noexpand\oldstylenums{#2}}%
7404 \else
7405 \s@paranumeri#2!%
7406 \edef\@submitdate{\noexpand#1
7407 \noexpand\oldstylenums{\1} -- \noexpand\oldstylenums{\2}}%
7408 \fi
7409 \let\1\undefined
7410 \let\2\undefined
7411 \else
7412 \def\@submitdate{#1 #2}%
7413 \fi
7414 }
7415 \def\s@paranumeri#1-#2!{\def\1{#1}\def\2{#2}}%
7416
7417 \newcommand*\NomeAnnoAccademico[1]{\gdef\AnnoAccademico{#1}}
7418 \@ifundefined{AnnoAccademico}{\gdef\AnnoAccademico{Anno accademico}}{}
7419
7420 \newcommand\NomeCorsoDiStudi{Corso di laurea in\xspace}
7421 \providecommand\@ateneo{}
7422 \newcommand\ateneo[1]{\gdef\@ateneo{#1}}
7423 \providecommand\@NomeAteneo{}
7424 \newcommand\NomeAteneo[1]{\gdef\@NomeAteneo{#1}}
7425 \let\nomeateneo\NomeAteneo
7426 % \end{macrocode}
7427 % The following command accepts a first optional argument that
7428 % should contain an ordinal number, in general an uppercase
7429 % roman numeral, that optionally qualifies the “academic
7430 % structure” in charge of the degree course. The user might,
7431 % for example specify something as
7432 % |\struttura[III]{Faculty of Engineering}|, if such kind of
7433 % information is required.
7434 % \begin{macrocode}
7435 \providecommand\@strutturadi{}
7436 \newcommand\StrutturaDi[1]{\gdef\@strutturadi{#1\unskip\xspace}}
7437 \newcommand\struttura[2][]{\gdef\@struttura{\ifempty{#1}{}{#1 }%
7438 \@strutturadi #2}}
7439 \let\FacoltaDi\StrutturaDi \let\facolta\struttura
7440 % \end{macrocode}
7441 % Generally bachelor degree courses are not developed within
7442 % international agreements such as Erasmus, but it may not be
7443 % excluded; therefore several University names and several
7444 % university logos might be necessary. The following is the
7445 % general machinery for lining several logos within a horizontal
7446 % box to be output at the proper moment. Remember, though, that
7447 % if the logos are output in the lower half of the page, the
7448 % top of the title page should contain the university name
7449 % list (if this list does not fit in one line, it is necessary
7450 % to use some tricks described in the Italian documentation
7451 % |toptesi-it.pdf|); but if the logos contain also the name
7452 % of the university, and are printed at the top of the page,
7453 % the university name list becomes unnecessary.
7454 % \begin{macrocode}
7455 \ifcsundef{TPT@logospace}{\newlength{\TPT@logospace}\TPT@logospace=3em}{}
7456 \ifcsundef{TPT@logobox}{\newsavebox{\TPT@logobox}}{}
7457 \ifcsundef{TPT@logoheight}{\newdimen\TPT@logoheight}{}
7458 \providecommand*\setlogodistance[1]{\TPT@logospace=#1}
7459 \providecommand*{\@logosede}{}
7460
7461 \ifcsundef{T@Tlogoheight}{%\
7462 \newlength\T@Tlogoheight
7463 \setlength\T@Tlogoheight{0.8\dimexpr(\paperwidth-\textwidth)/2}}{}
7464
7465 \newcommand\logosede[2][\T@Tlogoheight]%
7466 {\def\@logosede{#2}\TPT@logoheight=#1\relax
7467 \ifcsvoid{@logosede}{\sbox{\TPT@logobox}{}}{\begin{lrbox}{\TPT@logobox}%
7468 \expandafter\fillup@TCP@logobox\@logosede,!}}
7469
7470 \def\fillup@TCP@logobox#1,#2!{%
7471 \ifblank{#1}{\end{lrbox}\ifdim\wd\TPT@logobox>\textwidth
7472 \sbox\TPT@logobox{\resizebox{\textwidth}{!}{\box\TPT@logobox}}\fi}%
7473 {\def\@logosede{#2}%
7474 \includegraphics[height=\TPT@logoheight]{#1}\hskip\TPT@logospace
7475 \expandafter\fillup@TCP@logobox\@logosede,!}}
7476
7477 \providecommand\printloghi{}
7478 \renewcommand\printloghi{%
7479 \unless\ifvoid\TPT@logobox\usebox{\TPT@logobox}\fi}
7480 % \end{macrocode}
7481 % The name of a company tutor may be required if the bachelor
7482 % degree final work is developed within an institution or
7483 % a company external to the university.
7484 % \begin{macrocode}
7485 \providecommand\@tutoreaziendale{}
7486 \def\tutoreaziendale#1{\gdef\@tutoreaziendale{#1}}
7487 \providecommand\@tutoreaziendalename{Supervisore Aziendale}
7488 \def\NomeTutoreAziendale#1{\gdef\@tutoreaziendalename{#1}}
7489 % \end{macrocode}
7490 % The following command sets up the information for a legal or
7491 % copyright page; this information might contain just a simple
7492 % statement that indicates a copyright notice or a licence that
7493 % specifies the clauses for the intellectual property of the
7494 % work. But it might also contain a disclaimer where the only
7495 % author takes his/her responsibility and liability for not
7496 % infringing any applicable law on intellectual property;
7497 % such disclaimer should be dated and undersigned by the (single)
7498 % author. Therefore within this |\retrofrontespizio| command
7499 % two more commands are optionally used: |\luogo| to establish
7500 % the location of the signature, and |\giorno| to establish a
7501 % signature date different from the current date. If the |\giorno|
7502 % is not specified, its value is a meaningless default
7503 % string, and upon testing for such a string, no location,
7504 % date and signature is typeset in the copyright page; if the
7505 % current date should be used, the user should specify
7506 % |\giorno{}|, with a really empty argument.
7507 % \begin{macrocode}
7508 \let\@luogo\empty\def\@giorno{*}
7509 \def\luogo#1{\def\@luogo{#1}}%
7510 \def\giorno#1{\def\@giorno{#1}}
7511 \let\@retrofrontespizio\empty
7512 \newcommand\retrofrontespizio[1]{%
7513 \long\gdef\@retrofrontespizio{#1}}
7514 % \end{macrocode}
7515 % We restart with the definition of other data setting commands.
7516 % \begin{macrocode}
7517 \providecommand\@corsodistudi{}
7518 \newcommand\corsodistudi[1]{\gdef\@corsodistudi{#1}}
7519 \let\corsodilaurea\corsodistudi
7520 \providecommand\@monografia{Monografia}
7521 \newcommand\NomeElaborato[1]{\gdef\@monografia{#1}}
7522 \let\NomeMonografia\NomeElaborato
7523 \def\@nomecandidato{\ifclassica Laureando\else Candidato\fi}
7524 \def\@nomecandidata{\ifclassica Laureanda\else Candidata\fi}
7525 \def\@nomecandidati{\ifclassica Laureandi\else Candidati\fi}
7526 \def\@nomecandidate{\ifclassica Laureande\else Candidate\fi}
7527 % \end{macrocode}
7528 % The label for the candidate list requires a list of comma
7529 % separated names, to a maximum of four names; in order they
7530 % should be the singular masculine, the plural masculine, the
7531 % singular feminine, and the plural feminine names. No one is
7532 % mandatory, and the list may be completely empty if the label
7533 % should remain blank. The list is scanned and the names are
7534 % assigned to some internal variables that will be used according
7535 % the the gender and the number of candidates. If the list is void,
7536 % no name is going to be used at all, and the candidates list is
7537 % typeset as a centred one without any label.
7538 %
7539 % In this way, these settings are all valid:
7540 %\begin{ttsintassi}
7541 %\cs{TitoloListaCandidati}\Marg{}
7542 %\cs{TitoloListaCandidati}\Marg{Estudiante,Estudiantes}
7543 %\cs{TitoloListaCandidati}\Marg{ExamenKandidat,ExamenKandidaten,\%
7544 %\qquad ExamenKandidatin,ExamenKandidatinen}
7545 %\end{ttsintassi}
7546 % This command, as it may be seen, may be used also to set the
7547 % name list in languages different from Italian.
7548 % It goes without saying that if the user typesets the thesis in a
7549 % language where names are gender indifferent (as English,
7550 % Spanish, and other ones) s/he has two choices: ether s/he
7551 % uses the command with just two arguments, as shown above,
7552 % and uses only the masculine commands |\candidato|,
7553 % |\secondocandidato|, and |\terzocoandidato| even with names
7554 % of student women, or s/he specifies the same names in the
7555 % arguments~3 and~4, as in arguments ~1 and~2. Lacking this
7556 % action, the corresponding titling names are blank.
7557 % \begin{macrocode}
7558 \newcommand\TitoloListaCandidati[1]{\CandidateNames#1,,,,!}
7559 \def\CandidateNames#1,#2,#3,#4,!{%
7560 \gdef\@nomecandidato{#1}% Masc/neutr-sing
7561 \gdef\@nomecandidati{#2}% Masc/neutr-plur
7562 \gdef\@nomecandidata{#3}% Fem-sing
7563 \gdef\@nomecandidate{#4}% Fem-plur
7564 }
7565 \providecommand\Relatore{Relatore}
7566 \newcommand\AdvisorName[1]{\gdef\Relatore{#1}}
7567 \providecommand\Correlatore{Correlatore}
7568 \providecommand\Correlatori{Correlatori}
7569 \newcommand\CoAdvisorName[2]{\gdef\Correlatore{#1}%
7570 \gdef\Correlatori{#2}}
7571 % \end{macrocode}
7572 % A new boolean is defined in order to have a suitable switch to set
7573 % the logo(s) “string” at the top or in the second half of the page.
7574 % \begin{macrocode}
7575 \ifcsundef{iftopTPTlogos}{\newbool{topTPTlogos}%
7576 \booltrue{topTPTlogos}}{}
7577 % \end{macrocode}
7578 % We eventually define the whole construction of the title
7579 % page with this new command defined by means of the |xparse|
7580 % package facilities. This environment accepts an optional
7581 % asterisk; its presence means that the logo(s) string should
7582 % be typeset in the lower half of the title page; differently
7583 % from the \LaTeX\ kernel environments that accepts an optional
7584 % asterisk that becomes part of the environment name, and must
7585 % be repeated in the closing environment statement, with the
7586 % |xparse| facilities the asterisk is just an argument among the
7587 % argument list of the opening command: therefore the source
7588 % file contains an opening statement of the form
7589 % |\begin{environment}*|, not |\begin{environment*}|. The user
7590 % should remember this peculiar way of specifying certain
7591 % optional arguments, in particular the optional “star” one.
7592 %
7593 % Another important difference is that environments defined
7594 % with the |xparse| facilities may receive optional and
7595 % mandatory arguments of many kinds in the opening command,
7596 % but differently form the standard \LaTeX\ kernel environments
7597 % such arguments are available not only in the opening commands,
7598 % but also in the closing ones. We actually don't use this
7599 % property during the definition of the |ThesisTitlePage|
7600 % environment, but we preferred to use the previously defined
7601 % switch.
7602 % \begin{macrocode}
7603 \NewDocumentEnvironment{ThesisTitlePage}{s}
7604 {% OPENING
7605 \IfBooleanTF{#1}{\boolfalse{topTPTlogos}}{\booltrue{topTPTlogos}}%
7606 \begin{titlepage}
7607 \oddsidemargin=\dimexpr(\oddsidemargin+\evensidemargin)/2\relax
7608 \evensidemargin \oddsidemargin
7609 \IfFileExists{\jobname.cfg}{\input{\jobname.cfg}%
7610 }{%C
7611 \PackageWarning{monografia}{No configuration file found}%
7612 }%C
7613 }{% CLOSING
7614 \ifbool{topTPTlogos}{\noindent\raisebox{-0.5em}[\z@][\z@]%
7615 {\makebox[\textwidth]{\printloghi}}\par\bigskip}{}
7616 \ifdefempty{\ateneo}{}{{\centering\huge \@ateneo\par}}
7617 \ifdefempty{\@NomeAteneo}{}{\medskip{\centering\large
7618 \expandafter\MakeUppercase\expandafter{\@NomeAteneo}\par}}
7619 \ifdefempty{\@strutturadi}{}{\vspace{\stretch{0.1}}\par{\centering
7620 \Large\@struttura\par}}
7621 \ifdefempty{\@corsodistudi}{}{\bigskip{\centering\large
7622 \NomeCorsoDiStudi\ \@corsodistudi\par}}
7623 \ifdefempty{\@materia}{}{\medskip{\centering\large\@materia\par}}
7624 \vspace{\stretch{0.25}}
7625 {\centering\large \@monografia\par}
7626 \vspace{\stretch{0.1}}
7627 {\centering\LARGE\bfseries \@titolo\par}
7628 \ifdefempty{\@subtitle}{\vspace{\stretch{0.3}}}{\bigskip
7629 {\centering\large\@subtitle\par}}
7630 \ifbool{topTPTlogos}{}{\vspace{3em}\par\centering\printloghi\par}
7631 \vspace{\stretch{0.25}}
7632
7633 \ifdefempty{\@principaladviser}{\def\BoxRelatori{}}{%
7634 \def\BoxRelatori{%
7635 \begin{tabular}[t]{l}%
7636 \hbox{\unless\ifclassica\large\fi
7637 \ifdefempty{\@secondadviser}%
7638 {\let\@nomerelatore\@nomerelatoresingolare}%
7639 {\let\@nomerelatore\@nomerelatoreplurale}%
7640 \textbf{\@nomerelatore}}\\[.6ex]
7641 \hbox{\large\textrm{\protect\@principaladviser}}%
7642 \ifdefempty{\@secondadviser}{}{%
7643 \ifclassica
7644 \ifdefempty{\@thirdadviser}{%
7645 \ifdefempty{\@secondadviser}{}{%
7646 \\[1.5ex]\textbf{\Correlatore:}%
7647 }
7648 }{%
7649 \\[1.5ex]\textbf{\Correlatori:}%
7650 }
7651 \fi
7652 \\[.6ex]
7653 \hbox{{\large\textrm{\protect\@secondadviser}}}%
7654 }
7655 \ifdefempty{\@thirdadviser}{}{%
7656 \\[.6ex]
7657 \hbox{{\large\textrm{\protect\@thirdadviser}}}%
7658 }
7659 \end{tabular}%
7660 }%
7661 }
7662 %
7663 \def\print@secondocandidato{\\\relax
7664 \hbox{\large\tabular{@{}l@{}}\@secondauthor\endtabular}}%
7665 \def\print@terzocandidato{\\\relax
7666 \hbox{\large\tabular{@{}l@{}}\@thirdauthor\endtabular}}%
7667
7668 \def\BoxCandidati{%
7669 \begin{tabular}[t]{l}
7670 \hbox{\unless\ifclassica\large\fi
7671 \textbf{\ifplurale
7672 \iffemminile\@nomecandidate\else\@nomecandidati\fi
7673 \else
7674 \iffemminile\@nomecandidata\else\@nomecandidato\fi
7675 \fi}}\\[.6ex]
7676 \hbox{\large\tabular{@{}l@{}}\@author\endtabular}%
7677 \ifcsvoid{@secondauthor}{}{\print@secondocandidato}%
7678 \ifcsvoid{@thirdauthor}{}{\print@terzocandidato}%
7679 \end{tabular}%
7680 }%
7681 \unless\ifclassica
7682 \ifdefempty{\BoxRelatori}{%Bachelor degree without supervisors
7683 \noindent\makebox[\textwidth]{\tabular[t]{@{}c@{}}
7684 \unless\ifclassica\large\fi
7685 \textbf{\ifplurale
7686 \iffemminile\@nomecandidate\else\@nomecandidati\fi
7687 \else
7688 \iffemminile\@nomecandidata\else\@nomecandidato\fi
7689 \fi}\\[.6ex]
7690 \@author
7691 \ifcsvoid{@secondauthor}{}{\\ \@secondauthor}
7692 \ifcsvoid{@thirdauthor}{}{\\ \@thirdauthor}
7693 \endtabular}%
7694 }{%
7695 \unless\ifevenboxes
7696 \begin{flushleft}%
7697 \BoxRelatori
7698 \end{flushleft}\par
7699 \vspace*{-1.5\baselineskip}
7700 \begin{flushright}%
7701 \BoxCandidati
7702 \end{flushright}%
7703 \else
7704 \noindent
7705 \makebox[\textwidth]{\BoxRelatori\hfill\BoxCandidati}%
7706 \fi}
7707 \else
7708 \noindent
7709 \makebox[\textwidth]{\BoxRelatori\hfill\BoxCandidati}%
7710 \fi
7711 \par\vspace*{\stretch{0.5}}
7712 \ifdefempty{\@tutoreaziendale}{\relax}{\begin{center}
7713 \textbf{\@tutoreaziendalename}\\[0.6ex]
7714 \@tutoreaziendale
7715 \end{center}}
7716 \noindent\raisebox{-\baselineskip}[0pt][0pt]{%
7717 \makebox[\textwidth]{\@submitdate}}%
7718 \end{titlepage}\newpage
7719 % Legal/Copyright page
7720 \ifdefempty{\@retrofrontespizio}{}{\thispagestyle{empty}%
7721 \vspace*{\stretch{1}}\par
7722 \@retrofrontespizio\par
7723 \ifdefstring{\@giorno}{*}{}{\medskip
7724 \noindent
7725 \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lc@{}}
7726 \ifdefempty{\@luogo}{}{\@luogo, }%
7727 \ifdefempty{\@giorno}{\today}{\@giorno}
7728 & \@@author\\[3ex]
7729 & \makebox[0.5\textwidth]{\dotfill}
7730 \end{tabular*}\par}
7731 \newpage}
7732 }
7733 % \end{macrocode}
7734 %
7735 % This is the end of this module code.
7736 %\iffalse
7737 %</topmon>
7738 %\fi
7739 %
7740 %\iffalse
7741 %<*topmag>^^A MAGISTRALE
7742 %\fi
7743 % \subsection{The \texttt{toptesi-magistrale} module code}
7744
7745 % Here we document the code for the \opz{magistrale} option.
7746 % It is a little more complicated than the code for other
7747 % thesis types, because the title page may be typeset in
7748 % different modes, especially for theses in the humanities
7749 % domain where they might be typeset in more than one volume
7750 % (tome).
7751 %
7752 % We start by providing the necessary commands, without
7753 % duplicating those provided by the calling package |toptesi|.
7754 % Nevertheless this module may be used as a standalone one,
7755 % i.e.\ a package loaded by a different class; may be not
7756 % always and not with any class, but the idea is this one.
7757 % In facts if this module does not receive the suitable
7758 % settings from package |toptesi|,it is possible to call it
7759 % with the suitable options as explained below.
7760 % In any case if the module is loaded by a class different
7761 % from \class{toptesi} the facilities for chosing the folio
7762 % and/or the header text positions are not available.
7763 % \begin{macrocode}
7764 \IfPackageLoadedF{etoolbox}{\RequirePackage{etoolbox}}
7765 \IfPackageLoadedF{xspace}{\RequirePackage{xspace}}
7766 \IfPackageLoadedF{xparse}{\RequirePackage{xparse}}
7767 \ifcsundef{ifclassica}{\newif\ifclassica \classicafalse}{}
7768 \ifcsundef{if@utoretitolo}{\newif\if@utoretitolo\@utoretitolofalse}{}
7769 \ifcsundef{if@ldstyle}{\newif\if@ldstyle\@ldstylefalse}{}
7770 \ifcsundef{if@xivpt}{\newif\if@xivpt \@xivptfalse}{}
7771 \ifcsundef{if@binding}{\newif\if@binding\@bindingfalse}{}
7772 \ifcsundef{ifScuDo}{\newif\ifScuDo \ScuDofalse}{}
7773 \ifcsundef{ifmonografia}{\newif\ifmonografia\monografiafalse}{}
7774 \ifcsundef{iftriennale}{\newif\iftriennale\triennalefalse}{}
7775 \ifcsundef{ifmagistrale}{\newif\ifmagistrale\magistralefalse}{}
7776 \ifcsundef{ifdottorale}{\newif\ifdottorale\dottoralefalse}{}
7777 \ifcsundef{ifsecondaria}{\newif\ifsecondaria\secondariafalse}{}
7778 \ifcsundef{ifplurale}{\newif\ifplurale\pluralefalse}{}
7779 \ifcsundef{iffemminile}{\newif\iffemminile\femminilefalse}{}
7780
7781 \magistraletrue
7782
7783 \ifcsundef{ifTOPfront}{\newif\ifTOPfront \TOPfrontfalse
7784 \newif\ifevenboxes \evenboxesfalse}{}
7785
7786 % \end{macrocode}
7787 % We provide for the counter |tomo| and for a new definition of
7788 % the command |\tomo|; this new definition does not trigger
7789 % the production of a title page as it does with the definition
7790 % of package |topfront.sty|; it accepts an optional argument,
7791 % the tome (arabic) number (that shall be transformed into a
7792 % capital roman one while typesetting the title page); if this
7793 % number is not specified the counter value is stepped up
7794 % with the |\refstepconter| macro that renders it accessible
7795 % to the |\label| command; otherwise a value equal to the
7796 % given number minus one is loaded and afterwards “refstepped”
7797 % up in the same way.
7798 %
7799 % Since \LaTeX\ counter settings are global, the value kept
7800 % in the counter remains available anyhow; therefore it is
7801 % not excluded that multiple tomes might be typeset in one
7802 % output \sigla{PDF} file to be split in separate files as described
7803 % in section~\ref{sec:topmagistrale}.
7804 % \begin{macrocode}
7805 \ifcsundef{c@tomo}{\newcounter{tomo}{\setcounter{tomo}{0}}}{}
7806 \providecommand\tomo{}
7807 \ifcsundef{tomo}{\renewcommand\tomo[1][]{%
7808 \ifstrequal{#1}{}{}{\setcounter{tomo}{\numexpr#1-1}}%
7809 \refstepcounter{tomo}}}{}
7810 % \end{macrocode}
7811 %
7812 % We define the options that set the same switches as those set
7813 % by the class. If another class different from |toptesi| is used,
7814 % it is possible that \opz{14pt} produces errors or does not
7815 % produce the desired setting of the normal size to 14pt.
7816 % \begin{macrocode}
7817 \DeclareOption{evenboxes}{\evenboxestrue}
7818 \DeclareOption{cucitura}{\@bindingtrue}
7819 \DeclareOption{14pt}{\@xivpttrue}
7820 \DeclareOption{classica}{\classicatrue}
7821 \DeclareOption{autoretitolo}{\ifclassica\@utoretitolotrue\fi}
7822 \DeclareOption{oldstyle}{\ifclassica\@ldstyletrue\fi}
7823 \ProcessOptions*\relax
7824 % \end{macrocode}
7825 %
7826 % We define two different page styles to be used normally
7827 % or when the |classica| option is in force. Both redefine
7828 % the text grid to be more or less centred on the physical
7829 % page; since it is the first page, no binding correction
7830 % is taken care of, because the first page does
7831 % not suffer from the curvature and thickness of the bound
7832 % thesis. The headings and footers in both cases are already
7833 % filled up with suitable title page data, therefore their
7834 % space is used instead of being “wasted”.
7835 % \begin{macrocode}
7836 \def\headstrut{\vrule \@depth4\p@ \@height\z@ \@width\z@}
7837 \def\ps@titlepage{\let\@mkboth\@gobbletwo
7838 \def\@oddfoot{\vbox to 0.05\paperheight{\vss
7839 \hbox to\hsize{\hfil{\Large{\@submitdate}}\hfil}}}%
7840 \let\@evenfoot\@oddfoot
7841 \def\@oddhead{%
7842 \vbox to\headheight{\vss\iftopTPTlogos
7843 \hbox to\textwidth{%
7844 \headstrut\hfil
7845 \raisebox{3\baselineskip}{\usebox\TPT@logobox}\hfil\null%
7846 }\fi
7847 \ifcsvoid{@ateneo}{}{\vskip\smallskipamount
7848 \hbox to\textwidth{\hss\LARGE\MakeUppercase{\@ateneo}\hss}}
7849 \vss
7850 }%
7851 }%
7852 \let\@evenhead\@oddhead
7853 \def\chaptermark##1{}\def\sectionmark##1{}%
7854 }
7855
7856 \def\ps@classica{\let\@mkboth\markboth
7857 \def\@oddhead{\vbox{%
7858 \setbox256=\hbox{\LARGE\MakeUppercase{\@ateneo}}
7859 \unless\ifdim\wd256<\textwidth
7860 \setbox256=\hbox{\resizebox{\textwidth}{!}{\box256}}%
7861 \fi
7862 \hbox to \hsize{\hss\box256\hss}%
7863 \ifclassica
7864 \hbox to \hsize{\hfil\vrule\@width\z@
7865 \@height2ex\vrule\@height1.4\p@\@depth-\p@\@width50mm\hfil}%
7866 \fi
7867 }}%
7868 \def\@oddfoot{\vbox to \dimexpr\paperheight/20\relax{\vss
7869 \ifclassica
7870 \hbox to \hsize{\hfil\raisebox{-.3ex}[\z@][\z@]{%
7871 \vrule\@height-2.6\p@\@depth3\p@\@width
7872 \dimexpr\textwidth/3}\hfil}%
7873 \fi
7874 \hbox to\hsize{\hfill{\Large{\@submitdate}}\hfill}}%
7875 }%
7876 \let\@evenhead\@oddhead
7877 \let\@evenfoot\@oddfoot
7878 }%
7879 % \end{macrocode}
7880 %
7881 % Some redefinitions to handle both the heading label of
7882 % the authors block and the proper gender of such names.
7883 % \begin{macrocode}
7884 \newif\iffemminile
7885
7886 \def\Candidato{\ifclassica Laureando\else Candidato\fi}
7887 \def\Candidata{\ifclassica Laureanda\else Candidata\fi}
7888 \def\Candidati{\ifclassica Laureandi\else Candidati\fi}
7889 \def\Candidate{\ifclassica Laureande\else Candidate\fi}
7890 \newcommand\TitoloListaCandidati[1]{\CandidateNames#1,,,,!}
7891 \def\CandidateNames#1,#2,#3,#4,!{%
7892 \gdef\Candidato{#1}% Masc/neutr-sing
7893 \gdef\Candidati{#2}% Masc/neutr-plur
7894 \gdef\Candidata{#3}% Fem-sing
7895 \gdef\Candidate{#4}% Fem-plur
7896 }
7897
7898 % \end{macrocode}
7899 %
7900 % We prepare the |titolo| command. Such command accepts
7901 % a \emph{short title} string, no more, no less than the \LaTeX\
7902 % sectioning commands. It is always advisable to use short
7903 % titles; nevertheless when the |classica| |autoretitolo|
7904 % option is in force, long titles don't fit into the page
7905 % headings, therefore an alternative short title is desirable.
7906 % Long titles may be also shortened by transferring part of
7907 % their information to a subtitle; but this must be an
7908 % author's decision, it cannot be automated. Therefore
7909 % a |\sottotitolo| command is also provided.
7910 % \begin{macrocode}
7911 \let\@stitle\empty % default short title string
7912
7913 \providecommand\titolo{}
7914 \RenewDocumentCommand{\titolo}{O{#2} m}{%
7915 \gdef\@stitle{#1}\gdef\@titolo{#2}%
7916 }%
7917 \def\sottotitolo#1{\gdef\@subtitle{#1}}
7918
7919 % \end{macrocode}
7920 %
7921 % The defining commands for both the preset fixed strings
7922 % and the variable data strings are defined; somewhere
7923 % these strings receive also the preset values; some of the
7924 % following strings are used to modify such preset values,
7925 % very useful to localise these strings for a particular language.
7926 % \begin{macrocode}
7927 \let\@materia\empty
7928 \def\Materia#1{\def\@materia{#1}}\let\materia\Materia
7929 \def\relatore#1{\gdef\@principaladviser{#1}}
7930 \def\secondorelatore#1{\gdef\@secondadviser{#1}}
7931 \def\terzorelatore#1{\gdef\@thirdadviser{#1}}
7932 \def\sedutadilaurea#1{\getseduta#1 !}
7933 \def\getseduta#1 #2!{%
7934 \ifstrequal{#2}{}%
7935 {\def\@submitdate{#1}}%
7936 {\unless\ifclassica
7937 \def\@submitdate{#1 #2}%
7938 \else
7939 \s@dutaclassica#1 #2!%
7940 \fi}
7941 }%
7942 \def\s@dutaclassica#1 #2!{%
7943 \if@ldstyle
7944 \s@paranumeri#2-!%
7945 \ifx\2\empty
7946 \edef\@submitdate{\noexpand#1 \noexpand\oldstylenums{#2}}%
7947 \else
7948 \s@paranumeri#2!%
7949 \edef\@submitdate{\noexpand#1
7950 \noexpand\oldstylenums{\1} -- \noexpand\oldstylenums{\2}}%
7951 \fi
7952 \let\1\undefined
7953 \let\2\undefined
7954 \else
7955 \def\@submitdate{#1 #2}%
7956 \fi
7957 }
7958 \def\s@paranumeri#1-#2!{\def\1{#1}\def\2{#2}}%
7959
7960 \newcommand*\NomeAnnoAccademico[1]{\gdef\AnnoAccademico{#1}}
7961 \@ifundefined{AnnoAccademico}{\gdef\AnnoAccademico{Anno accademico}}{}
7962 \def\annoaccademico#1{%
7963 \ifclassica
7964 \def\@submitdate{{\large\textsc{\AnnoAccademico}}%
7965 {\Large\s@tanno#1!}}
7966 \else
7967 \PackageWarning{toptesi}{\string\annoaccademico\space
7968 is usable only when the\MessageBreak
7969 `classica' option is in force}%
7970 \def\@submitdate{\AnnoAccademico\ #1 ---
7971 Needs the `classica' option}
7972 \fi}
7973 \def\s@tanno#1-#2!{\oldstylenums{#1}\EnDash\oldstylenums{#2}}
7974
7975 \def\EnDash{{\settowidth{\dimen@}{\large\scshape I}%
7976 \setbox\tw@\hbox{2}\dimen\[email protected]\ht\tw@\advance\dimen\[email protected]\dp\tw@
7977 \dimen4\dimen\tw@\advance\dimen4by.0385ex\relax
7978 \advance\dimen\[email protected]\relax
7979 \makebox[1.5\dimen@]{%
7980 \vrule\@width\dimen@\@height\dimen4\@depth-\dimen\tw@}}}
7981 \def\corsodilaurea#1{\gdef\@corso{#1}}
7982 \def\ateneo#1{\gdef\@ateneo{#1}}
7983 \def\nomeateneo#1{\gdef\@nomeat{\expandafter\uppercase{\expandafter #1}}}
7984 \newcommand\facolta[2][]{\gdef\@facname{#2}\gdef\@facnumber{#1}}
7985 \let\struttura\facolta
7986
7987 % \end{macrocode}
7988 %
7989 % Here we define the necessary commands to fill up a comma
7990 % separated list of logo graphic-file names; we define
7991 % everything up to the |\printlogos| command that provides
7992 % printing a list of images, duly separated by adequate
7993 % space, all scaled to the same height, and, possibly, even
7994 % the whole logo string duly scaled to fit in the title page
7995 % width. The |\logosede| command, that can be used several
7996 % times with different logo file names, accepts an optional
7997 % argument consisting in a dimension; it is used to scale the
7998 % height of the logo image to the desired value, so that the
7999 % whole string of images does not have unusual different
8000 % logo heights. This dimension is preset to 80\% the mean
8001 % width of the page margins, and on the average it is well suited.
8002 % With the standard |toptesi| class printed on A4 paper, such
8003 % height equals about 25\,mm; of course on smaller paper it is
8004 % proportionally smaller; on American sized papers it may be
8005 % a little larger, but in general it is adequate to the page size.
8006 % \begin{macrocode}
8007 \newlength{\TPT@logospace}\TPT@logospace=3em\relax
8008 \newsavebox{\TPT@logobox}
8009 \newdimen\TPT@logoheight
8010 \newcommand*\setlogodistance[1]{\TPT@logospace=#1}
8011 \providecommand*{\@logosede}{}
8012
8013 \ifcsundef{T@Tlogoheight}{%\
8014 \newlength\T@Tlogoheight
8015 \setlength\T@Tlogoheight{0.8\dimexpr(\paperwidth-\textwidth)/2}}{}
8016
8017 \newcommand\logosede[2][\T@Tlogoheight]{\def\@logosede{#2}\TPT@logoheight=#1\relax
8018 \ifcsvoid{@logosede}{\sbox{\TPT@logobox}{}}{\begin{lrbox}{\TPT@logobox}%
8019 \expandafter\fillup@TCP@logobox\@logosede,!}}
8020
8021 \def\fillup@TCP@logobox#1,#2!{%
8022 \ifblank{#1}{\end{lrbox}\ifdim\wd\TPT@logobox>\textwidth
8023 \sbox\TPT@logobox{\resizebox{\textwidth}{!}{\box\TPT@logobox}}\fi}%
8024 {\def\@logosede{#2}%
8025 \includegraphics[height=\TPT@logoheight]{#1}\hskip\TPT@logospace
8026 \expandafter\fillup@TCP@logobox\@logosede,!}}
8027
8028 \newcommand\printloghi{\unless\ifvoid\TPT@logobox\usebox{\TPT@logobox}\fi}
8029 % \end{macrocode}
8030 %
8031 % Still more commands to define the necessary string data.
8032 % For the ID number label the same remarks made in
8033 % section~\ref{sec:topfront} hold true.
8034 % \begin{macrocode}
8035 \def\tutoreaziendale#1{\gdef\@tutoreaziendale{#1}}
8036 \newcommand\retrofrontespizio[1]{\long\gdef\@retrofrontespizio{#1}}
8037 \newcommand\FacoltaDi[1]{\gdef\@faculty{#1}}
8038 \let\StrutturaDidattica\FacoltaDi
8039 \newcommand\CorsoDiLaureaIn[1]{\gdef\@laureaname{#1}}
8040 \newcommand\TesiDiLaurea[1]{\gdef\@TesiDiLaurea{#1}}
8041 \newcommand\InName[1]{\gdef\@InName{#1}}
8042 \newcommand\CandidateName[1]{\gdef\@nomecandidato{#1}}
8043 \newcommand\AdvisorName[1]{\gdef\Relatore{#1}\gdef\Relatori{#1}}
8044 \newcommand\CoAdvisorName[1]{\gdef\Correlatore{#1}\gdef\Correlatori{#1}}
8045 \newcommand\TutorName[1]{\gdef\Tutore{#1}}
8046 \newcommand\NomeTutoreAziendale[1]{\gdef\@tutoreaziendalename{#1}}
8047 \newcommand\NomePrimoTomo[1]{\gdef\PrimoTomo{#1}}
8048 \newcommand\NomeSecondoTomo[1]{\gdef\SecondoTomo{#1}}
8049 \newcommand\NomeTerzoTomo[1]{\gdef\TerzoTomo{#1}}
8050 \newcommand\NomeQuartoTomo[1]{\gdef\QuartoTomo{#1}}
8051 \newcommand\IDlabel{\\\quad matricola:\xspace}
8052 \IfFileExists{\jobname.cfg}{\input{\jobname.cfg}}%
8053 {\IfFileExists{toptesi.cfg}{\input{toptesi.cfg}}{}}
8054 % \end{macrocode}
8055 %
8056 % Here we define the preset strings; most of them are empty
8057 % strings, but some are real words; the setting commands
8058 % listed before can easily be used to localise such strings
8059 % in different languages.
8060 % \begin{macrocode}
8061 \@ifundefined{@titolo}{\def\@titolo{}}{}
8062
8063 \providecommand\@author{}\providecommand\@@author{}
8064 \NewDocumentCommand\candidato{m o}{\gdef\@@author{#1}%
8065 \IfNoValueTF{#2}{\gdef\@author{#1}}%
8066 {\gdef\@author{#1\IDlabel#2}}
8067 \femminilefalse\pluralefalse}
8068 \NewDocumentCommand\candidata{m o}{\gdef\@@author{#1}%
8069 \IfNoValueTF{#2}{\gdef\@author{#1}}%
8070 {\gdef\@author{#1\IDlabel#2}}
8071 \femminiletrue\pluralefalse}
8072 \providecommand\@secondauthor{}
8073 \NewDocumentCommand\secondocandidato{m o}{%
8074 \IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
8075 {\gdef\@secondauthor{#1\IDlabel#2}}%
8076 \femminilefalse\pluraletrue}
8077 \NewDocumentCommand\secondacandidata{m o}{%
8078 \IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
8079 {\gdef\@secondauthor{#1\IDlabel#2}}%
8080 \pluraletrue}
8081 \providecommand\@thirdauthor{}
8082 \NewDocumentCommand\terzocandidato{m o}{%
8083 \IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
8084 {\gdef\@thirdauthor{#1\IDlabel#2}}%
8085 \femminilefalse\pluraletrue}
8086 \NewDocumentCommand\terzacandidata{m o}{%
8087 \IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
8088 {\gdef\@thirdauthor{#1\IDlabel#2}}%
8089 \pluraletrue}
8090 \providecommand\IDlabel{\\\quad matricola\ }
8091 \@ifundefined{@principaladviser}{\def\@principaladviser{}}{}
8092 \@ifundefined{@secondadviser}{\def\@secondadviser{}}{}
8093 \@ifundefined{@thirdadviser}{\def\@thirdadviser{}}{}
8094 \@ifundefined{@tutore}{\def\@tutore{}}{}
8095 \@ifundefined{@nomerelatore}{\def\@nomerelatore{}}{}
8096 \@ifundefined{@nomecandidato}{\def\@nomecandidato{}}{}
8097 \@ifundefined{Candidato}{\def\Candidato{Candidato}}{}
8098 \@ifundefined{Candidata}{\def\Candidata{Candidata}}{}
8099 \@ifundefined{Candidati}{\def\Candidati{Candidati}}{}
8100 \@ifundefined{Candidate}{\def\Candidate{Candidate}}{}
8101 \@ifundefined{Relatore}{\def\Relatore{Relatore}}{}
8102 \@ifundefined{Relatori}{\def\Relatori{Relatori}}{}
8103 \@ifundefined{Correlatore}{\def\Correlatore{Correlatore}}{}
8104 \@ifundefined{Correlatori}{\def\Correlatori{Correlatori}}{}
8105 \@ifundefined{Tutore}{\def\Tutore{Tutore}}{}
8106 \@ifundefined{@tutoreaziendale}{\def\@tutoreaziendale{}}{}
8107 \@ifundefined{@tutoreaziendalename}%
8108 {\def\@tutoreaziendalename{Supervisore Aziendale}}{}
8109 \@ifundefined{@retrofrontespizio}{\def\@retrofrontespizio{}}{}
8110 \@ifundefined{@subtitle}{\def\@subtitle{}}{}
8111 \@ifundefined{@corso}{\def\@corso{}}{}
8112 \@ifundefined{@ateneo}{\def\@ateneo{POLITECNICO DI TORINO}}{}
8113 \@ifundefined{@nomeat}{\def\@nomeat{}}{}% Nome proprio dell'ateneo
8114 \@ifundefined{@facolta}{\def\@facname{}}{}
8115 \@ifundefined{@facnumber}{\def\@facnumber{}}{}
8116 \@ifundefined{@faculty}{\def\@faculty{}}{}
8117 \@ifundefined{PrimoTomo}{\def\PrimoTomo{Tomo primo}}{}
8118 \@ifundefined{SecondoTomo}{\def\SecondoTomo{Tomo secondo}}{}
8119 \@ifundefined{TerzoTomo}{\def\TerzoTomo{Tomo terzo}}{}
8120 \@ifundefined{QuartoTomo}{\def\QuartoTomo{Tomo quarto}}{}
8121 \ifclassica
8122 \def\Candidato{Laureando}
8123 \def\Candidata{Laureanda}
8124 \def\Candidati{Laureandi}
8125 \def\Candidate{Laureande}
8126 \fi
8127 \@ifundefined{@submitdate}{\def\@submitdate{\ifcase\the\month\or%
8128 Gennaio\or Febbraio\or Marzo\or Aprile\or Maggio\or Giugno\or
8129 Luglio\or Agosto\or Settembre\or Ottobre\or Novembre\or Dicembre\fi
8130 \space \the\year}}{}
8131 \@ifundefined{@TesiDiLaurea}{\def\@TesiDiLaurea{Tesi di Laurea}}{}
8132 \@ifundefined{@laureaname}{\def\@laureaname{Corso di Laurea in }}{}
8133 \@ifundefined{@InName}{\def\@InName{in}}{}
8134 \newbool{topTPTlogos} \booltrue{topTPTlogos}
8135 % \end{macrocode}
8136 %
8137 % Here the real differences take place; the environments
8138 % |frontespizio| and |frontespizio*| are still usable, but
8139 % we discourage them. Even the commands |\frontespizio| and
8140 % |\frontespizio*| are still usable but for even more reasons
8141 % we discourage their usage; they remain available for a sort
8142 % of backwards compatibility.
8143 %
8144 % A new environment |ThesisTitlePage| is defined that actually
8145 % resorts to the core command that stands behind the above
8146 % discouraged environments and commands. This new environment
8147 % uses the |xparse| commands to define it; therefore the
8148 % asterisk that differentiates the four old environments and
8149 % commands is not any more part of the environment name, but,
8150 % if used, must be the first token after the environment
8151 % opening statement, and should not be repeated with the
8152 % closing statement; therefore
8153 % \begin{Sintassi}
8154 %\begin{verbatim}
8155 %% Correct usage
8156 %\begin{ThesisTitlePage}*
8157 %...
8158 %\end{ThesisTitlePage}
8159 %\end{verbatim}
8160 % is correct, while
8161 %\begin{verbatim}
8162 %% Wrong usage
8163 %\begin{ThesisTitlePage*}
8164 %...
8165 %\end{ThesisTitlePage*}
8166 %\end{verbatim}
8167 % \end{Sintassi}
8168 % is wrong.
8169 %
8170 % This choice was made because its programming is simpler,
8171 % but also, in view of the end user, it is simpler to use: for
8172 % example, if the user does not use the asterisk for typesetting
8173 % the logos at the top of the page, and in a second time
8174 % s/he decides that the title page should be typeset with
8175 % the logos in the title page lower part, s/he has to add
8176 % just one asterisk to the opening statement avoiding the
8177 % possibility to forget its addition to the closing statement.
8178 % \begin{macrocode}
8179 \newenvironment{frontespizio*}{\boolfalse{topTPTlogos}}{\fr@ntespizio}
8180
8181 \newenvironment{frontespizio}{%
8182 \ifdefstring{\@currenvir}{frontespizio}
8183 {\booltrue{topTPTlogos}}{\TPTmaybestar}
8184 }{%
8185 \fr@ntespizio
8186 }
8187
8188 \DeclareDocumentEnvironment{ThesisTitlePage}{s}{%
8189 \IfBooleanTF{#1}{\boolfalse{topTPTlogos}}{\booltrue{topTPTlogos}}%
8190 \InputIfFileExists{\jobname.cfg}{}{%
8191 \PackageInfo{toptesi-magistrale}{No configuration file found}}
8192 }{\fr@ntespizio}
8193 % \end{macrocode}
8194 %
8195 % The following code is substantially identical to that of the
8196 % |topfront| package; just the statements concerning the
8197 % bachelor degree and the Ph.D.~degree theses have been deleted.
8198 % \begin{macrocode}
8199 \newbool{AteneoInHead}\boolfalse{AteneoInHead}
8200 \newcommand\TPTmaybestar[1]{\def\@tempA{#1}%
8201 \ifdefstring{\@tempA}{*}%
8202 {\boolfalse{topTPTlogos}\booltrue{AteneoInHead}\fr@ntespizio}
8203 {\booltrue{topTPTlogos}\fr@ntespizio\@tempA}
8204 }
8205 \def\fr@ntespizio{%
8206 \begingroup\par
8207 \oddsidemargin=\dimexpr(\oddsidemargin+\evensidemargin)/2\relax
8208 \evensidemargin \oddsidemargin
8209 \null
8210 \setcounter{page}{1}%
8211 \normalfont
8212 \ifclassica
8213 \boolfalse{topTPTlogos}
8214 \thispagestyle{classica}
8215 \ifcsvoid{@ateneo}{\def\@ateneo{Manca il nome dell'ateneo}
8216 }{}
8217 \else
8218 \thispagestyle{titlepage}
8219 \fi
8220 \ifcsvoid{@ateneo}{}{\booltrue{AteneoInHead}}
8221 \ifcsvoid{@ateneo}{%
8222 \ifbool{topTPTlogos}
8223 {}{\booltrue{AteneoInHead}\def\@ateneo{Manca il nome dell'ateneo}}%
8224 }{%
8225 \booltrue{AteneoInHead}%
8226 }
8227
8228 \ifbool{AteneoInHead}{}{%
8229 {{\centering\LARGE \@ateneo\par}}
8230 }
8231 \ifcsvoid{@nomeat}{}
8232 {\ifbool{topTPTlogos}{\vspace*{\dimexpr \headsep+2.5ex}}%
8233 {\vspace*{-3ex}}%
8234 {\centering\@nomeat\par}\vfill}
8235
8236 \begin{center}
8237 {\rmfamily\mdseries
8238 \ifdottorato
8239 \large \@phdschool\par\medskip
8240 \else
8241 \ifcsvoid{@faculty}{}{%
8242 \LARGE\ifx\@facnumber\empty\else\@facnumber\space\fi
8243 \@faculty\unskip\xspace\@facname\par\medskip
8244 }
8245 \fi
8246 }%
8247 \ifcsvoid{@corso}{}{{\large
8248 \ifdottorato
8249 \@PhDname\unskip\xspace
8250 \@corso\ifx\@ciclo\empty\else~--~\@ciclo\fi
8251 \else
8252 \@laureaname\unskip\xspace\@corso
8253 \fi
8254 \par}}
8255 \end{center}
8256 \vspace{\stretch{0.2}}
8257 \begin{center}
8258 \LARGE\@TesiDiLaurea%
8259 \unless\ifx\empty\@materia
8260 \\\@InName\\\@materia
8261 \fi
8262 \end{center}
8263 \vspace{\stretch{0.2}}
8264 \begin{center}
8265 {\huge\bfseries \baselineskip=0.95em plus 1pt
8266 \@titolo \par}
8267 \end{center}
8268 \unless\ifx\@subtitle\empty
8269 \begin{center}%
8270 \large\textrm{\@subtitle}\par
8271 \end{center}%
8272 \fi
8273 \ifclassica
8274 \ifnum\value{tomo}>\z@
8275 \par\bigskip
8276 \noindent\makebox[\textwidth]{%
8277 \large\textbf{%
8278 \ifcase\c@tomo%
8279 \or \PrimoTomo%
8280 \or \SecondoTomo%
8281 \or \TerzoTomo%
8282 \or \QuartoTomo%
8283 \else
8284 \PackageWarning{toptesi}{%
8285 Counter tomo equals \the\c@tomo\MessageBreak
8286 We never considered a thesis might get\MessageeBreak
8287 divided in more than four volumes}%
8288 \fi}}%
8289 \fi
8290 \vspace{1em}
8291 \fi
8292 \par
8293 \unless\iftopTPTlogos
8294 {\vfill\centering \printloghi\par}\fi
8295 \vfill
8296 \iffemminile
8297 \def\@nomecandidato{\Candidata}%
8298 \else
8299 \def\@nomecandidato{\Candidato}%
8300 \fi
8301 \ifcsvoid{@secondauthor}{}{%
8302 \iffemminile
8303 \def\@nomecandidato{\Candidate}%
8304 \else
8305 \def\@nomecandidato{\Candidati}%
8306 \fi}
8307 \unless\iftriennale
8308 \def\BoxRelatori{%
8309
8310 \begin{tabular}[t]{l}%
8311 \ifclassica
8312 \hbox{\textbf{\Relatore}}%
8313 \else
8314 \hbox{\large\bfseries
8315 \ifcsvoid{@secondadviser}{\Relatore}{\Relatori}}
8316 \fi\\[.6ex]
8317 \hbox{\large\textrm{\protect\@principaladviser}}%
8318 \ifx\@secondadviser\empty \else
8319 \ifclassica
8320 \ifx\@thirdadviser\empty
8321 \ifx\@secondadviser\empty\else
8322 \\[1.5ex]\textbf{\Correlatore:}%
8323 \fi
8324 \else
8325 \\[1.5ex]\textbf{\Correlatori:}%
8326 \fi
8327 \fi
8328 \\[.6ex]\hbox{{\large\textrm{\protect\@secondadviser}}}%
8329 \fi
8330 \ifx\@thirdadviser\empty \else
8331 \\[.6ex]
8332 \hbox{{\large\textrm{\protect\@thirdadviser}}}%
8333 \fi
8334 \end{tabular}%
8335 }%
8336 \def\print@secondocandidato{\\\relax
8337 \hbox{\large\tabular{@{}l@{}}%
8338 \@secondauthor\endtabular}}
8339 \def\print@terzocandidato{\\\relax
8340 \hbox{\large\tabular{@{}l@{}}%
8341 \@thirdauthor\endtabular}}
8342 \def\BoxCandidati{%
8343 \begin{tabular}[t]{l}%
8344 \hbox{\unless\ifclassica\large\fi
8345 \textbf{\protect\@nomecandidato}}\\[.6ex]
8346 \hbox{\large\tabular{@{}l@{}}\@author\endtabular}%
8347 \ifcsvoid{@secondauthor}{}{\print@secondocandidato}%
8348 \ifcsvoid{@thirdauthor}{}{\print@terzocandidato}%
8349 \end{tabular}%
8350 }%
8351 \unless\ifdottorato
8352 \unless\ifclassica
8353 \unless\ifevenboxes
8354 \begin{flushleft}%
8355 \BoxRelatori
8356 \end{flushleft}\par\vspace*{-1.5\baselineskip}
8357 \begin{flushright}%
8358 \BoxCandidati
8359 \end{flushright}%
8360 \else
8361 \makebox[\textwidth]{\BoxRelatori\hfill\BoxCandidati}
8362 \fi
8363 \else
8364 \noindent
8365 \makebox[\textwidth]{%
8366 \BoxRelatori\hfill\BoxCandidati}\par
8367 \fi
8368 \fi
8369 \fi
8370 \ifcsvoid{@tutoreaziendale}{}{%
8371 \vfill\vfill
8372 {\centering \textbf{\@tutoreaziendalename}\\[.6ex]
8373 \@tutoreaziendale\par}%
8374 }
8375 \par\clearpage
8376 % \end{macrocode}
8377 %
8378 % It is useful to remind that the copyright page in general is not
8379 % compulsory, but it is becoming frequently requested by more
8380 % and more universities. The user can fill up the
8381 % |\retrofrontespizio| argument with as many paragraphs as are
8382 % necessary by his/her university requirements.
8383 %
8384 % In general there is a statement claiming the intellectual
8385 % property of the thesis contents; very often it makes reference
8386 % to the Creative Commons licence that is internationally well
8387 % known; other international licences may me used. At the same
8388 % time very often a statement is needed where the thesis author
8389 % assumes the necessary liability for any violation of other
8390 % people intellectual property and/or copyright. Plagiarism and
8391 % lack od attribution of other people rights are the most common
8392 % illegal actions done by students writing their theses, and it
8393 % is very important that the student responsibility is underlined
8394 % by asking him/her to fulfil the legal obligations.
8395 % \begin{macrocode}
8396 \ifcsvoid{@retrofrontespizio}{}%
8397 {\null\vfill\thispagestyle{empty}\@retrofrontespizio\par\clearpage}%
8398 \endgroup}
8399 % \end{macrocode}
8400 %\iffalse
8401 %</topmag>
8402 %\fi
8403 %
8404 %
8405 %\iffalse
8406 %<*topdoc>^^A DOTTORALE
8407 %\fi
8408 % \subsection{The \texttt{toptesi-dottorale} module code}
8409 % What follows is mainly a replica of the |topfront| module
8410 % where useless commands have been eliminated; “useless”
8411 % in view of creating a title page for a Ph.D.~thesis.
8412 %
8413 % First we load the necessary packages.
8414 % \begin{macrocode}
8415 \IfPackageLoadedF{etoolbox}{\RequirePackage{etoolbox}}
8416 \IfPackageLoadedF{xspace}{\RequirePackage{xspace}}
8417 \IfPackageLoadedF{xparse}{\RequirePackage{xparse}}
8418 % \end{macrocode}
8419 % Then we define, if they are not already defined, some boolean
8420 % switches related to the possible options. The above packages,
8421 % and the following switches are necessary in case this module
8422 % is used by itself with a different class. The module accepts
8423 % some options, that are declared just after these preliminary
8424 % definitions.
8425 % \begin{macrocode}
8426 \ifcsundef{ifclassica}{\newif\ifclassica \classicafalse}{}
8427 \ifcsundef{if@utoretitolo}{\newif\if@utoretitolo\@utoretitolofalse}{}
8428 \ifcsundef{if@ldstyle}{\newif\if@ldstyle\@ldstylefalse}{}
8429 \ifcsundef{if@xivpt}{\newif\if@xivpt \@xivptfalse}{}
8430 \ifcsundef{if@binding}{\newif\if@binding\@bindingfalse}{}
8431 \ifcsundef{ifdottorale}{\newif\ifdottorale\dottoralefalse}{}
8432 \ifcsundef{ifevenboxes}{\newif\ifevenboxes \evenboxesfalse}{}
8433 % \end{macrocode}
8434 % Using this module implies that some switches used in the
8435 % following commands should be set to false.
8436 % \begin{macrocode}
8437 \ifcsundef{ifTOPfront}{\newif\ifTOPfront \TOPfrontfalse}{}
8438 \ifcsundef{ifT@Pfrontespizio}{\newif\ifT@Pfrontespiziofalse}{}
8439 \ifcsundef{c@tomo}{\newcounter{tomo}\setcounter{tomo}{0}}{}
8440 \newif\iffemminile\newif\ifplurale
8441 \newif\iftriennale\triennalefalse
8442 \newif\ifdottorato \dottoratotrue
8443
8444 % \end{macrocode}
8445 %
8446 % Here are the option declarations and their processing. Notice
8447 % that the |14pt| option implies that the calling class loads
8448 % some package that can set a normal size to 14pt or 14.4pt,
8449 % otherwise this option may produce an error or a warning;
8450 % in the best case it does not do anything. The |toptesi|
8451 % class loads such a suitable package and allows to set any
8452 % integer or fractional size; this package is |scrextend| and
8453 % the user who wants to use a normal size larger than 12pt
8454 % or smaller than 10pt, can resort to that package; possibly
8455 % that is not the only package suited for such acrobatic
8456 % settings, but the important point is to avoid “acrobatics”;
8457 % scientific books, reports, theses, and other such documents
8458 % are supposed to be read by adults, not by children while
8459 % normal sizes from 14pt on are more suited for elementary
8460 % school pupils. On the opposite, normal sizes smaller than
8461 % 10pt are difficult to read and should be avoided for
8462 % documents to be read continuously; it is possible to use
8463 % such small font sizes in footnotes, or in dictionaries,
8464 % but both footnotes and dictionary entries do not generally
8465 % occupy dozens of pages.
8466 % \begin{macrocode}
8467 \DeclareOption{evenboxes}{\evenboxestrue}
8468 \DeclareOption{cucitura}{\@bindingtrue}
8469 \DeclareOption{14pt}{\@xivpttrue}
8470 \DeclareOption{classica}{\classicatrue}
8471 \DeclareOption{autoretitolo}{\ifclassica\@utoretitolotrue\fi}
8472 \DeclareOption{oldstyle}{\ifclassica\@ldstyletrue\fi}
8473 \ProcessOptions*\relax
8474 % \end{macrocode}
8475 %
8476 % We now define two specific page styles, one for “normal”
8477 % title pages, and one for theses typeset with the |classica|
8478 % option in force: they are |\ps@titlepge| and |\ps@classica|.
8479 % \begin{macrocode}
8480 \def\headstrut{\vrule \@depth4\p@ \@height\z@ \@width\z@}
8481 \def\ps@titlepage{\let\@mkboth\@gobbletwo
8482 \def\@oddfoot{\vbox to 0.05\paperheight{\vss
8483 \hbox to\hsize{\hfil{\Large{\@submitdate}}\hfil}}}%
8484 \let\@evenfoot\@oddfoot
8485 \def\@oddhead{%
8486 \vbox to\headheight{\vss\iftopTPTlogos
8487 \hbox to\textwidth{%
8488 \headstrut\hfil
8489 \raisebox{3\baselineskip}{\usebox\TPT@logobox}\hfil\null%
8490 }\fi
8491 \ifcsvoid{@ateneo}{}{\vskip\smallskipamount
8492 \hbox to\textwidth{\hss\LARGE\MakeUppercase{\@ateneo}\hss}}
8493 \vss
8494 }%
8495 }%
8496 \let\@evenhead\@oddhead
8497 \def\chaptermark##1{}\def\sectionmark##1{}%
8498 }
8499
8500 \def\ps@classica{\let\@mkboth\markboth
8501 \def\@oddhead{\vbox{%
8502 \setbox256=\hbox{\LARGE\MakeUppercase{\@ateneo}}
8503 \unless\ifdim\wd256<\textwidth
8504 \setbox256=\hbox{\resizebox{\textwidth}{!}{\box256}}%
8505 \fi
8506 \hbox to \hsize{\hss\box256\hss}%
8507 \ifclassica
8508 \hbox to \hsize{\hfil\vrule\@width\z@
8509 \@height2ex\vrule\@height1.4\p@\@depth-\p@\@width50mm\hfil}%
8510 \fi
8511 }}%
8512 \def\@oddfoot{\vbox to \dimexpr\paperheight/20\relax{\vss
8513 \ifclassica
8514 \hbox to \hsize{\hfil\raisebox{-.3ex}[\z@][\z@]{%
8515 \vrule\@height-2.6\p@\@depth3\p@\@width
8516 \dimexpr\textwidth/3}\hfil}%
8517 \fi
8518 \hbox to\hsize{\hfill{\Large{\@submitdate}}\hfill}}%
8519 }%
8520 \let\@evenhead\@oddhead
8521 \let\@evenfoot\@oddfoot
8522 }%
8523 % \end{macrocode}
8524 %
8525 % We provide also the variant settings for when the |classica|
8526 % option is in force together with the |autoretitolo| one.
8527 % \begin{macrocode}
8528 \if@utoretitolo
8529 \if@twoside
8530 %
8531 \renewcommand*{\ps@headings}{\let\@mkboth\markboth%
8532 \def\@oddfoot{\null \hfill \textbf{\lapagina} \hfill \null}%
8533 \let\@evenfoot\@oddfoot
8534 \def\@evenhead{%
8535 \setbox\@intesta\hbox{\ifPDFTeX\latintext\fi
8536 \footnotesize\strut\textsc{%
8537 \@@author\ifcsvoid{@secondauthor}{\ et al.}: \@stitle}%
8538 }%
8539 \ifdim\wd\@intesta>\textwidth\headwrn{\titolo}\fi
8540 \underline{\makebox[\textwidth]{\box\@intesta}}}%
8541 \def\@oddhead{\ifPDFTeX\latintext\fi
8542 \setbox\@intesta\hbox{%
8543 \footnotesize\strut\textsl{\rightmark}}%
8544 \ifdim\wd\@intesta>\textwidth \headWarn{\section}\fi%
8545 \underline{\makebox[\textwidth]{\box\@intesta}}}%
8546 \def\chaptermark##1{\markright{\thechapter\ -- ##1}}%
8547 \def\sectionmark##1{}}%
8548 \else
8549 \renewcommand*{\ps@headings}{\let\@mkboth\markboth
8550 \def\@oddfoot{\null \hfill \textbf{\lapagina}\hfill \null}%
8551 \let\@evenfoot\empty\let\@evenhead\empty
8552 \def\@oddhead{{\setbox\z@\hbox{\ifPDFTeX\latintext\fi
8553 \footnotesize\textsc{%
8554 \@@author\ifcsvoid{@secondauthor}{}{\ et al.}: \@stitle}}%
8555 \setbox\tw@\hbox{\ifPDFTeX\latintext\fi
8556 \footnotesize\textsl{\rightmark}}%
8557 \dimen@=\dimexpr2em + \wd\z@ + \wd\tw@\relax
8558 \ifdim\dimen@<\textwidth \relax
8559 \else
8560 \setbox\z@\vbox{\hsize.48\textwidth\parindent\z@
8561 \raggedright
8562 \ifPDFTeX\latintext\fi\footnotesize\textsc{%
8563 \@@author\ifcsvoid{@secondauthor}{}{\ et al.}: \@stitle
8564 }}%
8565 \setbox\tw@\vbox{\hsize.48\textwidth\parindent\z@
8566 \raggedleft
8567 \ifPDFTeX\latintext\fi\footnotesize
8568 \textsl{\rightmark}}%
8569 \fi
8570 \setbox\@intesta\vbox to\z@{%
8571 \vss\hbox to\textwidth{\strut\box\z@\hfill\box\tw@}}%
8572 \underline{\box\@intesta}}}%
8573 \def\chaptermark##1{\markright{\thechapter\ -- ##1}}}
8574 \fi
8575 \fi
8576 % \end{macrocode}
8577 % Now we define the title setting commands for both
8578 % title (|\titolo|) and subtitle (|\sottotitolo|) and
8579 % all the other commands for setting the fixed strings.
8580 % \begin{macrocode}
8581 \let\@stitle\empty
8582
8583 \newcommand*{\titolo}[2][]{%
8584 \def\@tempA{#1}\ifdefempty{\@tempA}%
8585 {\gdef\@stitle{#2}}{\gdef\@stitle{#1}}%
8586 \gdef\@titolo{#2}%
8587 }%
8588
8589 \def\sottotitolo#1{\gdef\@subtitle{#1}}
8590 \let\@materia\empty
8591 \def\Materia#1{\def\@materia{#1}}\let\materia\Materia
8592 \newif\ifDirettore \Direttorefalse
8593 \def\tutore#1{\gdef\@tutore{#1}}
8594 \def\direttore{\Direttoretrue\relatore}%
8595 \def\coordinatore{\Direttorefalse\relatore}%
8596 \def\QualificaDirettore#1{\gdef\@PhDdirector{#1}}%
8597 \def\relatore#1{\gdef\@principaladviser{#1}}
8598 \def\secondorelatore#1{\gdef\@secondadviser{#1}}
8599 \def\terzorelatore#1{\gdef\@thirdadviser{#1}}
8600 \def\esamedidottorato#1{\getseduta#1 !}
8601 \def\getseduta#1 #2!{%
8602 \def\@tempA{#2}%
8603 \ifx\@tempA\empty
8604 \def\@submitdate{#1}%
8605 \else
8606 \unless\ifclassica
8607 \def\@submitdate{#1 #2}%
8608 \else
8609 \s@dutaclassica#1 #2!%
8610 \fi
8611 \fi
8612 }%
8613 \def\s@dutaclassica#1 #2!{%
8614 \if@ldstyle
8615 \s@paranumeri#2-!%
8616 \ifx\2\empty
8617 \edef\@submitdate{\noexpand#1 \noexpand\oldstylenums{#2}}%
8618 \else
8619 \s@paranumeri#2!%
8620 \edef\@submitdate{\noexpand#1
8621 \noexpand\oldstylenums{\1} -- \noexpand\oldstylenums{\2}}%
8622 \fi
8623 \let\1\undefined
8624 \let\2\undefined
8625 \else
8626 \def\@submitdate{#1 #2}%
8627 \fi
8628 }
8629 \def\s@paranumeri#1-#2!{\def\1{#1}\def\2{#2}}%
8630
8631 \newcommand*\NomeAnnoAccademico[1]{\gdef\AnnoAccademico{#1}}
8632 \@ifundefined{AnnoAccademico}{\gdef\AnnoAccademico{Anno accademico}}{}
8633 \def\annoaccademico#1{\ifclassica
8634 \def\@submitdate{{\large\textsc{\AnnoAccademico}} {\Large\s@tanno#1!}}
8635 \else
8636 \PackageWarning{toptesi}{\string\annoaccademico\space
8637 is usable only when the\MessageBreak
8638 `classica' option is in force}%
8639 \def\@submitdate{\AnnoAccademico\ #1 --- Needs the `classica' option}
8640 \fi}
8641 \def\s@tanno#1-#2!{\oldstylenums{#1}\EnDash\oldstylenums{#2}}
8642
8643 \def\EnDash{{\settowidth{\dimen@}{\large\scshape I}%
8644 \setbox\tw@\hbox{2}\dimen\[email protected]\ht\tw@\advance\dimen\[email protected]\dp\tw@
8645 \dimen4\dimen\tw@\advance\dimen4by.0385ex\relax
8646 \advance\dimen\[email protected]\relax
8647 \makebox[1.5\dimen@]{%
8648 \vrule\@width\dimen@\@height\dimen4\@depth-\dimen\tw@}}}
8649 \def\ciclodidottorato#1{\gdef\@ciclo{#1 \@cyclename}}%
8650 \def\corsodidottorato#1{\global\dottoratotrue
8651 \global\gdef\@corso{#1}}
8652 \def\scuoladidottorato#1{\global\dottoratotrue
8653 \gdef\@phdschool{#1}}
8654 \def\ateneo#1{\gdef\@ateneo{#1}}
8655 \def\nomeateneo#1{\gdef\@nomeat{\expandafter\uppercase{\expandafter #1}}}
8656 \newcommand\facolta[2][]{\gdef\@facname{#2}\gdef\@facnumber{#1}}
8657 \let\struttura\facolta
8658 % \end{macrocode}
8659 %
8660 % Next we define how to handle one or more logos; even in
8661 % PH.D. schools there might be situations where the Ph.D.~program
8662 % has been carried on in several universities; it might be
8663 % required to set the logos of the universities where the research
8664 % program leading to the Ph.D. has been developed. The user commands
8665 % are |\logosede| and |\printloghi|; the latter does what
8666 % its name suggests, i.e. it prints the string of logos;
8667 % the former command accepts one logo file name, and queues
8668 % it into a logo list; this command may be used multiple times;
8669 % of course if there are several logos, their “string”
8670 % may become larger than the text width, and in this case
8671 % |\printloghi| shrinks the whole string (maintaining the
8672 % aspect ratio) so as to fit it within the measure. If the
8673 % logos are too many and/or they are too wide, this
8674 % shrinking may reduce them too much; there is no work
8675 % around to avoid this problem except refraining from using too
8676 % many and/or too wide logos.
8677 % \begin{macrocode}
8678 \newlength{\TPT@logospace}\TPT@logospace=3em\relax
8679 \newsavebox{\TPT@logobox}
8680 \newdimen\TPT@logoheight
8681 \newcommand*\setlogodistance[1]{\TPT@logospace=#1}
8682 \providecommand*{\@logosede}{}
8683
8684 \ifcsundef{T@Tlogoheight}{%\
8685 \newlength\T@Tlogoheight
8686 \setlength\T@Tlogoheight{0.8\dimexpr(\paperwidth-\textwidth)/2}}{}
8687
8688 \newcommand\logosede[2][\T@Tlogoheight]{\def\@logosede{#2}\TPT@logoheight=#1\relax
8689 \ifcsvoid{@logosede}{\sbox{\TPT@logobox}{}}{\begin{lrbox}{\TPT@logobox}%
8690 \expandafter\fillup@TCP@logobox\@logosede,!}}
8691
8692 \def\fillup@TCP@logobox#1,#2!{%
8693 \ifblank{#1}{\end{lrbox}\ifdim\wd\TPT@logobox>\textwidth
8694 \sbox\TPT@logobox{\resizebox{\textwidth}{!}{\box\TPT@logobox}}\fi}%
8695 {\def\@logosede{#2}%
8696 \includegraphics[height=\TPT@logoheight]{#1}\hskip\TPT@logospace
8697 \expandafter\fillup@TCP@logobox\@logosede,!}}
8698
8699 \newcommand\printloghi{\unless\ifvoid\TPT@logobox\usebox{\TPT@logobox}\fi}
8700 % \end{macrocode}
8701 %
8702 % We keep defining macros to set fixed strings and/or variable data.
8703 % \begin{macrocode}
8704 \def\tutoreaziendale#1{\gdef\@tutoreaziendale{#1}}
8705 \newcommand\retrofrontespizio[1]{\long\gdef\@retrofrontespizio{#1}}
8706 \newcommand\FacoltaDi[1]{\gdef\@faculty{#1}}
8707 \let\StrutturaDidattica\FacoltaDi
8708 \newcommand\DottoratoIn[1]{\gdef\@PhDname{#1}}
8709 \newcommand\CorsoDiLaureaIn[1]{\gdef\@laureaname{#1}}
8710 \newcommand\TesiDiLaurea[1]{\gdef\@TesiDiLaurea{#1}}
8711 \newcommand\NomeMonografia[1]{\gdef\@monografia{#1}}
8712 \newcommand\NomeDissertazione[1]{\gdef\@dissertazione{#1}}
8713 \newcommand\InName[1]{\gdef\@InName{#1}}
8714 \newcommand\CandidateName[1]{\gdef\@nomecandidato{#1}}
8715 \newcommand\AdvisorName[1]{\gdef\Relatore{#1}\gdef\Relatori{#1}}
8716 \newcommand\CoAdvisorName[1]{\gdef\Correlatore{#1}\gdef\Correlatori{#1}}
8717 \newcommand\TutorName[1]{\gdef\Tutore{#1}}
8718 \newcommand\NomeTutoreAziendale[1]{\gdef\@tutoreaziendalename{#1}}
8719 \newcommand\CycleName[1]{\gdef\@cyclename{#1}}
8720 \newcommand\NomePrimoTomo[1]{\gdef\PrimoTomo{#1}}
8721 \newcommand\NomeSecondoTomo[1]{\gdef\SecondoTomo{#1}}
8722 \newcommand\NomeTerzoTomo[1]{\gdef\TerzoTomo{#1}}
8723 \newcommand\NomeQuartoTomo[1]{\gdef\QuartoTomo{#1}}
8724 \newcommand\IDlabel{\\matricola:\xspace}
8725 \IfFileExists{\jobname.cfg}{\input{\jobname.cfg}}%
8726 {\IfFileExists{toptesi.cfg}{\input{toptesi.cfg}}{}}
8727 \@ifundefined{@cyclename}{\def\@cyclename{ciclo}}{}
8728 \@ifundefined{@titolo}{\def\@titolo{}}{}
8729 \NewDocumentCommand\candidato{m o}{\gdef\@@author{#1}%
8730 \IfNoValueTF{#2}{\gdef\@author{#1}}%
8731 {\gdef\@author{#1\IDlabel#2}}
8732 \femminilefalse\pluralefalse}
8733 \NewDocumentCommand\candidata{m o}{\gdef\@@author{#1}%
8734 \IfNoValueTF{#2}{\gdef\@author{#1}}%
8735 {\gdef\@author{#1\IDlabel#2}}
8736 \femminiletrue\pluralefalse}
8737 \providecommand\@secondauthor{}
8738 \NewDocumentCommand\secondocandidato{m o}{%
8739 \IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
8740 {\gdef\@secondauthor{#1\IDlabel#2}}%
8741 \femminilefalse\pluraletrue}
8742 \NewDocumentCommand\secondacandidata{m o}{%
8743 \IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
8744 {\gdef\@secondauthor{#1\IDlabel#2}}%
8745 \pluraletrue}
8746 \providecommand\@thirdauthor{}
8747 \NewDocumentCommand\terzocandidato{m o}{%
8748 \IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
8749 {\gdef\@thirdauthor{#1\IDlabel#2}}%
8750 \femminilefalse\pluraletrue}
8751 \NewDocumentCommand\terzacandidata{m o}{%
8752 \IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
8753 {\gdef\@thirdauthor{#1\IDlabel#2}}%
8754 \pluraletrue}
8755
8756 \@ifundefined{@principaladviser}{\def\@principaladviser{}}{}
8757 \@ifundefined{@secondadviser}{\def\@secondadviser{}}{}
8758 \@ifundefined{@thirdadviser}{\def\@thirdadviser{}}{}
8759 \ifcsundef{@PhDdirector}{%
8760 \ifDirettore\def\@PhDdirector{Direttore del corso di dottorato}\else
8761 \def\@PhDdirector{Coordinatore del corso di dottorato}\fi}{}
8762 \@ifundefined{@tutore}{\def\@tutore{}}{}
8763 \@ifundefined{@nomerelatore}{\def\@nomerelatore{}}{}
8764 \@ifundefined{@nomecandidato}{\def\@nomecandidato{}}{}
8765 \@ifundefined{Candidato}{\def\Candidato{Candidato}}{}
8766 \@ifundefined{Candidata}{\def\Candidata{Candidata}}{}
8767 \@ifundefined{Candidati}{\def\Candidati{Candidati}}{}
8768 \@ifundefined{Candidate}{\def\Candidate{Candidate}}{}
8769 \@ifundefined{Relatore}{\def\Relatore{Relatore}}{}
8770 \@ifundefined{Relatori}{\def\Relatori{Relatori}}{}
8771 \@ifundefined{Correlatore}{\def\Correlatore{Correlatore}}{}
8772 \@ifundefined{Correlatori}{\def\Correlatori{Correlatori}}{}
8773 \@ifundefined{Tutore}{\def\Tutore{Tutore}}{}
8774 \@ifundefined{@tutoreaziendale}{\def\@tutoreaziendale{}}{}
8775 \@ifundefined{@tutoreaziendalename}%
8776 {\def\@tutoreaziendalename{Supervisore Aziendale}}{}
8777 \@ifundefined{@retrofrontespizio}{\def\@retrofrontespizio{}}{}
8778 \@ifundefined{@subtitle}{\def\@subtitle{}}{}
8779 \@ifundefined{@corso}{\def\@corso{}}{}
8780 \@ifundefined{@ciclo}{\def\@ciclo{}}{}
8781 \@ifundefined{@ateneo}{\def\@ateneo{POLITECNICO DI TORINO}}{}
8782 \@ifundefined{@nomeat}{\def\@nomeat{}}{}% Nome proprio dell'ateneo
8783 \@ifundefined{@facolta}{\def\@facname{}}{}
8784 \@ifundefined{@facnumber}{\def\@facnumber{}}{}
8785 \@ifundefined{@faculty}{\def\@faculty{}}{}
8786 \@ifundefined{PrimoTomo}{\def\PrimoTomo{Tomo primo}}{}
8787 \@ifundefined{SecondoTomo}{\def\SecondoTomo{Tomo secondo}}{}
8788 \@ifundefined{TerzoTomo}{\def\TerzoTomo{Tomo terzo}}{}
8789 \@ifundefined{QuartoTomo}{\def\QuartoTomo{Tomo quarto}}{}
8790 \@ifundefined{@submitdate}{\def\@submitdate{\ifcase\the\month\or%
8791 Gennaio\or Febbraio\or Marzo\or Aprile\or Maggio\or Giugno\or
8792 Luglio\or Agosto\or Settembre\or Ottobre\or Novembre\or Dicembre\fi
8793 \space \the\year}}{}
8794 \@ifundefined{@TesiDiLaurea}{\def\@TesiDiLaurea{Tesi di Laurea}}{}
8795 \@ifundefined{@phdschool}{\def\@phdschool{SCUOLA DI DOTTORATO}}{}
8796 \@ifundefined{@PhDname}{\def\@PhDname{Dottorato in }}{}
8797 \@ifundefined{@laureaname}{\def\@laureaname{Corso di Laurea in }}{}
8798 \@ifundefined{@dissertazione}{\def\@dissertazione{Tesi di Dottorato}}{}
8799 \@ifundefined{@monografia}{\def\@monografia{Monografia di Laurea}}{}
8800 \@ifundefined{@InName}{\def\@InName{in}}{}
8801 % \end{macrocode}
8802 %
8803 % We now start setting the |ThesisTitlePage| environment;
8804 % we use the |xparse| functionality to define it; the
8805 % environment accepts an optional asterisk as its first
8806 % and only (boolean type) argument, that is a single token
8807 % is entered without brackets as the very first token after
8808 % the environment opening statement. If the user wants to
8809 % use this optional argument, s/he must enter
8810 % |\begin{ThesisTitlePage}*| with the asterisk after the
8811 % closing brace. The presence of the asterisk sets the
8812 % logo position to the title page lower half, while its
8813 % absence sets such position to the title page top.
8814 %
8815 % The opening commands provide also to read a configuration
8816 % file, if it exists in the same folder as the thesis main
8817 % file; such configuration file must be named \meta{thesis
8818 % main file name}|.cfg|. The environment body, besides the
8819 % possible data already retrieved from the configuration file,
8820 % accepts other setting commands for the title page necessary
8821 % and optional data; if some commands are repeated with
8822 % different data, the last ones prevail on the previous ones.
8823 % The actual title page typesetting is done by the closing
8824 % environment command.
8825 %
8826 % Among the setting commands there might be also the legal
8827 % page rendered with the |\retrofrontespizio| command; it
8828 % closes the recto title page, and on the verso, if the command
8829 % argument is void, nothing is printed except the blank verso page,
8830 % but if it contains something, the legal notice is printed
8831 % at the verso page bottom.
8832 % \begin{macrocode}
8833 \newbool{topTPTlogos}\newbool{AteneoInHead}
8834
8835 \DeclareDocumentEnvironment{ThesisTitlePage}{s}{%
8836 \IfBooleanTF{#1}{\boolfalse{topTPTlogos}\booltrue{AteneoInHead}}%
8837 {\booltrue{topTPTlogos}\boolfalse{AteneoInHead}}%
8838 \IfFileExists{\jobname.cfg}{\input{\jobname.cfg}}{%
8839 \PackageWarning{toptesi-dottorale}{%
8840 No configuration file found\MessageBreak}}
8841 }{%
8842 \fr@ntespizio
8843 }
8844 % \end{macrocode}
8845 % Next we define the actual typesetting of the title page.
8846 % The code is substantially that of the generic module
8847 % |topfront| where we deleted the commands and the settings
8848 % related to thesis kinds that have nothing to do with
8849 % a generic doctoral thesis.
8850 % \begin{macrocode}
8851 \def\fr@ntespizio{%
8852 \begingroup\par
8853 \oddsidemargin=\dimexpr(\oddsidemargin+\evensidemargin)/2\relax
8854 \evensidemargin \oddsidemargin
8855 \null
8856 \setcounter{page}{1}%
8857 \normalfont
8858 \ifclassica
8859 \boolfalse{topTPTlogos}
8860 \thispagestyle{classica}
8861 \ifcsvoid{@ateneo}{\def\@ateneo{Manca il nome dell'ateneo}
8862 }{}
8863 \else
8864 \thispagestyle{titlepage}
8865 \fi
8866 \ifcsvoid{@ateneo}{}{\booltrue{AteneoInHead}}
8867 \ifcsvoid{@ateneo}{%
8868 \ifbool{topTPTlogos}
8869 {}{\booltrue{AteneoInHead}\def\@ateneo{Manca il nome dell'ateneo}}%
8870 }{%
8871 \booltrue{AteneoInHead}%
8872 }
8873 \ifbool{AteneoInHead}{}{%
8874 {{\centering\LARGE \@ateneo\par}}
8875 }
8876 \ifcsvoid{@nomeat}{}
8877 {\ifbool{topTPTlogos}{\vspace*{\dimexpr \headsep+2.5ex}}{\vspace*{-3ex}}%
8878 {\centering\@nomeat\par}\vfill}
8879
8880 \begin{center}
8881 {\rmfamily\mdseries
8882 \ifdottorato
8883 \large \@phdschool\par\medskip
8884 \else
8885 \ifcsvoid{@faculty}{}{%
8886 \LARGE\ifx\@facnumber\empty\else\@facnumber\space\fi
8887 \@faculty\unskip\xspace\@facname\par\medskip
8888 }
8889 \fi
8890 }%
8891 \ifcsvoid{@corso}{}{{\large
8892 \ifdottorato
8893 \@PhDname\unskip\xspace
8894 \@corso\ifx\@ciclo\empty\else~--~\@ciclo\fi
8895 \else
8896 \@laureaname\unskip\xspace\@corso
8897 \fi
8898 \par}}
8899 \end{center}
8900 \vspace{\stretch{0.2}}
8901 \begin{center}
8902 \LARGE\@dissertazione%
8903 \unless\ifx\empty\@materia
8904 \\\@InName\\\@materia
8905 \fi
8906 \end{center}
8907 \vspace{\stretch{0.2}}
8908 \begin{center}
8909 {\huge\bfseries \baselineskip=0.95em plus 1pt
8910 \@titolo \par}
8911 \end{center}
8912 \unless\ifx\@subtitle\empty
8913 \begin{center}%
8914 \large\textrm{\@subtitle}\par
8915 \end{center}%
8916 \fi
8917 \ifclassica
8918 \ifnum\value{tomo}>\z@
8919 \par\bigskip
8920 \noindent\makebox[\textwidth]{%
8921 \large\textbf{%
8922 \ifcase\c@tomo%
8923 \or \PrimoTomo%
8924 \or \SecondoTomo%
8925 \or \TerzoTomo%
8926 \or \QuartoTomo%
8927 \else
8928 \PackageWarning{toptesi}{%
8929 Counter tomo equals \the\c@tomo\MessageBreak
8930 We never considered a thesis might get
8931 divided in more than four volumes}%
8932 \fi}}%
8933 \fi
8934 \vspace{1em}
8935 \fi
8936 \par
8937 \unless\iftopTPTlogos
8938 {\vfill\centering \printloghi\par}\fi
8939 \vfill
8940 \iftriennale
8941 \let\@nomerelatore\empty
8942 \else
8943 \ifdottorato
8944 \edef\@nomerelatore{\@PhDdirector}%
8945 \else
8946 \ifcsvoid{@principaladviser}{}{%
8947 \def\@nomerelatore{\Relatore}}
8948 \unless\ifclassica
8949 \ifcsvoid{@secondadviser}{}{%
8950 \def\@nomerelatore{\Relatori}}%
8951 \fi
8952 \fi
8953 \fi
8954 \ifdottorato
8955 \let\@nomecandidato\empty
8956 \else
8957 \iflanguage{italian}{%
8958 \iffemminile
8959 \def\@nomecandidato{\Candidata}%
8960 \else
8961 \def\@nomecandidato{\Candidato}%
8962 \fi
8963 \ifcsvoid{@secondauthor}{}{%
8964 \iffemminile
8965 \def\@nomecandidato{\Candidate}%
8966 \else
8967 \def\@nomecandidato{\Candidati}%
8968 \fi}
8969 }{}%
8970 \fi
8971 \iftriennale
8972 \begin{center}%
8973 \large\mdseries\textsc{\@author}
8974 \end{center}%
8975 \else
8976 \def\BoxRelatori{%
8977 \begin{tabular}[t]{l}%
8978 \hbox{\ifclassica\else\large\fi
8979 \textbf{\protect\@nomerelatore}}\\[.6ex]
8980 \hbox{\large\textrm{\protect\@principaladviser}}%
8981 \ifx\@secondadviser\empty \else
8982 \ifclassica
8983 \ifx\@thirdadviser\empty
8984 \ifx\@secondadviser\empty\else
8985 \\[1.5ex]\textbf{\Correlatore:}%
8986 \fi
8987 \else
8988 \\[1.5ex]\textbf{\Correlatori:}%
8989 \fi
8990 \fi
8991 \\[.6ex]\hbox{{\large\textrm{\protect\@secondadviser}}}%
8992 \fi
8993 \ifx\@thirdadviser\empty \else
8994 \\[.6ex] \hbox{{\large\textrm{\protect\@thirdadviser}}}%
8995 \fi
8996 \end{tabular}%
8997 }%
8998 \def\print@secondocandidato{\\\relax
8999 \hbox{\large\tabular{@{}l@{}}\@secondauthor\endtabular}}
9000 \def\print@terzocandidato{\\\relax
9001 \hbox{\large\tabular{@{}l@{}}\@thirdauthor\endtabular}}
9002 \def\BoxCandidati{%
9003 \begin{tabular}[t]{l}%
9004 \hbox{\unless\ifclassica\large\fi
9005 \textbf{\protect\@nomecandidato}}\\[.6ex]
9006 \hbox{\large\tabular{@{}l@{}}\@author\endtabular}%
9007 \ifcsvoid{@secondauthor}{}{\print@secondocandidato}%
9008 \ifcsvoid{@thirdauthor}{}{\print@terzocandidato}%
9009 \end{tabular}%
9010 }%
9011 \ifdottorato
9012 \begin{center}\large
9013 \textbf{\@author}\\[3em]
9014 {\normalsize
9015 \begin {tabular*}{\hsize}{@{\extracolsep{\fill}}ccc}
9016 \ifcsvoid{@tutore}{}{\textbf{\Tutore}}
9017 &\relax&
9018 \ifcsvoid{@principaladviser}{}{\textbf{\@nomerelatore}}
9019 \\
9020 \ifcsvoid{@tutore}{}{\@tutore}
9021 &\relax&
9022 \ifcsvoid{@principaladviser}{}{\@principaladviser}
9023 \end{tabular*}
9024 }%
9025 \end{center}
9026 \else
9027 \unless\ifclassica
9028 \unless\ifevenboxes
9029 \begin{flushleft}%
9030 \BoxRelatori
9031 \end{flushleft}\par\vspace*{-1.5\baselineskip}
9032 \begin{flushright}%
9033 \BoxCandidati
9034 \end{flushright}%
9035 \else
9036 \makebox[\textwidth]{\BoxRelatori\hfill\BoxCandidati}
9037 \fi
9038 \else
9039 \noindent
9040 \makebox[\textwidth]{%
9041 \BoxRelatori\hfill\BoxCandidati}\par
9042 \fi
9043 \fi
9044 \fi
9045 \ifcsvoid{@tutoreaziendale}{}{%
9046 \vfill\vfill
9047 {\centering \textbf{\@tutoreaziendalename}\\[.6ex]
9048 \@tutoreaziendale\par}}
9049 \par\clearpage
9050 % Legal page
9051 \ifcsvoid{@retrofrontespizio}{}%
9052 {\null\vfill\thispagestyle{empty}\@retrofrontespizio\par\clearpage}%
9053 \endgroup}
9054 % \end{macrocode}
9055 %\iffalse
9056 %</topdoc>
9057 %\fi
9058 %
9059 %^^A SCUOLA SECONDARIA SUPERIORE
9060 %
9061 % \subsection{The \texttt{toptesi-sss} module code}
9062 %
9063 % The module for typesetting the high-school final-work
9064 % title-page starts here. We avoid using a |.def| file and put
9065 % all necessary commands in one file.
9066 %
9067 % First we load the described packages using different loading
9068 % schemes for \pdfLaTeX\ vs. \LuaLaTeX\ or \XeLaTeX.
9069 %
9070 %\iffalse
9071 %<*topsss>^^A SECONDARIA
9072 %\fi
9073 % \begin{macrocode}
9074 %%
9075 %%%% Math fonts and AMS extensions (|fontspec| is already loaded)
9076 \secondariatrue
9077 \ifPDFTeX
9078 \@ifpackageloaded{newtxmath}{}%
9079 {\@ifpackageloaded{newpxmath}{}%
9080 {%
9081 \RequirePackage{amsmath,amssymb,amsthm}%
9082 }%
9083 }%
9084 \else
9085 \RequirePackage{amsmath,amsthm}
9086 \RequirePackage{unicode-math}
9087 \fi
9088 \RequirePackage{xcolor} % Intelligent colors
9089 \RequirePackage{xspace} % Intelligent space
9090 \RequirePackage{xparse} % Command and environment advanced definitions
9091 \RequirePackage{calc} % Calculation macros
9092 \RequirePackage{ifthen} % Conditional statements
9093 \RequirePackage{booktabs} % professional rules in tables
9094 \RequirePackage{multirow} % Multirow table cells are not professional
9095 \ifPDFTeX \RequirePackage{indentfirst}\fi
9096 \raggedbottom
9097 % \end{macrocode}
9098 %
9099 % We initialise the internal macros to the default values; most
9100 % of them are just empty strings.
9101 % \begin{macrocode}
9102 \providecommand*\@SSSLogo{}
9103 \providecommand*\@tiposcuola{}
9104 \providecommand*\@indirizzomiur{}
9105 \providecommand*\@opzionemiur{}
9106 \providecommand*\@nomescuola{}
9107 \providecommand*\@sedescuola{}
9108 \providecommand*\@annoscolastico{}
9109
9110 \providecommand*\@Ntesina{Tesina di maturit\`a}
9111 \providecommand*\@title{}
9112 \providecommand*\@subtitle{}
9113
9114 \ifcsundef{ifemminile}{\newif\iffemminile\femminilefalse}{}
9115 \providecommand*\@Ncandidato{\iffemminile Studentessa\else
9116 Studente\fi}
9117 \providecommand*\@author{}
9118 \providecommand*\@Npresidente{Presidente di commissione}
9119 \providecommand*\@presidente{}
9120 \providecommand*\@numerocommissione{}
9121
9122 \newcommand*\SSSLogo[1]{\gdef\@SSSLogo{#1}}
9123 \newcommand*\NomeTesina[1]{\gdef\@Ntesina{#1}}
9124 \newcommand*\IndirizzoMiur[1]{\gdef\@indirizzomiur{#1}}
9125 \newcommand*\OpzioneMiur[1]{\gdef\@opzionemiur{#1}}
9126 \newcommand*\TipoScuola[1]{\gdef\@tiposcuola{#1}}
9127 \newcommand*\SedeScuola[1]{\gdef\@sedescuola{#1}}
9128 \newcommand*\NomeScuola[1]{\gdef\@nomescuola{#1}}
9129 \newcommand*\AnnoScolastico[1]{\gdef\@annoscolastico{#1}}
9130 \newcommand*\NomeCandidato[1]{\gdef\@Ncandidato{#1}}
9131
9132 \newcommand*\titolo[1]{\gdef\@title{#1}}
9133 \newcommand*\sottotitolo[1]{\gdef\@subtitle{\ifblank{#1}{}%
9134 {\medskip\par{\Large #1\par}}%
9135 \vspace{\stretch{1}}}}
9136
9137 \NewDocumentCommand\studente{m o}{\gdef\@@author{#1}%
9138 \IfNoValueTF{#2}{\gdef\@author{#1}}%
9139 {\gdef\@author{#1\IDlabel#2}}\femminilefalse}
9140 \NewDocumentCommand\studentessa{m o}{\gdef\@@author{#1}%
9141 \IfNoValueTF{#2}{\gdef\@author{#1}}%
9142 {\gdef\@author{#1\IDlabel#2}}\femminiletrue}
9143 \newcommand*\IDlabel{\\\normalfont Classe\ }
9144 \newcommand*\Presidente[1]{\gdef\@presidente{#1}}
9145 \newcommand*\NumeroCommissione[1]{\gdef\@numerocommissione{#1}}
9146 % \end{macrocode}
9147 %
9148 % The following code certainly does not hurt, but it was
9149 % necessary during the preliminary testing.
9150 % \begin{macrocode}
9151 \newcommand*\ifBlank{\expandafter\ifblank\expandafter}
9152 % \end{macrocode}
9153 % The environment |FrontespizioTesina| is being defined here.
9154 % No optional arguments are requested, therefore it is not
9155 % necessary to use the defining commands of package |xparse|.
9156 % The environment starts by reading the configuration file
9157 % |jobname.cfg| if it exists. Nothing is done if such file
9158 % does not exist, not even an info message; after all the
9159 % configuration file is optional.
9160 % \begin{macrocode}
9161 \newenvironment{FrontespizioTesina}{%
9162 \InputIfFileExists{\jobname.cfg}{\relax}{\relax}
9163 }{%
9164 % \end{macrocode}
9165 %
9166 % After this preliminary test the |titlepage| environment is
9167 % opened and the layout assembly starts. First the information
9168 % on the school; if the school generic name has been omitted
9169 % among the mandatory user commands, the string “Manca il tipo
9170 % di scuola” is printed in its place, so that the user is
9171 % directly reminded of the mandatory nature of this piece of
9172 % data. On the opposite if the Ministry of education data are
9173 % missing, nothing is done. After these mandatory and optional
9174 % data are printed, a couple of horizontal lines are typed so
9175 % as to mark the end of the title page heading.
9176 % \begin{macrocode}
9177 \begin{titlepage}\parindent=0pt
9178 \centering
9179 \raisebox{0.025\textheight}[0pt][0pt]{\parbox[b]{\textwidth}{%
9180 \centering
9181 \ifBlank{\@tiposcuola}{Manca il tipo di scuola}{\@tiposcuola}%
9182 \ifBlank{\@indirizzomiur}{\relax}{\space--\space\@indirizzomiur}%
9183 \ifBlank{\@opzionemiur}{\relax}{\space--\space\@opzionemiur}\par
9184 \vspace{-1ex}
9185 \makebox[0.5\textwidth]{\rule{0.50\textwidth}{0.4\p@}}\par
9186 \vspace{-1.5ex}
9187 \makebox[0.25\textwidth]{\rule{0.25\textwidth}{0.8\p@}}\par
9188 % \end{macrocode}
9189 %
9190 % After this heading the proper name of the school is printed,
9191 % possibly with its real address.
9192 % \begin{macrocode}
9193 \medskip
9194
9195 \textsc{\@nomescuola}}}\par
9196 \null\hfill\ifBlank{\@sedescuola}{\relax}{%
9197 \raisebox{0.5\baselineskip}[0pt][0pt]{%
9198 \parbox{0.4\textwidth}{\raggedleft\@sedescuola}}}\par
9199 \vspace{\stretch{1}}
9200 % \end{macrocode}
9201 %
9202 % Next the name of the document and its title and subtitle
9203 % are set: the title in |\Large| boldface font, while the subtitle
9204 % in normal size.
9205 % \begin{macrocode}
9206 {\large \@Ntesina\par}
9207 \vspace{\stretch{0.5}}
9208
9209 {\Large\textbf{\@title}\par}
9210 {\vspace{0.5\baselineskip}
9211
9212 \normalsize\@subtitle\par}
9213 % \end{macrocode}
9214 %
9215 % If a file name is specified for the graphic file that
9216 % contains the school logo, such image is inserted in the
9217 % title page.
9218 % \begin{macrocode}
9219 \ifBlank{\@SSSLogo}%
9220 {\vspace{\stretch{1}}}%
9221 {\vspace{\stretch{1}}\makebox[\textwidth]{%
9222 \setbox0\hbox{\includegraphics[height=30mm]{\@SSSLogo}}
9223 \ifdim\wd0>\textwidth \resizebox{\linewidth}{!}{\box0}\else\box0\fi}
9224 \par\vspace{\stretch{1}}}
9225 % \end{macrocode}
9226 %
9227 % The examining committee chairperson name and the Ministry
9228 % of education committee ID number are typeset within a
9229 % |minipage|. Another |minipage| contains the student's name.
9230 % Pay attention: the names of the student and of the president
9231 % are typeset in bold face small caps if the default fonts have
9232 % this typeface; if the chosen fonts do not have this typeface
9233 % the actual used typeface is bold roman.
9234 % \begin{macrocode}
9235 \begin{minipage}[t]{0.45\textwidth}\flushleft
9236 \ifBlank{\@presidente}{}{\@Npresidente\\
9237 {\bfseries\scshape\@presidente}\par
9238 \vspace{\baselineskip}}
9239
9240 \ifBlank{\@numerocommissione}{}{Commissione numero\\
9241 \textbf{\@numerocommissione}}
9242 \end{minipage}
9243 \hfill
9244 \begin{minipage}[t]{0.45\textwidth}\flushright
9245 \@Ncandidato\\
9246 {\bfseries\scshape\@author}
9247 \end{minipage}
9248
9249 \vspace{\stretch{1}}
9250
9251 % \end{macrocode}
9252 %
9253 % Eventually the school year is printed with an initial string
9254 % `Anno scolastico'. This terminates the title page; the
9255 % environment is closed and the page ejected.
9256 % \begin{macrocode}
9257 \raisebox{-0.05\textheight}[0pt][0pt]{%
9258 \parbox[t]{\textwidth}{\centering
9259 \makebox[0.25\textwidth]{\hrulefill}\\[\medskipamount]
9260 Anno scolastico \@annoscolastico}}
9261 \end{titlepage}
9262 \clearpage}%%
9263 %%
9264 \endinput
9265 % \end{macrocode}
9266 % This is the end of this module code.
9267 %\iffalse
9268 %</topsss>
9269 %\fi
9270 %
9271 % \Finale
9272 % \endinput
9273 %
9274 \endinput
9275 %%%%%% Recent progress
9276 %%% (version 6.2.04 2018-05-05) With TeXLive 2018 diagnostic messages
9277 % on errors in the LaTeX kernel are more efficient and some of them
9278 % were notified, while until 2017 no notice was issued. The source
9279 % code was revised in order to eliminate those little nasty bugs.
9280 %
9281 %%% (version 6.2.01 2018-04-30) The main structure introduced with
9282 % previous versions and their minor versions remains untouched,
9283 % but a new option has been added in order to modify the bibliography
9284 % style when typesetting theses for the PoliTO Doctoral School ScuDo.
9285 % The specific module was developed having in mind theses in the
9286 % scientific domains covered by the IEEE Transactions; of course
9287 % not all doctoral theses deal with those domains, therefore the
9288 % bibliography style should be changeable according to the styles
9289 % used in other scientific domains.
9290 %
9291 %%% (version 6.1.8 -- 2017-10-15) Extended version 5.92.xx in order
9292 % to modularise the whole bundle; this requires the key=value options
9293 % in order to smoothly handle the various new options, especially those
9294 % that offer the user the new environment ThesisTitlePage
9295 % (FrontespizioTesi for high school tesina); a new environment SDbox
9296 % to produce figures and tables and any other possible floating body,
9297 % defined through package float, with their captions on a side,
9298 % possibly protruding into the external margin; in any case the SD
9299 % box can be used by itself without using the corresponding floating
9300 % environment. Modules available for different thesis types include
9301 % high school tesina, bachelor, master, doctoral theses, the doctoral
9302 % thesis title page for the Doctorate School of Politecnico di Torino;
9303 % custom and frontespizio key-value options are available for a totally
9304 % hand made title page, and a title page typeset by means of the
9305 % external package frontespizio by Enrico Gregorio; backwards
9306 % compatibility with the previous version is almost always maintained
9307 % for both title pages; even the ID number of the candidates is
9308 % maintained, although with a slightly different modern interface,
9309 % since the xparse package facilities are used to define some of the
9310 % new commands and environments. The a4paper paper size is
9311 % maintained as the default one, although alla paper sizes available
9312 % to the report/book/article class can be used (this required a loto
9313 % of thought, because the xkeyval package documentations require
9314 % thoughtful interpretation.
9315 %%%% (version 6.2.07 of 2018/11/12) Added checks in order to avoid loading
9316 % an older toptesi.sty package compared to the toptesi.cls. It avoids
9317 % any possible conflict with hacked toptesi.sty files, or even with
9318 % obsolete versions, still going around in Internet, that date back
9319 % to the old times when the toptesi.cls file did not yet exist (versions
9320 % 2.xxxx or older).
9321 %%%% (version 6.2.09 of 2018/11/20) Loaded the filecontents package in oder
9322 % to allow overwriting of the metadata file needed for PDF/A compliance.
9323 %%%% (version 6.2.10 of 2018/12/30) Adjusted information about PDF/A color
9324 % profile compliance after the |pdfx| package has been upgraded to
9325 % version 1.6.1 on 2018/12/22.
9326 %%%% (version 6.3.00 of 2019-03-09) Modified the toptesi-magistrale.sty
9327 % module in order to have a working set of commands to set
9328 % the candidates' list heading in a proper way with any number (<4)
9329 % of candidates of any sex; previous to this version this module did not
9330 % accept the commands \CandidateNames and \TitoloListaCandidati.
9331 %%%% (version 6.3.05 of 2019-07-01) redefined the \chapter command,
9332 % and adapted the corresponding declarations and commands, to exploit
9333 % the new functionalities. Such new functionalities depend on the
9334 % package xparse new (may be not that new, but new for me) syntax
9335 % that allows to declare the optional argument descriptors so as to
9336 % inherit the values of other arguments.Such syntax avoids a lot of
9337 % fragile tests, and is very handy.
9338 %%%% (version 6.3.07) corrected "Attention!" and "It goes by itself"
9339 % by "Warning!" and "It goes without saying" respectively.
9340 %%%% (version 6.4.02) Besides correcting some typos, some options were
9341 % added in order to set page headers and folios on specific positions;
9342 % by default headers are centred, and folios are centred in footers;
9343 % options allow to shift them towards the external margins and
9344 % sometimes to set footers in headers. Moreover the PDF/A-2b is now
9345 % described and suggested to set it as the preferred PDF/A conformance
9346 % level. Documentation has been modified accordingly.