Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When typesetting an article documentclass, the sections appear as bold in the table of contents, with no leading dots. I would like to change these to non-bold, and insert some leading dots. I tried the following, but it seems to be ignored. Any ideas?

% change section headers and page numbers to normal instead of bold font
\renewcommand{\cftsecfont}{
\normalfont
}
\renewcommand{\cftsecpagefont}{%
\normalfont
}
% use leader dots with section headers
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
share|improve this question
    
It's not standard. It seems like you use tocloft package for designing the TOC, however you didn't mention it. –  Stefan Kottwitz Mar 14 '11 at 20:29
    
Further to what Stefan said, the tocloft package might be sensitive to other things you have in your preamble. Could you post a minimum working example, please? –  Charles Stewart Mar 14 '11 at 20:33
    
@Stefan: the behaviour described by @Hugo is the standard when using the article document class: entries of section type are boldfaced and with no leading dots. –  Gonzalo Medina Mar 14 '11 at 20:41

2 Answers 2

up vote 10 down vote accepted

Using the tocloft package you can do something like this:

\documentclass{article}
\usepackage{tocloft}

\renewcommand\cftsecfont{\normalfont}
\renewcommand\cftsecpagefont{\normalfont}
\renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}
\renewcommand\cftsecdotsep{\cftdot}
\renewcommand\cftsubsecdotsep{\cftdot}

\begin{document}

\tableofcontents
\section{test section}
\subsection{test section}
\section{test section}
\subsection{test section}

\end{document}
share|improve this answer

The »tocstyle« package from KOMA Script could be an alternative. Note that this package is in alpha state and you'll get a corresponding warning.

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{babel}
\usepackage{tocstyle}
\usepackage{blindtext}

\begin{document}
  \tableofcontents

  \bigskip
  \Blinddocument
\end{document}

Simply including the package does already what you're after. Further customization is done by declaring new ToC styles. For further information run texdoc tocstyle on the command line.

As always, the blindtext package is only for creating dummy text thus not part of the solution.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.