GeneralModify the table of contents

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
luzmara
Posts: 18
Joined: Thu Sep 04, 2008 3:45 pm

Modify the table of contents

Post by luzmara »

Hi,

In my contents appears the abstract, my list of figures and tables, then the introduction and my sections. By defaults the sections and all relate with it (number of section, page number of the section and the dots) appears in bold, also have more vertical space between the sections.

I need that in the TOC the sections, the number of section, the page number of the section and the dots appear without bold and decrease the vertical space between sections, this last I can do it with the command \renewcommand{\cftbeforesecskip}{0em} but still continued with the bold problem.

There is an example of my document,

Code: Select all

\documentclass{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{caption}
\captionsetup[figure]{format=hang,labelsep=endash}
\captionsetup[table]{format=hang,labelsep=endash,singlelinecheck=false}
\usepackage[titles,subfigure]{tocloft}
\usepackage{subfig}

\renewcommand{\cfttabpresnum}{Table }
\renewcommand{\cftfigpresnum}{Figure }
\renewcommand{\cfttabaftersnum}{ - }
\renewcommand{\cftfigaftersnum}{ - }
\renewcommand{\cfttabnumwidth}{4.7em}
\renewcommand{\cftfignumwidth}{4.7em}
\renewcommand{\cfttabindent}{0em}
\renewcommand{\cftfigindent}{0em}

\renewcommand{\cftsubsecindent}{0em} 
\renewcommand{\cftsubsubsecindent}{0em} 
\renewcommand{\cftsecdotsep}{\cftdotsep}
\renewcommand{\cftbeforesecskip}{0em}

\begin{document}

\tableofcontents
\newpage

\section*{Abstract}
\addcontentsline{toc}{section}{Abstract}

\newpage
\listoftables
\addcontentsline{toc}{section}{List of Tables}

\newpage
\listoffigures
\addcontentsline{toc}{section}{List of Figures}

\newpage
\section{Introduction}

\section{Section one}

\subsection{Subsection of the section one}
\subsubsection{subsubsection of the section two}

\section{Section two}
\subsection{Subsection of the section two}
\subsubsection{subsection of the section  two}

\section*{References}
\addcontentsline{toc}{section}{References}

\end{document}
Thanks,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Modify the table of contents

Post by gmedina »

Hi luzmara,

use:

Code: Select all

\renewcommand{\cftsecfont}{\normalfont}
\renewcommand{\cftsecpagefont}{\normalfont}
\renewcommand{\cftsecleader}{\normalfont\cftdotfill{\cftsecdotsep}}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
luzmara
Posts: 18
Joined: Thu Sep 04, 2008 3:45 pm

Re: Modify the table of contents

Post by luzmara »

Hi gmedina,

Thanks a lot, like always you solve my questions. You are the best.

:mrgreen:
Post Reply