[Tugindia] Problem with amsmath and varioref.

Manoj Kummini tugindia@tug.org
Wed, 8 Jan 2003 08:41:35 +0000 (GMT)


See you code. The problem arises because you use \vref inside the
equation environment. (Do you write eq-12 the way you have written? I
thought that the phrase inside the \textrm should be outside the
equation. Does anyone know what the accepted style is?)

Here is what happens inside, and why the problem vanishes when you
use eqnarray.

In amsmath.sty, equation is defined using mathdisplay which defines
\label to be \label@in@display. It checks \df@label, and if that is
not \@empty, the said error comes. \vref uses \label internally, and
any use of \label (i.e, \label@in@display, inside mathdisplay for
amsmath) sets \df@label. At the beginning of the equation, \df@label
is set to \@empty. This prevents you from using multiple labels in
equation environment. The \label that you gave caused the error. The
problem will arise even if you reverse the order of \vref and \label.
See the aux file for the additional \newlabel commands written by
\label@in@display. This will become clear if you put a few
\makeatletter\df@label\makeatother at different points in the code.

The environment eqnarray is not defined using mathdisplay. 

With regards,

 --- "S. venkataraman" <svenkat@ignou.ac.in> wrote:

> ! Package amsmath Error: Multiple \label's: label '4@vr' will be
> lost.
> [...]
> l.18 ...rm{using eqn.(\vref{eq-11})}\label
>                                           {eq-12}
> [...]
> %%%%%%%%%%%%%%%%%%%beginning of the file%%%%%%
> \documentclass{article}
> [...]
> \begin{equation}f\left(\vt{31}\right)=8\textrm{ and }
>   f\left(\vt{32}\right)=12\textrm{using
> eqn.(\vref{eq-11})}\label{eq-12}
> \end{equation} 
> \end{document}

Manoj Kummini
12 deg 58 min N, 77 deg 35 min E

Missed your favourite TV serial last night? Try the new, Yahoo! TV.
       visit http://in.tv.yahoo.com