0

Using bibtex, I can't get the right numberpage of the bibliography in the table of contents. The toc shows the last number page of the bibliography, so that in my case, at the bottom of the table of contents I've got "9 Bibliography 75" but it should be "71". I can't fix it.

\documentclass[a4paper,11pt]{book}
\pdfpagewidth
\paperwidth
\pdfpageheight
\paperheight
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\makeindex
\usepackage{url}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{rotating}
\usepackage{caption}
\geometry{a4paper,tmargin=3cm,bmargin=4cm, lmargin=3.7cm,rmargin=3.7cm} 
\usepackage{multirow}
\usepackage{splitbib}
  \begin{document}
\cite{example}

\begingroup
\pagestyle{plain}
\sloppy
\begin{category}[]{name}
  \SBentries{example}
\end{category}


\bibliographystyle{plain}
\bibliography{name of the bib file}
\addtocounter{chapter}{1}
\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}\bibname}

\endgroup


\end{document}
8
  • 1
    Well your \addcontentsline command is after the bibliography so naturally it stores the page number from the end of the bibliography. Dec 8, 2016 at 16:19
  • 1
    As @UlrikeFischer mentioned: Just flip those lines: first \addcontentsline than \bibliography.
    – Jan
    Dec 8, 2016 at 16:27
  • Sorry, I've also tried this way, but what I obtain is even worse. Putting the \addcontentstline command before results in the toc showing the page number of the previous chapter. Dec 8, 2016 at 16:33
  • 1
    take a look at this question: Wrong page number in contents. the best answers are in the comments. Dec 8, 2016 at 16:35
  • 1
    It can't be worse, it can be at most two pages off and not 4 like now. Add a \newpage before the \addcontentsline. Dec 8, 2016 at 16:35

1 Answer 1

1

As in the comments: this is the code-snippet, that will do:

\cleardoublepage
\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}\bibname}
\bibliography{name of the bib file}

:-)

1
  • Or look at the tocbibind package.
    – egreg
    Jan 22, 2017 at 17:25

You must log in to answer this question.

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