Debian Codegraph @

texmf-dist/doc/latex/sapthesis/sapthesis-doc.tex

raw
1 % !TeX encoding = UTF-8
2 % !TeX program = pdflatex
3 % !TeX spellcheck = en_US
4
5
6 \documentclass[a5paper,11pt]{article}
7
8 \usepackage[scale=0.85, footskip=0.8cm,heightrounded]{geometry}
9 \usepackage[T1]{fontenc}
10 \usepackage[scaled=1]{newtxtext}
11 \usepackage{textcomp}
12 \usepackage{amsmath}
13 \usepackage[varg,cmintegrals,cmbraces]{newtxmath}
14 \usepackage{microtype}
15 \usepackage{graphicx}
16 \usepackage{color}
17 \definecolor{gray}{gray}{0.4}
18 \definecolor{sfondoblu}{rgb}{0.94,0.97,1}
19 \usepackage{curve2e}
20 \usepackage{listings}
21 \lstset{language=[LaTeX]TeX,
22 basicstyle=\scriptsize\ttfamily,
23 keywordstyle=\color{blue}\bfseries,
24 commentstyle=\color{gray},
25 backgroundcolor=\color{sfondoblu},
26 frameround=tttt,
27 frame=tlrb,
28 escapechar=|,
29 morekeywords={submitdate, cycle, courseorganizer, AcademicYear, copyyear, Faculty, course, PhDorganizer, IDnumber, advisor, coadvisor, examdate, examiner, authoremail, frontmatter, mainmatter, maketitle, tableofcontents, chapter, appendix, backmatter, dedication, selectlanguage, tutor, tutorcoord, thesistype, customdirectorlabel, schoolname, schooladdress, schoolwebsite, schoolprincipal, phantomsection, director, hypersetup},
30 columns=flexible
31 }
32
33 \definecolor{sapred}{rgb}{0.5098039,0.1411765,0.2}
34
35 \usepackage{multicol}
36
37 % eliminate dots in the table of contents
38 \makeatletter
39 \renewcommand{\@dotsep}{10000}
40 \makeatother
41
42 \usepackage[bookmarks=false,hyperfootnotes=false]{hyperref}
43 \hypersetup{
44 colorlinks=true,
45 linkcolor=blue,
46 anchorcolor=blue,
47 citecolor=blue,
48 urlcolor=blue,
49 pdftitle={sapthesis.cls documentation},
50 pdfauthor={Francesco Biccari}
51 }
52
53 \newcommand{\bs}{\textbackslash}
54 \newcommand{\sq}{\textquotesingle}
55
56 \author{\small Francesco Biccari\thanks{\href{mailto:[email protected]}{[email protected]}}}
57 \title{\small Documentation of the \LaTeX\ class\\
58 \Large \textbf{\texttt{sapthesis.cls}}\\
59 \small \vspace{0.2cm} Version 5.1, 2022-07-04
60 }
61 \date{}
62
63 % degree
64 \providecommand{\degree}{\mbox{\textdegree}}
65 \providecommand{\g}{\degree}
66
67 % gradi Celsius
68 \providecommand{\celsius}{\ensuremath{\textrm{\upshape\textdegree}\kern-\scriptspace\mathrm{C}}}
69 \providecommand{\C}{\celsius}
70
71 % Angstrom
72 \providecommand{\angstrom}{\mbox{\AA}}
73 \providecommand{\A}{\angstrom}
74
75 % micro
76 \providecommand{\micro}{\mbox{\textmu}}
77
78 % Ohm
79 \providecommand{\ohm}{\ensuremath{\mbox{\textohm}}}
80
81 % Napier's number
82 \providecommand{\eu}{\ensuremath{\mathrm{e}}}
83
84 % imaginary unit
85 \providecommand{\iu}{\ensuremath{\mathrm{i}}}
86
87 % roman subscript
88 \providecommand*{\rb}[1]{\ensuremath{_\mathrm{#1}}}
89
90 % roman superscript
91 \providecommand*{\rp}[1]{\ensuremath{^\mathrm{#1}}}
92
93 % differential (only math)
94 \providecommand{\di}{\mathop{}\!d}
95
96 % derivative and partial derivative (only math)
97 \providecommand*{\der}[3][]{\frac{d^{#1}#2}{d #3^{#1}}}
98 \providecommand*{\pder}[3][]{%
99 \frac{\partial^{#1}#2}{\partial #3^{#1}}%
100 }
101
102 % measurement unit
103 \providecommand*{\un}[1]{\ensuremath{\mathrm{\,#1}}}
104
105
106 \begin{document}
107 \maketitle
108
109 \begin{abstract}\noindent
110 This document describes how to use \texttt{sapthesis.cls}, a \LaTeX\ document class for the typesetting of the theses of the ``Sapienza University of Rome''. The official web page of \textsf{sapthesis} is\\
111 {\footnotesize\url{http://biccari.altervista.org/c/informatica/latex/sapthesis.php}}.
112 \end{abstract}
113
114 \setcounter{tocdepth}{2}
115 \renewcommand{\columnseprule}{0.4pt}
116 \setlength{\columnsep}{1.5cm}
117
118 \addtocontents{toc}{\protect\begin{multicols}{2}}
119 {\small
120 \tableofcontents}
121
122 \clearpage
123
124 \section{Introduction}
125
126 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.
127 This is against the philosophy of \LaTeX, which was created to relieve the writer from the typesetter's work.
128 Apart from the time spent, the resulting documents are obviously all different from each other and good aesthetic results are not always achieved.
129 This has a negative impact both on the student's work and on the university.
130 Moreover in 2007 the Sapienza university changed completely its
131 logo and a lot of strict graphic rules for official documents were introduced.%
132 \footnote{A thesis is not an official document and therefore these guidelines can not be applied (private communication with Laura Gobbo, Ufficio Stampa e Comunicazione Sapienza Universit\`a di Roma).
133 However some Microsoft Word templates, with a completely different style, are provided.
134 To give a look to the new Sapienza style see
135 \href{https://www.uniroma1.it/it/pagina/marchio-identita-visiva-e-sistema-grafico}{Marchio, identità visiva e sistema grafico} and \href{https://www.uniroma1.it/it/pagina/impaginazione-della-tesi-e-logo}{Template tesi}.}
136
137 For these reasons I thought that a \LaTeX\ class for the theses of my
138 university would have been a good idea.
139 \textsf{Sapthesis} is the result of my work.
140 Its official web page is
141 {\footnotesize\url{http://biccari.altervista.org/c/informatica/latex/sapthesis.php}}.
142 \textsf{Sapthesis} is released under the terms of the latest version of the
143 \href{http://www.latex-project.org/lppl/}{\LaTeX\ Project Public License}.
144
145 To give a look to a document composed by \textsf{sapthesis} class, compile one of the several examples reported in App.\,\ref{sec:examples}.
146
147 I would like to thank the Italian \TeX\ user group (\href{http://www.guitex.org/}{GuIT}) for the help provided, in particular Enrico Gregorio and Claudio Beccari. I would also thank all the users who reported bugs and suggestions.
148
149 \section[Requirements\\ and installation]{Requirements and installation}
150 \label{requirements_installation}
151
152 The simplest way to install \textsf{sapthesis} is by the package manager of
153 your \TeX\ distribution (\TeX\ Live or MiK\TeX). For manual installation see
154 the \texttt{README} file.
155
156 The \textsf{sapthesis} package provides: the
157 \texttt{sapthesis.cls} class file; the documentation
158 \texttt{sapthesis-doc.pdf} (this file) and its source code; the logo of
159 Sapienza university; an English Bib\TeX\ style, called
160 \texttt{sapthesis.bst}, which can be used, obviously, only if you use the
161 Bib\TeX\ way to compose your bibliography and if your thesis is written in
162 English (its usage is not mandatory).
163
164
165 \textsf{Sapthesis} explicitely loads the packages \textsf{xkeyval}, \textsf{etoolbox}, \textsf{geometry}, \textsf{ifxetex}, \textsf{xltxtra}, \textsf{fontenc}, \textsf{textcomp}, \textsf{lmodern}, \textsf{caption}, \textsf{graphicx}, \textsf{color}, \textsf{booktabs}, \textsf{amsmath}, \textsf{fancyhdr}.
166 Do \textbf{not} include these packages in the preamble of your document!
167
168
169
170
171
172 \section{Usage}
173
174 A \LaTeX\ document based on \textsf{sapthesis} can be compiled only by the commands
175 \texttt{pdflatex} and \texttt{xelatex}. In this manual only \texttt{pdflatex} will be considered.
176
177
178 As usual, in order to use this class, you need to call it by
179 \begin{lstlisting}
180 \documentclass[|\textit{\texttt{options}}|]{sapthesis}
181 \end{lstlisting}
182 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:examples}.
183 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!
184
185 This class supports, at the moment, two languages: Italian and English. The choice of the language is automatic according to the \texttt{babel} package settings. If babel is not loaded, english is used. See below to override the automatic choice.
186
187 \subsection{Class options}
188 \label{class_options}
189 The following options can be passed to the \texttt{\bs documentclass} command.
190
191 \begin{description}
192
193 \item[\texttt{a4paper/a5paper/b5paper}] Choose one of these three options to set the paper format. The default value is \texttt{a4paper}.
194 \item[\texttt{layout=\textsl{a5paper/b5paper}}] If, for some reason, it is impossible to print on A5 or B5 directly (printer not supporting these formats, paper not available, ...), it is possible to specify the A5 or B5 layout, maintaining the A4 paper format: some cropmarks will be printed to show where the page should be cut.
195 \item[\texttt{draft}] The usual \texttt{draft} option of the \LaTeX\ Standard Classes.
196 \item[\texttt{oneside}] The usual \texttt{oneside} option of the \LaTeX\ Standard Classes.
197 \item[\texttt{twoside}] (default) The usual \texttt{twoside} option of the \LaTeX\ Standard Classes.
198
199 \item[\texttt{binding=\textsl{length}}] (zero default binding)
200 The value of this option is an offset of the text column.
201 It is useful to take into account the margin for the binding (ask to your bookbinder for information).
202 \item[\texttt{noexaminfo}] Suppress all the final exam informations. Indeed, by default, \textsf{Sapthesis} 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
203 \texttt{\bs examdate\{\dots\}} and \texttt{\bs examiner\{\dots\}} the date and
204 the examiners list are shown.
205 \item[\texttt{nodefaultfont}] Avoid the loading of packages \textsf{fontenc}, \textsf{textcomp} and \textsf{lmodern}.
206 \item[\texttt{romandiff}] See App.~\ref{sec:usefulcommands}.
207 \item[\texttt{italian} / \texttt{english}] Explicitly declare the language of
208 the title page. Useful to write the title page in a language
209 and the thesis in a different language.
210 \end{description}
211
212 \subsection[Commands for the\\ title page]{Commands for the title page}
213 \label{commands_titlepage}
214
215 As usual, the title page is generated by the \texttt{\bs maketitle} command.
216 It needs some information that you can supply by the following commands
217 in the preamble.
218 \begin{description}
219 \item[\texttt{\bs title\{\dots\}}] Mandatory. Title of the thesis. The text is justified, however it is recommended to insert manual linebreaks (\bs\bs) to compose a beautiful title.
220
221 \item[\texttt{\bs subtitle\{\dots\}}] Optional. Subtitle (try to avoid a subtitle). If both\\ \texttt{\bs subtitle\{\dots\}} and \texttt{\bs alttitle\{\dots\}} are used, the latter is discarded.
222
223 \item[\texttt{\bs alttitle\{\dots\}}] Optional. Alternative title (try to avoid an alternative title). This command, together with the \texttt{\bs title\{\dots\}} command, is typically used to insert in the frontispiece the title in another language. If both \texttt{\bs subtitle\{\dots\}} and \texttt{\bs alttitle\{\dots\}} are used, the latter is discarded.
224
225 \item[\texttt{\bs author\{\dots\}}] Mandatory. Author (student's name).
226
227 \item[\texttt{\bs IDnumber\{\dots\}}] Mandatory. ID number (\textit{matricola} in Italian).
228
229 \item[\texttt{\bs course\{\dots\}}] Mandatory. Use the official Italian name of the course.
230 Even though your thesis is in English you should write here the official name of the course, which normally is in Italian.
231
232 \item[\texttt{\bs cycle\{\dots\}}] Mandatory only for PhD's. Use the form: \texttt{\bs cycle\{XXII\}}
233
234 \item[\texttt{\bs courseorganizer\{\dots\}}] Mandatory. Course organizer (for example Scuola di Scienze Matematiche Fisiche e Naturali). Use \bs\bs\ to properly break the lines.
235
236 \item[\texttt{\bs AcademicYear\{\dots\}}] Academic Year.
237
238 \item[\texttt{\bs advisor\{\dots\}}] You must specify at least one advisor.
239 If you have more than one advisor, put several advisor commands in the correct order:\\
240 \texttt{\bs advisor\{Prof.~Pippo\}} \texttt{\bs advisor\{Dr.~Pluto\}}
241
242 \item[\texttt{\bs customadvisorlabel\{\dots\}}] Optional. Specify the label for advisors. It can be used, for example, to print ``Relatrice'' instead of ``Relatore''.
243
244 \item[\texttt{\bs coadvisor\{\dots\}}] Optional. Co-advisors of the thesis.
245 Same syntax of the \texttt{\bs advisor} command.
246
247 \item[\texttt{\bs customcoadvisorlabel\{\dots\}}] Optional. Specify the label for co-advisors. It can be used to print ``external advisor'' or similar labels.
248
249 \item[\texttt{\bs director\{\dots\}}] Optional. Director of the PhD program, head of the Specialization degree, or similar. Same syntax of the \texttt{\bs advisor} command. Avoid its usage if possible.
250
251 \item[\texttt{\bs customdirectorlabel\{\dots\}}] Optional. Specify the label for director.
252
253 \end{description}
254
255 Together with the title page, \textsf{Sapthesis} 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.
256 \begin{description}
257 \item[\texttt{\bs examdate\{\dots\}}] Optional. Date of the final exam.\\
258 Example: \texttt{\bs examdate\{16 February 2020\}}.
259
260 \item[\texttt{\bs examiner[\dots]\{\dots\}}] Optional. Specifies the members of the
261 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.
262
263 \item[\texttt{\bs thesistype\{\dots\}}] Optional. Type of thesis (usually PhD thesis, Master thesis, and so on).
264
265 \item[\texttt{\bs ISBN\{\dots\}}] Optional. ISBN
266
267 \item[\texttt{\bs copyyear\{\dots\}}] Mandatory. Copyright year (usually the
268 graduation year).
269
270 \item[\texttt{\bs copyrightstatement\{\dots\}}] Optional. Specify a copyright statement that will be printed in place of the default one.
271
272 \item[\texttt{\bs versiondate\{\dots\}}] Optional. Date version of the thesis.
273
274 \item[\texttt{\bs website\{\dots\}}] Optional. Thesis website. Automatically
275 hyper-linked if \textsf{hyperref} package is loaded.
276
277 \item[\texttt{\bs authoremail\{\dots\}}] Mandatory. Email of the thesis author.
278 It is automatically hyper-linked if \textsf{hyperref} package is loaded.
279
280 \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.
281
282 \item[\texttt{\bs extrainfo\{\dots\}}] Optional. This command can be used to insert an arbitraly long text at the top of the back of the titlepage. For example, in the past it was used to provide some information for TFA theses (tutor, tutor coordinator, principal of the school, name of the school, and so on).
283
284
285 \end{description}
286
287
288
289 \subsection[Other commands\\ and environments]{Other commands and environments}
290
291 \begin{description}
292
293 \item[\texttt{\bs dedication\{\dots\}}] A command to compose the dedication.
294
295 \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.
296 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.
297
298 \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.
299 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.
300
301
302 \end{description}
303 \textcolor{sapred}{%
304 The \texttt{sapthesis} class defines also the color \texttt{sapred} which is the \emph{Sapienza red}: RGB(130,36,51). Example of usage: \texttt{\bs textcolor\{sapred\}\{blah blah\}}}
305
306
307 \section{Recommendations}
308
309 \begin{itemize}
310
311 \item Do \textbf{not} change the default layout.
312
313 \item Do \textbf{not} load the packages already loaded by \textsf{sapthesis} (see Sec.~\ref{requirements_installation}).
314
315 \item As you already should know, \LaTeX\ can process only documents
316 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:examples}).
317
318 \item Respect the following thesis structure:
319
320 \begin{itemize}
321 \item Title page (\texttt{\bs maketitle} command)
322 \item Dedication (\texttt{\bs dedication} command)
323 \item Abstract (\texttt{abstract} environment)
324 \item Acknowledgements (\texttt{acknowledgments} environment)
325 \item Table of contents (\texttt{\bs tableofcontens} command)
326 \item Chapters
327 \item Appendices
328 \item Bibliography
329 \end{itemize}
330
331 \item It is recommended to avoid or limit the acknowledgments in a thesis, it
332 is not very professional. The dedication should be enough.
333
334 \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.
335
336 \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.
337
338 \item If the figure has a small width, it is possible to put the figure caption
339 aside the figure using the \texttt{sidecap} package (not preloaded by \textsf{sapthesis}).
340
341 \item Avoid the use of colors unless really necessary. Remember that the figures should be readable even if they are printed in gray scale!
342
343 \item Subscripts and superscripts should be in italic if they represent variable quantities, whereas should be in roman if they are simply labels.
344
345 \item The name of operators should be typed in roman. Example: use $\sin$ (\texttt{\$\bs sin\$}) instead of $sin$ (\texttt{\$sin\$}).
346
347 \item The margin notes are rarely used in scientific documents and should \textbf{not} be used in a scientific thesis.
348
349 \item Do not divide the bibliography per chapter unless it is \textbf{really} necessary.
350 This will save you from wasting a lot of time to prepare your \LaTeX\ source code.
351 Order your bibliography alphabetically according to the
352 first author surname: this order is very useful, contrary to the other typical order, the citation order.
353
354 \end{itemize}
355
356 \clearpage
357 \section{Other useful commands}
358 \label{sec:usefulcommands}
359
360 \textsf{Sapthesis} provides several useful commands for scientific texts.
361
362 \begin{description}
363 \item[\texttt{\bs eu}] Napier's number, $\mathrm{e}$, in roman.
364
365 \item[\texttt{\bs iu}] Imaginary unit, $\mathrm{i}$, in roman.
366
367 \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:
368 \texttt{\bs der\{f\}\{x\}}, \texttt{\bs der\{f\}\{x,y\}}, \texttt{\bs der\{f\}\{*\{3\}\{x\}\}},
369 \texttt{\bs der\{f\}\{*\{2\}\{x\},*\{2\}\{y\},z\}}.
370
371 \item[\texttt{\bs pder\{\dots\}\{\dots\}}] Partial derivative. Same syntax of the \texttt{\bs der} command.
372
373 \item[\texttt{\bs rb\{\dots\}}] Roman suBscript
374
375 \item[\texttt{\bs rp\{\dots\}}] Roman suPerscript
376
377 \item[\texttt{\bs tb\{\dots\}}] Text suBscript
378
379 \item[\texttt{\bs tp\{\dots\}}] Text suPerscript
380
381 \item[\texttt{\bs un\{\dots\}}] Useful command to typeset measurement units in the correct way, e.g. \texttt{25\bs un\{m/s\}},
382 \texttt{13\bs un\{kg\bs ,cm\^{}\{-3\}\}}. It can be used both inside or outside the math environment.
383 For heavy usage of measurement units and to insert numbers in the form
384 \texttt{1.4e-5}, the package \textsf{siunitx} is recommended.
385
386 \item[\texttt{\bs g}] Shortcut for the \texttt{\bs degree} command. Example: \texttt{45\bs g} produces 45\g.
387
388 \item[\texttt{\bs C}] Shortcut for the \texttt{\bs celsius} command. Example: \texttt{37\bs ,\bs C} produces 37\,\C. (Not available in math mode compiling with \texttt{xelatex}).
389
390 \item[\texttt{\bs A}] Angstrom. Example: \texttt{10\bs ,\bs A} produces 10\,\A.
391
392 \item[\texttt{\bs micro}] Micro prefix. Example: \texttt{7\bs ,\bs micro m} produces 7\,\micro m.
393
394 \item[\texttt{\bs ohm}] Ohm. Example: \texttt{100\bs ,\bs ohm} produces 100\,\ohm.
395
396 \item[\texttt{\bs di}] Differential symbol with automatic spacing. Example:
397 \texttt{\$\bs int x \bs di x\$} produces $\int x \di x$. If you prefer the differential symbol in roman ($\mathrm{d}$), you can use the \texttt{romandiff} document class option.
398
399 \item[\texttt{\bs x}] Shortcut for the \texttt{\bs times} command. E.g.: \texttt{\$7 \bs x 10\^{}5\$} produces $7 \times 10^5$.
400
401 \end{description}
402
403 \clearpage
404 \section{Examples}
405 \label{sec:examples}
406
407 \subsection*{PhD thesis in English}
408 \begin{lstlisting}
409 % !TeX encoding = UTF-8
410 % !TeX program = pdflatex
411 % !TeX spellcheck = en_US
412
413 \documentclass[binding=0.6cm]{sapthesis}
414
415 \usepackage{microtype}
416 \usepackage{hyperref}
417 \hypersetup{pdftitle={My thesis},pdfauthor={Francesco Biccari}}
418
419 \title{My thesis}
420 \author{Francesco Biccari}
421 \IDnumber{123456}
422 \course{Dottorato di Ricerca in Filologia}
423 \courseorganizer{Scuola di Dottorato in Scienze Filologiche}
424 \cycle{XXXVII}
425 \AcademicYear{2021/2022}
426 \advisor{Prof. Caio}
427 \coadvisor{Dr. Sempronio}
428 \authoremail{[email protected]}
429 \copyyear{2022}
430 \thesistype{PhD thesis}
431
432 \begin{document}
433
434 \frontmatter
435 \maketitle
436 \dedication{Dedicated to\\ Donald Knuth}
437
438 \begin{abstract}
439 This thesis deals with myself.
440 \end{abstract}
441
442 \tableofcontents
443
444 \mainmatter
445 \chapter{Introduction}
446 ...
447
448 \backmatter
449 \cleardoublepage
450 \phantomsection % Give this command only if hyperref is loaded
451 \addcontentsline{toc}{chapter}{\bibname}
452 % Here put the code for the bibliography. You can use BibTeX or
453 % the BibLaTeX package or the simple environment thebibliography.
454
455 \end{document}
456 \end{lstlisting}
457
458
459 \clearpage
460 \subsection*{Master thesis (Laurea/Laurea Magistrale) in Italian}
461
462 \begin{lstlisting}
463 % !TeX encoding = UTF-8
464 % !TeX program = pdflatex
465 % !TeX spellcheck = it_IT
466
467 \documentclass[binding=0.6cm]{sapthesis}
468
469 \usepackage{microtype}
470 \usepackage[italian]{babel}
471 \usepackage[utf8]{inputenc}
472 \usepackage{hyperref}
473 \hypersetup{pdftitle={La mia tesi},pdfauthor={Francesco Biccari}}
474
475 \title{La mia tesi}
476 \author{Francesco Biccari}
477 \IDnumber{123456}
478 \course{Laurea Magistrale in Fisica}
479 \courseorganizer{Facolt|\`a| di Scienze Matematiche, Fisiche e Naturali}
480 \AcademicYear{2021/2022}
481 \advisor{Prof. Caio}
482 \coadvisor{Dr. Sempronio}
483 \authoremail{[email protected]}
484 \copyyear{2022}
485 \thesistype{Tesi di Laurea Magistrale}
486
487 \begin{document}
488
489 \frontmatter
490 \maketitle
491 \dedication{Dedicato a\\ Donald Knuth}
492
493 \begin{abstract}
494 Questa tesi parla di me.
495 \end{abstract}
496
497 \tableofcontents
498
499 \mainmatter
500 \chapter{Introduzione}
501 ...
502
503 \backmatter
504 \cleardoublepage
505 \phantomsection % Give this command only if hyperref is loaded
506 \addcontentsline{toc}{chapter}{\bibname}
507 % Here put the code for the bibliography. You can use BibTeX or
508 % the BibLaTeX package or the simple environment thebibliography.
509
510 \end{document}
511 \end{lstlisting}
512
513
514 \clearpage
515 \subsection*{Specialization thesis in English}
516
517 \begin{lstlisting}
518 % !TeX encoding = UTF-8
519 % !TeX program = pdflatex
520 % !TeX spellcheck = en_US
521
522 \documentclass[binding=0.6cm]{sapthesis}
523
524 \usepackage{microtype}
525 \usepackage[english]{babel}
526 \usepackage[utf8]{inputenc}
527 \usepackage{hyperref}
528 \hypersetup{pdftitle={My thesis},pdfauthor={Francesco Biccari}}
529
530 \title{My thesis}
531 \author{Francesco Biccari}
532 \IDnumber{123456}
533 \course{Specializzazione in Fisica Medica}
534 \courseorganizer{Facolt|\`a| di Medicina e Chirurgia}
535 \AcademicYear{2021/2022}
536 \advisor{Prof. Caio}
537 \coadvisor{Dr. Sempronio}
538 \director{Prof. Pippo}
539 \customdirectorlabel{Direttore della Scuola di Specializzazione}
540 \authoremail{[email protected]}
541 \copyyear{2022}
542 \thesistype{Specialization thesis}
543
544 \begin{document}
545
546 \frontmatter
547 \maketitle
548 \dedication{Dedicated to\\ Donald Knuth}
549
550 \begin{abstract}
551 This thesis deals with myself.
552 \end{abstract}
553
554 \tableofcontents
555
556 \mainmatter
557 \chapter{Introduction}
558 ...
559
560 \backmatter
561 \cleardoublepage
562 \phantomsection % Give this command only if hyperref is loaded
563 \addcontentsline{toc}{chapter}{\bibname}
564 % Here put the code for the bibliography. You can use BibTeX or
565 % the BibLaTeX package or the simple environment thebibliography.
566
567 \end{document}
568 \end{lstlisting}
569
570
571 \appendix
572
573 \section{A very brief introduction to the \TeX\ world}
574
575 Many people want to (or are compelled to) write in \LaTeX\ without studying
576 a basic manual. Here follows a very brief introduction to the \TeX\ world.
577
578 \TeX, the document preparation system designed by Donald Knuth in 1978, is a program to typeset documents.
579 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.
580 \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.
581
582 The following list of \LaTeX\ manuals, may be especially useful for Italian authors.
583
584 \begin{itemize}
585 \item \href{http://www.lorenzopantieri.net/LaTeX_files/ArteLaTeX.pdf}{\textsc{L.
586 Pantieri \& T. Gordini}, \textit{L'arte di scrivere con} \LaTeX, (2017)}
587
588 \item \href{http://mirror.ctan.org/info/symbols/comprehensive/symbols-a4.pdf}{\textsc{S. Pakin}, \textit{The comprehensive} \LaTeX\ \textit{symbol list}, (2021)}
589
590 \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)}
591 \end{itemize}
592
593 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, Linux, and Mac), \href{http://www.tug.org/texlive/}{TeX Live} (available for Windows, Linux, and Mac) and \href{https://tug.org/mactex/}{MacTeX} (available only for Mac OS).
594
595 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:
596 \begin{itemize}
597 \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}}.
598
599 \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.
600
601 \item \textbf{Avoid} other editors unless you know what you are doing!
602
603 \end{itemize}
604
605 Finally we explain how to compile the example documents provided in the \textsf{sapthesis} package. Double click on one of the \texttt{.tex} file in the \texttt{examples} folder.
606 TeXworks should start showing the content of that file.
607 The \texttt{pdflatex} compiler should be automatically selected thanks to the \emph{magic lines} placed at the beginning of the file.
608 Now, in order to compile, press the green button.
609 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).
610
611
612 \subsection*{Using Overleaf}
613
614 \href{https://www.overleaf.com/}{Overleaf} is a collaborative cloud-based online text editor, specifically designed for \LaTeX. The compilation of the source file is performed remotely on the Overleaf servers, by a TeXLive distribution. Therefore, using \textsf{sapthesis} in Overleaf is straightforward. You don't need to do anything, the package is already available. For any reason \textsf{sapthesis} is not available or the version present in Overleaf is outdated, just copy the files of \textsf{sapthesis } in your remote working directory in Overleaf. Local files have always precedence with respect to global files.
615
616 \subsection*{Using LyX}
617
618 \href{https://www.lyx.org/}{LyX} is an advanced \LaTeX\ editor which does not simply show the source code like any text editor, but instead it renders maths, images, tables and some text formatting commands. However this ``layer'' between the writer and the real source code is sometimes frustrating and many authors discourage the usage of LyX.
619
620 Using \textsf{sapthesis} with LyX is quite straightforward.
621 \begin{itemize}
622 \item
623 Install \textsf{sapthesis} by the package manager of your \TeX\ distribution or manually.
624
625 \item
626 Copy the file \texttt{sapthesis.layout} in the directory\\ \texttt{C:\bs Program Files\bs Lyx20\bs Resources\bs layouts\bs}\\ and then, in LyX, click on \textsf{Tools > Reconfigure}. This will add the \textsf{sapthesis} class in the list of LyX available classes.
627
628 \item
629 In LyX, first of all, go in \textsf{Tools > Preferences > Language Settings > Language} and choose ``none'' in Language package. This step is necessary because LyX not only loads babel with the desired language, but it passes the language also as an option for the class! This triggers an error in many classes.
630
631 \item
632 Create a new document and go in \textsf{Document > Settings > Document Class}. Here you can choose \textsf{sapthesis} as the class for the document and write the class options.
633
634 \item
635 Write the preamble in \textsf{Document > Settings > LaTeX Preamble}.
636
637 \item Create the titlepage inserting the title by the \textsf{Title} item in the LyX left menu.
638
639 \end{itemize}
640
641 It is recommended to activate \textsf{View > Source Pane}. This step is not necessary but it is very useful to observe the \LaTeX\ code produced by LyX (on the right choose ``Complete source'' or ``Preamble'').
642
643
644
645
646
647
648
649
650
651 \clearpage
652 \section{Frequently Asked Questions}
653
654 \subsection{How can I increase the font size?}
655
656 The default font used in \textsf{Sapthesis} 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 \textsf{Sapthesis} class file (\texttt{sapthesis.cls}). The reason for this choice is to maintain a common format for all the theses.
657
658
659 \subsection{How can I increase the line-spacing?}
660
661 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.
662
663 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).
664
665 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 \textsf{Sapthesis} 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.
666
667 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.
668
669
670
671 \subsection{Single sided or double sided printing?}
672
673 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}.
674 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.
675
676 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?)
677
678 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.
679
680
681 \subsection{Inverted margins? How much space for binding?}
682
683 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 \textsf{Sapthesis} (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.
684
685 \begin{figure}[!b]
686 \centering
687 \setlength{\unitlength}{0.12mm}
688 \begin{picture}(420,297)(-210,0)
689 \polyline(-210,0)(210,0)(210,297)(-210,297)(-210,0)
690 \Line(0,0)(0,297)
691 \put(27.05,37.4){\polygon(0,0)(139.2,0)(139.2,223.8)(0,223.8)}
692 \put(-27.05,37.4){\polygon(0,0)(-139.2,0)(-139.2,223.8)(0,223.8)}
693 \put(27.05,268.16){\polygon(0,0)(139.2,0)(139.2,4.22)(0,4.22)}
694 \put(-27.05,268.16){\polygon(0,0)(-139.2,0)(-139.2,4.22)(0,4.22)}
695 \end{picture}
696 \caption{A4 page layout scheme of \textsf{UniFiTh} class using a zero binding margin.}
697 \label{layout}
698 \end{figure}
699
700
701 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 \textsf{Sapthesis} (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).
702
703 \subsection{Numbered introduction and conclusions?}
704
705 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.
706
707 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?
708
709 Therefore I suggest to use the following structure of the thesis (which is the same reported in the examples in Appendix \ref{sec:examples}).
710
711 \begin{lstlisting}
712 ...
713
714 \frontmatter
715 \maketitle
716 ...
717
718 % The chapters after the mainmatter command are numbered
719 \mainmatter
720 \chapter{Introduction}
721 \chapter{...}
722 \chapter{...}
723 \chapter{...}
724 \chapter{Conclusions}
725
726 \backmatter
727 ...
728 \end{lstlisting}
729
730 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?
731
732 \begin{lstlisting}
733 ...
734
735 \frontmatter
736 \maketitle
737
738 % The chapters after the mainmatter command are numbered
739 \mainmatter
740 \chapter*{Introduction} % The chapter* does not attribute a number
741 \markboth{Introduction}{} % This command is necessary for the headings
742 \chapter{...}
743 \chapter{...}
744 \chapter{...}
745 \chapter*{Conclusions} % The chapter* does not attribute a number
746 \markboth{Conclusions}{} % This command is necessary for the headings
747
748 \backmatter
749 ...
750 \end{lstlisting}
751
752 Finally, it is worth noting that the first and last chapter of a thesis must not to be always called Introduction and Conclusions!
753
754 \subsection{How to reduce the size of the pdf?}
755
756 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.
757
758 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):
759
760 \begin{lstlisting}
761 BEST QUALITY (Flate image encoding)
762
763 gswin64c.exe -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=output.pdf
764 -dAutoFilterColorImages=false -dAutoFilterGrayImages=false
765 -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode
766 -dPDFSETTINGS=/prepress -dCompatibilityLevel=1.5 input.pdf
767 \end{lstlisting}
768
769 \begin{lstlisting}
770 BEST QUALITY (DECT image encoding)
771
772 gswin64c.exe -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=output.pdf
773 -dPDFSETTINGS=/prepress -dCompatibilityLevel=1.5 input.pdf
774 \end{lstlisting}
775
776 \begin{lstlisting}
777 LOWER QUALITY (DECT image encoding)
778 Substitute XXXXXXX with one of the following settings (order of descending quality):
779 /printer /ebook /screen
780
781 gswin64c.exe -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=output.pdf
782 -dPDFSETTINGS=XXXXXXX -dCompatibilityLevel=1.5 input.pdf
783 \end{lstlisting}
784
785 \subsection{How to create an archivable pdf?}
786
787 \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.
788
789 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.
790
791 A PDF/A file can be generated directly in \LaTeX, properly following some rules (see ``Creare file archiviabili con pdf\LaTeX\ e Lua\LaTeX'' by Claudio Beccari) however we do not have enough space to cover this topic here.
792 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}. Follow the following steps:
793
794 \begin{enumerate}
795 \item Copy in your working directory an \texttt{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}. Rename it, for example, in \texttt{srgb.icc}.
796
797 \item Copy a PostScript definition file, with the instructions to convert the file in PDF/A, in your working directory. This file, containing all the proper commands, can be found in your computer.
798 You can find it under the name \texttt{PDFA\_def.ps} in the \texttt{lib} folder of your Ghostscript installation directory (for example \texttt{C:\bs Program Files\bs gs\bs gs9.22\bs lib\bs}typically in the lib subfolder). Copy this file in your working directory and rename it! Let us suppose to rename it in \texttt{PDFArenamed.ps}.
799
800 \item Modify the PostScript definition file. Open the \texttt{PDFArenamed.ps} file and specify the color profile (\texttt{srgb.icc}) and the title of your pdf file. To do that use the text editor you prefer. The variables to modify are intuitive and easily identifiable: \texttt{/ICCProfile} and \texttt{/Title}.
801
802 \item Open a terminal and launch the following command
803 \begin{lstlisting}
804 gswin64.exe -q -dNOPAUSE -dBATCH -dNOSAFER
805 -sDEVICE=pdfwrite -sOutputFile=output.pdf
806 -dPDFA=2 -dPDFACompatibilityPolicy=1
807 -sColorConversionStrategy=UseDeviceIndependentColor
808 -sProcessColorModel=DeviceRGB
809 PDFArenamed.ps input.pdf
810 \end{lstlisting}
811
812 \item Finally, control that the converted file correctly adheres to the PDF/A format using the VeraPDF software.
813
814 \end{enumerate}
815
816 \addtocontents{toc}{\protect\end{multicols}}
817 \end{document}