# Using Description Environment Titles

This is related to the question asked in Using Description environment with cleveref. I wonder if there is a clean solution to reuse titles of items in the description. E.g. given the following piece of latex:

\begin{description}
\item[TEST\label{itm:test}] test
\end{description}


I need some macro descriptionTitle such that \descriptionTitle{itm:test} produce TEST. I do not mind TEST to be a reference to this description item, but I do not want to replace TEST and others each time someone comes up with a better name than TEST.

Thanks a lot!

You can use hyperref and define a marker called \namedlabel:

\documentclass{article}

\usepackage{float}
% definition of environment
\floatstyle{plain}
\newfloat{statement}{tbhp}{los}[section]
\floatname{statement}{Statement}

\usepackage{hyperref}
% definition of named label
\makeatletter
\def\namedlabel#1#2{\begingroup
#2%
\def\@currentlabel{#2}%
\phantomsection\label{#1}\endgroup
}
\makeatother

\begin{document}

\section{Statements with float}

\begin{statement}[ht!]

\begin{description}
\item[\namedlabel{state1}{Statement 1}] This is the first statement.
\item[\namedlabel{state2}{Statement 2}] This is the second statement.
\item[\namedlabel{state3}{Statement 3}] This is the third statement
\end{description}

\caption{Statements}
\label{state:example}
\end{statement}

Reference to whole thing: See Statements \ref{state:example}.

Reference to a single statement: See  \ref{state2}.

Note that if you refer to the float you get only the number, but if you refer to the description item itself you get the whole label.

\section{Statements without float}

\begin{description}
\item[\namedlabel{state4}{Statement 4}] This is the fourth statement.
\item[\namedlabel{state5}{Statement 5}] This is the fifth statement.
\end{description}

See \ref{state4}.

\end{document}


I put the float environment that I created along with this (with the float package), but as you can see in the second section it works fine without it.