Cheers, Herbert. You pointed me in the right direction
again. I've tried to generalise your suggestion so that I
need not keep a reference of the actual equation numbers.
The LaTeX Companion by Goosens et al. describes a package
"calc" on page 468 that allows arithmetic to be performed
on \setcounter type commands. For example:
\setcounter{equation}{\value{equation}-1}
decrements the equation counter by 1.
The attached .lyx file has a little more ERT (some of this
--- the \newcounter commands --- could be hidden in LaTeX
Preamble?), but it gets the equation numbering correct.
Thanks again for your help.
Angus
On Thu, 27 Jan 2000, you wrote:
> >%_Angus Leeming wrote:
> >
> > I have a question about equation numbering.
> > Suppose I have an equation that I've labelled:
> >
> > x^2+y^2=r^2 (eq:circle)
> >
> > Later in text I want to print it out again, WITH THE SAME
> > EQ. NUMBER so:
> >
> > x^2+y^2=r^2 (eq:circle)
> >
> > Unfortunately, this does not work. LaTeX gives the second
> > equation a new number. What to do?
#LyX 1.1 Copyright 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass article
\begin_preamble
\usepackage{amsfonts}
\usepackage{calc}
\end_preamble
\language default
\inputencoding latin1
\fontscheme default
\graphics default
\paperfontsize default
\spacing single
\papersize a4paper
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 1
0
9
-1
\end_bullet
\bullet 2
1
31
-1
\end_bullet
\layout Standard
\latex latex
\backslash
newcounter{circlecounter}
\layout Standard
\latex latex
\backslash
newcounter{tempcounter}
\layout Standard
A dummy equation to get things started:
\layout Standard
\begin_inset Formula
\begin{equation}
\label{eq:Einstein}
E=mc^{2}
\end{equation}
\end_inset
\layout Standard
The equation we wish to refer to later in the document:
\layout Standard
\begin_inset Formula
\begin{equation}
\label{eq:circle}
x^{2}+y^{2}=z^{2}
\end{equation}
\end_inset
\layout Standard
\latex latex
\backslash
setcounter{circlecounter}{
\backslash
value{equation}-1}
\layout Standard
Now any text like
\begin_inset Quotes eld
\end_inset
bla, bla, bla, bla
\begin_inset Quotes erd
\end_inset
and another equation:
\begin_inset Formula
\begin{equation}
\label{eq:sin}
sin(x)\approx tan(x)\qquad x\ll 1
\end{equation}
\end_inset
\layout Standard
the earlier equation, once again with correct equation number:
\layout Standard
\latex latex
\backslash
setcounter{tempcounter}{
\backslash
value{equation}}
\layout Standard
\latex latex
\backslash
setcounter{equation}{
\backslash
value{circlecounter}}
\layout Standard
\begin_inset Formula
\begin{equation}
\label{eq:circle}
x^{2}+y^{2}=z^{2}
\end{equation}
\end_inset
\layout Standard
\latex latex
\backslash
setcounter{equation}{
\backslash
value{tempcounter}}
\layout Standard
and a new equation, correctly numbered:
\begin_inset Formula
\begin{equation}
\label{eq:newone}
y=f(x)
\end{equation}
\end_inset
\the_end