6

I am trying to modify the equation numbering as follows

\renewcommand{\theequation}{FFF(\arabic{SomeCounter}).\arabic{equation}},

where SomeCounter is a counter defined as \newcounter{SomeCounter} and FFF(x) is a simple arithmetic function. Specifically, FFF(x) = 2 * x+1.

I know there are several packages such as calc and calculator but I could not find a way to use them in this context. Please give me some advice.

7

TeX has limited arithmetic capabilities; in this simple case you can say

\renewcommand{\theequation}{%
   \the\numexpr 2*\value{SomeCounter}+1\relax.\arabic{equation}%
}

More complex functions could be used, with more complex methods.

  • Exactly what I am looking for. – Sungmin Apr 2 '15 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.