15

I am using the hyperref package, but I would like a way to use \ref without making it into a link (but not always). To give an example:

\documentclass[a4paper,10pt]{article}
\usepackage{enumerate}
\usepackage{hyperref}

\begin{document}

\section{Some section} \label{section}

The following is a list placed in Section~\ref{section}:
\begin{enumerate}[1]
    \item
        first list item
    \item \label{item}
        second list item
    \item
        third list item
\end{enumerate}
From my point of view the most interesting is part of this list is part \ref{item}.
\end{document}

My situation is something like this: I would like hyperref to make a link to the section when I write \ref{section}, but I do not want it to do so when refering to the label item, becuase the reference to this label will be place in the same place as the list, and if I refer a lot to the points in the list, then the text will be perforated with links, which looks stupid.

Is there a way to select which references are made into links?

1 Answer 1

13

This is documented in the hyperref manual.

Just use \ref* for those labels that you do not want to become links, eg \ref*{item}:

\documentclass[a4paper,10pt]{article}
\usepackage{enumerate}
\usepackage{hyperref}

\begin{document}

\section{Some section} \label{section}

The following is a list placed in Section~\ref{section}:
\begin{enumerate}[1]
    \item
        first list item
    \item \label{item}
        second list item
    \item
        third list item
\end{enumerate}
From my point of view the most interesting is part of this list is part \ref*{item}.
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .