# Changing the TOC style of an Article document-class

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
}

-
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

Using the tocloft package you can do something like this:

\documentclass{article}
\usepackage{tocloft}

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

\begin{document}

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

\end{document}

-

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.

-