1
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.

Werner
  • 603,163

2 Answers2

1

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:

enter image description here

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

For more information, see~\nameref{soft_reset_perf} or~\nameref{something}.

\begingroup \setlength{\leftskip}{2em}% Correct for \Item adjustment \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.

Werner
  • 603,163
0
\documentclass{article}
\usepackage{nameref}
\begin{document}

For more information, see~\nameref{soft_reset_perf} or~\nameref{something}.

\paragraph{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.
\paragraph{something}:~\label{something} This is just an interesting 
  item that will be referenced by name at a different location in 
  the document.

\end{document}

enter image description here