# Problem with hyperref and hypdvips

In my table of contents, there are entries that span more than one line. Since I compile with LaTeX -> PS -> PDF, the links created by hyperref are not correctly displayed in the output file (pdf). To fix this issue, I added \usepackage{hypdvips} in my preamble.

Here is my minimal working example:

\documentclass{scrbook}

%\usepackage[USenglish]{babel}
%\usepackage[T1]{fontenc}
%\usepackage[latin1]{inputenc}
\usepackage{hypdvips} %The hypdvips package fixes some problems when using hyperref with dvips as backend driver.

\listfiles

\begin{document}

\tableofcontents

\chapter{A short chapter heading}

\section{A short section heading}

\chapter{A very long never ending far reaching comprehensive illustrative long chapter heading}

\section{A very long never ending far reaching comprehensive illustrative long section heading}

\subsection{Short: Two alternative models for the workforce assignment problem}

\subsection{Long: Limitations of the models and potential remedies and extensions}

\end{document}


However, adding hypdvips leads to two error messages:

1. ! Undefined control sequence.
\tableofcontents ->\backrefsetup
{disable}\pp@backup@tableofcontents \backre...
l.15 \tableofcontents

2. ! Undefined control sequence.
\tableofcontents ...tableofcontents \backrefsetup
{enable}
l.15 \tableofcontents


The output file is created and all links are correctly displayed but the words „disable“ and „enable“ appear in the output file.

The problem seems to resemble the issue that has already been reported here. I use the latest version of the hypdvips package (Version 3.01), and pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=latex 2014.3.24).

The error occurs for all document classes that I tested (scrbook, book, scrartcl, article, scrreprt, report). Any help would be appreciated.

• Do you know, that you can use shorter entries to the TOC by using, say, \chapter[short_entry]{long_entry}? The same works for the other sectioning commands. Do you really need such long entries?
– user31729
Jun 19 '14 at 8:54
• And I just forgot: Welcome to TeX.SX! ;-)
– user31729
Jun 19 '14 at 8:56
• Dear Christian, thanks for the welcome. Yes, I know about the option enabling short entries, but in my case I have to stick to the long headings even in the table of contents. So I tried the suggestions of Heiko. Jun 19 '14 at 16:43

This is a bug in hypdvips. According to the option settings hyperef does not load package backref. But hypdvips redefines \tableofcontents and friends to disable back references there. It uses \backrefsetup that is not defined, because backref is not loaded.

Workarounds:

• Providing a dummy definition for \backrefsetup:

\providecommand*{\backrefsetup}[1]{}

• Options backref or pagebackref for hyperref to enable back references and load package backref.

• Use of options tocbr, lofbr, lotbr, loabr for hypdvips. Then hypdvips does not redefine \tableofcontents and friends to insert \backrefsetup commands to disable back references there.

Of course, backref should be up-to-date:

The ChangeLog of hyperref shows, when \backrefstup was defined:

2012-07-24

• backref 1.37:

• \backrefsetup added.
• Options enable and disable added.
• I have written an email to the author to notify him. Jun 19 '14 at 9:46
• Dear Heiko, thanks for your comprehensive suggestions. All three suggestions work fine for the minimal working example. In my original document, though, only the second workaraound does the job. My hyperref package is up to date (Version 6.83m with backref Version 1.38). Jun 19 '14 at 16:48
• Second workaround (Options backref or pagebackref for hyperref): There is only an error message from biblatex because biblatex has an own back-referencing mechanism: ! Package biblatex Error: Incompatible package 'backref'. See the biblatex package documentation for explanation. But this conflict seems to have no consequences. The output looks fine, no matter whether I use the backref option of biblatex or not. Jun 19 '14 at 16:52
• First workaround (\providecommand*{\backrefsetup}[1]{}): Causes many errors, each related to citations. ! Undefined control sequence. \Hy@backout #1->\@bsphack \ifBR@enable \ifBR@verbose \PackageInfo {backref}{... l.3 ...63 and 25--27, respectively]{Kerzner.2013}. As each project demands s... ! Undefined control sequence. \Hy@backout ...bsphack \ifBR@enable \ifBR@verbose \PackageInfo {backref}{Bac... l.3 ...63 and 25--27, respectively]{Kerzner.2013}. Package backref Info: Back cite 0@Kerzner.2013' on input line 3. ! Extra \else. And later: ! LaTeX Error: No counter 'pp@backrefID' defined. Jun 19 '14 at 17:03
• Third workaround (Use of options tocbr, lofbr, lotbr, loabr for hypdvips): The same error messages occur but the last referring to the counter pp@backrefID. In case of the first and third workaraound, the output file contains an empty table of contents and comprises only the first chapter and the first pages of the second chapter. All the errors are related to citations. I use biblatex (with \textcite and \parencite commands ) as follows \usepackage[citestyle=authoryear-comp, bibstyle=authoryear, ..., backend=biber, ..., autolang=hyphen, ..., backref=false]{biblatex} Jun 19 '14 at 17:06

For me none of the above suggested solutions really worked. Instead, redefining the following command, that is defined by the hypdvips package, to do nothing made the hypdvips and biblatex packages compatible in my case.

\renewcommand*{\Hy@backout}[1]{}