2

I have had problems with the bibliography title and the Table-of-contents title not being numbered and not showing in the ToC. To solve it I used the tocbibind package.

By adding the line:

\usepackage[numbib]{tocbibind}

to my preamble both the bibliography title and the ToC title appeared in the ToC. And the numbib value added a numbering to the bibliography.

I am still missing the numbering of the ToC, though:

enter image description here

As you can see in the ToC list the "Contents" title appears as it should but without a numbering. The "Contents" title (in red) did get a number though, when I added this package, but the number is wrong. As you can see, it has the number 2, which is already taken by the "Preface" title.

So it seems the numbering is not working properly and in any case not added to the ToC. Looking through the documentation of the tocbibind package, I couldn't find any notion of this, but if it can be fixed with this package, that would be good. Else, how can I fix this?


My code structure:

\documentclass[11pt,a4paper]{article}
\usepackage[utf8x]{inputenc}    %Character set
\usepackage[numbib]{tocbibind}
 ...
\begin{document}

   \section{Abstract}
   Text text text

   \section{Preface}
   Text text text

   \pagebreak
   \tableofcontents
   \pagebreak

   \section{Introduction}
   Text text text
   ...
\end{document}
2

The tocbibind has no provision for numbering the table of contents. The easiest method is to redefine \tableofcontents to do it and to load tocbibind with the nottoc option in order to avoid double inclusion.

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}    %Character set
\usepackage[numbib,nottoc]{tocbibind}

\makeatletter
\renewcommand\tableofcontents{%
  \section{\contentsname}\@starttoc{toc}%
}
\makeatother

\begin{document}

   \section{Abstract}
   Text text text

   \section{Preface}
   Text text text

   \clearpage
   \tableofcontents
   \clearpage

   \section{Introduction}
   Text text text
   ...
\end{document}

Notes. (1) Avoid utf8x. (2) If you want a page break that fills the available space, use \clearpage; \pagebreak seems to work here, but just because \raggedbottom is in force: with the twoside option you'd get surprises.

picture

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.