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 have a table with many entries and I want to reference the key so another person can quickly look up what the key means.

Here is some pseudocode:

snippet1\label{?key1} & longexplanatory text
snippet2\label{?key2} & longexplanatory text
snippet3\label{?key3} & longexplanatory text

connect \ref{key1} with \ref{key13}

After compilation I want the text to read

connect snippet1 with snippet3

The reader should be able to quickly jump to the table when clicking on snippet-N.

share|improve this question
up vote 4 down vote accepted

The following uses \refstepcounter (instead of the internal \@currentlabel) of a dummy counter to make the text to something that can be referenced. \raisebox moves \refstepcounter a bit to move the anchor position, if package hyperref is used. At the place of \refstepcounter hyperref sets the anchor.



\keylabel{snippet1}{key1} & longexplanatory text\\
\keylabel{snippet2}{key2} & longexplanatory text\\
\keylabel{snippet3}{key3} & longexplanatory text\\

connect \ref{key1} with \ref{key3}


share|improve this answer

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.