Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.