diff options
author | Karl Berry <karl@freefriends.org> | 2014-12-13 23:38:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-12-13 23:38:15 +0000 |
commit | eb9b398b309be6def2fcf03d84da4865fdba6a04 (patch) | |
tree | 0ae59d5c893775b65eaa2a49979aa8a141a6c79e /Master/texmf-dist/source/latex | |
parent | 6e60746f3bb4513d40f0802d177e7f11587680a2 (diff) |
toptesi (13dec14)
git-svn-id: svn://tug.org/texlive/trunk@35817 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/toptesi/toptesi.dtx | 1125 |
1 files changed, 587 insertions, 538 deletions
diff --git a/Master/texmf-dist/source/latex/toptesi/toptesi.dtx b/Master/texmf-dist/source/latex/toptesi/toptesi.dtx index 0955243100a..2d3f86ff616 100644 --- a/Master/texmf-dist/source/latex/toptesi/toptesi.dtx +++ b/Master/texmf-dist/source/latex/toptesi/toptesi.dtx @@ -95,7 +95,7 @@ its source file is another example of how to use toptesi. % \iffalse %<*driver> \documentclass{ltxdoc} -\ProvidesFile{toptesi.dtx}[2014/11/07 v.5.84 Documented TeX file for +\ProvidesFile{toptesi.dtx}[2014/11/13 v.5.85b Documented TeX file for the TOPtesi bundle] \GetFileInfo{toptesi.dtx} \title{The TOPtesi bundle} @@ -116,7 +116,7 @@ the TOPtesi bundle] %</driver> % \fi % -% \CheckSum{2882} +% \CheckSum{2771} % %% \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 @@ -178,13 +178,14 @@ the TOPtesi bundle] % typesetting just the title page; this file might be used as a template for setting % up the title page fixed information in languages different from Italian. % This package is part of the bundle, but it is loaded automatically only if -% the user did not specify the class option |usefrontespizio|; if this option -% is specified the user is free to use whotever other external package s/he +% the user did not specify the class option |noTOPfront| or its alias +% |usefrontespizio|; if this option +% is specified the user is free to use whatever other external package s/he % prefers in order to typeset the tile page; in this case we suggest to use % the package |frontespizio| and we address the user to its documentation. % \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 contained also the logos of a certain number of +% \item Previous versions 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 @@ -197,17 +198,17 @@ the TOPtesi bundle] % \end{enumerate} % % The above files are complemented with a configuration file that any user may -% customise at will; these customisations make it easy to configure the +% customise at will; this customisation file makes it easy to configure the % bundle so as to make it suitable for another language; in facts the % \textsf{babel} and \textsf{polyglossia} packages contain localisations -% for many languages, but such localizations deal with the standard infix +% for many languages, but such localisations deal with the standard infix % \LaTeX\ names and phrases and do not cope with the thesis title page requirements. -% This customisation is usable only if Non |usefrontespizio| option had been -% declared to the class. +% This customisation is usable only if no |noTOPfront| or |usefrontespizio| +% option had been declared to the class. % % TOPtesi was specifically conceived for typesetting theses with the \LaTeX\ mark-up, % and initially it was using the \textsf{tex} typesetting engine; later on this engine -% was substantially substituted by the \textsf{pdftex} engine, which was capable +% was substantially substituted by the \textsf{pdftex} one, which was capable % of direct output of PDF files. Since about 2006 the typesetting engine \XeTeX\ % is available; the most important feature of this engine is its capability % of using OpentType fonts, among which those that are available to the @@ -236,7 +237,7 @@ the TOPtesi bundle] % not as a typewriter written one. % % Theses very often are full of specialised material: formulas, diagrams and pictures, -% texts written in non latin alphabets, special symbols for philological mark-up, and +% texts written in non Latin alphabets, special symbols for philological mark-up, and % the like; a common typewriter would not be suitable and the quality of the contents % requires professional typesetting; this is why I strongly believe that instructions % on typesetting styles that refer to the ``gone by times'' of mechanical typewriters @@ -246,27 +247,27 @@ the TOPtesi bundle] % nowadays, in facts, Universities are requesting theses in smaller formats % than A4 or letter paper. With smaller paper sizes the layout changes % automatically, but the title page might require some more attention. The -% default paper size is A4, but the user can seta any paper size among those -% accepted by the |report| standard class. If the |usefrontespizio| option +% default paper size is A4, but the user can set any paper size among those +% accepted by the |report| standard class. If the |noTOPfront| option % was specified and the package |frontepsizio| was loaded by the user, it -% is necessary to remind that it can easily create pretty nice title pages, but only -% either on A4 paper or on a paper format that mimics that of the famous book -% \emph{Elements of typographic style} by Robert Bringhurst; this is so at -% least with |frontespizio|'s version 1.4a of 2011/09/21 or earlier. +% is necessary to remind that it can easily create pretty nice title pages, but +% by default it is preset to use A4 paper where it can typeset the tytle page in teo styles, one so called ``standard'' and the other called ``elements'', that +% mimics that of the famous book \emph{Elements of typographic style} by +% Robert Bringhurst; this is so at least with |frontespizio|'s version +% 1.4a of 2011/09/21 or earlier. It is possible to use |frontespizio| to use +% a different paper size, but it's necessary to make use of certain +% customisation commands described in its documentation. % % Therefore if you want to typeset your thesis while typesetting the title % page by means of the functionalities of package |frontespizio| you have % to follow carefully how to use that package's options in the proper way -% as to bypassa the two fixed formats that it can produce; May be when you -% happen to use the TOPtesi bundle, the author of |frontespizio| has already -% extended his package in order to let it recognise the various paper formats -% used for the rest of the thesis. See also the Italian documentation contained -% in the document |toptesi-it-xetex.pdf|. +% as to bypass the two fixed styles it can produce. +% See also the Italian documentation contained in the document |toptesi-it-xetex.pdf|. % % Most new commands refer themselves to the information that should be typeset % in the title page; some class options specify special stylistic page details; % the rest is simple and traditional \LaTeX\ mark-up as it is implemented in -% the \LaTeX\ kernel and in the report document class. If \XeLaTeX\ has to be +% the \LaTeX\ kernel and in the report class. If \XeLaTeX\ has to be % used, some essential preamble specific commands are to be used, but essentially % the body of the thesis has the same mark-up. % @@ -284,14 +285,14 @@ the TOPtesi bundle] % such as \pack{biblatex} and sorting end formatting engines such as \prog{biber}. % % \Item[classica] Specifies a general modification of certain details that are -% supposed to be more adequate in the humanities fields; specifically this option +% supposed to be more adequate for theses in humanities; specifically this option % lets old style numbers to be used for certain numerical pieces of information; % some variations are also introduced in the title page. % % \Item[cucitura] In two sided printing it is better to move the % typesetting grid towards the outer edges so as to cope with the thesis binding % that is generally not made up by sewing together a number of signatures; -% the default outer displacement is fixed to~7mm, but it can be customized by means +% the default outer displacement is fixed to~7mm, but it can be customised by means % of a proper entry in the configuration file or by an explicit command in the preamble. % % \Item[14pt] Extends the normal size choice to 14 points; it is appreciated @@ -307,19 +308,19 @@ the TOPtesi bundle] % 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. +% similarly to the ordinary sectioning commands. % % \Item[oldstyle] Also this option works only if \texttt{classica} had already been % specified; it typesets several numerical data with the old style numbers. % -% \Item[usefrontespizio] allows the user to load a different package for +% \Item[noTOPfront] allows the user to load a different package for % creating and typesetting the title page; of course if this option is % specified, the native package |topfront| is not loaded, and the commands -% described in the next section are not available. On the opposite commands available +% described in the next section are not available. On the opposite, commands available % with the chosen package become available, while possible package conflicts are % eliminated at the root. % -% \Item[noTOPfront] is basically equivalent to the previous option; both +% \Item[usefrontespizio] is basically equivalent to the previous option; both % options set up the |\ifTOPfront| switch that is more mnemonic than the long % (actually not defined) |\iffrontespizio| one; if it was defined, |\iffrontespizio| % would be true when |\ifTOPfront| is false. @@ -334,7 +335,7 @@ the TOPtesi bundle] % \noindent The user must specify a certain number of commands in order to have the % title page contain all the required information. It must be specified that % most of these commands may be used in the configuration file so as to avoid repeating -% the same data for different ``reports''; well, a university student might write a +% the same data for different ``final reports''; well, a university student might write a % bachelor's ``monografia'', then a master thesis and finally a doctoral dissertation; % why should s/he repeat his/her name, the name of the institution, and so on? % @@ -356,9 +357,20 @@ the TOPtesi bundle] % \begin{description} % \def\cs#1{\texttt{\char92#1}} % \def\Item[#1]{\item[\normalfont\cs{#1}]} -% \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[\textnormal{ttfamily fontespizio}] and \texttt{frontespizio*} are two +% environments that typeset the title page with two opposite styles: with the +% university logo in the header vs the university logo in the lower part of +% the front page. The commands described in the following items shall be used +% either in the configuration file or within the body of these environments. +%^^A +% \Item[frontespizio] Even if the above environments are recommended, the +% command |\frontespizio|, defined in the previous versions of the TOPtesi +% bundle, is still usable. It typesets the title page according to the actua +%l status of the boolean |\topTPTlogos|; the user, before issuing the +% |\frontespizio| command, may set this boolean by means of the |\topTPTlogostrue| +% or |\topTPTlogosfalse|, or with either one of the commands +% |\booltrue{topTPTlogos}| and |\boolfalse{topTPTlogos|. +%^^A % \Item[monografia] sets the bachelor's report style and retrieves its title % \Item[titolo] gets the master or PhD thesis title and an optional thesis short title % \Item[sottotitolo] gets the thesis subtitle if any @@ -413,7 +425,7 @@ the TOPtesi bundle] % option \texttt{classica} the string becomes ``Laureando:''; in other % languages it is necessary to specify this string in the proper gender % and number. -% \Item[sedutadilaurea] gets the date of the final exam, or presentation, or defense +% \Item[sedutadilaurea] gets the date of the final exam, or presentation, or defence % of the thesis; if this date is omitted the default date is the current % month and year in Italian. % \Item[esamedidottorato] an alias for \cs{sedutadilaurea} to be used for doctoral @@ -424,7 +436,7 @@ the TOPtesi bundle] % name in a different language. % \Item[corsodilaurea] gets the proper name of the degree course; the phrase that % describes the degree course is specified, if necessary, with the -% following command; with this one you specify just, say, +% next command; with this one you specify just, say, % ``Electrical Engineering'' % \Item[CorsoDiLaureaIn] gets the generic name of the degree course, for example % ``Bachelor Degree in\textvisiblespace'' @@ -446,19 +458,22 @@ the TOPtesi bundle] % \Item[logosede] specifies the name of the file or the files that contain the university % logos; no default is defined; rather a warning message is issued if no % name is given or the file is missing, but typesetting goes on without -% the inclusion of any logo. a list of logos can be specified, useful +% the inclusion of any logo. A list of logos can be specified, useful % when a thesis is carried on in a multiple University environment % such as, for example, in a double degree Erasmus % program; or under the Erasmus Mundus program. The ``string'' of -% logos is scaled properly so that they may fit in the |\textwidth|. +% logos is scaled properly so that they may fit in |\textwidth|. % \Item[setbindingcorrection] sets up the length to displace the text block to the % external margin so as to have a wider internal margin to accommodate % the binding correction. Its argument is not optional and is used to -% modify the default correction of 7\,mm. -% \Item[retrofrontespizio] with its argument, made up one or several paragraphs, defines -% what should be printed on the verso of the title page, generally named -% ``copyright page''; if this command is specified with an empty -% text or if it is not used at all, no copyright page is assumed. +% modify the default correction of 7\,mm. Notice that 7\,mm is already +% a large displacement; most often than not the binding correction is +% unnecessary. +% \Item[retrofrontespizio] with its argument, made up of one or several paragraphs, +% defines what should be printed on the verso of the title page, +% generally named ``copyright page''; if this command is specified +% with an empty text or if it is not used at all, no copyright +% page is assumed. % \end{description} % % Since the infix strings are all memorised into control sequences and for each of @@ -474,38 +489,38 @@ the TOPtesi bundle] % printing the isolated title and copyright pages (if any). % % \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 +% The TOPtesi bundle and the |toptesi| document class accept all \LaTeX\ commands +% provided by the \LaTeX\ \texttt{kernel}, the \texttt{report} document class, and the % \texttt{graphicx} extension package, besides those provided by the \texttt{babel} % package. % If the source thesis file is being typeset by means of \XeLaTeX\ the \texttt{babel} % package is not loaded; in its place the \texttt{polyglossia} package is loaded that -% should implement in \XeLaTeX\ most of the functionality provided by \texttt{babel} to +% should implement in \XeLaTeX\ most of the functionality provided by \texttt{babel} in % \LaTeX. ``Most'' means that not all the functionality is available, therefore it's % better to consult the documentation of \texttt{polyglossia} before using its built % in commands. % % With this respect it must be underlined that the Italian and English languages are -% specified by default, the Italian one being the default language. An initial +% specified by default, the Italian one being the main language. An initial % specification of |\selectlanguage{english}| sets the English language as the default. % Should a student typeset the thesis in French by means of \textsf{pdflatex}, it % would be necessary to specify the option \texttt{french} among the \emph{class} % options, and then start the document by specifying |\selectlanguage{french}|. -% But the user should pay attention to use \texttt{babel} in the proper way: +% But the user should pay attention to use \texttt{babel} in the proper way. % \begin{enumerate} % \item Due to the way \LaTeX\ classes load the requested files, and to the fact that the % \texttt{babel} package has already been loaded by the \texttt{toptesi} class, the user % cannot reload it with a different list of language options; therefore the latter -% language options \emph{must be specified} as global class options; so if the thesis has -% to be typeset, for example, in French, is is necessary to do the following: +% language options \emph{must be specified} as a global class options; so if the +% thesis has to be typeset, for example, in French, is is necessary to do the following: %\begin{verbatim} %\documentclass[...,french,...]{toptesi} %... %\begin{document} %\selectlanguage{french} %\end{verbatim} -% But if the thesis should be typeset in French by means of \XeLaTeX, then it i perfectly -% legal to specify the auxiliary language in this way: +% But if the thesis should be typeset in French by means of \XeLaTeX, then it is +% perfectly legal to specify the auxiliary language in this way: %\begin{verbatim} %\documentclass[...]{toptesi} %\setotherlanguage{french} @@ -513,24 +528,25 @@ the TOPtesi bundle] %\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. +% \item With the 2010 \TeX\ system complete distributions, both \TeX Live and MiKTeX, +% all known (to \LaTeX) language hyphenation rules are preloaded; with other less up +% to date \TeX\ system distributions this might not be true. With both distributions +% also the language hyphenation rules known to \XeLaTeX\ are all preloaded. % Remember that \texttt{babel} and \texttt{polyglossia} macros select the language % typesetting rules, but hyphenation is activated only if the program format file has % been generated with the pertinent language hyphenation rules. You can check this -% detail by reading the first dozen lines of your thesis \texttt{.log} file; there +% detail by reading the first dozen lines of your thesis \texttt{.log} file; there % the list of all language hyphenation rules that are available in the format file is % being shown. -% While (American) English is the default and almost any \emph{basic} distribution -% of the \TeX\ system has several preloaded languages, it is more likely that French is -% preloaded while Italian is not. Complete distributions don't exhibit this flaw. +% While (American) English is the default language and almost any \emph{basic} +% distribution of the \TeX\ system has several preloaded languages, it is more +% likely that French is preloaded while Italian is not. Complete distributions don't +% exhibit this flaw. % % Should the required language(s) be missing, the user is forced to read his/her -% distribution instructions, so as to find out how to configure his/her system so as to -% consider the languages s/he wants to work with, and finally s/he must recreate the -% format files. +% distribution instructions, so as to find out how to configure his/her system in +% order to preload the languages s/he wants to work with, and finally s/he must +% recreate the format files. % The user is invited to carefully investigate on these fine points and to properly % configure the system; it would be very upsetting to use fine software for producing a % perfectly typeset thesis that, unfortunately, has wrong hyphenation points! Luckily @@ -583,12 +599,12 @@ the TOPtesi bundle] % \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 +% \Item[unit] sets the unit of measure close to the numerical measure value by % inserting a non breakable thin space and by setting the units of % measure in upright type; this works both in math and text mode. Of % course it is necessary to input the |\unit| command without intervening % spaces in the source file; it's necessary to typeset, say, -% |35\unit{km}| and to avoid to input \verb*+35 \unit{km}+. This command, +% |35\unit{km}| and to avoid writing \verb*+35 \unit{km}+. This command, % as it is defined, conflicts with the definition of the homonymous % command |\unit| as defined by the \texttt{unitsx} package, but since % this latter package is necessarily input \emph{after} @@ -596,7 +612,7 @@ the TOPtesi bundle] % 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 +% \Item[micro] sets the decimal prefix $\mu$ when typesetting units of % measure. % % % \Item[gradi] sets the small circle that defines the sexagesimal degrees, for @@ -617,7 +633,7 @@ the TOPtesi bundle] % 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 physical +% the electron charge $e$ is typeset in math italics because this is 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 slanted ''pi'' (the angle). @@ -776,7 +792,7 @@ the TOPtesi bundle] % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{toptesi}% -[2014/11/07 v.5.84 Class for typesetting university theses] +[2014/11/13 v.5.85b Class for typesetting university theses] % \end{macrocode} % % The class itself is very simple since it requires just the \texttt{report} document @@ -821,8 +837,8 @@ 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 -% stand alone package, although, take notice, it might conflict with the \texttt{book} -% class code and certainly it is incompatible with the \texttt{article} class. This +% stand alone package, although, take notice, it might interfere with the \texttt{book} +% class code while certainly it is incompatible with the \texttt{article} class. This % package must contain its own \TeX\ format declaration and might have different % version and subversion numbers compared to the class file and the other invoked % packages that are part of the same bundle. @@ -833,17 +849,18 @@ the TOPtesi bundle] % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{toptesi}% -[2014/11/07 v.5.84 Extension for toptesi.cls]% +[2014/11/13 v.5.85b Extension for toptesi.cls]% % \end{macrocode} % % 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. +% to be much better, but sometimes I use these ones. % \begin{macrocode} \def\TRON{\tracingcommands \tw@ \tracingmacros \tw@} \def\TROFF{\tracingcommands\z@ \tracingmacros \z@} \let\TROF\TROFF % \end{macrocode} +% % Now we define the specific package macros: \texttt{classica} and \texttt{trieste} % are identical; the use of \texttt{trieste} is discouraged, but this option is % maintained for backward compatibility. @@ -857,7 +874,7 @@ the TOPtesi bundle] % \texttt{chapterbib} allows to set a list of references at the end of each chapter. % % For the options some boolean variables are -% defined and the option definitions set them to the value ``true''. +% defined and the option definitions set some of them to the value ``true''. % \begin{macrocode} \newif\if@utoretitolo \@utoretitolofalse \newif\if@ldstyle \@ldstylefalse @@ -868,12 +885,12 @@ the TOPtesi bundle] % % A binding correction is established; its default value is parametrised to % the paper dimensions, even if this correction should actually not depend -% on the aper size; the paper flexibility at the spine margin should be +% on the paper size; the paper flexibility at the spine margin should be % independent from its width; nevertheless large sizes allow for larger % default corrections. In any case the user can override this setting by % using the specific command |\setbindingcorrection|. The recommendation % to the user is to not exaggerate with this correction. The options -% |usefrontespizio| and |noTOPfront| are synonymous; the latter one should be +% |usefrontespizio| and |noTOPfront| are synonymous; the latter should be % preferred to the former one. % \begin{macrocode} \newlength\T@Pbinding\setlength\T@Pbinding{7mm} @@ -906,16 +923,17 @@ the TOPtesi bundle] \if@xivpt\input{size14.clo}\fi % \end{macrocode} % -% The |\texheight| is parametrised to the paper height and adjusted so as to +% The |\textheight| is parametrised to the paper height and adjusted so as to % contain an integer number of normal text lines. A new dimension is defined % to hold the actual value of the inner/spine margin. % % \begin{macrocode} \newlength\interno \textheight 0.7\paperheight -\divide\textheight by \baselineskip -\multiply\textheight by \baselineskip -\advance\textheight by \topskip +\setlength{\textheight}{\dimexpr\textheight*\baselineskip/\baselineskip+\topskip} +%\divide\textheight by \baselineskip +%\multiply\textheight by \baselineskip +%\advance\textheight by \topskip % \end{macrocode} % The inner margin is parametrised to the paper width, but a small correction % is made if the extra size of 14pt is chosen. Also |\footskip| is parametrised @@ -934,10 +952,10 @@ the TOPtesi bundle] % Without binding correction the inner and outer margin are chosen equal, but % the grid is moved outwards if the binding correction option is specified. % \begin{macrocode} +\textwidth=\dimexpr\paperwidth-2\interno\relax \oddsidemargin=\dimexpr\interno-1in\relax \evensidemargin=\oddsidemargin -\marginparwidth\interno -\advance\marginparwidth-2.5\marginparsep +\marginparwidth=\dimexpr\interno-2.5\marginparsep \AtBeginDocument{% \if@binding \PackageInfo{TOPtesi}{Margin width recalculation} @@ -951,7 +969,6 @@ the TOPtesi bundle] oddsidemargin\space\space \the\oddsidemargin\MessageBreak evensidemargin\space \the\evensidemargin} \fi} -\textwidth=\dimexpr\paperwidth-2\interno\relax % \end{macrocode} % @@ -975,8 +992,8 @@ the TOPtesi bundle] \def\@evenhead{}\let\@evenfoot\@oddfoot} % \end{macrocode} % Other page styles are defined in a different way according to the choice of -% one side or two side printing. In any case the header is set without capitalisation -% as it happens in all the default document classes, and it is underlined at a fixed +% one side or two side printing. In any case the header is set without the uppercasing +% that is done in all the default document classes, and it is underlined at a fixed % distance from the base line. If the chapter or section heading exceed the % |\textwidth| a warning is issued so as to invite the user to exploit the % sectioning commands optional short argument. @@ -996,7 +1013,8 @@ the TOPtesi bundle] \ifdim\wd\@intesta>\textwidth \headWarn{\section}\fi% \underline{\makebox[\textwidth]{\footnotesize\slshape \strut\rightmark}}}% - \def\chaptermark##1{\markboth{\thechapter\ -- ##1}{}} + \def\chaptermark##1{% + \markboth{\thechapter\ -- ##1}{\thechapter\ -- ##1}} \def\sectionmark##1{\markright{\ifnum\c@secnumdepth>\z@ \thesection\ -- \fi ##1}}} \else @@ -1075,7 +1093,8 @@ the TOPtesi bundle] % it uses by default the plain page style, but it can be set to any other style. % \begin{macrocode} \let\ps@blank\ps@plain -\newcommand*\blankpagestyle[1]{\expandafter\let\expandafter\blank@ps\csname ps@#1\endcsname} +\newcommand*\blankpagestyle[1]{% + \expandafter\let\expandafter\ps@blank\csname ps@#1\endcsname} \renewcommand\cleardoublepage[1][blank]{\clearpage\ifodd\value{page}\else \if@twoside\if@openright \clearpage\null\thispagestyle{#1}\clearpage\fi\fi\fi} @@ -1093,7 +1112,6 @@ the TOPtesi bundle] \def\ringraziamenti{% \iffrontmatter\else\frontmattertrue\fi \chapter*{\acknowledgename}% - \addcontentsline{toc}{chapter}{\acknowledgename}% } % \end{macrocode} % The strings |\summaryname| and |\acknowledgename| are not defined in any @@ -1109,13 +1127,6 @@ the TOPtesi bundle] % as defined above, are regularly typeset in the style of the front matter, % opening on any page (even or odd) and numbered with small caps roman numerals. % \begin{macrocode} -%\renewcommand\chapter{% -% \iffrontmatter\mainmatter\fi -% \if@openright\cleardoublepage\else\clearpage\fi -% \thispagestyle{plain}% -% \global\@topnum\z@ -% \@afterindentfalse -% \secdef\@chapter\@schapter} \def\@chapter[#1]#2{\iffrontmatter\mainmatter\fi \ifnum \c@secnumdepth >\m@ne \refstepcounter{chapter}% @@ -1135,13 +1146,6 @@ the TOPtesi bundle] \@afterheading \fi} % -%\renewcommand\part{% -% \iffrontmatter\mainmatter\fi -% \if@openright\cleardoublepage\else\clearpage\fi -% \thispagestyle{empty}% -% \if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi -% \null\vfil -% \secdef\@part\@spart} \def\@part[#1]#2{\iffrontmatter\mainmatter\fi \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}% @@ -1167,32 +1171,23 @@ the TOPtesi bundle] % document step, so we have to avoid to use starred or un-starred |\chapter| commands. % \begin{macrocode} \renewcommand\tableofcontents{% - \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi - \if@openright\cleardoublepage\else\clearpage\fi - \global\@topnum\z@ - \@afterindentfalse - \@schapter{\contentsname}% + \chapter*{\contentsname}% + \@mkboth{\contentsname}{\contentsname}% \@starttoc{toc}% \clearpage \if@restonecol\twocolumn\fi } \renewcommand\listoffigures{% - \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi - \if@openright\cleardoublepage\else\clearpage\fi - \global\@topnum\z@ - \@afterindentfalse - \@schapter{\listfigurename} + \chapter*{\listfigurename} \@mkboth{\listfigurename}{\listfigurename}% + \addcontentsline{toc}{chapter}{\listfigurename} \@starttoc{lof}% \clearpage \if@restonecol\twocolumn\fi } \renewcommand\listoftables{% - \if@twocolumn\@restonecoltrue\onecolumn\else\@restonecolfalse\fi - \if@openright\cleardoublepage\else\clearpage\fi - \global\@topnum\z@ - \@afterindentfalse - \@schapter{\listtablename}% + \chapter*{\listtablename}% + \addcontentsline{toc}{chapter}{\listtablename} \@mkboth{\listtablename}{\listtablename}% \@starttoc{lot}% \clearpage @@ -1220,12 +1215,12 @@ the TOPtesi bundle] \listoffigures \let\addvspace=\saveaddvspace} \fi -} +\ifbool{@twoside}{\clearpage\thispagestyle{empty}\null\clearpage}{}} % \end{macrocode} % % Command |\onecolumn| is not actually necessary; it simply overrides the possible % misused option \texttt{twocolumn} in the opening document class statement; -% no thesis should be typeset in double column. +% no thesis should be typeset in two columns. % \begin{macrocode} \onecolumn % \end{macrocode} @@ -1246,14 +1241,15 @@ the TOPtesi bundle] % \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 largeer or a smaller baseline skip -% might be required; the \LaTeX\ kernel allows to use the |\linespread| command; +% 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 larger 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 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. +% The experience has shown that some 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. % \begin{macrocode} \def\interlinea#1{\linespread{#1}\selectfont} \def\endinterlinea{\par} @@ -1262,7 +1258,7 @@ the TOPtesi bundle] % this factor to the unit value; floating bodies do not belong to this or that section % of text where a different spread factor might be reasonable. % \begin{macrocode} -\def \@floatboxreset {% +\def\@floatboxreset {% \reset@font \linespread{1}% \normalsize @@ -1270,16 +1266,17 @@ the TOPtesi bundle] } % \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. +% values ``here'', ``top of the page'' and ``bottom of the page'', that we set as +% the 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 -% floats to exit the queue provided they do not exceed the text height. +% 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 figures 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} % @@ -1287,30 +1284,30 @@ the TOPtesi bundle] \def\topfraction{1} \setcounter{bottomnumber}{1} \def\bottomfraction{.5} -\setcounter{totalnumber}{3} +\setcounter{totalnumber}{2} \def\textfraction{0} \def\floatpagefraction{0} \setcounter{dbltopnumber}{2} \def\dbltopfraction{1} \def\dblfloatpagefraction{0} % \end{macrocode} -% 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 +% 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| parameter 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; -% 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 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. +% 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 centred 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 caption width shrinking 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 % necessary to recall that the first line occupies a vertical space that equals @@ -1323,8 +1320,9 @@ the TOPtesi bundle] % more compact than the regular text. % The baseline skip is a little shorter than the regular one, but it should % still exceed the default |\topskip|; when we first typeset the caption in a -% vertical box we strip off the last line -% and we must remember the presence of this line in our arithmetics. +% vertical box we strip off the last line 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, but if this last line is shorter than one third of the @@ -1385,7 +1383,7 @@ the TOPtesi bundle] % The point is that for this task the reference key must contain also the % chapter number; the rest is simply a redefinition of the environment that behaves % differently according to the chosen option. In any case the bibliography goes to the -% table of contents as a unnumbered chapter or section. +% table of contents as an unnumbered chapter or section. % \begin{macrocode} \def\redef@bibitem{\def\@bibitem##1{\item\if@filesw \immediate\write\@auxout @@ -1430,19 +1428,20 @@ the TOPtesi bundle] % % These last heterogeneous definitions are partly important and partly residues of % the good old times of MS-DOS v.3 when a Ctrl-Z character would be placed at the -% end of files. It's a long time that such version is not being used, but some +% end of files. It's a long time that such DOS version is not being used, but some % old time files might still be around. % % The cryptic code that redefines the comma in math mode establishes that this % character is a normal math character, instead of a math punctuation mark. Actually the % code that defines the mathematical active comma is a new addition that lets the comma % perform correctly in its double function (decimal separator and punctuation mark). The -% only point where this code fails is when a list of numbers is typeset: When a numeric list -% 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) because |n| is not recognized as a digit, therefore -% the ``intelligent'' comma inserts the necessary space by itself. +% only point where this code fails is when a list of numbers is typeset: when a numeric +% list 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) because |n| is not +% recognised as a digit, therefore the ``intelligent'' comma inserts the necessary +% space by itself. % % \begin{macrocode} \DeclareMathSymbol{\virgola}{\mathpunct}{letters}{"3B} @@ -1462,23 +1461,24 @@ the TOPtesi bundle] % the commands |\sommario| and |\ringraziamenti| respectively. The infix strings % 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} 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 -% messages are issued, the |\summaryname| and |\acknowledgename| are let to -% |\empty|. -% \begin{macrocode} -\let\summaryname\empty -\let\acknowledgename\empty +% 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} 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 compilation +% goes on any way without the sectioning string names. For being sure no other +% undefined error messages are issued, the |\summaryname| and |\acknowledgename| +% are let to |\empty|. +% \begin{macrocode} +\providecommand*\summaryname{} +\providecommand*\acknowledgename{} \newcommand*\ExtendCaptions[3]{{% \@ifundefined{captions#1}{% \PackageWarning{toptesi}{Language option #1 not specified\MessageBreak @@ -1512,7 +1512,7 @@ Skipping any redefinition\MessageBreak}% % ... % \end{verbatim} % and the rest of the thesis will be typeset correctly in Spanish. Remember -% that Italian is the default language and nothing is necessary for setting up +% that Italian is the main language and nothing is necessary to set up % the Italian defaults. If English is desired, then after |\begin{document}| is % is necessary to specify the default language; for ease of use the following % macros are defined so they can be used instead of the lengthy \texttt{babel} @@ -1529,13 +1529,13 @@ Skipping any redefinition\MessageBreak}% % \end{macrocode} % At the beginning of the document the following commands are executed; % the general macro |\italiano| sets the summary and the acknowledgements -% names in Italian, as the default language; and the |\@chapapp| macro is +% names in Italian, as the main language; and the |\@chapapp| macro is % redefined so as to agree with the default language. If a different % default language is desired, we recall it again, it is necessary to do % the following: % \begin{enumerate} % \item specify |\english| \emph{after} the |\begin{document}| statement, -% if English is supposed to be the default language, or +% if English is supposed to be the main 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; @@ -1556,28 +1556,21 @@ Skipping any redefinition\MessageBreak}% % \end{macrocode} % % At last the subsidiary and independent packages \texttt{topcoman} and -% \texttt{topfront} are requested for input the former is loaded only if -% at the |documentclass| level the option |usefrontespizio| has NOT been -% declared. 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, even if the past experience -% has not shown any inconvenience. +% \texttt{topfront} are requested for input; the former is loaded only when +% the |documentclass| option |noTOPfront| has NOT been declared. +% 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. Even if the past experience +% has shown that loading these packages does not need to be deferred al the +% ``begin document'' level with pdf\/\LaTeX, it does not hurt to delay their +% loading operation with both engines. % \begin{macrocode} -\ifxetex - \AtBeginDocument{% - \unless\ifT@Pfrontespizio - \RequirePackage{topfront} - \fi - \RequirePackage{topcoman}% - } -\else +\AtBeginDocument{% \unless\ifT@Pfrontespizio - \RequirePackage{topfront} - \fi + \RequirePackage{topfront} + \fi \RequirePackage{topcoman}% -\fi +} % \end{macrocode} % % Last but not least, here come the specifications for the PDF/A-1b format. First of @@ -1628,18 +1621,17 @@ Skipping any redefinition\MessageBreak}% % 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. +% with the suitable option for typesetting a (hopefully) PDF/A compliant 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''. +% Nevertheless if \XeLaTeX\ is being used to typeset the document, loading +% of the package |pdfx| skipped; at the same time if the |pdfa| option was +% specified, the |hyperref| package gets loaded anyhow. If with \XeLaTeX\ you +% do not want to use hyperlinks, do not specifica the |pdfa| option to the +% |toptesi| class. % \begin{macrocode} \ifT@Ppdfa \unless\ifxetex @@ -1656,8 +1648,8 @@ Skipping any redefinition\MessageBreak}% % 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 mark-up requires typesetting environments -% similar to the mathematical ones, since the material to be typeset does not form +% I believe that the philological mark-up requires typesetting environments +% similar to the mathematical ones: in facts the 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 @@ -1679,31 +1671,33 @@ Skipping any redefinition\MessageBreak}% % \end{macrocode} % % Since theses in humanities may end up to occupy several volumes (classically -% ``tomo'' in Italian means ``volume'', although the latter spelling is valid +% ``tomo'' in Italian means ``volume'', although the latter word is valid % also in Italian with the same meaning but appears to be neglected by the % humanists; in English ``tome'' indicates a ``large book''; in Italian the % meaning nuance of ``tomo'' is a little different because it is used to -% indicate the volumes into which a large typeset work is divided; the +% indicate the volumes into which a large printed work is divided; the % humanists, as usual, know well their words and use them properly!) a % mechanism is set up to create a different title page for each volume; -% we need a volume counter and a command to start each volume; the -% |\frontespizio| macro typesets the real title page and we have already -% seen that it can print the volume ordinal. The localisation allows to -% change the infix string that is going to be printed. When several tomes -% are involved, instead of using the |\frontespizio| macro, use the |\tomo| -% one, that provides to stepping up the volume counter before actually -% printing the new tome title page. +% we need a volume counter and a command to start each volume. +% The localisation allows to change the infix string that is going to be +% printed in the title page. But when several tomes are involved, instead +% of using the |\frontespizio| macro or |frontespizio| environment, use +% the |\tomo| macro, that provides to stepping up the volume counter before +% actually printing the new tome title page. % \begin{macrocode} \newcounter{tomo} -\newcommand*{\tomo}{\clearpage\stepcounter{tomo}\frontespizio} -% \end{macrocode} -% Folios as well are to be redefined and also the page styles require a redefinition so as -% to being able to use old style numbers. The macro |\lapagina| (it's not a case the this -% macro name is the direct translation of ``the page'') contains the folio number; if it is -% in roman numerals nothing happens, but if the old style numbers are required the folio is -% surrounded by the proper macros so as to expand the folio macro before typesetting it in -% old style. The page style does not need an actual redefinition, because the original -% definition in file \texttt{toptesi.sty} already uses |\lapagina| as the typeset folio +\newcommand*{\tomo}{\clearpage\stepcounter{tomo}\boolfalse{topTPTlogos}% + \fr@ntespizio} +% \end{macrocode} +% Folios as well are to be redefined and also the page styles require a +% redefinition so as to being able to use old style numbers. The macro +% |\lapagina| (it's not a case the this macro name is the direct translation +% of ``the page'') contains the folio number; if it is in roman numerals +% nothing happens, but if the old style numbers are required the folio is +% surrounded by the proper macros so as to expand the folio macro before +% typesetting it in old style. The page style does not need an actual +% redefinition, because the original definition in file \texttt{toptesi.sty} +% already uses |\lapagina| as the typeset folio % indicator. % \begin{macrocode} \renewcommand*{\lapagina}{% @@ -1716,35 +1710,38 @@ Skipping any redefinition\MessageBreak}% \thepage \fi \fi - } +} % \end{macrocode} -% But we actually have to redefine the page style for the new headings because the -% \texttt{classica} option changes completely the left and the right headers depending on -% the option \texttt{autoretitolo}; in this case the left header contains the candidate's -% name a a short version of the thesis title, while the right heading contains the chapter -% (short) title; if this option is not in force, headings appear as usual. The redefinition -% of the \texttt{headings} page style is made only if this option is in force. In case of -% two side printing where the left head and the right head are different, the left heading -% contains the author name and the short title name; if there are other authors the first -% author name is printed followed by ``et al.''; if the over all header string exceeds the -% text width, a message is printed so as to induce the user to make use of the optional -% |\titolo| argument, the one that is supposed to contain the short title. In the right -% heading there is the chapter title; again if the header turns out to bee too wide, a -% message is issued to the user. -% -% More complicated things are done when typesetting on one side; in facts the author name -% (possibly followed by ``et al.'') and the short thesis title are typeset on the left -% of the only header while the chapter title is typeset on the right; in the unlikely -% situation where these two elements separated by at least 2em of white space do not exceed -% the text width, they are printed, but if they do, as it is likely to happen, then my -% suggestion would be not to use the \texttt{autoretitolo} option, but if the user -% absolutely wants this layout, then the author's name, possibly followed by ``et al.'', and -% the short thesis title are set in a vertical box; the same happens for the chapter title -% in another box; these texts are set with ragged margins on the center, and finally these -% boxes are set one next to the other with an intermediate glob of infinitely stretchable -% glue, and finally set in the header box with a rule underneath the two of them. The result -% might be barely acceptable if both vertical boxes do not exceed two lines and no words -% have to be hyphenated, but in general I believe it is an ugly layout; the user is warned! +% But we actually have to redefine the page style for the new headings because +% the \texttt{classica} option changes completely the left and the right headers +% depending on the option \texttt{autoretitolo}; in this case the left header +% contains the candidate's name and a short version of the thesis title, while +% the right heading contains the chapter (short) title; if this option is not +% in force, headings appear as usual. The redefinition of the \texttt{headings} +% page style is made only if this option is in force. In case of two side printing +% where the left head and the right head are different, the left heading contains +% the author name and the short title name; if there are other authors the first +% author name is printed followed by ``et al.''; if the over all header string +% exceeds the text width, a message is printed so as to induce the user to +% use the optional |\titolo| argument, the one that is supposed to contain the +% short title. In the right heading there is the chapter title; again if the +% header turns out to bee too wide, a message is issued to the user. +% +% More complicated things are done when typesetting on one side; in facts the +% author name (possibly followed by ``et al.'') and the short thesis title are +% typeset on the left of the only header while the chapter title is typeset +% on the right; in the unlikely situation where these two elements separated +% by at least 2em of white space do not exceed the text width, they are printed, +% but if they do, as it is likely to happen, then my suggestion would be not +% to use the \texttt{autoretitolo} option; but if the user absolutely wants +% this layout, then the author's name, possibly followed by ``et al.'', and +% the short thesis title are set in a vertical box; the same happens for the +% chapter title in another box; these texts are set with ragged margins, and +% eventually these boxes are set one next to the other with an intermediate +% glob of infinitely stretchable glue, and finally set in the header box with +% a rule underneath the two of them. The result might be barely acceptable if +% both vertical boxes do not exceed two lines and no words have to be hyphenated, +% but in general I believe it is an ugly layout; the user is warned! % \begin{macrocode} \if@utoretitolo \if@twoside @@ -1752,7 +1749,6 @@ Skipping any redefinition\MessageBreak}% \renewcommand*{\ps@headings}{\let\@mkboth\markboth% \def\@oddfoot{\null \hfill \textbf{\lapagina} \hfill \null}% \let\@evenfoot\@oddfoot -% \def\@evenhead{% \setbox\@intesta\hbox{\unless\ifxetex\latintext\fi \footnotesize\strut\textsc{% @@ -1765,7 +1761,7 @@ Skipping any redefinition\MessageBreak}% \footnotesize\strut\textsl{\rightmark}}% \ifdim\wd\@intesta>\textwidth \headWarn{\section}\fi% \underline{\makebox[\textwidth]{\box\@intesta}}}% - \def\chaptermark##1{\markright{\thechapter\ -- ##1}{}}% + \def\chaptermark##1{\markright{\thechapter\ -- ##1}}% \def\sectionmark##1{}}% \else \renewcommand*{\ps@headings}{\let\@mkboth\markboth @@ -1775,7 +1771,7 @@ Skipping any redefinition\MessageBreak}% \textsc{% \@author\ifx\@secondauthor\empty\else\ et al.\fi: \@stitle}}% \setbox\tw@\hbox{\unless\ifxetex\latintext\fi\footnotesize\textsl{\rightmark}}% - \dimen@=2em\advance\dimen@\wd\z@\advance\dimen@\wd\tw@ + \dimen@=\dimexpr2em + \wd\z@ + \wd\tw@\relax \ifdim\dimen@<\textwidth \relax \else \setbox\z@\vbox{\hsize.48\textwidth\parindent\z@\raggedright @@ -1792,13 +1788,13 @@ Skipping any redefinition\MessageBreak}% \fi \fi % \end{macrocode} -% Here |\annoaccademico| is defined that typesets the infix string corresponding to +% Here |\annoaccademico| is defined to typesets the infix string corresponding to % ``Anno accademico'' followed by the year range in old style numbers (irrespective -% of the \texttt{oldstyle} option); localization commands are provided so as +% of the \texttt{oldstyle} option); localisation commands are provided so as % to set a different string, possibly through the configuration file. In order to set % an adequate en-dash between the old style numbers a new definition is given that -% takes care to set the dash at a height above the base line that copes the specific -% shape of the old style numbers. +% takes care to set the dash at a height above the base line that copes with the +% specific shape of the old style numbers. % \begin{macrocode} \newcommand*\NomeAnnoAccademico[1]{\gdef\AnnoAccademico{#1}} \@ifundefined{AnnoAccademico}{\gdef\AnnoAccademico{Anno accademico}}{} @@ -1813,26 +1809,28 @@ Skipping any redefinition\MessageBreak}% \fi} \def\s@tanno#1-#2!{\oldstylenums{#1\EnDash#2}} -\def\EnDash{{\settowidth{\dimen@}{\large\sc I}% +\def\EnDash{{\settowidth{\dimen@}{\large\scshape I}% \setbox\tw@\hbox{2}\dimen\tw@.5\ht\tw@\advance\dimen\tw@-.5\dp\tw@ \dimen4\dimen\tw@\advance\dimen4by.0385ex\relax \advance\dimen\tw@-.0385ex\relax \makebox[1.5\dimen@]{% \vrule\@width\dimen@\@height\dimen4\@depth-\dimen\tw@}}} % \end{macrocode} -% The footnote rule separator is also longer that the default one. Dealing with notes -% the footnote separator is also changed as well as the footnote skip. But the humanists -% like to have also unnumbered notes within numbered ones, as if they were two separate -% sets; of course specialized extensions are available on CTAN, but as a poor man solution -% the command |\nota| was introduced that inserts a note with a symbol as a note mark; -% the symbol \emph{must} be a mathematical symbol as the dagger or the double dagger; -% by default it is the asterisk. At the same time the default definition of the -% mathematical -% asterisk is that of a binary operator; I have experienced that the note symbol gets a -% better positioning if it is used as an ordinary symbol through |\mathord|. This -% is why its math code is redefined. A final unusual request was to be able to put a blank -% unnumbered note, as a (rather wide) note separator. The command |\NoteWhiteLine| has to -% be used at the end of the text of the preceding note. +% The footnote rule separator is also longer that the default one. Dealing +% with notes the footnote separator is also changed as well as the footnote +% skip. But the humanists like to have also unnumbered notes within numbered +% ones, as if they were two separate sets; of course specialised extension +% modules, such as, for example, the |eledmac| Package, are available on CTAN, +% but as a poor man solution the command |\nota| was introduced that inserts +% a note with a symbol as a note mark; the symbol \emph{must} be a mathematical +% symbol as the dagger or the double dagger; by default it is the asterisk. +% At the same time the default definition of the mathematical asterisk is that +% of a binary operator; I have experienced that the note symbol gets a +% better positioning if it is used as an ordinary symbol through |\mathord|. +% This is why its math code is redefined. A final unusual request was to be +% able to put a blank unnumbered note, as a (rather wide) note separator. +% The command |\NoteWhiteLine| has to be used at the end of the text of the +% preceding note. % \begin{macrocode} \renewcommand\footnoterule{% \kern-6\p@ @@ -1846,22 +1844,24 @@ Skipping any redefinition\MessageBreak}% \newcommand*{\NoteWhiteLine}{\par\vspace*{-.3\baselineskip}} % \end{macrocode} % -% The humanists asked me to create some other simple macros: one for skipping a whole page, -% without header and footer; another to compose a dedication page; a third one for -% typesetting a page with one or more witty sentences. The first request has a trivial -% solution, but at least |\paginavuota| is much shorter to type in that its expansion. +% The humanists asked me to create some other simple macros: one for skipping +% a whole page, without header and footer; another to compose a dedication +% page; a third one for typesetting a page with one or more witty sentences. +% The first request has a trivial solution, but at least |\paginavuota| is +% much shorter to type in that its expansion. % -% The environments \texttt{dedica} for the dedication, and \texttt{citazioni} for the witty -% sentences are almost identical; both typeset their content with a reduced text width, half -% of the normal one; this column is typeset on the right of the page. The \texttt{dedica} -% environment is supposed to be used in the front matter, while the witty sentence -% environment may be used anywhere. The dedication is typeset in |\Large| font size and in -% italics; if the author wants a different size and/or a different shape s/he must specify -% it at the beginning of the dedication. The \texttt{citazioni} environment typesets its -% material with the default font shape series and size, so the author has to specify any -% change s/he desires. These three commands, though, are available irrespective of the -% \texttt{classica} option, so that they can be used also for theses outside the humanities -% fields. +% The environments \texttt{dedica} for the dedication, and \texttt{citazioni} +% for the witty sentences are almost identical; both typeset their content +% with a reduced text width, half of the normal one; this column is typeset +% on the right of the page. The \texttt{dedica} environment is supposed to +% be used in the front matter, while the witty sentence environment may be +% used anywhere. The dedication is typeset in |\Large| font size and in italics; +% if the author wants a different size and/or a different shape s/he must +% specify it at the beginning of the dedication. The \texttt{citazioni} +% environment typesets its material with the default font shape series and +% size, so the author has to specify any change s/he desires. These three +% commands, though, are available irrespective of the \texttt{classica} option, +% so that they can be used also for theses outside the humanities fields. % % \begin{macrocode} \newcommand*\paginavuota{\clearpage\thispagestyle{empty}\null\clearpage} @@ -1894,31 +1894,38 @@ Skipping any redefinition\MessageBreak}% % \fi % % \subsection{The \texttt{topfront.sty} code} -% This file is input by \texttt{toptesi}, version 5.x, but it can be used as an -% independent extension package. +% This file may input by \texttt{toptesi}, version 5.x provided that the +% |noTOPfront| is not specified among the |\documentclass| options, but +% it can be used as an independent extension module with (hopefully) any +% document class. % % 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. +% that are peculiar to this title page. Among other things it can typeset +% also the copyright page on the verso of the title page if the +% |\retrofrontespizio| macro argument is not empty. +% +% This file specifies that it requires the \LaTeXe\ format and identifies +% itself. Since this module package might be used to extend the performances +% of other classes, this package does not specify any input encoding, +% on the assumptions that the calling class already provided this information. % \iffalse %<*topfrn> % \fi % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{topfront}[2014/11/07 v.5.84 Title page for TOPtesi] +\ProvidesPackage{topfront}[2014/11/13 v.5.85b Title page for TOPtesi and other classes] % \end{macrocode} -% Per l'uso di topfront come pacchetto autonomo bisogna verificare che l'opzione |classica| -% corrisponda ad una impostazione corretta di |\ifclassica|; siccome questo |\if| รจ definito -% in |toptesi.sty|, qui bisogna verificarne l'esistenza, e se del caso impostare il valore -% |false|. Per la verifica -% In oder to use |topfront| as a stand-alone extension package it is necessary to verify if the |classica| option corresponds to a valid setting of |\ifclassica|; since this test is defined in the main |toptesi| package, here we need to verify its existance, and in case to set its value to |false|. This implies two points: we need a powerful macro package to test a ``switch'', and when this |topfront| package is used as a stand-alone one, the settings of the |classica| options are not available. +% In oder to use |topfront| as a stand-alone extension package with other +% classes it is necessary to verify if the |classica| option corresponds +% to a valid setting of |\ifclassica|; since this test is defined in the +% |toptesi| class, here we need to verify its existence and, in case, to +% set its value to |false|. This implies two points: we need a powerful +% macro package to test a ``switch'', and when this |topfront| module is +% used as a stand-alone one, the settings of the |classica| options are +% not available. % \begin{macrocode} \@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}} \ifcsundef{ifclassica}{% @@ -1929,7 +1936,7 @@ Skipping any redefinition\MessageBreak}% % % For the title page we need a special style, in order to put some information % in the header and some other in the footer, without actually changing the -% page layout, except for centering the grid horizontally in the page. +% page layout, except for centring the grid horizontally in the page. % The headers, due to a specific request of Politecnico di Torino, is to have % the university logo(s) in the header; other universities maintain their % logo(s) in the lower part of the page as it was done all the time in the @@ -1938,9 +1945,9 @@ Skipping any redefinition\MessageBreak}% % the header must smash the header contents, so as to avoid any modification % of the position and size of the other parts of the page. The |TPT@logobox| % box is being defined later on and the |\logosede| command takes care of -% filling it up. Besides these devices, the |\frontepsizio| command accepts -% an optional asterisk, so that by setting the asterisk in the source file, -% as in |\frontespizio*|, the page styles are switched. +% filling it up. Besides these devices, the |\frontepsizio| command and the +% |frontespizio| environments (with or without asterisk) produce either +% layout depending on the state of the boolean |topTPTlogos|. % \begin{macrocode} \def\headstrut{\vrule \@depth4\p@ \@height\z@ \@width\z@} \def\ps@titlepage{\let\@mkboth\@gobbletwo @@ -1948,11 +1955,13 @@ Skipping any redefinition\MessageBreak}% \hbox to\hsize{\hfil{\Large{\@submitdate}}\hfil}}}% \let\@evenfoot\@oddfoot \def\@oddhead{ - \vbox to\headheight{\vss + \vbox to\headheight{\vss\iftopTPTlogos \hbox to\textwidth{% \headstrut\hfil \raisebox{3\baselineskip}{\usebox\TPT@logobox}\hfil\null% - }% + }\fi + \ifcsvoid{@ateneo}{}{\vskip\smallskipamount + \hbox to\textwidth{\hss\LARGE\@ateneo\hss}} \vss }% }% @@ -2018,7 +2027,7 @@ Skipping any redefinition\MessageBreak}% % |\titolo| accepts an optional argument, the ``short title'', more or less % as the standard sectioning commands; this is due to the fact that with the % class option \texttt{autoretitolo} the thesis title is written together -% with the author's name in the even side headings; if the thesis full title +% with the author's name in the even page headings; if the thesis full title % is too long it produces overfull headlines with ugly results; a short title % may solve the inconvenience. The |\sottotitolo| command is another way % to maintain a short title; all the supplementary title information may be @@ -2026,32 +2035,39 @@ Skipping any redefinition\MessageBreak}% % \begin{macrocode} \def\monografia#1{\global\laureatriennaletrue \global\dottoratofalse - \global\def\titolo##1{\PackageWarning{toptesi}% + \global\def\titolo##1{\PackageWarning{topfront}% {Il titolo e' gia' stato impostato con il comando \string\monografia}}% - \gdef\@title{#1}} + \gdef\@titolo{#1}} \let\@stitle\empty -\newcommand*{\titolo}[2][]{{\def\@tempA{#1}% - \ifx\@tempA\empty\gdef\@stitle{#2}\else\gdef\@stitle{#1}\fi - \gdef\@title{#2}}} +\newcommand*{\titolo}[2][]{% +\ifbool{laureatriennale}{% +\PackageWarning{topfront}{Il titolo deve essere impostato con + il comando \string\monografia} +} +{\def\@tempA{#1}\ifdefempty{\@tempA}% + {\gdef\@stitle{#2}} + {\gdef\@stitle{#1}}% + \gdef\@titolo{#2}% +}} \def\sottotitolo#1{\gdef\@subtitle{#1}} % \end{macrocode} % % The |\materia| or its alias |\Materia| are used to specify the -% subject of the thesis; as a silly example a set of commands that reflect +% subject of the thesis; as a silly example a set of commands that reflects % this subtle difference might be the following: % \begin{verbatim} % \materia{Applied Tetratricotomy} % \titolo{The tetratricotomy of blond hair} % \sottotitolo{Accurate measurements of the four fourths -% of tetratricotomized blond hair} +% of tetratricotomised blond hair} %\end{verbatim} % and the title page, for example, will contain something like this:\\[\bigskipamount] % \begin{minipage}{\textwidth}\centering % {\Large Master Thesis\\ in\\ Applied Tetratricotomy\par}\bigskip % {\huge The tetratricotomy of blond hair\par}\bigskip % {\large Accurate measurements of the four fourths\\ -% of tetratricotomized blond hair} +% of tetratricotomised blond hair} % \end{minipage}\bigskip % \begin{macrocode} \let\@materia\empty @@ -2059,10 +2075,11 @@ Skipping any redefinition\MessageBreak}% % \end{macrocode} % % Things get more complicated for doctoral theses; in general there is no supervisor; -% at most if a professor is assigned to supervise or control the doctoring's work +% at most if a professor is assigned to supervise or control the PhD student's work % 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''. +% in any case in Italian ``tutore'' does not have the same meaning as the English +% ``tutor''. % 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 @@ -2073,7 +2090,7 @@ Skipping any redefinition\MessageBreak}% \def\tutore#1{\gdef\@tutore{#1}} \def\direttore{\Direttoretrue\relatore}% \def\coordinatore{\Direttorefalse\relatore}% -\def\QualificaDirettore#1{\gdef{#1}} +\def\QualificaDirettore#1{\gdef\@PhDdirector{#1}}% % \end{macrocode} % % For ``normal'' theses we may have from one to three supervisors and from @@ -2102,33 +2119,36 @@ 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''; +% The next set of macros is used to typeset the ``date'' of the thesis +% defence 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 then the formatting of the ``date'' may +% be still different. This command is aliased with |\esamendidottorato| +% which literally means ``defence of the doctoral dissertation''; % nevertheless both commands refer to a simple date in one of those formats. % -% |\getseduta| splits the date into 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 either 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. +% |\getseduta| splits the date into 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@dutaclassica| is called with the whole string. On turn% |\s@dutaclassica| +% 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 either 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 !} @@ -2140,11 +2160,11 @@ Skipping any redefinition\MessageBreak}% \unless\ifclassica \def\@submitdate{#1 #2}% \else - \s@dutaTrieste#1 #2!% + \s@dutaclassica#1 #2!% \fi \fi }% -\def\s@dutaTrieste#1 #2!{% +\def\s@dutaclassica#1 #2!{% \if@ldstyle \s@paranumeri#2-!% \ifx\2\empty @@ -2165,82 +2185,96 @@ Skipping any redefinition\MessageBreak}% % \end{macrocode} % % The next macros are used to assign strings to some literal information -% to be typeset in the title page. |\ciclodidottorato| requires an uppercase roman numeral -% (in Italy), but it can accept anything that can precede the infix word ``cycle''. -% Macros |\corsodilaurea| and |\corsodidottorato| specify the degree course qualification; -% You would specify just ``Elettronica'', for example, and the package will -% write in the title page ``Corso di Laurea in Elettronica''. The infix part may be changed -% 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| may receive 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. It might be necessary to define another name -% in place of ``Facolt\`a di~'', since with recent bills, the administrative structure of -% all Italian universities has been changed and the activities formally assigned to the -% Faculties may be now the responsibility of other structures that may have different -% names in different universities. If the internal command defined by |\FacoltaDi| -% is empty, no name is printed at all and the title page will not have any indication -% of a particular faculty or other educational structure. Therefore the Degree Course +% to be typeset in the title page. |\ciclodidottorato| requires an uppercase +% roman numeral (in Italy), but it can accept anything that can precede the +% infix word ``cycle''. +% Macros |\corsodilaurea| and |\corsodidottorato| specify the degree course +% qualification; You would specify just ``Elettronica'', for example, and the +% module will write in the title page ``Corso di Laurea in Elettronica''. +% The infix part may be changed depending on the default language and the +% configuration file. +% +% |\scuoladidottorato| gets the name of the PhD School; |\ateneo| gets 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| may receive 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. +% It might be necessary to define another name +% in place of ``Facolt\`a di\textvisiblespace'', since with recent bills, +% the administrative structure of all Italian universities has been changed +% and the activities formally assigned to the Faculties may be now the +% responsibility of other structures that may have different names in different +% universities. If the internal command defined by |\FacoltaDi| is empty, no +% name is printed at all and the title page will not have any indication of a +% particular faculty or other educational structure. Therefore the Degree Course % name, specified with |\corsodilaurea| should be always specified. The alias % commands |\StrutturaDidattica| and |\struttura| are defined as equivalent % commands to |\FacoltaDi| and |\facolta| respectively. % -% Finally |\logosede| gets the name of the graphic file that contains the information -% relative to the university logo; it may receive also a comma separated list of logo file -% names, as it might be necessary when a thesis is developed in a multiple university -% environment. If such logo file is not available, the user does not specify this command; -% if the thesis is typeset on smaller paper size than A4 or letter, it would be much -% better to avoid inserting one or more logos in the title page; this is -% particularly important when using A5 paper size. Nevertheless this decision is -% left to the user and this package neither controls this fact nor outputs any warning. +% Finally |\logosede| gets the name of the graphic file that contains the +% information relative to the university logo; it may receive also a comma +% separated list of logo file names, as it might be necessary when a thesis +% is developed in a multiple university environment. If such logo file is not +% available, the user should not specify this command; if the thesis is +% typeset on smaller paper size than A4 or letter, it would be much better +% to avoid inserting one or more logos in the title page; this is particularly +% important when using A5 paper size. Nevertheless this decision is left to +% the user and this package neither controls this fact nor outputs any warning. % If the user uses this command to insert one or more university logo files -% but some file is not available, the usual \texttt{graphicx} package warning is issued -% but compilation goes on without the missing logo. -% -% The treatment of one or more logo files requires some extra -% commands and control sequences suitable to store temporary data or to specify style -% parameters: one is the name of a save box; another is the default spacing between the -% logos in the typeset page; the third is the height of the logos. The default spacing -% may be set with the help of the macro |\setlogodistance| -- notice that the default -% value is |3em|, and if a different distance is desired, it should not be much larger -% or much smaller than the default one; the default logo height is specified as an -% optional command to the |\logosede| command, while the default size is given by the -% |\interno| length; This length is specified in the main |toptesi| package in order to -% compute the typesetting grid, so that id the |topfront| package is used by itself with -% other classes, thee xistence of the |\inteno| control sequence is tested and if it is -% undefined, then and only then id defined in this package and assigned a default value. -% The save box name is just for internal workings and does not require any customization. -% The analysis and processing to the possible list of logo file names is done through the -% usual means of the delimited argument extraction of the single names from the list; the -% ``string'' of logos is then composed in a save box; as the list has been completely -% processed, the box is measured; if its width is shorter than the |\textwidth| it is -% typeset without further processing; if it's larger, on the opposite, the box gets scaled -% down so that its width equals the |\textwidth|. -% -% The |\tutoreaziendale| macro is the last title page 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. -% -% Eventually the |\retrofrontespizio| command, that by default is empty, allows to typeset -% a copyright page; the argument of this command is in total responsibility of the user -% who must write it in the thesis main language; the user can specify from zero to -% several paragraphs, separated by the vertical spaces s/he thinks best; the argument -% by default is typeset at the bottom of the text block of the copyright page. The user -% can specify any pertinent space at the bottom of his/her argument, so as to set the +% but some file is not available, the usual \texttt{graphicx} package warning +% is issued but compilation may go on without the missing logo. +% +% The treatment of one or more logo files requires some extra commands and +% control sequences suitable to store temporary data or to specify style +% parameters: one is the name of a save box; another is the default spacing +% between the logos in the typeset page; the third is the height of the logos. +% The default spacing may be set with the help of the macro |\setlogodistance| +% -- notice that the default value is |3em|, and if a different distance is +% desired, it should not be much larger or much smaller than the default one; +% the default logo height is specified as an optional command to the |\logosede| +% command, while the default size is given by the |\interno| length. This length +% is specified in the main |toptesi| package in order to compute the typesetting +% grid, so that if the |topfront| module is used by itself with other classes, +% the existence of the |\inteno| control sequence is tested and if it is +% undefined, then and only then it is defined in this module and assigned a +% default value. +% The save box name is just for internal workings and does not require any +% customisation. +% The analysis and processing to the possible list of logo file names is done +% through the usual means of the delimited argument extraction of the single +% names from the list; the ``string'' of logos is then composed in a save box; +% as the list has been completely processed, the box is measured; if its width +% is shorter than the |\textwidth| it is typeset without further processing; +% if it's larger, on the opposite, the box gets scaled down so that its width +% equals the |\textwidth|. +% +% The |\tutoreaziendale| macro is the last title page 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. +% +% Eventually the |\retrofrontespizio| command, that by default is empty, +% allows to typeset a copyright page; the argument of this command is in +% total responsibility to the user who must write it in the thesis main +% language; the user can specify from zero to several paragraphs, separated +% by the vertical spaces s/he thinks best; the argument by default is typeset +% at the bottom of the text block of the copyright page. The user can specify +% any pertinent space at the bottom of his/her argument, so as to set the % text in the position s/he likes best. -% In order to handle the copyright page in the proper way we need to test if its -% definition is empty or blank so we need the powerful advanced macros of the package -% |etoolbox| that has already been loaded by this package or by the main |toptesi| one. +% In order to handle the copyright page in the proper way we need to test +% if its definition is empty or blank so we need the powerful advanced macros +% of the package |etoolbox| that has already been loaded by this module or +% by the main |toptesi| one. % \begin{macrocode} \def\ciclodidottorato#1{\gdef\@ciclo{#1 \@cyclename}}% \def\corsodilaurea#1{\global\dottoratofalse\gdef\@corso{#1}} @@ -2275,20 +2309,6 @@ Skipping any redefinition\MessageBreak}% \newcommand\printloghi{\unless\ifvoid\TPT@logobox\usebox{\TPT@logobox}\fi} -%\newcommand\printloghi{\ifdefvoid{\@logosede}{}{% -%\begin{lrbox}{\TPT@logobox}\hskip\TPT@logospace -% \expandafter\@printloghi\@logosede,!}} -% -%\def\@printloghi#1,#2!{% -%\ifblank{#1}{\hskip\TPT@logospace\end{lrbox}\vspace*{\bigskipamount}% -%\leavevmode -%\ifdim\wd\TPT@logobox<\textwidth \box\TPT@logobox -%\else\resizebox{\textwidth}{!}{\box\TPT@logobox}% -%\fi}{\def\@logosede{#2}% -%\includegraphics[height=\TPT@logoheight]{#1}\hskip\TPT@logospace -% \expandafter\@printloghi\@logosede,!}} - - \def\tutoreaziendale#1{\gdef\@tutoreaziendale{#1}} \newcommand\retrofrontespizio[1]{\long\gdef\@retrofrontespizio{#1}} % \end{macrocode} @@ -2322,10 +2342,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 +% 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 localising language strings: it +% is necessary to localise the whole phrase, because of the position of % the adjectives. % \begin{macrocode} \newcommand\FacoltaDi[1]{\gdef\@faculty{#1}} @@ -2368,7 +2389,7 @@ Skipping any redefinition\MessageBreak}% {\IfFileExists{toptesi.cfg}{\input{toptesi.cfg}}{}} % \@ifundefined{@cyclename}{\def\@cyclename{ciclo}}{} -\@ifundefined{@title}{\def\@title{}}{} +\@ifundefined{@titolo}{\def\@titolo{}}{} \@ifundefined{@author}{\def\@author{}}{} \@ifundefined{@principaladviser}{\def\@principaladviser{}}{} \@ifundefined{@secondadviser}{\def\@secondadviser{}}{} @@ -2429,58 +2450,83 @@ Skipping any redefinition\MessageBreak}% \@ifundefined{@InName}{\def\@InName{in}}{} % \end{macrocode} % -% Finally we have the real macro |\frontespizio|, the real macro that actually -% typesets the title page. Actually the macro starts with some tests in order -% to decide if logos have to be set on topo or in the lower half of the title -% page; if the |classica| option has been set, the logos can be typeset only -% in the lower half of the title page, else the procedure tests if the -% |\frontespizio command| is followed by the asterisk. The macro |\fr@ntespizio| -% is the one that is invoked after such tests; it starts with the selection -% of the title page style; the local redefinition of the -% \texttt{myheadings} page style or a new |titlepage| page style; with the former one -% the university name goes into the header, while the exam date goes into the footer; -% with the latter style, on the opposite, the university logo(s) go in the header, -% while the Exam date remains in the footer. In this way the information that must -% be typeset on 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. -% But in oder t to control if we are dealing with |\fontespizio| or -% |frontespizio*| we must properly check the presence of the asterisk in -% a robust way. The point is that with the |classica| option the university -% logos go in the lower half of the title page, while without this option -% the asterisk controls the logo position in the lower half page, while its -% absence pots it above everything else. The |\@ifstar| kernel macro behaves -% in a funny way if nested with other tests. There fore I need to do some -% acrobatics that have to be absolutely robust. -% I define a |\TPTcheckstarmacro| that absorbs the first token after it and -% defines a service macro for testing that it is really an asterisk. -% The testing will be done within the following macros, but if it is an -% asterisk the boolean |topTPTlogos| is set to true, otherwise to false; -% but since this token has been already swallowed by the macro, in case -% it is not an asterisk, it must be put back in the input stream. -% \begin{macrocode} -\newif\iftopTPTlogos -\newcommand\TPTcheckstar[1]{\def\TPTmaybestar{#1}\fr@ntespizio} -\def\frontespizio{% -\ifbool{classica}{\boolfalse{topTPTlogos}\fr@ntespizio}{\TPTcheckstar} -} +% Finally we have the real macro |\frontespizio| and the corresponding environments, +% the real macro or environments that actually typesets the title page. +% +% I recommend to use the environments, a new feature of version 5.85. But the legacy +% command |\frontespizio| is still usable. +% The principle on which these environments work is that the |frontespizio| +% environment typesets the title page with logo(s) set in the page header, +% while the |frontspizio*| environment typesets the logos after the information +% on the title, possible sub titel and passible tome information., that is +% in the lower half of the title page. In order to achieve this result each +% environment sets the boolean variable |topTPTlogos| to eiter value |true| +% (for header logos) and |false| otherwise. The key of the different typesetting +% style is this boolean-variable state. +% +% Now, since the internal |frontespizio| environment opening command is +% |\frontespizio| how is it possible to distinguish this opening statement +% from the homonymous user command? The solution is a little tricky, but after +% all very simple. the |\begin| command, with which an environment is started, +% before calling the opening statement defines the internal serve macro +% |\@currenvir| to contain the environment name; this is used by the +% |\end| statement to control that it is closing the last opened environment. +% If the |\frontespizio| command is directly used, the |\@currenvir| macro +% does not contain the name frontespizio; therefore if in the opening environment +% definition we check the contents of |\@currenvir| against the string +% |frontespizio| we can decide if the user resorted to the legacy command, or +% the environment was correctly opened by means of |\begin|. +% If the user resorted to the legacy command, the service macro |\fr@ontespizio| +% is called that typesets the title page according to the current status of the +% boolean |topTPTlogos|, a boolean that has a default value but the user can set +% at its will. Otherwise the |frontespizio| environment is regularly executed. +% Notice that the service macro |\fr@ntespizio| tests the state of the boolean +% |classica| and accordingly uses a different page style. +% \begin{macrocode} +\newbool{topTPTlogos} \booltrue{topTPTlogos} - +\newenvironment{frontespizio*}{\boolfalse{topTPTlogos}}{\fr@ntespizio} + +\newenvironment{frontespizio}{% + \ifdefstring{\@currenvir}{frontespizio} + {\booltrue{topTPTlogos}}{\fr@ntespizio} + }{% + \fr@ntespizio + } + +% \end{macrocode} +% +% With the new bolean |AteneoInHead| we can mark these situations where the +% university common name goes int to header; With the |classica| option the +% title page \emph{must} have this name in the header and if the user forgets +% to specify one, this module fakes it with a clear message that the university +% name has been forgotten, but at the same time this fake message fills up the +% header position. On the other hand, when the |classica| option has no been +% specified, the user can use either an empty university name or a specific +% name. So only when the |\@ateneo| macro remains empty the university name +% in the header remains really blank; this is good when the university name +% is part of the university logo (this is the case for Politecnico di Torino, +% and for many other universities). Whne no universty name is set in the header +% some little attentions in formatting the title page are necessary. +% +% \begin{macrocode} +\newbool{AteneoInHead}\boolfalse{AteneoInHead} \def\fr@ntespizio{% \begingroup \ifclassica + \boolfalse{topTPTlogos} \thispagestyle{classica} + \ifcsvoid{@ateneo}{\def\@ateneo{Manca il nome dell'ateneo} + }{} \else -\ifdefstring{\TPTmaybestar}{*}{\@firstoftwo}{\@secondoftwo}% - {\boolfalse{topTPTlogos}\thispagestyle{classica}\TPTmaybestar}% - {\booltrue{topTPTlogos}\thispagestyle{titlepage}} + \thispagestyle{titlepage} \fi +\ifcsvoid{@ateneo}{}{\booltrue{AteneoInHead}} % \end{macrocode} % % We want also the title page to be set in the middle of the page irrespective of -% the binding correction; so we assign the average of the two side margins to each -% margin. +% the binding correction; so we assign the average of the two side margins to both +% of them. % \begin{macrocode} \oddsidemargin=\dimexpr(\oddsidemargin+\evensidemargin)/2\relax \evensidemargin \oddsidemargin @@ -2497,27 +2543,26 @@ Skipping any redefinition\MessageBreak}% % The generic university name should already be in the header either in the logo % or in the header text; but in spite of this we test if the university generic % name macro is void, if it contains something, then we typeset also the generic -% name; some candidates might obey to university regulations require the name +% name; some candidates might obey to university regulations that require the name % of the university be at the top, just under the logo. The switch |\ifcsvoid| -% is true if |@ateneo| is empty or blank, false otherwise -% \begin{macrocode} -\iftopTPTlogos - \ifcsvoid{@ateneo}{}{% - {\centering\LARGE \@ateneo\par}\bigskip +% is true if |@ateneo| is empty or blank, false otherwise; but even with page top +% logos, no test is made in order to give the possibility to repeat the university +% name. It is the user responsibility to set an empty value to the |\ateneo| macro +% so as to avoid repeating the university name possibly already present in the logo +% itself. +% \begin{macrocode} + \ifbool{AteneoInHead}{}{% + {{\centering\LARGE \@ateneo\par}} } -\fi % \end{macrocode} +% +% If it is non blank the first thing we set on the page is the university +% proper name and some vertical glue. +% \begin{macrocode} + \ifcsvoid{@nomeat}{} + {\ifbool{topTPTlogos}{\vspace*{3.5ex}}{\vspace*{-3ex}}% + {\centering\Large \@nomeat\par}\vfill} - -%if it is non blank -% the first thing -% we set in the page is the university proper name and some vertical glue. -% \begin{macrocode} - \ifx\@nomeat\empty \else - {% - \centering - {\Large \@nomeat}\par}\vfill - \fi % \end{macrocode} % 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 @@ -2549,9 +2594,9 @@ Skipping any redefinition\MessageBreak}% \par}} \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 centres the name of the report, be it ``Doctoral Dissertation'' or ``Master +% Thesis'' or whatever; in case the command |\materia| was used, it then centres +% the discipline which the thesis deals with. % \begin{macrocode} \vspace{\stretch{0.2}} \begin{center} @@ -2577,7 +2622,7 @@ Skipping any redefinition\MessageBreak}% \vspace{\stretch{0.2}} \begin{center} {\huge\bfseries \baselineskip=0.95em plus 1pt - \@title \par} + \@titolo \par} \end{center} % \end{macrocode} % con l'eventuale sottotitolo: @@ -2590,7 +2635,7 @@ Skipping any redefinition\MessageBreak}% % \end{macrocode} % If the option \texttt{classica} is in force the thesis might be divided in several % volumes; theses in humanities apparently are often oversized. In this case the -% |\frontespizio| command may be given at the beginning of every volume and the +% |\tomo| 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} @@ -2616,12 +2661,13 @@ Skipping any redefinition\MessageBreak}% \par % \end{macrocode} % Going down in the title page, now comes the optional insertion of the university -% logo(s);``optional'' in both meanings: lone or more university logos are not generally +% logo(s); ``optional'' in both meanings: one or more university logos are not generally % required in a thesis, and in case it depends if the logo(s) have to be put in the % header or here. -% This is a simple task since the |\logosede| already defined the contents to the box -% |\TPT@logobox|, and this was done either with % an explicit command |\logosede| -% with its argument in the preamble, or with a specific line in the configuration file. +% This is a simple task since the |\logosede| already defined the contents to the +% box |\TPT@logobox|, and this was done either with an explicit command |\logosede| +% with its argument in the preamble, or with a specific line in the configuration +% file or within the |frontespizio| environment. % If such box |\TPT@logobox| is void, the already defined |\printloghi| macro does % not do anything. % \begin{macrocode} @@ -2629,13 +2675,13 @@ Skipping any redefinition\MessageBreak}% {\centering \printloghi\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 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 of -% supervisors. +% 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 of supervisors. % \begin{macrocode} \vfill \iflaureatriennale @@ -2680,7 +2726,7 @@ Skipping any redefinition\MessageBreak}% % % 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 +% report is dealt with, the name of the \emph{single} candidate is centred and % written in caps-and-small-caps. % \begin{macrocode} \iflaureatriennale @@ -2716,7 +2762,7 @@ Skipping any redefinition\MessageBreak}% % but with |\renewcommand| the user can redefine it as s/he prefers, in % particular by changing the Italian name into a proper English one, may be % simply `ID'. It is necessary to recall that the ID number must be entered -% only if required by the University regulations; il must not be typeset in +% only if required by the University regulations; it must not be typeset in % the title page just because it is possible to do it. If no number is entered, % the |\IDN| must not be used. @@ -2768,9 +2814,9 @@ Skipping any redefinition\MessageBreak}% % referred to the PhD school one type of layout is used, otherwise the default % master thesis layout is used; remember that the bachelor degree case has % already taken place. For the doctoral dissertation the doctoral candidate name -% is typeset centered in one line by itself and everything else is set 3em below +% is typeset centred 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 labels and the second line containing the true names. The central +% the personal 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 @@ -2827,7 +2873,7 @@ Skipping any redefinition\MessageBreak}% % \begin{macrocode} \par\clearpage \ifcsvoid{@retrofrontespizio}{}% - {\null\vfill\pagestyle{empty}\@retrofrontespizio\par\clearpage}% + {\null\vfill\thispagestyle{empty}\@retrofrontespizio\par\clearpage}% \endgroup} % \end{macrocode} % \iffalse @@ -2835,7 +2881,7 @@ Skipping any redefinition\MessageBreak}% % \fi % % \subsection{A sample configuration file} -% The following code generates a simple configuration file that the user +% The following code generates a sample configuration file that the user % can change at will; it can be used as a template for generating a really % personal configuration file. % \iffalse @@ -2884,7 +2930,7 @@ Skipping any redefinition\MessageBreak}% % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} % lavora solo con LaTeX 2e \ProvidesPackage{topcoman}% - [2014/11/07 v.5.84 Additional commands for the TOPtesi bundle] + [2014/11/13 v.5.85b 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 @@ -2994,29 +3040,32 @@ Skipping any redefinition\MessageBreak}% {\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 +% Remember that the comma as a decimal separator is required for all languages +% except English. If you use this module outside TOPtesi, but as an extension +% of other classes or modules, it's up to you to define an ``intelligent comma'' +% macro or to load either the |icomma.sty| or the |nccomma.sty| module that +% define such a macro: the |icomma| package defines the comma as a mathematical +% active character that recognises 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 recognises if the following token is a digit so as to +% use a decimal comma. +% +% The following commands are used to write the ``lower case'' roman numerals +% with the small-caps font; 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 comply with the |hyperref| module, I avoided +% using this new macro for folios; in other situations there are no 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}}% + {\mbox{$\relax$}\fontsize{\sf@size}{\f@baselineskip}\selectfont#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. |