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 think I may have found a bug in either hyperref, cleverefoder varioref but can't determine the details any further. If do not load hyperref in the following example, the result is fine.

\documentclass[ngerman]{scrartcl}

\usepackage{babel}
%\usepackage{hyperref}
\usepackage{varioref}
\usepackage{cleveref}

\begin{document}

\section{Erster Abschnitt}\label{sec}

\begin{figure}
\rule{\textwidth}{1cm}
\caption{bild}\label{bild}
\end{figure}

Siehe \vref{sec}, siehe \vref{bild}

\end{document} 

good results without hyperref

If I load hyperref the reference reference to the section cannot be expanded, I get the following error instead:

! Argument of \@fourthoffive has an extra }.
<inserted text> 
                \par 
l.19 Siehe \vref{sec}
                     , siehe \vref{bild}
? 

bad results with hyperref

Any idea from which package this error may result?

share|improve this question
3  
for future reference which-packages-should-be-loaded-after-hyperref-instead-of-before –  cmhughes Apr 25 '12 at 9:04
    
also very closely related Difference between ref, varioref and cleveref. Decision for a thesis –  cmhughes Mar 1 '13 at 5:11
add comment

1 Answer

up vote 26 down vote accepted

Load varioref first, then hyperref, then cleveref. See section 12.1 of the cleveref manual.

\documentclass[ngerman]{scrartcl}

\usepackage{babel}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}

\begin{document}

\section{Erster Abschnitt}\label{sec}

\begin{figure}
\rule{\textwidth}{1cm}
\caption{bild}\label{bild}
\end{figure}

Siehe \vref{sec}, siehe \vref{bild}

\end{document}

enter image description here

share|improve this answer
add comment

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.