4

I'm using \vref for labels in my text. I'd like to change it in the output form X on p. Y instead of X on page Y. How can I do it?

6

It seems you are using the varioref package. You have to redefine \reftextfaraway. Solution without babel:

\documentclass[twoside]{article}

\usepackage{varioref}

\renewcommand*{\reftextfaraway}[1]{on p.~\pageref{#1}}

\begin{document}

\section{foo}\label{sec:foo}

Some text.

\cleardoublepage

\section{bar}

See section~\vref{sec:foo}.

\end{document}

Solution with babel:

\documentclass[twoside]{article}

\usepackage[english]{babel}

\usepackage{varioref}

\addto\extrasenglish{%
  \renewcommand*{\reftextfaraway}[1]{on p.~\pageref{#1}}%
}

\begin{document}

\section{foo}\label{sec:foo}

Some text.

\cleardoublepage

\section{bar}

See section~\vref{sec:foo}.

\end{document}

Output for both solutions (page 3):

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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