summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/unifith/unifith-doc.tex
blob: cc7e9e46aac2a062e26a5fd24d08ace139c50706 (plain)
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
% !TeX encoding = UTF-8
% !TeX program = pdflatex
% !TeX spellcheck = en_US


\documentclass[a5paper,11pt]{article}

\usepackage[scale=0.85, footskip=0.8cm,heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage[helvratio=0.88]{newtxtext}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage[varg,cmintegrals,cmbraces]{newtxmath}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{curve2e}
\usepackage{color}
\definecolor{gray}{gray}{0.4}
\definecolor{sfondoblu}{rgb}{0.94,0.97,1}
\usepackage{listings}
\lstset{language=[LaTeX]TeX,
	basicstyle=\scriptsize\ttfamily,
	keywordstyle=\color{blue}\bfseries,
	commentstyle=\color{gray},
	backgroundcolor=\color{sfondoblu},
	frameround=tttt,
	frame=tlrb,
	escapechar=|,
	morekeywords={submitdate, cycle,  courseorganizer, AcademicYear, copyyear, Faculty, course, PhDorganizer, IDnumber, advisor, examdate, examiner, authoremail, frontmatter, mainmatter, maketitle, tableofcontents, chapter, appendix, backmatter, dedication, selectlanguage,alttitle,thesistype,phantomsection},
	columns=flexible
}

\usepackage{multicol}

% eliminate dots in the table of contents
\makeatletter
\renewcommand{\@dotsep}{10000}
\makeatother

\usepackage[bookmarks=false,hyperfootnotes=false]{hyperref}
\hypersetup{
			colorlinks=true,
			linkcolor=blue,
			anchorcolor=blue,
			citecolor=blue,
			urlcolor=blue,
			pdftitle={unifith.cls documentation},
			pdfauthor={Francesco Biccari}
}

\newcommand{\bs}{\textbackslash}
\newcommand{\sq}{\textquotesingle}

\author{\small Francesco Biccari\\\small(\href{mailto:biccari@gmail.com}{biccari@gmail.com})}
\title{\small Documentation of the \LaTeX\ class\\
		\Large \textbf{\texttt{unifith.cls}}\\
		\small \vspace{0.2cm} Version 1.6, 2021-10-01
}
\date{}

% degree
  \providecommand{\degree}{\mbox{\textdegree}}
  \providecommand{\g}{\degree}

  % gradi Celsius
  \providecommand{\celsius}{\ensuremath{\textrm{\upshape\textdegree}\kern-\scriptspace\mathrm{C}}}
  \providecommand{\C}{\celsius}
  
  % Angstrom
  \providecommand{\angstrom}{\mbox{\AA}}
  \providecommand{\A}{\angstrom}
  
  % micro
  \providecommand{\micro}{\mbox{\textmu}}
  
  % Ohm
  \providecommand{\ohm}{\ensuremath{\mbox{\textohm}}}
  
  % Napier's number
  \providecommand{\eu}{\ensuremath{\mathrm{e}}}
  
  % imaginary unit
  \providecommand{\iu}{\ensuremath{\mathrm{i}}}
  
  % roman subscript
  \providecommand*{\rb}[1]{\ensuremath{_\mathrm{#1}}}
  
  % roman superscript
  \providecommand*{\rp}[1]{\ensuremath{^\mathrm{#1}}}

  % differential (only math)
  \providecommand{\di}{\mathop{}\!d}
  
  % derivative and partial derivative (only math)
  \providecommand*{\der}[3][]{\frac{d^{#1}#2}{d #3^{#1}}}
  \providecommand*{\pder}[3][]{%
    \frac{\partial^{#1}#2}{\partial #3^{#1}}%
  }

  % measurement unit
  \providecommand*{\un}[1]{\ensuremath{\mathrm{\,#1}}}
  
  
  \newcommand{\unifith}{\textsf{UniFiTh}}
  
\begin{document}
\maketitle

\begin{abstract}\noindent
This document describes how to use \texttt{unifith.cls}, a \LaTeX\ document class for the typesetting of the theses of the ``University of Florence''. The official web page of \textsf{UniFiTh} is {\footnotesize\url{http://biccari.altervista.org/c/informatica/latex/unifith.php}}.
\end{abstract}

\setcounter{tocdepth}{2}
\renewcommand{\columnseprule}{0.4pt}
\setlength{\columnsep}{1.5cm}

\addtocontents{toc}{\protect\begin{multicols}{2}}
{\small
\tableofcontents}

\clearpage

\section{Introduction}

After several years in my faculty I noticed that usually students spend a lot of time to refine the aesthetic aspect of their \LaTeX\ documents instead of focusing on the content.
This is against the philosophy of \LaTeX, which was created to relieve the writer from the typesetter's work.
Apart from the time spent, the resulting documents are obviously all different from each other and good aesthetic results are not always achieved.
This has a negative impact both on the student's work and on the university.
For these reasons I thought that a \LaTeX\ class for the theses of my 
university would have been a good idea.
\textsf{UniFiTh} is the result of my work.
It has been developed starting from \textsf{Sapthesis} class of the same author. \textsf{UniFiTh} follows the rules of the Communication Plan of the University of Florence: {\footnotesize\url{https://www.unifi.it/ls-36-unifi-comunica.html}}. At that link you can find the guidelines for the preparation of the documents, the files of the logo and some examples. 

To give a look to a document composed by \textsf{UniFiTh} class, compile one of the several examples in the \texttt{examples} directory.
In those files the page layout and the layout choices are explained.
\textsf{UniFiTh} is released under the terms of the latest version (1.3c) of the 
\href{http://www.latex-project.org/lppl/}{\LaTeX\ Project Public License}.

I would like to thank the Italian \TeX\ user group (\href{http://www.guitex.org/}{GuIT}) for the help provided. I would like to thank also Giacomo Mazzamuto and Lorenzo Pattelli and all the users who reported bugs and suggestions.

\section[Requirements\\ and installation]{Requirements and installation}
\label{requirements_installation}

The simplest way to install \textsf{UniFiTh} is by the package manager of 
your \TeX\ distribution (\TeX\ Live or MiK\TeX). For manual installation see 
the \texttt{README} file. 

The \textsf{UniFiTh} package provides: the 
\texttt{unifith.cls} class file; the documentation 
\texttt{unifith-doc.pdf} (this file) and its source code; the logo of the 
University of Florence (see next section); several usage examples.


\textsf{UniFiTh} explicitely loads the packages \textsf{xkeyval}, \textsf{etoolbox}, \textsf{geometry}, \textsf{ifxetex}, \textsf{fontspec}, \textsf{fontenc}, \textsf{textcomp}, \textsf{lmodern}, \textsf{caption}, \textsf{graphicx}, \textsf{color}, \textsf{booktabs}, \textsf{amsmath}, \textsf{fancyhdr}.
Do \textbf{not} include these packages in the preamble of your document!


\subsection[The problem of the logo]{The problem of the logo}
\label{logo_problem}

I cannot upload the logo of the University of Florence on the TeX Live and MiKTeX repositories because they accept only \href{https://en.wikipedia.org/wiki/Free_software}{\emph{free softwares}}. Therefore, if you have installed \textsf{UniFiTh} by the package manager of your \TeX\ distribution or from CTAN, after the compilation of your thesis file, you will obtain a frontispiece with a white rectangle instead of the University of Florence logo. In the white rectangle you will find the web address to download the logo in pdf format\footnote{The link to download the logo is \url{http://biccari.altervista.org/c/informatica/latex/unifilogo.pdf}}. Save the logo (keeping the name \texttt{unifilogo.pdf}) in the same folder of your main \texttt{.tex} thesis file. Then compile again and everything should be fine. 

Instead, if you have manually downloaded the package from the official web page of \textsf{UniFiTh}, you do not have to do anything.

\section{Usage}

A \LaTeX\ document based on \textsf{UniFiTh} can be compiled only by the commands
\texttt{pdflatex} and \texttt{xelatex}. In this manual only \texttt{pdflatex} will be considered.


As usual, in order to use this class, you need to call it by
\begin{lstlisting}
\documentclass[|\textit{\texttt{options}}|]{unifith}
\end{lstlisting}
You have to specify the class options for your case (see Sec.~\ref{class_options}). Then you have to provide some fundamental information (title, author, etc\ldots) by specific commands in the preamble (see Sec.~\ref{commands_titlepage}). Finally, remember to follow a source code structure similar to those of the examples given in App.~\ref{sec:PhDexample} and~\ref{sec:LaMexample}.
Especially the usage of the commands \texttt{\bs frontmatter}, \texttt{\bs mainmatter} and \texttt{\bs backmatter} is mandatory, otherwise the page style of the document will be wrong!

This class supports, at the moment, two languages: Italian and English. English is the default.
If your thesis contains only English or very few paragraphs in another language, do not use the \texttt{babel} package because completely useless. Instead, if you write in Italian, load the \texttt{babel} package with the
\texttt{italian} option: \texttt{\bs usepackage[italian]\{babel\}}.

\subsection{Class options}
\label{class_options}
The following options can be passed to the \texttt{\bs documentclass} command.

\begin{description}

\item[\texttt{a4paper/a5paper/b5paper}] Choose one of these three options to set the paper format. The default value is \texttt{a4paper}.
\item[\texttt{layout=\textsl{a5paper/b5paper}}] If, for some reason, it is impossible to print on A5 or B5 directly (printer not supporting those formats, paper not available, ...), it is possible to specify the A5 or B5 layout, maintaining the A4 paper format. In this case some cropmarks will be printed to show where the page should be cut.
\item[\texttt{draft}] The usual \texttt{draft} option of the \LaTeX\ Standard Classes.
\item[\texttt{oneside}] The usual \texttt{oneside} option of the \LaTeX\ Standard Classes.
\item[\texttt{twoside}] (default) The usual \texttt{twoside} option of the \LaTeX\ Standard Classes.

\item[\texttt{binding=\textsl{length}}] (zero default binding)
The value of this option is an offset of the text column.
It is useful to take into account the margin for the binding (ask to your bookbinder for information).
\item[\texttt{noexaminfo}] Suppress all the final exam informations. Indeed, by default, \textsf{UniFiTh} shows some information about the final thesis discussion on the back of the title page. By default it shows the phrase ``Thesis not yet defended''. Otherwise, as explained later, giving the commands 
\texttt{\bs examdate\{\dots\}} and \texttt{\bs examiner\{\dots\}} the date and
the examiners list are shown.
\item[\texttt{nodefaultfont}] Avoid the loading of packages \textsf{fontenc}, \textsf{textcomp} and \textsf{lmodern}.
\item[\texttt{romandiff}] See App.~\ref{sec:usefulcommands}.
\item[\texttt{fem}] Use the feminine (only Italian): shows ``candidata'' instead of ``candidato''.
\end{description}

\subsection[Commands for the\\ title page]{Commands for the title page}
\label{commands_titlepage}

As usual, the title page is generated by the \texttt{\bs maketitle} command.
It needs some information that you can supply by the following commands
in the preamble.
\begin{description}
\item[\texttt{\bs title\{\dots\}}] Mandatory. Title.

\item[\texttt{\bs subtitle\{\dots\}}] Optional. Subtitle (try to avoid a subtitle). An alias of this coomand is \texttt{\bs alttitle\{\dots\}} (alternative title).

\item[\texttt{\bs author\{\dots\}}] Mandatory. Author (student's name). See the \texttt{fem} class option described in the previous section.

\item[\texttt{\bs IDnumber\{\dots\}}] Mandatory. ID number (\textit{matricola} in Italian).

\item[\texttt{\bs course\{\dots\}}] Mandatory. Use the official Italian name of the course.

\item[\texttt{\bs cycle\{\dots\}}] Mandatory only for PhD's. Use the form: \texttt{\bs cycle\{XXII\}}

\item[\texttt{\bs courseorganizer\{\dots\}}] Mandatory. Course organizer (for example Scuola di Scienze Matematiche Fisiche e Naturali). The usual \bs\bs can be use to break the lines.

\item[\texttt{\bs AcademicYear\{\dots\}}] Academic Year.

\item[\texttt{\bs advisor\{\dots\}}] You must specify at least one advisor.
If you have more than one advisor, put several advisor commands in the correct order:\\
\texttt{\bs advisor\{Prof.~Pippo\}} \texttt{\bs advisor\{Dr.~Pluto\}}

\item[\texttt{\bs coadvisor\{\dots\}}] Optional. Co-advisors of the thesis. 
Same syntax of the \texttt{\bs advisor} command.

\item[\texttt{\bs customcoadvisorlabel\{\dots\}}] Optional. Specify the label for co-advisors. It can be used to print ``external advisor'' or similar labels.

\item[\texttt{\bs director\{\dots\}}] Optional. Director of the PhD program. Head of the Specialization degree. Same syntax of the \texttt{\bs advisor} command.

\item[\texttt{\bs customdirectorlabel\{\dots\}}] Optional. Specify the label for director.

\end{description}

Together with the title page, \unifith\ will also compose an information page just after the title page. See also the \texttt{\bs noexaminfo} class option described in a previous section. Here follow the necessary commands to compose this page.
\begin{description}
\item[\texttt{\bs examdate\{\dots\}}] Optional. Date of the final exam.\\
Example: \texttt{\bs examdate\{16 February 2010\}}.

\item[\texttt{\bs examiner[\dots]\{\dots\}}] Optional. Specifies the members of the
board of examiners of the final exam. Usage similar to \texttt{\bs advisor} command. The optional argument can be used to specify the role of that examiner in the commission.

\item[\texttt{\bs thesistype\{\dots\}}] Optional. Type of thesis (usually PhD thesis, Master thesis, and so on). 

\item[\texttt{\bs ISBN\{\dots\}}] Optional. ISBN

\item[\texttt{\bs copyyear\{\dots\}}] Mandatory. Copyright year (usually the 
graduation year).

\item[\texttt{\bs copyrightstatement\{\dots\}}] Optional. Specify a copyright statement that will be printed in place of the default one.

\item[\texttt{\bs versiondate\{\dots\}}] Optional. Date version of the thesis.

\item[\texttt{\bs website\{\dots\}}] Optional. Thesis website. Automatically 
hyper-linked if \textsf{hyperref} package is loaded.

\item[\texttt{\bs authoremail\{\dots\}}] Mandatory. Email of the thesis author.
It is automatically hyper-linked if \textsf{hyperref} package is loaded.

\item[\texttt{\bs reviewer\{\dots\}}] Optional. Reviewers of the thesis (typically this applies to PhD theses only). Same syntax of the \texttt{\bs advisor} command. The list of the reviewer is preceded by the a text which can be specified by the \texttt{\bs reviewerlabel\{\dots\}} command.


\end{description}



\subsection[Other commands\\ and environments]{Other commands and environments}

\begin{description}

\item[\texttt{\bs dedication\{\dots\}}] A command to compose the dedication.

\item[\texttt{abstract}] An environment to compose the abstract of your document. This environment has an optional parameter to choose the title of the abstract section.
If you use a language for the abstract different from that of the thesis, consider the \texttt{\bs selectlanguage\{\dots\}} command provided by the \texttt{babel} package.

\item[\texttt{acknowledgments}] An environment to compose the acknowledgments of your document. This environment has an optional parameter to choose the title of the acknowledgments section.
If you use a language for the acknowledgments different from that of the thesis, consider the \texttt{\bs selectlanguage\{\dots\}} command provided by the \texttt{babel} package.


\end{description}

The \textsf{UniFiTh} class defines also the color \texttt{unifiblue} which is the \emph{UniFi blue}: RGB(0,82,147).
Example of usage: \texttt{\bs textcolor\{unifiblue\}\{blah blah\}}


\section{Recommendations}

\begin{itemize}

\item Do \textbf{not} change the default layout.

\item Do \textbf{not} load the packages already loaded by \textsf{UniFiTh} (see Sec.~\ref{requirements_installation}).

\item As you already should know, \LaTeX\ can process only documents
in pure ASCII. If you want to insert \emph{directly} other characters, not included in the 128 ASCII characters (for example accented letters), you have to use a particular text encoding for your source file. Then you have to ``tell'' to \LaTeX\ which encoding you have chosen by the packages \texttt{inputenc}. It is always recommended to use UTF-8 character encoding and specify this choice also by the \emph{magic lines} at the beginning of the source code (see the examples in App.~\ref{sec:PhDexample} and~\ref{sec:LaMexample}).

\item Respect the following thesis structure:

\begin{itemize}
\item Title page (\texttt{\bs maketitle} command)
\item Dedication (\texttt{\bs dedication} command)
\item Abstract (\texttt{abstract} environment)
\item Acknowledgements (\texttt{acknowledgments} environment)
\item Table of contents (\texttt{\bs tableofcontens} command)
\item Chapters
\item Appendices
\item Bibliography
\end{itemize}

\item It is recommended to avoid or limit the acknowledgments in a thesis, it 
is not very professional. The dedication should be enough.

\item Do not put any preface in your thesis. The preface should be written only by an eminent expert in the field to comment exceptionally important results of the student.

\item Usually tables and figures are centered. Remember that, according to the typographic rules, the table captions should be placed \textbf{above} the table, whereas the figure caption should be placed \textbf{below} the figure.

\item If the figure has a small width, it is possible to put the figure caption
aside the figure using the \texttt{sidecap} package (not preloaded by \textsf{UniFiTh}).

\item Avoid the use of colors unless really necessary. Remember that the figures should be readable even if they are printed in gray scale!

\item Subscripts and superscripts should be in italic if they represent variable quantities, whereas should be in roman if they are simply labels.

\item The name of operators should be typed in roman. Example: use $\sin$ (\texttt{\$\bs sin\$}) instead of $sin$ (\texttt{\$sin\$}).

\item The margin notes are rarely used in scientific documents and should \textbf{not} be used in a scientific thesis.

\item Do not divide the bibliography per chapter unless it is \textbf{really} necessary.
This will save you from wasting a lot of time to prepare your \LaTeX\ source code.
Order your bibliography alphabetically according to the
first author surname: this order is very useful, contrary to the other typical order, the citation order.

\end{itemize}

\clearpage
\appendix

\section{A very brief introduction to the \TeX\ world}

Many people want to (or are compelled to) write in \LaTeX\ without studying
a basic manual. Here follows a very brief introduction to the \TeX\ world.

\TeX, the document preparation system designed by Donald Knuth in 1978, is a program to typeset documents.
It is a mark-up language: you write a simple text decorated with \TeX\ commands (source code) which is then compiled to obtain the final product, a document in pdf format. 
\LaTeX\ is just a set of macros, written in \TeX, to simplify the writing of the source code: it can be thought as a simpler programming language with respect to \TeX. A source code written in \LaTeX\ can be compiled by several ``compilers'': \texttt{pdflatex} (the most common), or \texttt{xelatex}, or others.

The following list of \LaTeX\ manuals, may be especially useful for Italian authors.

\begin{itemize}
\item \href{http://www.lorenzopantieri.net/LaTeX_files/ArteLaTeX.pdf}{\textsc{L. 
Pantieri \& T. Gordini}, \textit{L'arte di scrivere con} \LaTeX, (2017)}

\item \href{http://mirror.ctan.org/info/symbols/comprehensive/symbols-a4.pdf}{\textsc{S. Pakin}, \textit{The comprehensive} \LaTeX\ \textit{symbol list}, (2021)}

\item \href{http://profs.sci.univr.it/~gregorio/breveguida.pdf}{\textsc{E. Gregorio}, \LaTeX\textit{: breve guida ai pacchetti di uso pi\`u comune}, (2010)}
\end{itemize}

In order to use \LaTeX, you have to install a \TeX\ distribution. It contains the compilers, several fonts and other files needed by the compilers and also many \emph{packages}, which can be thought as libraries or extensions of \LaTeX. The most famous distributions are \href{http://miktex.org/}{MiKTeX} (available only for Windows), \href{http://www.tug.org/texlive/}{TeX Live} (available both for Windows and Linux) and \href{http://www.tug.org/mactex/2011/}{MacTeX} (available only for Mac OS).

Finally we discuss the editor, that is the program used to write your source file. Since a source file written in \LaTeX, like in any other programming language, is a simple text file, you can write your code with any text editor you want (for example Notepad in Windows). However the suggested editors are:
\begin{itemize}
\item \href{http://tug.org/texworks/}{TeXworks}. Already installed with any \TeX\ distribution. Very simple and powerful. Use TeXworks if you are not an expert. Enrico Gregorio has written a very good and brief TeXworks manual in Italian, which can be found at: {\small \url{http://profs.sci.univr.it/~gregorio/introtexworks.pdf}}.

\item \href{http://texstudio.sourceforge.net/}{TeXstudio} (cross-platform), \href{http://www.xm1math.net/texmaker/}{TeXmaker} (cross-platform), \href{http://pages.uoregon.edu/koch/texshop/}{TeXshop} (only for Mac), \href{http://kile.sourceforge.net/}{Kile} (only for Linux). Powerful editors.

\item \textbf{Avoid} other editors unless you know what you are doing!

\end{itemize}

Finally we explain how to compile the example documents provided in the \textsf{UniFiTh} package. Double click on one of the \texttt{.tex} file in the \texttt{examples} folder. 
TeXworks should start showing the content of that file. 
The \texttt{pdflatex} compiler should be automatically selected thanks to the \emph{magic lines} placed at the beginning of the file.
Now, in order to compile, press the green button. 
At the end of the compilation the resulting pdf appears in a separate window. Remember to compile at least three times, because \LaTeX\ needs more than one compilation to correctly resolve the internal cross references (for example for the table of contents composition, or when you refer to a figure by the \texttt{\bs label}\,--\,\texttt{\bs ref}\,/\,\texttt{\bs pageref} mechanism).


\clearpage
\section{PhD thesis example}
\label{sec:PhDexample}

\begin{lstlisting}
% !TeX encoding = UTF-8
% !TeX program = pdflatex
% !TeX spellcheck = en_US

\documentclass[binding=0.6cm]{unifith}

\usepackage{microtype}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\hypersetup{pdftitle={My thesis},pdfauthor={Francesco Biccari}}

\title{My thesis}
\alttitle{Optional anternative title (for example different language)}
\author{Francesco Biccari}
\IDnumber{166350}
\course{Corso di Dottorato in Fisica e Astronomia}
\courseorganizer{Dipartimento di Fisica e Astronomia}
\cycle{Ciclo XXXII}
\advisor{Prof. Caio}
\advisor{Dr. Sempronio}
\AcademicYear{2018/2019}

\thesistype{PhD thesis}
\copyyear{2020}
\authoremail{pippo@pippo.com}

\begin{document}

\frontmatter
\maketitle
\dedication{Dedicated to\\ Donald Knuth}

\begin{abstract}
This thesis deals with myself.
\end{abstract}

\tableofcontents

\mainmatter
\chapter{Introduction}
...

\backmatter
\cleardoublepage
\phantomsection % Give this command only if hyperref is loaded
\addcontentsline{toc}{chapter}{\bibname}
% Here put the code for the bibliography. You can use BibTeX or
% the BibLaTeX package or the simple environment thebibliography.
\end{document}
\end{lstlisting}


\clearpage
\section[Laurea (Magistrale)\\ thesis example]{Laurea (Magistrale) thesis example}
\label{sec:LaMexample}

\begin{lstlisting}
% !TeX encoding = UTF-8
% !TeX program = pdflatex
% !TeX spellcheck = it_IT

\documentclass[binding=0.6cm]{unifith}

\usepackage{microtype}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\hypersetup{pdftitle={La mia tesi},pdfauthor={Francesco Biccari}}

\title{La mia tesi}
\alttitle{Titolo alternativo opzionale (tipicamente in inglese)}
\author{Francesco Biccari}
\IDnumber{166350}
\course{Corso di Laurea Magistrale in Fisica e Astronomia}
\courseorganizer{Scuola di Scienze Matematiche, Fisiche e Naturali}
\advisor{Prof. Caio}
\advisor{Dr. Sempronio}
\AcademicYear{2018/2019}

\thesistype{Master thesis}
\copyyear{2020}
\authoremail{pippo@pippo.com}

\begin{document}

\frontmatter
\maketitle
\dedication{Dedicato a\\ Donald Knuth}

\begin{abstract}
Questa tesi parla di me.
\end{abstract}

\tableofcontents

\mainmatter
\chapter{Introduzione}
...

\backmatter
\cleardoublepage
\phantomsection % Give this command only if hyperref is loaded
\addcontentsline{toc}{chapter}{\bibname}
% Here put the code for the bibliography. You can use BibTeX or
% the BibLaTeX package or the simple environment thebibliography.
\end{document}
\end{lstlisting}



\clearpage
\section{Other useful commands}
\label{sec:usefulcommands}

\begin{description}
\item[\texttt{\bs eu}] Napier's number, $\mathrm{e}$,  in roman.

\item[\texttt{\bs iu}] Imaginary unit, $\mathrm{i}$,  in roman.

\item[\texttt{\bs der\{\dots\}\{\dots\}}] Derivative. The first argument represents the function to derive while the second the variables separated by commas. The differential symbol is automatically inserted. Examples:
\texttt{\bs der\{f\}\{x\}}, \texttt{\bs der\{f\}\{x,y\}}, \texttt{\bs der\{f\}\{*\{3\}\{x\}\}}, 
\texttt{\bs der\{f\}\{*\{2\}\{x\},*\{2\}\{y\},z\}}.

\item[\texttt{\bs pder\{\dots\}\{\dots\}}] Partial derivative. Same syntax of the \texttt{\bs der} command.

\item[\texttt{\bs rb\{\dots\}}] Roman suBscript

\item[\texttt{\bs rp\{\dots\}}] Roman suPerscript

\item[\texttt{\bs tb\{\dots\}}] Text suBscript

\item[\texttt{\bs tp\{\dots\}}] Text suPerscript

\item[\texttt{\bs un\{\dots\}}] Useful command to typeset measurement units in the correct way, e.g. \texttt{25\bs un\{m/s\}},
\texttt{13\bs un\{kg\bs ,cm\^{}\{-3\}\}}. It can be used both inside or outside the math environment.
For heavy usage of measurement units and to insert numbers in the form
\texttt{1.4e-5}, the package \textsf{siunitx} is recommended.

\item[\texttt{\bs mnote\{\dots\}}] Fancy margin notes

\item[\texttt{\bs g}] Shortcut for the \texttt{\bs degree} command. Example: \texttt{45\bs g} produces 45\g.

\item[\texttt{\bs C}] Shortcut for the \texttt{\bs celsius} command. Example: \texttt{37\bs ,\bs C} produces 37\,\C.\footnote{Not available in math mode compiling with \texttt{xelatex}.}

\item[\texttt{\bs A}] Angstrom. Example: \texttt{10\bs ,\bs A} produces 10\,\A.\footnote{Remember that the angstrom unit of measurement should not be used.}

\item[\texttt{\bs micro}] Micro prefix. Example: \texttt{7\bs ,\bs micro m} produces 7\,\micro m.

\item[\texttt{\bs ohm}] Ohm. Example: \texttt{100\bs ,\bs ohm} produces 100\,\ohm.

\item[\texttt{\bs di}] Differential symbol with automatic spacing. Example: 
\texttt{\$\bs int x \bs di x\$} produces $\int x \di x$. If you prefer the differential symbol in roman ($\mathrm{d}$) you can give the option \texttt{romandiff} in the document class options.

\item[\texttt{\bs x}] Shortcut for the \texttt{\bs times} command. E.g.: \texttt{\$7 \bs x 10\^{}5\$} produces $7 \times 10^5$.

\end{description}


\clearpage
\section{Frequently Asked Questions}

\subsection{How can I increase the font size?}

The default font used in \unifith\ is Latin Modern. The default font size is 11\,pt using A4 and 10\,pt using A5 and B5. At the moment it is impossible to change the font size unless you modify the \unifith\ class file (\texttt{unifith.cls}). The reason for this choice is to maintain a common format for all the theses.


\subsection{How can I increase the line-spacing?}

The line-spacing in typography is defined as the distance between two lines. A strange ``tradition'' in Italy is to write the thesis with a double line-spacing. This is an incredibly large number. The lines are so separated that the effect is very ugly. Two reasons are behind this choice. The first one is that a lot of space is available for your professor to comment your text. The second one is that, in this way, the thesis is thicker.

This effect is amplified when you use Microsoft Word because Word defines the line-spacing in a different way with respect to the typical definition. And usually people do not know that. Therefore, when you set the value of 2 for the line-spacing in Word, actually you obtain a line-spacing of 2.34 according to the normal definition of the term! (Word adds an extra 17\% of space, I do not know why).

Of course this large value of the line-spacing is a nonsense. It is known in typography that the best value ranges between 1.20 and 1.45. In \LaTeX\ the default line-spacing is 1.20, which means that, if you use a font size of 10\,pt, the line-spacing is 12\,pt. In \unifith\ the line-spacing is set to 1.20. Nowadays, professors typically correct a thesis by using the comment tools of the their pdf viewer. There are still some who want to print it and want a double line-spacing. In that case, give them a copy with a double line-spacing but ask them to have the permission to print it in a more normal line-spacing, in order to save paper.

If you want to change the line-spacing, do not use the \texttt{\bs linespread} command. Load instead the \textsf{setspace} package and use, for example, the \texttt{\bs onehalfspacing} command.



\subsection{Single sided or double sided printing?}

A strange ``tradition'' in Italy is to print the theses only on one side of the paper sheets. In the past this was justified because a thesis was manually typed by a \href{https://en.wikipedia.org/wiki/Typewriter}{typewriter machine}.
Today, where the theses are all composed by a computer, this ``tradition'' is kept mainly because in this way the professors and the students are happy to see a thicker book.

Of course this is a nonsense. Not only because the bulky effect is only aesthetic (if you open the thesis you can see that only one side is printed), but especially because it is a waste of paper. Moreover, reading a book where only the right page is printed is quite ugly and strange, isn't it? (Have you ever seen a book, containing mainly text, printed single sided?)

The only real reason to print single sided is when a good paper is not available. Indeed, a low quality paper, like the one typically used for photocopies, has a grammage of 80\,g/m$^2$. It is a little bit semitransparent and this can be a problem when you print double sided, especially if you have many color images. The best approach is using a proper paper grammage of 90\,g/m$^2$ or 100\,g/m$^2$. Ask to the printing service which type of paper is more suitable to print your thesis double sided.


\subsection{Inverted margins? How much space for binding?}

Another typical question regards the margins of the thesis. Quite often the students (and incredibly also the printing services) complain about the margins of the thesis. They think that the margins are reversed because in \LaTeX\ standard classes, by default, the inner margin is smaller than the outer margin. The same behaviour, but with slightly different proportions, is adopted in \unifith\ (see Figure\,\ref{layout}). Of course, they are wrong. This is the correct behavior! Indeed, as you can see in any book, the sum of the two inner margins should be more or less equal to the width of a single outer margin. This is for an aesthetic reason. Otherwise the two columns of text would be too much separated when the book is open.

\begin{figure}[!b]
\centering
\setlength{\unitlength}{0.12mm}
\begin{picture}(420,297)(-210,0)
\polyline(-210,0)(210,0)(210,297)(-210,297)(-210,0)
\Line(0,0)(0,297)
\put(27.05,37.4){\polygon(0,0)(139.2,0)(139.2,223.8)(0,223.8)}
\put(-27.05,37.4){\polygon(0,0)(-139.2,0)(-139.2,223.8)(0,223.8)}
\put(27.05,268.16){\polygon(0,0)(139.2,0)(139.2,4.22)(0,4.22)}
\put(-27.05,268.16){\polygon(0,0)(-139.2,0)(-139.2,4.22)(0,4.22)}
\end{picture}
\caption{A4 page layout scheme of \textsf{UniFiTh} class using a zero binding margin.}
\label{layout}
\end{figure}


At this point the students usually reply ``what about the binding margin? The inner margin should be larger because some space is used by the binding process!'' This is partially true. The effect described above in Figure\,\ref{layout} is what should happen \emph{after} the binding process. For this reason there is the documentclass \texttt{binding} option in \unifith\ (see Section\,\ref{class_options}). Typical values are 6 or 7\,mm but it is always preferable to ask the printing service which is the correct value according to the binding method (be careful because many printing services are not professional and suggest arbitrarly binding margin values).

\subsection{Numbered introduction and conclusions?}

There is a strange ``tradition'' in Italy to not attribute a number to the Introduction and Conclusions of a thesis. Probably, only because they are usually short chapters. So it seems that they do not deserve a proper number like any other chapter.

In my (and not only mine) opinion this is a nonsense. The Introduction and Conclusions chapters are part of the thesis, and they should be read to properly understand the thesis. They cannot be skipped. So why don't attribute a number to those chapters?

Therefore I suggest to use the following structure of the thesis (which is the same reported in the examples in Appendix \ref{sec:PhDexample} and \ref{sec:LaMexample}).

\begin{lstlisting}
...

\frontmatter
\maketitle
...

% The chapters after the mainmatter command are numbered
\mainmatter
\chapter{Introduction}
\chapter{...}
\chapter{...}
\chapter{...}
\chapter{Conclusions}

\backmatter
...
\end{lstlisting}

However, if you really want to follow the nonsense of not giving a number to the Introduction and Conclusions chapter, you can do it in the following way. But keep in mind that \emph{if you do not number the Introduction and Conclusions, you cannot insert any numbered equation, table, or picture in these chapters}. Indeed, all these objects are numbered with the chapter number: Fig.\,1.2, Tab.\,3.2, Eq.\,(4.1), etc. If the chapter does not have a number, how can we assign a number to Figures, Tables, or Equations?

\begin{lstlisting}
...

\frontmatter
\maketitle

% The chapters after the mainmatter command are numbered
\mainmatter
\chapter*{Introduction}   % The chapter* does not attribute a number
\markboth{Introduction}{} % This command is necessary for the headings
\chapter{...}
\chapter{...}
\chapter{...}
\chapter*{Conclusions}    % The chapter* does not attribute a number
\markboth{Conclusions}{}  % This command is necessary for the headings

\backmatter
...
\end{lstlisting}

Finally, it is worth noting that the first and last chapter of a thesis must not to be always called Introduction and Conclusions! 

\subsection{How to reduce the size of the pdf?}

Usually, students do not optimize the images of their thesis. This is a very bad practice and one of the typical consequences is the excessive large size of the final pdf. The topic is too long to be covered here, however I want to provide a simple way to reduce \textit{a posteriori} the file size of the pdf.

Using \href{https://www.ghostscript.com/}{Ghostscript} we can ``distill'' a pdf file, which means interpreting it and re-enconding it again. This is just a small list of possible commands (commands are intended for Windows 64 bit but they can easily applied to other operating systems changing the name of the Ghostscript executable):

\begin{lstlisting}
BEST QUALITY (Flate image encoding)

gswin64c.exe -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=output.pdf
-dAutoFilterColorImages=false -dAutoFilterGrayImages=false 
-dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode 
-dPDFSETTINGS=/prepress -dCompatibilityLevel=1.5 input.pdf
\end{lstlisting}

\begin{lstlisting}
BEST QUALITY (DECT image encoding)

gswin64c.exe -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=output.pdf
-dPDFSETTINGS=/prepress -dCompatibilityLevel=1.5 input.pdf
\end{lstlisting}

\begin{lstlisting}
LOWER QUALITY (DECT image encoding)
Substitute XXXXXXX with one of the following settings (order of descending quality):
/printer /ebook /screen

gswin64c.exe -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=output.pdf
-dPDFSETTINGS=XXXXXXX -dCompatibilityLevel=1.5 input.pdf
\end{lstlisting}

\subsection{How to create an archivable pdf?}

\href{https://en.wikipedia.org/wiki/PDF/A}{PDF/A} is a particular PDF format, standardized by ISO, specialized for use in the archiving and long-term preservation of electronic documents. Public and private institutions, including universities, increasingly require this form to archive electronic documents. There are several levels of PDF/A. The suggested format for a thesis is the PDF/A-2b.

The best and free way to check if a pdf file is compliant to one of the PDF/A levels is to use \href{https://verapdf.org/}{veraPDF}, an open source software supported by the most important PDF associations in the world and funded by the European Commission. This software is freely available for Windows, Linux, and Mac.

A PDF/A file can be generated directly in \LaTeX, properly following some rules (see TOPTesi \LaTeX\ class documentation by Claudio Beccari) however we do not have enough space to cover this topic here.

A faster way is to transform the file of the thesis in a PDF/A compliant pdf file using \href{https://www.ghostscript.com/}{Ghostscript}. First of all you need to copy two files in the same directory of the pdf file you want to convert. One file is an ICC color profile and the other one is a PostScript definition file containing some information needed by the convertion process. Let us start from the ICC color profile. Since the pdf file will be viewed mainly on electronic screen, you can use a generic sRGB color profile. You can download one here: \url{https://www.color.org/srgbprofiles.xalter}. The PostScript definition file, already prepared for PDF/A file generation, can be found in the Ghostscript directory in your system (typically in the lib subfolder). Once copied (and RENAMED!) in your working directory, open it and modify the /ICCProfile variable, matching the name of the ICC color profile you downloaded, and the /Title variable, matching (reasonably) the title of your pdf.

Then, launch the following command:

\begin{lstlisting}
gswin64.exe -q -dNOPAUSE -dBATCH -dNOSAFER -sDEVICE=pdfwrite -sOutputFile=output.pdf
-dPDFA=2 -dPDFACompatibilityPolicy=1
-sColorConversionStrategy=UseDeviceIndependentColor -sProcessColorModel=DeviceRGB
PDFArenamed.ps input.pdf
\end{lstlisting}




%\subsection{Cover}
%
%In order to help the student to prepare the cover for the printing service, \unifith\ provides a class option \texttt{cover}. When this option is used, the thesis is not compiled, but the cover is generated as a single page pdf. This file is usually provided to the printing service to prepare the cover for the thesis. Of course the students can use their own cover or the cover provided by the printing services.


\addtocontents{toc}{\protect\end{multicols}}
\end{document}