For the following MWE hyperref complains that it can not find a target for the link, and thus does not create a link. What can I do to make it work?





Line~\ref{l:foo} on page~\pageref{l:foo}.
  • 1
    Does the code I posted at tex.stackexchange.com/a/129570/15925 help? – Andrew Swann Aug 22 '13 at 14:14
  • @AndrewSwann Hi Andrew, that is quite good! The other question is newer, but has an accepted answer, so I would not want to close it as duplicate. So I'd like to suggest that you give another answer here, maybe even proposing something for the nonworking \pageref. Acceptance guaranteed ;-) – mafp Aug 22 '13 at 22:54

The work-around I gave in Hyperref and lineno: always jumping to first page is easily extended to page references via a new command \lpageref:

Sample output





Finally, we reference line \lref{test} on page~\lpageref{test}.

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.