I have a counter called LCount
, which I want to use in some text, and i would like to be able to reference numbers that are relative to that counter. for example, I would like this LaTeX code:
For the regular languages:
\begin{align*}
&L_\theLCount = L((a|b^*)cc^*a^*(c|b^*)^*)\\\stepcounter{LCount}
&L_\theLCount = L(ac^*c(a^*|b)^*)\stepcounter{LCount}
\end{align*}
If $L_\theLCount = L_{\theLCount-2} \cap L_{\theLCount-1}$, then:
to render like this:
if LCount
has an initial value of 2. Is there a way of doing this? Should I be using something different other than counters? I know i can use \addtocounter a bunch of times and make the final line:
If $L_\theLCount = \addtocounter{LCount}{-2} L_\theLCount \cap \addtocounter{LCount}{1} L_\theLCount$\stepcounter{LCount}, then:
but that seems really clumsy and inefficient. Is there a better way?
refstepcounter
and labels, but it seems that there is some clash with equation labelling... see also tex.stackexchange.com/questions/21300/…