4

I like that hyperref gives me results like

\ref{eq:first-equation}   % yields "equation (1)"

and that varioref gives results like

\vref{eq:first-equation}  % yields "1 on the following page"

but I would like even more if the resulting vref yielded "equation (1) on the following page," to distinguish from tables, etc.

Is there any way to get this to happen?

My current preamble includes

% ...
\usepackage{varioref}
\usepackage{refstyle}
% ...
\usepackage[unicode=true]{hyperref}
% ...

in this order, if it matters.


When I remove refstyle and switch it out for cleveref, all of my \eqrefs break. For example

\eqref{4-range-of-validity}

used to produce equation (8) but now produces (??).

4

Do not use refstyle; instead, load (in that order!) the varioref, hyperref, and cleveref packages in the preamble and use \vref in the text body. (For cross-references without page information, use \cref instead of \ref.)

\documentclass{article}

\usepackage{varioref}
\usepackage{hyperref}
\usepackage[noabbrev]{cleveref}

\begin{document}

Some text. See \vref{eq:test}.

\clearpage

\begin{equation}\label{eq:test}
a^2 + b^2 = c^2
\end{equation}

\end{document}

enter image description here

  • Okay, but now my normal \ref{eq:test} is just showing (1), not equation (1); how do I fix this? – wchargin Dec 16 '13 at 23:54
  • Also \vref{eq:test} produces equation (??) on the preceding page for me – wchargin Dec 16 '13 at 23:54
  • @WChargin Ad 1: See the last sentence of my answer. Ad 2: Without a minimal working example, I can't say what's going on. – lockstep Dec 17 '13 at 11:02

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.