From b2fad8915b87bb45e4d3ffafd0f8119da45a921e Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 22 Oct 2017 19:50:59 +0000
Subject: toptesi (22oct17)

git-svn-id: svn://tug.org/texlive/trunk@45577 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/toptesi/topfront.sty | 196 ++++++++++++++---------
 1 file changed, 123 insertions(+), 73 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/toptesi/topfront.sty')

diff --git a/Master/texmf-dist/tex/latex/toptesi/topfront.sty b/Master/texmf-dist/tex/latex/toptesi/topfront.sty
index d6ca4f3ce7d..772b4705764 100644
--- a/Master/texmf-dist/tex/latex/toptesi/topfront.sty
+++ b/Master/texmf-dist/tex/latex/toptesi/topfront.sty
@@ -6,26 +6,37 @@
 %%
 %% toptesi.dtx  (with options: `topfrn')
 %%   ______________________________________________________
-%%   The TOPtesi package
-%%   Copyright (C) 2005-2016 Claudio Beccari
+%%   The TOPtesi bundle
+%%   Copyright (C) 2015-2017 Claudio Beccari
 %%   All rights reserved
 %% 
 %%   License information appended
 %% 
-\NeedsTeXFormat{LaTeX2e}[2015/01/01]
+\NeedsTeXFormat{LaTeX2e}[2016/01/01]
 \ProvidesPackage{topfront}[%
-2016/11/25 v.5.9.06
+2017/10/22 v.~6.1.09
 Title page for TOPtesi and other classes]
+
 \@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}}
-\ifcsundef{ifclassica}{%
-\newif\ifclassica \classicafalse
-\newif\if@utoretitolo \@utoretitolofalse
-\newif\if@ldstyle \@ldstylefalse
-\newif\if@xivpt \@xivptfalse
-\newif\if@binding \@bindingfalse
-}{}
-\ifcsundef{ifTOPfront}{\newif\ifTOPfront \TOPfronttrue}{}
+\@ifpackageloaded{xspace}{}{\RequirePackage{xspace}}
+\@ifpackageloaded{xparse}{}{\RequirePackage{xparse}}
+\ifcsundef{ifclassica}{\newif\ifclassica \classicafalse}{}
+\ifcsundef{if@utoretitolo}{\newif\if@utoretitolo\@utoretitolofalse}{}
+\ifcsundef{if@ldstyle}{\newif\if@ldstyle\@ldstylefalse}{}
+\ifcsundef{if@xivpt}{\newif\if@xivpt \@xivptfalse}{}
+\ifcsundef{if@binding}{\newif\if@binding\@bindingfalse}{}
+\ifcsundef{ifScuDo}{\newif\ifScuDo \ScuDofalse}{}
+\ifcsundef{ifmonografia}{\newif\ifmonografia\monografiafalse}{}
+\ifcsundef{iftriennale}{\newif\iftriennale\triennalefalse}{}
+\ifcsundef{ifmagistrale}{\newif\ifmagistrale\magistralefalse}{}
+\ifcsundef{ifdottorale}{\newif\ifdottorale\dottoralefalse}{}
+\ifcsundef{ifsecondaria}{\newif\ifsecondaria\secondariafalse}{}
+\ifcsundef{ifplurale}{\newif\ifplurale\pluralefalse}{}
+
+\ifcsundef{ifTOPfront}{\newif\ifTOPfront \TOPfronttrue
+\newif\ifevenboxes \evenboxesfalse}{}
 \ifcsundef{c@tomo}{\newcounter{tomo}}{}
+\DeclareOption{evenboxes}{\evenboxestrue}
 \DeclareOption{cucitura}{\@bindingtrue}
 \DeclareOption{14pt}{\@xivpttrue}
 \DeclareOption{classica}{\classicatrue}
@@ -33,20 +44,21 @@ Title page for TOPtesi and other classes]
 \DeclareOption{oldstyle}{\ifclassica\@ldstyletrue\fi}
 \ProcessOptions*\relax
 
-\if@xivpt\@ifl@aded{clo}{size14}{}{\input{size14.clo}}\fi
 \def\headstrut{\vrule \@depth4\p@ \@height\z@ \@width\z@}
 \def\ps@titlepage{\let\@mkboth\@gobbletwo
    \def\@oddfoot{\vbox to 0.05\paperheight{\vss
       \hbox to\hsize{\hfil{\Large{\@submitdate}}\hfil}}}%
    \let\@evenfoot\@oddfoot
    \def\@oddhead{%
-      \vbox to\headheight{\vss\iftopTPTlogos
+      \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\MakeUppercase{\@ateneo}\hss}}
+           }
+         \fi\par
+         \ifcsvoid{@ateneo}{}{%
+         \hbox to\textwidth{\hss\LARGE\rule[-1ex]{0pt}{3.3ex}\MakeUppercase{\@ateneo}\hss}}
          \vss
       }%
    }%
@@ -68,7 +80,8 @@ Title page for TOPtesi and other classes]
       \def\@oddfoot{\vbox to \dimexpr\paperheight/20\relax{\vss
      \ifclassica
         \hbox to \hsize{\hfil\raisebox{-.3ex}[\z@][\z@]{%
-        \vrule\@height-2.6\p@\@depth3\p@\@width\dimexpr\textwidth/3}\hfil}%
+        \vrule\@height-2.6\p@\@depth3\p@\@width
+            \dimexpr\textwidth/3}\hfil}%
       \fi
       \hbox to\hsize{\hfill{\Large{\@submitdate}}\hfill}}%
       }%
@@ -77,7 +90,7 @@ Title page for TOPtesi and other classes]
       }%
 \newif\iffemminile
 \newif\ifdottorato \dottoratofalse
-\newif\iflaureatriennale \laureatriennalefalse
+\newif\iftriennale \triennalefalse
 \ifTOPfront
 \ifclassica
 \def\Candidato{Laureando}
@@ -85,23 +98,25 @@ Title page for TOPtesi and other classes]
 \def\Candidati{Laureandi}
 \def\Candidate{Laureande}
 \fi\fi
-\def\monografia#1{\global\laureatriennaletrue
+\def\monografia#1{\global\triennaletrue
       \global\dottoratofalse
       \global\def\titolo##1{\PackageWarning{topfront}%
       {Il titolo e' gia' stato impostato con
             il comando \string\monografia}}%
       \gdef\@titolo{#1}}
+
 \let\@stitle\empty
+
 \newcommand*{\titolo}[2][]{%
-\ifbool{laureatriennale}{%
+\ifbool{triennale}{%
 \PackageWarning{topfront}{Il titolo deve essere impostato con
                                il comando \string\monografia}
-}
-{\def\@tempA{#1}\ifdefempty{\@tempA}%
-     {\gdef\@stitle{#2}}
-     {\gdef\@stitle{#1}}%
+}{%
+\def\@tempA{#1}\ifdefempty{\@tempA}%
+     {\gdef\@stitle{#2}}{\gdef\@stitle{#1}}%
      \gdef\@titolo{#2}%
-}}
+     }%
+}
 \def\sottotitolo#1{\gdef\@subtitle{#1}}
 \let\@materia\empty
 \def\Materia#1{\def\@materia{#1}}\let\materia\Materia
@@ -113,12 +128,6 @@ Title page for TOPtesi and other classes]
 \def\relatore#1{\gdef\@principaladviser{#1}}
 \def\secondorelatore#1{\gdef\@secondadviser{#1}}
 \def\terzorelatore#1{\gdef\@thirdadviser{#1}}
-\def\candidato#1{\gdef\@author{#1}\femminilefalse}
-\def\candidata#1{\gdef\@author{#1}\femminiletrue}
-\def\secondocandidato#1{\gdef\@secondauthor{#1}\femminilefalse}
-\def\secondacandidata#1{\gdef\@secondauthor{#1}}
-\def\terzocandidato#1{\gdef\@thirdauthor{#1}\femminilefalse}
-\def\terzacandidata#1{\gdef\@thirdauthor{#1}}
 \def\sedutadilaurea#1{\getseduta#1 !}
 \def\getseduta#1 #2!{%
     \def\@tempA{#2}%
@@ -170,9 +179,9 @@ Title page for TOPtesi and other classes]
     \vrule\@width\dimen@\@height\dimen4\@depth-\dimen\tw@}}}
 \def\ciclodidottorato#1{\gdef\@ciclo{#1 \@cyclename}}%
 \def\corsodilaurea#1{\global\dottoratofalse\gdef\@corso{#1}}
-\def\corsodidottorato#1{\global\dottoratotrue\global\laureatriennalefalse
+\def\corsodidottorato#1{\global\dottoratotrue\global\triennalefalse
     \gdef\@corso{#1}}
-\def\scuoladidottorato#1{\global\dottoratotrue\global\laureatriennalefalse
+\def\scuoladidottorato#1{\global\dottoratotrue\global\triennalefalse
     \gdef\@phdschool{#1}}
 \def\ateneo#1{\gdef\@ateneo{#1}}
 \def\nomeateneo#1{\gdef\@nomeat{\expandafter\uppercase{\expandafter #1}}}
@@ -185,11 +194,11 @@ Title page for TOPtesi and other classes]
 \newcommand*\setlogodistance[1]{\TPT@logospace=#1}
 \providecommand*{\@logosede}{}
 
-\ifcsundef{interno}{%\
-    \newlength\interno
-    \setlength\interno{\dimexpr\paperwidth/7}}{}
+\ifcsundef{T@Tlogoheight}{%\
+    \newlength\T@Tlogoheight
+    \setlength\T@Tlogoheight{0.8\dimexpr(\paperwidth-\textwidth)/2}}{}
 
-\newcommand\logosede[2][\interno]{\def\@logosede{#2}\TPT@logoheight=#1\relax
+\newcommand\logosede[2][\T@Tlogoheight]{\def\@logosede{#2}\TPT@logoheight=#1\relax
 \ifcsvoid{@logosede}{\sbox{\TPT@logobox}{}}{\begin{lrbox}{\TPT@logobox}%
 \expandafter\fillup@TCP@logobox\@logosede,!}}
 
@@ -222,12 +231,41 @@ Title page for TOPtesi and other classes]
 \newcommand\NomeSecondoTomo[1]{\gdef\SecondoTomo{#1}}
 \newcommand\NomeTerzoTomo[1]{\gdef\TerzoTomo{#1}}
 \newcommand\NomeQuartoTomo[1]{\gdef\QuartoTomo{#1}}
-\newcommand\IDN{\\\quad matricola:\space}
+\providecommand\IDlabel{\\\quad matricola\ }
 \IfFileExists{\jobname.cfg}{\input{\jobname.cfg}}%
     {\IfFileExists{toptesi.cfg}{\input{toptesi.cfg}}{}}
 \@ifundefined{@cyclename}{\def\@cyclename{ciclo}}{}
 \@ifundefined{@titolo}{\def\@titolo{}}{}
-\@ifundefined{@author}{\def\@author{}}{}
+
+\providecommand\@author{}\providecommand\@@author{}
+\NewDocumentCommand\candidato{m o}{\gdef\@@author{#1}%
+\IfNoValueTF{#2}{\gdef\@author{#1}}%
+               {\gdef\@author{#1\IDlabel#2}}
+\femminilefalse\pluralefalse}
+\NewDocumentCommand\candidata{m o}{\gdef\@@author{#1}%
+\IfNoValueTF{#2}{\gdef\@author{#1}}%
+               {\gdef\@author{#1\IDlabel#2}}
+\femminiletrue\pluralefalse}
+\providecommand\@secondauthor{}
+\NewDocumentCommand\secondocandidato{m o}{%
+\IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
+                {\gdef\@secondauthor{#1\IDlabel#2}}%
+\femminilefalse\pluraletrue}
+\NewDocumentCommand\secondacandidata{m o}{%
+\IfNoValueTF{#2}{\gdef\@secondauthor{#1}}%
+                {\gdef\@secondauthor{#1\IDlabel#2}}%
+\pluraletrue}
+\providecommand\@thirdauthor{}
+\NewDocumentCommand\terzocandidato{m o}{%
+\IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
+                {\gdef\@thirdauthor{#1\IDlabel#2}}%
+\femminilefalse\pluraletrue}
+\NewDocumentCommand\terzacandidata{m o}{%
+\IfNoValueTF{#2}{\gdef\@thirdauthor{#1}}%
+                {\gdef\@thirdauthor{#1\IDlabel#2}}%
+\pluraletrue}
+\providecommand\IDlabel{matricola\ }
+
 \@ifundefined{@principaladviser}{\def\@principaladviser{}}{}
 \@ifundefined{@secondadviser}{\def\@secondadviser{}}{}
 \@ifundefined{@thirdadviser}{\def\@thirdadviser{}}{}
@@ -235,8 +273,6 @@ Title page for TOPtesi and other classes]
    \ifDirettore\def\@PhDdirector{Direttore del corso di dottorato}\else
     \def\@PhDdirector{Coordinatore del corso di dottorato}\fi}{}
 \@ifundefined{@tutore}{\def\@tutore{}}{}
-\@ifundefined{@secondauthor}{\def\@secondauthor{}}{}
-\@ifundefined{@thirdauthor}{\def\@thirdauthor{}}{}
 \@ifundefined{@nomerelatore}{\def\@nomerelatore{}}{}
 \@ifundefined{@nomecandidato}{\def\@nomecandidato{}}{}
 \@ifundefined{Candidato}{\def\Candidato{Candidato}}{}
@@ -326,7 +362,7 @@ Title page for TOPtesi and other classes]
       {{\centering\LARGE \@ateneo\par}}
    }
    \ifcsvoid{@nomeat}{}
-      {\ifbool{topTPTlogos}{\vspace*{3.5ex}}{\vspace*{-3ex}}%
+      {\ifbool{topTPTlogos}{\vspace*{\dimexpr \headsep+2.5ex}}{\vspace*{-3ex}}%
       {\centering\@nomeat\par}\vfill}
 
       \begin{center}
@@ -336,15 +372,16 @@ Title page for TOPtesi and other classes]
       \else
             \ifcsvoid{@faculty}{}{%
              \LARGE\ifx\@facnumber\empty\else\@facnumber\space\fi
-             \@faculty\@facname\par\medskip
+             \@faculty\unskip\xspace\@facname\par\medskip
             }
       \fi
       }%
       \ifcsvoid{@corso}{}{{\large
             \ifdottorato
-                  \@PhDname\@corso\ifx\@ciclo\empty\else~--~\@ciclo\fi
+                 \@PhDname\unskip\xspace
+                      \@corso\ifx\@ciclo\empty\else~--~\@ciclo\fi
             \else
-                  \@laureaname\@corso
+                  \@laureaname\unskip\xspace\@corso
             \fi
             \par}}
       \end{center}
@@ -354,7 +391,7 @@ Title page for TOPtesi and other classes]
         \ifdottorato
             \@dissertazione%
         \else
-            \iflaureatriennale
+            \iftriennale
                   \@monografia%
             \else
                   \@TesiDiLaurea%
@@ -386,7 +423,8 @@ Title page for TOPtesi and other classes]
                         \or \QuartoTomo%
                         \else
                             \PackageWarning{toptesi}{%
-                            Counter tomo equals \the\c@tomo\MessageBreak
+                            Counter tomo equals
+                               \the\c@tomo\MessageBreak
                             We never considered a thesis might get
                             divided in more than four volumes}%
                         \fi}}%
@@ -397,7 +435,7 @@ Title page for TOPtesi and other classes]
      \unless\iftopTPTlogos
       {\vfill\centering \printloghi\par}\fi
       \vfill
-      \iflaureatriennale
+      \iftriennale
             \let\@nomerelatore\empty
       \else
             \ifdottorato
@@ -428,11 +466,10 @@ Title page for TOPtesi and other classes]
                   \fi}
          }{}%
      \fi
-      \iflaureatriennale
+      \iftriennale
             \begin{center}%
                   \large\mdseries\textsc{\@author}
             \end{center}%
-
       \else
          \def\BoxRelatori{%
             \begin{tabular}[t]{l}%
@@ -485,16 +522,21 @@ Title page for TOPtesi and other classes]
                }%
             \end{center}
          \else
-             \unless\ifclassica
-               \begin{flushleft}%
-                     \BoxRelatori
-               \end{flushleft}\par\vspace*{-1.5\baselineskip}
-               \begin{flushright}%
-                     \BoxCandidati
-               \end{flushright}%
+           \unless\ifclassica
+             \unless\ifevenboxes
+             \begin{flushleft}%
+                \BoxRelatori
+             \end{flushleft}\par\vspace*{-1.5\baselineskip}
+             \begin{flushright}%
+                \BoxCandidati
+             \end{flushright}%
+             \else
+                \makebox[\textwidth]{\BoxRelatori\hfill\BoxCandidati}
+             \fi
              \else
                \noindent
-               \makebox[\textwidth]{\BoxRelatori\hfill\BoxCandidati}\par
+               \makebox[\textwidth]{%
+               \BoxRelatori\hfill\BoxCandidati}\par
              \fi
           \fi
       \fi
@@ -507,7 +549,7 @@ Title page for TOPtesi and other classes]
       {\null\vfill\thispagestyle{empty}\@retrofrontespizio\par\clearpage}%
 \endgroup}
 %% 
-%% Copyright 2005-2016 Claudio Beccari
+%% Copyright 2005-2017 Claudio Beccari
 %% 
 %% Distributable under the LaTeX Project Public License,
 %% version 1.3c or higher (your choice). The latest version of
@@ -516,14 +558,14 @@ Title page for TOPtesi and other classes]
 %% This work is "author-maintained"
 %% 
 %% This work consists of this file toptesi.dtx, a README file
-%% and the derived files:
-%% 
-%% toptesi.cls, toptesi.sty, topfront.sty, topcoman.sty,
-%% toptesi.cfg, and the English documentation toptesi.pdf.
+%% the manifest.txt file, and the derived files:
+%%     toptesi.cls, toptesi.sty, topfront.sty, topcommand.sty,
+%%     toptesi-scudo.sty, toptesi-scudo.def, toptesi.cfg, and the
+%%     English documentation toptesi.pdf.
 %% 
 %% Furthermore the bundle contains the documentation source
-%% file toptesi-it-pdftex.tex and the derived file
-%% toptesi-it-pdftex.pdf.
+%% file toptesi-it.tex and the derived file
+%% toptesi-it.pdf.
 %% 
 %% The toptesi-example.tex source file is just an example
 %% that shows how to use the various commands; by commenting
@@ -534,18 +576,26 @@ Title page for TOPtesi and other classes]
 %% to produce just the title page with TOPtesi and the external
 %% package frontespizio.
 %% 
+%% The toptesi-scudo-example.tex source file is an example
+%% that shows the particular features available with TOPtesi,
+%% when a doctoral thesis is produced for the SCUola di
+%% DOttorato (ScuDo) of Politecnico di Torino.
+%% 
 %% The toptesi.cfg file is a sample of a local configuration
 %% file that can be copied to another file and its copy freely
-%% edited and customized.
+%% edited and customised.
 %% 
 %% By running pdflatex on toptesi.dtx the user gets the class,
-%% sty and cfg files and the English documentation file in
-%% pdf format.
+%% sty, def and cfg files and the English documentation file in
+%% PDF format.
 %% 
 %% The source file of the Italian documentation file
-%% toptesi-it-pdftex.pdf is another example of how to use TOPtesi.
-%% In spite of its name, toptesi-it-pdftex.tex may be typeset
-%% with pdfLaTeX, XeLaTeX, and LuaLateX; see the first comment
-%% lines of the file for how-to information.
+%% toptesi-it.pdf is another example of how to use TOPtesi.
+%% This file toptesi-it.tex may be typeset with pdfLaTeX,
+%% XeLaTeX, and LuaLateX; see the first comment lines of
+%% the file for how-to information. In spite of being mainly
+%% written in Italian, it contains several sections in English
+%% for the benefit of foreign students attending the Doctoral
+%% School of Turin.
 %%
 %% End of file `topfront.sty'.
-- 
cgit v1.2.3

