Every now and then I use the description list environment
\begin{description}
\item[foo] foo is good
\item[bar] bar is bad
\end{description}
to create lists with non-numerical labels. Unfortunately the description list does not support the label-reference pair as normal latex: i.e. if I write
\begin{description}
\item[foo] \label{foo} foo is good
....
\end{description}
....
For good things (see, for example \ref{foo})...
the reference does not point to the item in the list. Instead it points to the closest environment that supports labeling (usually the subsection). So instead of showing the text foo (in boldface), it shows something like 2.2.1 (the subsection corresponding to where the description environment is sitting).
My question: is there a way or a package which allows references to description list items? My current work-around is to just type the text myself in the spot (since I named it myself, and it is not numbered, the formatting is unlikely to change the label =). But one of the good things about the label/reference pairs in latex is the implementation in pdflatex that allows in PDF hyperlinks between references and the objects referred to, this I cannot replicate myself.
Edit: let me rephrase my question. The primary goal is not to display \ref
to something other than what LaTeX thinks the \label
is. There are many ways to deal with it, some of which outlined in Michael Underwood's helpful answer below. What I am looking at is whether there exists an implementation of a list environment which is like the built-in description
environment in that the displayed "title" for the list item is completely customized, while having support for \label
s. (The built-in description
environment does not support \label
s, whereas the built-in enumerate
environment does not support customized "title"s.) The enumitem
package adds some customizability to the environments, but as far as I can tell it doesn't support exactly what I want.