0

Problem Statement

I use BibTeX for the Bibliography, makeindex for the Index and hyperref to create the hyperlinks.

In the .pdf file that I get after compiling, all hyperlinks (e.g., ToC entries, page references in the Index, citations of Bibliography entries,...) work, except for the Index entry in the ToC, which instead points to the Bibliography (the Bibliography ToC entry also links to the Bibliography).

How to reproduce the problem

Here is my example.tex file, reduced to a MWE:

\documentclass[a4paper]{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{lipsum}
\usepackage{makeidx}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{hyperref}

\makeindex

\begin{document}

\bibliographystyle{unsrt}
%\nocite{*}

\frontmatter

\title{Title}
\author{Author}
\date{}
\maketitle

\tableofcontents

\mainmatter

\chapter{First chapter}
\section{First section\index{section}}
\lipsum[1-2]
\section{Second section}
\lipsum[1-2]

Cite-example\cite{ref1}

\backmatter

\bibliography{biblio.bib}

\printindex

\end{document}

and my biblio.bib file:

@book{ref1,
  author = "Author",
  title  = "Title",
  year   = 1490
}

Finally, here is the routine I use in compiling (I am running TeXLive in GNU/Linux Fedora20):

pdflatex example.tex
makeindex example.idx
bibtex example.aux
pdflatex example.tex
pdflatex example.tex

What am I doing wrong?

Pier Paolo
  • 2,790
  • You could manually add the correct entry, see for example http://tex.stackexchange.com/questions/187828/wrong-pdf-bookmark-for-bibliography-chapter/188040#188040 –  Jul 18 '14 at 20:44
  • @ChristianHupfer Thanks for your answer. I tried \clearpage \phantomsection \printindex \addcontentsline{toc}{chapter}{\indexname}. Now the problem is that the Index ToC entry points to the start of the Index instead of displaying the Index title. – Pier Paolo Jul 18 '14 at 21:11
  • @PierPaolo: I will look into your code –  Jul 18 '14 at 21:13
  • @PierPaolo: I am little bit confused: You do want to have an ToC entry for the Index and this should be hyperlink to your Index? If this is the case, then the code you tried (see your comment) is correct, after compiling twice. Or do you mean the Toc itself, Indice in Italian? –  Jul 18 '14 at 21:20
  • @ChristianHupfer: You are right, but now the link points to the first voice of the Index instead of pointing to the title. I looked here: http://tex.stackexchange.com/questions/172352/correct-hyperlink-to-the-index/172375 , but I could not solve the "new" problem. – Pier Paolo Jul 18 '14 at 21:25
  • @PierPaolo: You mean the title Indice analitico? –  Jul 18 '14 at 21:28
  • @ChristianHupfer: Yes. It's the Italian for Index, I left it because I reduced an actual document to a MWE. – Pier Paolo Jul 18 '14 at 21:30
  • @PierPaolo: How do you notice, that it links to the first entry of your Indice analitico instead of linking to the title? In your MWE there is just one index entry, section –  Jul 18 '14 at 21:31
  • 1
    Have you ever been able to resolve the issue? Can you provide a self answer or was Heikos solution helping you as well? If so, we could close this as duplicate to Heikos solution. – Johannes_B Feb 18 '15 at 22:05
  • @Johannes_B: Heiko Oberdiek's answer (here) helped get the right page from the “Index” link in the ToC, but didn't solve the problem posted specifically in that question, i.e. the fact that the link points to the first entry in the Index rather than the Index title (\indexname). It's not really a problem, though. – Pier Paolo Feb 18 '15 at 23:14
  • 1
  • @Johannes_B: the link to your question solves completely the problem for the class scrbook (which I actually use now instead of the standard classes). However, it generates a spurious blank page after the index itself and moreover it affects the page style: the first page of the index has a different style than the one I defined with \renewcommand*{\chapterpagestyle}{...} and the following page as the header, even though I loaded the package emptypage to explicitly suppress it. – Pier Paolo Feb 19 '15 at 17:23
  • @Johannes_B: I corrected the wrong page style with \renewcommand*{\indexpagestyle}{...} but the spurious blank (not really, it still has the header) page is still there. – Pier Paolo Feb 19 '15 at 17:57
  • indexpagestyle is the right keyword. the default with KOMA-classes is, i think, cleardoublepage=empty, so i guess for this part, a new question is in order. But back to the topic at hand, what to do with this question? To be honest, i haven't even tested your MWE. Shall i look into the matter, or dupe it as one of the above linked Qs? – Johannes_B Feb 19 '15 at 20:36
  • @Johannes_B: the original question is solved thanks to the answer to this question, so IMO this thread can be closed as a duplicate of the linked question. The spurious blank page is an issue that is about scrbook and I plan to investigate it before posting another question. Thank you for your time. :) – Pier Paolo Feb 19 '15 at 21:00
  • 1
    VtC as dupe as discussed in the last comments. Looking forward to the new question, if it comes :-) – Johannes_B Feb 19 '15 at 21:01

0 Answers0