Re: Livello appendici

#74820
Up
0
Down
::

Alb” post=73991Vorrei cambiare il rientro delle voci dell’indice senza cambiare la struttura gerarchica del documento.

Grazie del suggerimento. Ho trovato un modo per ottenere il risultato desiderato, proprio usando tocloft (qui). Il problema è che funziona con la classe report, ma non con la classe scrbook che sto usando per il mio documento.

Il codice è:
`\documentclass{report}
\usepackage{tocloft}
\begin{document}
\tableofcontents
\chapter{A chapter}
\section{A section}
\newpage\phantomsection
\addcontentsline{toc}{chapter}{Appendices}
\appendix
\addtocontents{toc}{
\setlength{\cftbeforechapskip}{\cftbeforesecskip}
\setlength{\cftchapindent}{\cftsecindent}
\protect\renewcommand{\cftchapfont}{\cftsecfont}
\protect\renewcommand{\protect\cftchapdotsep}{\cftsecdotsep}
}
\chapter{An Appendix}
\end{document}`

Con la classe report mi dà il risultato desiderato. Ma con scrbook ottengo l’errore seguente:

Missing endcsname inserted.

— Tex said —

\protect
l.4 … command {\normalcolor \sffamily \bfseries }
{\normalfont } \renewcomma..
— HELP —
From the .log file…

The control sequence marked should
not appear between \csname and \endcsname.

Scriverei
`\addtocontents{toc}{%
\unexpanded{\unexpanded{%
\setlength{\cftbeforechapskip}{\cftbeforesecskip}%
\setlength{\cftchapindent}{\cftsecindent}%
\renewcommand{\cftchapfont}{\cftsecfont}%
\renewcommand{\cftchapdotsep}{\cftsecdotsep}}}%
}`
così non hai problemi di sapere dove mettere [tt]\protect[/tt]. Di sicuro, comunque, andava anche prima di [tt]\cftchapfont[/tt].

In ogni caso l’idea mi sembra balzana.

Ciao
Enrico

Go to top