0

I would like to number the list of figures and the table of contents, with Roman numerals, themselves (not the things listed in them).

Doing this, while leaving the main text in bold, and leaving the number unformatted.

I can't seem to find a way of doing so.

4
  • This depends deliberately on the documentclass ... you did not show any line of code, however, but \usepackage[nottoc,notlof,notlot,chapter]{tocbibind} could help, in conjunction with \renewcommand{\thechapter}{\Roman{chapter}} just before \listoffigures\listoftables and \renewcommand{\thechapter}{\arabic{chapter}} after...
    – user31729
    Commented Feb 24, 2018 at 23:37
  • Please note that your require might cause inconsistent numbering, however
    – user31729
    Commented Feb 24, 2018 at 23:38
  • I was using the report document class. I doubt including any code would help (I just have the table of contents and the figure listing initiated, I didn't do anything else to them), besides, it is pretty messy.
    – Rodrigo
    Commented Feb 25, 2018 at 0:11
  • @ChristianHupfer Don't those commands just change the numbering of the chapters? The Table of Contents and the List of Figures, remain unnumbered.
    – Rodrigo
    Commented Feb 25, 2018 at 0:42

1 Answer 1

2

By default \tableofcontents and \listoffigures do not use numbered headings. This can be changed using the tocbibind package.

The following code redefines \tableofcontents and inserts the \tocchapter instruction, then loading the .toc file with \tocfile{\contentsname}{toc}.

The macro \unboldchapternumber defines the chapter number to be not bold and switches to \Roman and redefines the potential hyper anchor \theHchapter in case of hyperref being loaded.

  \renewcommand{\tableofcontents}{%
    \begingroup
    \unboldchapternumber%
    \tocchapter
    \tocfile{\contentsname}{toc}
    \endgroup
  }

After loading \listoffigures, the chapter counter should be reset to zero.

\documentclass{report}

\usepackage{tocbibind}
\usepackage{blindtext}
\usepackage{hyperref}

\makeatletter
\newif\ifhyperrefloaded
% Check whether hyperref is loaded
\@ifpackageloaded{hyperref}{
  \hyperrefloadedtrue
}{}
\makeatother


\newcommand{\unboldchapternumber}{%
  \renewcommand{\thechapter}{\normalfont\Roman{chapter}\bfseries}%
  \ifhyperrefloaded
  % Change the hyperanchors to prevent wrong anchors
  \renewcommand{\theHchapter}{tocchapter.\arabic{chapter}}%
  \fi
}

  \renewcommand{\tableofcontents}{%
    \begingroup
    \unboldchapternumber%
    \tocchapter
    \tocfile{\contentsname}{toc}
    \endgroup
  }
  \renewcommand{\listoffigures}{%
    \begingroup
    \unboldchapternumber
    \tocchapter
    \tocfile{\listfigurename}{lof}
    \endgroup
  }

\begin{document}
\tableofcontents
\listoffigures

\setcounter{chapter}{0}
\chapter{One}

\blindtext

\chapter{Two}

\blindtext
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .