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've got a problem with the varioref package:

Whenever I want to refer to something that is on the same page as the reference, varioref normally printed something like 'X on this page' or 'X auf dieser Seite' (German) (X = number of label) , but today I tried to use varioref again (after I reinstalled MiKTeX because of an API 1113 Error or something concerning the update manager after an update -- fixed it \o/) and I only got 'X on page Y' (Y = page number) when the reference was on the same page as what I wanted to refer to. If there's something on the next or former page, the output is correct (e.g. 'X on the previous page').

Here's a (hopefully more or less) minimal example:

\documentclass[english]{article}
\usepackage{babel}
\usepackage{varioref} 
\begin{document}
\section{Bla}\label{bla}
Haha, \vref{bla}. {\reftextcurrent} \clearpage
Haha, \vref{bla}.
\end{document}

And what I get using pdfTeX is:

%%%%%%%%%%%% Page 1

1 Bla Haha, 1 on page 1. on this page

%%%%%%%%%%%% Page 2

Haha, 1 on the previous page.

(I only included the {\reftextcurrent} to see whether the text varioref normally used, might have been redefined accidentally. )

Does anyone have a solution to this problem?

share|improve this question
add comment

1 Answer 1

According to page 1 of the varioref documentation, \reftextcurrent is only used by the \vpageref command if label and reference fall on the same page -- \vref will only produce a \ref (i.e., the section number) in this case.

\documentclass[english]{article}
\usepackage{babel}
\usepackage{varioref} 
\begin{document}
\section{Bla}\label{bla}
Haha, \vref{bla}.
Haha, \vpageref{bla}.
\clearpage
Haha, \vref{bla}.
Haha, \vpageref{bla}.
\end{document}
share|improve this answer
    
Oh, OK, it seems I missed that, sorry (although I definitely read the documentation, I'm not that much of a noob), but be that as it may, what I get on the first page of the pdf from your example is: "Haha, 1 on page 1. Haha, on page 1." while I should get "Haha, 1. Haha, on page 1.", shouldn't I? –  Lustique Jul 30 '11 at 22:41
    
Well, I get "Haha, 1. Haha, on the current page." Package versions: babel 3.8l, varioref 1.4w. –  lockstep Jul 30 '11 at 22:47
    
Hmmm, I've got babel 3.8m and varioref 1.4y. It shouldn't be a matter of actuality then... This is kinda odd. –  Lustique Jul 30 '11 at 23:09
    
To the contrary: I'm using TeXlive 2011, but for whatever reason this TeX distribution shipped with an old version of varioref (!). It may well be that something broke in the newer version. –  lockstep Jul 30 '11 at 23:15
1  
I just made an interesting observation: If I also load hyperrefin addition to (and after) varioref, the output is right: No mention of the page number if the object of interest is on the same page as the reference, just like it should be. Or is this a feature of hyperref itself? I normally don't use it and loaded it as is (\usepackage{hyperref}). –  Lustique Aug 7 '11 at 16:51
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.