Re: Personalizzare indice con tocloft

#80490
Up
0
Down
::


Benvenuta!

Ecco qui una possibilità:

`\documentclass{book}

\usepackage[titles]{tocloft}
\usepackage[nottoc]{tocbibind}

\makeatletter
\renewcommand{\l@chapter}[2]{%
\ifnum\c@tocdepth>\m@ne
\addpenalty{-\@highpenalty}\vskip 1.0em \@plus \p@
{\centering\renewcommand\numberline[1]{{\normalfont\scshape\chaptername\ ##1}\\}\bfseries#1\par}
\penalty\@highpenalty
\fi}
\makeatother

\setlength{\cftsecindent}{0pt}
\renewcommand{\cftsecaftersnum}{.}
\setlength{\cftsubsecindent}{\cftsecnumwidth}
\renewcommand{\cftsubsecaftersnum}{.}

\begin{document}
\frontmatter
\tableofcontents
\listoffigures
\mainmatter
\chapter{Titolo}
\section{Sezione}
\subsection{Sottosezione}
\end{document}`
Preferisco cambiare direttamente [tt]\l@chapter[/tt] perché il codice è assai più semplice così che inserire tutte le necessarie istruzioni per tocloft.

Ricorda di caricare hyperref DOPO queste modifiche.

Ciao
Enrico

Go to top