# hyperref using ref: How can I avoid the section number

perf~\ref{soft_reset_perf}

\phantomsection
\item[perf]:~\label{soft_reset_perf} Indicates that a soft reset has been performed.


It shows next to 'perf' the section number. How can I just get a link without section number?

With ~\nameref{soft_reset_perf} I get the name of the section in which the label is defined. I want the item name ('perf' in this case) to be displayed instead of the section name.

-

## migrated from stackoverflow.comDec 7 '11 at 16:02

This question came from our site for professional and enthusiast programmers.

If you want to refer to an item in a list why don't you simply use cross-reference by \ref? –  N.N. Dec 7 '11 at 11:59
Welcome to TeX.sx chandras! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Dec 7 '11 at 17:54

Here is one alternative to achieve your output. Since you're after referencing the name of a label, using a sectional unit is ideal.

In the example below, I've defined \Item to be similar to \paragraph (it is set at the "paragraph level" with some spacing adjustments) in the sense that it is now a sectional unit. As such, using \label{<lab>} and \nameref{<lab>} works as expected:

\documentclass{article}
\usepackage{nameref}% http://ctan.org/pkg/nameref
\makeatletter
\newcommand\Item{\@startsection{paragraph}{4}{-2em}%
{0pt}%
{0pt}%
{\normalfont\normalsize\bfseries}}
\makeatother
\begin{document}

\begingroup
\Item{perf}:~\label{soft_reset_perf} Indicates that a soft
reset has been performed. Here is some more text. Here is some
more text. Here is some more text. Here is some more text.
\Item{something}:~\label{something} This is just an interesting
item that will be referenced by name at a different location in
the document.\par
\endgroup
\end{document}


To mimic an itemize environment, I've typeset the \Item with a 2em negative indent (undent?). As such, to correct for horizontal shift, the left margin has been pushed right by 2em (by setting \leftskip). For help on the specific components in the definition of \Item, consider reading Where can I find help files or documentation for commands like \@startsection for LaTeX?

Although I've used nameref, it works just as well with hyperref.

-
\documentclass{article}
\usepackage{nameref}
\begin{document}