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

Please take a look at the following LaTeX code. How can I get the text of a \hypertarget?

\newcommand{\Req}[1]{(\hyperlink{#1}{%text of hypertarget%})}


This is a requirement \newReq{req1}. This is the same requirement as \Req{req1}.


This is a requirement (R1). This is the same requirement as (R1).

share|improve this question

migrated from stackoverflow.com Jun 23 '13 at 13:05

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.SX! Your post was migrated here from another Stack Exchange site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Marco Daniel Jun 23 '13 at 13:08

Use the regular \label-\ref system in the following way:

enter image description here

Example: This is a requirement~\newReq{req1}. This is the same requirement as~\Req{req1}.

Depending on the use case, there may be more optimal ways of dealing with this.

share|improve this answer
And where can I find documentation on more optimal ways? I'm about desperate enough to ask a new question ... – user1129682 Aug 9 '14 at 12:08

Your Answer


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