summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/toptesi
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-07-19 20:56:50 +0000
committerKarl Berry <karl@freefriends.org>2019-07-19 20:56:50 +0000
commitb6688aa7248a7020bf607aa3ec305eef2a70ce67 (patch)
treeebe7ecbd90abd57d43bfe9d26745d2293a07fcba /Master/texmf-dist/source/latex/toptesi
parentacc026ddb4026d82773b71771f1c5f6112f02043 (diff)
toptesi (19jul19)
git-svn-id: svn://tug.org/texlive/trunk@51682 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/toptesi')
-rw-r--r--Master/texmf-dist/source/latex/toptesi/toptesi.dtx223
1 files changed, 175 insertions, 48 deletions
diff --git a/Master/texmf-dist/source/latex/toptesi/toptesi.dtx b/Master/texmf-dist/source/latex/toptesi/toptesi.dtx
index 6a07bb8f18d..3572289e173 100644
--- a/Master/texmf-dist/source/latex/toptesi/toptesi.dtx
+++ b/Master/texmf-dist/source/latex/toptesi/toptesi.dtx
@@ -128,7 +128,7 @@ School of Turin.
%
% \iffalse
%^^A The following trick uses the same date for every file header.
-%<class,topsty,topcmn,topfrn,topscu,topmon,topsss,topmag>\NeedsTeXFormat{LaTeX2e}[2016/01/01]
+%<class,topsty,topcmn,topfrn,topscu,topmon,topsss,topmag>\NeedsTeXFormat{LaTeX2e}[2018/01/01]
%<*driver>
\ProvidesFile{toptesi.dtx}[%
%</driver>
@@ -142,7 +142,7 @@ School of Turin.
%<topmag>\ProvidesPackage{toptesi-magistrale}[%
%<topdoc>\ProvidesPackage{toptesi-dottorale}[%
%<*driver,class,topsty,topcmn,topfrn,topscu,topmon,topsss,topmag,topdoc>
-2019-05-01 v.6.3.04
+2019-07-01 v.6.3.05
%<class>Class for typesetting university theses]
%<topsty>Extension for toptesi.cls]
%<topcmn>Additional commands for the TOPtesi bundle]
@@ -161,7 +161,7 @@ School of Turin.
\GetFileInfo{toptesi.dtx}
\title{The TOPtesi bundle}
\date{\fileversion\space--- \filedate}
- \author{\makebox[\textwidth]{Claudio Beccari --- mail: \texttt{claudio dot beccari at gmail dot com}}}
+ \author{\makebox[\textwidth]{Claudio Beccari --- \texttt{claudio dot beccari at gmail dot com}}}
\usepackage[utf8]{inputenc}
\usepackage[LGR,T1]{fontenc}
\usepackage{metalogo,multicol,enumitem,xspace,
@@ -256,7 +256,7 @@ School of Turin.
%</driver>
% \fi
%
-% \CheckSum{7627}
+% \CheckSum{7658}
%
% \begin{abstract}
% This file describes the TOPtesi bundle; it consists of a set of files
@@ -3155,6 +3155,7 @@ School of Turin.
\newif\iffigurespage
\newif\iftablespage
\newif\ifnumeriromani
+\newif\if@mainmatter
\newif\iffrontmatter
% \end{macrocode}
% The |\frontmatter| and |\mainmatter| commands are defined
@@ -3163,18 +3164,21 @@ School of Turin.
% command it suffices to turn out sectional numbering, and
% to allow opening chapters also on even numbered pages.
% \begin{macrocode}
-\def\frontmatter{\clearpage\ps@plain%
+\def\frontmatter{\clearpage\ps@plain\@mainmatterfalse
\ifTOPnumerazioneromana\numeriromanitrue\fi
\frontmattertrue\@openrightfalse\c@secnumdepth=-2\relax
}
-\def\mainmatter{\if@twoside\@openrighttrue\fi
+\def\mainmatter{\@mainmattertrue
+\if@twoside\@openrighttrue\fi
\ifTOPnumerazioneromana\numeriromanifalse\fi
- \frontmatterfalse\c@secnumdepth=2
+ \frontmatterfalse
+ \c@secnumdepth=2
\clearpage\ps@headings
\ifTOPnumerazioneromana\pagenumbering{arabic}\fi
}
\newcommand\backmatter{\cleardoublepage[empty]%
+\@mainmatterfalse
\setcounter{secnumdepth}{-1}\if@twoside\@openrightfalse\fi}
\AtBeginDocument{%
@@ -3198,6 +3202,7 @@ School of Turin.
% \begin{macrocode}
\figurespagefalse
\tablespagefalse
+
% \end{macrocode}
%
% Before going further on, we redefine the |\cleardoublepage|
@@ -3216,6 +3221,7 @@ School of Turin.
\if@openright
\null\thispagestyle{#1}\clearpage
\fi\fi\fi}
+
% \end{macrocode}
%
% We have to define the front matter sectioning names |\sommario|
@@ -3239,34 +3245,129 @@ School of Turin.
% from Italian and English.
%
% We have to modify the |\chapter| and |\part| commands so
-% that as the user first issues one of these commands the
+% that as the user first uses one of these commands the
% typesetting style is switched to that of the main matter.
-% Actually it is not necessary to redefine all the commands,
-% but just those of the unstarred versions. In facts
-% |\chapter| commands to typeset the Summary and the
+% But by exploiting certain facilities of the |xparse| package,
+% some delicate tests could be developed by |xparse| itself; therefore
+% the whole command was redefined so that the new syntax is the following:
+%\begin{flushleft}\obeylines
+%\cs{chapter}\meta{$\star$}\oarg{toc entry}\oarg{headings entries}\marg{title}\oarg{pagestyle}
+%\end{flushleft}
+% The \meta{$\star$} is optional, and simply implies that no toc
+% entry will be generated and the chapter title will not be
+% numbered. In this way the previous \LaTeX\ kernel macros
+% |\chapter| and |\chapter*| maintain their usual behaviour:
+%\begin{flushleft}\obeylines
+%\cs{chapter}\oarg{toc entry}\marg{title}
+%\cs{chapter*}\marg{title}
+%\end{flushleft}
+% But the various optional arguments play different roles and
+% implement new functionalities. The star itself now is a special
+% argument, numbered |#1|, therefore the total number of arguments
+% is five. Their meaning is the following.
+%\begin{description}
+%
+%\item[\meta{$\star$}] Controls the chapter numbering and the
+% toc entry; its absence implies numbering and toc entry;
+% its presence implies no numbering and no toc entry;
+% nevertheless is does not cancels the possibility of having
+% an header (if the page style accepts left and right marks);
+% for example, a command such as this one\\[1ex]
+%\cs{chapter*}\Oarg{Short entry}\Marg{Long title}\\[1ex]
+% does not number the chapter with the |Long title|, but gets
+% the string |Short entry|; lacking the optional argument both
+% headers (see below) will contain the string |Long title|.
+% If you want an empty header, you have to specify an empty
+% optional argument; or before using the command, you specify
+% an empty or a plain page style
+%\item[\meta{toc entry}] is the entry for the table of contents;
+% its default value is \meta{title}, but since more often than
+% not the actual \meta{title} is a long string, it is better
+% to use such optional argument: of course, if the optional star
+% is used, its \meta{toc entry} is passed on as a default value
+% for the \meta{headings entry}.
+%
+%
+%\item[\meta{headings entry}] contains the string to be inserted
+% in both left and right headers, if the page style uses such
+% pieces of information; this is a deliberate choice in order
+% to have both headers correctly indicating the chapter title
+% even if the “chapter” contains no sections, for example indices,
+% lists of figures and/or tables, forewords and similar thesis
+% items. Of course if sections are used, their entries replace
+% that chapter entry in the right header. This choice of defining
+% both headings is useful also for those numbered chapters that
+% have a longish text preceding the first section.
+%
+%
+%\item[\meta{title}] with no surprise is the chapter title that
+% is printed in its opening page. It defines also the default
+% \meta{toc entry} and therefore the \meta{headings entry}.
+%
+%
+%\item[\meta{pagestyle}] solves a problem that arises more often
+% than not: by default the chapter opening page is typeset with
+% the |plain| page style; sometimes a different style is desired,
+% for example the |empty| one. The use can specify this optional
+% argument with |empty| to have a headerless opening page without
+% a printed folio. Actually the user can specify any page style,
+% provided it satisfies the typographical best practice.
+%
+%\end{description}
+% Actually the commands to typeset the Summary and the
% Acknowledgements chapters, as defined above, are regularly
% typeset in the front matter style, opening on any page
% (even or odd) and possibly numbered with small caps roman numerals.
% \begin{macrocode}
-\def\@chapter[#1]#2{\iffrontmatter\mainmatter\fi
- \ifnum \c@secnumdepth >\m@ne
- \refstepcounter{chapter}%
- \typeout{\@chapapp\space\thechapter.}%
- \addcontentsline{toc}{chapter}%
- {\protect\numberline{\thechapter}#1}%
- \else
- \addcontentsline{toc}{chapter}{#1}%
- \fi
- \chaptermark{#1}%
- \addtocontents{lof}{\protect\addvspace{10\p@}}%
- \addtocontents{lot}{\protect\addvspace{10\p@}}%
- \if@twocolumn
- \@topnewpage[\@makechapterhead{#2}]%
- \else
- \@makechapterhead{#2}%
- \@afterheading
- \fi}
-%
+\RenewDocumentCommand{\chapter}
+ {s O{#4} O{#2} m O{plain}}{%
+ \if@openright\cleardoublepage
+ \else\clearpage\fi
+ \thispagestyle{#5}%
+ \global\@topnum\z@
+ \@afterindentfalse
+\IfBooleanTF{#1}{%
+ \c@secnumdepth=-3\relax
+ \let\iftoc\iffalse
+}{%
+ \iffrontmatter\mainmatter\fi
+ \let\iftoc\iftrue
+}%
+% Numbering and TOC entry
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter % where \if@mainmatter is defined
+ % (e.g. book.cls, toptesi.cls)
+ \refstepcounter{chapter}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \iftoc\addcontentsline{toc}{chapter}{%
+ \protect\numberline{\thechapter}#2}\fi
+ \else %
+ \iftoc\addcontentsline{toc}{chapter}{#2}\fi
+ \fi
+ \else % Were \mainmatter is not defined (e.g.report.cls)
+ \iftoc\addcontentsline{toc}{chapter}{#2}\fi
+ \fi
+% Headers
+ \markboth{#3}{#3}% No \MakeUppercase
+ \iftoc
+ \addtocontents{lof}%
+ {\protect\addvspace{10\p@}}%
+ \addtocontents{lot}%
+ {\protect\addvspace{10\p@}}%
+ \fi
+% Actual title in the opening chapter page.
+ \if@twocolumn
+ \@topnewpage[\@makechapterhead{#4}]%
+ \else
+ \@makechapterhead{#4}%
+ \@afterheading
+ \fi
+}
+% \end{macrocode}
+% It would be possible to redefine in a similar manner also
+% the |\part| command, but it was deemed unnecessary, since
+% theses are seldom divided into parts.
+% \begin{macrocode}
\def\@part[#1]#2{\iffrontmatter\mainmatter\fi
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
@@ -3285,32 +3386,51 @@ School of Turin.
\fi
\Huge \bfseries #2\par}%
\@endpart}
+
% \end{macrocode}
% At the same time we have to make sure that |\tableofcontents|,
% |\listoftables| and |\listoffigures| do not exit from the
% front matter style. We assume these commands are issued
-% while in front matter, the default at the begin document step,
-% so we have to avoid to use starred |\chapter| commands.
+% while in front matter, the default at the begin document phase,
+% so we use starred |\chapter| commands but add the necessary
+% toc entries with the native commands. We need not define the
+% headers, because the default title is good for this purpose;
+% but since such thesis elements are typeset with the front
+% matter page style (|plain|), no headers are used; With long
+% indices and/or lists of tables and/or figures, the user might
+% desire to have headers, so that the declaration
+% |\pagestyle{headings}| should be specifies before using the
+% |\indici| or |\allcontents| commands.
+%
+% The table of contents itself is not linked at all, but in order
+% to link the lists of tables and figures, that are listed into
+% the toc, it is better that such lists contain a possible
+% target; the |\phantomsection| macro defined by the |hyperref|
+% package is used; in case |hyperref| is not loaded, a dummy
+% definition avoids “Undefined control sequence” error messages.
% \begin{macrocode}
\renewcommand\tableofcontents{%
\chapter*{\contentsname}%
- \@mkboth{\contentsname}{\contentsname}%
\@starttoc{toc}%
\clearpage
\if@restonecol\twocolumn\fi
}
+
+\providecommand\phantomsection{}% in case \hyperref was not loaded
+
\renewcommand\listoffigures{%
- \chapter*{\listfigurename}
- \@mkboth{\listfigurename}{\listfigurename}%
+ \phantomsection
+ \chapter*{\listfigurename}%
\addcontentsline{toc}{chapter}{\listfigurename}
\@starttoc{lof}%
\clearpage
\if@restonecol\twocolumn\fi
}
+
\renewcommand\listoftables{%
+ \phantomsection
\chapter*{\listtablename}%
\addcontentsline{toc}{chapter}{\listtablename}
- \@mkboth{\listtablename}{\listtablename}%
\@starttoc{lot}%
\clearpage
\if@restonecol\twocolumn\fi
@@ -3319,10 +3439,10 @@ School of Turin.
%
% We need to define |\indici| (alias |\allcontents|) that typesets
% the table of contents and, optionally, the lists of tables and/or
-% figures while assuring that the front matter style is used for
-% typesetting.
+% figures while softly maintaining the front matter style for
+% typesetting. In facts, if the user wants a diffferent styl s/he can select it with a suitable argument the |\pagestyle| command.
% \begin{macrocode}
-\def\indici{%
+\def\indici{% If headings are desired, the pagestyle must be set in advance
\iffrontmatter\else\frontmattertrue\fi
\tableofcontents
\iftablespage
@@ -3332,7 +3452,7 @@ School of Turin.
\listoftables
\let\addvspace=\saveaddvspace}
\fi
- \iffigurespage
+ \iffigurespage%
{\addvspace{10pt}
\let\saveaddvspace=\addvspace
\def\addvspace##1{}
@@ -3341,6 +3461,7 @@ School of Turin.
\fi
\ifbool{@twoside}{\cleardoublepage[empty]}{}}
\let\allcontents\indici
+
% \end{macrocode}
%
% Command |\onecolumn| is not actually necessary; it simply
@@ -4008,7 +4129,6 @@ School of Turin.
\usecounter{enumi}}
\else
\chapter*{\bibname}\relax
- \@mkboth{\bibname}{\bibname}\relax
\addcontentsline{toc}{chapter}{\bibname}\relax
\list{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}%
\leftmargin\labelwidth
@@ -8799,17 +8919,17 @@ Anno scolastico \@annoscolastico}}
\endinput
%%%%%% Recent progress
%%% (version 6.2.04 2018-05-05) With TeXLive 2018 diagnostic messages
-% on errors in the LaTeX kernel are more efficiente and some of them
+% on errors in the LaTeX kernel are more efficient and some of them
% were notified, while until 2017 no notice was issued. The source
% code was revised in order to eliminate those little nasty bugs.
%
%%% (version 6.2.01 2018-04-30) The main structure introduced with
% previous versions and their minor versions remains untouched,
-% but a neu option has been added in order to modify the bibliography
+% but a new option has been added in order to modify the bibliography
% style when typesetting theses for the PoliTO Doctoral School ScuDo.
% The specific module was developed having in mind theses in the
% scientific domains covered by the IEEE Transactions; of course
-% not all doctoral theses deal with thos domains, therefore the
+% not all doctoral theses deal with those domains, therefore the
% bibliography style should be changeable according to the styles
% used in other scientific domains.
%
@@ -8840,7 +8960,7 @@ Anno scolastico \@annoscolastico}}
%%%% (version 6.2.07 of 2018/11/12) Added checks in order to avoid loading
% an older toptesi.sty package compared to the toptesi.cls. It avoids
% any possible conflict with hacked toptesi.sty files, or even with
-% such obsolete versions, still going around in Internet, that date back
+% obsolete versions, still going around in Internet, that date back
% to the old times when the toptesi.cls file did not yet exist (versions
% 2.xxxx or older).
%%%% (version 6.2.09 of 2018/11/20) Loaded the filecontents package in oder
@@ -8849,7 +8969,14 @@ Anno scolastico \@annoscolastico}}
% profile compliance after the |pdfx| package has been upgraded to
% version 1.6.1 on 2018/12/22.
%%%% (version 6.3.00 of 2019-03-09) Modified the toptesi-magistrale.sty
-% module in order to have a working set of commands to properly set
-% the candidates' list heading in a proper way withe any number (<4)
-% of candidates of any sex; Previous to this wersion thi module did not
+% module in order to have a working set of commands to set
+% the candidates' list heading in a proper way with any number (<4)
+% of candidates of any sex; previous to this version this module did not
% accept the commands \CandidateNames and \TitoloListaCandidati.
+%%%% (version 6.3.05 of 2019-07-01) redefined the \chapter command,
+% and adapted the corresponding declarations and commands, to exploit
+% the new functionalities. Such new functionalities depend on the
+% package xparse new (may be not that new, but new for me) syntax
+% that allows to declare the optional argument descriptors so as to
+% inherit the values of other arguments.Such syntax avoids a lot of
+% fragile tests, and is very handy. \ No newline at end of file