[Tex/LaTex] Changing the output of \vref

cross-referencingvarioref

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?

Best Answer

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

Related Question