I would like to include links/reference points in my latex document, e.g.

Picture showing 3 pages and a link from page 3 to page 1

The situation is the following:

There is a certain paragraph on, say page 11, and on page 13 there is a link and when the reader clicks this link (which does not necessarily have to be blue) then the reader is taken to the desired paragraph on page 11.

And I imagined my code to look like this:

Lie groups are smooth manifolds
Lie algebra.

\CreateLink{LabelLie}{Paragraph about Lie groups}
Lie groups play an enormous role in modern geometry, 
and are studied in representation theory.

In the 1940s–1950s, Ellis Kolchin, Armand Borel
in number theory.

On a "global" level, whenever a 
analysis on the manifold.  (see \LinkTo{LabelLie})

Is such a construction possible?


There are several methods in hyperref:

  • \hypertarget and \hyperlink can be used to create an anchor and a link to that anchor.
  • \phantomsection\label{foo} can be referenced with arbitrary text as \hypererf[foo]{arbitrary text}.
  • The following example uses \refstepcounter that automatically sets an anchor. By redefining \the<counter> the text is setup for later use with \ref:

The example file:


      % raise the anchor above the base line in horizontal mode

\CreateLink{nam}{Paragraph about nam dui ligula}
See \LinkTo{nam}


|improve this answer|||||
  • May I just ask what the line \renewcommand*{\thepartextdummy}{#2}% does ? – Thomas Feb 23 '13 at 17:20
  • \refstepcounter{<counter>} advances the counter by one and \label will use \the<counter> for the referenced number that \ref refers to. \renewcommand*{\the<counter>}{#2} replaces that number with #2. – Heiko Oberdiek Feb 23 '13 at 17:29
  • I am not a latex pro, but couldn't I run the risk of overwriting another command each time I use \CreateLink ? – Thomas Feb 23 '13 at 19:57
  • \CreateLink is defined by \newcommand that complains, if the command already exists. The redefinition of \thepartextdummy is local (because of \begingroup and \endgroup) and the command belongs to the counter partextdummy. – Heiko Oberdiek Feb 23 '13 at 20:14

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.