Compiling the following example file:
\documentclass{aa}
\usepackage{hyperref}
\begin{document}
\section{Introduction}
Aaaa bbbb~\cite{Smith_2005} cccc.
\bibliographystyle{aa}
\bibliography{biblio}
\end{document}
shows the warning:
…/test.tex:15: Package hyperref Warning: Suppressing link with empty target on input line 15.
I compile with:
$ latexmk test.tex
my LaTeX version is:
$ latex
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=latex)
The biblio.bib
file looks like this:
@ARTICLE{Smith_2005,
author = {{Smith}, N.~V.},
journal = {AAA},
year = 2005,
month = sep,
volume = 440,
pages = {403-408},
}
and the other two files needed to compile are here: aa.cls, aa.bst.
Disabling the hyperref
package makes the warning go away, but I need it to be enabled. The final PDF looks fine, but I wonder why this warning appears since I don't remember seeing it before.
Best Answer
The class stores the last page number as a reference using
LastPage
, written as part of\end{document}
(comment added):Note that the
\newlabel
is written with 5 arguments. However, arguments 3, 4 and 5 are empty. This is to accommodate regular, non-hyperref
\label
s which only require two arguments, as well as whenhyperref
is loaded (which writes\label
s with 5 arguments).This
LastPage
reference is used in the footer throughout the document via this macro (line 425):While this works in general,
hyperref
uses the additional arguments (empty in this case) to identify markers for the last page as a hyperlink/jump. Since they're empty,hyperref
ignores the hyperlink and merely prints the (page) reference (together with a warning).You can avoid this warning by changing the
\pageref
to\pageref*
; add the following to your preamble:Alternately, make all
\pageref
s default to hyperlink-less references: