1

Possible Duplicate:
Reference plain text

I want to reference an item in a description, without actually displaying the text of the specific item.

I have a description with labeled items

\begin{description}
    \item[House\label{bld:house} is a building] \hfill \\
    A house is a building...
\end{description}

And I would want to use something like this

House\ref{bld:house} is something I don't own.

So that the output looks like this

House is something I don't own.

But instead I get this

House is a building is something I don't own.

So it references the whole text within the item. How would I just have a reference with my own individual text, like in HTML (Google)?

And for some reason when I click on the reference it only jumps to the nearest section, but not exactly to the item.

David Carlisle
  • 757,742
cherrung
  • 3,759

2 Answers2

2

I'm not sure if I understand your question correctly, but I think you are using the hyperref package to make hyperlinks in the pdf output? In that case, you can use the \hyperref command to make an HTML-style link to a label. As with HTML you need to specify what text is supposed to be clickable. Does the following code do what you intended? In my pdf viewer, evince, when I click on the word House it correctly jumps to the item in the description list.

\documentclass[11pt]{article}
\usepackage{hyperref}
\begin{document}
\begin{description}
    \item[House\label{bld:house} is a building] \hfill \\
    A house is a building...
\end{description}
\hyperref[bld:house]{House} is something I don't own.
\end{document}
David Carlisle
  • 757,742
yori
  • 5,681
  • 29
  • 59
0

It "works" for me, in the sense that the output I get is:

House is something I don't own.

Since you didn't have hyperref in your example code, I didn't load it. Perhaps what you have is come conflict with hyperref?

JohnD
  • 2,239
  • 3
  • 21
  • 24