-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtoptesi.dtx
3258 lines (3219 loc) · 159 KB
/
toptesi.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
%<*internal>
\begingroup
\input docstrip.tex
\keepsilent
\preamble
______________________________________________________
The TOPtesi package
Copyright (C) 2005-2016 Claudio Beccari
All rights reserved
License information appended
\endpreamble
\postamble
Copyright 2005-2016 Claudio Beccari
Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
this license is at: http://www.latex-project.org/lppl.txt
This work is "author-maintained"
This work consists of this file toptesi.dtx, a README file
and the derived files:
toptesi.cls, toptesi.sty, topfront.sty, topcoman.sty,
toptesi.cfg, and the English documentation toptesi.pdf.
Furthermore the bundle contains the documentation source
file toptesi-it-pdftex.tex and the derived file
toptesi-it-pdftex.pdf.
The toptesi-example.tex source file is just an example
that shows how to use the various commands; by commenting
or uncommenting certain source lines it is possible to
typeset different kind of theses and their front pages.
The topfront-example.tex source file is an example of how
to produce just the title page with TOPtesi and the external
package frontespizio.
The toptesi.cfg file is a sample of a local configuration
file that can be copied to another file and its copy freely
edited and customized.
By running pdflatex on toptesi.dtx the user gets the class,
sty and cfg files and the English documentation file in
pdf format.
The source file of the Italian documentation file
toptesi-it-pdftex.pdf is another example of how to use TOPtesi.
In spite of its name, toptesi-it-pdftex.tex may be typeset
with pdfLaTeX, XeLaTeX, and LuaLateX; see the first comment
lines of the file for how-to information.
\endpostamble
\askforoverwritefalse
\generate{\file{toptesi.cls}{\from{toptesi.dtx}{class}}
\file{toptesi.sty}{\from{toptesi.dtx}{topsty}}
\file{topcoman.sty}{\from{toptesi.dtx}{topcmn}}
\file{topfront.sty}{\from{toptesi.dtx}{topfrn}}
\file{toptesi.cfg}{\from{toptesi.dtx}{topcfg}}
}
\def\tmpa{plain}
\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
\endgroup
%</internal>
%
% Copyright 1989--2015 Claudio Beccari
%
% This file is part of the TOPtesi bundle
% -------------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This file has the LPPL maintenance status "author-maintained".
%
% The list of all files belonging to the TOPtesi bundle is
% given in the file `manifest.txt'.
%
% The list of derived (unpacked) files belonging to the distribution
% and covered by LPPL is defined by the self unpacking file toptesi.dtx
% which is part of the distribution.
%
% \fi
%
% \iffalse
%^^A The following trick uses the same date for every file header.
%<class,topsty,topcmn,topfrn>\NeedsTeXFormat{LaTeX2e}[2015/01/01]
%<*driver>
\ProvidesFile{toptesi.dtx}[%
%</driver>
%<class>\ProvidesClass{toptesi}[%
%<topsty>\ProvidesPackage{toptesi}[%
%<topcmn>\ProvidesPackage{topcoman}[%
%<topfrn>\ProvidesPackage{topfront}[%
%<*driver,class,topsty,topcmn,topfrn>
2016/11/25 v.5.9.06
%<class>Class for typesetting university theses]
%<topsty>Extension for toptesi.cls]
%<topcmn>Additional commands for the TOPtesi bundle]
%<topfrn>Title page for TOPtesi and other classes]
%</driver,class,topsty,topcmn,topfrn>
%<*driver>
]
%</driver>
%<*driver>
\documentclass{ltxdoc}
\GetFileInfo{toptesi.dtx}
\title{The TOPtesi bundle}
\date{\fileversion\space--- \filedate}
\author{Claudio Beccari\thanks{E-mail: \texttt{claudio dot beccari at gmail dot com}}}
\usepackage{metalogo,multicol}
\def\prog#1{\textsf{#1}}
\def\pack#1{\textsf{\slshape#1}}
\def\env#1{\textit{#1}}\let\amb\env
\begin{document}\errorcontextlines=9
\maketitle
\begin{multicols}{2}
\tableofcontents
\end{multicols}
\setlength\hfuzz{20pt}
\DocInput{toptesi.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{2847}
%
% \begin{abstract}
% This file describes the TOPtesi bundle; it is a set of files designed to
% typeset a university final report that in Italian is generally
% called ``tesi''; it was originally developed at the Technical University
% of Turin (Politecnico di Torino) but it was adapted for typesetting theses in
% any Italian university. Well\dots\ since the Erasmus student mobility is very
% extended and many Italian students participate in the so called \textit{double
% degree} programs, their theses, or whatever they are called in other countries,
% may be typeset so as to comply also with the host university rules; therefore
% this set of files has the ambition to be suited for typesetting theses in any
% university in the world\dots\ This ambition can't be fulfilled, though,
% because of the complexity of the title page (and possibly of the legal page)
% requirements. This version is experimentally compliant with the \XeLaTeX\
% and the \LuaLaTeX\ programs. Up to now the few conflicts that have been
% spotted have been solved with suitable corrections or additions.
% The most important feature with \XeLaTeX\ is that the option pdfa cannot be
% used any more; this is due to the fact that the typesetting engine \XeTeX\
% does not produce directly any PDF output but a modified, extended DVI
% output, that is immediately converted into a PDF file through xdvipdfmx,
% a special version of the conversion program. Another minor \XeLaTeX\
% feature is that it cannot fully exploit the typesetting facilities
% of the microtype package, but the wide choice of OpenType fonts replaces
% almost completely such missing features.
% \end{abstract}
%
% \section{Introduction}
% The TOPtesi bundle contains a certain number of files.
% \begin{enumerate}
% \item A class file \texttt{toptesi.cls} to be used as the main document class; the main
% document may be any of a certain number of reports that in Italy
% are called with various names: ``monografia'', ``monografia di laurea'',
% ``tesi di laurea'', ``tesi di laurea specialistica'', ``tesi di laurea
% magistrale'', ``tesi di dottorato'', ``dissertazione di dottorato'', and so on.
% All these documents have in common the fact that they all conclude a period of
% university education. Moreover since they may conclude a double degree university
% program, they may receive foreign names such as, for example, ``Projet de fin d'\'etudes'', ``Master thesis'', and the like.
% \item An extension package \texttt{toptesi.sty} that contains most of the code
% for the real typesetting; it might be used as an extension to other classes,
% although this use is seldom necessary.
% \item A second extension package \texttt{topfront.sty} that contains the
% commands and the typesetting macros for the title page; this file may be
% used as an independent extension package to be added to, say, the report
% class file for typesetting just the title page; this file might be used as
% a template for setting up the title page fixed information in languages
% different from Italian. This package is part of the bundle, but it is
% automatically loaded only if the user did not specify the class option
% |noTOPfront| or its alias |usefrontespizio|; if this option is specified
% the user is free to use whatever other external package s/he prefers in
% order to typeset the tile page; in this case we suggest to use the package
% |frontespizio| and we address the user to its documentation. It is important
% to recall that if the |topfront| package has to be loaded, is is only at
% the execution of the |\begin{document}| command. There fore no title page
% commands of any kind (those defined by |topfront|) can be used in the preamble.
% \item A third extension package \texttt{topcoman.sty} that defines a certain
% number of user commands suitable for typesetting technical matters.
% \item Previous versions of this bundle contained also the logos of a set of
% universities; these logos are not distributed anymore because of legal
% constraints. Every one who is working on his/her degree course final report
% must retrieve the logo of his/her university, but s/he should pay attention
% to use it according to the rules and limitations of the university.
% \item A documentation file \texttt{toptesi-it-xetex.pdf} written in Italian
% where every feature is explained in detail; essential information is given
% in this English documentation. The source file of the documentation
% \texttt{toptesi-it-xetex.tex} may be used as a sample or template for
% typesetting one's thesis with XeLaTeX.
% \end{enumerate}
%
% The above files are complemented with a configuration file that any user may
% customise at will; this customisation file makes it easy to configure the
% bundle so as to make it suitable for another language; in facts the
% \textsf{babel} and \textsf{polyglossia} packages contain localisations
% for many languages, but such localisations deal with the standard infix
% \LaTeX\ names and phrases and do not cope with the thesis title page requirements.
% This customisation is usable only if no |noTOPfront| or |usefrontespizio|
% option had been declared to the class.
%
% TOPtesi was specifically conceived for typesetting theses with the \LaTeX\ mark-up,
% and initially it was using the \textsf{tex} typesetting engine; later on this engine
% was substantially substituted by the \textsf{pdftex} one, which was capable
% of direct output of PDF files. Since about 2006 the typesetting engine \XeTeX\
% is available; the most important feature of this engine is its capability
% of using OpentType fonts, among which those that are available to the
% operating system of the specific platform where the document is being typeset.
% For what concerns theses this might be of essential importance when the thesis
% deals with specific languages that use different scripts (Greek, Russian,
% Bulgarian, Chinese, Japanese, Korean, Hebrew, Arabic, Farsi, Thai, and so on).
%
% This version of TOPtesi has been tested with \XeLaTeX. Some conflicts have
% been spotted and solved; may be there are still hidden ones, so that feedback
% from users is particularly welcome. The only main drawback still present
% when running \XeLaTeX\ is the fact that this program cannot still
% \emph{directly} produce the output file in PDF format, although it
% automatically transforms its specific output file into PDF format. This
% implies that the specific \textsf{pdftex} features required to produce
% a PDF/A compliant output PDF file suitable for long term archiving cannot
% be used. But with some attention the PDF file output by \XeLaTeX\ may be
% converted to PDF/A by using the program \prog{ghostscript}.
%
% \section{User commands}
% The \texttt{toptesi.cls} is basically an extension of the standard class
% \texttt{report.cls}; it redefines the page typesetting grid, the headers
% and the footers, and the title page layout and commands. \texttt{toptesi.cls}
% does not set such crazy settings as ``double spaced'' text; it is intended
% to typeset the thesis with the quality of a \LaTeX\ well typeset document,
% not as a typewriter written one.
%
% Theses very often are full of specialised material: formulas, diagrams and pictures,
% texts written in non Latin alphabets, special symbols for philological mark-up, and
% the like; a common typewriter would not be suitable and the quality of the contents
% requires professional typesetting; this is why I strongly believe that instructions
% on typesetting styles that refer to the ``gone by times'' of mechanical typewriters
% should be banned.
%
% At the same time the class allows to typeset theses on any paper format;
% nowadays, in facts, Universities are requesting theses in smaller formats
% than A4 or letter paper. With smaller paper sizes the layout changes
% automatically, but the title page might require some more attention. The
% default paper size is A4, but the user can set any paper size among those
% accepted by the |report| standard class. If the |noTOPfront| option
% was specified and the package |frontepsizio| was loaded by the user, it
% is necessary to remind that it can easily create pretty nice title pages, but
% by default it is preset to use A4 paper where it can typeset the tytle page in
% two styles, one so called ``standard'' and the other called ``elements'', that
% mimics that of the famous book \emph{Elements of typographic style} by
% Robert Bringhurst; this is so at least with |frontespizio|'s version
% 1.4a of 2011/09/21 or earlier. It is possible to use |frontespizio| to use
% a different paper size, but it's necessary to make use of certain
% customisation commands described in its documentation.
%
% Therefore if you want to typeset your thesis while typesetting the title
% page by means of the functionalities of package |frontespizio| you have
% to follow carefully how to use that package's options in the proper way
% as to bypass the two fixed styles it can produce.
% See also the Italian documentation contained in the document |toptesi-it-xetex.pdf|.
%
% Most new commands refer themselves to the information that should be typeset
% in the title page; some class options specify special stylistic page details;
% the rest is simple and traditional \LaTeX\ mark-up as it is implemented in
% the \LaTeX\ kernel and in the report class. If \XeLaTeX\ has to be
% used, some essential preamble specific commands are to be used, but essentially
% the body of the thesis has the same mark-up.
%
% \subsection{Class options}
% The class accepts all the options accepted by the |report| document class
% plus the ones defined here:
% \begin{description}\def\Item[#1]{\item[\texttt{#1}]}
%
% \Item[chapterbib] Allows to typeset a list of references at the end
% of each chapter and the bibliography items are numbered with a \emph{chapter.item}
% indication. This implies a manual build up of each end-of-chapter bibliography
% by means off a specific |thebibliography| environment. This works may be
% avoided if the user relies on the various packages already available in any
% complete \TeX\ system distribution and the facilities offered by packages
% such as \pack{biblatex} and sorting end formatting engines such as \prog{biber}.
%
% \Item[classica] Specifies a general modification of certain details that are
% supposed to be more adequate for theses in humanities; specifically this option
% lets old style numbers to be used for certain numerical pieces of information;
% some variations are also introduced in the title page.
%
% \Item[cucitura] In two sided printing it is better to move the
% typesetting grid towards the outer edges so as to cope with the thesis binding
% that is generally not made up by sewing together a number of signatures;
% the default outer displacement is fixed to~7mm, but it can be customised by means
% of a proper entry in the configuration file or by an explicit command in the preamble.
%
% \Item[14pt] Extends the normal size choice to 14 points; it is appreciated
% in various fields of humanities, but I would discourage this use in a technical
% thesis, where 10 point perhaps is too small, but 11 point or 12 point typesetting
% may be adequate.
%
% \Item[autoretitolo] This option modifies the left hand (even numbered) pages
% in two side typesetting; normally the even numbered page headings contain
% the chapter title, while the odd numbered ones contain the current section title.
% If the \texttt{classica} option has been specified, then with this option it is
% possible to have even numbered headings contain the author's name and the thesis
% title, while the odd numbered ones contain the chapter title. Since the thesis
% title might be too long to fit in the header together with the author's name,
% the |\title| macro as been modified so as to accept an optional short title,
% similarly to the ordinary sectioning commands.
%
% \Item[oldstyle] Also this option works only if \texttt{classica} had already been
% specified; it typesets several numerical data with the old style numbers.
%
% \Item[noTOPfront] allows the user to load a different package for
% creating and typesetting the title page; of course if this option is
% specified, the native package |topfront| is not loaded, and the commands
% described in the next section are not available. On the opposite, commands available
% with the chosen package become available, while possible package conflicts are
% eliminated at the root.
%
% \Item[usefrontespizio] is basically equivalent to the previous option; both
% options set up the |\ifTOPfront| switch that is more mnemonic than the long
% (actually not defined) |\iffrontespizio| one; if it was defined, |\iffrontespizio|
% would be true when |\ifTOPfront| is false.
% \end{description}
%
% \subsection{Title page commands}
% Note: Skip this section if you decide to load an external package for
% the title~page. Notice also that if you want to load an external package for
% typesetting the title page, you should load it \emph{after} specifying
% the input encoding you use for your text files.\bigskip
%
% \noindent The user must specify a certain number of commands in order to have the
% title page contain all the required information. It must be specified that
% most of these commands may be used in the configuration file so as to avoid repeating
% the same data for different ``final reports''; well, a university student might write a
% bachelor's ``monografia'', then a master thesis and finally a doctoral dissertation;
% why should s/he repeat his/her name, the name of the institution, and so on?
%
% All the user commands for the title page redefine default values or strings;
% therefore if none of the required information is given, the default values and strings
% are typeset, possibly with hilarious results\dots
%
% Since most users are supposed to be Italian, the user commands are mostly in Italian;
% the following description gives their names and meanings; every command receives one
% argument; only the command |\title| accepts an optional argument according to the usual
% \LaTeX\ syntax:
% \[
% \makebox[0pt]{%
% \texttt{\char92}\emph{command}\relax
% \texttt{[}\emph{opt\_arg}\texttt{]}\relax
% \texttt{\char123}\emph{req\_arg}\texttt{\char125}\relax
% }
% \]
% \begin{description}
% \def\cs#1{\texttt{\char92#1}}
% \def\Item[#1]{\item[\normalfont\cs{#1}]}
% \item[\textnormal{\ttfamily fontespizio}] and \texttt{frontespizio*} are two
% environments that typeset the title page with two opposite styles: with the
% university logo in the header vs the university logo in the lower part of
% the front page. The commands described in the following items shall be used
% either in the configuration file or within the body of these environments.
%^^A
% \Item[frontespizio] {\tolerance=6000 Even if the above environments are
% recommended, the
% command |\frontespizio|, defined in the previous versions of the TOPtesi
% bundle, is still usable. It typesets the title page according to the actual
% status of the boolean |\topTPTlogos|; the user, before issuing the
% |\frontespizio| command, may set this boolean by means of the |\topTPTlogostrue|
% or |\topTPTlogosfalse|, or with either one of the commands
% |\booltrue{topTPTlogos}| and |\boolfalse{topTPTlogos}|.\par}
%^^A
% \Item[monografia] sets the bachelor's report style and retrieves its title
% \Item[titolo] gets the master or PhD thesis title and an optional thesis short title
% \Item[sottotitolo] gets the thesis subtitle if any
% \Item[materia] gets the name of the subject the thesis deals with
% \Item[Materia] alias for \cs{materia}
% \Item[direttore] gets the name of the Doctoral School Director
% \Item[coordinatore] gets the name of the Doctoral School Coordinator
% \Item[QualificaDirettore] gets the phrase that describes the director or coordinator
% official position; by using the command \cs{direttore} the
% default phrase
% ``Direttore della Scuola di Dottorato'' is printed above the
% ``director's'' name;
% if \cs{coordinatore} is used the default phrase ``Coordinatore della
% Scuola di Dottorato'' is printed instead.
% If neither one is applicable or a description
% in another language is required, this macro is available for
% specifying such position.
% \Item[relatore] gets the name of the thesis first supervisor
% \Item[secondorelatore] gets the name of the second supervisor
% \Item[terzorelatore] gets the name of the third supervisor; it is assumed that the
% number of supervisors never exceeds three.
% \Item[tutore] gets the name of the doctorate tutor; there is no difference
% with regards to the \cs{relatore}, but the default phrase
% ``Tutore'' is printed above this person's name.
% \Item[TutorName] gets the phrase that describes the tutor position, possibly
% in a different language.
% \Item[AdvisorName] gets the string that qualifies the supervisor(s); the default string
% is ``Relatore:'' or ``Relatori:'' for the plural;
% in another language this command is used to define the string,
% say, ``Supervisors:'' if the thesis has been supervised
% by more than one person.
% \Item[CoAdvisorName] gets the string that qualifies the co-supervisor(s); the default
% string is ``Correlatore:'' or ``Correlatori:'' in the plural; this
% command may be used to define the string, say, ``Corapporteur:'' in a
% French Projet de fin d'\'etudes.
% \Item[candidato] gets the name of the male author
% \Item[candidata] gets the name of the female author
% \Item[secondocandidato] gets the name of the second male author
% \Item[secondacandidata] gets the name of the second female author
% \Item[terzocandidato] gets the name of the third male author
% \Item[terzacandidata] gets the name of the third female author; most often the thesis
% author is just one person; but there are some institutions where group
% final works are accepted; it is assumed that the group does not contain
% more than three authors. The specification of the gender allows the
% software to determine the correct labelling phrase in the proper
% gender and proper number.
% For different languages there might be no difference in gender but
% there is a difference in the plural ending.
% \Item[CandidateName] gets the string that describes the student status in a foreign
% language or even in Italian; the default string is ``Candidato:'' (with
% colons) adjusted to masculine or feminine, singular or plural; with the
% option \texttt{classica} the string becomes ``Laureando:''; in other
% languages it is necessary to specify this string in the proper gender
% and number.
% \Item[sedutadilaurea] gets the date of the final exam, or presentation, or defence
% of the thesis; if this date is omitted the default date is the current
% month and year in Italian.
% \Item[esamedidottorato] an alias for \cs{sedutadilaurea} to be used for doctoral
% dissertations.
% \Item[ciclodidottorato] gets the roman numeral that specifies the doctoral cycle.
% \Item[CycleName] redefines the string that expresses the name of the doctoral cycle;
% by default this is ``ciclo'' but this command is useful to set the
% name in a different language.
% \Item[corsodilaurea] gets the proper name of the degree course; the phrase that
% describes the degree course is specified, if necessary, with the
% next command; with this one you specify just, say,
% ``Electrical Engineering''
% \Item[CorsoDiLaureaIn] gets the generic name of the degree course, for example
% ``Bachelor Degree in\textvisiblespace''
% \Item[TesiDiLaurea] gets the generic phrase that describes the thesis; by default it is
% ``Tesi di Laurea''; in English one might set it to ``Master Thesis''.
% \Item[NomeMonografia] gets the phrase that describes the bachelor's report; by default
% it is ``Monografia di Laurea''. In some Italian universities it might
% be called ``Tesi di Laurea'', so that the master thesis should be given
% another qualification, for example ``Tesi di Laurea Magistrale''.
% \Item[NomeDissertazione] gets the phrase that describes the doctoral thesis;
% by default it is ``Tesi di Dottorato''.
% \Item[InName] infix strings often require adjusting of the prepositions; this
% macro gets the preposition that stands for ``in'' (the default).
% In German it might become ``auf''.
% \Item[NomeAnnoAccademico] defines the infix string that stands for ``Academic
% year''. This macro is defined only if the option
% \texttt{classica} is in force; after all the command
% |\annoaccademico| is defined only with that option.
% \Item[logosede] specifies the name of the file or the files that contain
% the university logos; no default is defined; rather a warning
% message is issued if no name is given or the file is missing,
% but typesetting goes on without the inclusion of any logo.
% A list of logos can be specified, useful when a thesis is
% carried on in a multiple University environment
% such as, for example, in a double degree Erasmus
% program; or under the Erasmus Mundus program. The ``string'' of
% logos is scaled properly so that they may fit in |\textwidth|.
% \Item[setbindingcorrection] sets up the length to displace the text block to the
% external margin so as to have a wider internal margin to accommodate
% the binding correction. Its argument is not optional and is used to
% modify the default correction of 7\,mm. Notice that 7\,mm is already
% a large displacement; most often than not the binding correction is
% unnecessary.
% \Item[retrofrontespizio] with its argument, made up of one or several paragraphs,
% defines what should be printed on the verso of the title page,
% generally named ``copyright page''; if this command is specified
% with an empty text or if it is not used at all, no copyright
% page is assumed.
% \end{description}
%
% Since the infix strings are all memorised into control sequences and for each of
% them it is possible to use a defining command, all strings can be modified at will,
% so that there is no difficulty to localise the package in another language;
% this comes particularly handy for the Erasmus students on double degree programs.
%
% As a final remark notice that the commands for typesetting the title page and the
% copyright page are contained in the package \texttt{topfront.sty}, which can be used
% as an autonomous extension to the \texttt{report} document class. One could easily
% typeset either just the title page with a separate \TeX\ source file so as to test the
% completeness of the commands and coherence of the configuration file, or for just
% printing the isolated title and copyright pages (if any).
%
% \subsection{Typesetting commands}
% The TOPtesi bundle and the |toptesi| document class accept all \LaTeX\ commands
% provided by the \LaTeX\ \texttt{kernel}, the \texttt{report} document class, and the
% \texttt{graphicx} extension package, besides those provided by the \texttt{babel}
% package.
% If the source thesis file is being typeset by means of \XeLaTeX\ the \texttt{babel}
% package is not loaded; in its place the \texttt{polyglossia} package is loaded that
% should implement in \XeLaTeX\ most of the functionality provided by \texttt{babel} in
% \LaTeX. ``Most'' means that not all the functionality is available, therefore it's
% better to consult the documentation of \texttt{polyglossia} before using its built
% in commands.
%
% With this respect it must be underlined that the Italian and English languages are
% specified by default, the Italian one being the main language. An initial
% specification of |\selectlanguage{english}| sets the English language as the default.
% Should a student typeset the thesis in French by means of \textsf{pdflatex}, it
% would be necessary to specify the option \texttt{french} among the \emph{class}
% options, and then start the document by specifying |\selectlanguage{french}|.
% But the user should pay attention to use \texttt{babel} in the proper way.
% \begin{enumerate}
% \item Due to the way \LaTeX\ classes load the requested files, and to the fact that the
% \texttt{babel} package has already been loaded by the \texttt{toptesi} class, the user
% cannot reload it with a different list of language options; therefore the latter
% language options \emph{must be specified} as a global class options; so if the
% thesis has to be typeset, for example, in French, is is necessary to do the following:
%\begin{verbatim}
%\documentclass[...,french,...]{toptesi}
%...
%\begin{document}
%\selectlanguage{french}
%\end{verbatim}
% But if the thesis should be typeset in French by means of \XeLaTeX, then it is
% perfectly legal to specify the auxiliary language in this way:
%\begin{verbatim}
%\documentclass[...]{toptesi}
%\setotherlanguage{french}
%...
%\begin{document}
%\selectlanguage{french}
%\end{verbatim}
% \item With the 2010 \TeX\ system complete distributions, both \TeX Live and MiKTeX,
% all known (to \LaTeX) language hyphenation rules are preloaded; with other less up
% to date \TeX\ system distributions this might not be true. With both distributions
% also the language hyphenation rules known to \XeLaTeX\ are all preloaded.
% Remember that \texttt{babel} and \texttt{polyglossia} macros select the language
% typesetting rules, but hyphenation is activated only if the program format file has
% been generated with the pertinent language hyphenation rules. You can check this
% detail by reading the first dozen lines of your thesis \texttt{.log} file; there
% the list of all language hyphenation rules that are available in the format file is
% being shown.
% While (American) English is the default language and almost any \emph{basic}
% distribution of the \TeX\ system has several preloaded languages, it is more
% likely that French is preloaded while Italian is not. Complete distributions don't
% exhibit this flaw.
%
% Should the required language(s) be missing, the user is forced to read his/her
% distribution instructions, so as to find out how to configure his/her system in
% order to preload the languages s/he wants to work with, and finally s/he must
% recreate the format files.
% The user is invited to carefully investigate on these fine points and to properly
% configure the system; it would be very upsetting to use fine software for producing a
% perfectly typeset thesis that, unfortunately, has wrong hyphenation points! Luckily
% enough, recent distributions of the \TeX\ system have all the known hyphenation rules
% preloaded; in any case even older distributions have available command-line commands
% or graphical user interfaces that make it easy to perform the tasks of changing the
% list of preloaded hyphenation rules and rebuilding all the format files, moving them
% to the proper places.
% \end{enumerate}
%
% The TOPtesi bundle adds very little to the user commands; nevertheless the
% package \texttt{topcoman.sty}, that is part of this bundle and is
% automatically loaded, defines some useful commands for typesetting technical
% matters in such a way as to fulfil the ISO regulations.
% Some of these commands are already defined with the \texttt{babel} Italian
% option, but if your thesis is written in different languages it may happen
% that such commands are not available any more when you select another
% language; with the presence of the definitions contained in
% \texttt{topcoman.sty} such useful commands remain available with every
% language. The \texttt{polyglossia} package does not produce any useful
% additional command for writing in a ISO compliant way, therefore the macros
% contained in the \texttt{topcoman.sty} package come very handy.
%
% The following description specifies these particular commands.
% \begin{description}
% \def\Item[#1]{\item[\normalfont\texttt{\char92#1}]}
% \Item[DeclareSlantedCapitalGreekLetters] does exactly what its name
% means: it changes the definitions of the mathematical capital Greek letters
% so that they are typeset in ``italics''; they are in effects taken from
% the math italic alphabet, instead of the default roman one. This option
% is useful with \LaTeX, while with \XeLaTeX\ it is unnecessary due to the
% larger set of math alphabets and math font commands that are available
% with proper UNICODE math fonts.
% %
% \Item[ensuremath] should be already defined in the \LaTeX\ kernel;
% should one still be using an obsolete version, this command gets
% available anyhow.
% %
% \Item[ohm] typesets an upright capital omega even if the capital Greek
% letters are in italics; another good point is that |\ohm| can be used also
% in text mode.
% %
% \Item[ped] inserts a subscript in upright type; the ISO regulations
% require the use of italics for physical or mathematical quantities, and
% upright type for anything that is not a variable, from the names of
% functions (such as sin, cos, log, etc.), to the indices that contain
% information on something that is not variable. This means that $V_i$
% requires an italic index to imply that the object $V$ is the $i$-th in
% a set, while, say, $V_{\mathrm{max}}$ indicates the maximum value of the
% variable $V$. This command |\ped| may be used in both math and text mode.
% %
% \Item[ap] similarly |\ap| inserts an apex in upright type, in both math
% and text mode.
% %
% \Item[unit] sets the unit of measure close to the numerical measure value by
% inserting a non breakable thin space and by setting the units of
% measure in upright type; this works both in math and text mode. Of
% course it is necessary to input the |\unit| command without intervening
% spaces in the source file; it's necessary to typeset, say,
% |35\unit{km}| while avoiding \verb*+35 \unit{km}+. This command,
% as it is defined, conflicts with the definition of the homonymous
% command |\unit| as defined by the \texttt{unitsx} package, but since
% this latter package is necessarily input in the preamble, while
% \texttt{topcoman.sty} is read at the execution of |\begin{document}|,
% the latter file has provisions to test if |unitsx| has already been loaded,
% so as not to overwrite the latter package definition and to avoid every
% possible conflict. On the opposite, if the user loads package |siunitx|
% (the most performant one in the field of units and number handling),
% the command |\unit| remains available, because it is redefined in terms
% of this package commands.
% %
% \Item[micro] sets the decimal prefix $\mu$ when typesetting units of
% measure.
% %
% \Item[gradi] sets the small circle that defines the sexagesimal degrees, for
% example $35^\circ$; it may be used also for the celsius degrees by writing
% in the source file, say, |35\unit{\gradi C}| in order to get
% $35\,^\circ\mathrm{C}$; notice the difference with |35\gradi|, that yields
% $35^\circ$ without any space between the measure and the ``degree'' little
% circle; this is what the ISO regulations require; the small space inserted
% by |\unit| is required when the unit of measure symbol contains at least
% one letter.
% %
% \Item[gei] inserts the imaginary unit in upright type with the
% ``spelling'' used by the technologists: ``j''. This command may be
% redefined, of course, but this strange name is due to the fact that
% nowadays the letter ``j'' in Italian is called with the English name
% (much shorter than the traditional Italian name ``i~lunga'') and the
% indicated spelling ``gei'' is the phonetic Italian rendering of the
% English word. The imaginary unit is not a variable, and the ISO regulations
% require it is typed with an upright serifed font, just as operators are.
% %
% \Item[eu] inserts the Napier number symbol ``e'' in upright type; since
% this entity is not a variable, but is a mathematical constant, the ISO
% regulations require it to be written in upright type. The ISO regulations
% require the upright type for ``e'' and any other mathematical constant, but
% the electron charge $e$ is typeset in math italics because this is a physical
% ``constant'', not a mathematical one. \XeTeX\ allows to typeset upright
% math Greek letters, so there is the facility to typeset an upright ``pi''
% (the number) to be distinguished from a slanted ''pi'' (the angle).
% %
% \Item[goodpagebreak] inserts a conditional page break after the line
% where this command appears; it is not equivalent to the |\raggedbottom|
% declaration that does not vertically justify any page, but tests the
% amount of space remaining on the page, and if less than a given number of
% lines are available, it inserts a page break; the result is a ragged bottom
% single page, that sometimes is better than loose spacing between paragraphs,
% or within items of a list, or before or after displayed material. It is
% handy also to use before starting a new section, because at least four
% lines are required by \LaTeX\ in order to avoid orphan lines.
%
% \Item[listing] requires for its argument the name of a file and typesets
% it in verbatim mode; this command is very useful for typesetting the
% listings of the programs that were written for the thesis; for best results
% it is recommended that the source program has lines not longer than
% 80 characters. There exists an external package \texttt{listings}, that
% the user might want to load, that does a similar work in a more professional
% and configurable way; this package simpler command might be preferable for
% its simplicity, but of course it is not compulsory.
% \end{description}
%
% All these commands are defined into the separate package \texttt{topcoman.sty}
% that might be used as an independent extension package with any document class.
%
% \section{PDF/A archivable format}
% This section in general applies also if the thesis is typeset by means of
% \XeLaTeX\ or \LuaLaTeX, but in this case special attention should be given
% to the details of the procedure as described in the documentation of the
% \pack{pdfx} package. Even better, \LuaLaTeX, whose source file is
% practically the same as that of \XeLaTeX, may produce in a simpler way
% a PDF/A compliant output file if the users follow attentively the
% instructions contained in the documentation of the \pack{pdfx} package.
%
% More details are given in the Italian documentation contained in file
% \texttt{toptesi\discretionary{-}{}{-}it-pdftex}.
%
% Politecnico di Torino as well as many other Italian and foreign universities
% are moving towards archiving theses in electronic format, specifically in the
% PDF one. The problem of course is: ``Will it be possible to read the archived
% documents, say, fifty years from now?''
%
% This essential question has been answered by the International Standards
% Organisation (ISO) that in 2005 published the regulation ISO~19005-1. This
% regulation defines a PDF variant suitable for archiving, named PDF/A, that
% has two sub-formats distinguished as PDF/A-1a, and PDF/A-1b. The `a'
% sub-format is more exacting, while the `b' one is less stringent. Recently
% ISO has published upgrades to these regulations, but here we stick to the
% older ones, that are a sub set of the newer ones, and for which suitable
% software is available.
%
% The requirements for the `a' sub-format imply not only those imposed on
% the `b' one, but also that the logical structure of the document be
% accessible from outside (Tagged PDF).
% The requirements for the `b' sub-format are that the
% document must be reproducible without modifications exactly as it was at
% the moment of archiving. Both sub-formats must contain \emph{metadata}
% that are searchable even without decompressing the normally compressed
% PDF file, and that contain information useful for archive maintenance;
% among these informations, of course, the PDF/A category the document belongs
% to, the document title, the authors, and few other optional pieces of
% information, such as the keywords that ease up library searches.
%
% Since version 1.40, the program \texttt{pdflatex} is capable of producing
% PDF/A-1b compliant files, provided that some attention is put into
% editing of the source file of the thesis. With the distribution of
% the 2008 version of the \TeX\ system, the executable \texttt{pdflatex} has
% version number 1.40.9 (or higher) and is capable of producing PDF/A-1b files.
%
% The particular attention needed to avoid problems with the PDF/A compliance
% is summarised as follows:
% \begin{enumerate}
% \item The preliminary essential requirement is that the \texttt{pdflatex}
% engine used to typeset the thesis be sufficiently recent to support the
% PDF/A requirements. It's better to have the most recent distribution of
% the \TeX\ system installed on your PC. Do not try to typeset the thesis
% with the `old' \LaTeX; you \emph{must} process the input thesis file(s)
% with \texttt{pdflatex} or with \prog{xelatex} or with \prog{lualatex};
% in the following, no specific check will be made in order to verify if
% you are actually using \texttt{pdflatex}. If you really need to use the
% `old' \LaTeX, you get a DVI file and you need to transform it with |dvips|
% into a PS file; at this point you have lost the possibility of exploiting
% the internal commands of |pdflatex| version 1.40.9 or later. You can still
% produce a PDF/A final document, but you have to transform it by means of
% the procedures described in the Italian documentation; such documenttion
% describes several more or less effective methods to transform
% a non compliant PDF/A file into a compliant one, and how to correct the
% ``imperfections'' that forbid any valid transformation.
%
% \item Since 2016 the TeXLive distribution contains a new version of
% \pack{pdfx} and now PDF documents produced with \prog{lualatex} may be
% fully compatible with the standard PDF/A. With some special care, even
% \prog{xelatex} can now produce PDF/A compliant output files.
%
% \item Your up-to-date complete \TeX\ distribution should contain the package
% \textsf{pdfx}; if it does not, upgrade your \TeX\ system complete
% distribution. Be sure that the version number of the \pack{pdfx} package
% has version number 1.5.8 or higher.
%
% \item If your thesis main file, the one you run your \texttt{pdflatex} on,
% is named, say, \texttt{JohnSmithMasterThesis.tex}, prepare in the same
% directory another file named \texttt{JohnSmithMasterThesis.xmpdata} that
% contains the \emph{metadata} relative to the thesis; pay attention to
% follow the stringent syntax described and exemplified in the \textsf{pdfx}
% documentation. A minimal set of \emph{metadata} example would be the
% following one:
% \begin{verbatim}
% \Title{Experiments in Trichotetratomy}
% \Author{John Smith}
% \end{verbatim}
% The keyword list requires a specific format that can be examined
% in the package documentation. The best way to be sure that this file
% accompanies the thesis main file, is to put its contents in a
% \env{filecontents*} environment before the |\documentclass| declaration.
% The details are in the documentation of the \pack{pdfx} package.
%
% \item Some mathematical symbol commands obtained from the standard \LaTeX\
% set-up and the standard mathematical fonts require some patching that is
% already included in this \texttt{TOPtesi} bundle; but it is not excluded
% that with other fonts similar patches might be requested. The UNICODE
% math fonts used by \XeLaTeX\ and \LuaLaTeX\ do not require any patch.
%
% \item Use only PNG and JPEG images with RGB color profiles. If a PNG image
% file contains some transparencies, the document PDF cannot be validated
% as PDF/A compliant.
%
% \item If you include PDF images that contain some text, be sure that the
% fonts for this text are completely embedded in the included file. Should
% the PDF file come from an external drawing program be sure to configure
% that program so that it embeds all the fonts used in the image. If you
% don't succeed, open the PDF file with the free program \texttt{inkscape}
% and save it back in PDF format; the missing fonts will be replaced with
% their traced outlines and this will not disturb the PDF/A conformity. Pay
% attention, because Inkscape might save your file with some specifications
% for transparency; transparency specification destroy the PDF/A compliance.
%
% \item Verify your final PDF file with a suitable program and do not give
% up doing the necessary corrections or modifications while the verification
% program keeps saying that this or that is not compliant with the PDF/A
% specification. A suitable program is the Preflight module of Adobe Acrobat
% Pro~XI, but this, although the most authoritative, is a commercial program;
% probably your university has special facilities for this task.
%
% \item There exist an experimental freeware program \prog{veraPDF} that
% can be downloaded from the Web, that performs quite well in checking
% the PDF/A conformity of a PDF file; read more in the \pack{TOPtesi}
% Italian documentation.
%
%\end{enumerate}
%
% Warning: if you are using Adobe Reader X (or later), this program will open
% a PDF file beginning with an information header stating that the file
% PDF/A claims to be compliant; maybe it's true, but do not trust this
% information too much, at least don't believe that this information is a
% ``certification'' of the PDF/A compliance. I have seen files with this
% comforting information that did not pass the Preflight test!
%
% Up to today the realisation of PDF/A conforming files sets forth several
% problems that are of great concern for the large Institutions that have
% thousands of documents a year to archive; it is not a question implied
% in the free nature of the \prog{pdflatex}, \prog{xelatex}, and \prog{lualatex}
% programs, that, on the opposite, according to my experience, have a very high
% rate of success in producing PDF/A compliant documents. If you stick to the
% default \TeX\ system Type~1, 256-glyph fonts, or to the UNICODE encoded otf
% or ttf fonts and use this version of \texttt{TOPtesi} you should be able
% to avoid most problems.
%
% \StopEventually{} ^^A Bibliography?
%
% \section{Documented code}
% \subsection{The class code}
%
% Here begins the usual machinery for stating the required \TeX\ format
% and for sharing some code between the driver and the class part of the code, since they are
% supposed to carry the same date and version number, besides the description string.
% \iffalse
%<*class>
% \fi
%
% The class itself is very simple since it requires just the \texttt{report}
% document class and some packages with some default options. All options
% specified for the \texttt{toptesi} class are passed on to the \texttt{report}
% class; the |a4paper| option is made the default, but the user can call the
% class with any valid \LaTeX\ paper size. According to the \LaTeX\ machinery
% of option passing, the |\ExecuteOption| command assures that |a4paper|
% is the default size, but it is not being used if another paper size code is
% specified to the class. The same holds true for the other class options,
% except for the encoding code string because their passing machinery does
% not hold true for the \pack{inputenc} package; therefore this package is
% not loaded any more as it was in previous versions of the class\footnote{Thanks
% to Enrico Gregorio who pointed out this feature.}. On the opposite if another
% language is specified in the list of \pack{toptesi} class options, this
% language would be appended to the \pack{babel} package default options and,
% beware!, it would become the default language.
% \begin{macrocode}
\DeclareOption{a4paper}{\PassOptionsToClass{\CurrentOption}{report}}
\DeclareOption{titlepage}{\PassOptionsToClass{\CurrentOption}{report}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ExecuteOptions{a4paper,titlepage}
\ProcessOptions\relax
\LoadClass{report}
\RequirePackage{iftex}
\ifPDFTeX
\RequirePackage[english,italian]{babel}
\else
\RequirePackage{polyglossia}
\setmainlanguage{italian}
\setotherlanguage{english}
\renewcommand*{\iflanguage}[1]{\ifnum\the\language=\csname l@#1\endcsname
\expandafter\@firstoftwo\else
\expandafter\@secondoftwo\fi}
\fi
\RequirePackage{toptesi}
%
% \end{macrocode}
% \iffalse
%</class>
% \fi
% \subsection{The \texttt{toptesi.sty} code}
% The greatest part of the \texttt{toptesi} class code is saved into a separate
% file partly for backward compatibility reasons (before version 3.x
% \texttt{toptesi} was just an extension to the \texttt{report} class) and
% partly because it might be used as a stand alone package, although, take
% notice, it might create some conflicts with with the \texttt{book} class code
% (although with the latest versions of |toptesi| we did not notice any conflict)
% while certainly it is incompatible with the \texttt{article} class. This
% package must contain its own \TeX\ format declaration and might have different
% version and subversion numbers compared to the class file and the other invoked
% packages that are part of the same bundle.
%
% \iffalse
%<*topsty>
% \fi
%
% We start with defining the debugging macros; these trace commands and macros
% are the usual ones I use for debugging. I know the \texttt{trace} package is supposed
% to be much better, but sometimes I use these ones.
% \begin{macrocode}
\def\TRON{\tracingcommands \tw@ \tracingmacros \tw@}
\def\TROFF{\tracingcommands\z@ \tracingmacros \z@}
\let\TROF\TROFF
% \end{macrocode}
%
% Now we define the specific package options: \texttt{classica} and
% \texttt{trieste} are identical; the use of \texttt{trieste} is discouraged,
% but this option is maintained for backward compatibility.
% The option \texttt{14pt} is for choosing a normal size of 14pt; the class option
% file \texttt{size14.clo} is distributed with the \pack{extsizes} package and
% is already included in any complete distribution of the major \TeX\ system ones;
% in previous versions of this bundle there was a specific option class file for
% this large size, but with the latest complete distributions available, there
% is no chance that the existing option file is missing.
%
% \texttt{chapterbib} allows to set a list of references at the end of each
% chapter.
%
% For the options some boolean variables are
% defined and the option definitions set some of them to the value ``true''.
% \begin{macrocode}
\newif\if@utoretitolo \@utoretitolofalse
\newif\if@ldstyle \@ldstylefalse
\newif\if@xivpt \@xivptfalse
\newif\ifT@Pfrontespizio \T@Pfrontespiziofalse
\newif\ifTOPfront \TOPfronttrue
% \end{macrocode}
%
% A binding correction is established; its default value is parametrised to
% the paper dimensions, even if this correction should actually not depend
% on the paper size; the paper flexibility at the spine margin should be
% independent from its width; nevertheless large sizes allow for larger
% default corrections. In any case the user can override this setting by
% using the specific command |\setbindingcorrection|. The recommendation
% to the user is to not exaggerate with this correction. The options
% |usefrontespizio| and |noTOPfront| are synonymous; the latter should be
% preferred to the former one.
% \begin{macrocode}
\newlength\T@Pbinding\setlength\T@Pbinding{7mm}
\def\setbindingcorrection#1{\T@Pbinding=#1}
\newif\if@binding \@bindingfalse
\newif\ifchapterbibliography \chapterbibliographyfalse
\newif\ifclassica \classicafalse
\DeclareOption{cucitura}{\@bindingtrue}
\DeclareOption{14pt}{\@xivpttrue}
\DeclareOption{chapterbib}{\chapterbibliographytrue}
\DeclareOption{trieste}{\classicatrue}% Just for backwards compatibility
\DeclareOption{classica}{\classicatrue}
\DeclareOption{autoretitolo}{\ifclassica\@utoretitolotrue\fi}
\DeclareOption{oldstyle}{\ifclassica\@ldstyletrue\fi}
\DeclareOption{pdfa}{\PackageWarning{toptesi}{Option pdfa ignored.\MessageBreak
Read documentation toptesi-it-*.pdf, because package pdfx has changed}}
\DeclareOption{usefrontespizio}{\T@Pfrontespiziotrue\TOPfrontfalse}
\DeclareOption{noTOPfront}{\T@Pfrontespiziotrue\TOPfrontfalse}
%
\ProcessOptions\relax
% \end{macrocode}
% The \texttt{graphicx} package is loaded by default; it is required for
% inserting the university logo(s); if the user forgets that this package has
% already been loaded nothing dramatic happens, because the |\usepackage|
% and |\RequirePackage| macros perform the necessary tests in order to avoid
% reloading the same packages again and again.
%
% \begin{macrocode}
\RequirePackage{graphicx}
\RequirePackage{etoolbox}
\if@xivpt\input{size14.clo}\fi
% \end{macrocode}
%
% The |\textheight| is parametrised to the paper height and adjusted so as to
% contain an integer number of normal text lines. A new dimension is defined
% to hold the actual value of the inner/spine margin.
%
% \begin{macrocode}
\newlength\interno
\textheight 0.7\paperheight
\setlength{\textheight}{\dimexpr\textheight*\baselineskip/\baselineskip+\topskip}
% \end{macrocode}
% The inner margin is parametrised to the paper width, but a small correction
% is made if the extra size of 14pt is chosen. Also |\footskip| is parametrised
% to the paper height in a slightly different way when the large |14pt| size is
% chosen.
% \begin{macrocode}
\ifx\f@size\@xivpt
\setlength\interno{\dimexpr\paperwidth/6}
\footskip=1,5\baselineskip
\else
\setlength\interno{\dimexpr\paperwidth/7}
\footskip=2\baselineskip
\fi
% \end{macrocode}
% The convenience of holding the spine margin within a dimensional register
% becomes really useful now in order to define the other text-body
% grid-dimensions.
% Without binding correction the inner and outer margin are chosen equal, but
% the grid is moved outwards if the binding correction option is specified.
% \begin{macrocode}
\textwidth=\dimexpr\paperwidth-2\interno\relax
\oddsidemargin=\dimexpr\interno-1in\relax
\evensidemargin=\oddsidemargin
\marginparwidth=\dimexpr\interno-2.5\marginparsep