Thursday, 22 August 2013

Hyperref and lineno: allways jumping to first page

Hyperref and lineno: allways jumping to first page

I have a document where lines are numbered. I want to reference some
special lines, for which the correct line numbers are generated. But using
hyperref does not give the expected result: clicking on a line reference
always moves me to the first page of the document, not the page which the
referenced line is on. Check the following minimal example for reproducing
my problem:
\documentclass[11pt]{article}
\usepackage{lipsum}
\usepackage{hyperref}
\usepackage[right]{lineno}
\begin{document}
\linenumbers
\lipsum[1-8]
\textbf{Here is the line, I want a reference to.}\linelabel{test}
\lipsum[5-8]
\textbf{Here is the line, where I refence a the special line (on page two):
\ref{test}}
\end{document}
I'm using pdflatex.

No comments:

Post a Comment