summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/suftesi/suftesi.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/suftesi/suftesi.dtx')
-rw-r--r--macros/latex/contrib/suftesi/suftesi.dtx295
1 files changed, 158 insertions, 137 deletions
diff --git a/macros/latex/contrib/suftesi/suftesi.dtx b/macros/latex/contrib/suftesi/suftesi.dtx
index 2ded276ca5..02fec48f52 100644
--- a/macros/latex/contrib/suftesi/suftesi.dtx
+++ b/macros/latex/contrib/suftesi/suftesi.dtx
@@ -56,7 +56,7 @@ This work has the LPPL maintenance status "author-maintained".
%<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<class>\ProvidesClass{suftesi}
%<*class>
- [2021/06/05 v3.1.2 A class for typesetting theses, books and articles]
+ [2021/06/06 v3.1.3 A class for typesetting theses, books and articles]
%</class>
%<*driver>
\documentclass[12pt]{ltxdoc}
@@ -338,7 +338,7 @@ cochineal,mathpazo,bera,amsthm}
%</driver>
% \fi
%
-% \CheckSum{5683}
+% \CheckSum{5686}
%
% \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
@@ -356,6 +356,10 @@ cochineal,mathpazo,bera,amsthm}
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
+% \changes{v3.1.3}{2021/06/06}{Maintenance release.
+% Moved commands for breaking titles after \opt{titletoc} settings.
+% Corrected a bug in \cmd{maketitle} with the \opt{collection} structure.
+% Added \sty{etoolbox}, previously removed by mistake.}
% \changes{v3.1.2}{2021/06/05}{Corrected a bug with \opt{reverseauthortitle} option.}
% \changes{v3.1.1}{2021/05/23}{Redefined some boolean options. Renamed some private commands. Corrected a bug in headers numbering (\cmd{protect} removed). Disabled automatic partial ToC functionality. Improved \opt{fewfootnotes} option via \sty{zref}. Updated documentation.}
% \changes{v3.1.0}{2021/05/20}{Replaced \cmd{val}\cmd{nr} with \cmd{suftesi@val}\cmd{suftesi@nr}. Corrected a bug with \cmd{maketitle} in \opt{collection} structure. New options \opt{partialtoc} and \opt{maketitlestyle}. New commands for customizing the partial ToC. New value \opt{justify} for \opt{quotestyle} option. Improved \opt{quotesize} option. Renamed the \opt{revauthortitle} option to \opt{reverseauthortitle}. The options \opt{titlefont}, \opt{authorfont}, \opt{reverseauthortitle} now work for every structure. Renewed documentation}
@@ -457,7 +461,7 @@ cochineal,mathpazo,bera,amsthm}
% \DoNotIndex{\titlepage,\vss,\vtop,\xdef,\@gobbletwo,\color,\dimexpr}
% \DoNotIndex{\huge,\large,\makebox,\ProcessOptions,\renewcommand}
%
-%\nocite{appendix,caption,color,crop,enumitem,emptypage,fancyhdr,fixltxhyph,fontsize,mathalpha,libertinust1math,newtx,geometry,iftex,microtype,multicol,titlesec,titletoc,xkeyval,cclicenses,substitutefont,luatex85,lm,textcomp,newpx,biolinum,inconsolata,libertine,cochineal,mathpazo,bera,amsthm,zref}
+%\nocite{appendix,caption,color,crop,enumitem,emptypage,fancyhdr,fixltxhyph,fontsize,mathalpha,libertinust1math,newtx,geometry,iftex,microtype,multicol,titlesec,titletoc,xkeyval,cclicenses,substitutefont,luatex85,lm,textcomp,newpx,biolinum,inconsolata,libertine,cochineal,mathpazo,bera,amsthm,zref,etoolbox}
%
% \thispagestyle{empty}
%
@@ -610,7 +614,7 @@ cochineal,mathpazo,bera,amsthm}
% \toprule
% \multicolumn{2}{c}{\textbf{Context}} & \multicolumn{1}{c}{\textbf{Packages}} \\
% \midrule
-% & \textrm{Global} & appendix, caption, color, crop, enumitem, emptypage,
+% & \textrm{Global} & appendix, caption, color, crop, enumitem, emptypage, etoolbox,
% fancyhdr, fixltxhyph, fontenc, fontsize, geometry, iftex,
% microtype, multicol, titlesec, titletoc,
% xkeyval, cclicenses*, zref** \\
@@ -2437,7 +2441,6 @@ cochineal,mathpazo,bera,amsthm}
\def\SUF@chapswitch{}
\or
\suftesi@collectiontrue
- \SUF@titlepagefalse
\setkeys{}{headerstyle=authortitleinner}
\def\SUF@chapswitch{}
\fi}
@@ -3788,6 +3791,10 @@ cochineal,mathpazo,bera,amsthm}
\RequirePackage{luatex85}
\fi
% \end{macrocode}
+% The \sty{etoolbox} package is required to use \cmd{AtEndPreamble} (see \pageref{page:atendpreamble}).
+% \begin{macrocode}
+\RequirePackage{etoolbox}
+% \end{macrocode}
% The FSPL style requires a verbose colophon which uses specific icons:
% \begin{macrocode}
\ifsuftesi@FSPL
@@ -4015,7 +4022,7 @@ cochineal,mathpazo,bera,amsthm}
\fi
\fi
% \end{macrocode}
-%The following macro was created by Claudio Beccari. Some time later, Massimiliano Dominici suggested the use of \cmd{AtEndPreamble} instead of \cmd{AtBeginDocument}, to make the \env{otherlanguage} environment work.
+%The following macro was created by Claudio Beccari. Some time later, Massimiliano Dominici suggested the use of \cmd{AtEndPreamble} instead of \cmd{AtBeginDocument}, to make the \env{otherlanguage} environment work.\label{page:atendpreamble}
% \begin{macrocode}
\AtEndPreamble{
\substitutefont{LGR}{\rmdefault}{\SUF@greekfamily}
@@ -4406,46 +4413,6 @@ cochineal,mathpazo,bera,amsthm}
{\relax}}
\fi
% \end{macrocode}
-% \subsubsection{Commands for sections font}
-% \begin{macrocode}
-\newcommand{\partfont}[1]{\def\SUF@PART@font{#1}}
-\newcommand{\chapfont}[1]{\def\SUF@CHAP@font{#1}}
-\newcommand{\secfont}[1]{\def\SUF@SEC@font{#1}}
-\newcommand{\subsecfont}[1]{\def\SUF@SUBSEC@font{#1}}
-\newcommand{\subsubsecfont}[1]{\def\SUF@SUBSUBSEC@font{#1}}
-\newcommand{\partnumfont}[1]{\def\SUF@PART@font{#1}}\partnumfont{}
-\newcommand{\chapnumfont}[1]{\def\SUF@thechapter{#1}}
-\newcommand{\secnumfont}[1]{\def\SUF@thesection{#1}}
-\newcommand{\subsecnumfont}[1]{\def\SUF@thesubsection{#1}}
-\newcommand{\subsubsecnumfont}[1]{\def\SUF@thesubsubsection{#1}}
-\newcommand{\titlefont}[1]{\def\SUF@titlestyle{#1}\let\SUF@titlefont\relax}
-\newcommand{\authorfont}[1]{\def\SUF@authorstyle{#1}\let\SUF@authorfont\relax}
-\newcommand{\datefont}[1]{\def\SUF@datefont{#1}}
-% \end{macrocode}
-% \subsubsection{Commands for breaking titles}
-% Two commands for manual breaks active, respectively, only in the table of contents and in the body text. The solution was initially made available by Enrico Gregorio many years ago in one of the first versions of the class (at that time the commands were called \cmd{headbreak} and \cmd{xheadbreak}). Later, while I was working on version 3.0, I noticed an alignment problem in the chapter titles when using the \opt{chapstyle=left} option. So I added the \cmd{breakinbodyleft} command and updated the command names to make them more recognizable. Old names are in any case available for backwards compatibility.
-% \begin{macrocode}
-\newif\ifbreakintoc\breakintocfalse
-\newif\ifbreakinbody\breakinbodytrue
-\DeclareRobustCommand{\breakintoc}
- {\ifbreakintoc\\\else\fi}
-\DeclareRobustCommand{\breakinbody}
- {\ifbreakinbody\\\else\fi}
-\DeclareRobustCommand{\breakinbodyleft}
- {\ifbreakinbody\newline\else\fi}
-\let\origtableofcontents\tableofcontents
-\renewcommand{\tableofcontents}{%
- \begingroup
- \breakintoctrue\breakinbodyfalse%
- \origtableofcontents
- \endgroup}
-\DeclareRobustCommand{\headbreak}
- {\ifbreakintoc\\\else\fi}
-\DeclareRobustCommand{\xheadbreak}
- {\ifbreakinbody\\\else\fi}
-\DeclareRobustCommand{\yheadbreak}
- {\ifbreakinbody\newline\else\fi}
-% \end{macrocode}
% \subsubsection{Abstract}
% \begin{macrocode}
\ifsuftesi@collection
@@ -5241,33 +5208,7 @@ cochineal,mathpazo,bera,amsthm}
}
\fi
% \end{macrocode}
-% \subsubsection{Commands for sections font in ToC}
-% \begin{macrocode}
-\newcommand{\tocpartname}[1]{\def\SUF@tocpartname{#1}}
- \tocpartname{\partname}
-\newcommand{\tocpartfont}[1]{\def\SUF@tocPART@font{#1}}
-\newcommand{\tocchapfont}[1]{\def\SUF@tocCHAP@font{#1}}
-\newcommand{\tocsecfont}[1]{\def\SUF@tocSEC@font{#1}}
-\newcommand{\tocsubsecfont}[1]{\def\SUF@tocSUBSEC@font{#1}}
-\newcommand{\tocsubsubsecfont}[1]{\def\SUF@tocSUBSUBSEC@font{#1}}
-\newcommand{\tocparfont}[1]{\def\SUF@tocPAR@font{#1}}
-\newcommand{\tocsubparfont}[1]{\def\SUF@tocSUBPAR@font{#1}}
-\newcommand{\tocpartnumfont}[1]{\def\SUF@tocPARTnum@font{#1}}\tocpartnumfont{}
-\newcommand{\tocchapnumfont}[1]{%
- \def\SUF@CHAP@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
-\newcommand{\tocsecnumfont}[1]{%
- \def\SUF@SEC@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
-\newcommand{\tocsubsecnumfont}[1]{%
- \def\SUF@SUBSEC@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
-\newcommand{\tocsubsubsecnumfont}[1]{%
- \def\SUF@SUBSUBSEC@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
-\newcommand{\tocparnumfont}[1]{%
- \def\SUF@PAR@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
-\newcommand{\tocsubparnumfont}[1]{%
- \def\SUF@SUBPAR@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
-\tocparnumfont{}
-\tocsubparnumfont{}
-% \end{macrocode}
+% \subsection{Customizing entries}
% \subsubsection{The partial ToC}
% \begin{macrocode}
\newcommand{\partialtocsize}[1]{%
@@ -5316,6 +5257,73 @@ cochineal,mathpazo,bera,amsthm}
\partialtocbeforecode{}
\partialtocaftercode{}
% \end{macrocode}
+% \subsubsection{Sections font}
+% \begin{macrocode}
+\newcommand{\partfont}[1]{\def\SUF@PART@font{#1}}
+\newcommand{\chapfont}[1]{\def\SUF@CHAP@font{#1}}
+\newcommand{\secfont}[1]{\def\SUF@SEC@font{#1}}
+\newcommand{\subsecfont}[1]{\def\SUF@SUBSEC@font{#1}}
+\newcommand{\subsubsecfont}[1]{\def\SUF@SUBSUBSEC@font{#1}}
+\newcommand{\partnumfont}[1]{\def\SUF@PART@font{#1}}\partnumfont{}
+\newcommand{\chapnumfont}[1]{\def\SUF@thechapter{#1}}
+\newcommand{\secnumfont}[1]{\def\SUF@thesection{#1}}
+\newcommand{\subsecnumfont}[1]{\def\SUF@thesubsection{#1}}
+\newcommand{\subsubsecnumfont}[1]{\def\SUF@thesubsubsection{#1}}
+\newcommand{\titlefont}[1]{\def\SUF@titlestyle{#1}\let\SUF@titlefont\relax}
+\newcommand{\authorfont}[1]{\def\SUF@authorstyle{#1}\let\SUF@authorfont\relax}
+\newcommand{\datefont}[1]{\def\SUF@datefont{#1}}
+% \end{macrocode}
+% \subsubsection{Sections font in ToC}
+% \begin{macrocode}
+\newcommand{\tocpartname}[1]{\def\SUF@tocpartname{#1}}
+ \tocpartname{\partname}
+\newcommand{\tocpartfont}[1]{\def\SUF@tocPART@font{#1}}
+\newcommand{\tocchapfont}[1]{\def\SUF@tocCHAP@font{#1}}
+\newcommand{\tocsecfont}[1]{\def\SUF@tocSEC@font{#1}}
+\newcommand{\tocsubsecfont}[1]{\def\SUF@tocSUBSEC@font{#1}}
+\newcommand{\tocsubsubsecfont}[1]{\def\SUF@tocSUBSUBSEC@font{#1}}
+\newcommand{\tocparfont}[1]{\def\SUF@tocPAR@font{#1}}
+\newcommand{\tocsubparfont}[1]{\def\SUF@tocSUBPAR@font{#1}}
+\newcommand{\tocpartnumfont}[1]{\def\SUF@tocPARTnum@font{#1}}\tocpartnumfont{}
+\newcommand{\tocchapnumfont}[1]{%
+ \def\SUF@CHAP@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
+\newcommand{\tocsecnumfont}[1]{%
+ \def\SUF@SEC@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
+\newcommand{\tocsubsecnumfont}[1]{%
+ \def\SUF@SUBSEC@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
+\newcommand{\tocsubsubsecnumfont}[1]{%
+ \def\SUF@SUBSUBSEC@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
+\newcommand{\tocparnumfont}[1]{%
+ \def\SUF@PAR@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
+\newcommand{\tocsubparnumfont}[1]{%
+ \def\SUF@SUBPAR@contentslabel{\begingroup#1\thecontentslabel\endgroup}}
+\tocparnumfont{}
+\tocsubparnumfont{}
+% \end{macrocode}
+% \subsubsection{Breaking titles}
+% Two commands for manual breaks active, respectively, only in the table of contents and in the body text. The solution was initially made available by Enrico Gregorio many years ago in one of the first versions of the class (at that time the commands were called \cmd{headbreak} and \cmd{xheadbreak}). Later, while I was working on version 3.0, I noticed an alignment problem in the chapter titles when using the \opt{chapstyle=left} option. So I added the \cmd{breakinbodyleft} command and updated the command names to make them more recognizable. Old names are in any case available for backwards compatibility.
+% \begin{macrocode}
+\newif\ifbreakintoc\breakintocfalse
+\newif\ifbreakinbody\breakinbodytrue
+\DeclareRobustCommand{\breakintoc}
+ {\ifbreakintoc\\\else\fi}
+\DeclareRobustCommand{\breakinbody}
+ {\ifbreakinbody\\\else\fi}
+\DeclareRobustCommand{\breakinbodyleft}
+ {\ifbreakinbody\newline\else\fi}
+\let\origtableofcontents\tableofcontents
+\renewcommand{\tableofcontents}{%
+ \begingroup
+ \breakintoctrue\breakinbodyfalse%
+ \origtableofcontents
+ \endgroup}
+\DeclareRobustCommand{\headbreak}
+ {\ifbreakintoc\\\else\fi}
+\DeclareRobustCommand{\xheadbreak}
+ {\ifbreakinbody\\\else\fi}
+\DeclareRobustCommand{\yheadbreak}
+ {\ifbreakinbody\newline\else\fi}
+% \end{macrocode}
% \subsection{Headers and footers}
% \begin{macrocode}
\RequirePackage{fancyhdr}
@@ -5570,69 +5578,6 @@ cochineal,mathpazo,bera,amsthm}
\penalty\@highpenalty
\endgroup
\fi}
-\renewcommand\maketitle{\par
- \begingroup
- \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
- \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
- \long\def\@makefntext##1{\parindent 1em\noindent
- \hb@xt@1.8em{%
- \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
- \if@twocolumn
- \ifnum \col@number=\@ne
- \@maketitle
- \else
- \twocolumn[\@maketitle]%
- \fi
- \else
- \newpage
- \global\@topnum\z@ % Prevents figures from going at top of page.
- \@maketitle
- \fi
- \thispagestyle{plain}\@thanks%
- \endgroup
- \setcounter{section}{0}%
-% \setcounter{footnote}{0}%
-% \global\let\thanks\relax
-% \global\let\maketitle\relax
-% \global\let\@maketitle\relax
-% \global\let\@thanks\@empty
-% \global\let\@author\@empty
-% \global\let\@date\@empty
-% \global\let\@title\@empty
-% \global\let\title\relax
-% \global\let\author\relax
-% \global\let\date\relax
- \global\let\and\relax
- \let\thanks\@gobble}
-\AtBeginDocument{\def\@maketitle{%
- \refstepcounter{article}
- \SUF@chaptersize
- \SUF@authortitle@align
- \let\footnote\thanks
- \parindent=0pt
- {\SUF@second\par}%
- \label{begin:\thearticle}
-% \end{macrocode}
-% Check if you don't use \sty{hyperrref} provided by Enrico Gregorio
-% (\url{https://tex.stackexchange.com/a/427203/231952}):
-% \begin{macrocode}
- \@ifundefined{Hy@raisedlink}{\let\texorpdfstring\@firstoftwo}{%
- \xdef\@currentHref{title.\thearticle}%
- \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
- }%
-% \end{macrocode}
-% \begin{macrocode}
- \csname toc@entry@\endcsname
- \begingroup%
- \let\thanks\@gobble
- \addcontentsline{toc}{title}{%
- {\SUF@tocAUT@font{\@author}}\texorpdfstring{\newline}{, }%
- {\SUF@tocTIT@font{\@headtitle}}}
- \endgroup%
- \par\nobreak\vspace{2ex}
- {\SUF@first\par%
- \vskip1.5cm}}%
- }
% \newenvironment{article}
% {\begingroup
% \global\let\@thanks\@empty
@@ -5717,6 +5662,71 @@ cochineal,mathpazo,bera,amsthm}
\protect\ClassWarningNoLine{suftesi}{%
No \string\author\space given\MessageBreak%
See the class documentation for explanation}}
+\ifsuftesi@collection
+\renewcommand\maketitle{\par
+ \begingroup
+ \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
+ \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
+ \long\def\@makefntext##1{\parindent 1em\noindent
+ \hb@xt@1.8em{%
+ \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+ \if@twocolumn
+ \ifnum \col@number=\@ne
+ \@maketitle
+ \else
+ \twocolumn[\@maketitle]%
+ \fi
+ \else
+ \newpage
+ \global\@topnum\z@ % Prevents figures from going at top of page.
+ \@maketitle
+ \fi
+ \thispagestyle{plain}\@thanks%
+ \endgroup
+ \setcounter{section}{0}%
+% \setcounter{footnote}{0}%
+% \global\let\thanks\relax
+% \global\let\maketitle\relax
+% \global\let\@maketitle\relax
+% \global\let\@thanks\@empty
+% \global\let\@author\@empty
+% \global\let\@date\@empty
+% \global\let\@title\@empty
+% \global\let\title\relax
+% \global\let\author\relax
+% \global\let\date\relax
+ \global\let\and\relax
+ \let\thanks\@gobble}
+\AtBeginDocument{\def\@maketitle{%
+ \refstepcounter{article}
+ \SUF@chaptersize
+ \SUF@authortitle@align
+ \let\footnote\thanks
+ \parindent=0pt
+ {\SUF@second\par}%
+ \label{begin:\thearticle}
+% \end{macrocode}
+% Check if you don't use \sty{hyperrref} provided by Enrico Gregorio
+% (\url{https://tex.stackexchange.com/a/427203/231952}):
+% \begin{macrocode}
+ \@ifundefined{Hy@raisedlink}{\let\texorpdfstring\@firstoftwo}{%
+ \xdef\@currentHref{title.\thearticle}%
+ \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
+ }%
+% \end{macrocode}
+% \begin{macrocode}
+ \csname toc@entry@\endcsname
+ \begingroup%
+ \let\thanks\@gobble
+ \addcontentsline{toc}{title}{%
+ {\SUF@tocAUT@font{\@author}}\texorpdfstring{\newline}{, }%
+ {\SUF@tocTIT@font{\@headtitle}}}
+ \endgroup%
+ \par\nobreak\vspace{2ex}
+ {\SUF@first\par%
+ \vskip1.5cm}}%
+ }
+\else
\ifSUF@titlepage
\renewcommand\maketitle{%
\begin{titlepage}
@@ -5788,6 +5798,7 @@ cochineal,mathpazo,bera,amsthm}
\end{center}%
\par
\vskip 1.5em}
+ \fi
\fi
% \end{macrocode}
% \subsection{Cover page}
@@ -5935,7 +5946,7 @@ cochineal,mathpazo,bera,amsthm}
\fi\fi\fi\fi\fi\fi\fi\fi\fi}
{\relax}}}
% \end{macrocode}
-% \paragraph{Colophon or copyright notice}
+% \subsection{Colophon}
% \begin{macrocode}
\newcommand{\colophon}[3][]{%
\thispagestyle{empty}
@@ -6572,6 +6583,16 @@ Janusz M.~Nowacki.
version = {v1.5e}
}
+@manual{etoolbox,
+ title = {The \sty{etoolbox} package},
+ subtitle = {An e-\TeX Toolbox for Class and Package Authors},
+ author = {Philipp Lehman and Joseph Wright},
+ url = {http://www.ctan.org/pkg/etoolbox},
+ urldate = {2021-06-06},
+ date = {2020-10-05},
+ version = {v2.5k}
+}
+
%</bib>
% \fi
% \Finale