[texhax] "variablke" formula numbers (in latex)

Victor Ivrii vivrii at gmail.com
Mon Jun 20 07:44:21 CEST 2005


Ok, I will try to clarify it.
Equation which is currently (6.3) (but I want to avoid any
hardnumbering there) is followed by equation which should be numbered
as $(6.4)_\pm$:
\begin{equation}
\addtocounter{equation}{1}
x_\pm = a \pm b
\tag*{$(\theequation)_\pm$}
\label{myequation}
\end{equation}
and this formula introduces $x_\pm$.

So far, so good. \ref{myequation} returns $(6.4)_\pm $ and properly changes if I
add or remove equations before equation in question.

However at some moment I want to wright
``$x_+$ defined by $(6.4)_+$''
but I do not want to hardnumber it.
========================

Actually I found a solution:
In preamble I put
\newenvironment{pseudoequation}[1][]{\refstepcounter{equation}}{}
-- 

and instead of the above I write

\begin{pseudoequation}\label{myequation}\end{pseudoequation}
\begin{equation}
x_\pm = a \pm b
\tag*{$(\theequation)_\pm$}
\label{myequationpm}
\end{equation}

Then \ref{myequationpm} returns $(6.4)_\pm$ but 
$(\ref{myequation})_+$ returns $(6.4)_+$
and this works fine with hyperref package as well

========================
Victor Ivrii, Department of Mathematics, University of Toronto



On 6/19/05, Konstantin Karapetyan <texnic at photonica.ru> wrote:
> Hello Victor,
> 
> I am afraid the question is not quite clear. Could you explain it in
> other words or, better, give a complete short example in LaTeX (a bad
> one) and say, in what way you would like it to be improved? Perhaps
> then texhax will be able to help.
> 
> Happy TeXing!
> 
> Konstantin.
> 
> 
> > I have a formula which is given by equation say
> > \begin{equation}
> > x_\pm = .....
> > \end{equation}
> > and which I would like to call $(6.7)_\pm$. Sometimes
> > I will refer to $(6.7)_\pm$ and sometimes to $(6.7)_+$,
> > or $(6.7)_-$. Is there a way to do it in the usual
> > \label - \ref way completely avoiding typing (6.7)?
> > Also I want it to be consistent with hyperref package
> 
> > Thank you in advance
> > --
> > ========================
> > Victor Ivrii, Department of Mathematics, University of Toronto
> 
> 
> 
> _______________________________________________



More information about the texhax mailing list