New answers tagged

3

Special setups require special means ;-) The spacings etc. can be done with tocloft features, however, this changes the \tableofcontents command too much. The section page numbers in the section title line require some change to the \@sect command. \documentclass{book} \makeatletter \let\latextableofcontents\tableofcontents % Save the original version ...


1

Since the part number should be centered as well, I choose to use a patch for the \addcontentsline within \@part -- note this is only working of the \secnumdepth is greater than -1. \documentclass{book} \usepackage{xpatch} \makeatletter \xpatchcmd{\@part}{% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%% }{% ...


1

To get the part number centered, I had to use the tocloft package. \documentclass{book} \usepackage{tocloft} \renewcommand\cftpartpresnum{\hfill} \renewcommand\cftpartleader{\hfill} \begin{document} \tableofcontents \clearpage \part{Parte the First} \section{Introduction} \section{Next Section} \part{Parte the Second} \section{Introduction} ...


1

Use a redefined \cftsecpagefont for this, calling the old version after the ( then: \documentclass{article} \usepackage{tocloft} \usepackage{blindtext} \let\origcftsecpagefont\cftsecpagefont \let\origcftsecafterpnum\cftsecafterpnum \renewcommand{\cftsecpagefont}{(\origcftsecpagefont} \renewcommand{\cftsecafterpnum}{\origcftsecafterpnum)} \begin{document} ...


1

You can put the space in \cftXleaders before the actual leaders: \documentclass{book} \usepackage[titles]{tocloft} \renewcommand{\cftchapdotsep}{\cftdotsep} % leaders for chapters \renewcommand{\cftchapleader}{\hspace{1em}\cftdotfill{\cftsecdotsep}} \renewcommand{\cftsecleader}{\hspace{2em}\cftdotfill{\cftsecdotsep}} ...


0

For the tocloft package (tagged by the OP's question), after turning dots on with \cftsecdotsep, the gap between section title and the dot leader can be adjusted by redefining \cftsecfillnum to add a \hspace at the very beginning. \documentclass{article} \usepackage{tocloft} \renewcommand\cftsecdotsep{\cftdotsep} \makeatletter ...


0

If package tocloft should not change the settings of the headings in TOC etc. you can load it with option titles. \documentclass{report} \usepackage{sectsty} \chapterfont{\LARGE} \usepackage[titles]{tocloft} \usepackage{blindtext}% dummy text \begin{document} \tableofcontents \blinddocument \end{document} Note that \cfttoctitlefont does not take an ...



Top 50 recent answers are included