summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/suftesi
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-23 23:36:01 +0000
committerKarl Berry <karl@freefriends.org>2012-04-23 23:36:01 +0000
commit68c4c15d01c4839dc0b91269e02d3931dc598d5a (patch)
tree204ba80bf52ea46ccf2c6bd6db8fda0583f3a209 /Master/texmf-dist/tex/latex/suftesi
parentc356c0b921843da986afd43189746387e30f4fe1 (diff)
suftesi (23apr12)
git-svn-id: svn://tug.org/texlive/trunk@26113 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/suftesi')
-rw-r--r--Master/texmf-dist/tex/latex/suftesi/suftesi.cls226
1 files changed, 153 insertions, 73 deletions
diff --git a/Master/texmf-dist/tex/latex/suftesi/suftesi.cls b/Master/texmf-dist/tex/latex/suftesi/suftesi.cls
index bc370eca2a2..add538521fd 100644
--- a/Master/texmf-dist/tex/latex/suftesi/suftesi.cls
+++ b/Master/texmf-dist/tex/latex/suftesi/suftesi.cls
@@ -19,7 +19,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesClass{suftesi}
- [2012/03/19 v0.8 A class for typesetting theses, books and articles]
+ [2012/04/22 v0.9 A class for typesetting theses, books and articles]
\newif\ifsuftesi@centertitle
\newif\ifsuftesi@sctitles
\newif\ifsuftesi@artemisia
@@ -39,6 +39,8 @@
\newif\ifsuftesi@sufelements
\newif\ifsuftesi@nocrop
\newif\ifsuftesi@nomarginpar
+\newif\ifsuftesi@dottedtoc
+\newif\ifsuftesi@raggedtoc
\DeclareOption{centertitle}{\suftesi@centertitletrue}
\DeclareOption{sctitles}{\suftesi@sctitlestrue}
\DeclareOption{disablefront}{\suftesi@nofronttrue}
@@ -62,6 +64,8 @@
\DeclareOption{nomarginpar}{\suftesi@nomarginpartrue}
\DeclareOption{article}{\suftesi@articletrue}
\DeclareOption{authortitle}{\suftesi@authortitletrue}
+\DeclareOption{dottedtoc}{\suftesi@dottedtoctrue}
+\DeclareOption{raggedtoc}{\suftesi@raggedtoctrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ExecuteOptions{artemisia}
\ProcessOptions
@@ -70,7 +74,7 @@
\RequirePackage{color}
\definecolor{sufred}{rgb}{0.5,0,0}
\definecolor{sufgray}{rgb}{0.5,0.5,0.5}
-\RequirePackage{ifxetex,ifluatex,metalogo}
+\RequirePackage{ifxetex,ifluatex}
\ifxetex\relax
\else
\RequirePackage{microtype}
@@ -240,42 +244,6 @@
\chapnumfont{pplj}
\fi
\ifsuftesi@article
- \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}
-\AtBeginDocument{%
-\@ifpackageloaded{biblatex}{%
- \defbibheading{bibliography}[\refname]{%
- \section*{#1}%
- \markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
- \defbibheading{shorthands}[\losname]{%
- \section*{#1}%
- \markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
- \defbibheading{bibintoc}[\refname]{%
- \section*{#1}%
- \addcontentsline{toc}{section}{#1}%
- \markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
- \defbibheading{losintoc}[\losname]{%
- \section*{#1}%
- \addcontentsline{toc}{section}{#1}%
- \markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
- \defbibheading{bibnumbered}[\refname]{%
- \section{#1}%
- \if@twoside\markright{\MakeUppercase{#1}}\fi}
- \defbibheading{losnumbered}[\losname]{%
- \section{#1}%
- \if@twoside\markright{\MakeUppercase{#1}}\fi}
- \defbibheading{subbibliography}[\refname]{%
- \subsection*{#1}}
- \defbibheading{subbibintoc}[\refname]{%
- \subsection*{#1}%
- \addcontentsline{toc}{subsection}{#1}}
- \defbibheading{subbibnumbered}[\refname]{%
- \subsection{#1}}}%
- {\relax}%
-}%
\titleclass{\part}{straight}
\titleformat{\part}[hang]
{\large}
@@ -361,6 +329,14 @@
{}
\titlespacing*{\subsubsection}{0em}{\baselineskip}{\baselineskip}[0em]
\else
+\ifsuftesi@article
+ \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}
+\else
+\fi
\titleformat{\section}[hang]
{\filright}
{\thesection}
@@ -394,17 +370,111 @@
{}
[.\hspace*{1em}]
\titlespacing*{\subparagraph}{\parindent}{.5\sectionsep}{.5\sectionsep}
+\ifsuftesi@article %ARTICLE
+\AtBeginDocument{%
+\@ifpackageloaded{biblatex}{%
+ \defbibheading{bibliography}[\refname]{%
+ \section*{#1}%
+ \markboth{#1}{#1}}
+ \defbibheading{shorthands}[\losname]{%
+ \section*{#1}%
+ \markboth{#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}}
+ \defbibheading{bibnumbered}[\refname]{%
+ \section{#1}%
+ \if@twoside\markright{#1}\fi}
+ \defbibheading{losnumbered}[\losname]{%
+ \section{#1}%
+ \if@twoside\markright{#1}\fi}
+ \defbibheading{subbibliography}[\refname]{%
+ \subsection*{#1}}
+ \defbibheading{subbibintoc}[\refname]{%
+ \subsection*{#1}%
+ \addcontentsline{toc}{subsection}{#1}}
+ \defbibheading{subbibnumbered}[\refname]{%
+ \subsection{#1}}}%
+ {\relax}%
+}%
+\else %BOOK
+\AtBeginDocument{%
+\@ifpackageloaded{biblatex}{%
+ \defbibheading{bibliography}[\bibname]{%
+ \chapter*{#1}%
+ \markboth{#1}{#1}}
+ \defbibheading{shorthands}[\losname]{%
+ \chapter*{#1}%
+ \markboth{#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}}
+ \defbibheading{bibnumbered}[\bibname]{%
+ \chapter{#1}%
+ \if@twoside\markright{#1}\fi}
+ \defbibheading{losnumbered}[\losname]{%
+ \chapter{#1}%
+ \if@twoside\markright{#1}\fi}
+ \defbibheading{subbibliography}[\refname]{%
+ \section*{#1}%
+ \if@twoside\markright{#1}\fi}
+ \defbibheading{subbibintoc}[\refname]{%
+ \section*{#1}%
+ \addcontentsline{toc}{section}{#1}%
+ \if@twoside\markright{#1}\fi}
+ \defbibheading{subbibnumbered}[\refname]{%
+ \section{#1}}}
+ {\relax}%
+}%
+\fi
\RequirePackage{titletoc}
+\ifsuftesi@dottedtoc
+ \newcommand{\suftesi@titlerule}{\titlerule*{\footnotesize .\ }}
+ \newcommand{\suftesi@chaptitlerule}{\titlerule*{}}
+ \else
+\ifsuftesi@raggedtoc
+ \newcommand{\suftesi@titlerule}{\hspace{1.5em}}
+ \newcommand{\suftesi@chaptitlerule}{\hspace{1.5em}}
+ \else
+ \newcommand{\suftesi@titlerule}{\titlerule*{}}
+ \newcommand{\suftesi@chaptitlerule}{\titlerule*{}}
+ \fi
+\fi
\ifsuftesi@article
-\renewcommand\tableofcontents{% article mode
+\renewcommand\tableofcontents{%
\thispagestyle{empty}
\section*{\contentsname
\@mkboth{\contentsname}{\contentsname}}%
\@starttoc{toc}%
- \vspace*{2ex}
+ \vspace{2ex}%
+ }
+\renewcommand\listoffigures{%
+ \section*{\listfigurename}%
+ \@mkboth{\listfigurename}%
+ {\listfigurename}%
+ \@starttoc{lof}%
+ \vspace{2ex}%
+ }
+\renewcommand\listoftables{%
+ \section*{\listtablename}%
+ \@mkboth{%
+ \listtablename}%
+ {\listtablename}%
+ \@starttoc{lot}%
+ \vspace{2ex}%
}
\else
-\renewcommand\tableofcontents{% book mode
+\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
@@ -428,38 +498,54 @@
{\addvspace{2ex}}
{\thecontentslabel\hspace*{1em}}
{}
- {\titlerule*{\footnotesize .\ }\contentspage}
+ {\suftesi@chaptitlerule\contentspage}
[\addvspace{1ex}]
\titlecontents{section}
[1.5em]
{}
{\thecontentslabel\hspace*{1em}}
{}
- {\titlerule*{\footnotesize .\ }\contentspage}
+ {\ifsuftesi@article\suftesi@chaptitlerule%
+ \else\suftesi@titlerule\fi\contentspage}
\titlecontents{subsection}
[3em]
{}
{\thecontentslabel\hspace*{1em}}
{}
- {\titlerule*{\footnotesize .\ }\contentspage}
+ {\suftesi@titlerule\contentspage}
\titlecontents{subsubsection}
[4.5em]
{}
{\thecontentslabel\hspace*{1em}}
{}
- {\titlerule*{\footnotesize .\ }\contentspage}
+ {\suftesi@titlerule\contentspage}
\titlecontents{figure}
[1.5em]
{}
{\thecontentslabel\hspace*{1em}}
{}
- {\titlerule*{\footnotesize .\ }\contentspage}
+ {\suftesi@titlerule\contentspage}
\titlecontents{table}
[1.5em]
{}
{\thecontentslabel\hspace*{1em}}
{}
- {\titlerule*{\footnotesize .\ }\contentspage}
+ {\suftesi@titlerule\contentspage}
+ \renewcommand*{\title}[2][]{\gdef\@headtitle{#1}\gdef\@title{#2}}
+ \edef\title{\noexpand\@dblarg
+ \expandafter\noexpand\csname\string\title\endcsname}
+ \def\@headtitle{--missing title--%
+ \protect\ClassWarningNoLine{suftesi}{%
+ No \string\title\space given \MessageBreak%
+ See the class documentation for explanation}}
+ \def\@title{--missing title--%
+ \protect\ClassWarningNoLine{suftesi}{%
+ No \string\title\space given\MessageBreak%
+ See the class documentation for explanation}}
+ \def\@author{--missing author--%
+ \protect\ClassWarningNoLine{suftesi}{%
+ No \string\author\space given\MessageBreak%
+ See the class documentation for explanation}}
\let\standardtitle\maketitle
\if@titlepage% titlepage
\renewcommand\maketitle{\begin{titlepage}%
@@ -621,26 +707,20 @@
{}
{\contentspage\vspace{5pt}}}
\else
-\renewcommand\appendix{\par
- \setcounter{chapter}{0}%
- \setcounter{section}{0}%
- \gdef\@chapapp{\appendixname}%
- \gdef\thechapter{\@Alph\c@chapter}}
+ \ifsuftesi@article
+ \renewcommand\appendix{\par
+ \setcounter{section}{0}%
+ \setcounter{subsection}{0}%
+ \gdef\thesection{\@Alph\c@section}}
+ \else
+ \renewcommand\appendix{\par
+ \setcounter{chapter}{0}%
+ \setcounter{section}{0}%
+ \gdef\@chapapp{\appendixname}%
+ \gdef\thechapter{\@Alph\c@chapter}}
+ \fi
\fi
\RequirePackage{fancyhdr}
- \renewcommand{\title}[2][\@title]{\gdef\@title{#2}\gdef\@headtitle{#1}}
- \def\@headtitle{--missing title--%
- \protect\ClassWarningNoLine{suftesi}{%
- No \string\title\space given \MessageBreak%
- See the class documentation for explanation}}
- \def\@title{--missing title--%
- \protect\ClassWarningNoLine{suftesi}{%
- No \string\title\space given\MessageBreak%
- See the class documentation for explanation}}
- \def\@author{--missing author--%
- \protect\ClassWarningNoLine{suftesi}{%
- No \string\author\space given\MessageBreak%
- See the class documentation for explanation}}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footnoterule}{}
@@ -825,20 +905,20 @@
{\endlist}
\renewcommand\@makefntext{%
\hskip-2.5em\makebox[2em][r]{\@thefnmark}\hskip.5em}
-\def\graffito@setup{%thanks to Lorenzo Pantieri and Enrico Gregorio
+\def\sufmpsetup@setup{%thanks to Lorenzo Pantieri and Enrico Gregorio
\itshape\footnotesize%
\parindent=0pt \lineskip=0pt \lineskiplimit=0pt %
\tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%
\doublehyphendemerits=100000%
\finalhyphendemerits=\doublehyphendemerits}
-\newcommand{\graffito}[1]{\marginnote%
- [\graffito@setup\raggedleft\hspace{0pt}{#1}]%
- {\graffito@setup\raggedright\hspace{0pt}{#1}}}
- \let\marginnote\marginpar
- \def\marginpar{% thanks to Antonio Macrì
- \@ifnextchar[\marginnote\graffito}
+\long\def\@xmpar[#1]#2{%
+ \@savemarbox\@marbox{\sufmpsetup@setup\raggedleft\hspace{0pt}#1}%
+ \@savemarbox\@currbox{\sufmpsetup@setup\raggedright\hspace{0pt}#2}%
+ \@xympar}
+\long\def\@ympar#1{%
+ \@savemarbox\@marbox{\sufmpsetup@setup\raggedleft\hspace{0pt}#1}%
+ \global\setbox\@currbox\copy\@marbox \@xympar}
\ifsuftesi@nomarginpar
- \let\graffito\@gobble
\renewcommand\marginpar[2][]{}
\else
\fi