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 currently developing a doclet which translates javadoc to LaTeX.

I'm compiling the LaTeX document using pdflatex with a sty file I have from my school it generates a PDF document with links (red box) for all references this means that a I don't need the chapter.section representation
I'm generating a label for example


when I reference it I get something like 5.1.

How can I change it ?

share|improve this question
up vote 1 down vote accepted

It depends on what you exactly want. The nameref package (comes with hyperref) provides \nameref which gives the reference name instead of the number, e.g. the section title not the section number. There is also \autoref (hyperref package) which gives e.g. "Section 5.1".

For arbitrary link texts I would recommend to use \hypertarget and \hyperlink (both from hyperref) instead of \label and \ref.

There is also the zref package (written by the hyperref author) which gives you a lot of advanced cross-referencing options. See also the TeX FAQ Referring to things by their name.

share|improve this answer
Thanks \hyperref[label]{text} solved the problem – sherif Apr 9 '11 at 20:23

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.