TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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}


share|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
Okay, thanks a lot. :) – Thomas Feb 23 '13 at 20:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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