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.

Possible Duplicate:
Can individual items in an itemize list be labelled and hyperref linked?

\documentclass[11pt,a4paper]{article}
\usepackage[colorlinks=true]{hyperref}
\begin{document}
\ref{itm:tre} 
\section{Referenser}
\begin{itemize}
\item \label{itm:tre} item number three
\end{itemize}
\end{document}

Why does it refer to the section and not the item? I want the reference marker to be [3] with a red three, and [3] with black three at the itemlist. Any suggestions?

share|improve this question

marked as duplicate by lockstep, Stefan Kottwitz Nov 20 '12 at 12:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
itemize is non-numbered, so the items can't be referenced. You want enumerate. More precisely, please read the documentation on bibliographies. –  Stephan Lehmke Nov 20 '12 at 11:51
    
I tried enumerate instead of itemize and still the same issue. Do you mean I should use another package? This seems kind of standard shouldn't it work the way I tried with something that counts as list or item? –  kuke Nov 20 '12 at 12:01
    
@kuke Please update your MWE to enumerate. It's nearly inconceivable it doesn't work this way. Furthermore, instead of constructing a bibliography by hand like this, it's way better to use the dedicated LaTeX constructs. Please please read the manual. –  Stephan Lehmke Nov 20 '12 at 12:37

1 Answer 1

You can use \phantomsection to add an anchor for hyperref. But the number printed by the \ref will still be the number of the section:

\documentclass[11pt,a4paper]{article}
\usepackage[colorlinks=true]{hyperref}
\begin{document}
\ref{itm:tre}
\section{Referenser}
\newpage %to better see the target of the link
\begin{itemize}
\item \phantomsection\label{itm:tre} item number three
\end{itemize}
\end{document}
share|improve this answer
    
Ops misclick... –  kuke Nov 20 '12 at 12:32

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