TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The varioref package can also cite page ranges by defining a reference to 2 different labels with \vpagerefrange. I did not find information about an option which allows to typeset

  • "5-6" as "5f"
  • and every range spanning more than 2 pages to "5ff"

Is there a package or an option which allows to do that automatically?

share|improve this question
Take a look at the latest development version of cleveref. – Martin Schröder Oct 19 '11 at 6:38
up vote 8 down vote accepted

The varioref package provides \vrefpagenum{<macro>}{<ref>} which stores the page number of the given reference in the macro so that users can define their own vario-style macros. There is an example on page 2f ;-) of the manual.

Here an example implementation. The tests could be optimized a little more.




    \if ?\@tempa\else
    \if ?\@tempb\else
            \@tempa f%
            \@tempa ff%


i-vi: \vrefff{i}{vi}

i-ii: \vrefff{i}{ii}

ii-iii: \vrefff{ii}{iii}

iii-ii: \vrefff{iii}{ii}

i-i: \vrefff{i}{i}

iii-vi: \vrefff{iii}{vi}



Results in:

i-vi: 1ff
i-ii: 1f
ii-iii: 2f
iii-ii: 2f
i-i: 1
iii-vi: 3ff
share|improve this answer

Your Answer


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.