From 6385395b92eec56d518f264568394f0865bbae58 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 22 Dec 2020 03:02:03 +0000 Subject: CTAN sync 202012220302 --- macros/latex/contrib/fontsize/fontsize.dtx | 247 +- macros/latex/contrib/fontsize/fontsize.pdf | Bin 284372 -> 327782 bytes macros/latex/contrib/pygmentex/demo.c | 22 - macros/latex/contrib/pygmentex/demo.delphi | 8 - macros/latex/contrib/pygmentex/demo.hs | 7 - macros/latex/contrib/pygmentex/demo.java | 68 - macros/latex/contrib/pygmentex/demo.pas | 7 - macros/latex/contrib/pygmentex/demo.pdf | Bin 592365 -> 0 bytes macros/latex/contrib/pygmentex/demo.py | 10 - macros/latex/contrib/pygmentex/demo.tex | 852 ------- macros/latex/contrib/pygmentex/pygmentex.py | 83 +- macros/latex/contrib/pygmentex/pygmentex.sty | 12 +- macros/latex/contrib/pygmentex/pygmentex_demo.c | 22 + .../latex/contrib/pygmentex/pygmentex_demo.delphi | 8 + macros/latex/contrib/pygmentex/pygmentex_demo.hs | 7 + macros/latex/contrib/pygmentex/pygmentex_demo.java | 68 + macros/latex/contrib/pygmentex/pygmentex_demo.pas | 7 + macros/latex/contrib/pygmentex/pygmentex_demo.pdf | Bin 0 -> 585220 bytes macros/latex/contrib/pygmentex/pygmentex_demo.py | 10 + macros/latex/contrib/pygmentex/pygmentex_demo.tex | 861 +++++++ macros/latex/contrib/suftesi/suftesi.dtx | 2463 ++++++++++---------- macros/latex/contrib/suftesi/suftesi.pdf | Bin 777127 -> 793785 bytes 22 files changed, 2416 insertions(+), 2346 deletions(-) delete mode 100644 macros/latex/contrib/pygmentex/demo.c delete mode 100644 macros/latex/contrib/pygmentex/demo.delphi delete mode 100644 macros/latex/contrib/pygmentex/demo.hs delete mode 100644 macros/latex/contrib/pygmentex/demo.java delete mode 100644 macros/latex/contrib/pygmentex/demo.pas delete mode 100644 macros/latex/contrib/pygmentex/demo.pdf delete mode 100644 macros/latex/contrib/pygmentex/demo.py delete mode 100644 macros/latex/contrib/pygmentex/demo.tex create mode 100644 macros/latex/contrib/pygmentex/pygmentex_demo.c create mode 100644 macros/latex/contrib/pygmentex/pygmentex_demo.delphi create mode 100644 macros/latex/contrib/pygmentex/pygmentex_demo.hs create mode 100644 macros/latex/contrib/pygmentex/pygmentex_demo.java create mode 100644 macros/latex/contrib/pygmentex/pygmentex_demo.pas create mode 100644 macros/latex/contrib/pygmentex/pygmentex_demo.pdf create mode 100644 macros/latex/contrib/pygmentex/pygmentex_demo.py create mode 100644 macros/latex/contrib/pygmentex/pygmentex_demo.tex (limited to 'macros/latex/contrib') diff --git a/macros/latex/contrib/fontsize/fontsize.dtx b/macros/latex/contrib/fontsize/fontsize.dtx index 973ee3fe69..da294bb6fe 100644 --- a/macros/latex/contrib/fontsize/fontsize.dtx +++ b/macros/latex/contrib/fontsize/fontsize.dtx @@ -5,7 +5,7 @@ \preamble The 'fontsize' package -Copyright (C) 2009-2020 Ivan Valbusa +Copyright (C) 2020 Ivan Valbusa All rights reserved. @@ -26,9 +26,11 @@ This work has the LPPL maintenance status "author-maintained". \keepsilent \askforoverwritefalse -\Msg{*** Generating the package files ***} +\Msg{*** Generating the package file ***} \generate{ - \file{fontsize.sty}{\from{fontsize.dtx}{package}}} + \file{fontsize.sty}{\from{fontsize.dtx}{package}} + \nopreamble\nopostamble + \file{fontsize.bib}{\from{fontsize.dtx}{bib}}} \Msg{***********************************************************} \Msg{*} @@ -54,13 +56,14 @@ This work has the LPPL maintenance status "author-maintained". %\NeedsTeXFormat{LaTeX2e}[2005/12/01] %\ProvidesPackage{fontsize} %<*package> - [2020/05/24 v0.2 'fontsize' package. Set main font sizes (Ivan Valbusa)] + [2020/12/19 v0.3 'fontsize' package. Set main font sizes (Ivan Valbusa)] % %<*driver> \documentclass[12pt]{ltxdoc} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} -\usepackage[fontsize=12pt]{fontsize} +\usepackage[fontsize=11.7pt]{fontsize} +\usepackage{array,booktabs,siunitx} %-------------------------------------------------------- % GRAPHICS %-------------------------------------------------------- @@ -108,6 +111,12 @@ This work has the LPPL maintenance status "author-maintained". heightrounded} \usepackage{sectsty} \allsectionsfont{\sffamily} +% -------------------------------------------------------- +% OTHER PACKAGES +% -------------------------------------------------------- +\usepackage[autostyle]{csquotes} +\usepackage[style=philosophy-classic]{biblatex} +\addbibresource{fontsize.bib} %-------------------------------------------------------- % COMMANDS AND ENVIRONMENTS %-------------------------------------------------------- @@ -126,25 +135,14 @@ This work has the LPPL maintenance status "author-maintained". \newenvironment{ttquote}{% \begin{mdframed}\ttfamily\microtypesetup{activate=false}}{\end{mdframed}} \newenvironment{latexcode}{\begin{mdframed}}{\end{mdframed}} -% Correct (?) \optitem to use \meta inside #2 \makeatletter -\renewcommand*{\ltd@ol@optitem}[3][]{% - \ifblank{#1} - {\ltd@option{}{#2}{#3}{}} - {\ltd@option{}{#2}{#3}{\ltd@textverb{#1}}}}% -\renewenvironment*{valuelist}[1][] -{\list{}{% - \ifblank{#1} - {\setlength{\labelwidth}{5em}} - {\setlength{\labelwidth}{#1}}% - \setlength{\labelsep}{1em}% - \setlength{\leftmargin}{\labelwidth}% - \addtolength{\leftmargin}{\labelsep}% - \setlength{\itemsep}{0pt}% - \renewcommand*{\makelabel}[1]{\valuelistfont##1\hss}}} -{\endlist} -\newcommand*{\valuelistfont}{% - \color{olive}\sffamily\displayverbfont} +% Customizing option and value list: +\patchcmd{\optionlist}{\marglistwidth}{0pt}{}{} +\patchcmd{\optionlist}{\hss}{\phantom{\rule{1pt}{20pt}}\hss}{}{} +\patchcmd{\ltd@option@i}{\linewidth}{\linewidth-\marglistwidth}{}{} +\patchcmd{\ltxsyntax}{\marglistwidth}{0pt}{}{} +\patchcmd{\ltd@option@i}{=}{\ = }{}{} +% New color for items \renewcommand*{\optionlistfont}{% \color{philA}\sffamily\displayverbfont} \renewcommand*{\ltxsyntaxlabelfont}{% @@ -172,19 +170,13 @@ This work has the LPPL maintenance status "author-maintained". \sffamily\bfseries#1\par}} \def\eaddition{% \emph{\ldots addition ends}]\medskip} - -\def\bexcerpt#1{% - \medskip{[\emph{excerpt from \file{#1} begins}\par\medskip}} -\def\eexcerpt#1{% - \emph{\ldots excerpt from \file{#1} ends}]\medskip} - % -------------------------------------------------------- % HYPERREF SETUP % -------------------------------------------------------- \usepackage{hyperref} \hypersetup{% hidelinks, - pdftitle={User's Guide to \textsf{fontsize}}, + pdftitle={User's guide to \textsf{fontsize}}, pdfsubject={A small package to change the font size}, pdfauthor={Ivan Valbusa}, pdfkeywords={latex, fonts}} @@ -201,7 +193,7 @@ This work has the LPPL maintenance status "author-maintained". % % \fi % -% \CheckSum{1727} +% \CheckSum{1774} % % \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 @@ -219,6 +211,8 @@ This work has the LPPL maintenance status "author-maintained". % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % +% +% \changes{v0.3}{2020/12/19}{Added definitions of some lengths omitted from Koma files: \cmd{smallskiamount}, \cmd{medskiamount}, \cmd{bigskiamount}. Redefined \cmd{parindent} and \cmd{headheight}.} % \changes{v0.2}{2020/05/24}{Updated documentation and code comments.} % \changes{v0.1}{2020/02/20}{First public release} % \GetFileInfo{fontsize.dtx} @@ -294,7 +288,7 @@ This work has the LPPL maintenance status "author-maintained". % % \begin{center} % {\color{philA}\bfseries\sffamily -% \Huge User's Guide to \texttt{fontsize}\\[3mm]} +% \huge User's guide to \texttt{fontsize}\\[3mm]} % {\large\bfseries\sffamily A small package to change the font size} % \vspace{.8cm} % @@ -318,8 +312,8 @@ This work has the LPPL maintenance status "author-maintained". %^^A--------------------------------------------------------------------- % % The code is an excerpt of the \sty{scrextend} and -% \sty{scrfontsizes} packages (see \cite{koma}), with few minor -% changes to make it completely independent of the Koma bundle and with a couple of new features. +% \sty{scrfontsizes} packages \parencite{koma}, with few minor +% changes to make it completely independent of the Koma bundle and with a couple of new features. The package is updated to version |3390 2019-11-18 17:09:35Z| of the \file{scrkernel-fonts.dtx} file. % %^^A--------------------------------------------------------------------- % \section*{Caveat} @@ -328,8 +322,7 @@ This work has the LPPL maintenance status "author-maintained". % Although effective with any value for the \meta{fontsize} (as long as the font % is scalable!), the package is meant for small font size changes. % For truly optimal results you should (re)define your own \file{.clo} file. -% Indeed note that the file generated with \cmd{generateclofile}, as well as the macros redefined via \cmd{changefontsize}, are a subset of the standard \file{bk11.clo} file and some lengths such as \cmd{smallskipamount}, \cmd{medskipamount}, \cmd{bigskipamount}, \cmd{headsep} are not defined by the package. Up to now! -% \enlargethispage{1\baselineskip} +% Indeed note that the file generated with \cmd{generateclofile}, as well as the macros redefined via \cmd{changefontsize}, are a subset of the standard \file{clo} files. %^^A--------------------------------------------------------------------- % \section{Usage} %^^A--------------------------------------------------------------------- @@ -338,6 +331,9 @@ This work has the LPPL maintenance status "author-maintained". % \begin{ttquote} % \noindent\cmd{usepackage}\oarg{options}|{fontsize}| % \end{ttquote} +% +%^^A The \sty{geometry} package and the settings to change the page layout +%^^A must follow \sty{fontsize} to avoid errors in the layout % %^^A--------------------------------------------------------------------- % \subsection{Options} @@ -385,7 +381,7 @@ This work has the LPPL maintenance status "author-maintained". % % \cmditem{generateclofile}{name}[baselineskip]{fontsize} \hfill iff \meta{baselineskip} $\geq$\meta{fontsize} % -% Generates a file named \file{\meta{name}\meta{fontsize}.clo} in which the normal line spacing is \meta{baselineskip} and the other sizes and line spacings are adjusted consistently. If \opt{cloname=\meta{name}} \textit{and} \opt{fontsize=\meta{fontsize}} the generated file will be automatically use to setup the main font sizes. You can use any unit recognized by TeX and you can omit the unit as well. +% Generates a file named \file{\meta{name}\meta{fontsize}.clo} in which the normal line spacing is \meta{baselineskip} and the other sizes and line spacings are adjusted consistently. If \opt{cloname=\meta{name}} \textit{and} \opt{fontsize=\meta{fontsize}} the generated file will be automatically used to setup the main font sizes (it requires two runs). You can use any unit recognized by TeX and you can omit the unit as well. % % \emph{In fact this file is only needed if you intend to modify it. In this case remember to comment the command, otherwise the edited file will be overwrittern}.\bigskip % @@ -441,34 +437,19 @@ This work has the LPPL maintenance status "author-maintained". % \begin{mdframed}[linecolor=black,backgroundcolor=none] % \printfontsize[13]{11} % \end{mdframed} +% \nocite{xkeyval,etoolbox} % -% \begin{thebibliography}{label} -% \bibitem{koma} Frank Neukam, Markus Kohm, Axel Kielhorn, -% \textit{KOMA -- Script. A versatile \LaTeXe{} bundle}. -% \url{https://www.ctan.org/pkg/koma-script} -% \bibitem{xkeyval} Hendri Adriaens, \textit{The \sty{xkeyval} package}, -% \url{https://www.ctan.org/pkg/xkeyval}. -% \bibitem{etoolbox} Philipp Lehman, Joseph Wright, -% \textit{The \sty{etoolbox} Package. An e-\TeX{} Toolbox for Class -% and Package Authors}, \url{https://www.ctan.org/pkg/etoolbox}. -% \end{thebibliography} +% \StopEventually{% +% \printbibliography[heading=bibintoc] +% \PrintChanges\PrintIndex} % -% \StopEventually{\PrintChanges\PrintIndex} -% -%\newgeometry{ -% a4paper, -% margin=3cm, -% left=4cm, -% headheight=15pt, -% ignoreall, -% heightrounded} +% \iffalse +%<*package> +% \fi %^^A--------------------------------------------------------------------- % \section{The Code} %^^A--------------------------------------------------------------------- % -% \iffalse -%<*package> -% \fi % The options of the package are defined via \sty{xkeyval}, while \sty{etoolbox} % is required to execute \cmd{AtEndOfPackage}. It is probably not necessary but for the moment I prefer to take advantage of it. % \begin{macrocode} @@ -481,7 +462,7 @@ This work has the LPPL maintenance status "author-maintained". % \end{macrocode} % \eaddition % -% \bexcerpt{scrextend.sty} +% \subsection*{Excerpt from \file{scrextend.sty}} % % Here the \sty{scrextend} code begins. Only a few names have been changed. % The value of \cmd{|@|fontsizefilebase} is set to \texttt{custom} instead of \texttt{scrsize}. @@ -519,7 +500,7 @@ This work has the LPPL maintenance status "author-maintained". \ProcessOptionsX*\relax % \end{macrocode} % \eaddition -% \begin{macro}{\ctm@setlength} +% % The comamnd \cmd{ctm@setlength} is simply a new name for \cmd{scr@setlength} of \file{scrextend}. % \begin{macrocode} \newcommand*\ctm@setlength[4]{% @@ -554,8 +535,6 @@ This work has the LPPL maintenance status "author-maintained". \fi } % \end{macrocode} -% \end{macro} -% \begin{macro}{\changefontsize} % The comamnd \cmd{changefontsize} is simply a new name for \cmd{changefontsizes} of \file{scrextend}. % \begin{macrocode} \providecommand*{\changefontsize}[2][1.2\@tempdima]{% @@ -568,15 +547,6 @@ This work has the LPPL maintenance status "author-maintained". \edef\@tempb{\the\@tempdimc}% \setlength{\@tempdimc}{\@tempdima}% \def\@tempa##1##2##3##4##5\@nnil{\def##1{##2.##3##4}}% -% \end{macrocode} -% \baddition{New lengths} -% The Koma code does not define \cmd{parindent} and other lengths related to the page dimensions (\cmd{textheight}, \cmd{headheight}, \cmd{headsep}, etc.) Anyway I think that some of these lengths are strictly linked to the font rather than to the page and text dimensions. Particularly \cmd{parindent} and \cmd{headheight} (the value of the last one could cause a well known warning if \sty{fancyhdr} is loaded). The default value of \cmd{parindent} is \cmd{baselineskip} and the value of \cmd{headheight} is set normal size plus 2.5\,pt. -% \begin{macrocode} -\setlength\parindent{\the\@tempdimb} -\setlength\headheight{\dimexpr(\@tempdima+2.5pt)} -% \end{macrocode} -% \eaddition -% \begin{macrocode} \expandafter\@tempa\expandafter\@tempb\@tempb\@nnil% \ctm@setlength{\abovedisplayskip}% {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}% @@ -669,7 +639,42 @@ This work has the LPPL maintenance status "author-maintained". \noexpand\@setfontsize\noexpand\Huge {\the\@tempdima}{\the\@tempdimb}% }% - \normalsize + \normalsize% +% \end{macrocode} +% \baddition{New lengths} +% The Koma code does not define \cmd{parindent} and other lengths related to the page dimensions (\cmd{textheight}, \cmd{headheight}, \cmd{headsep}, etc.) Anyway I think that some of these lengths are strictly linked to the font rather than to the page and text dimensions. Particularly \cmd{headheight}, whose value may cause a well known warning if \sty{fancyhdr} is loaded. +% \begin{macrocode} +\setlength\parindent{\f@size pt}% +\setlength\headheight{\dimexpr(\f@size pt+2pt)}% +% \end{macrocode} +% In the following lengths, all values are calculated proportionally to the main font. I took the \file{bk11.clo} file as a reference point. Note that the differences of these lengths in the files \file{bk10.clo} \file{bk11.clo} and \file{bk12.clo} only affect \cmd{headsep}, \cmd{topskip} and \cmd{footskip}, which are not redefined here. +% \begin{macrocode} +\setlength\smallskipamount{\dimexpr((\f@size pt+1pt)/4) \@plus 1\p@ \@minus 1\p@}% +\setlength\medskipamount{\dimexpr((\f@size pt+1pt)/2) \@plus 2\p@ \@minus 2\p@}% +\setlength\bigskipamount{\dimexpr(\f@size pt+1pt) \@plus 4\p@ \@minus 4\p@}% +% \end{macrocode} +% The following table shows the values of some specific lengths +% defined by the pacakge, relative to some significant settings +% of the main font and line spacing. The values are exressed in pt +% and rounded to the second decimal place. +% +% \begin{small} +% \newcolumntype{Y}{@{}S[table-column-width=1.04cm]} \begin{tabular}{@{}m{4cm}YYYYYYYYYYY@{}} +% \toprule +% Main font size & 10 & 10.1 & 10.2 & 10.3 & 10.4 & 10.5 & 10.6 & 10.7 & 10.8 & 10.9 & 11\\ +% Line spacing & 12 & 12.1 & 12.2 & 12.3 & 12.4 & 12.5 & 12.6 & 12.7 & 12.8 & 12.9 & 11\\ +% \midrule +% \cmd{headheight} &12 &12.1 &12.2 &12.3 &12.4 &12.5 &12.6 &12.7 &12.8 &12.9 &13\\ +% \cmd{parindent} &10 &10.1 &10.2 &10.3 &10.4 &10.5 &10.6 &10.7 &10.8 &10.9 &11\\ +% \cmd{bigskipamount}\ \hfill$\pm$\SI{4}{pt} &11 &11.1 &11.2 &11.3 &11.4 &11.5 &11.6 &11.7 &11.8 &11.9 &12\\ +% \cmd{medskipamount}\ \hfill$\pm$\SI{2}{pt} &5.5 &5.55 &5.6 &5.65 &5.7 &5.75 &5.8 &5.85 &5.9 &5.95 &6\\ +% \cmd{smallskipamount}\ \hfill$\pm$\SI{1}{pt} &2.75 &2.78 &2.8 &2.82 &2.85 &2.88 &2.9 &2.93 &2.95 &2.98 &3\\ +% \bottomrule +% \end{tabular} +% \end{small} +% +% \eaddition +% \begin{macrocode} \setlength{\@tempdimb}{\f@baselineskip}% \ctm@setlength{\parsep}% {.3333\@tempdimb}{.1667\@tempdimb}{.0833\@tempdimb}% @@ -797,13 +802,9 @@ This work has the LPPL maintenance status "author-maintained". \ctm@setlength{\partopsep}{.2\@tempdimb}{.1\@tempdimb}{.1\@tempdimb}% } % \end{macrocode} -% \end{macro} -% -% \eexcerpt{scrextend.sty} % -% \bexcerpt{scrfontsizes.sty} +% \subsection*{Excerpt from \file{scrfontsizes.sty}} % -% \begin{macro}{\generateclofile} % Here is a portion of the \sty{scrfontsizes} package. It simply provides the \cmd{generateclofile} command, without the Koma-related definitions. There are no reserved names for the \file{.clo} files. The command name is a new name for the Koma \cmd{generatefontfile}. In fact, what the command generates, is a \file{.clo} file. % \begin{macrocode} \newcommand*{\generateclofile}[1]{% @@ -813,15 +814,16 @@ This work has the LPPL maintenance status "author-maintained". \def\@generatefontfile#1[#2]#3{% \begingroup % \end{macrocode} -% Here we use |[#2]| in place of |[{#2}]| of the -% \sty{scrfontsizes} code. +% At least starting with version 3.31 of the \sty{scrfontsizes} package the code of the \cmd{@generatefontfile} and \cmd{@@generatefontfile} commands sets the \cmd{parskip} value to |0pt|. We also use \cmd{changefontsize}|[#2]{#3}| in place of \cmd{changefontsize}|[{#2}]{#3}| of the \sty{scrfontsizes} code. % \begin{macrocode} + \setlength{\parskip}{0pt}% \changefontsize[#2]{#3}% \generate@fontfile{#1}{#3}% \endgroup } \newcommand\@@generatefontfile[2]{% \begingroup + \setlength{\parskip}{0pt}% \changefontsize{#2}% \generate@fontfile{#1}{#2}% \endgroup @@ -834,6 +836,11 @@ This work has the LPPL maintenance status "author-maintained". \immediate\openout\@fontfile #1#2.clo \immediate\write\@fontfile{\@percentchar^^J% \@percentchar\space This is file `#1#2.clo', generated with^^J% +% \end{macrocode} +% In the next three lines we only replace `scrfontsizes' with `fontsize' +% and `Markus Kohm' with `Ivan Valbusa', in order to get the correc informations +% in the .log file. +% \begin{macrocode} \@percentchar\space fontsize \csname ver@fontsize.\@pkgextension\endcsname,^^J% \@percentchar\space Copyright (c) Ivan Valbusa.^^J% @@ -841,16 +848,6 @@ This work has the LPPL maintenance status "author-maintained". \string\ProvidesFile{#1#2.clo}[% \the\year/\ifnum\month<10 0\fi\the\month/\ifnum\day<10 0\fi\the\day% \space generated font size class option (#2)]}% -% \end{macrocode} -% \baddition{New lengths in the \file{.clo} file.} -% \begin{macrocode} - \immediate\write\@fontfile{% - \string\setlength{\string\parindent}{\f@baselineskip}^^J% - \string\setlength{\string\headheight}{\dimexpr(\f@size+2.5pt)}^^J% - }% -% \end{macrocode} -% \eaddition -% \begin{macrocode} \immediate\write\@fontfile{% \string\def\string\normalsize{\@percentchar^^J% \@ind\string\@setfontsize\string\normalsize{\f@size}{\f@baselineskip}% @@ -948,6 +945,22 @@ This work has the LPPL maintenance status "author-maintained". }% \endgroup \immediate\write\@fontfile{\string\normalsize}% +% \end{macrocode} +% \baddition{New lengths in the \file{.clo} file.} +% The new lengths previously defined are recalled here and written in the .clo file. +% \begin{macrocode} +\begingroup +\immediate\write\@fontfile{% + \string\setlength{\string\parindent}{\the\parindent}^^J% + \string\setlength{\string\headheight}{\the\headheight}^^J% + \string\setlength{\string\smallskipamount}{\the\smallskipamount}^^J% + \string\setlength{\string\medskipamount}{\the\medskipamount}^^J% + \string\setlength{\string\bigskipamount}{\the\bigskipamount}^^J% +}% +\endgroup +% \end{macrocode} +% \eaddition +% \begin{macrocode} \immediate\write\@fontfile{% \string\setlength{\string\footnotesep}{\the\footnotesep}\@percentchar }% @@ -1086,9 +1099,6 @@ This work has the LPPL maintenance status "author-maintained". } \@onlypreamble\generateclofile % \end{macrocode} -% \end{macro} -% -% \eexcerpt{scrfontsizes.sty} % % \baddition{New commands} % We will now define some internal commands to test the package functions. @@ -1108,25 +1118,52 @@ This work has the LPPL maintenance status "author-maintained". \paragraph*{\csname #1\endcsname \texttt{\fsbslash #1} \textmd{\f@size pt on \the\baselineskip}\\} \noindent\bgroup\raggedright\csname #1\endcsname\fs@extext\par\egroup} -% \end{macrocode} -% \begin{macro}{\printfontsize} -% \begin{macrocode} \newcommand{\printfontsize}[2][]{% \section*{Settings with \texttt{\fsbslash changefontsize[#1]\{#2\}}}% \changefontsize[#1]{#2} - \mysize{tiny}\mysize{scriptsize}\mysize{footnotesize} - \mysize{small}\mysize{normalsize}\mysize{large}\mysize{Large} - \mysize{LARGE}\mysize{huge}\mysize{Huge} + \mysize{tiny}\mysize{scriptsize}\mysize{footnotesize}\mysize{small} + \mysize{normalsize}\mysize{large}\mysize{Large}\mysize{LARGE} + \mysize{huge}\mysize{Huge} \mysizeex{tiny}\mysizeex{scriptsize}\mysizeex{footnotesize} - \mysizeex{small}\mysizeex{normalsize}\mysizeex{large} - \mysizeex{Large}\mysizeex{LARGE}\mysizeex{huge}\mysizeex{Huge}} + \mysizeex{small}\mysizeex{normalsize}\mysizeex{large}\mysizeex{Large} + \mysizeex{LARGE}\mysizeex{huge}\mysizeex{Huge} +} % \end{macrocode} % \eaddition -% \end{macro} -% \begin{macrocode} -\endinput -% \end{macrocode} % \iffalse % % \fi +% +% \iffalse +%<*bib> +@manual{xkeyval, + title = {The \textsf{xkeyval} package}, + subtitle = {Extension of the keyval package}, + author = {Adriaens, Hendri}, + url = {http://www.ctan.org/pkg/xkeyval}, + urldate = {2020-07-05}, + date = {2014-03-12}, + version = {2.7a} +} + +@manual{etoolbox, + title = {The \sty{etoolbox} Package. An e-\TeX{} Toolbox + for Class and Package Authors}, + author = {Philipp Lehman and Joseph Wright}, + url = {http://www.ctan.org/pkg/etoolbox}, + urldate = {2020-07-05}, + date = {2019-09-21}, + version = {2.5h} +} + +@manual{koma, + title = {KOMA -- Script. A versatile \LaTeXe{} bundle}, + author = {Frank Neukam and Markus Kohm and Axel Kielhorn}, + url = {http://www.ctan.org/pkg/koma-script}, + urldate = {2020-07-05}, + date = {2020-04-19}, + version = {3.30} +} +% +% \fi % \Finale diff --git a/macros/latex/contrib/fontsize/fontsize.pdf b/macros/latex/contrib/fontsize/fontsize.pdf index 437021de32..eb4f42da51 100644 Binary files a/macros/latex/contrib/fontsize/fontsize.pdf and b/macros/latex/contrib/fontsize/fontsize.pdf differ diff --git a/macros/latex/contrib/pygmentex/demo.c b/macros/latex/contrib/pygmentex/demo.c deleted file mode 100644 index 1d739f5edf..0000000000 --- a/macros/latex/contrib/pygmentex/demo.c +++ /dev/null @@ -1,22 +0,0 @@ -// test.cpp - -#include - -using namespace std; - -void greetings() -{ - string name; - cout << "What is your name? "; - cin >> name; - cout << "Hello, " - << name - << '!' - << endl; -} - -int main() -{ - greetings(); - return 0; -} diff --git a/macros/latex/contrib/pygmentex/demo.delphi b/macros/latex/contrib/pygmentex/demo.delphi deleted file mode 100644 index 71e3812974..0000000000 --- a/macros/latex/contrib/pygmentex/demo.delphi +++ /dev/null @@ -1,8 +0,0 @@ -procedure example(a: integer); -const - A = 'jeja'; -var - sMessage: string; -begin - ShowMessage(sMessage + A); -end; diff --git a/macros/latex/contrib/pygmentex/demo.hs b/macros/latex/contrib/pygmentex/demo.hs deleted file mode 100644 index b784c890a5..0000000000 --- a/macros/latex/contrib/pygmentex/demo.hs +++ /dev/null @@ -1,7 +0,0 @@ -module Main where - --- the main IO action -main = do { putStr "What is your name? " - , name''' <- read - , putStrLn ("Hello, " ++ name''') - } diff --git a/macros/latex/contrib/pygmentex/demo.java b/macros/latex/contrib/pygmentex/demo.java deleted file mode 100644 index bda5bb322f..0000000000 --- a/macros/latex/contrib/pygmentex/demo.java +++ /dev/null @@ -1,68 +0,0 @@ -import java.io.IOException; -import java.io.Reader; -import java.util.Hashtable; -import java.util.Map; - -public class Lexer -{ - private Reader in; - private int x; - - private Map reserved = - new Hashtable(); - - public Lexer(Reader in) throws IOException - { - this.in = in; - x = in.read(); - reserved.put("let", Token.T.LET); - // acrescentar demais palavras reservadas - // ... - } - - public Token get() throws IOException - { - // retornar o próximo símbolo léxico do programa - - while (Character.isWhitespace(x)) - x = in.read(); - - if (x == -1) - return new Token(Token.T.EOF); - - if ((char)x == ',') - { - x = in.read(); - return new Token(Token.T.COMMA); - } - - if (Character.isDigit(x)) - { - StringBuilder builder = new StringBuilder(); - builder.append((char)x); - while (Character.isDigit((x = in.read()))) - builder.append((char)x); - return new Token(Token.T.INT, new Long(builder.toString())); - } - - if (Character.isAlphabetic(x)) - { - StringBuilder builder = new StringBuilder(); - builder.append((char)x); - while (Character.isAlphabetic(x = in.read()) || - Character.isDigit(x) || (char)x == '_') - builder.append((char)x); - String s = builder.toString(); - Token.T t = reserved.get(s); - if (t == null) - return new Token(Token.T.ID, s); - return new Token(t); - } - - // completar demais tokens - - System.out.println("unexpectec char: <" + (char)x + ">"); - x = in.read(); - return get(); - } -} diff --git a/macros/latex/contrib/pygmentex/demo.pas b/macros/latex/contrib/pygmentex/demo.pas deleted file mode 100644 index 5d63cc6e2d..0000000000 --- a/macros/latex/contrib/pygmentex/demo.pas +++ /dev/null @@ -1,7 +0,0 @@ -Program HelloWorld(output) -var - msg : String -begin - msg = 'Hello, world!'; - Writeln(msg) -end. diff --git a/macros/latex/contrib/pygmentex/demo.pdf b/macros/latex/contrib/pygmentex/demo.pdf deleted file mode 100644 index ccebf5004a..0000000000 Binary files a/macros/latex/contrib/pygmentex/demo.pdf and /dev/null differ diff --git a/macros/latex/contrib/pygmentex/demo.py b/macros/latex/contrib/pygmentex/demo.py deleted file mode 100644 index a5fa60eed4..0000000000 --- a/macros/latex/contrib/pygmentex/demo.py +++ /dev/null @@ -1,10 +0,0 @@ -# -*- coding: utf-8 -*- - -def parse_opts(dic, opts): - for opt in re.split(r'\s*,\s*', opts): - x = re.split(r'\s*=\s*', opt) - if len(x) == 2 and x[0] and x[1]: - dic[x[0]] = x[1] - elif len(x) == 1 and x[0]: - dic[x[0]] = True - return dic diff --git a/macros/latex/contrib/pygmentex/demo.tex b/macros/latex/contrib/pygmentex/demo.tex deleted file mode 100644 index 03fe3ac0a1..0000000000 --- a/macros/latex/contrib/pygmentex/demo.tex +++ /dev/null @@ -1,852 +0,0 @@ -\documentclass[10pt,a4paper]{article} - -%\usepackage[margin=13mm]{geometry} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage[font=normalsize,format=plain,labelfont=bf,up,textfont=it,up]{caption} -\usepackage{xcolor} -\usepackage{hyperref} -\usepackage[framemethod=tikz]{mdframed} -\usepackage{tcolorbox} -\usepackage{fvrb-ex} -\usepackage{tikz} -\usepackage{calc} -\usepackage{pygmentex} -\usepackage{lipsum} - -\fvset{gobble=0,showtabs,tabsize=1,frame=lines,framerule=1pt,numbers=left,fontsize=\scriptsize} - -\tcbuselibrary{skins,breakable} - -\definecolor{shadecolor}{rgb}{0.9,0.9,0.9} -\definecolor{lightgreen}{rgb}{0.8,0.95,0.8} - -\begin{document} - -\title{Testing the Pygmen\TeX{} package} -\author{José Romildo Malaquias} -\maketitle - -\section{The Pygmen\TeX{} package} - -This document demonstrates how to use the Pygment\TeX{} package to -typeset code listings with \LaTeX{} and -Pygments\footnote{\url{http://pygments.org/}}. - -Pygments is a generic syntax highlighter for general use in all kinds of -software such as forum systems, wikis or other applications that need to -prettify source code. - -Pygmen\TeX{} provides an environment and two commands for typesetting code -listings in a \LaTeX{} document: -\begin{itemize} - \item the \verb|pygmented| environment typesets its contents as a - source code listing, - \item the \verb|includepygmented| command typesets the contents of a - file, including the result in the \LaTeX{} document, and - \item the \verb|\pyginline| command typesets its contents, keeping the - result in the same line. -\end{itemize} -They accept many options that allow the user to configure the listing in -many ways. - -Read the remaining of this document to have an idea of what the package -is capable of. - -\section{How to use the package} - -In order to use the package, start by putting -\begin{verbatim} -\usepackage{pygmentex} -\end{verbatim} -in the preamble of the document. - -Use the environment or commands mentioned previously to include source -code listings on your document. - -When compiling the document (with \texttt{pdflatex}, for instance), all -the source code listings in the document wil be collected and saved in a -temporary file with the extension \texttt{.snippets} in its name. Then -the auxiliary program \texttt{pygmentex} (a Python application -distributed with the Pygmen\TeX{} package) should be run taking this -file as input. It will produce another temporary file with the extension -\texttt{.pygmented}, containing \LaTeX{} code for the code listings -previously collected. The next time the document is compiled, they are -included to produce the final typeset document. - -The programming language of the listing code can be specified using the -\verb|lang| option. - -To get a list of all available languages, execute the following command -on the command line: -\begin{verbatim} -$ pygmentize -L lexers -\end{verbatim} - -\section{First examples} - -The followig C program reads two integers and calculates their sum. - -\begin{Example} -\begin{pygmented}[lang=c] -#include -int main(void) -{ - int a, b, c; - printf("Enter two numbers to add: "); - scanf("%d%d", &a, &b); - c = a + b; - printf("Sum of entered numbers = %d\n", c); - return 0; -} -\end{pygmented} -\end{Example} - -\begin{Example} - In this program, \pyginline[lang=c]|int| is a type and - \pyginline[lang=c]|"Enter two numbers to add: "| is a literal string. -\end{Example} - -Next you can see a Java program to calculate the factorial of a number. - -\begin{Example} -\inputpygmented[lang=java]{Factorial.java} -\end{Example} - -\section{Choosing different Pygments styles} - -Instead of using the default style you may choose another stylesheet -provided by Pygments by its name using the \verb|sty| option. - -To get a list of all available stylesheets, execute the following -command on the command line: -\begin{verbatim} -$ pygmentize -L styles -\end{verbatim} - -Creating your own styles is also very easy. Just follow the instructions -provided on the website. - -As examples you can see a C program typeset with different styles. - -\begin{Example} -\noindent -\begin{minipage}[t]{0.49\linewidth} - \begin{pygmented}[lang=c,gobble=4,sty=murphy] - #include - main() - { int n; - printf("Enter a number: "); - scanf("%d",&n); - if ( n%2 == 0 ) - printf("Even\n"); - else - printf("Odd\n"); - return 0; - } - \end{pygmented} -\end{minipage} -\hfil -\begin{minipage}[t]{0.49\linewidth} - \begin{pygmented}[lang=c,gobble=4,sty=trac] - #include - main() - { int n; - printf("Enter a number: "); - scanf("%d",&n); - if ( n%2 == 0 ) - printf("Even\n"); - else - printf("Odd\n"); - return 0; - } - \end{pygmented} -\end{minipage} -\end{Example} - -\section{Choosing a font} - -The value of the option \verb|font| is typeset before the content of the -listing. Usualy it is used to specify a font to be used. See the -following example. - -\begin{Example} -\begin{pygmented}[lang=scala,font=\rmfamily\scshape\large] -object bigint extends Application { - def factorial(n: BigInt): BigInt = - if (n == 0) 1 else n * factorial(n-1) - - val f50 = factorial(50); val f49 = factorial(49) - println("50! = " + f50) - println("49! = " + f49) - println("50!/49! = " + (f50 / f49)) -} -\end{pygmented} -\end{Example} - -\section{Changing the background color} - -The option \verb|colback| can be used to choose a background color, as -is shown in the folowing example. - -\begin{Example} -\begin{pygmented}[lang=fsharp,colback=green!25] -let rec factorial n = - if n = 0 - then 1 - else n * factorial (n - 1) -System.Console.WriteLine(factorial anInt) -\end{pygmented} -\end{Example} - - -\section{Supressing initial characters} - -The option \verb|gobble| specifies the number of characters to suppress -at the beginning of each line (up to a maximum of 9). This is mainly -useful when environments are indented (Default: empty — no character -suppressed). - -\begin{Example} -A code snippet inside a minipage: -\begin{minipage}[t]{.5\linewidth} - \begin{pygmented}[lang=d,gobble=8] - ulong fact(ulong n) - { - if(n < 2) - return 1; - else - return n * fact(n - 1); - } - \end{pygmented} -\end{minipage} -\end{Example} - - -\section{Size of tabulator} - -The option \verb|tabsize| specifies the number of of spaces given by a -tab character (Default: 8). - -\begin{Verbatim}[showtabs,tabsize=1] -\begin{pygmented}[lang=common-lisp,tabsize=4] -;; Triple the value of a number -(defun triple (X) - "Compute three times X." - (* 3 X)) -\end{pygmented} -\end{Verbatim} - -\begin{pygmented}[lang=common-lisp,tabsize=4] -;; Triple the value of a number -(defun triple (X) - "Compute three times X." - (* 3 X)) -\end{pygmented} - - -\section{Numbering lines} - -The lines of a listing can be numbered. The followig options control -numbering of lines. -\begin{itemize} - \item Line numbering is enabled or disable with the \verb|linenos| - boolean option. - \item The number used for the first line can be set with the option - \verb|linenostart|. - \item The step between numbered lines can be set with the option - \verb|linenostep|. - \item The space between the line number and the line of the listing - can be set with the option \verb|linenosep|. -\end{itemize} - -In the followig listing you can see a Scheme function to calculate the -factorial of a number. - -\begin{Example} -\begin{pygmented}[lang=scheme,linenos,linenostart=1001,linenostep=2,linenosep=5mm] -;; Building a list of squares from 0 to 9. -;; Note: loop is simply an arbitrary symbol used as -;; a label. Any symbol will do. - -(define (list-of-squares n) - (let loop ((i n) (res '())) - (if (< i 0) - res - (loop (- i 1) (cons (* i i) res))))) -\end{pygmented} -\end{Example} - -\section{Captioning} - -The option \verb|caption| can be used to set a caption for the listing. -The option \verb|label| allows the assignment of a label to the listing. - -Here is an example: - -\begin{Example} -\begin{pygmented}[lang=c++,label=lst:test,caption=A \textbf{C++} example] -// This program adds two numbers and prints their sum. -#include -int main() -{ - int a; - int b; - int sum; - sum = a + b; - std::cout << "The sum of " << a << " and " << b - << " is " << sum << "\n"; - return 0; -} -\end{pygmented} -\end{Example} - -\begin{Example} - Listing \ref{lst:test} is a C++ program. -\end{Example} - -\section{Escaping to \LaTeX{} inside a code snippet} - -The option \verb|texcomments|, if set to \texttt{true}, enables \LaTeX{} -comment lines. That is, LaTex markup in comment tokens is not escaped -so that \LaTeX{} can render it. - -The \verb|mathescape|, if set to \texttt{true}, enables \LaTeX{} math -mode escape in comments. That is, \verb|$...$| inside a comment will -trigger math mode. - -The option \verb|escapeinside|, if set to a string of length two, -enables escaping to \LaTeX{}. Text delimited by these two characters -is read as \LaTeX{} code and typeset accordingly. It has no effect in -string literals. It has no effect in comments if \verb|texcomments| or -\verb|mathescape| is set. - -Some examples follows. - -\begin{Example} -\begin{pygmented}[lang=c++,texcomments] -#include -using namespace std; -main() -{ - cout << "Hello World"; // prints \underline{Hello World} - return 0; -} -\end{pygmented} -\end{Example} - -\begin{Example} -\begin{pygmented}[lang=python,mathescape] -# Returns $\sum_{i=1}^{n}i$ -def sum_from_one_to(n): - r = range(1, n + 1) - return sum(r) -\end{pygmented} -\end{Example} - -\begin{Example} -\begin{pygmented}[lang=c,escapeinside=||] - -if (|\textit{condition}|) - |\textit{command$_1$}| -else - |\textit{command$_2$}| -\end{pygmented} -\end{Example} - - -\section{Enclosing command and environment} - -After being prettified by Pygments, the listings are enclosed in a -command (for \verb|\pyginline|) or in an environment (for -\verb|pygmented| and \verb|includepygmented|). By default -\verb|\pyginline| uses the command \verb|\efbox| from the \texttt{efbox} -package, and \verb|pygmented| and \verb|includepygmented| use the -environment \verb|mdframed| from the \texttt{mdframed} package. - -The enclosing command or environment should be configurable using a list -of key-value pairs written between square brackets. - -The enclosing command for -\verb|\pyginline| can be changed with the option -\verb|inline method|. For instance, in the following the command -\verb|\tcbox| from the \verb|tcolorbox| package is used: - -\begin{Example} - In the previous Java program, - \pyginline[lang=java,inline method=tcbox]|"Factorial of "| is a - literal string. -\end{Example} - -The enclosing environment for \verb|pygmented| and -\verb|includepygmented| can be changed with the option -\verb|boxing method|. For instance, here is a hello world program in -C\#, enclosed in a \verb|tcolorbox| environment: - -\begin{Example} -\begin{pygmented}[lang=csharp,boxing method=tcolorbox] -using System; -class Program -{ - public static void Main(string[] args) - { - Console.WriteLine("Hello, world!"); - } -} -\end{pygmented} -\end{Example} - -Any option unknown to Pygmen\TeX{} are passed to the enclosing command -or environment. - -For instance: - -\begin{Example} -\begin{pygmented}[lang=xml,boxing method=tcolorbox,colframe=red,boxrule=2mm] - - - Tove - Jani - Reminder - Don't forget me this weekend! - -\end{pygmented} -\end{Example} - -\section{Setting global options for Pygmen\TeX{}} - -Global options can be setting using the \verb|setpygmented| command. -See the examples that follows. - -\begin{Example} -\setpygmented{lang=haskell, colback=red!30, font=\ttfamily\small} - -\begin{pygmented}[] -sum :: Num a => [a] -> a -sum [] = 0 -sum (x:xs) = x + sum xs -\end{pygmented} -\end{Example} - -\begin{Example} -\begin{pygmented}[colback=blue!20, boxing method=tcolorbox] -elem :: Eq a => a -> [a] -> Bool -elem _ [] = False -elem x (y:ys) = x == y || elem x ys -\end{pygmented} -\end{Example} - -\begin{Example} -\setpygmented{lang=snobol} - -\begin{pygmented}[] - OUTPUT = "What is your name?" - Username = INPUT - OUTPUT = "Thank you, " Username -END -\end{pygmented} -\end{Example} - -\begin{Example} -\setpygmented{test/.style={colback=yellow!33,boxing method=tcolorbox,colframe=blue}} - -\begin{pygmented}[test, lang=vbnet] -Module Module1 - Sub Main() - Console.WriteLine("Hello, world!") - End Sub -End Module -\end{pygmented} -\end{Example} - -\begin{Example} -\begin{pygmented}[lang=tcl] -puts "Hello, world!" -\end{pygmented} -\end{Example} - -\section{More examples of inline code snippets} - -\begin{Example} - An inline source code snippet: - \pyginline[lang=c]|const double alfa = 3.14159;|. - This is a C declaration with initialization. -\end{Example} - -\begin{Example} - \pyginline[lang=prolog,colback=yellow]=avo(A,B) :- pai(A,X), pai(X,B).= - is a Prolog clause. Its head is - \pyginline[lang=prolog,sty=emacs,colback=yellow,linecolor=red]=avo(A,B)= - and its body is - \pyginline[lang=prolog,sty=vim,colback=black,hidealllines]=pai(A,X), pai(X,B)=. -\end{Example} - -\begin{Example} - See the identifier \pyginline[inline method=efbox,colback=green!25]|variable|, - which names something. String literals in C looks like - \pyginline[lang=c,inline method=tcbox,colback=blue!20,boxrule=2pt]|"hello, world!\n"|. -\end{Example} - -\setpygmented{colback=shadecolor} - -\begin{Example} - This one - \pyginline[lang=ocaml,font=\ttfamily\scriptsize,topline=false]:let x = [1;2;3] in length x: - is an OCaml expression with local bindings. With OCaml one can do - imperative, functional and object oriented programming. -\end{Example} - -\begin{Example} - Now some Java code: - \pyginline[lang=java,sty=colorful,font=\ttfamily\itshape,linewidth=1pt]|public int f(double x)|. - This is a method header. -\end{Example} - -\section{More examples of displayed code snippets} - -\setpygmented{lang=scheme,colback=shadecolor,sty=emacs} - -In listing \ref{lst:fact} you can see a function definition in the -Scheme language. This function computes the factorial of a natural -number. -\newline\rule{\linewidth}{2pt} -\begin{pygmented}[ - sty=emacs, - linenos, - label=lst:fact, - caption=A Scheme function. - ] -(define fact - (lambda (n) - (if (= n 0) - 1 - (* n (fact (- n 1)))))) -\end{pygmented} - -Here you have some more code to further testing the package. Listing -\ref{lst:haskell} is a Haskell program. When run this program interacts -with the user asking the user name, reading a line input by the user, -and showing a greeting message to the user. - -\inputpygmented[% - lang=haskell, - linenos, - linenostart=79831, - innerlinecolor=yellow, innerlinewidth=6pt, - middlelinecolor=blue, middlelinewidth=10pt, - outerlinecolor=green, outerlinewidth=12pt, - roundcorner=4, - colback=shadecolor, - caption=A haskell interactive program, - label=lst:haskell, - ]{demo.hs} - -This is a rule: - -\noindent\rule{\linewidth}{2pt} - -Now a Pascal procedure: - -\inputpygmented[ - lang=delphi, - linewidth=1.5pt, - font=\ttfamily\sffamily\large, - colback=yellow - ]{demo.delphi} -and a Pascal program -\inputpygmented[lang=pascal,linenos,linenostart=5801]{demo.pas} - -A Python code snippet: - -\inputpygmented[ - lang=python, - sty=emacs, - linenos, - linenostep=3, - linewidth=1pt, - colback=lightgreen - ]{demo.py} - -\section{Using code snippets in environments} - -The following is a \textbf{description} environment. - -\begin{description} - \item[An item] \lipsum[31] - \begin{pygmented}[lang=scala,colback=yellow, - % title=Item A - ] -def qsort(xs: List[Int]): List[Int] = - xs match { - case Nil => - Nil - case pivot :: tail => - qsort(tail filter { _ < pivot }) ::: - pivot :: qsort(tail filter { _ >= pivot }) - } - \end{pygmented} - \lipsum[32] - - \item[Another item] \lipsum[33] - \begin{pygmented}[lang=lua,colback=yellow] -function entry0 (o) - N=N + 1 - local title = o.title or '(no title)' - fwrite('
  • %s\n', N, title) -end - \end{pygmented} - \lipsum[34] -\end{description} - -\section{A long program} - -Here you can read the source code for a hand written lexical analyser -for the \emph{straight-line} programming language that I have developed -in Java. - -\inputpygmented[boxing method=mdframed,lang=java,sty=autumn,colback=red!8,font=\ttfamily\small,tabsize=2,frametitle=\emph{Ad hoc} lexical analyser]{demo.java} - -\section{Some fancy examples using \texttt{tcolorbox}} - -The followig example uses \texttt{tcolorbox} to typeset the code -listing. - -\newcounter{example} -\newlength{\examlen} -\colorlet{colexam}{red!75!black} - -\begin{pygmented}[boxing method=tcolorbox,lang=scala, - title=Example \arabic{example}: hello from \texttt{Scala}, - code={\refstepcounter{example}% - \settowidth{\examlen}{\Large\bfseries Example \arabic{example}}},% - coltitle=colexam,fonttitle=\Large\bfseries, - enhanced,breakable, - before=\par\medskip, - parbox=false, - frame hidden,interior hidden,segmentation hidden, - boxsep=0pt,left=0pt,right=3mm,toptitle=2mm,pad at break=0mm, - overlay unbroken={\draw[colexam,line width=1pt] (frame.north west) - --([xshift=-0.5pt]frame.north east)--([xshift=-0.5pt]frame.south east) - --(frame.south west); - \draw[colexam,line width=2pt] ([yshift=0.5pt]frame.north west) - -- +(\examlen,0pt);}, - overlay first={\draw[colexam,line width=1pt] (frame.north west) - --([xshift=-0.5pt]frame.north east)--([xshift=-0.5pt]frame.south east); - \draw[red!75!black,line width=2pt] ([yshift=0.5pt]frame.north west) - -- +(\examlen,0pt);}, - overlay middle={\draw[colexam,line width=1pt] ([xshift=-0.5pt]frame.north east) - --([xshift=-0.5pt]frame.south east); }, - overlay last={\draw[colexam,line width=1pt] ([xshift=-0.5pt]frame.north east) - --([xshift=-0.5pt]frame.south east)--(frame.south west);}% - ] -object HelloWorld extends App { - println("Hello, world!") -}\end{pygmented} - -\begin{pygmented}[boxing method=tcolorbox,lang=java, - enhanced,colback=blue!10!white,colframe=orange,top=4mm, - enlarge top by=\baselineskip/2+1mm, - enlarge top at break by=0mm,pad at break=2mm, - fontupper=\normalsize, - overlay unbroken and first={% - \node[rectangle,rounded corners,draw=black,fill=blue!20!white, - inner sep=1mm,anchor=west,font=\small] - at ([xshift=4.5mm]frame.north west) {\strut\textbf{My fancy title}};}, - ] -public class Hello { - public static void main(String[] args) { - System.out.println("Hello, world!") - } -} -\end{pygmented} - -\begin{pygmented}[boxing method=tcolorbox,lang=haskell, - enhanced,sharp corners=uphill, - colback=blue!25!white,colframe=blue!25!black,coltext=blue!90!black, - fontupper=\Large\bfseries,arc=6mm,boxrule=2mm,boxsep=5mm, - borderline={0.3mm}{0.3mm}{white} - ] -module Main (main) where - -main :: IO () -main = putStrLn "Hello, world!" -\end{pygmented} - -\begin{pygmented}[boxing method=tcolorbox,lang=c++, - enhanced,frame style image=blueshade.png, - opacityback=0.75,opacitybacktitle=0.25, - colback=blue!5!white,colframe=blue!75!black, - title=My title - ] -#include -using namespace std; -int main(int argc, char** argv) { - cout << "Hello, world!" << endl; - return 0; -} -\end{pygmented} - -\begin{pygmented}[boxing method=tcolorbox,lang=d, - enhanced,attach boxed title to top center={yshift=-3mm,yshifttext=-1mm}, - colback=blue!5!white,colframe=blue!75!black,colbacktitle=red!80!black, - title=My title,fonttitle=\bfseries, - boxed title style={size=small,colframe=red!50!black} - ] -/* This program prints a - hello world message - to the console. */ - -import std.stdio; - -void main() -{ - writeln("Hello, World!"); -} -\end{pygmented} - - -\section{Some fancy examples using \texttt{mdframed}} - -The followig example uses \texttt{mdframed} to typeset the code listing. - -\global\mdfdefinestyle{exampledefault}{% - linecolor=red,linewidth=3pt,% - leftmargin=1cm,rightmargin=1cm -} - -\begin{pygmented}[boxing method=mdframed,lang=ada,style=exampledefault] -with Ada.Text_IO; - -procedure Hello_World is - use Ada.Text_IO; -begin - Put_Line("Hello, world!"); -end; -\end{pygmented} - -\global\mdfapptodefinestyle{exampledefault}{% - topline=false,bottomline=false, -} - -\begin{pygmented}[boxing method=mdframed,lang=pascal,style=exampledefault,frametitle={Saying \emph{hello} from Pascal}] -program HelloWorld; - -begin - WriteLn('Hello, world!'); -end. -\end{pygmented} - -\global\mdfdefinestyle{separateheader}{% - frametitle={% - \tikz[baseline=(current bounding box.east),outer sep=0pt] - \node[anchor=east,rectangle,fill=blue!20] - {\strut Saying \emph{hello} in Modula-2};}, - innertopmargin=10pt,linecolor=blue!20,% - linewidth=2pt,topline=true, - frametitleaboveskip=\dimexpr-\ht\strutbox\relax, - frametitlerule=false, - backgroundcolor=white, -} - -\begin{pygmented}[boxing method=mdframed,lang=modula2,style=separateheader] -MODULE Hello; -FROM STextIO IMPORT WriteString; -BEGIN - WriteString("Hello World!"); -END Hello. -\end{pygmented} - - -\tikzset{titregris/.style = - {draw=gray, thick, fill=white, shading = exersicetitle, % - text=gray, rectangle, rounded corners, right,minimum height=.7cm}} -\pgfdeclarehorizontalshading{exersicebackground}{100bp} - {color(0bp)=(green!40); color(100bp)=(black!5)} -\pgfdeclarehorizontalshading{exersicetitle}{100bp} - {color(0bp)=(red!40);color(100bp)=(black!5)} -\newcounter{exercise} -\renewcommand*\theexercise{Exercise~n\arabic{exercise}} -\makeatletter -\def\mdf@@exercisepoints{}%new mdframed key: -\define@key{mdf}{exercisepoints}{% - \def\mdf@@exercisepoints{#1} -} -\mdfdefinestyle{exercisestyle}{% - outerlinewidth=1em,outerlinecolor=white,% - leftmargin=-1em,rightmargin=-1em,% - middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray, - apptotikzsetting={\tikzset{mdfbackground/.append style ={% - shading = exersicebackground}}}, - innertopmargin=1.2\baselineskip, - skipabove={\dimexpr0.5\baselineskip+\topskip\relax}, - skipbelow={-1em}, - needspace=3\baselineskip, - frametitlefont=\sffamily\bfseries, - settings={\global\stepcounter{exercise}}, - singleextra={% - \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}\hbox{~}}; - \ifdefempty{\mdf@@exercisepoints}% - {}% - {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}% - }, - firstextra={% - \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}\hbox{~}}; - \ifdefempty{\mdf@@exercisepoints}% - {}% - {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}% - }, -} -\makeatother - -\begin{pygmented}[boxing method=mdframed,lang=go,style=exercisestyle] -// hello world in 'go' -package main - -import "fmt" - -func main() { - fmt.Println("Hello, world!") -} -\end{pygmented} - -\begin{pygmented}[boxing method=mdframed,lang=objective-c,style=exercisestyle,exercisepoints=10] -/* hello from objective-c */ - -#import -#import - -int main(void) -{ - NSLog(@"Hello, world!\n"); - return 0; -} -\end{pygmented} - -\mdfdefinestyle{another}{% - linecolor=red,middlelinewidth=2pt,% - frametitlerule=true,% - apptotikzsetting={\tikzset{mdfframetitlebackground/.append style={% - shade,left color=white, right color=blue!20}}}, - frametitlerulecolor=green!60, - frametitlerulewidth=1pt, - innertopmargin=\topskip, -} - -\begin{pygmented}[boxing method=mdframed,lang=c,style=another,frametitle={Hello from C}] -#include -int main(int argc, char **argv) { - printf("Hello, world!\n"); - return 0; -} -\end{pygmented} - - -\section{Conclusion} - -That is all. - -\end{document} diff --git a/macros/latex/contrib/pygmentex/pygmentex.py b/macros/latex/contrib/pygmentex/pygmentex.py index 42cef96fae..099b5a67ee 100755 --- a/macros/latex/contrib/pygmentex/pygmentex.py +++ b/macros/latex/contrib/pygmentex/pygmentex.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python2 +#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ @@ -8,11 +8,11 @@ PygmenTeX is a converter that do syntax highlighting of snippets of source code extracted from a LaTeX file. - :copyright: Copyright 2014 by José Romildo Malaquias + :copyright: Copyright 2020 by José Romildo Malaquias :license: BSD, see LICENSE for details """ -__version__ = '0.8' +__version__ = '0.10' __docformat__ = 'restructuredtext' import sys @@ -27,6 +27,7 @@ from pygments.formatters.latex import LatexFormatter, escape_tex, _get_ttype_nam from pygments.util import get_bool_opt, get_int_opt from pygments.lexer import Lexer from pygments.token import Token +from pygments.util import guess_decode ################################################### # The following code is in >=pygments-2.0 @@ -56,24 +57,24 @@ class EnhancedLatexFormatter(LatexFormatter): realoutfile = outfile outfile = StringIO() - outfile.write(u'\\begin{Verbatim}[commandchars=\\\\\\{\\}') + outfile.write(r'\begin{Verbatim}[commandchars=\\\{\}') if self.linenos: start, step = self.linenostart, self.linenostep - outfile.write(u',numbers=left' + - (start and u',firstnumber=%d' % start or u'') + - (step and u',stepnumber=%d' % step or u'')) + outfile.write(',numbers=left' + + (start and ',firstnumber=%d' % start or '') + + (step and ',stepnumber=%d' % step or '')) if self.mathescape or self.texcomments or self.escapeinside: - outfile.write(u',codes={\\catcode`\\$=3\\catcode`\\^=7\\catcode`\\_=8}') + outfile.write(r',codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8}') if self.verboptions: - outfile.write(u',' + self.verboptions) - outfile.write(u']\n') + outfile.write(',' + self.verboptions) + outfile.write(']\n') for ttype, value in tokensource: if ttype in Token.Comment: if self.texcomments: # Try to guess comment starting lexeme and escape it ... start = value[0:1] - for i in xrange(1, len(value)): + for i in range(1, len(value)): if start[0] != value[i]: break start += value[i] @@ -129,7 +130,7 @@ class EnhancedLatexFormatter(LatexFormatter): else: outfile.write(value) - outfile.write(u'\\end{Verbatim}\n') + outfile.write('\\end{Verbatim}\n') if self.full: realoutfile.write(DOC_TEMPLATE % @@ -232,7 +233,7 @@ DISPLAY_LINENOS_SNIPPET_TEMPLATE = r''' ''' -def pyg(outfile, n, opts, extra_opts, text, usedstyles, inline_delim = ''): +def pyg(outfile, outencoding, n, opts, extra_opts, text, usedstyles, inline_delim = ''): try: lexer = get_lexer_by_name(opts['lang']) except ClassNotFound as err: @@ -260,27 +261,8 @@ def pyg(outfile, n, opts, extra_opts, text, usedstyles, inline_delim = ''): if tabsize: lexer.tabsize = tabsize - encoding = opts['encoding'] - if encoding == 'guess': - try: - import chardet - except ImportError: - try: - text = text.decode('utf-8') - if text.startswith(u'\ufeff'): - text = text[len(u'\ufeff'):] - encoding = 'utf-8' - except UnicodeDecodeError: - text = text.decode('latin1') - encoding = 'latin1' - else: - encoding = chardet.detect(text)['encoding'] - text = text.decode(encoding) - else: - text = text.decode(encoding) - lexer.encoding = '' - _fmter.encoding = encoding + # _fmter.encoding = outencoding stylename = opts['sty'] @@ -367,7 +349,7 @@ _re_input = re.compile( r'^<@@pygmented@input@(\d+)\n(.*)\n([\s\S]*?)\n>@@pygmented@input@\1$', re.MULTILINE) -def convert(code, outfile): +def convert(code, outfile, outencoding): """ Convert ``code`` """ @@ -393,6 +375,7 @@ def convert(code, outfile): m = _re_inline.match(code, pos) if m: pyg(outfile, + outencoding, m.group(1), parse_opts(opts.copy(), m.group(2)), '', @@ -405,6 +388,7 @@ def convert(code, outfile): m = _re_display.match(code, pos) if m: pyg(outfile, + outencoding, m.group(1), parse_opts(opts.copy(), m.group(2)), '', @@ -415,15 +399,16 @@ def convert(code, outfile): m = _re_input.match(code, pos) if m: + opts_new = parse_opts(opts, m.group(2)) try: - filecontents = open(m.group(3), 'rb').read() + filecontents, inencoding = read_input(m.group(3), opts_new['encoding']) except Exception as err: - sys.stderr.write('Error: cannot read input file: ') - sys.stderr.write(str(err)) + print('Error: cannot read input file: ', err, file=sys.stderr) else: pyg(outfile, + outencoding, m.group(1), - parse_opts(opts, m.group(2)), + opts_new, "", filecontents, usedstyles) @@ -435,6 +420,16 @@ def convert(code, outfile): outfile.write(GENERIC_DEFINITIONS_2) +def read_input(filename, encoding): + with open(filename, 'rb') as infp: + code = infp.read() + + if not encoding or encoding == 'guess': + code, encoding = guess_decode(code) + else: + code = code.decode(encoding) + + return code, encoding USAGE = """\ @@ -486,7 +481,7 @@ def main(args = sys.argv): return 0 if opts.pop('-V', None) is not None: - print('PygmenTeX version %s, (c) 2010 by José Romildo.' % __version__) + print('PygmenTeX version %s, (c) 2020 by José Romildo.' % __version__) return 0 if len(args) != 1: @@ -494,10 +489,9 @@ def main(args = sys.argv): return 2 infn = args[0] try: - code = open(infn, 'rb').read() + code, inencoding = read_input(infn, "guess") except Exception as err: - sys.stderr.write('Error: cannot read input file: ') - sys.stderr.write(str(err)) + print('Error: cannot read input file: ', err, file=sys.stderr) return 1 outfn = opts.pop('-o', None) @@ -507,11 +501,10 @@ def main(args = sys.argv): try: outfile = open(outfn, 'w') except Exception as err: - sys.stderr.write('Error: cannot open output file: ') - sys.stderr.write(str(err)) + print('Error: cannot open output file: ', err, file=sys.stderr) return 1 - convert(code, outfile) + convert(code, outfile, inencoding) return 0 diff --git a/macros/latex/contrib/pygmentex/pygmentex.sty b/macros/latex/contrib/pygmentex/pygmentex.sty index a0ddd911b8..60e7bcda30 100644 --- a/macros/latex/contrib/pygmentex/pygmentex.sty +++ b/macros/latex/contrib/pygmentex/pygmentex.sty @@ -2,7 +2,7 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{pygmentex}[2014/08/12 v0.8 A Pygmentex layer for LaTeX] +\ProvidesPackage{pygmentex}[2020/12/21 v0.10 A Pygmentex layer for LaTeX] \RequirePackage{fancyvrb} \RequirePackage{color} @@ -13,9 +13,9 @@ \RequirePackage{efbox} \RequirePackage[framemethod=tikz]{mdframed} -%\DeclareCaptionType[within=chapter]{code}[Listagem][Lista de listagens] -\DeclareCaptionType{code}[Listagem][Lista de listagens] -\captionsetup[code]{position=top} +%\DeclareCaptionType[within=chapter]{pygcode}[Listagem][Lista de listagens] +\DeclareCaptionType{pygcode}[Listagem][Lista de listagens] +\captionsetup[pygcode]{position=top} % ========================================================= % Auxiliary: @@ -246,14 +246,14 @@ % \ifdefined\pygmented@opt@label \def\pygmented@title{% - \captionof{code}{\label{\pygmented@opt@label}\pygmented@opt@caption}% + \captionof{pygcode}{\label{\pygmented@opt@label}\pygmented@opt@caption}% % \nopagebreak \vskip -0.7\baselineskip }% \else \ifdefined\pygmented@opt@caption \def\pygmented@title{% - \captionof{code}{\pygmented@opt@caption}% + \captionof{pygcode}{\pygmented@opt@caption}% % \nopagebreak \vskip -0.7\baselineskip }% diff --git a/macros/latex/contrib/pygmentex/pygmentex_demo.c b/macros/latex/contrib/pygmentex/pygmentex_demo.c new file mode 100644 index 0000000000..1d739f5edf --- /dev/null +++ b/macros/latex/contrib/pygmentex/pygmentex_demo.c @@ -0,0 +1,22 @@ +// test.cpp + +#include + +using namespace std; + +void greetings() +{ + string name; + cout << "What is your name? "; + cin >> name; + cout << "Hello, " + << name + << '!' + << endl; +} + +int main() +{ + greetings(); + return 0; +} diff --git a/macros/latex/contrib/pygmentex/pygmentex_demo.delphi b/macros/latex/contrib/pygmentex/pygmentex_demo.delphi new file mode 100644 index 0000000000..71e3812974 --- /dev/null +++ b/macros/latex/contrib/pygmentex/pygmentex_demo.delphi @@ -0,0 +1,8 @@ +procedure example(a: integer); +const + A = 'jeja'; +var + sMessage: string; +begin + ShowMessage(sMessage + A); +end; diff --git a/macros/latex/contrib/pygmentex/pygmentex_demo.hs b/macros/latex/contrib/pygmentex/pygmentex_demo.hs new file mode 100644 index 0000000000..b784c890a5 --- /dev/null +++ b/macros/latex/contrib/pygmentex/pygmentex_demo.hs @@ -0,0 +1,7 @@ +module Main where + +-- the main IO action +main = do { putStr "What is your name? " + , name''' <- read + , putStrLn ("Hello, " ++ name''') + } diff --git a/macros/latex/contrib/pygmentex/pygmentex_demo.java b/macros/latex/contrib/pygmentex/pygmentex_demo.java new file mode 100644 index 0000000000..bda5bb322f --- /dev/null +++ b/macros/latex/contrib/pygmentex/pygmentex_demo.java @@ -0,0 +1,68 @@ +import java.io.IOException; +import java.io.Reader; +import java.util.Hashtable; +import java.util.Map; + +public class Lexer +{ + private Reader in; + private int x; + + private Map reserved = + new Hashtable(); + + public Lexer(Reader in) throws IOException + { + this.in = in; + x = in.read(); + reserved.put("let", Token.T.LET); + // acrescentar demais palavras reservadas + // ... + } + + public Token get() throws IOException + { + // retornar o próximo símbolo léxico do programa + + while (Character.isWhitespace(x)) + x = in.read(); + + if (x == -1) + return new Token(Token.T.EOF); + + if ((char)x == ',') + { + x = in.read(); + return new Token(Token.T.COMMA); + } + + if (Character.isDigit(x)) + { + StringBuilder builder = new StringBuilder(); + builder.append((char)x); + while (Character.isDigit((x = in.read()))) + builder.append((char)x); + return new Token(Token.T.INT, new Long(builder.toString())); + } + + if (Character.isAlphabetic(x)) + { + StringBuilder builder = new StringBuilder(); + builder.append((char)x); + while (Character.isAlphabetic(x = in.read()) || + Character.isDigit(x) || (char)x == '_') + builder.append((char)x); + String s = builder.toString(); + Token.T t = reserved.get(s); + if (t == null) + return new Token(Token.T.ID, s); + return new Token(t); + } + + // completar demais tokens + + System.out.println("unexpectec char: <" + (char)x + ">"); + x = in.read(); + return get(); + } +} diff --git a/macros/latex/contrib/pygmentex/pygmentex_demo.pas b/macros/latex/contrib/pygmentex/pygmentex_demo.pas new file mode 100644 index 0000000000..5d63cc6e2d --- /dev/null +++ b/macros/latex/contrib/pygmentex/pygmentex_demo.pas @@ -0,0 +1,7 @@ +Program HelloWorld(output) +var + msg : String +begin + msg = 'Hello, world!'; + Writeln(msg) +end. diff --git a/macros/latex/contrib/pygmentex/pygmentex_demo.pdf b/macros/latex/contrib/pygmentex/pygmentex_demo.pdf new file mode 100644 index 0000000000..a444bffd44 Binary files /dev/null and b/macros/latex/contrib/pygmentex/pygmentex_demo.pdf differ diff --git a/macros/latex/contrib/pygmentex/pygmentex_demo.py b/macros/latex/contrib/pygmentex/pygmentex_demo.py new file mode 100644 index 0000000000..a5fa60eed4 --- /dev/null +++ b/macros/latex/contrib/pygmentex/pygmentex_demo.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- + +def parse_opts(dic, opts): + for opt in re.split(r'\s*,\s*', opts): + x = re.split(r'\s*=\s*', opt) + if len(x) == 2 and x[0] and x[1]: + dic[x[0]] = x[1] + elif len(x) == 1 and x[0]: + dic[x[0]] = True + return dic diff --git a/macros/latex/contrib/pygmentex/pygmentex_demo.tex b/macros/latex/contrib/pygmentex/pygmentex_demo.tex new file mode 100644 index 0000000000..5a07f49bed --- /dev/null +++ b/macros/latex/contrib/pygmentex/pygmentex_demo.tex @@ -0,0 +1,861 @@ +\documentclass[10pt,a4paper]{article} + +%\usepackage[margin=13mm]{geometry} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[font=normalsize,format=plain,labelfont=bf,up,textfont=it,up]{caption} +\usepackage{xcolor} +\usepackage{hyperref} +\usepackage[framemethod=tikz]{mdframed} +\usepackage{tcolorbox} +\usepackage{fancyvrb-ex} +\usepackage{tikz} +\usepackage{calc} +\usepackage{pygmentex} +\usepackage{lipsum} + +\fvset{gobble=0,showtabs,tabsize=1,frame=lines,framerule=1pt,numbers=left,fontsize=\scriptsize} + +\tcbuselibrary{skins,breakable} + +\definecolor{shadecolor}{rgb}{0.9,0.9,0.9} +\definecolor{lightgreen}{rgb}{0.8,0.95,0.8} + +\begin{document} + +\title{Testing the Pygmen\TeX{} package} +\author{José Romildo Malaquias} +\maketitle + +\section{The Pygmen\TeX{} package} + +This document demonstrates how to use the Pygment\TeX{} package to +typeset code listings with \LaTeX{} and +Pygments\footnote{\url{http://pygments.org/}}. + +Pygments is a generic syntax highlighter for general use in all kinds of +software such as forum systems, wikis or other applications that need to +prettify source code. + +Pygmen\TeX{} provides an environment and two commands for typesetting code +listings in a \LaTeX{} document: +\begin{itemize} + \item the \verb|pygmented| environment typesets its contents as a + source code listing, + \item the \verb|includepygmented| command typesets the contents of a + file, including the result in the \LaTeX{} document, and + \item the \verb|\pyginline| command typesets its contents, keeping the + result in the same line. +\end{itemize} +They accept many options that allow the user to configure the listing in +many ways. + +Read the remaining of this document to have an idea of what the package +is capable of. + +\section{How to use the package} + +In order to use the package, start by putting +\begin{verbatim} +\usepackage{pygmentex} +\end{verbatim} +in the preamble of the document. + +Use the environment or commands mentioned previously to include source +code listings on your document. + +When compiling the document (with \texttt{pdflatex}, for instance), all +the source code listings in the document wil be collected and saved in a +temporary file with the extension \texttt{.snippets} in its name. Then +the auxiliary program \texttt{pygmentex} (a Python application +distributed with the Pygmen\TeX{} package) should be run taking this +file as input. It will produce another temporary file with the extension +\texttt{.pygmented}, containing \LaTeX{} code for the code listings +previously collected. The next time the document is compiled, they are +included to produce the final typeset document. + +The programming language of the listing code can be specified using the +\verb|lang| option. + +To get a list of all available languages, execute the following command +on the command line: +\begin{verbatim} +$ pygmentize -L lexers +\end{verbatim} + +\section{First examples} + +A simple verbatim text is the first example. + +\begin{Example} +\begin{pygmented}[] +Hello world! + This is a simple demonstration text. +\end{pygmented} +\end{Example} + +The followig C program reads two integers and calculates their sum. + +\begin{Example} +\begin{pygmented}[lang=c] +#include +int main(void) +{ + int a, b, c; + printf("Enter two numbers to add: "); + scanf("%d%d", &a, &b); + c = a + b; + printf("Sum of entered numbers = %d\n", c); + return 0; +} +\end{pygmented} +\end{Example} + +\begin{Example} + In this program, \pyginline[lang=c]|int| is a type and + \pyginline[lang=c]|"Enter two numbers to add: "| is a literal string. +\end{Example} + +Next you can see a Java program to calculate the factorial of a number. + +\begin{Example} +\inputpygmented[lang=java]{Factorial.java} +\end{Example} + +\section{Choosing different Pygments styles} + +Instead of using the default style you may choose another stylesheet +provided by Pygments by its name using the \verb|sty| option. + +To get a list of all available stylesheets, execute the following +command on the command line: +\begin{verbatim} +$ pygmentize -L styles +\end{verbatim} + +Creating your own styles is also very easy. Just follow the instructions +provided on the website. + +As examples you can see a C program typeset with different styles. + +\begin{Example} +\noindent +\begin{minipage}[t]{0.49\linewidth} + \begin{pygmented}[lang=c,gobble=4,sty=murphy] + #include + main() + { int n; + printf("Enter a number: "); + scanf("%d",&n); + if ( n%2 == 0 ) + printf("Even\n"); + else + printf("Odd\n"); + return 0; + } + \end{pygmented} +\end{minipage} +\hfil +\begin{minipage}[t]{0.49\linewidth} + \begin{pygmented}[lang=c,gobble=4,sty=trac] + #include + main() + { int n; + printf("Enter a number: "); + scanf("%d",&n); + if ( n%2 == 0 ) + printf("Even\n"); + else + printf("Odd\n"); + return 0; + } + \end{pygmented} +\end{minipage} +\end{Example} + +\section{Choosing a font} + +The value of the option \verb|font| is typeset before the content of the +listing. Usualy it is used to specify a font to be used. See the +following example. + +\begin{Example} +\begin{pygmented}[lang=scala,font=\rmfamily\scshape\large] +object bigint extends Application { + def factorial(n: BigInt): BigInt = + if (n == 0) 1 else n * factorial(n-1) + + val f50 = factorial(50); val f49 = factorial(49) + println("50! = " + f50) + println("49! = " + f49) + println("50!/49! = " + (f50 / f49)) +} +\end{pygmented} +\end{Example} + +\section{Changing the background color} + +The option \verb|colback| can be used to choose a background color, as +is shown in the folowing example. + +\begin{Example} +\begin{pygmented}[lang=fsharp,colback=green!25] +let rec factorial n = + if n = 0 + then 1 + else n * factorial (n - 1) +System.Console.WriteLine(factorial anInt) +\end{pygmented} +\end{Example} + + +\section{Supressing initial characters} + +The option \verb|gobble| specifies the number of characters to suppress +at the beginning of each line (up to a maximum of 9). This is mainly +useful when environments are indented (Default: empty — no character +suppressed). + +\begin{Example} +A code snippet inside a minipage: +\begin{minipage}[t]{.5\linewidth} + \begin{pygmented}[lang=d,gobble=8] + ulong fact(ulong n) + { + if(n < 2) + return 1; + else + return n * fact(n - 1); + } + \end{pygmented} +\end{minipage} +\end{Example} + + +\section{Size of tabulator} + +The option \verb|tabsize| specifies the number of of spaces given by a +tab character (Default: 8). + +\begin{Verbatim}[showtabs,tabsize=1] +\begin{pygmented}[lang=common-lisp,tabsize=4] +;; Triple the value of a number +(defun triple (X) + "Compute three times X." + (* 3 X)) +\end{pygmented} +\end{Verbatim} + +\begin{pygmented}[lang=common-lisp,tabsize=4] +;; Triple the value of a number +(defun triple (X) + "Compute three times X." + (* 3 X)) +\end{pygmented} + + +\section{Numbering lines} + +The lines of a listing can be numbered. The followig options control +numbering of lines. +\begin{itemize} + \item Line numbering is enabled or disable with the \verb|linenos| + boolean option. + \item The number used for the first line can be set with the option + \verb|linenostart|. + \item The step between numbered lines can be set with the option + \verb|linenostep|. + \item The space between the line number and the line of the listing + can be set with the option \verb|linenosep|. +\end{itemize} + +In the followig listing you can see a Scheme function to calculate the +factorial of a number. + +\begin{Example} +\begin{pygmented}[lang=scheme,linenos,linenostart=1001,linenostep=2,linenosep=5mm] +;; Building a list of squares from 0 to 9. +;; Note: loop is simply an arbitrary symbol used as +;; a label. Any symbol will do. + +(define (list-of-squares n) + (let loop ((i n) (res '())) + (if (< i 0) + res + (loop (- i 1) (cons (* i i) res))))) +\end{pygmented} +\end{Example} + +\section{Captioning} + +The option \verb|caption| can be used to set a caption for the listing. +The option \verb|label| allows the assignment of a label to the listing. + +Here is an example: + +\begin{Example} +\begin{pygmented}[lang=c++,label=lst:test,caption=A \textbf{C++} example] +// This program adds two numbers and prints their sum. +#include +int main() +{ + int a; + int b; + int sum; + sum = a + b; + std::cout << "The sum of " << a << " and " << b + << " is " << sum << "\n"; + return 0; +} +\end{pygmented} +\end{Example} + +\begin{Example} + Listing \ref{lst:test} is a C++ program. +\end{Example} + +\section{Escaping to \LaTeX{} inside a code snippet} + +The option \verb|texcomments|, if set to \texttt{true}, enables \LaTeX{} +comment lines. That is, LaTex markup in comment tokens is not escaped +so that \LaTeX{} can render it. + +The \verb|mathescape|, if set to \texttt{true}, enables \LaTeX{} math +mode escape in comments. That is, \verb|$...$| inside a comment will +trigger math mode. + +The option \verb|escapeinside|, if set to a string of length two, +enables escaping to \LaTeX{}. Text delimited by these two characters +is read as \LaTeX{} code and typeset accordingly. It has no effect in +string literals. It has no effect in comments if \verb|texcomments| or +\verb|mathescape| is set. + +Some examples follows. + +\begin{Example} +\begin{pygmented}[lang=c++,texcomments] +#include +using namespace std; +main() +{ + cout << "Hello World"; // prints \underline{Hello World} + return 0; +} +\end{pygmented} +\end{Example} + +\begin{Example} +\begin{pygmented}[lang=python,mathescape] +# Returns $\sum_{i=1}^{n}i$ +def sum_from_one_to(n): + r = range(1, n + 1) + return sum(r) +\end{pygmented} +\end{Example} + +\begin{Example} +\begin{pygmented}[lang=c,escapeinside=||] + +if (|\textit{condition}|) + |\textit{command$_1$}| +else + |\textit{command$_2$}| +\end{pygmented} +\end{Example} + + +\section{Enclosing command and environment} + +After being prettified by Pygments, the listings are enclosed in a +command (for \verb|\pyginline|) or in an environment (for +\verb|pygmented| and \verb|includepygmented|). By default +\verb|\pyginline| uses the command \verb|\efbox| from the \texttt{efbox} +package, and \verb|pygmented| and \verb|includepygmented| use the +environment \verb|mdframed| from the \texttt{mdframed} package. + +The enclosing command or environment should be configurable using a list +of key-value pairs written between square brackets. + +The enclosing command for +\verb|\pyginline| can be changed with the option +\verb|inline method|. For instance, in the following the command +\verb|\tcbox| from the \verb|tcolorbox| package is used: + +\begin{Example} + In the previous Java program, + \pyginline[lang=java,inline method=tcbox]|"Factorial of "| is a + literal string. +\end{Example} + +The enclosing environment for \verb|pygmented| and +\verb|includepygmented| can be changed with the option +\verb|boxing method|. For instance, here is a hello world program in +C\#, enclosed in a \verb|tcolorbox| environment: + +\begin{Example} +\begin{pygmented}[lang=csharp,boxing method=tcolorbox] +using System; +class Program +{ + public static void Main(string[] args) + { + Console.WriteLine("Hello, world!"); + } +} +\end{pygmented} +\end{Example} + +Any option unknown to Pygmen\TeX{} are passed to the enclosing command +or environment. + +For instance: + +\begin{Example} +\begin{pygmented}[lang=xml,boxing method=tcolorbox,colframe=red,boxrule=2mm] + + + Tove + Jani + Reminder + Don't forget me this weekend! + +\end{pygmented} +\end{Example} + +\section{Setting global options for Pygmen\TeX{}} + +Global options can be setting using the \verb|setpygmented| command. +See the examples that follows. + +\begin{Example} +\setpygmented{lang=haskell, colback=red!30, font=\ttfamily\small} + +\begin{pygmented}[] +sum :: Num a => [a] -> a +sum [] = 0 +sum (x:xs) = x + sum xs +\end{pygmented} +\end{Example} + +\begin{Example} +\begin{pygmented}[colback=blue!20, boxing method=tcolorbox] +elem :: Eq a => a -> [a] -> Bool +elem _ [] = False +elem x (y:ys) = x == y || elem x ys +\end{pygmented} +\end{Example} + +\begin{Example} +\setpygmented{lang=snobol} + +\begin{pygmented}[] + OUTPUT = "What is your name?" + Username = INPUT + OUTPUT = "Thank you, " Username +END +\end{pygmented} +\end{Example} + +\begin{Example} +\setpygmented{test/.style={colback=yellow!33,boxing method=tcolorbox,colframe=blue}} + +\begin{pygmented}[test, lang=vbnet] +Module Module1 + Sub Main() + Console.WriteLine("Hello, world!") + End Sub +End Module +\end{pygmented} +\end{Example} + +\begin{Example} +\begin{pygmented}[lang=tcl] +puts "Hello, world!" +\end{pygmented} +\end{Example} + +\section{More examples of inline code snippets} + +\begin{Example} + An inline source code snippet: + \pyginline[lang=c]|const double alfa = 3.14159;|. + This is a C declaration with initialization. +\end{Example} + +\begin{Example} + \pyginline[lang=prolog,colback=yellow]=avo(A,B) :- pai(A,X), pai(X,B).= + is a Prolog clause. Its head is + \pyginline[lang=prolog,sty=emacs,colback=yellow,linecolor=red]=avo(A,B)= + and its body is + \pyginline[lang=prolog,sty=vim,colback=black,hidealllines]=pai(A,X), pai(X,B)=. +\end{Example} + +\begin{Example} + See the identifier \pyginline[inline method=efbox,colback=green!25]|variable|, + which names something. String literals in C looks like + \pyginline[lang=c,inline method=tcbox,colback=blue!20,boxrule=2pt]|"hello, world!\n"|. +\end{Example} + +\setpygmented{colback=shadecolor} + +\begin{Example} + This one + \pyginline[lang=ocaml,font=\ttfamily\scriptsize,topline=false]:let x = [1;2;3] in length x: + is an OCaml expression with local bindings. With OCaml one can do + imperative, functional and object oriented programming. +\end{Example} + +\begin{Example} + Now some Java code: + \pyginline[lang=java,sty=colorful,font=\ttfamily\itshape,linewidth=1pt]|public int f(double x)|. + This is a method header. +\end{Example} + +\section{More examples of displayed code snippets} + +\setpygmented{lang=scheme,colback=shadecolor,sty=emacs} + +In listing \ref{lst:fact} you can see a function definition in the +Scheme language. This function computes the factorial of a natural +number. +\newline\rule{\linewidth}{2pt} +\begin{pygmented}[ + sty=emacs, + linenos, + label=lst:fact, + caption=A Scheme function. + ] +(define fact + (lambda (n) + (if (= n 0) + 1 + (* n (fact (- n 1)))))) +\end{pygmented} + +Here you have some more code to further testing the package. Listing +\ref{lst:haskell} is a Haskell program. When run this program interacts +with the user asking the user name, reading a line input by the user, +and showing a greeting message to the user. + +\inputpygmented[% + lang=haskell, + linenos, + linenostart=79831, + innerlinecolor=yellow, innerlinewidth=6pt, + middlelinecolor=blue, middlelinewidth=10pt, + outerlinecolor=green, outerlinewidth=12pt, + roundcorner=4, + colback=shadecolor, + caption=A haskell interactive program, + label=lst:haskell, + ]{pygmentex_demo.hs} + +This is a rule: + +\noindent\rule{\linewidth}{2pt} + +Now a Pascal procedure: + +\inputpygmented[ + lang=delphi, + linewidth=1.5pt, + font=\ttfamily\sffamily\large, + colback=yellow + ]{pygmentex_demo.delphi} +and a Pascal program +\inputpygmented[lang=pascal,linenos,linenostart=5801]{pygmentex_demo.pas} + +A Python code snippet: + +\inputpygmented[ + lang=python, + sty=emacs, + linenos, + linenostep=3, + linewidth=1pt, + colback=lightgreen + ]{pygmentex_demo.py} + +\section{Using code snippets in environments} + +The following is a \textbf{description} environment. + +\begin{description} + \item[An item] \lipsum[31] + \begin{pygmented}[lang=scala,colback=yellow, + % title=Item A + ] +def qsort(xs: List[Int]): List[Int] = + xs match { + case Nil => + Nil + case pivot :: tail => + qsort(tail filter { _ < pivot }) ::: + pivot :: qsort(tail filter { _ >= pivot }) + } + \end{pygmented} + \lipsum[32] + + \item[Another item] \lipsum[33] + \begin{pygmented}[lang=lua,colback=yellow] +function entry0 (o) + N=N + 1 + local title = o.title or '(no title)' + fwrite('
  • %s\n', N, title) +end + \end{pygmented} + \lipsum[34] +\end{description} + +\section{A long program} + +Here you can read the source code for a hand written lexical analyser +for the \emph{straight-line} programming language that I have developed +in Java. + +\inputpygmented[boxing method=mdframed,lang=java,sty=autumn,colback=red!8,font=\ttfamily\small,tabsize=2,frametitle=\emph{Ad hoc} lexical analyser]{pygmentex_demo.java} + +\section{Some fancy examples using \texttt{tcolorbox}} + +The followig example uses \texttt{tcolorbox} to typeset the code +listing. + +\newcounter{example} +\newlength{\examlen} +\colorlet{colexam}{red!75!black} + +\begin{pygmented}[boxing method=tcolorbox,lang=scala, + title=Example \arabic{example}: hello from \texttt{Scala}, + code={\refstepcounter{example}% + \settowidth{\examlen}{\Large\bfseries Example \arabic{example}}},% + coltitle=colexam,fonttitle=\Large\bfseries, + enhanced,breakable, + before=\par\medskip, + parbox=false, + frame hidden,interior hidden,segmentation hidden, + boxsep=0pt,left=0pt,right=3mm,toptitle=2mm,pad at break=0mm, + overlay unbroken={\draw[colexam,line width=1pt] (frame.north west) + --([xshift=-0.5pt]frame.north east)--([xshift=-0.5pt]frame.south east) + --(frame.south west); + \draw[colexam,line width=2pt] ([yshift=0.5pt]frame.north west) + -- +(\examlen,0pt);}, + overlay first={\draw[colexam,line width=1pt] (frame.north west) + --([xshift=-0.5pt]frame.north east)--([xshift=-0.5pt]frame.south east); + \draw[red!75!black,line width=2pt] ([yshift=0.5pt]frame.north west) + -- +(\examlen,0pt);}, + overlay middle={\draw[colexam,line width=1pt] ([xshift=-0.5pt]frame.north east) + --([xshift=-0.5pt]frame.south east); }, + overlay last={\draw[colexam,line width=1pt] ([xshift=-0.5pt]frame.north east) + --([xshift=-0.5pt]frame.south east)--(frame.south west);}% + ] +object HelloWorld extends App { + println("Hello, world!") +}\end{pygmented} + +\begin{pygmented}[boxing method=tcolorbox,lang=java, + enhanced,colback=blue!10!white,colframe=orange,top=4mm, + enlarge top by=\baselineskip/2+1mm, + enlarge top at break by=0mm,pad at break=2mm, + fontupper=\normalsize, + overlay unbroken and first={% + \node[rectangle,rounded corners,draw=black,fill=blue!20!white, + inner sep=1mm,anchor=west,font=\small] + at ([xshift=4.5mm]frame.north west) {\strut\textbf{My fancy title}};}, + ] +public class Hello { + public static void main(String[] args) { + System.out.println("Hello, world!") + } +} +\end{pygmented} + +\begin{pygmented}[boxing method=tcolorbox,lang=haskell, + enhanced,sharp corners=uphill, + colback=blue!25!white,colframe=blue!25!black,coltext=blue!90!black, + fontupper=\Large\bfseries,arc=6mm,boxrule=2mm,boxsep=5mm, + borderline={0.3mm}{0.3mm}{white} + ] +module Main (main) where + +main :: IO () +main = putStrLn "Hello, world!" +\end{pygmented} + +\begin{pygmented}[boxing method=tcolorbox,lang=c++, + enhanced,frame style image=blueshade.png, + opacityback=0.75,opacitybacktitle=0.25, + colback=blue!5!white,colframe=blue!75!black, + title=My title + ] +#include +using namespace std; +int main(int argc, char** argv) { + cout << "Hello, world!" << endl; + return 0; +} +\end{pygmented} + +\begin{pygmented}[boxing method=tcolorbox,lang=d, + enhanced,attach boxed title to top center={yshift=-3mm,yshifttext=-1mm}, + colback=blue!5!white,colframe=blue!75!black,colbacktitle=red!80!black, + title=My title,fonttitle=\bfseries, + boxed title style={size=small,colframe=red!50!black} + ] +/* This program prints a + hello world message + to the console. */ + +import std.stdio; + +void main() +{ + writeln("Hello, World!"); +} +\end{pygmented} + + +\section{Some fancy examples using \texttt{mdframed}} + +The followig example uses \texttt{mdframed} to typeset the code listing. + +\global\mdfdefinestyle{exampledefault}{% + linecolor=red,linewidth=3pt,% + leftmargin=1cm,rightmargin=1cm +} + +\begin{pygmented}[boxing method=mdframed,lang=ada,style=exampledefault] +with Ada.Text_IO; + +procedure Hello_World is + use Ada.Text_IO; +begin + Put_Line("Hello, world!"); +end; +\end{pygmented} + +\global\mdfapptodefinestyle{exampledefault}{% + topline=false,bottomline=false, +} + +\begin{pygmented}[boxing method=mdframed,lang=pascal,style=exampledefault,frametitle={Saying \emph{hello} from Pascal}] +program HelloWorld; + +begin + WriteLn('Hello, world!'); +end. +\end{pygmented} + +\global\mdfdefinestyle{separateheader}{% + frametitle={% + \tikz[baseline=(current bounding box.east),outer sep=0pt] + \node[anchor=east,rectangle,fill=blue!20] + {\strut Saying \emph{hello} in Modula-2};}, + innertopmargin=10pt,linecolor=blue!20,% + linewidth=2pt,topline=true, + frametitleaboveskip=\dimexpr-\ht\strutbox\relax, + frametitlerule=false, + backgroundcolor=white, +} + +\begin{pygmented}[boxing method=mdframed,lang=modula2,style=separateheader] +MODULE Hello; +FROM STextIO IMPORT WriteString; +BEGIN + WriteString("Hello World!"); +END Hello. +\end{pygmented} + + +\tikzset{titregris/.style = + {draw=gray, thick, fill=white, shading = exersicetitle, % + text=gray, rectangle, rounded corners, right,minimum height=.7cm}} +\pgfdeclarehorizontalshading{exersicebackground}{100bp} + {color(0bp)=(green!40); color(100bp)=(black!5)} +\pgfdeclarehorizontalshading{exersicetitle}{100bp} + {color(0bp)=(red!40);color(100bp)=(black!5)} +\newcounter{exercise} +\renewcommand*\theexercise{Exercise~n\arabic{exercise}} +\makeatletter +\def\mdf@@exercisepoints{}%new mdframed key: +\define@key{mdf}{exercisepoints}{% + \def\mdf@@exercisepoints{#1} +} +\mdfdefinestyle{exercisestyle}{% + outerlinewidth=1em,outerlinecolor=white,% + leftmargin=-1em,rightmargin=-1em,% + middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray, + apptotikzsetting={\tikzset{mdfbackground/.append style ={% + shading = exersicebackground}}}, + innertopmargin=1.2\baselineskip, + skipabove={\dimexpr0.5\baselineskip+\topskip\relax}, + skipbelow={-1em}, + needspace=3\baselineskip, + frametitlefont=\sffamily\bfseries, + settings={\global\stepcounter{exercise}}, + singleextra={% + \node[titregris,xshift=1cm] at (P-|O) % + {~\mdf@frametitlefont{\theexercise}\hbox{~}}; + \ifdefempty{\mdf@@exercisepoints}% + {}% + {\node[titregris,left,xshift=-1cm] at (P)% + {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}% + }, + firstextra={% + \node[titregris,xshift=1cm] at (P-|O) % + {~\mdf@frametitlefont{\theexercise}\hbox{~}}; + \ifdefempty{\mdf@@exercisepoints}% + {}% + {\node[titregris,left,xshift=-1cm] at (P)% + {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}% + }, +} +\makeatother + +\begin{pygmented}[boxing method=mdframed,lang=go,style=exercisestyle] +// hello world in 'go' +package main + +import "fmt" + +func main() { + fmt.Println("Hello, world!") +} +\end{pygmented} + +\begin{pygmented}[boxing method=mdframed,lang=objective-c,style=exercisestyle,exercisepoints=10] +/* hello from objective-c */ + +#import +#import + +int main(void) +{ + NSLog(@"Hello, world!\n"); + return 0; +} +\end{pygmented} + +\mdfdefinestyle{another}{% + linecolor=red,middlelinewidth=2pt,% + frametitlerule=true,% + apptotikzsetting={\tikzset{mdfframetitlebackground/.append style={% + shade,left color=white, right color=blue!20}}}, + frametitlerulecolor=green!60, + frametitlerulewidth=1pt, + innertopmargin=\topskip, +} + +\begin{pygmented}[boxing method=mdframed,lang=c,style=another,frametitle={Hello from C}] +#include +int main(int argc, char **argv) { + printf("Hello, world!\n"); + return 0; +} +\end{pygmented} + + +\section{Conclusion} + +That is all. + +\end{document} diff --git a/macros/latex/contrib/suftesi/suftesi.dtx b/macros/latex/contrib/suftesi/suftesi.dtx index ff9d6bb38f..470dc9efdb 100644 --- a/macros/latex/contrib/suftesi/suftesi.dtx +++ b/macros/latex/contrib/suftesi/suftesi.dtx @@ -56,12 +56,13 @@ This work has the LPPL maintenance status "author-maintained". %\NeedsTeXFormat{LaTeX2e}[2005/12/01] %\ProvidesClass{suftesi} %<*class> - [2020/06/26 v2.9.10 A class for typesetting theses, books and articles] + [2020/12/21 v2.9.11 A class for typesetting theses, books and articles] % %<*driver> \documentclass[12pt]{ltxdoc} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} +\usepackage[fontsize=12pt]{fontsize} \usepackage[greek.ancient,english]{babel} %-------------------------------------------------------- % GRAPHICS @@ -120,10 +121,14 @@ This work has the LPPL maintenance status "author-maintained". % OTHER PACKAGES % -------------------------------------------------------- \usepackage[autostyle]{csquotes} -\usepackage[style=philosophy-classic,backend=biber]{biblatex} +\usepackage[style=philosophy-classic]{biblatex} \addbibresource{suftesi.bib} \DeclareBibliographyCategory{pkgs-loaded} -\addtocategory{pkgs-loaded}{appendix,caption,color,crop,enumitem,emptypage,fancyhdr,fixltxhyph,fontenc,fontsize,mathalpha,libertinust1math,newtx,geometry,iftex,microtype,multicol,titlesec,titletoc,xkeyval,cclicenses,fontenc,substitutefont,luatex85,lm,textcomp,newpx,biolinum,inconsolata,libertine,cochineal,mathpazo,bera,amsthm} +\addtocategory{pkgs-loaded}{appendix,caption,color,crop,enumitem,emptypage, +fancyhdr,fixltxhyph,fontenc,fontsize,mathalpha,libertinust1math,newtx,geometry, +iftex,microtype,multicol,titlesec,titletoc,xkeyval,cclicenses,fontenc, +substitutefont,luatex85,lm,textcomp,newpx,biolinum,inconsolata,libertine, +cochineal,mathpazo,bera,amsthm} \usepackage{array} \usepackage{booktabs} \usepackage{multirow} @@ -144,23 +149,20 @@ This work has the LPPL maintenance status "author-maintained". \newenvironment{ttquote}{% \begin{mdframed}\ttfamily\microtypesetup{activate=false}}{\end{mdframed}} \newenvironment{latexcode}{\begin{mdframed}}{\end{mdframed}} -% Correct (?) \optitem to use \meta inside #2 \makeatletter -\renewcommand*{\ltd@ol@optitem}[3][]{% +% Customizing option and value list: +\renewcommand*{\ltd@ol@optitem}[3][]{%To use \meta inside #2 \ifblank{#1} {\ltd@option{}{#2}{#3}{}} {\ltd@option{}{#2}{#3}{\ltd@textverb{#1}}}}% -\renewenvironment*{valuelist}[1][] -{\list{}{% - \ifblank{#1} - {\setlength{\labelwidth}{5em}} - {\setlength{\labelwidth}{#1}}% - \setlength{\labelsep}{1em}% - \setlength{\leftmargin}{\labelwidth}% - \addtolength{\leftmargin}{\labelsep}% - \setlength{\itemsep}{0pt}% - \renewcommand*{\makelabel}[1]{\valuelistfont##1\hss}}} -{\endlist} +\patchcmd{\optionlist}{\marglistwidth}{0pt}{}{} +\patchcmd{\optionlist}{\hss}{\phantom{\rule{1pt}{20pt}}\hss}{}{} +\patchcmd{\ltd@option@i}{\linewidth}{\linewidth-\marglistwidth}{}{} +\pretocmd{\valuelist}{\let\optionlistfont\valuelistfont}{}{} +\patchcmd{\ltxsyntax}{\marglistwidth}{0pt}{}{} +\patchcmd{\ltd@option@i}{=}{\ = }{}{} +\expandafter\patchcmd\csname\string\valuelist\endcsname{{\leftmargin}{\labelsep}}{{\leftmargin}{3\labelsep}}{}{} +% New color for items \newcommand*{\valuelistfont}{% \color{olive}\sffamily\displayverbfont} \renewcommand*{\optionlistfont}{% @@ -190,7 +192,8 @@ This work has the LPPL maintenance status "author-maintained". \def\latintxt{Aliquam auctor, pede consequat laoreet varius, eros tellus maris quam, pellentesque hendrerit.} \def\latintxtb{Morbi luctus, wisi viverra faucibus pretium, - nibh est placerat.} + nihil est placerat pro cuius loquentis verba. Sed maleficium in quibusdam + aeternitaem manet.} \def\greektxt{Πρῶτον εἰπεῖν περὶ τί καὶ τίνος ἐστὶν ἡ σκέψις, ὅτι περὶ ἀπόδειξιν καὶ ἐπιστήμης ἀποδεικτικῆς· εἶτα διορίσαι τί ἐστι πρότασις καὶ τί ὅρος καὶ τί συλλογισμός} @@ -204,14 +207,18 @@ This work has the LPPL maintenance status "author-maintained". \usepackage{hyperref} \hypersetup{% hidelinks, - pdftitle={User's Guide to \textsf{suftesi}}, - pdfsubject={A document class for typesetting theses, - books and articles}, - pdfauthor={Ivan Valbusa}, - pdfkeywords={thesis, humanities, books}} + pdftitle={User's guide to \textsf{suftesi}}, + pdfsubject={A document class for typesetting theses, + books and articles}, + pdfauthor={Ivan Valbusa}, + pdfkeywords={thesis, humanities, books}} % -------------------------------------------------------- % FINAL SETTINGS % -------------------------------------------------------- +\setcounter{tocdepth}{2} +\widowpenalty=10000 +\clubpenalty=10000 + \EnableCrossrefs \CodelineIndex \RecordChanges @@ -223,7 +230,7 @@ This work has the LPPL maintenance status "author-maintained". % % \fi % -% \CheckSum{5386} +% \CheckSum{5398} % % \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 @@ -241,6 +248,7 @@ This work has the LPPL maintenance status "author-maintained". % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % +% \changes{v2.9.11}{2020/12/21}{New page layouts: \opt{pocketa}, \opt{pocketb}, \opt{pocketc}. New commands \cmd{breakinbody}, \cmd{breakinbodyleft}, \cmd{breakintoc} (old names: \cmd{headbreak} and \cmd{xheadbreak}). Changed definitions of \cmd{appendixpagename}, \cmd{appendixtocname} and \cmd{appendixname} commands (default: english). The \cmd{part} command has been completely redefined. Updated documentation.} % \changes{v2.9.10}{2020/06/26}{Corrected a bug using the \env{otherlanguage} environment with \opt{greekfont} option. Updated documentation.} % \changes{v2.9.9}{2020/05/21}{Removed a bug with \cmd{appendix} and roman chapter numbers in table of contents. Updated documentation.} % \changes{v2.9.8}{2020/02/24}{Removed license restrictions. Updated documentation.} @@ -359,7 +367,7 @@ This work has the LPPL maintenance status "author-maintained". % \section*{Legalese} % ^^A % ^^A ---------------------------------------------------------------- -% +% % \noindent Copyright \copyright\ 2009-\the\year\ Ivan Valbusa % \smallskip % @@ -385,7 +393,7 @@ This work has the LPPL maintenance status "author-maintained". % % \begin{center} % {\color{philA}\bfseries\sffamily -% \Huge User's Guide to \texttt{suftesi}\\[3mm]} +% \huge User's guide to \texttt{suftesi}\\[3mm]} % {\large\bfseries\sffamily A document class for typesetting theses, books and articles} % \vspace{.8cm} % @@ -417,8 +425,6 @@ This work has the LPPL maintenance status "author-maintained". % ^^A % ^^A ---------------------------------------------------------------- % -% \clearpage -% % % ^^A ---------------------------------------------------------------- % ^^A @@ -427,13 +433,13 @@ This work has the LPPL maintenance status "author-maintained". % ^^A ---------------------------------------------------------------- % % The \sty{suftesi} class was born as a result of the course \emph{Introduzione - % a \hologo{LaTeX} per le scienze umane} (\emph{Introduction to \hologo{LaTeX} for the human - % sciences}) which I held at the Graduate School of Human Sciences and Philosophy -% (\textcolor{magenta}{\textbf{S}}cienze \textcolor{magenta}{\textbf{U}}mane e -% \textcolor{magenta}{\textbf{F}}ilosofia) of Verona University (Italy) in June -% 2010. Originally thought as a class to typeset theses, during these years +% a \hologo{LaTeX} per le scienze umane} (\emph{Introduction to \hologo{LaTeX} for +% the Human Sciences}) which I held at the Graduate School of Human Sciences and +% Philosophy (\textcolor{sufred}{\textbf{S}}cienze \textcolor{sufred}{\textbf{U}}mane +% e \textcolor{sufred}{\textbf{F}}ilosofia) of Verona University (Italy) in June +% 2010. Originally thought as a class to typeset theses, through the years % it has developed many new features and styles. Finally it has become the -% referential class of the Joint Project \emph{Formal Style for PhD +% referential class of the Joint Project \emph{Formal Style for PhD % Theses with \hologo{LaTeX}} of the University of Verona. % % ^^A ---------------------------------------------------------------- @@ -443,7 +449,8 @@ This work has the LPPL maintenance status "author-maintained". % ^^A ---------------------------------------------------------------- % % I would like to thank Professors Paola Di~Nicola, -% Director of the Graduate School, and Ugo Savardi who suggested to propose +% Director of the Graduate School of Human Sciences and +% Philosophy, and Ugo Savardi who suggested to propose % the course precisely to that School; Gilberto D'Arduini, Matteo Lanza and % Antonio Rinaldi, who installed \hologo{LaTeX} on the computers used during the course; % Catia Cordioli, for her help in the organization of the lessons; @@ -453,7 +460,7 @@ This work has the LPPL maintenance status "author-maintained". % for the \TeX pert support and his priceless ``magic formulas'', and Tommaso % Gordini for his valuable advice in choosing and improving the class % features during these years. I would finally thank all the participants -% to the course who patiently resisted the four intensive lessons. +% to the course who patiently endured the four intensive lessons. % This work is dedicated to them. % % ^^A ---------------------------------------------------------------- @@ -474,9 +481,9 @@ This work has the LPPL maintenance status "author-maintained". % the page dimensions (\opt{a4paper}, \opt{a5paper}, \opt{b5paper}, %\opt{legalpaper}, \opt{executivepaper} and \opt{landscape}), which are % automatically disabled. The class loads the packages listed in -% the following table. +% table \ref{tab:pkgloaded}. % -% \begin{table}[h] +% \begin{table} % \centering % \begin{tabular}{>{\sffamily}r@{}>{\sffamily}l>{\raggedright\arraybackslash}>{\sffamily}p{9.6cm}} % \toprule @@ -525,7 +532,7 @@ This work has the LPPL maintenance status "author-maintained". % % ^^A ---------------------------------------------------------------- % ^^A -% \subsection{Document structure} +% \subsection{Document structures} % ^^A % ^^A ---------------------------------------------------------------- % @@ -553,7 +560,48 @@ This work has the LPPL maintenance status "author-maintained". % useful as they show the output in its real size. See section % \ref{sec:page-styles} for details. % -%\begin{table}[h] +% You can define your own layouts through the \cmd{geometry} command +% and you can change the value of \cmd{baselineskip} too. For example +% you can resize the typeblock of the \texttt{supercompactaureo} layout +% to fit particular needs, or simply because the font used requires +% a smaller line width. Remember that if you change the line spacing with +% the \cmd{linespread} command, you need to add \cmd{normalsize}. As you can see +% in the following example, you can change many aspects of the layout, +% using the parameters available for the \cmd{geometry} command. Here we have +% modified also the margin ratio, the value of the upper margin and the +% distance between the head and the beginning of the text. For the other parameters +% sees the documentation of the \sty{geometry} package \parencite{geometry}. +% \medskip +% +%\begin{minipage}{.4\textwidth} +%\begin{latexcode} +%\begin{verbatim} +%\linespread{0.956} +%\normalsize +%\geometry{ +% ignoreall, +% paperwidth = 140mm, +% paperheight = 210mm, +% textheight = 165mm, +% textwidth = 100mm, +% marginratio = 1:1, +% top = 2.07cm, +% headsep = 5.5mm, +% heightrounded} +%\end{verbatim} +% \end{latexcode} +%\end{minipage} +%\hfill +%\begin{minipage}{.555\textwidth} +%\begin{tikzpicture}[scale=2.81] +%\draw (0,0) rectangle (1.40cm,2.10cm); +%\draw[xshift=2mm,yshift=2.25mm,fill=gray!20,draw=none] (0,0) rectangle (1.00cm,1.65cm); +%\draw[xshift=1.6cm,yshift=2.25mm,fill=gray!20,draw=none] (0,0) rectangle (1.00cm,1.65cm); +%\draw[xshift=1.40cm] (0,0) rectangle (1.40cm,2.10cm); +%\end{tikzpicture} +%\end{minipage} +% +%\begin{table} %\centering %\begin{tabular}{@{}lccccr@{\,$:$\,}lr@{\,$:$\,}lcr@{\,$:$\,}l@{}} %\toprule @@ -593,35 +641,14 @@ This work has the LPPL maintenance status "author-maintained". % \opt{periodical} & 110 & 165 & 170 & 240 & $2$ & $3$ & $2$ & $3$ & 2\,:\,3 & $1$ & $\sqrt{2}$ \\ % \opt{periodicalaureo} & 120 & 194 & 170 & 240 & $2$ & $3$ & $2$ & $3$ & % 5\,:\,8\makebox[0pt]{\ \textsuperscript{*}} & $1$ & $\sqrt{2}$ \\ +% \opt{pocketa} & 102 & 153 & 135 & 208 & $2$ & $3$ & $1$ & $1$ & 2\,:\,3 & $2$ & $3$ \\ +% \opt{pocketb} & 99 & 165 & 140 & 210 & $2$ & $3$ & $1$ & $1$ & 3\,:\,5 & $2$ & $3$ \\ +% \opt{pocketc} & 90 & 150 & 116 & 193 & $2$ & $3$ & $1$ & $1$ & 3\,:\,5 & $3$ & $5$ \\ %\bottomrule\\[-2ex] %\multicolumn{12}{r}{\footnotesize\textsuperscript{*}5\,:\,8\,$\approx$\,1\,:\,1,618} %\end{tabular}\\[-3ex] %\caption{The layouts of \sty{suftesi}}\label{tab:layouts} %\end{table} -% -% You can define your own layouts through the \cmd{geometry} command -% and you can change the value of \cmd{baselineskip} too. For example -% you can resize the typeblock of the \texttt{supercompactaureo} layout -% to fit your particular needs. In this case remember to declare -% \cmd{normalsize} like in the following example: -% -% \begin{latexcode} -%\begin{verbatim} -%\linespread{0.95} -%\normalsize -%\geometry{ -% textheight= 162mm, -% textwidth= 100mm, -% paperwidth= 140mm, -% paperheight= 210mm, -% hmarginratio= 2:3, -% vmarginratio= 1:1, -% marginparwidth= 11mm, -% marginparsep= 7pt, -% ignoreall, -% heightrounded} -%\end{verbatim} -% \end{latexcode}% % ^^A The form of the book has been changing through the centuries and every content requires a particular shape. Nowdays the most widespread form for literary essays is a compact one. So, if you are interested in such a topic, you should consider the compact layouts. The one I prefer is shown on figure \ref{fig:periodicalaureo}. % % ^^A\begin{figure}[h!]\centering @@ -657,7 +684,7 @@ This work has the LPPL maintenance status "author-maintained". % (see section \ref{sec:options} for details). % % Today there are several Garamond-like fonts in \TeX~Live distribution. -% See, for example Garamond Libre (OpenType only) and Cormorant Garamond. +% See, for example Garamond Libre and Cormorant Garamond. % The Bembo-like fonts Etbb and fbb should also be considered if you % appreciate humanist fonts. In any case, before using a font, read the % license carefully. @@ -666,7 +693,7 @@ This work has the LPPL maintenance status "author-maintained". % bold weight and mathematical support, is made available by the % \sty{garamondx} package by Michael Sharpe, which provides an extension % of the \sty{ugm} fonts, (URW)++ GaramondNo8 (see the License note in the -% package documentation at the web page \url{https://www.ctan.org/pkg/garamondx}. +% package documentation at the web page \url{https://www.ctan.org/pkg/garamondx}). % They are not distributed as part of \TeX~Live, but they may be downloaded % using the \texttt{getnonfreefonts} script. See the instructions for % installation at \url{http://tug.org/fonts/getnonfreefonts/}. @@ -759,26 +786,26 @@ This work has the LPPL maintenance status "author-maintained". % \opt{defaultfont=none} option. % % \begin{mdframed}[backgroundcolor=philA!10,linecolor=white]\vskip-\baselineskip -% \greekexample{Cochineal-LF}{Cochineal-LF}{Cochineal/Cochineal}{\mygrsize} -% \greekexample{Cochineal-LF}{bodoni}{Cochineal/Bodoni}{\mygrsize} -% \greekexample{Cochineal-LF}{artemisia}{Cochineal/Artemisia}{\mygrsize} -% \greekexample{Cochineal-LF}{porson}{Cochineal/Porson}{\mygrsize} -% \greekexample{Cochineal-LF}{lmr}{Cochineal/CB Greek}{\mygrsize} -% \greekexample{LinuxLibertineT-OsF}{LinuxLibertineT-OsF}{Libertine/Libertine}{\mygrsize} -% \greekexample{LinuxLibertineT-OsF}{bodoni}{Libertine/Bodoni}{\mygrsize} -% \greekexample{LinuxLibertineT-OsF}{artemisia}{Libertine/Artemisia}{\mygrsize} -% \greekexample{LinuxLibertineT-OsF}{porson}{Libertine/Porson}{\mygrsize} -% \greekexample{LinuxLibertineT-OsF}{lmr}{Libertine/CB Greek}{\mygrsize} -% \greekexample{zplosf}{bodoni}{New PX/Bodoni}{\mygrsize} -% \greekexample{zplosf}{artemisia}{New PX/Artemisia}{\mygrsize} -% \greekexample{zplosf}{porson}{New PX/Porson}{\mygrsize} -% \greekexample{zplosf}{lmr}{New PX/CB Greek}{\mygrpxsize} -% \greekexample{lmr}{cbgreek}{Latin Modern/CB Greek}{\mygrsize} +%\greekexample{Cochineal-LF}{Cochineal-LF}{Cochineal/Cochineal}{12.15} +%\greekexample{Cochineal-LF}{bodoni}{Cochineal/Bodoni}{11.25} +%\greekexample{Cochineal-LF}{artemisia}{Cochineal/Artemisia}{11.8} +%\greekexample{Cochineal-LF}{porson}{Cochineal/Porson}{\mygrsize} +%\greekexample{Cochineal-LF}{lmr}{Cochineal/CB Greek}{\mygrsize} +%\greekexample{LinuxLibertineT-OsF}{LinuxLibertineT-OsF}{Libertine/Libertine}{\mygrsize} +%\greekexample{LinuxLibertineT-OsF}{bodoni}{Libertine/Bodoni}{11.2} +%\greekexample{LinuxLibertineT-OsF}{artemisia}{Libertine/Artemisia}{11.7} +%\greekexample{LinuxLibertineT-OsF}{porson}{Libertine/Porson}{\mygrsize} +%\greekexample{LinuxLibertineT-OsF}{lmr}{Libertine/CB Greek}{\mygrsize} +%\greekexample{zplosf}{bodoni}{New PX/Bodoni}{11.8} +%\greekexample{zplosf}{artemisia}{New PX/Artemisia}{12.5} +%\greekexample{zplosf}{porson}{New PX/Porson}{12.9} +%\greekexample{zplosf}{lmr}{New PX/CB Greek}{12.9} +%\greekexample{lmr}{cbgreek}{Latin Modern/CB Greek}{\mygrsize} % \end{mdframed} % % ^^A ---------------------------------------------------------------- % ^^A -% \subsection{The cover page} +% \subsection{Cover page} % ^^A % ^^A ---------------------------------------------------------------- % @@ -798,18 +825,17 @@ This work has the LPPL maintenance status "author-maintained". %\Cpagecolor{white!90!black} %\Ctextcolor{white} %\Cfootcolor{black} -% %\makecover[ball color=DarkBlue,draw=none] %\end{verbatim} % \end{latexcode} % % To produce a complete book cover, with spine and dust jacket, you should -% take a look at the \sty{bookcover} package by Tibor Tómács. +% take a look at the \sty{bookcover} class by Tibor \textcite{bookcover}. % % % ^^A ---------------------------------------------------------------- % ^^A -% \subsection{The frontispiece} \enlargethispage{\baselineskip} +% \subsection{Frontispiece} % ^^A % ^^A ---------------------------------------------------------------- % @@ -818,7 +844,7 @@ This work has the LPPL maintenance status "author-maintained". %\centering %\begin{tikzpicture}[scale=0.4]% %\draw[draw=gray,fill=white,drop shadow] (-\textwidth,0) rectangle (\textwidth,.9\textheight); -%\draw[line width=.1mm,fill=black!70,text=white,draw=black!300] (-4.2,18.1) circle (13mm) node {\parbox{10mm}{\centering\tiny ---*---\\ St. Anford\\ University\\ ---*--- }}; +%\draw[line width=.1pt,draw=black] (-4.2,18.1) circle (13mm) node {\parbox{10mm}{\centering\tiny ---*---\\[-.5mm] St. Anford\\ University\\ ---*--- }}; % \node[scale=0.4,anchor=north west] at (-2.5cm,19cm) {% % \parbox{8cm}{% % \small University of St. Anford\par @@ -846,7 +872,7 @@ This work has the LPPL maintenance status "author-maintained". % % {\normalsize\sffamily Research supervisors:\par} % \small J. H. Quick\par -% B. L. User\vspace{4cm} +% B. L. User\vspace{3.5cm} % % Thesis submitted in 2010 % } @@ -870,7 +896,7 @@ This work has the LPPL maintenance status "author-maintained". % {\smallskip\normalsize How to survive in the modern societies\\} % % {\vspace*{2\baselineskip}\scriptsize edited by\\ Walker Texas Ranger\\}}}; -% \node[align=center] at (0,2) {\scriptsize \textcolor{black}{Punch Press}\\\textcolor{black}{\bfseries P\&P}}; +% \node[align=center] at (0,2) {\scriptsize \textcolor{black}{Punch Press}\\\textcolor{black}{\bfseries\small P\&P}}; %\end{tikzpicture} %\caption{A cover page of \sty{suftesi}}\label{fig:cover} %\end{minipage} @@ -910,7 +936,7 @@ This work has the LPPL maintenance status "author-maintained". % % ^^A ---------------------------------------------------------------- % ^^A -% \subsection{The appendices} +% \subsection{Appendices} % ^^A % ^^A ---------------------------------------------------------------- % @@ -924,18 +950,16 @@ This work has the LPPL maintenance status "author-maintained". %\addappheadtotoc % %\begin{document} -%... +%... %\appendixpage % %\begin{appendices} -% % \chapter{First appendix} % Lorem ipsum -% % \chapter{First appendix} % Lorem ipsum -% %\end{appendices} +% %\end{document} %\end{verbatim} % \end{latexcode} @@ -965,7 +989,7 @@ This work has the LPPL maintenance status "author-maintained". % \end{valuelist} % \optitem[standard]{pagelayout}{\opt{standard}\OR\opt{standardaureo}% % \OR\opt{periodical}\OR\opt{periodicalaureo}\OR\opt{compact}\OR -% \opt{compactaureo}\OR\opt{supercompact}\OR\opt{supercompactaureo}} +% \opt{compactaureo}\OR\opt{supercompact}\OR\opt{supercompactaureo}\OR\opt{pocketa}\OR\opt{pocketb}\OR\opt{pocketc}} % \changes{v0.9b}{2012/09/23}{New option \opt{pagestyle}} % \begin{valuelist} % \item[standard] Prints an A4 page with a @@ -993,6 +1017,17 @@ This work has the LPPL maintenance status "author-maintained". % The same as \opt{supercompact} but with % a \emph{golden ratio} typeblock of $\SI{10,8}{cm} \times \SI{17,5}{cm}$. % \end{valuelist} +% \begin{valuelist} +% \item[pocketa] +% Prints a page of $\SI{135}{cm} \times \SI{208}{cm}$ with a typeblock of +% $\SI{102}{cm} \times \SI{153}{cm}$. +% \item[pocketb] +% Prints a page of $\SI{140}{cm} \times \SI{210}{cm}$ with a typeblock of +% $\SI{99}{cm} \times \SI{165}{cm}$. +% \item[pocketc] +% Prints a page of $\SI{116}{cm} \times \SI{193}{cm}$ with a typeblock of +% $\SI{90}{cm} \times \SI{150}{cm}$. +% \end{valuelist} % The details of this option are shown in table \ref{tab:layouts}. % \optitem[final]{version}{\opt{screen}\OR\opt{cscreen}\OR\opt{draft} % \OR\opt{final}} @@ -1026,16 +1061,15 @@ This work has the LPPL maintenance status "author-maintained". % \begin{optionlist} % \optitem[10\OR 10pt]{fontsize}{\meta{dimen}} % Sets the main font sizes for the document, changing the \cmd{baselineskip} -% accordingly (possible values: 10\OR 11pt\OR 10.7\OR 1.2ex\dots). It is based on the \sty{fontsize} package \parencite{fontsize}. -% Remember that using \hologo{XeLaTeX} or \hologo{LuaLaTeX} you can change the default -% font size also with the option \opt{SizeFeatures} of \sty{fontspec}. -% For example: -% -% \begin{latexcode} -%\begin{verbatim} -%\setmainfont[SizeFeatures={Size=11.5}]{Garamond Libre} -%\end{verbatim} -% \end{latexcode} +% accordingly. This option is based on the \sty{fontsize} package \parencite{fontsize}. The \meta{fontsize} can be given in any unit recognized +% by TeX (for example: \opt{6mm}, \opt{1ex}, \opt{11.5pt}). +% If the unit is not declared it defaults to \texttt{pt}. +% If you want to set a specific value for \cmd{baselineskip} +% you have to use the \cmd{changefontsize}\oarm{baselineskip}\arm{fontsize} command. +% Lastly Remember that using \hologo{XeLaTeX} or \hologo{LuaLaTeX} +% you can change the default font size also with the option +% \opt{SizeFeatures} of \sty{fontspec}. +% For example |\setmainfont[SizeFeatures={Size=11.5}]{EB Garamond}|. % % \optitem[cochineal]{defaultfont}{\opt{none}\OR\opt{cochineal} % \OR\opt{libertine}\OR\opt{palatino}\OR\opt{standard}} @@ -1056,9 +1090,7 @@ This work has the LPPL maintenance status "author-maintained". % \item[none] Does not load any Greek font. This is the default with % \hologo{XeLaTeX} or \hologo{LuaLaTeX}. % \item[artemisia] Loads the Artemisia font by the Greek Font Society. -% \item[porson] Loads the Porson font by the Greek Font Society.\footnote{The first code for the Porson font (\sty{suftesi} +% \fi % ^^A ---------------------------------------------------------------- % ^^A -% \section*{The Code} +% \section{The Code} % ^^A % ^^A ---------------------------------------------------------------- -% \addcontentsline{toc}{section}{The Code} -% \iffalse -%<*class> -% \fi +% % \begin{macrocode} \RequirePackage{xkeyval} \newif\ifsuftesi@compatibility @@ -2001,7 +2006,7 @@ This work has the LPPL maintenance status "author-maintained". \newif\ifsuftesi@toccompactsubsec \newif\ifsuftesi@toccompactsubsubsec % \end{macrocode} -% The \sty{suftesi} class is based on the standard \sty{book} class but the following options are disabled as they contrast with the layouts provided by the class. Specifically, the first five options are actually ineffective, while the \opt{landscape} option rotates the page correctly, but sets the text width according to the class options, effectively making it unusable. +% The class is based on the standard \sty{book} class but the following options are disabled as they contrast with the layouts provided by the class. Specifically, the first five options are actually ineffective, while the \opt{landscape} option rotates the page correctly, but sets the text width according to the class options, effectively making it unusable. % \begin{macrocode} \DeclareOption{a4paper}{% \ClassWarningNoLine{suftesi}{Option 'a4paper' not available}{}} @@ -2027,21 +2032,22 @@ This work has the LPPL maintenance status "author-maintained". \ExecuteOptionsX{parindent=\baselineskip} \ProcessOptionsX*\relax % \end{macrocode} -% \subsection*{Document structure} +% \subsection{Options definition} +% \subsubsection{Structure} % \begin{macrocode} \define@choicekey{}{structure}[\val\nr] {book,article,collection}[book]{% \ifcase\nr\relax % \disable@keys{}{secnumstyle} -\def\SUF@chapswitch{\thechapter.} + \def\SUF@chapswitch{\thechapter.} \or -\suftesi@articletrue -\@titlepagefalse -\def\SUF@chapswitch{} + \suftesi@articletrue + \@titlepagefalse + \def\SUF@chapswitch{} \or -\suftesi@collectiontrue - \setkeys{}{headerstyle=authortitleinner} -\def\SUF@chapswitch{} + \suftesi@collectiontrue + \setkeys{}{headerstyle=authortitleinner} + \def\SUF@chapswitch{} \fi} \define@choicekey{}{documentstructure}[\val\nr] {book,article,collection}[book]{% @@ -2056,12 +2062,57 @@ This work has the LPPL maintenance status "author-maintained". \setkeys{}{structure=collection} \fi} % \end{macrocode} -% \subsection*{Page layout} +% \subsubsection{Fonts} +% \paragraph{Roman fonts} +% \begin{macrocode} +\define@choicekey{}{defaultfont}[\val\nr]{% +none,cochineal,libertine,palatino,standard,compatibility}[cochineal]{% +\ifcase\nr\relax + \suftesi@nofonttrue +\or + \suftesi@cochinealtrue +\or + \suftesi@libertinetrue +\or + \suftesi@palatinotrue +\or + \suftesi@standardtrue +\or + \suftesi@compatibilitytrue +\fi} +\define@choicekey{}{mathfont}[\val\nr]{% +none,minimal,extended}[minimal]{% +\ifcase\nr\relax + \suftesi@mathminimalfalse + \suftesi@mathextendedfalse +\or + \suftesi@mathminimaltrue +\or + \suftesi@mathextendedtrue +\fi} +% \end{macrocode} +% \paragraph{Greek fonts} +% \begin{macrocode} +\define@choicekey{}{greekfont}[\val\nr]{% +none,artemisia,porson,bodoni,cbgreek}[none]{% +\ifcase\nr\relax +\suftesi@greekfontfalse +\or + \suftesi@greekfonttrue\suftesi@artemisiatrue +\or + \suftesi@greekfonttrue\suftesi@porsontrue +\or + \suftesi@greekfonttrue\suftesi@bodonitrue +\or + \suftesi@greekfonttrue\suftesi@cbgreektrue +\fi} +% \end{macrocode} +% \subsubsection{Layouts} % \begin{macrocode} \RequirePackage{geometry} \define@choicekey{}{pagelayout}[\val\nr] {standard,standardaureo,periodical,compact,compactaureo,supercompact, - supercompactaureo,periodicalaureo}[standard]{% + supercompactaureo,periodicalaureo,pocketa,pocketb,pocketc}[standard]{% \ifcase\nr\relax \DeclareRobustCommand{\SUF@partsize}{\Large} \DeclareRobustCommand{\SUF@chaptersize}{\Large} @@ -2194,213 +2245,195 @@ This work has the LPPL maintenance status "author-maintained". marginratio= 2:3, marginparwidth= 62pt, marginparsep= 10pt} -\or +\or% pocketa +\suftesi@supercompactaureotrue + \DeclareRobustCommand{\SUF@partsize}{\large} + \DeclareRobustCommand{\SUF@chaptersize}{\large} + \DeclareRobustCommand{\SUF@sectionsize}{\normalsize} + \DeclareRobustCommand{\SUF@subsectionsize}{\normalsize} + \DeclareRobustCommand{\SUF@subsubsectionsize}{\normalsize} + \geometry{ + heightrounded, + includeheadfoot=false, + textheight= 153mm, + textwidth= 102mm, + paperwidth= 135mm, + paperheight= 208mm, + hmarginratio= 1:1, + vmarginratio= 2:3, + marginparwidth= 12mm, + marginparsep= 7pt} +\or% pocketb +\suftesi@supercompactaureotrue + \DeclareRobustCommand{\SUF@partsize}{\large} + \DeclareRobustCommand{\SUF@chaptersize}{\large} + \DeclareRobustCommand{\SUF@sectionsize}{\normalsize} + \DeclareRobustCommand{\SUF@subsectionsize}{\normalsize} + \DeclareRobustCommand{\SUF@subsubsectionsize}{\normalsize} + \geometry{ + heightrounded, + includeheadfoot=false, + textheight= 165mm, + textwidth= 99mm, + paperwidth= 140mm, + paperheight= 210mm, + hmarginratio= 1:1, + vmarginratio= 2:3, + marginparwidth= 15mm, + marginparsep= 7pt} +\or% pocketc +\suftesi@supercompactaureotrue + \DeclareRobustCommand{\SUF@partsize}{\large} + \DeclareRobustCommand{\SUF@chaptersize}{\large} + \DeclareRobustCommand{\SUF@sectionsize}{\normalsize} + \DeclareRobustCommand{\SUF@subsectionsize}{\normalsize} + \DeclareRobustCommand{\SUF@subsubsectionsize}{\normalsize} + \geometry{ + heightrounded, + includeheadfoot=false, + textheight= 150mm, + textwidth= 90mm, + paperwidth= 116mm, + paperheight= 193mm, + hmarginratio= 1:1, + vmarginratio= 2:3, + marginparwidth= 8mm, + marginparsep= 7pt} \fi} % \end{macrocode} -% \subsection*{Sections style} +% \subsubsection{Sections style} % \begin{macrocode} \define@choicekey{}{partstyle}[\val\nr]{% left,center,right,parleft,parcenter,parright}[left]{% \ifcase\nr\relax \def\SUF@lr@PARTSwitch{\filright} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakNL} \or \def\SUF@lr@PARTSwitch{\filcenter} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or \def\SUF@lr@PARTSwitch{\filleft} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or%numpar \def\SUF@lr@PARTSwitch{\filright} \suftesi@numparparttrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakNL} \or \def\SUF@lr@PARTSwitch{\filcenter} \suftesi@numparparttrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or \def\SUF@lr@PARTSwitch{\filleft} \suftesi@numparparttrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \fi} \define@choicekey{}{chapstyle}[\val\nr]{% left,center,right,parleft,parcenter,parright}[left]{% \ifcase\nr\relax \def\SUF@lr@CHAPSwitch{\filright} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakNL} \or \def\SUF@lr@CHAPSwitch{\filcenter} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or \def\SUF@lr@CHAPSwitch{\filleft} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or%numparchap \def\SUF@lr@CHAPSwitch{\filright} \suftesi@numparchaptrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakNL} \or \def\SUF@lr@CHAPSwitch{\filcenter} \suftesi@numparchaptrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or \def\SUF@lr@CHAPSwitch{\filleft} \suftesi@numparchaptrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \fi} \define@choicekey{}{secstyle}[\val\nr]{% left,center,right,parleft,parcenter,parright}[left]{% \ifcase\nr\relax \def\SUF@lr@SECSwitch{\filright} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakNL} \or \def\SUF@lr@SECSwitch{\filcenter} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or \def\SUF@lr@SECSwitch{\filleft} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or%numparsec \def\SUF@lr@SECSwitch{\filright} \suftesi@numparsectrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakNL} \or \def\SUF@lr@SECSwitch{\filcenter} \suftesi@numparsectrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or \def\SUF@lr@SECSwitch{\filleft} \suftesi@numparsectrue - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \fi} \define@choicekey{}{subsecstyle}[\val\nr]{left,center,right}[left]{% \ifcase\nr\relax \def\SUF@lr@SUBSECSwitch{\filright} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakNL} \or \def\SUF@lr@SUBSECSwitch{\filcenter} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or \def\SUF@lr@SUBSECSwitch{\filleft} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \fi} \define@choicekey{}{subsubsecstyle}[\val\nr]{left,center,right}[left]{% \ifcase\nr\relax \def\SUF@lr@SUBSUBSECSwitch{\filright} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakNL} \or \def\SUF@lr@SUBSUBSECSwitch{\filcenter} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \or \def\SUF@lr@SUBSUBSECSwitch{\filleft} - \DeclareRobustCommand{\xheadbreak}{\xheadbreakBB} \fi} % \end{macrocode} -% \subsection*{Sections font} +% \subsubsection{Sections font} % \begin{macrocode} \define@choicekey{}{partfont}[\val\nr]{roman,italic,smallcaps}[roman]{% \ifcase\nr\relax -\def\SUF@PART@StyleSwitch{\relax} + \def\SUF@PART@StyleSwitch{\relax} \or -\def\SUF@PART@StyleSwitch{\itshape} + \def\SUF@PART@StyleSwitch{\itshape} \or -\def\SUF@PART@StyleSwitch{\expandafter\SUF@titlesmallcaps} + \def\SUF@PART@StyleSwitch{\expandafter\SUF@titlesmallcaps} \fi} \define@choicekey{}{chapfont}[\val\nr]{roman,italic,smallcaps}[roman]{% \ifcase\nr\relax -\def\SUF@CHAP@StyleSwitch{\relax} + \def\SUF@CHAP@StyleSwitch{\relax} \or -\def\SUF@CHAP@StyleSwitch{\itshape} + \def\SUF@CHAP@StyleSwitch{\itshape} \or -\def\SUF@CHAP@StyleSwitch{\expandafter\SUF@titlesmallcaps} + \def\SUF@CHAP@StyleSwitch{\expandafter\SUF@titlesmallcaps} \fi} \define@choicekey{}{secfont}[\val\nr]{roman,italic,smallcaps}[italic]{% \ifcase\nr\relax -\def\SUF@SEC@StyleSwitch{\relax} + \def\SUF@SEC@StyleSwitch{\relax} \or -\def\SUF@SEC@StyleSwitch{\itshape} + \def\SUF@SEC@StyleSwitch{\itshape} \or -\def\SUF@SEC@StyleSwitch{\expandafter\SUF@titlesmallcaps} + \def\SUF@SEC@StyleSwitch{\expandafter\SUF@titlesmallcaps} \fi} \define@choicekey{}{subsecfont}[\val\nr]{roman,italic,smallcaps}[roman]{% \ifcase\nr\relax -\def\SUF@SUBSEC@StyleSwitch{\relax} + \def\SUF@SUBSEC@StyleSwitch{\relax} \or -\def\SUF@SUBSEC@StyleSwitch{\itshape} + \def\SUF@SUBSEC@StyleSwitch{\itshape} \or -\def\SUF@SUBSEC@StyleSwitch{\expandafter\SUF@titlesmallcaps} + \def\SUF@SUBSEC@StyleSwitch{\expandafter\SUF@titlesmallcaps} \fi} \define@choicekey{}{subsubsecfont}[\val\nr]{roman,italic,smallcaps}[roman]{% \ifcase\nr\relax -\def\SUF@SUBSUBSEC@StyleSwitch{\relax} + \def\SUF@SUBSUBSEC@StyleSwitch{\relax} \or -\def\SUF@SUBSUBSEC@StyleSwitch{\itshape} + \def\SUF@SUBSUBSEC@StyleSwitch{\itshape} \or -\def\SUF@SUBSUBSEC@StyleSwitch{\expandafter\SUF@titlesmallcaps} + \def\SUF@SUBSUBSEC@StyleSwitch{\expandafter\SUF@titlesmallcaps} \fi} % \end{macrocode} -% \subsection*{TOC font} +% \paragraph{Small capitals style} % \begin{macrocode} -% \define@choicekey{}{tocpartfont}[\val\nr]{roman,italic,smallcaps}[roman]{% -% \ifcase\nr\relax -% \def\SUF@tocPART@font{\relax} -% \or -% \def\SUF@tocPART@font{\itshape} -% \or -% \def\SUF@tocPART@font{\expandafter\SUF@TOCtitlesmallcaps} -% \fi} -\define@choicekey{}{tocchapfont}[\val\nr]{roman,italic,smallcaps}[roman]{% -\ifcase\nr\relax -\def\SUF@tocCHAP@font{\relax} -\or -\def\SUF@tocCHAP@font{\itshape} -\or -\def\SUF@tocCHAP@font{\expandafter\SUF@TOCtitlesmallcaps} -\fi} -\define@choicekey{}{tocsecfont}[\val\nr]{roman,italic,smallcaps}[italic]{% -\ifcase\nr\relax -\def\SUF@tocSEC@font{\relax} -\or -\def\SUF@tocSEC@font{\itshape} -\or -\def\SUF@tocSEC@font{\expandafter\SUF@TOCtitlesmallcaps} -\fi} -\define@choicekey{}{tocsubsecfont}[\val\nr]{roman,italic,smallcaps}[roman]{% -\ifcase\nr\relax -\def\SUF@tocSUBSEC@font{\relax} -\or -\def\SUF@tocSUBSEC@font{\itshape} -\or -\def\SUF@tocSUBSEC@font{\expandafter\SUF@TOCtitlesmallcaps} -\fi} -\define@choicekey{}{tocsubsubsecfont}[\val\nr]{roman,italic,smallcaps}[roman]{% -\ifcase\nr\relax -\def\SUF@tocSUBSUBSEC@font{\relax} -\or -\def\SUF@tocSUBSUBSEC@font{\itshape} -\or -\def\SUF@tocSUBSUBSEC@font{\expandafter\SUF@TOCtitlesmallcaps} -\fi} -\define@choicekey{}{tocauthorfont}[\val\nr]{roman,italic,smallcaps}[roman]{% -\ifcase\nr\relax -\def\SUF@tocAUT@font{\relax} -\or -\def\SUF@tocAUT@font{\itshape} -\or -\def\SUF@tocAUT@font{\expandafter\SUF@TOCtitlesmallcaps} -\fi} -\define@choicekey{}{toctitlefont}[\val\nr]{roman,italic,smallcaps}[italic]{% +\define@choicekey{}{smallcapsstyle}[\val\nr] +{low,upper}[low]{% \ifcase\nr\relax -\def\SUF@tocTIT@font{\relax} -\or -\def\SUF@tocTIT@font{\itshape} + \def\suftesi@MakeTextLowercase{\MakeLowercase} + \def\suftesi@MakeTextTOCLowercase{\lowercase} \or -\def\SUF@tocTIT@font{\expandafter\SUF@TOCtitlesmallcaps} + \def\suftesi@MakeTextLowercase{\relax} + \def\suftesi@MakeTextTOCLowercase{\relax} \fi} % \end{macrocode} -% \subsection*{Sections number style} -% \subsubsection*{Part number style} +% \subsubsection{Sections number} +% \paragraph{Part number style} % \begin{macrocode} \define@choicekey{}{partnumstyle}[\val\nr] - {arabic,roman,Roman,dotarabic,dotroman,dotRoman}[arabic]{% +{arabic,roman,Roman,dotarabic,dotroman,dotRoman}[arabic]{% \ifcase\nr\relax \def\SUF@thepart{\arabic{part}} \def\SUF@dotpart{} @@ -2421,11 +2454,11 @@ This work has the LPPL maintenance status "author-maintained". \def\SUF@dotpart{.} \fi} % \end{macrocode} -% \subsubsection*{Chapter number style} +% \paragraph{Chapter number style} % \begin{macrocode} \define@choicekey{}{chapnumstyle}[\val\nr]{arabic,roman,Roman, - dotarabic,dotroman,dotRoman}[arabic]{% - \ifcase\nr\relax +dotarabic,dotroman,dotRoman}[arabic]{% +\ifcase\nr\relax \def\SUF@thechapter{\arabic{chapter}} \def\SUF@HEAD@thechapter{\arabic{chapter}} \def\SUF@dotchap{} @@ -2455,13 +2488,13 @@ This work has the LPPL maintenance status "author-maintained". \def\SUF@HEAD@thechapter{\Roman{chapter}} \def\SUF@dotchap{.} \def\SUF@CHAP@thecontentslabel{\@Roman{\thecontentslabel}} - \fi} +\fi} % \end{macrocode} -% \subsubsection*{Section number style} +% \paragraph{Section number style} % \begin{macrocode} \define@choicekey{}{secnumstyle}[\val\nr] {arabic,roman,Roman,dotarabic,dotroman,dotRoman}[arabic]{% - \ifcase\nr\relax +\ifcase\nr\relax \def\SUF@thesection{\SUF@chapswitch\arabic{section}} \def\SUF@HEAD@thesection{\arabic{section}} \def\SUF@dotsec{} @@ -2491,13 +2524,13 @@ This work has the LPPL maintenance status "author-maintained". \def\SUF@HEAD@thesection{\Roman{section}} \def\SUF@dotsec{.} \def\SUF@SEC@thecontentslabel{\@Roman{\thecontentslabel}} - \fi} +\fi} % \end{macrocode} -% \subsubsection*{Subsection number style} +% \paragraph{Subsection number style} % \begin{macrocode} \define@choicekey{}{subsecnumstyle}[\val\nr] {arabic,roman,Roman,dotarabic,dotroman,dotRoman}[arabic]{% - \ifcase\nr\relax +\ifcase\nr\relax \def\SUF@thesubsection{\SUF@thesection.\arabic{subsection}} \def\SUF@dotsubsec{} \def\SUF@SUBSEC@thecontentslabel{\thecontentslabel} @@ -2521,13 +2554,13 @@ This work has the LPPL maintenance status "author-maintained". \def\SUF@thesubsection{\SUF@thesection.\Roman{subsection}} \def\SUF@dotsubsec{.} \def\SUF@SUBSEC@thecontentslabel{\@Roman{\thecontentslabel}} - \fi} +\fi} % \end{macrocode} -% \subsubsection*{Sub-subsection number style} +% \paragraph{Sub-subsection number style} % \begin{macrocode} \define@choicekey{}{subsubsecnumstyle}[\val\nr] {arabic,roman,Roman,dotarabic,dotroman,dotRoman}[arabic]{% - \ifcase\nr\relax +\ifcase\nr\relax \def\SUF@thesubsubsection{\SUF@thesubsection.\arabic{subsubsection}} \def\SUF@dotsubsubsec{} \def\SUF@SUBSUBSEC@thecontentslabel{\thecontentslabel} @@ -2551,198 +2584,13 @@ This work has the LPPL maintenance status "author-maintained". \def\SUF@thesubsubsection{\SUF@thesubsection.\Roman{subsubsection}} \def\SUF@dotsubsubsec{.} \def\SUF@SUBSUBSEC@thecontentslabel{\@Roman{\thecontentslabel}} - \fi} -% \end{macrocode} -% \subsubsection*{Small capitals style} -% \begin{macrocode} -\define@choicekey{}{smallcapsstyle}[\val\nr] - {low,upper}[low]{% -\ifcase\nr\relax - \def\suftesi@MakeTextLowercase{\MakeLowercase} - \def\suftesi@MakeTextTOCLowercase{\lowercase} -\or - \def\suftesi@MakeTextLowercase{\relax} - \def\suftesi@MakeTextTOCLowercase{\relax} -\fi} -% \end{macrocode} -% \subsubsection*{Fine adjustment of sections font} -% \begin{macrocode} -\newcommand{\partfont}[1]{\def\SUF@PART@StyleSwitch{#1}} -\newcommand{\chapfont}[1]{\def\SUF@CHAP@StyleSwitch{#1}} -\newcommand{\secfont}[1]{\def\SUF@SEC@StyleSwitch{#1}} -\newcommand{\subsecfont}[1]{\def\SUF@SUBSEC@StyleSwitch{#1}} -\newcommand{\subsubsecfont}[1]{\def\SUF@SUBSUBSEC@StyleSwitch{#1}} -\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@titlefont@Switch{#1}} -\newcommand{\authorfont}[1]{\def\SUF@authorfont@Switch{#1}} -% \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{\tocpartnumfont}[1]{% - \def\SUF@PART@thecontentslabel{#1\thecontentslabel}} -\newcommand{\tocchapnumfont}[1]{% - \def\SUF@CHAP@thecontentslabel{#1\thecontentslabel}} -\newcommand{\tocsecnumfont}[1]{% - \def\SUF@SEC@thecontentslabel{#1\thecontentslabel}} -\newcommand{\tocsubsecnumfont}[1]{% - \def\SUF@SUBSEC@thecontentslabel{#1\thecontentslabel}} -\newcommand{\tocsubsubsecnumfont}[1]{% - \def\SUF@SUBSUBSEC@thecontentslabel{#1\thecontentslabel}} -% \end{macrocode} -% \subsection*{Headers} -% \subsubsection*{Header style} -% \begin{macrocode} -\define@choicekey{}{headerstyle}[\val\nr] - {inner,center,plain,authortitleinner, - authortitlecenter}[inner]{% -\ifcase\nr\relax - \def\SUF@rightmark{\SUF@Rheadstyle{\rightmark}} - \def\SUF@leftmark{\SUF@Lheadstyle{\SUF@leftrightmark}} -\or - \suftesi@centerheadertrue - \def\SUF@rightmark{\SUF@Rheadstyle{\rightmark}} - \def\SUF@leftmark{\SUF@Lheadstyle{\SUF@leftrightmark}} -\or - \suftesi@sufplaintrue -\or - \suftesi@authortitletrue - \def\SUF@rightmark{\let\thanks\@gobble\SUF@Rheadstyle{\@headtitle}} - \def\SUF@leftmark{\let\thanks\@gobble\SUF@Lheadstyle{\@author}} -\or - \suftesi@authortitletrue - \def\SUF@rightmark{\let\thanks\@gobble\SUF@Rheadstyle{\@headtitle}} - \def\SUF@leftmark{\let\thanks\@gobble\SUF@Lheadstyle{\@author}} - \suftesi@centerheadertrue -\fi} -% \end{macrocode} -% \subsubsection*{Header font} -% \begin{macrocode} -\define@choicekey{}{headerfont}[\val\nr] - {roman,italic,smallcaps}[roman]{% -\ifcase\nr\relax - \def\SUF@Rheadstyle{} - \def\SUF@Lheadstyle{} - \def\SUF@thepage{\thepage} -\or - \def\SUF@Rheadstyle{\itshape} - \def\SUF@Lheadstyle{\itshape} - \def\SUF@thepage{\thepage} -\or - \def\SUF@Rheadstyle{\SUF@headingsmallcaps} - \def\SUF@Lheadstyle{\SUF@headingsmallcaps} - \def\SUF@thepage{\SUF@headingsmallcaps{\thepage}} -\fi} -% \end{macrocode} -% \subsection*{Text elements} -% \subsubsection*{Lists} -% \begin{macrocode} -\RequirePackage[inline]{enumitem} -\renewcommand\labelitemi{\color{sufgray}\textbullet} -\setlist{itemsep=.5ex,parsep=0pt,listparindent=\parindent} -\setlist[description]{font=\normalfont\itshape} -\define@choicekey{}{liststyle}[\val\nr] - {bulged,aligned,indented}[bulged]{% -\ifcase\nr\relax - \setlist[enumerate,1]{leftmargin=0pt,label=\arabic*.} - \setlist[enumerate,2]{leftmargin= 1.3\parindent,label=\alph*.} - \setlist[enumerate,3]{leftmargin= 1.3\parindent,label=\roman*.} - \setlist[itemize,1]{leftmargin=0pt} - \setlist[itemize,2]{leftmargin=1.3\parindent} - \setlist[itemize,3]{leftmargin=1.3\parindent} -\or - \setlist[enumerate,1]{leftmargin=1\parindent,label=\arabic*.} - \setlist[enumerate,2]{leftmargin= 1.5\parindent,label=\alph*.} - \setlist[enumerate,3]{leftmargin= 1.5\parindent,label=\roman*.} - \setlist[itemize,1]{leftmargin=1\parindent} - \setlist[itemize,2]{leftmargin=1.5\parindent} - \setlist[itemize,3]{leftmargin=1.5\parindent} -\or - \setlist[enumerate,1]{leftmargin=2\parindent,label=\arabic*.} - \setlist[enumerate,2]{leftmargin= 2.5\parindent,label=\alph*.} - \setlist[enumerate,3]{leftmargin= 2.5\parindent,label=\roman*.} - \setlist[itemize,1]{leftmargin=2\parindent} - \setlist[itemize,2]{leftmargin=2.5\parindent} - \setlist[itemize,3]{leftmargin=2.5\parindent} -\fi} -% \end{macrocode} -% \subsubsection*{Quotations} -% \begin{macrocode} -\define@choicekey{}{quotestyle}[\val\nr] - {center,right}[center]{% -\ifcase\nr\relax -\def\SUF@quote@style{\rightmargin=\parindent} -\or -\def\SUF@quote@style{} -\fi} -\define@choicekey{}{quotesize}[\val\nr] - {footnotesize,small}[footnotesize]{% -\ifcase\nr\relax -\def\SUF@quotation@size{\footnotesize} -\or -\def\SUF@quotation@size{\small} -\fi} -% \end{macrocode} -% \subsubsection*{Footnotes} -% \begin{macrocode} -\define@choicekey{}{footnotestyle}[\val\nr] - {bulged,hung,dotted,superscript}[bulged]{% -\ifcase\nr\relax - \renewcommand\@makefntext{% - \hskip-2.5em\makebox[2em][r]{\@thefnmark}\hskip.5em} -\or - \renewcommand\@makefntext{% - \leftskip=1em\hskip-1.5em% - \makebox[1em][r]{\@thefnmark}\hskip.5em} -\or - \renewcommand\@makefntext{% - \@thefnmark.\hskip.5em} -\or - \renewcommand\@makefntext{% - \textsuperscript{\@thefnmark}\hskip.3em} -\fi} -\define@choicekey{}{fewfootnotes}[\val\nr] - {true,false}[true]{% -\ifcase\nr\relax - \suftesi@fewfootnotestrue -\or - \relax -\fi} -% \end{macrocode} -% \subsubsection*{Captions} -% \begin{macrocode} -\RequirePackage{caption} -\captionsetup{labelsep=period,font=small,textformat=period} -\define@choicekey{}{captionstyle}[\val\nr] - {standard,sanserif,italic,smallcaps}[standard]{% -\ifcase\nr\relax -\or - \captionsetup{font+=sf} -\or - \captionsetup{font+=it} -\or - \captionsetup{labelfont=sc} -\fi -} -% \end{macrocode} -% \subsubsection*{Marginal notes} -% \begin{macrocode} -\define@choicekey{}{marginpar}[\val\nr] - {true,false}[true]{% -\ifcase\nr\relax -\or - \renewcommand\marginpar[2][]{} \fi} % \end{macrocode} -% \subsubsection*{Table of contents} +% \subsubsection{Table of contents} +% \paragraph{Table of contents style} % \begin{macrocode} \define@choicekey{}{tocstyle}[\val\nr]{% - standard,dotted,ragged,leftpage}[standard]{% +standard,dotted,ragged,leftpage}[standard]{% \ifcase\nr\relax \def\SUF@titlerule{\titlerule*{}} \def\SUF@chaptitlerule{\titlerule*{}} @@ -2758,31 +2606,31 @@ This work has the LPPL maintenance status "author-maintained". \suftesi@pagelefttoctrue \fi} \define@choicekey{}{compacttoc}[\val\nr]{% - sec,subsec,subsubsec}[sec]{% - \ifcase\nr\relax +sec,subsec,subsubsec}[sec]{% +\ifcase\nr\relax \suftesi@toccompactsectrue \suftesi@toccompactsubsectrue \suftesi@toccompactsubsubsectrue \def\suf@sscorrect{\hskip.5em} \def\suf@ssscorrect{\hskip.5em} - \def\suf@ctocdotsec{.} - \def\suf@ctocdotssec{} - \def\suf@ctocdotsssec{} + \def\suf@ctocdotsec{.} + \def\suf@ctocdotssec{} + \def\suf@ctocdotsssec{} \or \suftesi@toccompactsubsectrue \suftesi@toccompactsubsubsectrue \def\suf@sscorrect{\relax} \def\suf@ssscorrect{\hskip.5em} - \def\suf@ctocdotssec{.} - \def\suf@ctocdotsssec{} + \def\suf@ctocdotssec{.} + \def\suf@ctocdotsssec{} \or \suftesi@toccompactsubsubsectrue \def\suf@sscorrect{\relax} \def\suf@ssscorrect{\relax} - \def\suf@ctocdotsssec{.} - \fi} + \def\suf@ctocdotsssec{.} +\fi} \define@choicekey{}{twocolcontents}[\val\nr]{% - toc,lof,lot,toclof,toclot,loflot,all}[all]{% +toc,lof,lot,toclof,toclot,loflot,all}[all]{% \ifcase\nr\relax \suftesi@twocolumntoctrue \setkeys{}{tocstyle=ragged} @@ -2805,60 +2653,217 @@ This work has the LPPL maintenance status "author-maintained". \suftesi@twocolumnlottrue \setkeys{}{tocstyle=ragged} \or - \suftesi@twocolumntoctrue - \suftesi@twocolumnloftrue - \suftesi@twocolumnlottrue - \setkeys{}{tocstyle=ragged} -\fi -} + \suftesi@twocolumntoctrue + \suftesi@twocolumnloftrue + \suftesi@twocolumnlottrue + \setkeys{}{tocstyle=ragged} +\fi +} +% \end{macrocode} +% \paragraph{Table of contents font} +% \begin{macrocode} +\define@choicekey{}{tocpartfont}[\val\nr]{roman,italic,smallcaps}[roman]{% +\ifcase\nr\relax + \def\SUF@tocPART@font{\relax} +\or + \def\SUF@tocPART@font{\itshape} +\or + \def\SUF@tocPART@font{\expandafter\SUF@TOCtitlesmallcaps} +\fi} +\define@choicekey{}{tocchapfont}[\val\nr]{roman,italic,smallcaps}[roman]{% +\ifcase\nr\relax + \def\SUF@tocCHAP@font{\relax} +\or + \def\SUF@tocCHAP@font{\itshape} +\or + \def\SUF@tocCHAP@font{\expandafter\SUF@TOCtitlesmallcaps} +\fi} +\define@choicekey{}{tocsecfont}[\val\nr]{roman,italic,smallcaps}[italic]{% +\ifcase\nr\relax + \def\SUF@tocSEC@font{\relax} +\or + \def\SUF@tocSEC@font{\itshape} +\or + \def\SUF@tocSEC@font{\expandafter\SUF@TOCtitlesmallcaps} +\fi} +\define@choicekey{}{tocsubsecfont}[\val\nr]{roman,italic,smallcaps}[roman]{% +\ifcase\nr\relax + \def\SUF@tocSUBSEC@font{\relax} +\or + \def\SUF@tocSUBSEC@font{\itshape} +\or + \def\SUF@tocSUBSEC@font{\expandafter\SUF@TOCtitlesmallcaps} +\fi} +\define@choicekey{}{tocsubsubsecfont}[\val\nr]{roman,italic,smallcaps}[roman]{% +\ifcase\nr\relax + \def\SUF@tocSUBSUBSEC@font{\relax} +\or + \def\SUF@tocSUBSUBSEC@font{\itshape} +\or + \def\SUF@tocSUBSUBSEC@font{\expandafter\SUF@TOCtitlesmallcaps} +\fi} +\define@choicekey{}{tocauthorfont}[\val\nr]{roman,italic,smallcaps}[roman]{% +\ifcase\nr\relax + \def\SUF@tocAUT@font{\relax} +\or + \def\SUF@tocAUT@font{\itshape} +\or + \def\SUF@tocAUT@font{\expandafter\SUF@TOCtitlesmallcaps} +\fi} +\define@choicekey{}{toctitlefont}[\val\nr]{roman,italic,smallcaps}[italic]{% +\ifcase\nr\relax + \def\SUF@tocTIT@font{\relax} +\or + \def\SUF@tocTIT@font{\itshape} +\or + \def\SUF@tocTIT@font{\expandafter\SUF@TOCtitlesmallcaps} +\fi} +% \end{macrocode} +% \subsubsection{Headers} +% \paragraph{Header style} +% \begin{macrocode} +\define@choicekey{}{headerstyle}[\val\nr] + {inner,center,plain,authortitleinner, + authortitlecenter}[inner]{% +\ifcase\nr\relax + \def\SUF@rightmark{\SUF@Rheadstyle{\rightmark}} + \def\SUF@leftmark{\SUF@Lheadstyle{\SUF@leftrightmark}} +\or + \suftesi@centerheadertrue + \def\SUF@rightmark{\SUF@Rheadstyle{\rightmark}} + \def\SUF@leftmark{\SUF@Lheadstyle{\SUF@leftrightmark}} +\or + \suftesi@sufplaintrue +\or + \suftesi@authortitletrue + \def\SUF@rightmark{\let\thanks\@gobble\SUF@Rheadstyle{\@headtitle}} + \def\SUF@leftmark{\let\thanks\@gobble\SUF@Lheadstyle{\@author}} +\or + \suftesi@authortitletrue + \def\SUF@rightmark{\let\thanks\@gobble\SUF@Rheadstyle{\@headtitle}} + \def\SUF@leftmark{\let\thanks\@gobble\SUF@Lheadstyle{\@author}} + \suftesi@centerheadertrue +\fi} +% \end{macrocode} +% \paragraph{Header font} +% \begin{macrocode} +\define@choicekey{}{headerfont}[\val\nr] + {roman,italic,smallcaps}[roman]{% +\ifcase\nr\relax + \def\SUF@Rheadstyle{} + \def\SUF@Lheadstyle{} + \def\SUF@thepage{\thepage} +\or + \def\SUF@Rheadstyle{\itshape} + \def\SUF@Lheadstyle{\itshape} + \def\SUF@thepage{\thepage} +\or + \def\SUF@Rheadstyle{\SUF@headingsmallcaps} + \def\SUF@Lheadstyle{\SUF@headingsmallcaps} + \def\SUF@thepage{\SUF@headingsmallcaps{\thepage}} +\fi} % \end{macrocode} -% \subsection*{Fonts} -% \subsubsection*{Roman fonts} +% \subsubsection{Text elements} +% \paragraph{Lists} % \begin{macrocode} -\define@choicekey{}{defaultfont}[\val\nr]{% - none,cochineal,libertine,palatino,standard,compatibility}[cochineal]{% +\RequirePackage[inline]{enumitem} +\renewcommand\labelitemi{\color{sufgray}\textbullet} +\setlist{itemsep=.5ex,parsep=0pt,listparindent=\parindent} +\setlist[description]{font=\normalfont\itshape} +\define@choicekey{}{liststyle}[\val\nr] + {bulged,aligned,indented}[bulged]{% \ifcase\nr\relax - \suftesi@nofonttrue + \setlist[enumerate,1]{leftmargin=0pt,label=\arabic*.} + \setlist[enumerate,2]{leftmargin= 1.3\parindent,label=\alph*.} + \setlist[enumerate,3]{leftmargin= 1.3\parindent,label=\roman*.} + \setlist[itemize,1]{leftmargin=0pt} \setlist[itemize,2]{leftmargin=1.3\parindent} + \setlist[itemize,3]{leftmargin=1.3\parindent} +\or + \setlist[enumerate,1]{leftmargin=1\parindent,label=\arabic*.} + \setlist[enumerate,2]{leftmargin= 1.5\parindent,label=\alph*.} + \setlist[enumerate,3]{leftmargin= 1.5\parindent,label=\roman*.} + \setlist[itemize,1]{leftmargin=1\parindent} + \setlist[itemize,2]{leftmargin=1.5\parindent} + \setlist[itemize,3]{leftmargin=1.5\parindent} +\or + \setlist[enumerate,1]{leftmargin=2\parindent,label=\arabic*.} + \setlist[enumerate,2]{leftmargin= 2.5\parindent,label=\alph*.} + \setlist[enumerate,3]{leftmargin= 2.5\parindent,label=\roman*.} + \setlist[itemize,1]{leftmargin=2\parindent} + \setlist[itemize,2]{leftmargin=2.5\parindent} + \setlist[itemize,3]{leftmargin=2.5\parindent} +\fi} +% \end{macrocode} +% \paragraph{Quotations} +% \begin{macrocode} +\define@choicekey{}{quotestyle}[\val\nr] + {center,right}[center]{% +\ifcase\nr\relax + \def\SUF@quote@style{\rightmargin=\parindent} \or - \suftesi@cochinealtrue + \def\SUF@quote@style{} +\fi} +\define@choicekey{}{quotesize}[\val\nr] + {footnotesize,small}[footnotesize]{% +\ifcase\nr\relax + \def\SUF@quotation@size{\footnotesize} \or - \suftesi@libertinetrue + \def\SUF@quotation@size{\small} +\fi} +% \end{macrocode} +% \paragraph{Footnotes} +% \begin{macrocode} +\define@choicekey{}{footnotestyle}[\val\nr] + {bulged,hung,dotted,superscript}[bulged]{% +\ifcase\nr\relax + \renewcommand\@makefntext{% + \hskip-2.5em\makebox[2em][r]{\@thefnmark}\hskip.5em} \or - \suftesi@palatinotrue + \renewcommand\@makefntext{% + \leftskip=1em\hskip-1.5em% + \makebox[1em][r]{\@thefnmark}\hskip.5em} \or - \suftesi@standardtrue + \renewcommand\@makefntext{% + \@thefnmark.\hskip.5em} \or - \suftesi@compatibilitytrue + \renewcommand\@makefntext{% + \textsuperscript{\@thefnmark}\hskip.3em} \fi} -\define@choicekey{}{mathfont}[\val\nr]{% - none,minimal,extended}[minimal]{% +\define@choicekey{}{fewfootnotes}[\val\nr] + {true,false}[true]{% \ifcase\nr\relax - \suftesi@mathminimalfalse - \suftesi@mathextendedfalse -\or - \suftesi@mathminimaltrue + \suftesi@fewfootnotestrue \or - \suftesi@mathextendedtrue + \relax \fi} % \end{macrocode} -% \subsubsection*{Greek fonts} +% \paragraph{Captions} % \begin{macrocode} -\define@choicekey{}{greekfont}[\val\nr]{% - none,artemisia,porson,bodoni,cbgreek}[none]{% +\RequirePackage{caption} +\captionsetup{labelsep=period,font=small,textformat=period} +\define@choicekey{}{captionstyle}[\val\nr] + {standard,sanserif,italic,smallcaps}[standard]{% \ifcase\nr\relax -\suftesi@greekfontfalse \or -\suftesi@greekfonttrue\suftesi@artemisiatrue -\or -\suftesi@greekfonttrue\suftesi@porsontrue + \captionsetup{font+=sf} \or -\suftesi@greekfonttrue\suftesi@bodonitrue + \captionsetup{font+=it} \or -\suftesi@greekfonttrue\suftesi@cbgreektrue + \captionsetup{labelfont=sc} +\fi +} +% \end{macrocode} +% \paragraph{Marginal notes} +% \begin{macrocode} +\define@choicekey{}{marginpar}[\val\nr] + {true,false}[true]{% +\ifcase\nr\relax +\or + \renewcommand\marginpar[2][]{} \fi} % \end{macrocode} -% \subsection*{Other options} -% \subsubsection*{Part page} +% \subsubsection{Other options} +% \paragraph{Part page} % \begin{macrocode} \define@choicekey{}{partpage}[\val\nr]{true,false}[true]{% \ifcase\nr\relax @@ -2867,16 +2872,17 @@ This work has the LPPL maintenance status "author-maintained". \relax \fi} % \end{macrocode} -% \subsubsection*{Draftdate} +% \paragraph{Draftdate} % \begin{macrocode} \define@choicekey{}{draftdate}[\val\nr] {true,false}[true]{% \ifcase\nr\relax \suftesi@draftdatetrue \or + \relax \fi} % \end{macrocode} -% \subsubsection*{View mode} +% \paragraph{View mode} % \begin{macrocode} \define@choicekey{}{version}[\val\nr] {screen,cscreen,draft,final}[draft]{% @@ -2886,6 +2892,7 @@ This work has the LPPL maintenance status "author-maintained". \suftesi@screentrue \suftesi@screencenteredtrue \or + \relax \or \AtBeginDocument{\crop[off]} \fi} @@ -2900,7 +2907,7 @@ This work has the LPPL maintenance status "author-maintained". \setkeys{}{version=screen} \fi} % \end{macrocode} -% \subsubsection*{Titlepage} +% \paragraph{Titlepage} % \begin{macrocode} \define@choicekey{}{titlepage}[\val\nr] {true,false}[true]{% @@ -2910,7 +2917,7 @@ This work has the LPPL maintenance status "author-maintained". \@titlepagefalse \fi} % \end{macrocode} -% \subsubsection*{Pre-defined styles} +% \paragraph{Pre-defined styles} % \begin{macrocode} \define@choicekey{}{style}[\val\nr] {roman1,roman2,roman3,roman4,roman5,roman6, @@ -2922,7 +2929,7 @@ This work has the LPPL maintenance status "author-maintained". [roman1]{% \ifcase\nr\relax % \end{macrocode} -% \paragraph{The `roman' styles} +% \subparagraph{The `roman' styles} % \begin{macrocode} \setkeys{}{chapstyle=left} \or @@ -2937,7 +2944,7 @@ This work has the LPPL maintenance status "author-maintained". \setkeys{}{chapstyle=parright} \or % \end{macrocode} -% \paragraph{The `italic' styles} +% \subparagraph{The `italic' styles} % \begin{macrocode} \setkeys{}{ chapstyle=left, @@ -3018,7 +3025,7 @@ This work has the LPPL maintenance status "author-maintained". headerfont=italic} \or % \end{macrocode} -% \paragraph{The smallcaps' styles} +% \subparagraph{The `smallcaps' styles} % \begin{macrocode} \setkeys{}{ chapstyle=left, @@ -3099,7 +3106,7 @@ This work has the LPPL maintenance status "author-maintained". headerfont=smallcaps} \or % \end{macrocode} -% \paragraph{The \opt{FSPL} styles} +% \subparagraph{The \opt{FSPL} styles} % \begin{macrocode} \suftesi@periodicalaureotrue \suftesi@FSPLtrue @@ -3156,7 +3163,7 @@ secnumstyle,tocstyle,headerstyle,headerfont,quotestyle,% quotesize,footnotestyle,liststyle,captionstyle} \fi} % \end{macrocode} -% \subsubsection*{Options for \opt{collection} document structure} +% \paragraph{Options for the \opt{collection} document structure} % \begin{macrocode} \define@choicekey{}{papertitlestyle}[\val\nr]{% left,center,right}[left]{% @@ -3170,27 +3177,28 @@ quotesize,footnotestyle,liststyle,captionstyle} \define@choicekey{}{revauthortitle}[\val\nr] {true,false}[false]{% \ifcase\nr\relax -\suftesi@reverseauthortitletrue -\or\relax + \suftesi@reverseauthortitletrue +\or + \relax \fi} \define@choicekey{}{titlefont}[\val\nr]{roman,italic,smallcaps}[roman]{% \ifcase\nr\relax -\def\SUF@titlefont@Switch{\relax} + \def\SUF@titlefont@Switch{\relax} \or -\def\SUF@titlefont@Switch{\itshape} + \def\SUF@titlefont@Switch{\itshape} \or -\def\SUF@titlefont@Switch{\expandafter\SUF@titlesmallcaps} + \def\SUF@titlefont@Switch{\expandafter\SUF@titlesmallcaps} \fi} \define@choicekey{}{authorfont}[\val\nr]{roman,italic,smallcaps}[roman]{% \ifcase\nr\relax -\def\SUF@authorfont@Switch{\relax} + \def\SUF@authorfont@Switch{\relax} \or -\def\SUF@authorfont@Switch{\itshape} + \def\SUF@authorfont@Switch{\itshape} \or -\def\SUF@authorfont@Switch{\expandafter\SUF@titlesmallcaps} + \def\SUF@authorfont@Switch{\expandafter\SUF@titlesmallcaps} \fi} % \end{macrocode} -% \subsection*{Execute and process options} +% \subsubsection{Execute options} % \begin{macrocode} \ExecuteOptionsX<>{ structure=book, @@ -3229,6 +3237,7 @@ quotesize,footnotestyle,liststyle,captionstyle} tocauthorfont=roman, revauthortitle=false, papertitlestyle=left, + tocpartfont=roman, tocchapfont=roman, tocsecfont=roman, tocsubsecfont=roman, @@ -3267,14 +3276,14 @@ quotesize,footnotestyle,liststyle,captionstyle} % \begin{macrocode} \def\XKV@classoptionslist{} % \end{macrocode} -% \subsection*{Basic packages} +% \subsection{Basic packages} % \begin{macrocode} \RequirePackage{multicol} \RequirePackage{emptypage} \RequirePackage{microtype} \RequirePackage{color} -\definecolor{sufred}{rgb}{0.5,0,0} -\definecolor{sufgray}{rgb}{0.5,0.5,0.5} + \definecolor{sufred}{rgb}{0.5,0,0} + \definecolor{sufgray}{rgb}{0.5,0.5,0.5} \RequirePackage{iftex} \ifLuaTeX \RequirePackage{luatex85} @@ -3288,24 +3297,23 @@ quotesize,footnotestyle,liststyle,captionstyle} \else \fi % \end{macrocode} -% \subsection*{Page layouts} +% If \opt{version=screen} or \opt{version=cscreen} the \sty{crop} package is not loaded. This can create problems if the \cmd{crop} command has been used in the document, for example to remove the crop marks from a certain page onwards (with \cmd{crop}|[off]|). For this reason, the \cmd{crop} command is defined (in practice it is rendered ineffective) so as not to produce errors if it had been used within the document. % \begin{macrocode} \ifsuftesi@screen \newcommand*\crop[1][]{} \ifsuftesi@screencentered \geometry{hmarginratio=1:1} - \else - \fi + \fi \else \RequirePackage[a4,cam,center]{crop} \fi % \end{macrocode} -% \subsection*{Fonts} +% \subsection{Fonts} % If you use \hologo{XeLaTeX} or \hologo{LuaLaTeX} no default font is loaded. % Anyway the \sty{fontspec} package is required because some commands -% of the class are base on it. +% of the class are base on it. If \sty{fontspec} is not loaded, a class error will be issued. % \begin{macrocode} -\unless\ifPDFTeX%if xelatex or lualatex +\unless\ifPDFTeX \AtBeginDocument{% \@ifpackageloaded{fontspec} {\relax} @@ -3343,10 +3351,10 @@ quotesize,footnotestyle,liststyle,captionstyle} \ifsuftesi@standard \RequirePackage{lmodern} \ifsuftesi@greekfont - \ClassWarningNoLine{suftesi}{% - Unused 'greekfont' option}% - \suftesi@greekfontfalse - \else\suftesi@greekfontfalse\fi + \ClassWarningNoLine{suftesi}{% + Unused 'greekfont' option}% + \suftesi@greekfontfalse + \else\suftesi@greekfontfalse\fi \else % \end{macrocode} % Previous versions of the class were based on @@ -3355,77 +3363,77 @@ quotesize,footnotestyle,liststyle,captionstyle} % for backward compatibility. % \begin{macrocode} \ifsuftesi@compatibility - \RequirePackage[osf,sc]{mathpazo} - \RequirePackage[scaled=0.8]{beramono} - \renewcommand{\sfdefault}{iwona} - \ifsuftesi@greekfont - \ifsuftesi@bodoni - \gdef\SUFfntscale{0.96} - \else - \ifsuftesi@artemisia - \gdef\SUFfntscale{0.97} - \else - \ifsuftesi@porson - \gdef\SUFfntscale{1.18} - \else - \ifsuftesi@cbgreek - \def\lmfntscale{1.06} - \else - \fi - \fi - \fi - \fi - \else - \ClassWarningNoLine{suftesi}{\MessageBreak - If you need the Greek font remember\MessageBreak - to set one of the following options:\MessageBreak - greekfont=artemisia,\MessageBreak - greekfont=porson,\MessageBreak - greekfont=cbgreek} - \fi + \RequirePackage[osf,sc]{mathpazo} + \RequirePackage[scaled=0.8]{beramono} + \renewcommand{\sfdefault}{iwona} + \ifsuftesi@greekfont + \ifsuftesi@bodoni + \gdef\SUFfntscale{0.96} + \else + \ifsuftesi@artemisia + \gdef\SUFfntscale{0.97} + \else + \ifsuftesi@porson + \gdef\SUFfntscale{1.17} + \else + \ifsuftesi@cbgreek + \def\lmfntscale{1.06} + \else + \fi + \fi + \fi + \fi + \else + \ClassWarningNoLine{suftesi}{\MessageBreak + If you need the Greek font remember\MessageBreak + to set one of the following options:\MessageBreak + greekfont=artemisia,\MessageBreak + greekfont=porson,\MessageBreak + greekfont=cbgreek} + \fi \else \ifsuftesi@palatino \RequirePackage[full]{textcomp} - \RequirePackage{newpxtext} - \RequirePackage[scaled=1.06]{biolinum} - \RequirePackage[varqu,varl]{inconsolata} - \ifsuftesi@mathextended - \RequirePackage{amsthm} - \RequirePackage[bigdelims,vvarbb]{newpxmath} - \RequirePackage[cal=boondoxo]{mathalpha} - \else - \ifsuftesi@mathminimal - \RequirePackage[bigdelims,vvarbb]{newpxmath} - \else - \fi - \fi - \useosf - \useproportional - \ifsuftesi@greekfont - \ifsuftesi@bodoni - \gdef\SUFfntscale{0.96} - \else - \ifsuftesi@artemisia - \gdef\SUFfntscale{0.97} - \else - \ifsuftesi@porson - \gdef\SUFfntscale{1.18} - \else - \ifsuftesi@cbgreek - \def\lmfntscale{1.06} - \else - \fi - \fi - \fi - \fi - \else - \ClassWarningNoLine{suftesi}{\MessageBreak - If you need the Greek font remember\MessageBreak - to set one of the following options:\MessageBreak - greekfont=artemisia,\MessageBreak - greekfont=porson,\MessageBreak - greekfont=cbgreek} - \fi + \RequirePackage{newpxtext} + \RequirePackage[scaled=1.06]{biolinum} + \RequirePackage[varqu,varl]{inconsolata} + \ifsuftesi@mathextended + \RequirePackage{amsthm} + \RequirePackage[bigdelims,vvarbb]{newpxmath} + \RequirePackage[cal=boondoxo]{mathalpha} + \else + \ifsuftesi@mathminimal + \RequirePackage[bigdelims,vvarbb]{newpxmath} + \else + \fi + \fi + \useosf + \useproportional + \ifsuftesi@greekfont + \ifsuftesi@bodoni + \gdef\SUFfntscale{0.96} + \else + \ifsuftesi@artemisia + \gdef\SUFfntscale{0.97} + \else + \ifsuftesi@porson + \gdef\SUFfntscale{1.17} + \else + \ifsuftesi@cbgreek + \def\lmfntscale{1.06} + \else + \fi + \fi + \fi + \fi + \else + \ClassWarningNoLine{suftesi}{\MessageBreak + If you need the Greek font remember\MessageBreak + to set one of the following options:\MessageBreak + greekfont=artemisia,\MessageBreak + greekfont=porson,\MessageBreak + greekfont=cbgreek} + \fi \else \ifsuftesi@libertine \RequirePackage{textcomp} @@ -3441,49 +3449,49 @@ quotesize,footnotestyle,liststyle,captionstyle} \else \fi \fi - \useosf - \ifsuftesi@bodoni - \gdef\SUFfntscale{0.9} - \else - \ifsuftesi@artemisia - \gdef\SUFfntscale{0.91} - \else - \ifsuftesi@porson - \gdef\SUFfntscale{1.1} - \else - \fi - \fi - \fi + \useosf + \ifsuftesi@bodoni + \gdef\SUFfntscale{0.9} + \else + \ifsuftesi@artemisia + \gdef\SUFfntscale{0.91} + \else + \ifsuftesi@porson + \gdef\SUFfntscale{1.1} + \else + \fi + \fi + \fi \else \ifsuftesi@cochineal \RequirePackage{textcomp} - \RequirePackage{cochineal} - \RequirePackage[varqu,varl,var0]{inconsolata} - \RequirePackage{biolinum} - \ifsuftesi@mathextended - \RequirePackage{amsthm} - \RequirePackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath} - \RequirePackage[cal=boondoxo]{mathalpha} - \else - \ifsuftesi@mathminimal - \RequirePackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath} - \else - \fi - \fi - \useosf - \useproportional - \ifsuftesi@bodoni - \gdef\SUFfntscale{0.9} - \else - \ifsuftesi@artemisia - \gdef\SUFfntscale{0.905} - \else - \ifsuftesi@porson - \gdef\SUFfntscale{1.1} - \else - \fi - \fi - \fi + \RequirePackage{cochineal} + \RequirePackage[varqu,varl,var0]{inconsolata} + \RequirePackage{biolinum} + \ifsuftesi@mathextended + \RequirePackage{amsthm} + \RequirePackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath} + \RequirePackage[cal=boondoxo]{mathalpha} + \else + \ifsuftesi@mathminimal + \RequirePackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath} + \else + \fi + \fi + \useosf + \useproportional + \ifsuftesi@bodoni + \gdef\SUFfntscale{0.9} + \else + \ifsuftesi@artemisia + \gdef\SUFfntscale{0.905} + \else + \ifsuftesi@porson + \gdef\SUFfntscale{1.1} + \else + \fi + \fi + \fi \else \fi \fi @@ -3492,9 +3500,6 @@ quotesize,footnotestyle,liststyle,captionstyle} \fi \fi \fi -% -% -% \begin{macrocode} \unless\ifPDFTeX\else \ifsuftesi@greekfont \ifsuftesi@artemisia @@ -3516,17 +3521,21 @@ quotesize,footnotestyle,liststyle,captionstyle} % \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. % \begin{macrocode} -\AtEndPreamble{ +\AtEndPreamble{ \substitutefont{LGR}{\rmdefault}{\SUF@greekfamily} \DeclareRobustCommand{\greektext}{% - \usefont{LGR}{\SUF@greekfamily}{\f@series}{\f@shape} - \def\encodingdefault{LGR}} - \DeclareTextFontCommand{\textgreek}{\greektext}} + \usefont{LGR}{\SUF@greekfamily}{\f@series}{\f@shape} + \def\encodingdefault{LGR}} + \DeclareTextFontCommand{\textgreek}{\greektext} +} \ifsuftesi@cbgreek \else % \end{macrocode} % We redefine the font definitions of the GFS fonts % in order to scale the fonts according to the roman default. +% The first code for the Porson font (\sty{suftesi} s * [\SUFfntscale] gbodonirg6a}{} @@ -3573,9 +3582,9 @@ quotesize,footnotestyle,liststyle,captionstyle} \fi \fi % \end{macrocode} -% \subsection*{Section titles} +% \subsection{Section titles} % \begin{macrocode} -\RequirePackage{titlesec} +\RequirePackage[newparttoc]{titlesec} \newlength{\sectionsep} \setlength{\sectionsep}{\dimexpr(\baselineskip) plus 1pt minus 1pt} \unless\ifPDFTeX% if xetex or luatex @@ -3594,7 +3603,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \scshape\suftesi@MakeTextLowercase{\textls*{#1}}}% \fi % \end{macrocode} -% Default styles: +% \subsubsection{Default styles} % \begin{macrocode} \newlength\SUF@ADJnumparchap \def\SUF@default@CHAPTER{ @@ -3616,8 +3625,6 @@ quotesize,footnotestyle,liststyle,captionstyle} \else \setlength{\SUF@ADJnumparchap}{0pt} \fi} -% \end{macrocode} -% \begin{macrocode} \def\SUF@default@SECTIONS{ \ifsuftesi@numparsec % \titleformat{\section}[display] @@ -3646,8 +3653,6 @@ quotesize,footnotestyle,liststyle,captionstyle} {\SUF@SEC@StyleSwitch} \titlespacing*{\section}{0ex}{\sectionsep}{\sectionsep}[0ex] \fi -% \end{macrocode} -% \begin{macrocode} \ifsuftesi@numparsubsec % \titleformat{\subsection}[display] % {\SUF@subsectionsize\SUF@lr@SUBSECSwitch} @@ -3673,8 +3678,6 @@ quotesize,footnotestyle,liststyle,captionstyle} {\SUF@SUBSEC@StyleSwitch} \titlespacing*{\subsection}{\parindent}{\sectionsep}{\sectionsep}[0ex] \fi -% \end{macrocode} -% \begin{macrocode} \ifsuftesi@numparsubsubsec % \titleformat{\subsubsection}[display] % {\SUF@subsectionsize\SUF@lr@SUBSUBSECSwitch} @@ -3699,10 +3702,12 @@ quotesize,footnotestyle,liststyle,captionstyle} {1em} {\SUF@SUBSUBSEC@StyleSwitch} \titlespacing*{\subsubsection}{\parindent}{\sectionsep}{\sectionsep}[0ex] - \fi -} + \fi} \SUF@default@CHAPTER \SUF@default@SECTIONS +% \end{macrocode} +% \subsubsection{Sections spacing} +% \begin{macrocode} \ifsuftesi@periodical \titlespacing*{\chapter}{0em}{\SUF@ADJnumparchap}{18ex} \titlespacing*{name=\chapter,numberless}{0em}{0pt}{18ex} @@ -3737,70 +3742,110 @@ quotesize,footnotestyle,liststyle,captionstyle} \fi \fi % \end{macrocode} -% \paragraph{Redefinitions for \opt{`article'} mode} +% Some redefinitions for \opt{article} mode: % \begin{macrocode} \ifsuftesi@article \def\chapter#1{\ClassError{suftesi} - {\noexpand\chapter level is undefined - using 'structure=article'} - {\noexpand\chapter level is undefined - using 'structure=article'}} - \setcounter{tocdepth}{3} - \setcounter{secnumdepth}{3} - \renewcommand\thesection{% - \@arabic\c@section} - \renewcommand\thesubsection{% - \thesection.\@arabic\c@subsection} - \renewcommand\thesubsubsection{% - \thesubsection.\@arabic\c@subsubsection} - \renewcommand\theparagraph{% - \thesubsubsection.\@arabic\c@paragraph} - \renewcommand\thesubparagraph{% - \theparagraph.\@arabic\c@subparagraph} + {\noexpand\chapter level is undefined + using 'structure=article'} + {\noexpand\chapter level is undefined + using 'structure=article'}} +\setcounter{tocdepth}{3} +\setcounter{secnumdepth}{3} +\renewcommand\thesection{% + \@arabic\c@section} +\renewcommand\thesubsection{% + \thesection.\@arabic\c@subsection} +\renewcommand\thesubsubsection{% + \thesubsection.\@arabic\c@subsubsection} +\renewcommand\theparagraph{% + \thesubsubsection.\@arabic\c@paragraph} +\renewcommand\thesubparagraph{% + \theparagraph.\@arabic\c@subparagraph} % \end{macrocode} -% The \opt{partpage} options allows you to print a standard part page -% in \opt{article} mode, which is similar to a -% \cmd{section} but with more vertical space before and after. +% \subsection*{The \cmd{part} command} % \begin{macrocode} -\ifsuftesi@partpage - \relax - \else - \titleclass{\part}{straight} - \titlespacing*{\part}{0ex}{2\sectionsep}{2\sectionsep}[0ex] -\fi -\ifsuftesi@numparpart -\titleformat{\part}[display] - {\SUF@partsize\SUF@lr@PARTSwitch} - {\SUF@PART@StyleSwitch\partname\hskip.5em\SUF@thepart\SUF@dotpart} - {2ex} - {\SUF@PART@StyleSwitch} -\else -\titleformat{\part}[hang] - {\SUF@partsize\SUF@lr@PARTSwitch} - {\SUF@PART@StyleSwitch\partname\hskip.5em\SUF@thepart\SUF@dotpart} - {1em} - {\SUF@PART@StyleSwitch} +\renewcommand\part{% + \ifsuftesi@partpage + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \thispagestyle{plain}% + \fi + \if@twocolumn + \onecolumn + \@tempswatrue + \else + \@tempswafalse + \fi + \ifsuftesi@partpage + \null\vfil + \fi + \secdef\@part\@spart} \fi + +\def\@part[#1]#2{% + \ifnum \c@secnumdepth >-2\relax + \refstepcounter{part}% + \addcontentsline{toc}{part}{\normalfont\normalsize + \SUF@tocpartname\hskip.5em{\SUF@tocPARTnum@font\SUF@thepart}% + \SUF@dotpart\hspace{1em}\SUF@tocPART@font#1}% + \else + \addcontentsline{toc}{part}{\normalfont\normalsize + \SUF@tocPART@font#1}% + \fi + \markboth{}{}% + {\SUF@lr@PARTSwitch\SUF@partsize + \interlinepenalty \@M + \ifnum \c@secnumdepth >-2\relax + \noindent\partname\hskip.5em{\SUF@PART@font\SUF@thepart}\SUF@dotpart + \ifsuftesi@numparpart + \par + \vskip2ex + \else + \hspace{1em} + \fi + \noindent\SUF@PART@StyleSwitch#2\par}% + \@endpart} + +\def\@spart#1{% + {\SUF@lr@PARTSwitch\SUF@partsize + \interlinepenalty \@M + \noindent\SUF@PART@StyleSwitch#1\par}% + \@endpart} + +\ifsuftesi@article +\def\@endpart{% + \ifsuftesi@partpage + \vfil\newpage + \if@twoside + \if@openright + \null + \thispagestyle{empty}% + \newpage + \fi + \fi + \fi + \if@tempswa + \twocolumn + \fi} \else -% \end{macrocode} -% \paragraph{The default \opt{`book'} mode} -% \begin{macrocode} -\ifsuftesi@numparpart -\titleformat{\part}[display] - {\SUF@partsize\SUF@lr@PARTSwitch} - {\SUF@PART@StyleSwitch\partname\hskip.5em\SUF@thepart\SUF@dotpart} - {2ex} - {\SUF@PART@StyleSwitch} -\else -\titleformat{\part}[hang] - {\SUF@partsize\SUF@lr@PARTSwitch} - {\SUF@PART@StyleSwitch\partname\hskip.5em\SUF@thepart\SUF@dotpart} - {1em} - {\SUF@PART@StyleSwitch} -\fi +\def\@endpart{\vfil\newpage + \if@twoside + \if@openright + \null + \thispagestyle{empty}% + \newpage + \fi + \fi + \if@tempswa + \twocolumn + \fi} \fi - % \end{macrocode} +% Other sublevels: % \begin{macrocode} \titleformat{\paragraph}[runin] {} @@ -3809,8 +3854,6 @@ quotesize,footnotestyle,liststyle,captionstyle} {\itshape} [{.}\hspace*{1em}] \titlespacing*{\paragraph}{\parindent}{.5\sectionsep}{.5\sectionsep} -% \end{macrocode} -% \begin{macrocode} \titleformat{\subparagraph}[runin] {} {\thesubparagraph} @@ -3828,71 +3871,67 @@ quotesize,footnotestyle,liststyle,captionstyle} \AtBeginDocument{% \@ifpackageloaded{biblatex}{% \defbibheading{bibliography}[\refname]{% - \section*{#1}% - \markboth{#1}{#1}} - \defbibheading{shorthands}[\losname]{% - \section*{#1}% - \markboth{#1}{#1}} + \section*{#1}% + \@mkboth{#1}{#1}} + \defbibheading{biblist}[\biblistname]{% + \section*{#1}% + \@mkboth{#1}{#1}} \defbibheading{bibintoc}[\refname]{% - \section*{#1}% - \addcontentsline{toc}{section}{#1}% - \markboth{#1}{#1}} - \defbibheading{losintoc}[\losname]{% - \section*{#1}% - \addcontentsline{toc}{section}{#1}% - \markboth{#1}{#1}} + \section*{#1}% + \addcontentsline{toc}{section}{#1}% + \@mkboth{#1}{#1}} + \defbibheading{biblistintoc}[\biblistname]{% + \section*{#1}% + \addcontentsline{toc}{section}{#1}% + \@mkboth{#1}{#1}} \defbibheading{bibnumbered}[\refname]{% - \section{#1}% - \if@twoside\markright{#1}\fi} - \defbibheading{losnumbered}[\losname]{% - \section{#1}% - \if@twoside\markright{#1}\fi} + \section{#1}} + \defbibheading{biblistnumbered}[\biblistname]{% + \section{#1}} \defbibheading{subbibliography}[\refname]{% - \subsection*{#1}} + \subsection*{#1}} \defbibheading{subbibintoc}[\refname]{% - \subsection*{#1}% - \addcontentsline{toc}{subsection}{#1}} + \subsection*{#1}% + \addcontentsline{toc}{subsection}{#1}} \defbibheading{subbibnumbered}[\refname]{% - \subsection{#1}}}% - {\relax}% + \subsection{#1}} }% +{\relax}} \else \AtBeginDocument{% \@ifpackageloaded{biblatex}{% \defbibheading{bibliography}[\bibname]{% - \chapter*{#1}% - \markboth{#1}{#1}} - \defbibheading{shorthands}[\losname]{% - \chapter*{#1}% - \markboth{#1}{#1}} + \chapter*{#1}% + \@mkboth{#1}{#1}} + \defbibheading{biblist}[\biblistname]{% + \chapter*{#1}% + \@mkboth{#1}{#1}} \defbibheading{bibintoc}[\bibname]{% - \chapter*{#1}% - \addcontentsline{toc}{chapter}{#1}% - \markboth{#1}{#1}} - \defbibheading{losintoc}[\losname]{% - \chapter*{#1}% - \addcontentsline{toc}{chapter}{#1}% - \markboth{#1}{#1}} + \chapter*{#1}% + \addcontentsline{toc}{chapter}{#1}% + \@mkboth{#1}{#1}} + \defbibheading{biblistintoc}[\biblistname]{% + \chapter*{#1}% + \addcontentsline{toc}{chapter}{#1}% + \@mkboth{#1}{#1}} \defbibheading{bibnumbered}[\bibname]{% - \chapter{#1}% - \if@twoside\markright{#1}\fi} - \defbibheading{losnumbered}[\losname]{% - \chapter{#1}% - \if@twoside\markright{#1}\fi} + \chapter{#1}} + \defbibheading{biblistnumbered}[\biblistname]{% + \chapter{#1}} \defbibheading{subbibliography}[\refname]{% - \section*{#1}% - \if@twoside\markright{#1}\fi} + \section*{#1}% + \if@twoside\markright{#1}\fi} \defbibheading{subbibintoc}[\refname]{% - \section*{#1}% - \addcontentsline{toc}{section}{#1}% - \if@twoside\markright{#1}\fi} + \section*{#1}% + \addcontentsline{toc}{section}{#1}% + \if@twoside\markright{#1}\fi} \defbibheading{subbibnumbered}[\refname]{% - \section{#1}}} - {\relax}% + \section{#1}} }% +{\relax}} \fi % \end{macrocode} -% \subsection*{Cover page} +% \subsection{Cover page} % \begin{macrocode} \newcommand{\Ctitle}[1]{\def\@Ctitle{#1}} \newcommand{\Csubtitle}[1]{\def\@Csubtitle{#1}} @@ -3965,7 +4004,7 @@ quotesize,footnotestyle,liststyle,captionstyle} ************************************}}} } % \end{macrocode} -% \subsection*{Title page} +% \subsection{Title page} % The new \cmd{title} command has an optional argument % which can be used in the headers. % \begin{macrocode} @@ -3994,7 +4033,7 @@ quotesize,footnotestyle,liststyle,captionstyle} No \string\author\space given\MessageBreak% See the class documentation for explanation}} % \end{macrocode} -% For |titlepage| (default) option: +% \subsubsection{For \opt{titlepage} (default) option} % \begin{macrocode} \if@titlepage% titlepage \renewcommand\maketitle{\begin{titlepage}% @@ -4038,7 +4077,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \global\let\date\relax \global\let\and\relax} % \end{macrocode} -% Reproduces the standard |\maketitle| style: +% \paragraph{The standard \cmd{aketitle} style} % \begin{macrocode} \newcommand\standardtitle{\begin{titlepage}% \let\footnotesize\small @@ -4069,7 +4108,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \global\let\and\relax} \else % \end{macrocode} -% For |notitlepage| option: +% \subsubsection{For \opt{notitlepage} option} % \begin{macrocode} \renewcommand\maketitle{\par \begingroup @@ -4130,7 +4169,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \par \vskip 1.5em} % \end{macrocode} -% Reproduces the standard |\maketitle| style: +% \paragraph{The standard \cmd{maketitle} style} % \begin{macrocode} \newcommand\standardtitle{\par \begingroup @@ -4180,7 +4219,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \vskip 1.5em} \fi % \end{macrocode} -% \subsection*{The \opt{collection} document structure} +% \subsection{The \opt{collection} structure} % \begin{macrocode} \ifsuftesi@collection \newcounter{journalnumber} @@ -4221,8 +4260,6 @@ quotesize,footnotestyle,liststyle,captionstyle} \def\collectioneditor#1{\gdef\@collectioneditor{#1}} \def\@collectioneditor{\@latex@warning@no@line{% No \noexpand\collectioneditor given}} -% \end{macrocode} -% \begin{macrocode} \renewcommand*{\title}[2][]{% \gdef\@headtitle{#1}\gdef\@title{#2}\markright{#1}} \edef\title{\noexpand\@dblarg @@ -4270,8 +4307,6 @@ quotesize,footnotestyle,liststyle,captionstyle} \penalty\@highpenalty \endgroup \fi} -% \end{macrocode} -% \begin{macrocode} \renewcommand\maketitle{\par \begingroup \renewcommand\thefootnote{\@fnsymbol\c@footnote}% @@ -4352,10 +4387,6 @@ quotesize,footnotestyle,liststyle,captionstyle} \cleardoublepage \global\let\@thanks\@empty \endgroup} -% \end{macrocode} -% A command to typeset -% the frontispiece of the collection. -% \begin{macrocode} \newcommand{\frontispiece}{% \thispagestyle{empty}% \begingroup @@ -4392,7 +4423,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \else \fi % \end{macrocode} -% \subsection*{Frontispiece} +% \subsection{Frontispiece} % \begin{macrocode} \AtBeginDocument{% \@ifpackagewith{frontespizio}{suftesi}{% @@ -4443,6 +4474,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \fi\fi\fi\fi\fi\fi} {\relax}}} % \end{macrocode} +% \subsection{The index} % \begin{macrocode} \renewenvironment{theindex} {\if@twocolumn @@ -4465,12 +4497,9 @@ quotesize,footnotestyle,liststyle,captionstyle} \let\item\@idxitem} {\if@restonecol\onecolumn\else\clearpage\fi} % \end{macrocode} -% \subsection*{Appendix} +% \subsection{Appendices} % \begin{macrocode} \RequirePackage{appendix} -\renewcommand{\appendixpagename}{Appendici} -\renewcommand{\appendixtocname}{Appendici} -\renewcommand{\appendixname}{Appendice} \noappendicestocpagenum % Bug using defaultfont=none,libertine,standard,compatibility % \AtBeginEnvironment{appendices}{\appendix\mainmatter} @@ -4484,38 +4513,6 @@ quotesize,footnotestyle,liststyle,captionstyle} Redefine the \noexpand\appendixpagename command instead. See the 'appendix' package documentation.\MessageBreak \noexpand\renewcommand{\noexpand\appendixpagename{newname}}}} -% \newcommand{\appendicesname}[1]{\def\SUF@appendices{#1}} -% \appendicesname{Appendici} -% \newcommand{\appendixpage}{\SUF@appendixpage} -% \def\SUF@appendixpage{% -% \@mainmattertrue -% \titlecontents{part} -% [0em] -% {\addvspace{3ex}} -% {} -% {} -% {} -% [\addvspace{1ex}] -% \let\contentspage\relax -% \cleardoublepage -% \thispagestyle{empty} -% \addcontentsline{toc}{part}{\SUF@appendices} -% \begingroup -% \centering -% \null\vfil -% {\LARGE\SUF@appendices\par} -% \vfil -% \endgroup -% \cleardoublepage -% \titlecontents{part} -% [0em] -% {\addvspace{3ex}\partname~} -% {\makebox[\SUF@label@part][l]{% -% \thecontentslabel}\hspace*{1em}} -% {} -% {} -% [\addvspace{1ex}] -% } \renewcommand{\@chap@pppage}{% \clear@ppage \thispagestyle{plain}% @@ -4654,7 +4651,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \renewcommand{\thechapter}{\@Alph\c@chapter}} \fi % \end{macrocode} -% \subsection*{Headings} +% \subsection{Headings} % \begin{macrocode} \RequirePackage{fancyhdr} \newcommand{\versionstring}[1]{\def\version@string{#1}} @@ -4693,8 +4690,8 @@ quotesize,footnotestyle,liststyle,captionstyle} \fancyhf{}% \fancyfoot[RE,LO]{% \ifsuftesi@draftdate\footnotesize\SUF@versionstring\else\fi} - \fancyhead[CO]{\footnotesize\xheadbreakfalse\SUF@rightmark} - \fancyhead[CE]{\footnotesize\xheadbreakfalse% + \fancyhead[CO]{\footnotesize\breakinbodyfalse\SUF@rightmark} + \fancyhead[CE]{\footnotesize\breakinbodyfalse% \SUF@LR@MarkSwitch} \fancyfoot[C]{\footnotesize\SUF@thepage}% }% @@ -4706,8 +4703,8 @@ quotesize,footnotestyle,liststyle,captionstyle} \fancyfoot[RE,LO]{% \ifsuftesi@draftdate\footnotesize\SUF@versionstring\else\fi} \fancyhead[LE,RO]{\footnotesize\SUF@thepage} - \fancyhead[LO]{\footnotesize\xheadbreakfalse\SUF@rightmark} - \fancyhead[RE]{\footnotesize\xheadbreakfalse% + \fancyhead[LO]{\footnotesize\breakinbodyfalse\SUF@rightmark} + \fancyhead[RE]{\footnotesize\breakinbodyfalse% \SUF@LR@MarkSwitch} }% % @@ -4722,17 +4719,12 @@ quotesize,footnotestyle,liststyle,captionstyle} \fi \def\SUF@leftrightmark{% \if@mainmatter\leftmark\else\rightmark\fi} -% \end{macrocode} -% Setting the default page style: -% \begin{macrocode} \pagestyle{sufdefault} \ifsuftesi@centerheader\pagestyle{centerheader}\else\fi \ifsuftesi@sufplain\pagestyle{sufplain}\else\fi} % \end{macrocode} -% \subsection*{Text elements} -% +% \subsection{Text elements} % \paragraph{Block Quotations} -% % New environments for block quotations according to a popular Italian style. % The font size is the same of the footnotes and the margins are set to \cmd{parindent}. % \begin{macrocode} @@ -4778,7 +4770,7 @@ quotesize,footnotestyle,liststyle,captionstyle} \def\thefootnote{\@fnsymbol\c@footnote}% \else\fi % \end{macrocode} -% Prints a footnote with discretionary +% \paragraph{The \cmd{xfootnote} command} Prints a footnote with discretionary % symbol give in the first argument. % \begin{macrocode} \newcommand*\xfootnote[1][*]{% @@ -4883,8 +4875,6 @@ quotesize,footnotestyle,liststyle,captionstyle} \fi usando la classe \textsf{suftesi} di Ivan Valbusa\index{Valbusa, Ivan}. #3\par} \cleardoublepage} -% \end{macrocode} -% \begin{macrocode} \newcommand{\bookcolophon}[2]{% \thispagestyle{empty} \null @@ -4893,15 +4883,11 @@ quotesize,footnotestyle,liststyle,captionstyle} \vfill {\small\noindent #2\par} \cleardoublepage} -% \end{macrocode} -% \begin{macrocode} \newcommand{\artcolophon}[1]{% \thispagestyle{empty} \null \vfill {\small\noindent #1\par}} -% \end{macrocode} -% \begin{macrocode} \newcommand{\finalcolophon}[1]{% \thispagestyle{empty} \null\vspace*{\stretch{1}} @@ -4953,19 +4939,16 @@ Janusz M.~Nowacki. only for the FSPL styles}} \fi % \end{macrocode} -% \subsection*{Toc, lof, lot} +% \subsection{ToC, LoF and LoT} % \begin{macrocode} \RequirePackage{titletoc} % \end{macrocode} % All the lengths depend on |\SUF@label@chap| -% so we define this first. +% so we define this first. The |\toclabelwidth| lengtth is provided to +% adjust the label width in the table of contents. % \begin{macrocode} \newlength\SUF@label@chap \setlength\SUF@label@chap{.5em} -% \end{macrocode} -% |\toclabelwidth| is provided to -% adjust the label width in the table of contents: -% \begin{macrocode} \newcommand*{\toclabelwidth}[2]{% \AtBeginDocument{ \addtolength{\csname SUF@label@#1\endcsname}{#2}% @@ -4992,7 +4975,7 @@ Janusz M.~Nowacki. See package documentation for details}} % \end{macrocode} % This macro controls the space between page number and chapter -% label using the \opt{tocpageleft} option: +% label using the \opt{toc=pageleft} option: % \begin{macrocode} \newlength{\SUF@tochang} \setlength{\SUF@tochang}{3em} @@ -5023,23 +5006,26 @@ Janusz M.~Nowacki. {\SUF@label@sec} } % \end{macrocode} -% Part in article mode +% \paragraph{Part etry} +% The style of the part ToC entry the same in all ToC types, +% i.e. aligned to the left and without page indication. +% The font options act only on the title, which is always printed +% in Roman shape, and not on the label. +% As is the case for the other sectioning commands. % \begin{macrocode} -\titlecontents{part} - [0em] - {\addvspace{3ex}\partname\hspace*{.5em}} - {\makebox[\SUF@label@part][l]{% - \thecontentslabel}\hspace*{1em}} - {} - {} - [\addvspace{1ex}] +%\titlecontents{part} +% [0em] +% {\addvspace{3ex}} +% {\partname\hspace*{.5em}\makebox[\SUF@label@part][l]{% +% \SUF@PART@thecontentslabel}\hspace*{1em}\SUF@tocPART@font} +% {\SUF@tocPART@font} +% {} +% [\addvspace{1ex}] % \end{macrocode} -% \paragraph{`\opt{tocpageleft}' toc} +% \paragraph{The `left' ToC} +% With this option, page numbers are placed to the left of the respective entry. Therefore we set the space provided for the page number on the right to zero, using the \cmd{contentsmargin} command. In this way the right margin of the index is correctly aligned. % \begin{macrocode} \ifsuftesi@pagelefttoc -% \end{macrocode} -% First we reset the right margin to zero: -% \begin{macrocode} \contentsmargin{0pt} \AtBeginDocument{ \newlength\SUF@tochang@chap @@ -5092,7 +5078,7 @@ Janusz M.~Nowacki. {\dimexpr(\SUF@addto@tochang@chap-\SUF@label@sec+\SUF@label@chap)} } % \end{macrocode} -% \paragraph{TOC entries} +% \paragraph{ToC entries} % \begin{macrocode} \titlecontents{chapter} [\SUF@tochang@chap] @@ -5199,7 +5185,7 @@ Janusz M.~Nowacki. {} \else % \end{macrocode} -% \paragraph{Default toc} +% \paragraph{Default ToC} % \begin{macrocode} \AtBeginDocument{ \newlength\SUF@tocindent@chap @@ -5245,7 +5231,7 @@ Janusz M.~Nowacki. \fi } % \end{macrocode} -% \paragraph{TOC entries} +% \paragraph{ToC entries} % \begin{macrocode} \titlecontents{chapter} [\SUF@tocindent@chap] @@ -5338,8 +5324,7 @@ Janusz M.~Nowacki. {\SUF@titlerule\contentspage} \fi % \end{macrocode} -% With \opt{article} option the toc, lof and lot -% are printed as sections. +% \subparagraph{The ToC, LoF and LoT in the \opt{article} structure} % \begin{macrocode} \ifsuftesi@article \renewcommand\tableofcontents{% @@ -5386,7 +5371,7 @@ Janusz M.~Nowacki. } \else % \end{macrocode} -% The default toc, lof and lot are treated as chapters. +% \subparagraph{The ToC, LoF and LoT in the \opt{book} structure} % \begin{macrocode} \renewcommand\tableofcontents{% \if@twocolumn @@ -5449,7 +5434,41 @@ Janusz M.~Nowacki. } \fi % \end{macrocode} -% \subsection*{New commands} +% \subsection{Customizing sections font} +% \begin{macrocode} +\newcommand{\tocpartname}[1]{\def\SUF@tocpartname{#1}} + \tocpartname{\partname} +\newcommand{\partfont}[1]{\def\SUF@PART@StyleSwitch{#1}} +\newcommand{\chapfont}[1]{\def\SUF@CHAP@StyleSwitch{#1}} +\newcommand{\secfont}[1]{\def\SUF@SEC@StyleSwitch{#1}} +\newcommand{\subsecfont}[1]{\def\SUF@SUBSEC@StyleSwitch{#1}} +\newcommand{\subsubsecfont}[1]{\def\SUF@SUBSUBSEC@StyleSwitch{#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@titlefont@Switch{#1}} +\newcommand{\authorfont}[1]{\def\SUF@authorfont@Switch{#1}} +\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{\tocpartnumfont}[1]{\def\SUF@tocPARTnum@font{#1}} + \tocpartnumfont{} +\newcommand{\tocchapnumfont}[1]{% + \def\SUF@CHAP@thecontentslabel{#1\thecontentslabel}} +\newcommand{\tocsecnumfont}[1]{% + \def\SUF@SEC@thecontentslabel{#1\thecontentslabel}} +\newcommand{\tocsubsecnumfont}[1]{% + \def\SUF@SUBSEC@thecontentslabel{#1\thecontentslabel}} +\newcommand{\tocsubsubsecnumfont}[1]{% + \def\SUF@SUBSUBSEC@thecontentslabel{#1\thecontentslabel}} +% \end{macrocode} +% \subsection{New commands} +% A command to print an unnumbered introduction at the beginning of the chapter. The \cmd{chapterintroname} defaults to ``Introduzione'' because the class was initially designed primarily for Italian-speaking users. % \begin{macrocode} \ifsuftesi@article \def\chapterintro{% @@ -5468,34 +5487,39 @@ Janusz M.~Nowacki. \chapterintroname{Introduzione} \fi % \end{macrocode} -% \subsubsection*{Manual breaks} -% Active in the table of contents but not in the text. -% \begin{macrocode} -\newif\ifheadbreak\headbreakfalse - \DeclareRobustCommand{\headbreak} - {\ifheadbreak\\\else\fi} -% \end{macrocode} -% Active in the text but not in the table of contents. -% \begin{macrocode} -\newif\ifxheadbreak\xheadbreaktrue - \def\xheadbreakNL{\ifxheadbreak\newline\else\fi} - \def\xheadbreakBB{\ifxheadbreak\\\else\fi} -% \end{macrocode} +% 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\headbreaktrue\xheadbreakfalse% - \origtableofcontents\endgroup} +\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*{Backward compatibility} -% An environment to manually typeset the bibliography. (Use \sty{biblatex} instead!) +% \subsection{Backward compatibility} +% Two environments to manually typeset the bibliography and the list of shorthands. +% As the class was initially designed primarily for Italian-speaking users, these two environments have an Italian name. Particularly the list of shorthands relies on \cmd{losname} which defaults to ``Sigle'' (that means ``shorthands''). They are not documented and are made available only for backward compatibility. % \begin{macrocode} \newenvironment{bibliografia}{% \ifsuftesi@article \section*{\refname} \addcontentsline{toc}{section}{\refname} \else - \chapter{\bibname}% + \chapter{\bibname}% \fi \normalfont \list{}{% \setlength{\itemindent}{-\parindent} @@ -5504,9 +5528,6 @@ Janusz M.~Nowacki. \setlength{\parsep}{\parskip} \let\makelabel}} {\endlist} -% \end{macrocode} -% An environment to manually typeset the list of shorthands. (Use \sty{biblatex} instead!) -% \begin{macrocode} \newcommand{\losname}{Sigle} \newcommand{\itlabel}[1]{\itshape\hbox to 6em{#1}} \newenvironment{sigle}{% @@ -5521,7 +5542,7 @@ Janusz M.~Nowacki. \let\makelabel\itlabel}} {\endlist} % \end{macrocode} -% \subsection*{Final settings} +% \subsection{Final settings} % \begin{macrocode} \ifsuftesi@article \renewcommand\frontmatter{\ClassError{suftesi} @@ -5562,8 +5583,8 @@ Janusz M.~Nowacki. \let\hemph\emph % \end{macrocode} % The first line of all sections is indented by default -% using \hologo{XeLaTeX} with Italian as the main language. Anyway this is -% incongruous with the \hologo{LaTeX} default. +% using \hologo{XeLaTeX} with Italian as the main language. I think that this is +% incongruous with the \hologo{LaTeX} default. For this reason: % \begin{macrocode} \unless\ifPDFTeX% if xetex or luatex \let\@afterindenttrue\@afterindentfalse @@ -5615,7 +5636,7 @@ Janusz M.~Nowacki. Month = {10}, Number = {9}, Title = {Creare stili bibliografici con \textsf{biblatex}: - l'esperienza del pacchetto {biblatex-philosophy}}, + l'esperienza del pacchetto {biblatex-philosophy}}, Year = {2010}} @book{Bringhurst:1992, @@ -5628,6 +5649,7 @@ Janusz M.~Nowacki. Title = {The Elements of Typographic Style}, related = {Bringhurst:1992-ITA} } + @book{Bringhurst:1992-ITA, Author = {Robert Bringhurst}, title = {Gli elementi dello stile tipografico}, @@ -5635,10 +5657,11 @@ Janusz M.~Nowacki. Edition = {5}, Location = {Milano}, Publisher = {Sylvestre Bonnard}} + @book{Tschichold:1975, Author = {Jan Tschichold}, Booktitle = {Ausgewählte Aufsätze über Fragen der Gestalt des - Buches und der Typographie}, + Buches und der Typographie}, Location = {Basel}, Origdate = {2003}, Origlocation = {Milano}, @@ -5646,7 +5669,7 @@ Janusz M.~Nowacki. Origtitle = {La forma del libro}, Publisher = {Birkhäuser Verlag}, Title = {Ausgewählte Aufsätze über Fragen der Gestalt des Buches - und der Typographie}, + und der Typographie}, Year = {1975}} @online{Lehman:2010, @@ -5673,8 +5696,8 @@ Janusz M.~Nowacki. Title = {L'arte di scrivere con \LaTeX}, Url = {http://www.lorenzopantieri.net/LaTeX_files/ArteLaTeX.pdf}, Annote = {Questa guida è diventata il punto di riferimento degli utenti - italiani di \LaTeX\ ed è apprezzata per la chiarezza espositiva e la - completezza dei contenuti}} + italiani di \LaTeX\ ed è apprezzata per la chiarezza espositiva e la + completezza dei contenuti}} @article{Pantieri:2009, Author = {Lorenzo Pantieri}, @@ -5711,337 +5734,345 @@ Janusz M.~Nowacki. Year = {1966}} @manual{amsthm, - title = {The \textsf{\MakeLowercase{Amsthm}} package}, - subtitle = {Typesetting theorems (AMS style)}, - author = {{The American Mathematical Society}}, - url = {http://www.ams.org/tex/amslatex.html}, - urldate = {2020-05-24}, - date = {}, - version = {2.20.1} + title = {The \textsf{\MakeLowercase{Amsthm}} package}, + subtitle = {Typesetting theorems (AMS style)}, + author = {{The American Mathematical Society}}, + url = {http://www.ams.org/tex/amslatex.html}, + urldate = {2020-05-24}, + date = {2020-05-29}, + version = {2.20.6} } @manual{appendix, - title = {The \textsf{\MakeLowercase{Appendix}} package}, - subtitle = {Extra control of appendices}, - author = {Robertson, Will and Wilson, Peter R.}, - url = {http://www.ctan.org/pkg/appendix}, - urldate = {2020-05-24}, - date = {2020-02-08}, - version = {1.2c} + title = {The \textsf{\MakeLowercase{Appendix}} package}, + subtitle = {Extra control of appendices}, + author = {Robertson, Will and Wilson, Peter R.}, + url = {http://www.ctan.org/pkg/appendix}, + urldate = {2020-05-24}, + date = {2020-02-08}, + version = {1.2c} } @manual{bera, - title = {The \textsf{\MakeLowercase{bera}} package}, - subtitle = {Bera fonts}, - author = {Walter Schmidt}, - url = {http://www.ctan.org/pkg/bera}, - urldate = {2020-05-24}, - date = {2004-09-30}, - version = {} + title = {The \textsf{\MakeLowercase{bera}} package}, + subtitle = {Bera fonts}, + author = {Walter Schmidt}, + url = {http://www.ctan.org/pkg/bera}, + urldate = {2020-05-24}, + date = {2004-09-30}, + version = {} } @manual{biolinum, - title = {The \textsf{\MakeLowercase{biolinum-type1}} package}, - subtitle = {(pdf)\LaTeX\ support for the Biolinum family of fonts}, - author = {Bob Tennent}, - url = {https://www.ctan.org/pkg/biolinum-type1}, - urldate = {2020-05-24}, - date = {2012-10-30}, - version = {5.3.0} + title = {The \textsf{\MakeLowercase{biolinum-type1}} package}, + subtitle = {(pdf)\LaTeX\ support for the Biolinum family of fonts}, + author = {Bob Tennent}, + url = {https://www.ctan.org/pkg/biolinum-type1}, + urldate = {2020-05-24}, + date = {2012-10-30}, + version = {5.3.0} } @manual{caption, - title = {The \textsf{\MakeLowercase{Caption}} package}, - subtitle = {Customising captions in floating environments}, - author = {Sommerfeldt, Axel}, - url = {http://www.ctan.org/pkg/caption}, - urldate = {2020-05-24}, - date = {2020-05-10}, - version = {} + title = {The \textsf{\MakeLowercase{Caption}} package}, + subtitle = {Customising captions in floating environments}, + author = {Sommerfeldt, Axel}, + url = {http://www.ctan.org/pkg/caption}, + urldate = {2020-05-24}, + date = {2020-05-30}, + version = {} } @manual{cclicenses, - title = {The \textsf{\MakeLowercase{CClicenses}} package}, - subtitle = {Typeset Creative Commons licence logos}, - author = {Pignalberi, Gianluca}, - url = {http://www.ctan.org/pkg/cclicenses}, - urldate = {2020-05-24}, - date = {}, - version = {} + title = {The \textsf{\MakeLowercase{CClicenses}} package}, + subtitle = {Typeset Creative Commons licence logos}, + author = {Pignalberi, Gianluca}, + url = {http://www.ctan.org/pkg/cclicenses}, + urldate = {2020-05-24}, + date = {2005/05/20}, + version = {v0.4} } @manual{cochineal, - title = {The \textsf{\MakeLowercase{Cochineal}} package}, - subtitle = {Cochineal fonts with \LaTeX\ support}, - author = {Sharpe, Michael}, - url = {http://www.ctan.org/pkg/cochineal}, - urldate = {2020-05-24}, - date = {}, - version = {1.061} + title = {The \textsf{\MakeLowercase{Cochineal}} package}, + subtitle = {Cochineal fonts with \LaTeX\ support}, + author = {Sharpe, Michael}, + url = {http://www.ctan.org/pkg/cochineal}, + urldate = {2020-05-24}, + date = {2016-2020}, + version = {1.061} } @manual{color, - title = {The \textsf{\MakeLowercase{Color}} package}, - subtitle = {Colour control for \LaTeX\ documents}, - author = {Carlisle, David and {The \LaTeX\ Team}}, - url = {http://www.ctan.org/pkg/color}, - urldate = {2020-05-24}, - date = {2019-11-23}, - version = {1.2a} + title = {The \textsf{\MakeLowercase{Color}} package}, + subtitle = {Colour control for \LaTeX\ documents}, + author = {Carlisle, David and {The \LaTeX\ Team}}, + url = {http://www.ctan.org/pkg/color}, + urldate = {2020-05-24}, + date = {2019-11-23}, + version = {1.2a} } @manual{crop, - title = {The \textsf{\MakeLowercase{Crop}} package}, - subtitle = {Support for cropmarks}, - author = {Franz, Melchior}, - url = {http://www.ctan.org/pkg/crop}, - urldate = {2020-05-24}, - date = {}, - version = {1.5} + title = {The \textsf{\MakeLowercase{Crop}} package}, + subtitle = {Support for cropmarks}, + author = {Franz, Melchior}, + url = {http://www.ctan.org/pkg/crop}, + urldate = {2020-05-24}, + date = {2020-06-05}, + version = {1.10.2} } @manual{emptypage, - title = {The \textsf{\MakeLowercase{Emptypage}} package}, - subtitle = {Make empty pages really empty}, - author = {Wette, Karl}, - url = {http://www.ctan.org/pkg/emptypage}, - urldate = {2020-05-24}, - date = {}, - version = {1.2} + title = {The \textsf{\MakeLowercase{Emptypage}} package}, + subtitle = {Make empty pages really empty}, + author = {Wette, Karl}, + url = {http://www.ctan.org/pkg/emptypage}, + urldate = {2020-05-24}, + date = {2009-2010}, + version = {1.2} } @manual{enumitem, - title = {The \textsf{\MakeLowercase{Enumitem}} package}, - subtitle = {Control layout of itemize, enumerate, description}, - author = {Bezos López, Javier}, - url = {http://www.texnia.com/enumitem.html}, - urldate = {2020-05-24}, - date = {2019-06-20}, - version = {3.9} + title = {The \textsf{\MakeLowercase{Enumitem}} package}, + subtitle = {Control layout of itemize, enumerate, description}, + author = {Bezos López, Javier}, + url = {http://www.texnia.com/enumitem.html}, + urldate = {2020-05-24}, + date = {2019-06-20}, + version = {3.9} } @manual{fancyhdr, - title = {The \textsf{\MakeLowercase{Fancyhdr}} package}, - subtitle = {Extensive control of page headers and footers in \hologo{LaTeX2e}}, - author = {van Oostrum, Piet}, - url = {http://www.ctan.org/pkg/fancyhdr}, - urldate = {2020-05-24}, - date = {2019-01-31}, - version = {3.10} + title = {The \textsf{\MakeLowercase{Fancyhdr}} package}, + subtitle = {Extensive control of page headers and footers in \hologo{LaTeX2e}}, + author = {van Oostrum, Piet}, + url = {http://www.ctan.org/pkg/fancyhdr}, + urldate = {2020-05-24}, + date = {2019-01-31}, + version = {3.10} } @manual{fixltxhyph, - title = {The \textsf{\MakeLowercase{Fixltxhyph}} package}, - subtitle = {Allow hyphenation of partially-emphasised substrings}, - author = {Beccari, Claudio}, - url = {http://www.ctan.org/pkg/fixltxhyph}, - urldate = {2020-05-24}, - date = {}, - version = {0.4} -} - -@manual{fontenc, - title = {The \textsf{\MakeLowercase{Fontenc}} package}, - subtitle = {Standard package for selecting font encodings}, - author = {{The \LaTeX\ Team}}, - url = {http://www.ctan.org/pkg/fontenc}, - urldate = {2020-05-24}, - date = {}, - version = {} + title = {The \textsf{\MakeLowercase{Fixltxhyph}} package}, + subtitle = {Allow hyphenation of partially-emphasised substrings}, + author = {Beccari, Claudio}, + url = {http://www.ctan.org/pkg/fixltxhyph}, + urldate = {2020-05-24}, + date = {2011}, + version = {0.4} } @manual{fontsize, - title = {The \textsf{\MakeLowercase{Fontsize}} package}, - subtitle = {A small package to set arbitrary sizes for the main font of the document}, - author = {Valbusa, Ivan}, - url = {http://www.ctan.org/pkg/fontsize}, - urldate = {2020-05-24}, - date = {}, - version = {0.1} + title = {The \textsf{\MakeLowercase{Fontsize}} package}, + subtitle = {A small package to set arbitrary sizes for the main font of the document}, + author = {Valbusa, Ivan}, + url = {http://www.ctan.org/pkg/fontsize}, + urldate = {2020-05-24}, + date = {2020-05-24}, + version = {0.1} } @manual{geometry, - title = {The \textsf{\MakeLowercase{Geometry}} package}, - subtitle = {Flexible and complete interface to document dimensions}, - author = {Carlisle, David and Umeki, Hideo}, - url = {http://www.ctan.org/pkg/geometry}, - urldate = {2020-05-24}, - date = {2020-01-02}, - version = {5.9} + title = {The \textsf{\MakeLowercase{Geometry}} package}, + subtitle = {Flexible and complete interface to document dimensions}, + author = {Carlisle, David and Umeki, Hideo}, + url = {http://www.ctan.org/pkg/geometry}, + urldate = {2020-05-24}, + date = {2020-01-02}, + version = {5.9} } @manual{iftex, - title = {The \textsf{\MakeLowercase{Iftex}} package}, - subtitle = {Am I running under pdf\TeX, Xe\TeX\ or Lua\TeX?}, - author = {Khalighi, Vafa and {The \LaTeX\ Team}}, - url = {http://www.ctan.org/pkg/iftex}, - urldate = {2020-05-24}, - date = {}, - version = {1.0d} + title = {The \textsf{\MakeLowercase{Iftex}} package}, + subtitle = {Am I running under pdf\TeX, Xe\TeX\ or Lua\TeX?}, + author = {Khalighi, Vafa and {The \LaTeX\ Team}}, + url = {http://www.ctan.org/pkg/iftex}, + urldate = {2020-05-24}, + date = {2020-03-06}, + version = {1.0d} } @manual{inconsolata, - title = {The \textsf{\MakeLowercase{Inconsolata}} package}, - subtitle = {A monospaced font, with support files for use with \TeX}, - author = {Levien, Raph and Berry, Karl and Sharpe, Michael}, - url = {http://levien.com/type/myfonts/inconsolata.html}, - urldate = {2020-05-24}, - date = {2019-06-20}, - version = {1.121} + title = {The \textsf{\MakeLowercase{Inconsolata}} package}, + subtitle = {A monospaced font, with support files for use with \TeX}, + author = {Levien, Raph and Berry, Karl and Sharpe, Michael}, + url = {http://levien.com/type/myfonts/inconsolata.html}, + urldate = {2020-05-24}, + date = {2019-06-20}, + version = {1.121} } @manual{libertine, - title = {The \textsf{\MakeLowercase{Libertine}} package}, - subtitle = {Use of Linux Libertine and Biolinum fonts with \LaTeX}, - author = {Tennent, Bob}, - url = {http://www.ctan.org/pkg/libertine}, - urldate = {2020-05-24}, - date = {2020-03-26}, - version = {5.3.0} + title = {The \textsf{\MakeLowercase{Libertine}} package}, + subtitle = {Use of Linux Libertine and Biolinum fonts with \LaTeX}, + author = {Tennent, Bob}, + url = {http://www.ctan.org/pkg/libertine}, + urldate = {2020-05-24}, + date = {2020-03-26}, + version = {5.3.0} } @manual{libertinust1math, - title = {The \textsf{\MakeLowercase{LibertinusT1Math}} package}, - subtitle = {A Type 1 font and \LaTeX\ support for Libertinus Math}, - author = {Sharpe, Michael}, - url = {http://www.ctan.org/pkg/libertinust1math}, - urldate = {2020-05-24}, - date = {2018-10-07}, - version = {1.1.9} + title = {The \textsf{\MakeLowercase{LibertinusT1Math}} package}, + subtitle = {A Type 1 font and \LaTeX\ support for Libertinus Math}, + author = {Sharpe, Michael}, + url = {http://www.ctan.org/pkg/libertinust1math}, + urldate = {2020-05-24}, + date = {2018-10-07}, + version = {1.1.9} } @manual{lm, - title = {The \textsf{\MakeLowercase{lm}} package}, - subtitle = {Latin modern fonts in outline formats}, - author = {B. Jackowski and J.M. Nowacki}, - url = {http://www.ctan.org/pkg/lmodern}, - urldate = {2020-05-24}, - date = {}, - version = {2.004} + title = {The \textsf{\MakeLowercase{lm}} package}, + subtitle = {Latin modern fonts in outline formats}, + author = {B. Jackowski and J.M. Nowacki}, + url = {http://www.ctan.org/pkg/lmodern}, + urldate = {2020-05-24}, + date = {2003-2009}, + version = {2.004} } @manual{luatex85, - title = {The \textsf{\MakeLowercase{Luatex85}} package}, - subtitle = {pdfTeX aliases for Lua\TeX}, - author = {{The \LaTeX\ Team} and Carlisle, David and Wright, Joseph}, - url = {http://www.ctan.org/pkg/luatex85}, - urldate = {2020-05-24}, - date = {2016-06-15}, - version = {1.4} + title = {The \textsf{\MakeLowercase{Luatex85}} package}, + subtitle = {pdfTeX aliases for Lua\TeX}, + author = {{The \LaTeX\ Team} and Carlisle, David and Wright, Joseph}, + url = {http://www.ctan.org/pkg/luatex85}, + urldate = {2020-05-24}, + date = {2016-06-15}, + version = {1.4} } @manual{mathalpha, - title = {The \textsf{\MakeLowercase{Mathalpha}} package}, - subtitle = {General package for loading maths alphabets in \LaTeX}, - author = {Sharpe, Michael}, - url = {http://www.ctan.org/pkg/mathalpha}, - urldate = {2020-05-24}, - date = {2019-10-05}, - version = {1.13} + title = {The \textsf{\MakeLowercase{Mathalpha}} package}, + subtitle = {General package for loading maths alphabets in \LaTeX}, + author = {Sharpe, Michael}, + url = {http://www.ctan.org/pkg/mathalpha}, + urldate = {2020-05-24}, + date = {2019-10-05}, + version = {1.13} } @manual{mathpazo, - title = {The \textsf{\MakeLowercase{Mathpazo}} package}, - subtitle = {Fonts to typeset mathematics to match Palatino}, - author = {Puga, Diego}, - url = {http://www.ctan.org/pkg/mathpazo}, - urldate = {2020-05-24}, - date = {}, - version = {1.003} + title = {The \textsf{\MakeLowercase{Mathpazo}} package}, + subtitle = {Fonts to typeset mathematics to match Palatino}, + author = {Puga, Diego}, + url = {http://www.ctan.org/pkg/mathpazo}, + urldate = {2020-05-24}, + date = {2002}, + version = {1.003} } @manual{microtype, - title = {The \textsf{\MakeLowercase{Microtype}} package}, - subtitle = {Subliminal refinements towards typographical perfection}, - author = {Schlicht, Robert}, - url = {http://www.ctan.org/pkg/microtype}, - urldate = {2020-05-24}, - date = {2019-11-18}, - version = {2.7d} + title = {The \textsf{\MakeLowercase{Microtype}} package}, + subtitle = {Subliminal refinements towards typographical perfection}, + author = {Schlicht, Robert}, + url = {http://www.ctan.org/pkg/microtype}, + urldate = {2020-05-24}, + date = {2019-11-18}, + version = {2.7d} } @manual{multicol, - title = {The \textsf{\MakeLowercase{Multicol}} package}, - subtitle = {Intermix single and multiple columns}, - author = {Mittelbach, Frank and {The \LaTeX\ Team}}, - url = {http://www.ctan.org/pkg/multicol}, - urldate = {2020-05-24}, - date = {2019-12-09}, - version = {1.8y} + title = {The \textsf{\MakeLowercase{Multicol}} package}, + subtitle = {Intermix single and multiple columns}, + author = {Mittelbach, Frank and {The \LaTeX\ Team}}, + url = {http://www.ctan.org/pkg/multicol}, + urldate = {2020-05-24}, + date = {2019-12-09}, + version = {1.8y} } @manual{newpx, - title = {The \textsf{\MakeLowercase{newpx}} package}, - subtitle = {Alternative uses of the PX fonts, with improved metrics}, - author = {Michael Sharpe}, - url = {http://www.ctan.org/pkg/newpxmath}, - urldate = {2020-05-24}, - date = {2020-05-17}, - version = {1.411} + title = {The \textsf{\MakeLowercase{newpx}} package}, + subtitle = {Alternative uses of the PX fonts, with improved metrics}, + author = {Michael Sharpe}, + url = {http://www.ctan.org/pkg/newpxmath}, + urldate = {2020-05-24}, + date = {2020-05-17}, + version = {1.411} } @manual{newtx, - title = {The \textsf{\MakeLowercase{newtx}} package}, - subtitle = {Alternative uses of the TX fonts, with improved metrics}, - author = {Michael Sharpe}, - url = {http://www.ctan.org/pkg/newtxmath}, - urldate = {2020-05-24}, - date = {2020-05-17}, - version = {1.627} + title = {The \textsf{\MakeLowercase{newtx}} package}, + subtitle = {Alternative uses of the TX fonts, with improved metrics}, + author = {Michael Sharpe}, + url = {http://www.ctan.org/pkg/newtxmath}, + urldate = {2020-05-24}, + date = {2020-05-17}, + version = {1.627} } @manual{substitutefont, - title = {The \textsf{\MakeLowercase{Substitutefont}} package}, - subtitle = {Easy font substitution}, - author = {Milde, Günter}, - url = {http://www.ctan.org/pkg/substitutefont}, - urldate = {2020-05-24}, - date = {2013-11-04}, - version = {0.1.4} + title = {The \textsf{\MakeLowercase{Substitutefont}} package}, + subtitle = {Easy font substitution}, + author = {Milde, Günter}, + url = {http://www.ctan.org/pkg/substitutefont}, + urldate = {2020-05-24}, + date = {2013-11-04}, + version = {0.1.4} } @manual{textcomp, - title = {The \textsf{\MakeLowercase{Textcomp}} package}, - subtitle = {\LaTeX\ support for the Text Companion fonts}, - author = {Rahtz, Sebastian}, - url = {http://www.ctan.org/pkg/textcomp}, - urldate = {2020-05-24}, - date = {}, - version = {} + title = {The \textsf{\MakeLowercase{Textcomp}} package}, + subtitle = {\LaTeX\ support for the Text Companion fonts}, + author = {Rahtz, Sebastian}, + url = {http://www.ctan.org/pkg/textcomp}, + urldate = {2020-05-24}, + date = {1995}, + version = {} } @manual{titlesec, - title = {The \textsf{\MakeLowercase{Titlesec}} package}, - subtitle = {Select alternative section titles}, - author = {Bezos López, Javier}, - url = {http://www.ctan.org/pkg/titlesec}, - urldate = {2020-05-24}, - date = {2019-10-16}, - version = {2.13} + title = {The \textsf{\MakeLowercase{Titlesec}} package}, + subtitle = {Select alternative section titles}, + author = {Bezos López, Javier}, + url = {http://www.ctan.org/pkg/titlesec}, + urldate = {2020-05-24}, + date = {2019-10-16}, + version = {2.13} } @manual{titletoc, - title = {The \textsf{\MakeLowercase{Titletoc}} package}, - subtitle = {Alternative headings for toc/lof/lot}, - author = {Bezos López, Javier}, - url = {http://www.ctan.org/pkg/titletoc}, - urldate = {2020-05-24}, - date = {2019-10-16}, - version = {2.13} + title = {The \textsf{\MakeLowercase{Titletoc}} package}, + subtitle = {Alternative headings for toc/lof/lot}, + author = {Bezos López, Javier}, + url = {http://www.ctan.org/pkg/titletoc}, + urldate = {2020-05-24}, + date = {2019-10-16}, + version = {2.13} } @manual{xkeyval, - title = {The \textsf{\MakeLowercase{Xkeyval}} package}, - subtitle = {Extension of the keyval package}, - author = {Adriaens, Hendri}, - url = {http://www.ctan.org/pkg/xkeyval}, - urldate = {2020-05-24}, - date = {}, - version = {2.7a} + title = {The \textsf{\MakeLowercase{Xkeyval}} package}, + subtitle = {Extension of the keyval package}, + author = {Adriaens, Hendri}, + url = {http://www.ctan.org/pkg/xkeyval}, + urldate = {2020-05-24}, + date = {2014-03-12}, + version = {2.7a} } +@manual{bookcover, + title = {The \textsf{bookcover} class}, + subtitle = {Class for book covers and dust jackets}, + author = {Tibor Tómács}, + url = {http://www.ctan.org/pkg/bookcover}, + urldate = {2020-06-29}, + date = {2018-01-21}, + version = {v2.3} +} + +@manual{afterpage, + title = {The \textsf{afterpage} package}, + subtitle = { Execute command after the next page break}, + author = {David Carlisle}, + url = {http://www.ctan.org/pkg/bookcover}, + urldate = {2020-06-29}, + date = {2014-10-28}, + version = {v1.08} +} % % \fi -% % \Finale diff --git a/macros/latex/contrib/suftesi/suftesi.pdf b/macros/latex/contrib/suftesi/suftesi.pdf index 6c268d5e39..12699ac52a 100644 Binary files a/macros/latex/contrib/suftesi/suftesi.pdf and b/macros/latex/contrib/suftesi/suftesi.pdf differ -- cgit v1.2.3