Compiling the following example file:

Aaaa bbbb~\cite{Smith_2005} cccc.

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:

    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.

  • 1
    Your input file doesn't have 16 lines. So perhaps this message doesn't pertain to the example code?
    – Werner
    Dec 26, 2016 at 19:47
  • There was a comment that I removed for clarity. It is fixed now.
    – Gabriel
    Dec 26, 2016 at 19:48
  • 1
    If you change aa to article does the warning persist?
    – Hugh
    Dec 27, 2016 at 1:14
  • No, it goes away.
    – Gabriel
    Dec 27, 2016 at 2:09

1 Answer 1


The class stores the last page number as a reference using LastPage, written as part of \end{document} (comment added):

   \advance\c@page \m@ne
   % ^^^^ This writes the (last) page number as a \label to the .aux
       \makeatletter \input\jobname.aux
     \ifdim \font@submax >\fontsubfuzz\relax
       \@font@warning{Size substitutions with differences\MessageBreak
                  up to \font@submax\space have occurred.\@gobbletwo}%
       \ifx \@multiplelabels \relax
           \@latex@warning@no@line{Label(s) may have changed.
               Rerun to get cross-references right}%

Note that the \newlabel is written with 5 arguments. However, arguments 3, 4 and 5 are empty. This is to accommodate regular, non-hyperref \labels which only require two arguments, as well as when hyperref is loaded (which writes \labels with 5 arguments).

This LastPage reference is used in the footer throughout the document via this macro (line 425):

\newcommand*\aa@pageof{, page \thepage{} of \pageref{LastPage}}

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:

\renewcommand*\aa@pageof{, page \thepage{} of \pageref*{LastPage}}

Alternately, make all \pagerefs default to hyperlink-less references:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.