A problem with hyperref

Ulrike Fischer news3 at nililand.de
Mon Mar 30 09:26:50 CEST 2020


Am Sun, 29 Mar 2020 23:00:57 +0000 schrieb Michael Barr, Prof.:

> I am redoing a book originally published in 1990 and I would like
> to add hyperref since it will be posted online.  Everything works
> well till I come to the Bibliography which is introduced by
> \setcounter{chapter}{-1} \chapter{Biblography}.  The trouble is
> that the preface is introduced in the same way and the hyper
> reference to the bibliography on the TOC page links to the
> preface.  A similar problem occurs with the index.  I have tried
> to read the hyperref document, but I still don't understand how
> to deal with this.   

You basically only need to ensure that \theHchapter gives something
unique for every chapter. E.g. you can redefine it before the second
occurance with the same chapter counter:

\documentclass{book}
\usepackage{hyperref}

\begin{document}%
\tableofcontents

\setcounter{chapter}{-1} \chapter{Biblography1}

\setcounter{chapter}{-1}
\renewcommand\theHchapter{Bib\arabic{chapter}}
\chapter{Biblography2}
\end{document}


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/



More information about the texhax mailing list.