views:

37

answers:

1

I'd like to refer to a description list item by name instead of number. To that effect, I've added labels to each item, but when referencing them I only get the name of the section, not of the list item. How can I change it to show a custom label for each item?

\section{Definitions}
\begin{description}
    \item [Vehicle\label{itm:vehicle}] Something
    \item [Bus\label{itm:bus}] A type of \nameref{itm:vehicle}
    \item [Car\label{itm:car}] A type of \nameref{itm:vehicle} smaller than a \nameref{itm:bus}
\end{description}

The result is something like this:

1 Definitions

Vehicle Something
Bus A type of Definitions
Car A type of Definitions smaller than a Definitions

I'd like to have the following:

1 Definitions

Vehicle Something
Bus A type of Vehicle
Car A type of Vehicle smaller than a Bus

An alternative solution would be to use subsections and display them as a definition list. Anyone know how to do it?

+1  A: 

This might be trickier than it sounds. This question is in a similar vein and the answer there was disappointingly longwinded. You'd have thought it would be easier... The same \namedlabel approach that worked there might work here?

Seamus
Excellent - Do you by any chance know how to avoid the duplication in `\item [Object\namedlabel{itm:object}{Object}] foo` if the label name is always the same as the description list item name?
l0b0