summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/suftesi
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-11-08 22:41:33 +0000
committerKarl Berry <karl@freefriends.org>2011-11-08 22:41:33 +0000
commite4d72a0d3a7f195c79c1df12796ae41ee60561a9 (patch)
treec41f1ec72c9b4ba6ffc51dbdb61dba8d383be701 /Master/texmf-dist/tex/latex/suftesi
parentc26a9027bee96ab3ce1ece40d17f3f372e80eec6 (diff)
suftesi (8nov11)
git-svn-id: svn://tug.org/texlive/trunk@24552 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/suftesi')
-rw-r--r--Master/texmf-dist/tex/latex/suftesi/suftesi.cls284
1 files changed, 157 insertions, 127 deletions
diff --git a/Master/texmf-dist/tex/latex/suftesi/suftesi.cls b/Master/texmf-dist/tex/latex/suftesi/suftesi.cls
index 0cadd0d87aa..0c971346cfb 100644
--- a/Master/texmf-dist/tex/latex/suftesi/suftesi.cls
+++ b/Master/texmf-dist/tex/latex/suftesi/suftesi.cls
@@ -14,7 +14,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesClass{suftesi}
- [2011/10/24 v. 0.6a
+ [2011/11/07 v. 0.6b
A class for typesetting theses, books and articles]
%****************************************
% declare options
@@ -61,7 +61,11 @@
\ExecuteOptions{artemisia}
\ProcessOptions
\relax
+\ifsuftesi@article
+\LoadClass[a4paper,notitlepage]{book}
+\else
\LoadClass[a4paper]{book}
+\fi
%****************************************
% PACKAGES
%****************************************
@@ -69,11 +73,14 @@
\definecolor{sufred}{rgb}{0.5,0,0}
\definecolor{sufgray}{rgb}{0.5,0.5,0.5}
\RequirePackage{ifxetex,ifluatex,metalogo}
-\RequirePackage[letterspace=110]{microtype}
+\ifxetex\relax
+ \else
+ \RequirePackage[letterspace=110]{microtype}
+ \microtypesetup{expansion=false}%
+ \fi
\RequirePackage{textcase}
\RequirePackage{multicol}
\RequirePackage{emptypage}
-\RequirePackage[bottom]{footmisc}
\RequirePackage{mparhack}
\RequirePackage{caption}
\captionsetup{labelsep=period,font=small}
@@ -231,15 +238,16 @@
% SECTION TITLES
%****************************************
\RequirePackage{titlesec}
-\microtypesetup{expansion=false}%
- \DeclareRobustCommand{\sufsc}[1]%
- {\textls{\MakeTextLowercase{\textsc{#1}}}}%
-\DeclareRobustCommand{\sufsmallcaps}%
- {\ifxetex\scshape\addfontfeature{LetterSpace=6}\else\lsstyle\scshape\fi\expandafter
- \MakeLowercase}%
+\DeclareRobustCommand{\suftesi@smallcaps}[1]{%
+ \ifxetex
+ \addfontfeature{LetterSpace=6}\MakeTextLowercase{\textsc{#1}}
+ \else
+ \textls{\MakeTextLowercase{\textsc{#1}}}
+ \fi
+ }%
\DeclareRobustCommand{\sufchaptersize}{%
\ifsuftesi@supercompact\large\else\ifsuftesi@compact\Large\else\LARGE\fi\fi}
-\ifsuftesi@article% article
+\ifsuftesi@article% article mode
\renewcommand \thesection {\@arabic\c@section}
\renewcommand\thesubsection {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}
@@ -278,26 +286,26 @@
\nobreak
\vskip 3ex
\@afterheading}
-\else% book
+\else% book mode
\titleformat{\part}[display]
{\LARGE\filcenter}
{\sufchaptersize\ifsuftesi@sctitles\scshape\else\fi\partname~\Roman{part}}
{3ex}
- {\sufchaptersize\ifsuftesi@sctitles\sufsmallcaps\else\fi}
+ {\sufchaptersize\ifsuftesi@sctitles\expandafter\suftesi@smallcaps\else\fi}
\fi
-% COMMON SETTINGS
+% common settings
\ifsuftesi@centertitle
\titleformat{\chapter}[display]
{\filcenter}
{\sufchaptersize\thechapter}
{3ex}
- {\sufchaptersize\ifsuftesi@sctitles\sufsmallcaps\else\fi}
+ {\sufchaptersize\ifsuftesi@sctitles\expandafter\suftesi@smallcaps\else\fi}
\else
\titleformat{\chapter}[hang]
{\filright}
{\sufchaptersize\thechapter.}
{3ex}
- {\sufchaptersize\ifsuftesi@sctitles\sufsmallcaps\else\fi}
+ {\sufchaptersize\ifsuftesi@sctitles\expandafter\suftesi@smallcaps\else\fi}
\fi
\ifsuftesi@compact
\titlespacing*{\chapter}{0em}{0ex}{18ex}
@@ -308,7 +316,7 @@
\titlespacing*{\chapter}{0em}{6ex}{18ex}
\fi
\fi
-% ELEMENTS
+% Elements
\newcommand{\chapnumfont}[1]{%
\ifxetex
\def\@chapnumfont{#1}
@@ -319,7 +327,7 @@
\xechapnumfont{Palatino}
\chapnumfont{pplj}
-\DeclareRobustCommand{\sectitle}[1]{\textls[160]{\MakeUppercase{#1}}}%
+\DeclareRobustCommand{\sectitle}[1]{\textls{\MakeUppercase{#1}}}%
\ifsuftesi@sufelements
\titleformat{\chapter}[block]
@@ -327,7 +335,7 @@
{\begin{picture}(0,0)
\setlength{\unitlength}{1pt}
\ifxetex
- \fontspec{\@chapnumfont}% Palatino
+ \fontspec{\@chapnumfont}%
\else
\@chapnumfont
\fi
@@ -351,7 +359,7 @@
{\raggedright}
{\textnormal\thesection}
{1em}
- {\small\sufsmallcaps}
+ {\small\suftesi@smallcaps}
\titlespacing*{\section}{0em}{10pt}{10pt}[0em]
\titleformat{\subsection}[block]
{\filright\normalsize\itshape}
@@ -370,7 +378,7 @@
{\filright}
{\thesection}
{.5em}
- {\unskip\ifsuftesi@sctitles\sufsmallcaps\else\itshape\fi}
+ {\unskip\ifsuftesi@sctitles\expandafter\suftesi@smallcaps\else\itshape\fi}
\titlespacing*{\section}{0ex}{\baselineskip}{\baselineskip}[0ex]
\fi
\titleformat{\subsection}[hang]
@@ -403,17 +411,16 @@
% TOC, LOF, LOT
%****************************************
\RequirePackage{titletoc}
-\ifsuftesi@article % ARTICLE MODE
-\renewcommand\tableofcontents{%
+\ifsuftesi@article
+\renewcommand\tableofcontents{% article mode
\thispagestyle{empty}
\section*{\contentsname
- \@mkboth{%
- \contentsname}{\contentsname}}%
+ \@mkboth{\contentsname}{\contentsname}}%
\@starttoc{toc}%
\vspace*{2ex}
}
\else
-\renewcommand\tableofcontents{%
+\renewcommand\tableofcontents{% book mode
\if@twocolumn
\@restonecoltrue\onecolumn
\else
@@ -457,14 +464,12 @@
{\thecontentslabel\hspace*{1em}}
{}
{\titlerule*{}\contentspage}
-% list of figures
\titlecontents{figure}
[1.5em]
{}
{\thecontentslabel\hspace*{1em}}
{}
{\titlerule*{}\contentspage}
-% list of tables
\titlecontents{table}
[1.5em]
{}
@@ -520,7 +525,7 @@
\titlespacing*{\chapter}{0em}{10pt}{10pt}[0em]
\titlecontents{chapter}[1em]
{\filright\hskip.5em}
- {\sufsmallcaps\appendixname~\thecontentslabel:\hskip1em}
+ {\suftesi@smallcaps{\appendixname~\thecontentslabel:}\hskip1em}
{}
{\contentspage\vspace{5pt}}}
\else
@@ -537,25 +542,49 @@
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footnoterule}{}
-\ifsuftesi@elements
- \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
-\else
- \renewcommand{\chaptermark}[1]{\markboth{\chaptertitlename~\thechapter}{#1}}
+\ifsuftesi@elements % Elements
+ \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
+ \renewcommand{\sectionmark}[1]{\markright{#1}}
+\else % book
+ \renewcommand{\chaptermark}[1]{\markboth{\chaptertitlename\ \thechapter}{#1}}
+ \renewcommand{\sectionmark}[1]{}
\fi
-\ifsuftesi@article
- \renewcommand{\sectionmark}[1]{\markright{\thesection.~#1}}
+\ifsuftesi@article % article
+ \renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\else\fi
- \ifsuftesi@elements
- \renewcommand{\sectionmark}[1]{\markright{#1}}
- \else\fi
-
-\def\sufrightmark{\ifsuftesi@sctitles\sufsc{\ifsuftesi@authortitle\@title\else\rightmark\fi}% article mode
- \else\ifsuftesi@authortitle\nouppercase\@title\else\nouppercase\rightmark\fi\fi}
-\def\sufleftmark{\ifsuftesi@sctitles\sufsc{\ifsuftesi@authortitle\@author\else\ivanleftmark\fi}% book mode
- \else\ifsuftesi@authortitle\nouppercase\@author\else\nouppercase\ivanleftmark\fi\fi}
-\def\sufthepage{\ifsuftesi@sctitles\sufsc{\thepage}\else\thepage\fi}
-\def\ivanleftmark{\if@mainmatter\leftmark\else\rightmark\fi}
-
+\ifsuftesi@sctitles
+ \ifsuftesi@authortitle
+ \def\suf@rightmark{\suftesi@smallcaps{\@title}}
+ \else
+ \def\suf@rightmark{\suftesi@smallcaps{\rightmark}}
+ \fi
+\else
+ \ifsuftesi@authortitle
+ \def\suf@rightmark{\nouppercase{\@title}}
+ \else
+ \def\suf@rightmark{\nouppercase{\rightmark}}
+ \fi
+\fi
+\ifsuftesi@sctitles
+ \ifsuftesi@authortitle
+ \def\suf@leftmark{\suftesi@smallcaps{\@author}}
+ \else
+ \def\suf@leftmark{\suftesi@smallcaps{\suf@leftrightmark}}
+ \fi
+\else
+ \ifsuftesi@authortitle
+ \def\suf@leftmark{\nouppercase{\@author}}
+ \else
+ \def\suf@leftmark{\nouppercase{\suf@leftrightmark}}
+ \fi
+\fi
+\ifsuftesi@sctitles
+ \def\sufthepage{\suftesi@smallcaps{\thepage}}
+\else
+ \def\sufthepage{\thepage}
+\fi
+\def\suf@leftrightmark{%
+ \if@mainmatter\leftmark\else\rightmark\fi}
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[C]{}
@@ -563,28 +592,44 @@
\renewcommand{\footrulewidth}{0pt}}
\fancypagestyle{sufplain}{%
\fancyhf{}%
- \fancyfoot[RE,LO]{\ifsuftesi@bozza \footnotesize Versione del \today\else\fi}
+ \fancyfoot[RE,LO]{\ifsuftesi@bozza \footnotesize Version of \today\else\fi}
\fancyfoot[C]{\footnotesize\sufthepage}}
\fancypagestyle{centerheadings}{%
\fancyhf{}%
- \fancyhead[CO]{\footnotesize%
- \xheadbreakfalse\sufrightmark}
- \fancyhead[CE]{\footnotesize%
- \xheadbreakfalse\ifsuftesi@article\ifsuftesi@authortitle\sufleftmark\else\sufrightmark\fi\else\sufleftmark\fi}
- \fancyfoot[RE,LO]{\ifsuftesi@bozza \footnotesize Versione del \today\else\fi}
+ \fancyfoot[RE,LO]{\ifsuftesi@bozza \footnotesize Version of \today\else\fi}
+ \fancyhead[CO]{\footnotesize\xheadbreakfalse\suf@rightmark}
+ \fancyhead[CE]{\footnotesize\xheadbreakfalse%
+ \ifsuftesi@article
+ \ifsuftesi@authortitle
+ \suf@leftmark
+ \else
+ \suf@rightmark
+ \fi
+ \else
+ \suf@leftmark
+ \fi}
\fancyfoot[C]{\footnotesize\sufthepage}%
}
\fancypagestyle{sufdefault}{%
\fancyhf{}%
- \fancyfoot[RE,LO]{\ifsuftesi@bozza \footnotesize Versione del \today\else\fi}
+ \fancyfoot[RE,LO]{\ifsuftesi@bozza \footnotesize Version of \today\else\fi}
\fancyhead[LE,RO]{\footnotesize\sufthepage}
- \fancyhead[LO]{\footnotesize\xheadbreakfalse\sufrightmark}
- \fancyhead[RE]{\footnotesize\ifsuftesi@article\ifsuftesi@authortitle\sufleftmark\else\sufrightmark\fi\else\sufleftmark\fi}%
- }
-\fancypagestyle{elements}{% elements
+ \fancyhead[LO]{\footnotesize\xheadbreakfalse\suf@rightmark}
+ \fancyhead[RE]{\footnotesize\xheadbreakfalse%
+ \ifsuftesi@article
+ \ifsuftesi@authortitle
+ \suf@leftmark
+ \else
+ \suf@rightmark
+ \fi
+ \else
+ \suf@leftmark
+ \fi}
+ }
+\fancypagestyle{elements}{%
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
- \fancyhead[RO]{%pari
+ \fancyhead[RO]{%
\begin{picture}(0,0)
\setlength{\unitlength}{1pt}
\put(0,-104){%
@@ -600,7 +645,6 @@
\parbox[t]{\marginparwidth}{\itshape\raggedleft\rightmark}}%
\end{picture}}
}
-
%\renewcommand{\author}[1]{\gdef\@sufauthor{#1}}
%\def\@sufauthor{--missing author--%
% \ClassWarningNoLine{suftesi}
@@ -612,19 +656,50 @@
% \ClassWarningNoLine{suftesi}
% {Missing \protect\title}%
% \gdef\univrart@author{--missing title--}}
-
\pagestyle{sufdefault}
\ifsuftesi@centerheadings\pagestyle{centerheadings}\else\fi
\ifsuftesi@sufplain\pagestyle{sufplain}\else\fi
\ifsuftesi@elements\pagestyle{elements}\else\fi
+
%****************************************
-% TITLE PAGE FOR "ARTICLE"
+% TITLE PAGE
%****************************************
-\newcommand{\standardtitle}{}
\let\standardtitle\maketitle
-\ifsuftesi@article
- \@titlepagefalse
- \renewcommand\maketitle{\par
+\if@titlepage% titlepage
+ \renewcommand\maketitle{\begin{titlepage}%
+ \let\footnotesize\small
+ \let\footnoterule\relax
+ \let \footnote \thanks
+ \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
+ \null\vfil
+ \vskip 60\p@
+ \begin{center}%
+ {\sufchaptersize\color{sufred}\sffamily\ifsuftesi@sctitles\suftesi@smallcaps{\@title}\else\@title\fi \par}%
+ \vskip 3em%
+ {\small\lineskip .75em%
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip 1.5em%
+ {\small\@date\par}%
+ \end{center}\par
+ \@thanks
+ \vfil\null
+ \end{titlepage}%
+ \setcounter{footnote}{0}%
+ \global\let\thanks\relax
+ \global\let\maketitle\relax
+ \global\let\@thanks\@empty
+% \global\let\@author\@empty
+ \global\let\@date\@empty
+% \global\let\@title\@empty
+% \global\let\title\relax
+% \global\let\author\relax
+ \global\let\date\relax
+ \global\let\and\relax
+}
+\else% notitlepage
+\renewcommand\maketitle{\par
\begingroup
\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
@@ -655,62 +730,29 @@
% \global\let\title\relax
% \global\let\author\relax
\global\let\date\relax
- \global\let\and\relax
- }
- \def\@maketitle{%
+ \global\let\and\relax}
+ \def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
- {\sufchaptersize\color{sufred}\sffamily\ifsuftesi@sctitles\sufsmallcaps\@title\else\@title\fi\par}%
+ {\sufchaptersize\color{sufred}\sffamily\ifsuftesi@sctitles\suftesi@smallcaps{\@title}\else\@title\fi\par}%
\vskip 1.5em%
- {\lineskip .5em%
+ {\small\lineskip .5em%
\begin{tabular}[t]{c}%
- {\small\@author\par}
+ \@author\par
\end{tabular}\par}%
\vskip 1em%
{\small\@date\par}%
\end{center}%
\par
\vskip 1.5em}
- \else
-\renewcommand\maketitle{\begin{titlepage}%
- \let\footnotesize\small
- \let\footnoterule\relax
- \let \footnote \thanks
- \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
- \null\vfil
- \vskip 60\p@
- \begin{center}%
- {\sufchaptersize\color{sufred}\sffamily\ifsuftesi@sctitles\sufsmallcaps\@title\else\@title\fi \par}%
- \vskip 3em%
- {\lineskip .75em%
- \begin{tabular}[t]{c}%
- {\small\@author\par}
- \end{tabular}\par}%
- \vskip 1.5em%
- {\small\@date\par}% % Set date in \large size.
- \end{center}\par
- \@thanks
- \vfil\null
- \end{titlepage}%
- \setcounter{footnote}{0}%
- \global\let\thanks\relax
- \global\let\maketitle\relax
- \global\let\@thanks\@empty
-% \global\let\@author\@empty
- \global\let\@date\@empty
-% \global\let\@title\@empty
- % \global\let\title\relax
-% \global\let\author\relax
- \global\let\date\relax
- \global\let\and\relax
-}
\fi
%****************************************
% NOTES
%****************************************
+\RequirePackage{ltxcmds}
\renewcommand\@makefntext{\hskip-2.5em\makebox[2em][r]{\@thefnmark}\hskip.5em}
% thanks to Lorenzo Pantieri and Enrico Gregorio
\def\graffito@setup{%
@@ -719,16 +761,17 @@
\tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%
\doublehyphendemerits=100000%
\finalhyphendemerits=\doublehyphendemerits}
- \DeclareRobustCommand{\marginnote}{}
- \let\marginnote\marginpar
- \DeclareRobustCommand{\graffito}[1]{\marginnote%
+\newcommand{\graffito}[1]{\marginnote%
[\graffito@setup\raggedleft\hspace{0pt}{#1}]%
{\graffito@setup\raggedright\hspace{0pt}{#1}}}
-\let\marginpar\graffito
+ \let\marginnote\marginpar
+ \def\marginpar{% thanks to Antonio Macrì
+ \@ifnextchar[\marginnote\graffito}
\ifsuftesi@nomarginpar
- \renewcommand{\marginpar}[1]{}
- \renewcommand{\graffito}[1]{}
-\else\fi
+ \let\graffito\@gobble
+ \renewcommand\marginpar[2][]{}
+ \else
+ \fi
%***************************************
% COLOPHON
%****************************************
@@ -759,7 +802,6 @@
\fi usando la classe \textsf{suftesi} di
Ivan Valbusa\index{Valbusa, Ivan}. #3\par}
\cleardoublepage}
-
\newcommand{\bookcolophon}[2]{%
\thispagestyle{empty}
\null
@@ -769,14 +811,11 @@
\section*{Colophon}
{\small #2\par}
\cleardoublepage}
-
\newcommand{\artcolophon}[1]{%
\thispagestyle{empty}
\null
\vfill
{\small #1\par}}
-
-
%****************************************
% INDEX
%****************************************
@@ -805,14 +844,10 @@
\chapter{\bibname}%
\fi
\normalfont \list{}{%
- %\setlength{\labelsep}{0.5em}
\setlength{\itemindent}{-\parindent}
\setlength{\leftmargin}{\parindent}
\setlength{\labelwidth}{\leftmargin}
- %\addtolength{\labelwidth}{-\labelsep}
- %\setlength{\listparindent}{\parindent}
\setlength{\parsep}{\parskip}
- %\setlength{\itemsep}{0em}
\let\makelabel}}
{\endlist}
\newcommand{\losname}{Sigle}
@@ -824,16 +859,14 @@
\setlength{\itemindent}{0pt}
\setlength{\leftmargin}{6em}
\setlength{\labelwidth}{\leftmargin}
- %\addtolength{\labelwidth}{-\labelsep}
\setlength{\listparindent}{\parindent}
\setlength{\parsep}{\parskip}
- %\setlength{\itemsep}{0em}
\let\makelabel\itlabel}}
{\endlist}
%*************************************************************
% ENVIRONMENTS
%*************************************************************
-% QUOTATIONS
+% quotations
\renewcommand\labelitemii{\normalfont \textendash}
\renewenvironment{quotation}
{\list{}{\listparindent\parindent%
@@ -858,8 +891,7 @@
\advance\leftmargin 1.5em}%
\item\relax}
{\endlist}
-% ABSTRACT
-\ifsuftesi@article
+% abstract
\if@titlepage
\newenvironment{abstract}{%
\titlepage
@@ -883,8 +915,6 @@
\fi}
{\if@twocolumn\else\endquotation\fi}
\fi
- \else
-\fi
%*************************************************************
% COMMANDS
%*************************************************************
@@ -896,11 +926,11 @@
\newcommand{\chapterintroname}[1]{\def\suffchapterintroname{#1}}
\chapterintroname{Introduzione}
\newcommand{\hemph}[1]{\penalty10000\hskip0pt\emph{#1}}
-% spezza nel toc ma non nel testo e testatina
+% breaks in toc but not in headings and text
\newif\ifheadbreak\headbreakfalse
\DeclareRobustCommand{\headbreak}
{\ifheadbreak\\\else\fi}
-% spezza nel testo e testatina ma non nel toc
+% breaks in text and headings but not in toc
\newif\ifxheadbreak\xheadbreaktrue
\DeclareRobustCommand{\xheadbreak}
{\ifxheadbreak\\\else\fi}