[Tex/LaTex] Problem with hyperref’s pagebackref, modroman and thebibliography

back-referencingbibliographieshyperrefroman numeralswarnings

Following @yiannis-lazarides comment here, I decided to use the modroman package for my frontmatters.

In my actual project I don't have that many references, and thus decided to use the thebibliography environment.

The problem is that I'm also using hyperref with the pagebackrefs option enabled, and this gives me some very strange warnings; not strange because of the warning per se, but rather because of when it happens (which baffles me).

The warning itself is:

name{page.xiij} has been referenced but does not exist, replaced by a fixed one

and its raised when LaTeX is typesetting the pagebackrefs in question.

A minimal working example (exercising the warnings further) follows:

\documentclass{book}
\usepackage[pagebackref]{hyperref}
\usepackage{modroman}
\begin{document}
  \frontmatter
  \renewcommand{\thepage}{\texorpdfstring{\modroman{page}}{\roman{page}}}
  \setcounter{page}{10}
  Lorem ipsum dolor sit amet\cite{bib}, consectetur adipiscing elit.\clearpage
  Lorem ipsum dolor sit amet\cite{bib}, consectetur adipiscing elit.\clearpage
  Lorem ipsum dolor sit amet\cite{bib}, consectetur adipiscing elit.\clearpage
  Lorem ipsum dolor sit amet\cite{bib}, consectetur adipiscing elit.\clearpage
  Lorem ipsum dolor sit amet\cite{bib}, consectetur adipiscing elit.\clearpage
  Lorem ipsum dolor sit amet\cite{bib}, consectetur adipiscing elit.\clearpage
  Lorem ipsum dolor sit amet\cite{bib}, consectetur adipiscing elit.\cleardoublepage
  \begin{thebibliography}{9}
    \bibitem{bib}
      A.~N.~Author.
      Some title here.
      \emph{Another one here}, (12):3--5,
      September 1990.

  \end{thebibliography}
\end{document}

Thoughts anyone? 🙂

Best Answer

The problem is that hyperref is using the two distinct representations when doing its business and gets out of synch when \modroman{page} and \roman{page} differ.

With \renewcommand{\thepage}{\modroman{page}} the error does not show; you'll get xiij also in the bookmarks, but it doesn't seem much of a problem. Happily, \modroman is completely expandable.

Related Question