%%% $Id: vprettyref.sty,v 1.3 2004/08/12 14:08:04 oliver Exp $
%%% use as \vprettyref{} or better \vpref{} ro combine 
%%% varioref and prettyref.
\ProvidesPackage{vprettyref}[2004/07/31 v3.0]
\RequirePackage{varioref}
%% Code from prettyref v3.0
%% Copyright 1995,1998.  by Kevin Ruland kevin@rodin.wustl.edu
%% and patched with \vref:
\def\newvariorefformat#1#2{%
  \@namedef{variopr@#1}##1{#2}}
\newvariorefformat{eq}{\textup{(\ref{#1})}\vpageref[]{#1}}
\newvariorefformat{lem}{Lemma \vref{#1}}
\newvariorefformat{thm}{Theorem \vref{#1}}
\newvariorefformat{cha}{Chapter \vref{#1}}
\newvariorefformat{sec}{Section \vref{#1}}
\newvariorefformat{tab}{Table \vref{#1}}
\newvariorefformat{fig}{Figure \vref{#1}}
\def\vprettyref#1{\@vprettyref#1:}
\def\@vprettyref#1:#2:{%
  \expandafter\ifx\csname variopr@#1\endcsname\relax%
    \PackageWarning{prettyref}{Reference format #1\space undefined}%
    \vref{#1:#2}%
  \else%
    \csname variopr@#1\endcsname{#1:#2}%
  \fi%
}
\DeclareRobustCommand\vpref{\vprettyref}
