TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I tell LaTeX to write additional content to bbl file?

Background of my question (see also MWE below): The page number for the bibliography displayed in the table of contents is correct if and only if \addcontentsline{toc}{chapter}{Bibliography} is placed at the beginning of the thebibliography environment. Hence, using bibTeX I need to write \addcontentsline{toc}{chapter}{Bibliography} into the bbl file. If I place it before \begin{thebibliography} the page number is first page of bibliography - 1, if I place it after \end{thebibliography} it is last page of bibliography + 1 (which in the MWE would be correct but not in general).



A. Brown
\newblock {\em Mathematics}.

share|improve this question
up vote 5 down vote accepted

The correct approach to add a bibliography entry to the ToC is not to fiddle with the .bbl file, but a) to add \addcontentsline{toc}{(sectioning level>}{Bibliography} to the (class-dependend!) definition of the thebibliography environment or b) to load packages for this task, e.g., \usepackage[nottoc]{tocbibind}.

See also Bibliography in table of contents; Gonzalo Medina's answer shows how to patch the thebibliography environment for the book class.

share|improve this answer
Apparently tocbibind is incompatible with imakeidx. In particular, including tocbibind results in the loss of `\indexprologue{abc}. Therefore I do no like including a package just for this purpose. One never knows what side effects new packages may possibly have ... – lpdbw Feb 24 '13 at 17:00
@lpdbw Use Gonzalo Medina's approach or try to load imakeidx after tocbibind. – lockstep Feb 24 '13 at 17:02
Yes, loading imakeidx after tocibind works. I wonder whether there are other unwanted effects due to tocibind which I am still ignoring ... I also tried Gonzalo Medina's second approach (the one with redefining \thebibliography) ... a remaining issue in combination with hyperref, is that if I click on the ToC entry for the bibliography, I jump to the first bib entry but not (as it should be) to the title of the bibliography ... maybe I will make this a comment of Medina's answer. – lpdbw Feb 24 '13 at 17:08

Your Answer


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.