summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/toptesi/toptesi.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/toptesi/toptesi.dtx')
-rw-r--r--Master/texmf-dist/source/latex/toptesi/toptesi.dtx1136
1 files changed, 634 insertions, 502 deletions
diff --git a/Master/texmf-dist/source/latex/toptesi/toptesi.dtx b/Master/texmf-dist/source/latex/toptesi/toptesi.dtx
index 2bf9d7ef74f..fe9d19684e2 100644
--- a/Master/texmf-dist/source/latex/toptesi/toptesi.dtx
+++ b/Master/texmf-dist/source/latex/toptesi/toptesi.dtx
@@ -6,7 +6,7 @@
\preamble
______________________________________________________
The TOPtesi package
- Copyright (C) 2010 Claudio Beccari
+ Copyright (C) 2011 Claudio Beccari
All rights reserved
License information appended
@@ -25,11 +25,11 @@ 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, topcommand.sty,
-toptesi.cfg, and the English documentation toptesi.pdf;
+toptesi.cls, toptesi.sty, topfront.sty, topcommand.sty,
+toptesi.cfg, and the English documentation toptesi.pdf.
-Furthermore the bundle contains the documentation source file toptesi-doc.tex
-and the derived file toptesi-doc.pdf.
+Furthermore the bundle contains the documentation source file toptesi-doc-xetex.tex
+and the derived file toptesi-doc-xetex.pdf.
The toptesi-example.tex source file is just an example that shows how
to use the various commands; by commenting or uncommenting certain
@@ -39,10 +39,10 @@ frontpages.
The toptesi.cfg file is a sample of a local configuration file that can be
freely edited and modified.
-By running pdflatex on toptesi.dtx the user gets the cls, sty and cfg files
+By running pdflatex on toptesi.dtx the user gets the class, sty and cfg files
and the English documentation file in pdf format.
-The documentation file toptesi-doc.pdf is in Italian; its source file is
+The documentation file toptesi-doc-xetex.pdf is in Italian; its source file is
another example of how to use toptesi.
\endpostamble
\askforoverwritefalse
@@ -58,7 +58,7 @@ another example of how to use toptesi.
\endgroup
%</internal>
%
-% Copyright 2005--2011 Claudio Beccari
+% Copyright 1989--2006 Claudio Beccari
%
% This file is part of the TOPtesi bundle
% -------------------------------------------
@@ -77,21 +77,23 @@ another example of how to use toptesi.
% given in the file `manifest.txt'.
%
% The list of derived (unpacked) files belonging to the distribution
-% and covered by LPPL is defined by the unpacking scripts (with
-% extension .ins) which are part of the distribution.
+% and covered by LPPL is defined by the self unpacking file toptesi.dtx
+% which is part of the distribution.
%
% \fi
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
-\ProvidesFile{toptesi.dtx}[2011/05/25 v.5.50 Documented TeX file for
+\ProvidesFile{toptesi.dtx}[2011/08/09 v.5.59 Documented TeX file for
the TOPtesi bundle]
\GetFileInfo{toptesi.dtx}
\title{The TOPtesi bundle}
\date{\fileversion\space\filedate}
\author{Claudio Beccari}
-
+
+\usepackage{metalogo}
+\def\prog#1{\textsf{#1}}
\begin{document}\errorcontextlines=9
\maketitle
\setlength\hfuzz{20pt}
@@ -100,7 +102,7 @@ the TOPtesi bundle]
%</driver>
% \fi
%
-% \CheckSum{2441}
+% \CheckSum{2551}
%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -129,11 +131,20 @@ the TOPtesi bundle]
% 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.
+% title page (and possibly of the legal page) requirements. This version is experimentally
+% compliant with the \XeLaTeX\ program. 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, because it resorts to a
+% compilation with pdf\LaTeX; the typesetting engine \XeTeX\ does not produce directly
+% any PDF output but a modified, extended DVI output, even if this format is immediately
+% transformed into a PDF file through a special version, xdvipdfmx, of the conversion program. Another
+% minor XeLaTeX feature is that it cannot fully exploit the typesetting facilities of
+% the micro type package, but the wide choice of OpenType fonts replaces almost completely
+% such missing feature.
% \end{abstract}
%
% \section{Introduction}
-% The TOPtesi bundle collects a certain number of files, specifically:
+% The TOPtesi bundle collects a certain number of files, specifically
% \begin{itemize}
% \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
@@ -142,8 +153,8 @@ the TOPtesi bundle]
% 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.
+% 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 the report class file,
% although this use is discouraged.
@@ -154,51 +165,70 @@ the TOPtesi bundle]
% title page fixed information in languages different from Italian.
% \item A third extension package \texttt{topcoman.sty} that defines a certain number
% of user commands suitable for typesetting technical matters.
-% \item Previous version of this bundle contianed also the logos of a certain number of
+% \item Previous version of this bundle contained also the logos of a certain number 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-doc.pdf} written in Italian where every feature
-% is explained in detail; this English documentation gives a summary of the necessary
-% information and contains the code description.
+% \item A documentation file \texttt{toptesi-doc-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-doc-xetex.tex} may be used as a sample
+% for typesetting one's thesis with XeLaTeX.
% \end{itemize}
%
% The above files are complemented with a configuration file that any user may
% personalize at will; these personalizations make it easy to configure the
% bundle so as to make it suitable for another language; in facts the \textsf{babel}
-% package contains localizations for many languages, but such localizations deal
+% package contains localizations 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.
%
+% TOPtesi was specifically conceived for typesetting theses with the \LaTeX\ mark-up, and
+% initially was using the \textsf{tex} typesetting engine; later on this engine was
+% substantially substituted by the \textsf{pdftex} engine, 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 resident in the specific platform where the document is being
+% typeset. For what concerns theses this might be of essential importance when the thesis
+% refers to specific languages that use different scripts (Greek, Russian, Bulgarian,
+% Chinese, Japanese, Korean, 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 at this version number this bundle
+% should be considered as a ``beta'' one. 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. I suppose that typewriter documents have completely vanished
-% except perhaps in the legal professions, especially in Italy where legal documents have to
-% be written on special paper produced by the State Polygraphic Institute and carry a
-% watermark and the Republic's Seal; without a special printer it would be very difficult to
-% typeset from a computer on such a custom paper.
+% 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 specialized 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 ``good old times'' of mechanical typewriters
+% on typesetting styles that refer to the ``gone by times'' of mechanical typewriters
% should be banned.
%
% 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 document class.
+% report document 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.
@@ -222,9 +252,9 @@ the TOPtesi bundle]
% \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
+% 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
% sectioning commands.
@@ -261,8 +291,8 @@ the TOPtesi bundle]
% \Item[frontespizio] is the actual command that typesets the title page and this command
% uses all the information that is passed to it by means of the following
% commands.
-% \Item[monografia] sets the bachelor's report style and retrieves the report title
-% \Item[titolo] gets the thesis title and an optional thesis short title
+% \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}
@@ -283,8 +313,8 @@ the TOPtesi bundle]
% \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[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
@@ -300,13 +330,13 @@ the TOPtesi bundle]
% \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 labeling phrase in the proper gender
-% and proper number.
+% 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 labeling 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
+% \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
@@ -342,73 +372,87 @@ the TOPtesi bundle]
% after all the command |\annoaccademico| is defined only with that option.
% \Item[logosede] specifies the name of the file that contains the university logo;
% 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.
+% given or the file is missing, but typesetting goes on without the inclusion
+% of any logo.
% \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 for the
-% binding correction. Its argument is not optional and is used to modify
-% the default correction of 7\,mm.
+% margin so as to have a wider internal margin to accommodate for the binding
+% correction. Its argument is not optional and is used to modify the default
+% correction of 7\,mm.
% \end{description}
%
% Since the infix strings are all memorized 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 localize the package in another language; this comes particularly
-% handy for the Erasmus students on double degree programs.
+% is no difficulty to localize 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 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 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 page.
+% \texttt{report} document class. One could easily typeset 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 page.
%
% \subsection{Typesetting commands}
% The 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.
-%
-% With this respect it must be underlined that the Italian and English languages are
-% specified by default, the Italian one being the default language. An initial specification
-% of |\selectlanguage{english}| sets the English language as default. Should a student
-% typeset the thesis in French, it would be necessary to specify the option \texttt{french}
-% among the \emph{class} options, and so start the document by specifying
-% |\selectlanguage{french}|.
+% 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} to
+% \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 default language. An initial specification of
+% |\selectlanguage{english}| sets the English language as 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 so start the document by specifying |\selectlanguage{french}|.
% But the user should pay attention to use \texttt{babel} in the proper way:
% \begin{itemize}
% \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 global class options; if the thesis has
-% to be typeset, fore example, in French, is is necessary to do the following:
+% options \emph{must be specified} as global class options; therefore, 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}
-% \item With the 2010 \TeX\ complete system 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; this might not be true also with some
-% Debian distributions of the \TeX\ system.
-% Remember that \texttt{babel} 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 is the list of all language hyphenation rules
-% that are available in the format file.
-% While (American) English is the default and almost any distribution of the \TeX\ system
-% has many language defaults, it is more likely that French is preloaded while Italian is
-% not.
-%
-% 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 so as to
-% consider the languages s/he wants to work with, and finally s/he must recreate the format
-% files and put them in the proper places of the standard or the local folder tree. The user
-% is invited to carefully investigate on these fine points and to configure the system
-% properly; it would be very upsetting using 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.
+% But if the thesis should be typeset in Frenche 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 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
+% languages 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 is the list of all
+% language hyphenation rules that are available in the format file.
+% While (American) English is the default and almost any \emph{basic} distribution of the \TeX\
+% system has many language defaults, 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 so as to consider the
+% languages s/he wants to work with, and finally s/he must recreate the format files and put
+% them in the proper places of the standard or the local folder tree. The user is invited to
+% carefully investigate on these fine points and to configure the system very properly;
+% 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{itemize}
%
% The TOPtesi bundle adds very little to the user commands; nevertheless the package
@@ -419,7 +463,9 @@ the TOPtesi bundle]
% 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.
+% 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}
@@ -427,7 +473,9 @@ the TOPtesi bundle]
% \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.
+% 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
@@ -444,29 +492,29 @@ the TOPtesi bundle]
% 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 may be used in both math and text mode.
+% variable $V$. This command may be used both in math and in text mode.
% %
-% \Item[ap] similarly |\ap| inserts an apex in upright type, in both math
-% and text mode.
+% \Item[ap] similarly |\ap| inserts an apex in upright type, both in math
+% and in text mode.
% %
% \Item[unit] sets the unit of measure close to the numerical measure by
-% insetting a non breakable thin space and by setting the units of
-% measure in upright type; this works in both math and text mode. Of
+% 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}| and to avoid to input \verb*+35 \unit{km}+. This command,
% as it is defined, conflicts with the definition of the homonymous
-% command |\unit| as defined by the \texttt{units} package, but since
+% command |\unit| as defined by the \texttt{unitsx} package, but since
% this latter package is necessarily input \emph{after}
% \texttt{topcomand.sty} is read, the last definition is the one in
-% force, therefore if one wishes to use the \texttt{units} package s/he
+% force, therefore if one wishes to use the \texttt{unitsx} package s/he
% should not encounter any inconsistencies.
% %
% \Item[micro] sets the decimal prefix $\mu$ in typesetting units of
% measure.
% %
-% \Item[gradi] sets the small circle that defines the sexagesimal
-% degrees; it may be used also for the celsius degrees by writing in the
+% \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}$.
% %
@@ -476,28 +524,37 @@ the TOPtesi bundle]
% 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, it may be viewed as a vector operator,
-% so that the ISO regulations require for this symbol an upright type.
+% English word. The imaginary unit is not a variable, and the ISO regulations
+% require it is typed with anxx upright serifed font, just as operators are.
% %
% \Item[eu] inserts the Euler number symbol ``e'' in upright type; since
% this entity is not a variable, but it 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 mathematical constant, but
-% the electron charge $e$ is typeset in math italics because this is a physical
-% ``constant'', not a mathematical one.
+% the electron charge $e$ is typeset in math italics because this physical
+% ``constant'', not a mathematical one. \XeTeX\ allows to typeset upright Greek letters,
+% so there is the facility to typeset an upright ``pi'' (the number) to be distinguished
+% from an inclined ''pi'' (the angle).
% %
% \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.
+% 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 can be used as an independent extension package with (possibly) any document class.
%
-% \section{PDF format suitable for archiving}
+% \section{Format PDF suitable for archiving}
+% This section in general does not apply if the thesis is typeset by means of \XeLaTeX,
+% because the typesetting engine in this case cannot directly produce a PDF formatted output
+% file. For this reason the option \texttt{pdfa}, that shall be described shortly, should
+% not specified to the class |toptesi|; at the same time if this option is specified, but
+% the thesis is typeset by means of \XeLaTeX, the effects of this options are be disabled.
+%
% 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
@@ -506,7 +563,7 @@ the TOPtesi bundle]
% This essential question has been answered by the International Standards Organization
% (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
+% distinguished as PDF/A-1a, and PDF/A-1b. The `a' sub-format is more exacting, while
% the `b' one is less stringent.
%
% The requirements for the `a' sub-format imply not only those imposed on the `b' one,
@@ -517,38 +574,38 @@ the TOPtesi bundle]
% 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 information, such as the keywords that ease up the library search.
+% optional information, such as the keywords that ease up library searches.
%
-% Since version 1.40, the program \texttt{pdflatex}, possibly with the addition of
-% some patches, is capable of producing PDF/A-1b conforming files, provided that some
-% attention is put into the manipulation 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 and should be capable of producing PDF/A-1b files without
-% the need of any patch.
+% Since version 1.40, the program \texttt{pdflatex} is capable of producing PDF/A-1b
+% conforming files, provided that some attention is put into the manipulation 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 and is capable of producing
+% PDF/A-1b files.
%
% The particular attention needed to avoid problems with the PDF/A certification is
% summarized as follows:
% \begin{itemize}
-% \item The preliminary essential requirement is that the \texttt{pdflatex} used to
+% \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}; 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
+% 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}; 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 with |ghostscript|; read the |ghostscript| (version 8.61 or later)
+% transform it by means of |ghostscript|; read the |ghostscript| (version 8.61 or later)
% documentation file |ps2pdf.html| in order to find out how to produce the correct PS
-% to PDF/A transformation.
-
+% to PDF/A transformation. A procedure similar to this one is available when the
+% thesis is typeset by means of \XeLaTeX, and produces valid results provided some
+% caution is exercised when using fonts.
+%
% \item Download from \textsc{ctan} and install the package \textsf{pdfx}, if it is
-% not already part of your \TeX\ system installation.
+% not already part of your \TeX\ system complete distribution.
% \item Install in the main \texttt{pdfx} directory a good version of a color model
-% profile file, such as, for example, \texttt{ECI-RGB-V1.0.icc} (see in the download
-% page of the web site \texttt{www.eci.org}).
+% profile file, such as, for example, \texttt{ECI-RGB-V1.0.icc} (see the download
+% page of the site \texttt{www.eci.org}).
% \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}
@@ -563,9 +620,11 @@ the TOPtesi bundle]
% documentation.
% \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.
-% \item Use only PNG and JPEG or PDF images with RGB color profiles.
+% 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\ do not require any
+% patch, but unfortunately its PDF byproduct is not PDF/A compliant (it must be converted
+% by means of \prog{ghostscript}).
+% \item Use only PNG and JPEG images with RGB color profiles.
% \item If you include PDF images that contain some text, be sure that the font for
% this text is 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
@@ -575,33 +634,50 @@ the TOPtesi bundle]
% conformity.
% \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 conforming to the PDF/A specification. A suitable program
+% the this or that is not conforming to the PDF/A specification. A suitable program
% is the Preflight plug-in of Adobe Acrobat Professional version 8 or later, but this,
% although the most authoritative, is a commercial program; probably your university
% has special facilities for this task.
+% \item If you use \prog{xelatex} for typesetting your thesis, you have to accompany your
+% master file with another one that contains the metadata and othe necessary information.
+% Be sure to call this auxiliary file as the masterfile name glued with |-def.ps|; so if
+% your mastefile is named \texttt{JohnSmithMasterThesis.tex}, name this auxiliary file as
+% \texttt{JohnSmithMasterThesis-def.ps} and fill in the necessary metadata and other
+% thechnical information into this file in the line marked with |% Customize|. Then run
+% the \prog{ghostscript} program with the proper name (different for Windows or UNIX-like
+% platforms) with the proper input parameters and options. There are strong chances that
+% if you follow the general recommendations shown here and in the document
+% |toptesi-doc-xetex.pdf| file, the output file will be PDF/A compliant.
%\end{itemize}
%
-% Up to day the realization of a PDF/A conforming file sets forth several problems
+% Let's issue a warning: if you are using Adobe Reader X (or later), this program will open
+% a PDF file beginning with an information header claiming that the file is PDF/A
+% 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 realization of PDF/A conforming files sets forth several problems
% that are of great concern for the large Institutions that have thousands of document
-% a year to archive; it is not a question implied in the free nature of the
-% \texttt{pdflatex} program, that, on the opposite, according to my experience has
-% a very high rate of success in producing PDF/A conforming documents. If you stick to
-% the default \TeX\ system fonts and use this patched version of \texttt{ToPtesi} you
-% should be able to avoid most problems.
+% a year to archive; it is not a question implied in the free nature of the \prog{pdflatex}
+% and \prog{xelatex} 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, or to the UNICODE encoded otf or ttf fonts
+% and use this patched version of \texttt{TOPtesi} you should be able to avoid most
+% problems.
%
% \StopEventually{} ^^A qui si puo' mettere una bibliografia
%
% \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
+% 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.
% \begin{macrocode}
%<*class>
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{toptesi}%
-[2011/05/25 v.5.50 Class for typesetting university theses]
+[2011/08/09 v.5.59 Class for typesetting university theses]
% \end{macrocode}
%
% The class itself is very simple since it requires just the \texttt{report}
@@ -609,21 +685,28 @@ the TOPtesi bundle]
% specified for the \texttt{toptesi} class are passed on to the \texttt{report}
% class; the latter, on turn, is called with the \texttt{a4paper} option.
% According to the \LaTeX\ machinery of option passing the options passed on to
-% the loaded class should be appended to the existing options, so that if
-% \texttt{letterpaper}
+% the loaded class should be appended to the existing options, so that if \texttt{letterpaper}
% was specified in the calling statement of \texttt{toptesi}, this last option would
% override the default \texttt{a4paper} option. The same holds true for the other package
-% options except for the encoding name used as an option for the \texttt{inputenc} package;
-% this simply does not work and the package is not loaded any more as it was in the previous % versions\footnote{Thanks to Enrico Gregorio who pointed out this feature.}.
+% options except for the encoding name used as an option for the \texttt{inputenc} package; this % simply does not work and the package is not loaded any more as it was in the previous % versions\footnote{Thanks to Enrico Gregorio who pointed out this feature.}.
% Similarly if another language was specified in the list of \texttt{toptesi}
-% options, this language would be appended to the \texttt{babel} package default options
+% options, this language would be appended yo the \texttt{babel} package default options
% and would become the default language.
% \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions\relax
-%
\LoadClass[a4paper]{report}
-\RequirePackage[english,italian]{babel}
+\RequirePackage{ifxetex}
+\ifxetex
+ \RequirePackage{fontspec}
+ \RequirePackage{polyglossia}
+ \setmainlanguage{italian}
+ \setotherlanguage{english}
+ \renewcommand*{\iflanguage}[1]{\ifnum\the\language=\csname l@#1\endcsname
+ \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+\else
+ \RequirePackage[english,italian]{babel}
+\fi
\RequirePackage{toptesi}
%
%</class>
@@ -632,28 +715,28 @@ the TOPtesi bundle]
% 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
-% standalone package, although, take notice, it might conflict with the \texttt{book} class
+% stand aolone package, although, take notice, it might conflict with the \texttt{book} class
% code and 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.
+% numbers compared to the class file and the other invoked packages that are part of the same
+% bundle.
%
% \begin{macrocode}
%<*topsty>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{toptesi}%
-[2011/05/25 v.5.50 Extension for toptesi.cls]%
+[2011/08/09 v.5.59 Extension for toptesi.cls]%
% \end{macrocode}
%
-% We start by defining the debugging macros; these trace commands and macros
-% and are the usual ones I use for debugging. I know the \texttt{trace} package is supposed
+% 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 I am used to 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}
+% Now we define the specific package macros: \texttt{classica} and \texttt{trieste}
% are identical; \texttt{trieste} 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 \texttt{extsizes} pacckage and is already
@@ -663,6 +746,7 @@ the TOPtesi bundle]
% is missing.
%
% \texttt{chapterbib} allows to set a list of references at the end of each chapter.
+%
% For the options specific to the \texttt{classica} style a couple of boolean variables are
% defined and the option definitions set them to the value ``true''.
% \begin{macrocode}
@@ -672,7 +756,8 @@ the TOPtesi bundle]
% \end{macrocode}
%
% \begin{macrocode}
-\newlength\T@Pbinding\setlength\T@Pbinding{7mm}\def\setbindingcorrection#1{\T@Pbinding=#1}
+\newlength\T@Pbinding\setlength\T@Pbinding{7mm}
+\def\setbindingcorrection#1{\T@Pbinding=#1}
\newif\if@binding \@bindingfalse
\newif\ifT@Ppdfa \T@Ppdfafalse
\newif\ifchapterbibliography \chapterbibliographyfalse
@@ -745,7 +830,7 @@ the TOPtesi bundle]
\fi}
% \end{macrocode}
%
-% We now establish the page style. We start by setting to ``empty'' the tokens that
+% We now establish the page style. We start by setting to ``empy'' the tokens that
% keep the left and the right marks; we define a box so as to set the headers
% inside this box; we redefine also the plain page styles; it is actually a leftover
% from the previous versions when the page number was set at the foot in bold face,
@@ -761,7 +846,7 @@ the TOPtesi bundle]
\newbox\@intesta
%
\def\ps@plain{\let\@mkboth\@gobbletwo
-\def\@oddfoot{\null\hfill \textsc{\lapagina}\hfill \null}\def\@oddhead{}
+\def\@oddfoot{\null\hfill {\scshape\lapagina}\hfill \null}\def\@oddhead{}
\def\@evenhead{}\let\@evenfoot\@oddfoot}
% \end{macrocode}
% Other page styles are defined in a different way according to the choice of
@@ -772,7 +857,7 @@ the TOPtesi bundle]
% \begin{macrocode}
\if@twoside
\def\ps@headings{\let\@mkboth\markboth%
- \def\@oddfoot{\null\hfill \textsc{\lapagina} \hfill\null}
+ \def\@oddfoot{\null\hfill {\scshape\lapagina} \hfill\null}
\let\@evenfoot\@oddfoot
%
\def\@evenhead{\setbox\@intesta\hbox{\footnotesize\slshape
@@ -790,7 +875,7 @@ the TOPtesi bundle]
\thesection\ -- \fi ##1}}}
\else
\def\ps@headings{\let\@mkboth\markboth
- \def\@oddfoot{\null \hfill \textsc{\lapagina} \hfill \null}
+ \def\@oddfoot{\null\hfill {\scshape\lapagina} \hfill\null}
\def\@evenfoot{}
\def\@oddhead{\setbox\@intesta\hbox{\footnotesize\slshape
\rightmark}%
@@ -799,18 +884,38 @@ the TOPtesi bundle]
\strut\rightmark}}}%
\def\chaptermark##1{\markright{\thechapter\ -- ##1}}}
\fi
-%
+
\def\headWarn#1{\PackageWarning{toptesi}{%
THE HEADING IS TOO LONG\MessageBreak
Use the optional argument of command \string#1\MessageBreak
See the LaTeX Handbook (1994) on section C.4.1\MessageBreak}}
% \end{macrocode}
-% The various tables of contents or figures or tables require some boolean variables to be
-% defined; in facts, although the ISO regulations require that every technical report
-% contains the list of figures and/or tables, in Italy theses rarely contain these lists;
-% after all: is a thesis a technical report? We require also some other boolean variables to
-% handle the difference between front matter and main matter; this differences are already
-% defined in the \texttt{book} document class, but not in the \texttt{report} one.
+% Bisogna ridefinre anche il modo di inserire nell'indice i capitoli non numerati con le pagine in
+% numeri romani maiuscoletti
+% \begin{macrocode}
+\renewcommand*\l@chapter[2]{%
+ \ifnum \c@tocdepth >\m@ne
+ \addpenalty{-\@highpenalty}%
+ \vskip 1.0em \@plus\p@
+ \setlength\@tempdima{1.5em}%
+ \begingroup
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode \bfseries
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ #1\nobreak\hfil \nobreak
+ \hb@xt@\@pnumwidth{\hss\unless\ifxetex\normalfont\fi\scshape{#2}}\par
+ \penalty\@highpenalty
+ \endgroup
+ \fi}
+% \end{macrocode}
+% The various tables of contents or figures or tables require some boolean variables to
+% be defined; in facts, although the ISO regulations require that every technical report contains
+% the list of figures and/or tables, in Italy theses rarely contain these lists; after all: is
+% a thesis a technical report? We require also some other boolean variables to handle
+% the difference between front matter and main matter; this differences are already defined
+% in the \texttt{book} document class, but not in the \texttt{report} one.
% \begin{macrocode}
\newif\iffigurespage
\newif\iftablespage
@@ -828,8 +933,8 @@ the TOPtesi bundle]
\AtBeginDocument{\frontmatter}
% \end{macrocode}
% The main matter is automatically established with the first |\chapter| command issued by
-% the user; this means that every command that starts a section at the ``chapter'' level
-% within the front matter must be executed without an explicit call to |\chapter|.
+% the user; this means that every command that starts a section at the ``chapter'' level within
+% the front matter must be executed without an explicit call to |\chapter|.
%
% By default we set to false the boolean variables that control the typesetting of the
% list of figures and the list of tables.
@@ -967,15 +1072,15 @@ the TOPtesi bundle]
\brokenpenalty=10000
% \end{macrocode}
%
-% Here comes a questionable command and/or environment; good typesetting requires the
-% baseline skip to be proportioned to the font size, generally it is some 10--20\% larger
-% than the font size. In some reasonable instances a wider or a narrower baseline skip
+% Here comes a questionable command and/or environment; good typesetting
+% requires the baseline skip to be proportioned to the font size, generally it is some 10--20\%
+% larger than the font size. In some reasonable instances a largeer or a smaller baseline skip
% might be required; the \LaTeX\ kernel allows to use the |\linespread| command;
% in the previous versions of this bundle a command |\interlinea| and an environment
-% \texttt{interlinea} were defined so as to allow to set the line spread factor.
+% \texttt{interlinea} were defined so as to allow setting the line spread factor.
% The experience has shown that students tend to use this command so as to typeset a poor
-% and thin thesis on more pages. Well, every instrument can be judiciously or maliciously
-% used; this is one of those double sided instruments.
+% and thin thesis on more pages. Well, every instrument can be judiciously or maliciously used;
+% this is one of those double sided instruments.
% \begin{macrocode}
\def\interlinea#1{\linespread{#1}\selectfont}
\def\endinterlinea{\par}
@@ -991,17 +1096,16 @@ the TOPtesi bundle]
\@setminipage
}
% \end{macrocode}
-% Since we are at it we define the floating bodies placing parameters; not only the values
-% ``here'', ``top of the page'' and ``bottom of the page'', that we set as default ones
-% leaving to the user to explicitly specify the ``page of floats'', but also the numerical
-% and geometrical parameters that control the float placements.
-% These geometrical parameters are critical and everybody has his/her own ideas of what are
-% the best values for them. According to my experience these parameters work quite well
+% Since we are at it we define the floating bodies placing parameters; not only the
+% values ``here'', ``top of the page'' and ``bottom of the page'', that we set as default ones
+% leaving to the user to explicitly specify the ``page of floats'', but also the numerical and
+% geometrical parameters that control the float placements.
+% These geometrical parameters are critical and everybody has his/her own ideas of
+% what are the best values for them. According to my experience these parameters work quite well
% but I would not suggest them for every kind of typewritten document.
-% In particular the zero value for the text fraction appears strange, but students have
-% the tendency to create large figures (more than large tables) and these tend to clog the
-% figure queue.
-% A 100\% space for the top of page figures and a requirement of 0\% text allows large
+% In particular the zero value for the text fraction appears strange, but students have the
+% tendency to create large figures (more than large tables) and these tend to clog the figure
+% queue. A 100\% space for the top of page figures and a requirement of 0\% text allows large
% floats to exit the queue provided they do not exceed the text height.
% \begin{macrocode}
\def\fps@figure{htb} \def\fps@table{htb}
@@ -1017,24 +1121,25 @@ the TOPtesi bundle]
\def\dbltopfraction{1}
\def\dblfloatpagefraction{0}
% \end{macrocode}
-%I don't like too much the default definition of the |\caption| command; actually
-% it is the internal |\@makecaption| macro that performs the job i don't like. The
-% point is that I prefer a narrower justified caption rather than a caption where the last
-% line is just a short word or the right segment of an hyphenated word. If one sets the
+% One command that the default definition does not satisfy me very much is the |\caption|
+% command; actually it is the internal |\@makecaption| macro that performs the job. The point
+% is that I prefer a narrower justified caption rather than a caption where the last line is just
+% a short word or the right segment of an hyphenated word. If one sets the
% |\finalhyphendemerits| counter to an incredibly high value, one might succeed
% in avoiding hyphenation in the last word of a caption; but this might lead
% to a very loose typesetting of the caption paragraph, especially
-% if the horizontal box that contains it hardly exceeds the caption width. I initially set
-% the caption width (a new length) to the overall text width diminished by 3em;
+% if the horizontal box that contains it hardly exceeds the caption width.
+% I initially set the caption width (a new length) to the overall text width diminished by 3em;
% then if the caption text, inclusive of the caption type string and number, is shorter than
-% the text width it is typeset as centered text; if it exceeds the text width it is set as a
-% justified paragraph whose line width equals the established caption width; but in any case
-% the last line of the paragraph is measured and if it is shorter than one third of the
-% caption width, this latter width is shortened a little bit and the paragraph is set again
+% the text width it is typeset as centered text; if it exceeds the text width
+% it is set as a justified paragraph whose line width equals the established caption width;
+% but in any case the last line of the paragraph is measured and if it is shorter than one third
+% of the caption width, this width is shortened a little bit and the paragraph is set again
% with this shortened caption width; in order to be sure that one iteration is
% sufficient, the shrinking of the caption width must be computed according to
% the number of lines the paragraph occupies.
-% In order to count the number of lines the caption paragraph occupies, it is
+%
+% In order to count the number of lines the caption paragraph occupies it is
% necessary to recall that the first line occupies a vertical space that equals
% |\topskip| while the other lines occupy a vertical space equal to
% |\baselineskip|; the latter one is generally larger than |\topskip| therefore
@@ -1049,7 +1154,7 @@ the TOPtesi bundle]
% and we must remember the presence of this line in our arithmetics.
% If the length of the stripped last line is longer that one third of the
% caption width, then the vertical box is recomposed by restacking the
-% individual lines; on the opposite, if this last line is shorter than one third of the
+% individual lines, but if this last line is shorter than one third of the
% caption width, this width is recomputed in this way: let $N-1$ be the number
% of lines obtained with the integer division, i.e.\ one line less than those
% actually contained in the vertical box. Let $x$ be the initial caption
@@ -1062,7 +1167,7 @@ the TOPtesi bundle]
% space, some words might have been hyphenated in a different way, and so on.
% Moreover we do not want a caption that barely exceeds the length of
% |\captionwidth| to be retyped into a two line caption width that is about one half
-% the width of the other captions. Therefore we allow for some white space in
+% of the width of the other captions. Therefore we allow for some white space in
% the last line by computing the new caption width with the following formula
% \[ y=\frac{(N+0.5)x + x_2}{N+1} \]
% \begin{macrocode}
@@ -1163,11 +1268,9 @@ the TOPtesi bundle]
% must be typeset, such as, for example, $\forall i=0,\,1,\,2,\,3, n$, in the source code
% a space \emph{must} be inserted after every punctuating comma while no space follows a
% decimal comma: for example \verb*+$\forall i=0, 1, 2, 3,n$+. The space before the |n| is
-% not necessary (but it wouldn't hurt) beecause |n| is not recognized as a digit, therefore
+% not necessary (but it wouldn't hurt) because |n| is not recognized as a digit, therefore
% the ``intelligent'' comma inserts the necessary space by itself.
%
-% |\topmargin| set to 0pt simply means that the real top margin is 25.4mm, i.e.\ one
-% inch, since the output offset is one inch by default.
% \begin{macrocode}
\DeclareMathSymbol{\virgola}{\mathpunct}{letters}{"3B}
\DeclareMathSymbol{\virgoladecimale}{\mathord}{letters}{"3B}
@@ -1187,14 +1290,14 @@ the TOPtesi bundle]
% that start these sections depend on the used language.
%
% Because of this it is necessary to extend the list of infix string definitions provided
-% the |\captions|$\langle$\texttt{language}$\rangle$ macros defined by the language
-% description files of \texttt{babel}; for this purpose we define a macro for adding new
-% items for these two new sectioning commands. This macro receives three arguments: the
-% first is the babel language name, the second is the string for the summary name, and
-% finally the third is the string for the acknowledgements name; everything is contained
-% within a group and only the relevant captions macro is globally redefined. The token
-% register `0' is normally for scratch usage, but the fact that its value is restored upon
-% exiting the group provides the necessary protection against an involuntary reassignment
+% the |\captions|$\langle$\texttt{language}$\rangle$ macros defined by the language description
+% files of \texttt{babel} or of \texttt{polyglossia}; for this purpose we define a macro for
+% adding new items for these two new sectioning commands. This macro receives three arguments:
+% the first is the babel language name, the second is the string for the summary name, and
+% finally the third is the string for the acknowledgements name; everything is contained within
+% a group and only the relevant captions macro is globally redefined. The token register `0' is
+% normally for scratch usage, but the fact that its value is restored upon exiting the
+% group provides the necessary protection against an involuntary reassignment
% to this register. At the same time if a specific language option was not
% specified, a warning message is issued, but compilations goes on any way
% without the sectioning string names. For being sure no other undefined error
@@ -1216,7 +1319,7 @@ Skipping any redefinition\MessageBreak}%
}}}%
% \end{macrocode}
% For Italian and English there are no problems; we provide immediately these extensions
-% by means of the newly available macros:
+% by means of the newly available macro:
% \begin{macrocode}
\ExtendCaptions{italian}{Sommario}{Ringraziamenti}
\ExtendCaptions{english}{Summary}{Acknowledgements}
@@ -1225,8 +1328,8 @@ Skipping any redefinition\MessageBreak}%
% default; therefore both caption macros |\captionsitalian| and |\captionsenglish| are
% already defined and can be freely extended. For any other language the corresponding
% language option must be entered in the class opening statement, otherwise a warning
-% is issued but compilation is not stopped. Therefore if, for example, the user wants to
-% write the thesis in Spanish, the thesis main file shall start like this:
+% is issued but compilation is not stopped. Therefore if, for example, the user wants to write
+% the thesis in Spanish, the thesis main file shall start like this:
% \begin{verbatim}
% \documentclass[...,spanish]{toptesi}
% \ExtendCaptions{spanish}{Resumen}{Agradecimientos}
@@ -1258,11 +1361,15 @@ Skipping any redefinition\MessageBreak}%
% following:
% \begin{itemize}
% \item specify |\english| \emph{after} the |\begin{document}| statement, if English is
-% supposed to be the default language, or
-% \item specify the language name, other than Italian or English, among the class options;
-% use the |\ExtendCaptions| macro for extending the list of sectioning commands infix
-% strings as explained above; specify with |\selectlanguage| the new language as the default
-% one \emph{after} the |\begin{document}| statement.
+% supposed to be the default language, or
+% \item specify the language name, other than Italian or English, among the class options; use
+% the |\ExtendCaptions| macro for extending the list of sectioning commands infix strings
+% as explained above; specify with |\selectlanguage| the new language as the default one
+% \emph{after} the |\begin{document}| statement.
+% \item If XeLaTeX is being used for typesetting it suffixes to specify in the preamble the name
+% of the other language to be used, by means of the |setotherlanguage| command, and to define the
+% summary and acknowledgments names in the same way as with pdf\/\LaTeX; the same must be done at
+% the beginning of the document to declare the new language a the default one.
% \end{itemize}
% \begin{macrocode}
\AtBeginDocument{%
@@ -1272,10 +1379,86 @@ Skipping any redefinition\MessageBreak}%
% \end{macrocode}
%
% At last the subsidiary and independent packages \texttt{topcoman} and \texttt{topfront}
-% are requested for input and file input is explicitly ended.
+% are requested for input. For using XeLaTeX as the typesetting engine it's necessary to load such packages at the ``begin document'' step, so that all a the other settings, especially fonts are already established. May be it should be better done also when using pdf\/\LaTeX\ as the typesetting engine, but the past experience has not shown any inconvenience.
+% \begin{macrocode}
+\ifxetex
+ \AtBeginDocument{\RequirePackage{topfront}
+ \RequirePackage{topcoman}}
+\else
+ \RequirePackage{topfront}
+ \RequirePackage{topcoman}
+\fi
+\def\sf@size{7}
+% \end{macrocode}
+%
+% Last but not least, here come the specifications for the PDF/A-1b format. First of
+% all the patches to the macros |\not| and |\mapstochar| that produce problems with
+% the format, because they have a declared width of 0\,pt; this is no problem for
+% \texttt{latex} or \texttt{pdflatex}, but it is a problem for the PDF/A format.
+% Therefore these commands must be replaced by equivalent ones that do not use zero-width
+% glyps. For |\not|, another slash can be used, but in order to have it the right size
+% in all math typesetting modes it is necessary to have a different command for
+% every mode; this is achieved with the |\mathchoice| primitive as such:
+% \begin{macrocode}
+\ifxetex\else
+\renewcommand*\not{\mathrel{\mathchoice%
+ {\rlap{$\displaystyle\mkern2.5mu\mathnormal{/}$}}%
+ {\rlap{$\textstyle\mkern2.5mu\mathnormal{/}$}}%
+ {\rlap{$\scriptstyle\mkern2.5mu\mathnormal{/}$}}%
+ {\rlap{$\scriptscriptstyle\mkern2.5mu\mathnormal{/}$}}%
+}}
+% \end{macrocode}
+% Actually the zero-width property of the slash must be simulated with a zero-width box
+% but within this box it is necessary to specify the typesetting style of the math
+% mode material.
+%
+% A similar trick is used to patch the |\mapstochar| command but no other glyph was
+% found suitable for substituting the original one; therefore we had to make it up
+% with the |picture| environment:
+% \begin{macrocode}
+\renewcommand\mapstochar{\mathrel{\mathchoice
+{\displaystyle\unitlength=0.0555\fontdimen6\font
+ \picture(0,0)\put(1,1.5){\linethickness{0.72\unitlength}%
+ \line(0,1){6}}\endpicture}
+{\textstyle\unitlength=0.0555\fontdimen6\font
+ \picture(0,0)\put(1,1.5){\linethickness{0.72\unitlength}%
+ \line(0,1){6}}\endpicture}
+{\scriptstyle\unitlength=0.0555\fontdimen6\font
+ \picture(0,0)\put(1,0.55){\linethickness{0.61\unitlength}%
+ \line(0,1){5}}\endpicture}
+{\scriptscriptstyle\unitlength=0.0555\fontdimen6\font
+ \picture(0,0)\put(1,0.2){\linethickness{0.56\unitlength}%
+ \line(0,1){4}}\endpicture}
+}}\fi
+% \end{macrocode}
+% The above patches are introduced irrespective of using \texttt{pdflatex} for producing
+% a PDF/A compliant file; one might need to produce a traditional PDF file, or even a
+% DVI file, to be converted to the PS format, in order to possibly further transform
+% it to PDF/A by means of \texttt{ghostscript} (see the details in the
+% \texttt{ps2pdf.html} file belonging to the \texttt{ghostscript} documentationx). The
+% patches are avoided if XeLaTeX is being used with the UNICODE math definitions.
+%
+% Finally, if the class option |pdfa| was specified, we load the |pdfx.sty| file
+% with the suitable option for typesetting a (hopefully) PDF/A conforming file.
+% We must remember that |pdfx.sty| on turn loads
+% the |hyperref.sty| file with the necessary |pdfa| option. The user, therefore does
+% not need to reload that package, but is free to configure it through the
+% |\hypersetup| command arguments right at the beginning of the thesis main file.
+%
+% Nevertheless if \XeLaTeX\ is being used to typeset the document, loading of the package
+% |pdfx| is skipped; at the same time the |hyperref| package is being loaded anyhow
+% just because the |pdfa| option was specified, but at least the |pdfa| option is
+% specified, so that even if it's necessary to resort to |ghostscript| in order to produce
+% a PDF/A compliant file, at least the hyperlinks to external sites are suitably
+% ``sterilized''.
% \begin{macrocode}
-\RequirePackage{topfront}
-\RequirePackage{topcoman}
+\ifT@Ppdfa
+ \unless\ifxetex
+ \RequirePackage[a-1b]{pdfx}
+ \else
+ \RequirePackage{hyperref}
+ \fi
+\fi
% \end{macrocode}
%
% \subsection{The \texttt{classica} option}
@@ -1283,10 +1466,10 @@ Skipping any redefinition\MessageBreak}%
% in humanities and the specifications came from Paolo Ciacchi, a student of the University
% of Trieste, who was preparing a master thesis in classical Greek philology. The necessity
% of the large normal size derived from the necessity of having clear mark-up signs among
-% the myriad signs philologists use, that sometimes let me believe that the philological
+% the myriad signs philologists use, that sometimes let me believe that the philological
% mark-up requires typesetting environments similar to the mathematical ones, since the
-% material to be typeset does not form a linear sequence, as in plain text, but a
-% bi-dimensional structure as in mathematics.
+% material to be typeset does not form linear sequences, as in plain text, but
+% bi-dimensional structures as in mathematics.
%
% The other requirements involve the title page and I agreed to implement them, since they
% are likely to be useful for other universities as well; the effort for localizing this
@@ -1378,13 +1561,13 @@ Skipping any redefinition\MessageBreak}%
\let\@evenfoot\@oddfoot
%
\def\@evenhead{%
- \setbox\@intesta\hbox{\latintext
+ \setbox\@intesta\hbox{\unless\ifxetex\latintext\fi
\footnotesize\strut\textsc{%
\@author\ifx\@secondauthor\empty\else\ et al.\fi: \@stitle}%
}%
\ifdim\wd\@intesta>\textwidth\headwrn{\titolo}\fi
\underline{\makebox[\textwidth]{\box\@intesta}}}%
- \def\@oddhead{\latintext
+ \def\@oddhead{\unless\ifxetex\latintext\fi
\setbox\@intesta\hbox{%
\footnotesize\strut\textsl{\rightmark}}%
\ifdim\wd\@intesta>\textwidth \headWarn{\section}\fi%
@@ -1395,19 +1578,19 @@ Skipping any redefinition\MessageBreak}%
\renewcommand*{\ps@headings}{\let\@mkboth\markboth
\def\@oddfoot{\null \hfill \textbf{\lapagina}\hfill \null}%
\let\@evenfoot\empty\let\@evenhead\empty
- \def\@oddhead{{\setbox\z@\hbox{\latintext\footnotesize
+ \def\@oddhead{{\setbox\z@\hbox{\unless\ifxetex\latintext\fi\footnotesize
\textsc{%
\@author\ifx\@secondauthor\empty\else\ et al.\fi: \@stitle}}%
- \setbox\tw@\hbox{\latintext\footnotesize\textsl{\rightmark}}%
+ \setbox\tw@\hbox{\unless\ifxetex\latintext\fi\footnotesize\textsl{\rightmark}}%
\dimen@=2em\advance\dimen@\wd\z@\advance\dimen@\wd\tw@
\ifdim\dimen@<\textwidth \relax
\else
\setbox\z@\vbox{\hsize.48\textwidth\parindent\z@\raggedright
- \latintext\footnotesize\textsc{%
+ \unless\ifxetex\latintext\fi\footnotesize\textsc{%
\@author\ifx\@secondauthor\empty\else\ et al.\fi: \@stitle
}}%
\setbox\tw@\vbox{\hsize.48\textwidth\parindent\z@\raggedleft
- \latintext\footnotesize\textsl{\rightmark}}%
+ \unless\ifxetex\latintext\fi\footnotesize\textsl{\rightmark}}%
\fi
\setbox\@intesta\vbox to\z@{%
\vss\hbox to\textwidth{\strut\box\z@\hfill\box\tw@}}%
@@ -1511,100 +1694,42 @@ Skipping any redefinition\MessageBreak}%
}{%
\endlist\clearpage
}
-% \end{macrocode}
-%
-% \subsection{PDF/A patches and configuration}
-% Last but not least, here come the specifications for the PDF/A-1b format. First of
-% all the patches to the macros |\not| and |\mapstochar| that produce problems with
-% the format, because they have a declared width of 0\,pt; this is no problem for
-% \texttt{latex} or \texttt{pdflatex}, but it is a problem for the PDF/A format.
-% Therefore these commands must be replaced by equivalent ones that do not use zero-width
-% glyps. For |\not|, another slash can be used, but in order to have it the right size
-% in all math typesetting modes it is necessary to have a different command for
-% every mode; this is achieved with the |\mathchoice| primitive as such:
-% \begin{macrocode}
-\renewcommand*\not{\mathrel{\mathchoice%
- {\rlap{$\displaystyle\mkern2.5mu\mathnormal{/}$}}%
- {\rlap{$\textstyle\mkern2.5mu\mathnormal{/}$}}%
- {\rlap{$\scriptstyle\mkern2.5mu\mathnormal{/}$}}%
- {\rlap{$\scriptscriptstyle\mkern2.5mu\mathnormal{/}$}}%
-}}
-% \end{macrocode}
-% Actually the zero-width property of the slash must be simulated with a zero-width box
-% but within this box it is necessary to specify the typesetting style of the math
-% mode material.
-%
-% A similar trick is used to patch the |\mapstochar| command but no other glyph was
-% found suitable for substituting the original one; therefore we had to make it up
-% with the |picture| environment:
-% \begin{macrocode}
-\renewcommand\mapstochar{\mathrel{\mathchoice
-{\displaystyle\unitlength=0.0555\fontdimen6\font
- \picture(0,0)\put(1,1.5){\linethickness{0.72\unitlength}%
- \line(0,1){6}}\endpicture}
-{\textstyle\unitlength=0.0555\fontdimen6\font
- \picture(0,0)\put(1,1.5){\linethickness{0.72\unitlength}%
- \line(0,1){6}}\endpicture}
-{\scriptstyle\unitlength=0.0555\fontdimen6\font
- \picture(0,0)\put(1,0.55){\linethickness{0.61\unitlength}%
- \line(0,1){5}}\endpicture}
-{\scriptscriptstyle\unitlength=0.0555\fontdimen6\font
- \picture(0,0)\put(1,0.2){\linethickness{0.56\unitlength}%
- \line(0,1){4}}\endpicture}
-}}
-% \end{macrocode}
-% The above patches are introduced irrespective of using \texttt{pdflatex} for producing
-% a PDF/A compliant file; one might need to produce a traditional PDF file, or even a
-% DVI file, to be converted to the PS format, in order to possibly further transform
-% it to PDF/A by means of \texttt{ghostscript} (see the details in the
-% \texttt{ps2pdf.html} file belonging to the \texttt{ghostscript} documentation).
-%
-% Finally, if the class option |pdfa| was specified, we load the |pdfx.sty| file
-% with the suitable option for typesetting a (hopefully) PDF/A conforming file.
-% We must remember that |pdfx.sty| on turn loads
-% the |hyperref.sty| file with the necessary |pdfa| option. The user, therefore does
-% not need to reload that package, but is free to configure it through the
-% |\hypersetup| command arguments right at the beginning of the thesis main file.
-% \begin{macrocode}
-\ifT@Ppdfa\RequirePackage[a-1b]{pdfx}\fi
%</topsty>
% \end{macrocode}
%
% \subsection{The package file \texttt{topfront.sty}}
-% This file is input by \texttt{toptesi}, but it can be used as an
-% independent extension package also with other classes.
+% This file is input by \texttt{toptesi}, version 5.x, but it can be used as an
+% independent extension package.
%
-% It contains all the definitions for the composition of just the title page
-% along the style requirements of \texttt{toptesi}. Since version 5.x
-% it makes use of an optional configuration file where the user can define
+% It contains all the definition for the composition of just the title page
+% along the style requirements of \texttt{toptesi}, version 5.x.
+% It makes use of an optional configuration file where the user can define
% a lot of default information and all the infix language dependent strings
% that are peculiar to this title page.
%
% This file specifies that it requires the \LaTeXe\ format and identifies itself. Since the
% package might be used to extend the performances of other classes, this package does not
-% specify any input encoding, assuming that the calling class already provided this
-% information.
+% specify any input encoding, assuming that the calling class already provided this information.
% \begin{macrocode}
%<*topfrn>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{topfront}[2011/05/25 v.5.50 Title page for TOPtesi]
+\ProvidesPackage{topfront}[2011/08/09 v.5.59 Title page for TOPtesi]
% \end{macrocode}
%
% The title page information depends on the type of ``thesis' that is being typeset.
% The following commands specify the kind of information that is going to be typeset.
% Some boolean variables are automatically set by the commands in order to change some
% formatting depending on the kind of thesis. For languages that distinguish feminine from
-% masculine adjectives or qualifications some automatic machinery is set up in order to
-% format some infix strings in a way that copes with the singular or plural forms; in
-% particular when there is a multitude of authors (maximum three) of different gender the
-% adjectives or qualifications are set masculine plurals, while when there is just one
-% author or the authors are of the same gender the adjectives or qualifications are set
-% according to number and gender. Al this is done by setting or resetting the truth value
-% associated to the boolean variable \texttt{femminile}. The boolean variable
-% \texttt{dottorato} controls the PhD thesis format, while the other variable
-% \texttt{laureatriennale} controls the formatting of the bachelor's degree report. All
-% other theses are treated as master theses, and in all cases the appropriate infix string
-% is typeset in the title page
+% masculine adjectives or qualifications some automatic machinery is set up in order to format
+% some infix strings in a way that copes with the singular or plural forms; in particular when
+% there is a multitude of authors (maximum three) of different gender the adjectives or
+% qualifications are set masculine plurals, while when there is just one author or the authors
+% are of the same gender the adjectives or qualifications are set according to number and
+% gender. Al this is done by setting or resetting the truth value associated to the boolean
+% variable \texttt{femminile}. The boolean variable \texttt{dottorato} controls the PhD thesis
+% format, while the other variable \texttt{laureatriennale} controls the formatting of the
+% bachelor's degree report. All other theses are treated as master theses, and in all cases
+% the appropriate infix string is typeset in the title page
% \begin{macrocode}
\newif\iffemminile
\newif\ifdottorato \dottoratofalse
@@ -1614,7 +1739,7 @@ Skipping any redefinition\MessageBreak}%
% The thesis title is specified by means of the following commands; |\monografia|,
% the name of the bachelors degree final report, sets also the corresponding
% boolean variables and redefines the command |\titolo| so as to avoid
-% duplications and inconsistencies; of course something could still be inconsistent
+% duplications and inconsistencies; of course something might still be inconsistent
% if the commands are given in the wrong order.
%
% |\titolo| accepts an optional argument, the ``short title'', more or less
@@ -1665,10 +1790,10 @@ Skipping any redefinition\MessageBreak}%
% this may be called in whatever mode but here we assume his name is input
% with the command |\tutore| even if ``tutor'' does not appear as the best choice;
% in any case in Italian ``tutore'' does not have the same meaning as the English ``tutor''.
-% Most Doctoral Schools require in place to name the School's director or
-% coordinator. This is why this person's name can be introduced with
+% Most Doctoral Schools require to name the School's director or
+% coordinator instead of the tutor. This is why this person's name can be introduced with
% |\direttore| or |\coordinatore|; the actual label printed over this person
-% name is ``Direttore'' or ``Coordinatore'' % but it can be changed with
+% name is ``Direttore'' or ``Coordinatore'' but it can be changed with
% |\QualificaDirettore|.
% \begin{macrocode}
\newif\ifDirettore \Direttorefalse
@@ -1704,33 +1829,35 @@ Skipping any redefinition\MessageBreak}%
\def\terzacandidata#1{\gdef\@thirdauthor{#1}}
% \end{macrocode}
%
-% The next set of macros is used to typeset the ``date'' of the thesis defense or
-% presentation or whatever is done for the final exam. The macro is sort of complicated
-% because the input format for this ``date'' may vary from a single year, to a year range,
-% to a month and year specification so that different actions must be taken; if the option
-% \texttt{classica} is in force\footnote{This option cannot be active if this extension
-% package is used to extend a document class other than \texttt{toptesi}.} then the
-% formatting of the ``date'' may be still different. This command is aliased with
-% |\esamendidottorato| which literally means ``defense of the doctoral dissertation'';
-% nevertheless both commands refer to a simple date in one of those formats.
-%
-% |\getseduta| splits the date in its two components, month and year; if the argument is a
-% single string without intervening spaces, the first one is the string itself and the
-% second is empty; this emptiness may be tested and in case the date formatting is modified
-% accordingly. In particular if the string is a single spaceless one, this string is
-% assigned to |\@submitdate|; otherwise a different treatment is made according to the fact
+% The next set of macros is used to typeset the ``date'' of the thesis defense or presentation
+% or whatever is done for the final exam. The macro is sort of complicated because the input
+% format for this ``date'' may vary from a single year, to a year range, to a month and year
+% specification so that different actions must be taken; if the option \texttt{classica} is in
+% force\footnote{This option cannot be active if this extension package is used to extend a
+% document class other than \texttt{toptesi}; nevertheless if the package \texttt{trieste.sty}
+% is loaded before this package, the relevant information equivalent to \texttt{classica}
+% is fully defined and this package works as it should.} then the formatting of the ``date''
+% may be still different. This command is aliased with |\esamendidottorato| which literally
+% means ``defense of the doctoral dissertation''; nevertheless both commands refer to a simple
+% date in one of those formats.
+%
+% |\getseduta| splits the date in its two components, month and year;
+% if the argument is a single string without intervening spaces, the first one is the string
+% itself and the second is empty; this emptiness may be tested and in case the date formatting
+% is modified accordingly. In particular if the string is a single spaceless one, this string
+% is assigned to |\@submitdate|; otherwise a different treatment is made according to the fact
% that \texttt{classica} is in force; if \texttt{classica} is not in force the total string,
% including spaces is assigned to |\@submitade|. If \texttt{classica} is in force,
% |\s@dutaTrieste| is called with the whole string. On turn |\s@dutaTrieste| verifies
-% if the date should be typeset with old style numbers or in the usual way; in the latter
-% case the whole string is assigned to |\@submitdate|; in the former one the year part may
-% be a single year or a year range; This separation is tested by splitting the year part
-% across one dash; if the dash is present the extremes of the year range are assigned to
-% |\1| and |\2|, otherwise the year part is a single year;. If a single year is given this
-% is simply typeset with old style numbers and the appropriate commands are assigned to the
-% |\@submitdate| control sequence.. If a year range is given, this year range is also
-% typeset with old style numbers, and the dash is executed with a regular en-dash surrounded
-% with white space.
+% if the date should be typeset with old style numbers or in the usual way; in the latter case
+% the whole string is assigned to |\@submitdate|; in the former one the year part may be a
+% single year or a year range; this separation is tested by splitting the year part across
+% one dash; if the dash is present the extremes of the year range are assigned to |\1| and
+% |\2|, otherwise the year part is a single year. If a single year is given this is simply
+% typeset with old style numbers and the appropriate commands are assigned to the
+% |\@submitdate| control sequence. If a year range is given, this year range is also typeset
+% with old style numbers, and the dash is executed with a regular en-dash surrounded with
+% white space.
%
% \begin{macrocode}
\def\sedutadilaurea#1{\getseduta#1 !}
@@ -1739,8 +1866,7 @@ Skipping any redefinition\MessageBreak}%
\ifx\@tempA\empty
\def\@submitdate{#1}%
\else
- \expandafter
- \ifx\csname StileTrieste\endcsname\relax
+ \unless\ifclassica
\def\@submitdate{#1 #2}%
\else
\s@dutaTrieste#1 #2!%
@@ -1776,26 +1902,25 @@ Skipping any redefinition\MessageBreak}%
% depending on the default language and the configuration file.
%
% |\scuoladidottorato| gets the name of the PhD School; |\ateneo| gets the the generic name
-% of the university; |\nomeateneo| gets the proper name of the university.
-% In Italy Universities are generally named after the city they are in; in large cities
-% where there are several universities, each one of them has a proper name. For example the
-% generic name might be ``Universit\`a di Roma'' and the proper name might be ``La
-% Sapienza''.
-% |\facolta| receives an optional argument that is the uppercase roman numeral specific of
-% the faculty and a compulsory argument that corresponds to the type of faculty; for
-% example, with |\facolta[II]{Ingegneria}| the package typesets in the title page
-% ``II Facolt\`a di Ingengeria''; if the optional argument is not specified non roman
-% numeral is typeset; the infix string \verb*+Facolt\`a di + may be changed with the
-% configuration file depending on the default language.
-% Finally |\logosede| gets the name of the graphic file that contains the information
-% relative to the university logo. If such logo is not available, the user does not specify
-% this command; if the user uses this command to insert the university logo but the file is
-% not available the usual \texttt{graphicx} package warning is issued but compilation goes
-% on without the logo.
-% The |\tutoreaziendale| macro is the last addition; several students who work on their
-% thesis or final project in a company want to have the company supervisor name printed in
-% the title page; this does not preclude expressing the student's deepest thanks in the
-% acknowledgements section, but it does not harm ro name this person also in the title page.
+% of the university; |\nomeateneo| gets the proper name of the university. In Italy
+% Universities are generally named after the city they are in; in large cities where there are
+% several universities, each one of them has a proper name. For example the generic name might
+% be ``Universit\`a di Roma'' and the proper name might be ``La Sapienza''. |\facolta|
+% receives an optional argument that is the uppercase roman numeral specific of the faculty
+% and a compulsory argument that corresponds to the type of faculty; for example, with
+% |\facolta[II]{Ingegneria}| the package typesets in the title page ``II Facolt\`a di
+% Ingengeria''; if the optional argument is not specified, no roman numeral is typeset; the
+% infix string \verb*+Facolt\`a di + may be changed with the configuration file depending on
+% the default language.
+% Finally |\logosede| gets the name of the graphic file that contains the information relative
+% to the university logo. If such logo is not available, the user does not specify this
+% command; if the user uses this command to insert the university logo but the file is not
+% available the usual \texttt{graphicx} package warning is issued but compilation goes on
+% without the logo.
+% The |\tutoreaziendale| macro is the last addition; several students who work on their thesis
+% or final project in a company want to have the company supervisor name printed in the title
+% page; this does not preclude expressing the student's deepest thanks in the acknowledgements
+% section, but it does not harm to name this person also in the title page.
% \begin{macrocode}
\def\ciclodidottorato#1{\gdef\@ciclo{#1 \@cyclename}}%
\def\corsodilaurea#1{\global\dottoratofalse\gdef\@corso{#1}}
@@ -1839,11 +1964,11 @@ Skipping any redefinition\MessageBreak}%
% \item[NomeTerzoTomo] ``Tomo terzo'' in, say, ``Third volume''
% \item[NomeQuartoTomo] ``Tomo quarto'' in, say, ``Fourth volume''
% \end{description}
-% In the above description the first string is generally the default one, while the
-% second string is just an example of the corresponding string to be set in another language
-% or to be changed in Italian. The last four commands clearly show the difficulty of
-% localizing language strings: it is necessary to localize the whole phrase, because of
-% the position of the adjectives.
+% In the above description the first string is generally the default one, while the second
+% string is just an example of the corresponding string to be set in another language or to be
+% changed in Italian. The last four commands clearly show the difficulty of localizing
+% language strings: it is necessary to localize the whole phrase, because of the position of
+% the adjectives.
% \begin{macrocode}
\newcommand\FacoltaDi[1]{\gdef\@faculty{#1}}
\newcommand\DottoratoIn[1]{\gdef\@PhDname{#1}}
@@ -1864,19 +1989,19 @@ Skipping any redefinition\MessageBreak}%
\newcommand\NomeQuartoTomo[1]{\gdef\QuartoTomo{#1}}
% \end{macrocode}
%
-% Now we can read the configuration file if it exists; in any case what is possibly defined
-% or redefined in the configuration file must not be redefined in the following lines and
-% this is why everything is subject to the test |\@ifundefined|. Most default definitions
-% are simply ``blank''; the others are in Italian. All of them, except the supervisor and
-% candidate strings may be individually be redefined in the configuration file or in the
-% preamble. Those that cannot be redefined such as the four ``candidate'' strings may be
-% actually redefined through the only |\CandidateName| that should be used in a language
-% dependent way and with the correct number and gender once for all. The four endings in the
-% Italian strings allow to exercise the correct selection only for Italian; a specific test
-% is made inside the |\frontespizio| command; because of this the same machinery cannot be
-% used, say, for French but may be in the future this feature is resolved in a proper way.
-% The same is true for the supervisor and the co-supervisor strings that may be changed once
-% for all with |\AdvisorName| and |\CoAdvisorName|.
+% Now we can read the configuration file if it exists; in any case what is possibly defined or
+% redefined in the configuration file must not be redefined in the following Lines and this is
+% why everything is subject to the test |\@ifundefined|. Most default definitions are simply
+% ``blank''; the others are in Italian. All of them, except the supervisor and candidate
+% strings may be individually be redefined in the configuration file or in the preamble. Those
+% that cannot be redefined such as the four ``candidate'' strings may be actually redefined
+% through the only |\CandidateName| that should be used in a language depended way and with
+% the correct number and gender once for all. The four endings in the Italian strings allow to
+% exercise the correct selection only for Italian; a specific test is made inside the
+% |\frontespizio| command; because of this the same machinery cannot be used, say, for French
+% but may be in the future this feature is resolved in a proper way. The same is true for the
+% supervisor and the co-supervisor strings that may be changed once for all with
+% |\AdvisorName| and |\CoAdvisorName|.
% \begin{macrocode}
\IfFileExists{toptesi.cfg}{\input{toptesi.cfg}}{}
%
@@ -1922,10 +2047,10 @@ Skipping any redefinition\MessageBreak}%
\@ifundefined{TerzoTomo}{\def\TerzoTomo{Tomo terzo}}{}
\@ifundefined{QuartoTomo}{\def\QuartoTomo{Tomo quarto}}{}
% \end{macrocode}
-% If the final exam date is not given the default value is the current month
-% and the current year typeset in Italian; therefore the user is strongly
-% requested to enter a date either with the |\sedutadilaurea| or the
-% |\esamedidottorato| commands. The university logo command by default is also empty.
+% If the final exam date is not given the default value is the current month and the current
+% year typeset in Italian; therefore the user is strongly requested to enter a date either
+% with the |\sedutadilaurea| or the |\esamedidottorato| commands. The university logo command
+% by default is also empty.
% \begin{macrocode}
\@ifundefined{@submitdate}{\def\@submitdate{\ifcase\the\month\or%
Gennaio\or Febbraio\or Marzo\or Aprile\or Maggio\or Giugno\or
@@ -1942,13 +2067,12 @@ Skipping any redefinition\MessageBreak}%
\@ifundefined{@InName}{\def\@InName{in}}{}
% \end{macrocode}
%
-% Finally it comes the only active macro |\frontespizio|, the one macro that
-% actually typesets the title page. The macro starts with a local redefinition
-% of the \texttt{myheadings} page style; with this style the university name
-% goes into the header, while the exam date goes in the footer; in this way the
-% information that must be typeset in the title page is not crunched in too
-% little space and the overall text bounding box assumes a shape similar to that
-% of the page.
+% Finally we have the only active macro |\frontespizio|, the real macro that actually
+% typesets the title page. The macro starts with a local redefinition of the
+% \texttt{myheadings} page style; with this style the university name goes into the header,
+% while the exam date goes into the footer; in this way the information that must be typeset in
+% the title page is not crunched in too little a space and the overall text bounding box assumes
+% a shape similar to that of the page.
%
% Everything is closed within a group so all definitions remain local.
% \begin{macrocode}
@@ -1957,18 +2081,14 @@ Skipping any redefinition\MessageBreak}%
\def\ps@myheadings{\let\@mkboth\markboth
\def\@oddhead{\vbox{%
\hbox to \hsize{\hfill {\LARGE \@ateneo}\hfill}%
- \expandafter
- \ifx\csname StileTrieste\endcsname\relax
- \else
+ \ifclassica
\hbox to \hsize{\hfil\vrule\@width\z@
\@height3.5ex\vrule\@height1.4\p@\@depth-\p@\@width50mm\hfil}%
\fi
}}%
\def\@oddfoot{\vbox to 15mm{\vss
- \expandafter
- \ifx\csname StileTrieste\endcsname\relax
- \else
- \hbox to \hsize{\hfil\raisebox{-.3ex}[\z@][\z@]{%
+ \ifclassica
+ \hbox to \hsize{\hfil\raisebox{-.3ex}[\z@][\z@]{%
\vrule\@height-2.6\p@\@depth3\p@\@width50mm}\hfil}%
\fi
\hbox to\hsize{\hfill{\Large{\@submitdate}}\hfill}}%
@@ -1986,9 +2106,8 @@ Skipping any redefinition\MessageBreak}%
\evensidemargin \oddsidemargin
% \end{macrocode}
%
-% We select the \texttt{myheadings} page style; setting the page counter to zero is a remain
-% of old settings, but it does not hurt; the |\null| command inserts a void horizontal box
-% into the vertical list; it is useful to act as a block against which the vertical glue
+% We select the \texttt{myheadings} page style; the |\null| command inserts a void horizontal
+% box into the vertical list; it is useful to act as a block against which the vertical glue
% pushes for setting the subsequent material. The normal font is chosen in case preceding
% commands did change the font characteristics.
% \begin{macrocode}
@@ -2000,15 +2119,13 @@ Skipping any redefinition\MessageBreak}%
% we set in the page is the university proper name and some vertical glue.
% \begin{macrocode}
\ifx\@nomeat\empty \else
- {\vspace*{-1.5\topskip}
- \centering
+ {\vspace*{-3\topskip}\centering
{\Large \@nomeat}\par}\vfill
\fi
% \end{macrocode}
-% Then the faculty name comes next; but fot the doctoral school it uses the doctoral
-% school name entered with |\scuoladidottorato|, otherwise it inserts the faculty
-% ordinal number or prefix and name already entered with the optional and required
-% arguments of |\facolta|.
+% Then the faculty name comes next; but for the doctoral school it uses the doctoral school
+% name entered with |\scuoladidottorato|, otherwise it inserts the faculty ordinal number or
+% prefix and name already entered with the optional and required arguments of |\facolta|.
% \begin{macrocode}
\begin{center}
{\rmfamily\mdseries
@@ -2021,7 +2138,7 @@ Skipping any redefinition\MessageBreak}%
\par\medskip}%
% \end{macrocode}
% Further specification: it inserts the field of the PhD research or the degree course name;
-% for example it inserts the line ``Philosophy Degree in Applied Tetratricotomy~--VI~cycle''
+% for example it inserts the line ``Philosophy Degree in Applied Tetratricotomy~--~XVI~cycle''
% or ``Master of Science in Applied Tetratricotomy''.
% \begin{macrocode}
\ifx\@corso\empty \else{\large
@@ -2034,9 +2151,9 @@ Skipping any redefinition\MessageBreak}%
\fi
\end{center}
% \end{macrocode}
-% It now centers the name of the report, be it ``Doctoral Dissertation'' or ``Master
-% Thesis'' or whatever; in case the command |\materia| was used, it then centers the area
-% which the thesis deals with.
+% It now centers the name of the report, be it ``Doctoral Dissertation'' or ``Master Thesis''
+% or whatever; in case the command |\materia| was used, it then centers the area which the
+% thesis deals with.
% \begin{macrocode}
\vfill
\begin{center}
@@ -2055,8 +2172,7 @@ Skipping any redefinition\MessageBreak}%
\fi
\end{center}
% \end{macrocode}
-% Next comes the real title entered with |\titolo| or |\monografia| and the possible
-% subtitle.
+% Next comes the real title entered with |\titolo| or |\monografia| and the possible subtitle.
% \begin{macrocode}
\vfill
\begin{center}
@@ -2070,15 +2186,13 @@ Skipping any redefinition\MessageBreak}%
\end{center}%
\fi
% \end{macrocode}
-% If the option \texttt{classica} is in force the thesis might be divided in several
-% volumes; apparently these in humanities are often oversized. In this case the
-% |\frontespizio| command may be given at the beginning of every volume and the counter
-% \texttt{tomo} is stepped up; the volume number is therefore printed in each title page;
-% the infix string may be redefined as it was shown above.
+% If the option \texttt{classica} is in force the thesis might be divided in several volumes;
+% theses in humanities are apparently often oversized. In this case the |\frontespizio|
+% command may be given at the beginning of every volume and the counter \texttt{tomo} is
+% stepped up; the volume number is therefore printed in each title page; the infix string
+% may be redefined as it was shown above.
% \begin{macrocode}
- \expandafter
- \ifx\csname StileTrieste\endcsname\relax
- \else
+ \ifclassica
\ifnum\value{tomo}>\z@
\par\bigskip
\noindent\makebox[\textwidth]{%
@@ -2098,22 +2212,22 @@ Skipping any redefinition\MessageBreak}%
\fi
\par
% \end{macrocode}
-% Going down in the title page now comes the optional insertion of the university logo;
-% this is a simple task once |\@logosede| has been defined, and this was done either with
-% an explicit command |\logosede| with its argument in the preamble, or a specific line in
-% the configuration file.
+% Going down in the title page now comes the optional insertion of the university logo; this
+% is a simple task once |\@logosede| has been defined, and this was done either with an
+% explicit command |\logosede| with its argument in the preamble, or a specific line in the
+% configuration file.
% \begin{macrocode}
\ifx\@logosede\@empty\else
\vspace*{\bigskipamount}
{\centering \@logosede\par}\fi
% \end{macrocode}
%
-% The final task is to typeset the possible supervisors' names, the candidates' names and
-% all the rest of the bureaucratical terms. We have to distinguish between a bachelor degree
-% report that is not supposed to have a supervisor, from the doctoral dissertation where we
-% do not indicate the supervisor, but the School Director, and the master thesis where there
+% the final task is to typeset the possible supervisors' names, the candidates' names and all
+% the rest of the bureaucratical terms. We have to distinguish between a bachelor degree
+% report that is not supposed to have a supervisor, from the doctoral dissertation where we do
+% not indicate the supervisor, but the School Director, and the master thesis where there
% might be one or more supervisors; with the \texttt{classica} option in force no label is
-% printed over the supervisor's name, unless there is a plurality od supervisors.
+% printed over the supervisor's name, unless there is a plurality of supervisors.
% \begin{macrocode}
\vfill
\iflaureatriennale
@@ -2125,18 +2239,18 @@ Skipping any redefinition\MessageBreak}%
\ifx\@principaladviser\empty\else
\def\@nomerelatore{\Relatore:}%
\fi
- \@ifundefined{StileTrieste}%
- {\ifx\@secondadviser\empty \else
+ \unless\ifclassica
+ \ifx\@secondadviser\empty \else
\def\@nomerelatore{\Relatori:}%
- \fi}{}%
+ \fi
+ \fi
\fi
\fi
% \end{macrocode}
-% Similarly the label names for the exam candidates are chosen; in Italian the names are
-% infix strings that are selected according the gender and the number; if these labels have
-% to be set in a different language it is necessary to define one string that has to be
-% selected by the user according to number and gender. The label for the doctorship is left
-% empty.
+% Similarly the label names for the exam candidates are chosen; in Italian the names are infix
+% strings that are selected according the gender and the number; if these labels have to be
+% set in a different language it is necessary to define one string that has to be selected by
+% the user according to number and gender. The label for the PhD candidate is left empty.
% \begin{macrocode}
\ifdottorato
\let\@nomecandidato\empty
@@ -2157,9 +2271,9 @@ Skipping any redefinition\MessageBreak}%
\fi
% \end{macrocode}
%
-% For the names of the supervisor(s) and of the candidate(s) a different approach is used
-% for each one of the three categories of theses. If a bachelor degree report is dealt with,
-% the name of the \emph{only} candidate is centerd and written in caps-and-small-caps.
+% For the supervisor(s) and of the candidate(s) name(s) a different approach is used for
+% each one of the three categories of theses. If a bachelor degree report is dealt with, the
+% name of the \emph{only} candidate is centered and written in caps-and-small-caps.
% \begin{macrocode}
\iflaureatriennale
\begin{center}%
@@ -2167,32 +2281,32 @@ Skipping any redefinition\MessageBreak}%
\end{center}%
% \end{macrocode}
% For doctoral and master theses two virtual boxes (actually macros) are filled up so as to
-% align the supervisor name(s) and, in second virtual box, the candidate name(s). The label
-% is set in the first line with proper number and gender; in the second line the first name,
-% and in the subsequent lines, if there are any, the other names. These virtual boxes
-% actually contain a tabular environment each; these environments shall be actually typeset
-% when these virtual box macros are executed. If the \texttt{classica} option is in force no
-% label is set over the principal advisor name, but a label is set over the co-advisor
-% name(s). The type size is also e little different for the \texttt{classica} option. The
-% |\protect| command is used to protect the names in case they contain accent macros that
-% might be expanded at the wrong moment.
+% align the supervisor name(s) and, in a second virtual box, the candidate name(s). The label is
+% set in the first line with proper number and gender; in the second line the first name, and
+% in the subsequent lines, if there are any, the other names. These virtual boxes actually
+% contain a tabular environment each; these environments shall be actually typeset when these
+% virtual box macros are executed. If the \texttt{classica} option is in force no label is set
+% over the principal advisor name, but a label is set over the co-advisor name(s). The type
+% size is also a little different for the \texttt{classica} option. The |\protect| command
+% is used to protect the names in case they contain accent macros that might be expanded at
+% the wrong moment.
% \begin{macrocode}
\else
% Per laurea e dottorato con relatori e correlatori...
\def\BoxRelatori{%
\begin{tabular}[t]{l}%
- \hbox{{\@ifundefined{StileTrieste}{\large}{}%
- \textbf{\protect\@nomerelatore}}}\\[.6ex]
- \hbox{{\large\textrm{\protect\@principaladviser}}}%
+ \hbox{\ifclassica\else\large\fi
+ \textbf{\protect\@nomerelatore}}\\[.6ex]
+ \hbox{\large\textrm{\protect\@principaladviser}}%
\ifx\@secondadviser\empty \else
- \@ifundefined{StileTrieste}{}{%
+ \unless\ifclassica
\ifx\@thirdadviser\empty
\ifx\@secondadviser\empty\else
\\[1.5ex]\textbf{\Correlatore:}%
\fi
\else
\\[1.5ex]\textbf{\Correlatori:}%
- \fi}
+ \fi\fi
\\[.6ex]\hbox{{\large\textrm{\protect\@secondadviser}}}%
\fi
\ifx\@thirdadviser\empty \else
@@ -2205,7 +2319,7 @@ Skipping any redefinition\MessageBreak}%
% \begin{macrocode}
\def\BoxCandidati{%
\begin{tabular}[t]{l}%
- \hbox{\@ifundefined{StileTrieste}{\large}{}%
+ \hbox{\unless\ifclassica\large\fi
\textbf{\protect\@nomecandidato}}\\[.6ex]
\hbox{\large\textrm{\protect\@author}}%
\ifx\@secondauthor\empty
@@ -2224,8 +2338,8 @@ Skipping any redefinition\MessageBreak}%
% remember that the bachelor degree case has already taken place. For the doctoral
% dissertation the doctoring person name is typeset centered in one line by itself and
% everything else is set 3em below into a three column table extended to the |\hsize|, the
-% first line containing the person's qualifiers and the second line containing the true
-% names. The central column is used just for spacing, but it does not contain anything.
+% first line containing the person labels and the second line containing the true names. The
+% central column is used just for spacing, but it does not contain anything.
% \begin{macrocode}
\ifdottorato
\begin{center}\large
@@ -2252,21 +2366,20 @@ Skipping any redefinition\MessageBreak}%
\end{center}
\else
% \end{macrocode}
-% For the master thesis the two virtual boxes are set one besides the other but skewed so
-% that to the right or, respectively, to the left of every name there is enough space for
-% the signatures. With the \texttt{classica} option in force the two boxes are simply
-% aligned.
+% For the master thesis the two virtual boxes are set one besides the other but skewed so that
+% to the right or, respectively, to the left of every name there is enough space for the
+% signature. With the \texttt{classica} option in force the two boxes are simply aligned.
% \begin{macrocode}
- \@ifundefined{StileTrieste}{%
+ \unless\ifclassica
\begin{flushleft}%
\BoxRelatori
\end{flushleft}\par\vspace*{-1.5\baselineskip}
\begin{flushright}%
\BoxCandidati
- \end{flushright}\par}{%
+ \end{flushright}\else
\noindent
- \makebox[\textwidth]{\BoxRelatori
- \hfill\BoxCandidati}\par}%
+ \makebox[\textwidth]{\BoxRelatori\hfill\BoxCandidati}\par
+ \fi
\fi
\fi
% \end{macrocode}
@@ -2297,7 +2410,7 @@ Skipping any redefinition\MessageBreak}%
%%
%%================================================================
%% This file is the only file of the TOPtesi bundle that the user
-%% can modify without restrictions in order to personalize the
+%% can modify without restrictions in order to customize the
%% contents of this configuration file to his/her needs. The user
%% can add or remove lines, comment or uncomment lines, change the
%% arguments to the macros, add definitions and so on.
@@ -2316,6 +2429,7 @@ Skipping any redefinition\MessageBreak}%
%%\CycleName{ciclo}
%</topcfg>
% \end{macrocode}
+%
% \subsection{The package file \texttt{topcoman.sty}}
% This file may be used as an independent extension package for the \texttt{report}
% document class, and possibly for other classes
@@ -2323,13 +2437,17 @@ Skipping any redefinition\MessageBreak}%
%<*topcmn>
\NeedsTeXFormat{LaTeX2e} % lavora solo con LaTeX 2e
\ProvidesPackage{topcoman}%
- [2011/05/25 v.5.50 Additional commands for the TOPtesi bundle]
+ [2011/08/09 v.5.59 Additional commands for the TOPtesi bundle]
% \end{macrocode}
% The new command |\DeclareSlantedCapitalGreekLetters| optionally sets the capital
% Greek letters in math mode with the glyphs taken from the math italic fonts, not from
% the math roman fonts, at is is by default; some persons prefer to use both symbols with
-% different meanings, so this command lets them do so.
+% different meanings, so this command lets them do so. This may be useful unless the XeTeX
+% typesetting engine is used; in facts the Unicode math defines specific commands for setting
+% any Latin or Greek mathematical letter in any possible font shape and series.
% \begin{macrocode}
+\RequirePackage{ifxetex}
+\ifxetex\else
\newcommand*\DeclareSlantedCapitalGreekLetters{%
\mathchardef\Gamma="7100
\mathchardef\Delta="7101
@@ -2342,47 +2460,58 @@ Skipping any redefinition\MessageBreak}%
\mathchardef\Phi="7108
\mathchardef\Psi="7109
\mathchardef\Omega="710A
-}
+}\fi
% \end{macrocode}
% The |\ensuremath| command is defined in the \LaTeX\ kernel from a certain version on;
% should the user employ a really old \LaTeXe\ implementation this definition
-% supplies the missing one.
+% supplies the missing one. Should the |babel| package not be loaded, then we provide the
+% useful command |\textormath| provided by |babel|. We define the text version of the
+% subscript and ensure also that the |textcomp| package is loaded; of course it it's already
+% loaded the |\RequirePackage| command performs the necessary tests and possibly does not load
+% anything.
% \begin{macrocode}
\providecommand{\ensuremath}[1]{\ifmmode#1\else$#1$\fi}%
+\providecommand{\textormath}{\ifmmode\expandafter\@secondoftwo\else
+ \expandafter\@firstoftwo\fi}
+\providecommand*\textsubscript{\raisebox{-0.5ex}}
+\ifxetex\else
+\RequirePackage{textcomp}
+\fi
% \end{macrocode}
% The following commands may be already defined; should they be missing they are supplied
% here. The greatest part of them is already defined in the Italian option to the
-% \texttt{babel} language; but remember; this package may be used as a stand alone one,
-% without the initial call by the \texttt{toptesi} document class, so that the language
+% \texttt{babel} language if the thesis is typeset with \textsf{pdflatex} that loads that
+% package; these commands are not predefined if the thesis is typeset with \XeLaTeX\ that does
+% not load the \texttt{babel} package; but remember; this package may be used as a stand alone
+% one, without the initial call by the \texttt{toptesi} document class, so that the language
% Italian might be undefined.
% \begin{macrocode}
-\providecommand{\ohm}{\ensuremath{{\mathrm{\Omega}}}}
-\providecommand{\ped}[1]{\ensuremath{_{\mathrm{#1}}}}
-\providecommand{\ap}[1]{\ensuremath{^{\mathrm{#1}}}}
+\providecommand{\ohm}{\textormath{\textohm}{\mathrm{\Omega}}}
+\providecommand{\ped}[1]{\textormath{\textsubscript{#1}}{_{\mathrm{#1}}}}
+\providecommand{\ap}[1]{\textormath{\textsuperscript{#1}}{^{\mathrm{#1}}}}
\providecommand{\unit}[1]{\ensuremath{{\mathrm{\,#1}}}}
\providecommand{\gei}{\ensuremath{{\mathop{\mathrm{j}}\nolimits}}}
\providecommand{\eu}{\ensuremath{{\mathop{\mathrm{e}}\nolimits}}}
-\providecommand{\micro}{\ensuremath{\ifx\muup\undefined\mu\else\muup\fi}}
-\providecommand{\gradi}{\ensuremath{^\circ}}
-% \end{macrocode}
-%
-% The next set of definitions are used to list a program file. There are
-% better packages to perform this task in the CTAN archives. This set of macros
-% has the advantage that is very short and light on the computer memory; nevertheless
-% it performs its duty pretty well. The font face is the typewriter one; the
-% font size is chosen so as to
-% allow approximately 80 characters in the text width of the thesis. It respects
-% the possible indentation tabs (ASCII code 9) by inserting the correct amount
-% of typewriter spaces so as to align every line to the correct boundary which
-% is ``zero modulo eight''. If the program file contains some form feed ASCII
-% characters (ASCII code 12), this \TeX\ code inserts a new page command. The
-% code may appear strange, and it does because it makes heavy use of the dirty
-% tricks of appendix~D of the \TeX\-book.
+\providecommand{\micro}{\textormath{\textmu}{\ifxetex\mathup{μ}\else
+ \ifx\muup\undefined\mu\else\muup\fi\fi}}
+\providecommand{\gradi}{\textormath{\textdegree}{^\circ}}
+% \end{macrocode}
+%
+% The next set of definitions are used to list a program file. There are better packages to
+% perform this task in the CTAN archives. This set of macros has the advantage that is very
+% short and light on the computer memory; nevertheless it performs its duty pretty well. The
+% font face is the typewriter one; the font size is chosen so as to allow approximately 80
+% characters in the text width of the thesis. It respects the possible indentation tabs (ASCII
+% code 9) by inserting the correct amount of typewriter spaces so as to align every line to
+% the correct boundary which is ``zero modulo eight''. If the program file contains some form
+% feed ASCII characters (ASCII code 12), this \TeX\ code inserts a new page command. The code
+% may appear strange, and it does because it makes heavy use of the dirty tricks of appendix~D
+% of the \TeX\-book.
% \begin{macrocode}
\def\listing#1{\par\begingroup
\programma \input #1 \endgroup}
\def\uncatcodespecials{\def\do##1{\catcode`##1=12}\dospecials}
-\def\programma{\footnotesize\tt \parindent 0pt
+\def\programma{\ttfamily\footnotesize \parindent 0pt
\def\par{\leavevmode\egroup\box0\endgraf}
\catcode`\`=\active \catcode`\^^I=\active \catcode`\^^L=\active
\obeylines \uncatcodespecials \obeyspaces
@@ -2392,7 +2521,9 @@ Skipping any redefinition\MessageBreak}%
% new page command associated to the form feed ASCII character are done with the
% following definitions.
% \begin{macrocode}
-\newdimen\tabwidth \setbox0=\hbox{\footnotesize\tt\space} \tabwidth=8\wd0
+\newdimen\tabwidth
+\setbox0=\hbox{\ttfamily\footnotesize\space}
+\tabwidth=8\wd0
\def\startbox{\setbox0=\hbox\bgroup}
{\obeyspaces\global\let =\ }
{\catcode`\`=\active \gdef`{\relax\lq}}
@@ -2402,33 +2533,32 @@ Skipping any redefinition\MessageBreak}%
\multiply\dimen0 by\tabwidth
\advance\dimen0 by\tabwidth
\wd0=\dimen0 \box0 \startbox}}
-{\catcode`\^^L=\active \gdef^^L{\par\penalty-10000}}
-% \end{macrocode}
-%
-% The following code is already set in the \texttt{toptesi} package; here it is
-% repeated because this package might be used as a stand alone one. Remember that
-% the comma as a decimal separator is required for all languages except English.
-% \begin{macrocode}
-\mathcode`\,="013B
-\catcode`\^^Z=10
-% \end{macrocode}
-%
-% The following commands are used to write the ``lower case'' roman numerals
-% with the small-caps; in order to avoid complications with missing fonts or math
-% environments we make sure to typeset these numerals with script size capitals;
-% this solution is not probably the best one but it works; it typesets
-% these roman numerals with the current font; for this thesis bundle roman numerals
-% are used only for folios, therefore there are no problems with a choice of font shapes
-% and series. But for this task we need a robust command in order to set the script math
-% size
+{\catcode`\^^L=\active \global\let^^L\newpage}
+% \end{macrocode}
+%
+% Remember that the comma as a decimal separator is required for all languages except English.
+% If you use they package outside TOPtesi, but as an extension of other packages, it's up to
+% you to define an ``intelligent comma'' macro or to load either the |icomma.sty| or the
+% |nccomma.sty| package that defines such a macro: the |icomma| package defines the comma as
+% a mathematical active character that recognizes the subsequent token as a space token so as
+% to insert a punctuation comma; |nccomma| behaves more or less as the macro defined in
+% TOPtesi and recognizes digits so as to use a decimal comma.
+%
+% The following commands are used to write the ``lower case'' roman numerals with the
+% small-caps; in order to avoid complications with missing fonts or math environments we make
+% sure to typeset these numerals with script size capitals; this solution is not probably the
+% best one but it works; it typesets these roman numerals with the current font; in TOPtesi
+% roman numerals are used only for folios, but in order to be compliant with the package
+% |hyperref|, I avoided using this new macro for folios; in other situations there are no more
+% any problems with the choice of font shapes and series. We need a robust command in order to
+% set the script math size
% \begin{macrocode}
\DeclareRobustCommand*{\simulatedSC}[1]{%
{\check@mathfonts\fontsize{\sf@size}{\f@baselineskip}\selectfont#1}}%
-%\renewcommand*{\@roman}[1]{\simulatedSC{\@Roman#1}}%
% \end{macrocode}
%
% A user, Antonio Mele, suggested and requested the possibility of having
-% the figure and table name inserted automatically when the |\ref| command is
+% the figure and table name inserted automatically when the |\ref|command is
% issued. For single citations the solution works fine, but for range
% references it does not work. In Italian the name must be lower case while in
% other languages, specifically in English, the name has a capital initial.
@@ -2449,6 +2579,8 @@ Skipping any redefinition\MessageBreak}%
\DisableFigTabNames
%</topcmn>
% \end{macrocode}
+%
+%
% \Finale
% \endinput
-% \ No newline at end of file
+%