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'm trying to make a really basic reference.

Let's say I have theses lines in my document :

Lorem Ipsum ...
Lorem Ipsum ... [1] here ... Lorem Ipsum ...
Lorem Ipsum ...

I want to anywhere in my document make a reference to [1] here.

I thought it would be simple to find out but I searched for too long and I got confused with all the sets and making a simple reference now seems to be like rocket-science to me.

I want the following result :

enter image description here

When clicking on the colored number 1, the line [1] here get at the top of my document viewer so the user feels easy to find the line directly.

share|improve this question
up vote 7 down vote accepted

The hyperref package provides the pair of commands


for the creation of cross-references that are independent from counters. They are analogues of \label and \ref, respectively. Here's an example:




Go to the \hyperlink{lip}{second}, or  \hyperlink{lipsys}{third} paragraph.
The first hyperlink brings you \hypertarget{lip}{here.}
The second hyperlink brings you \hypertarget{lipsys}{here.}


On the other hand, if you wish associate cross-references to a counter, you can try using the following declarations:







Go to \ref{lipsys}, and \ref{lip}.
The second hyperlink brings you \foo{lip} here.
The first hyperlink brings you \foo{lipsys} here.


In the example above, \foo{<key>} (1) globally increments the counter bar, (2) maps the key to the current reference string, and (3) prints the value of bar. \textcolor{black}{...} is used to override the formatting applied by the hyperref package (otherwise it's typeset in the same colour as the counter).

enter image description here

share|improve this answer
perfect ! thank you, it was not that hard finally and now my document has the look I want, Regards~ – 발렌탕 Mar 2 '13 at 21:05
and +1 for the counter solution – 발렌탕 Mar 2 '13 at 21:09

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.