GeneralIndentation and Formatting for ToC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
nynoles
Posts: 1
Joined: Mon Oct 28, 2013 4:31 pm

Indentation and Formatting for ToC

Post by nynoles »

Hello everyone,

I am working on organizing my ToC and I'm using tocloft. My question is related to the indents associated with sections and subsections in an article.

Code: Select all

\usepackage{tocloft}

\renewcommand{\cftsecfont}{\normalsize}
\renewcommand{\cftsubsecfont}{\normalsize}
\renewcommand{\cftsubsubsecfont}{\normalsize}

\setlength{\cftsecindent}{0em}
\setlength{\cftsubsecindent}{0em}
\setlength{\cftsubsubsecindent}{0em}

\setlength{\cftsecnumwidth}{3.5em}
\setlength{\cftsubsecnumwidth}{3.5em}
\setlength{\cftsubsubsecnumwidth}{3.5em}
For some reason the section and subsection works fine, but the sub-subsection number is both indented slightly and doesn't show all three digits of "1.1.1". It stops at "1.1".

Any help at all would be much appreciated.
Last edited by localghost on Mon Oct 28, 2013 8:52 pm, edited 1 time in total.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Indentation and Formatting for ToC

Post by localghost »

You may wonder why you didn't get an answer yet. This is due to the fact that the code fragments don't allow to reproduce the problem. Hence you should try harder to make the problem comprehensible for others by preparing a self-contained and minimal example.

If I complete your code snippet to such an example, it works as expected with complete heading numbers in the ToC.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tocloft}
\usepackage{blindtext}

\renewcommand{\cftsecfont}{\normalsize}
\renewcommand{\cftsubsecfont}{\normalsize}
\renewcommand{\cftsubsubsecfont}{\normalsize}

\setlength{\cftsecindent}{0em}
\setlength{\cftsubsecindent}{0em}
\setlength{\cftsubsubsecindent}{0em}

\setlength{\cftsecnumwidth}{3.5em}
\setlength{\cftsubsecnumwidth}{3.5em}
\setlength{\cftsubsubsecnumwidth}{3.5em}

\begin{document}
  \tableofcontents

  \blinddocument
\end{document}
Perhaps you should also think about customizing the page number font for section entries determined by \cftsecpagefont because with your settings they still appear bold in opposite to the numbers and headings.

Now it's your turn to show a counterexample.


Best regards and welcome to the board
Thorsten
Post Reply