10

In the table of contents, the chapter number and chapter name are bold while the section and subsection numbers and names are not bold. How do I remove the bold from the chapter number and chapter name on the table of contents pages?

8

There are a few packages that can help customize \tableofcontents, \listoffigures, \listoftables, and other entries- here's a solution using the titletoc package.

screenshot

The important bit from the code below is

\titlecontents{chapter}
[0pt]                                               % left margin
{}%
{\contentsmargin{0pt}                               % numbered entry format
    \thecontentslabel\enspace%
    \large}
{\contentsmargin{0pt}\large}                        % unnumbered entry format
{\titlerule*[.5pc]{.}\contentspage}                 % filler-page format (e.g dots)
[]                                                  % below code (e.g vertical space)

Have a look at the documentation for more examples/ Here's a complete MWE to play with.

% arara: pdflatex

\documentclass{report}
\usepackage{titletoc}
\usepackage{hyperref}

\titlecontents{chapter}
[0pt]                                               % left margin
{}%
{\contentsmargin{0pt}                               % numbered entry format
    \thecontentslabel\enspace%
    \large}
{\contentsmargin{0pt}\large}                        % unnumbered entry format
{\titlerule*[.5pc]{.}\contentspage}                 % filler-page format (e.g dots)
[]                                                  % below code (e.g vertical space)


\begin{document}

\tableofcontents
\chapter{Test one}
\loop
\section{Section text}
\begin{table}
    \caption{Test table two}
\end{table}
\ifnum\value{section}<5\repeat

\chapter{Test two}
\loop
\section{Section text}
\begin{table}
    \caption{Test table two}
\end{table}
\ifnum\value{section}<5\repeat

\end{document}
7

I assume you're using the report or book document class, or a class that's based on these classes.

If you use the tocloft package, you can use the macros \cftchapfont and \cftchappagefont to set the font size and weight used for chapter-level entries and associated page numbers in the ToC. Set these macros to \mdseries to achieve your objective.

\documentclass{book}
\usepackage{tocloft}
\renewcommand\cftchapfont{\mdseries}
\renewcommand\cftchappagefont{\mdseries}
\setlength\textwidth{3in} % just for this example
\begin{document}
\tableofcontents
\chapter{First}
\section{Hello}
\subsection{Good morning}
\subsection{Good evening}
\chapter{Second}
\section{Goodbye}
\end{document}

The Table-of-Contents part of the output generated by this MWE looks like this:

enter image description here

For comparison, here's what the ToC would look like without the \cftsec... macro redefinitions -- note the bold font used for the sections' numbers, headers, and page numbers:

enter image description here


Addendum: If you use the article document class (which doesn't feature \chapter-level divisions, you'll find that the section-level entries (and associated page numbers) in the ToC are printed in bold. If you want to change these entries from "bold" to "normal", you can use the tocloft package; just be sure to redefine the macros \cftsecfont and \cftsecpagefont (instead of \cftchapfont and \cftchappagefont).

  • Thank you for the suggestion but the code did not cause any change in the output. – Peter Palmer May 22 '13 at 4:20
  • 1
    @PeterPalmer - I had overlooked that you were dealing with chapter rather than section headers in the ToC. I've changed the MWE; it's now based on the book document class and features code to change the appearance of chapter-level headings in the ToC. – Mico May 22 '13 at 11:44
  • It's nice to see this approach - I find the syntax of this package slightly harder to grasp than the titletoc – cmhughes May 22 '13 at 17:53
  • 3
    @cmhughes - the tocloft package provides lots and lots of ways of changing the look of the ToC (and LoT, LoF,...). It's probably true that the sheer number of actions made possible by the package can be a bit dizzying at first. – Mico May 22 '13 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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