I need special numbering for equations in my work, so I made it similar to figures numbering which egreg wrote here

This is my MWE:

\documentclass[12pt, a4paper, oneside, onecolumn]{article}
%numeriranje jednadžbe
  R' &= R/255 \\
  G' &= G/255 \\
  B' &= B/255

  C_{max} &= max(R', G', B') \\
  C_{min} &= min(R', G', B') \\
  \Delta &= C_{max} - C_{min}


It gives me this type of numbering, which is good, but the number of equation is wrong: wrong numbering on my MWE

If I use it in my document it looks like this: wrong numbering in document

The 2.1.2. part is fine, that's the number of my subsubsection, but the rest is wrong. It should be and Could you tell me what have I done wrong here?

  • 1
    you want {equation} not {figure} in each case, you are incrementing the equation counter then printing the figure one, change to print the equation counter Sep 14, 2013 at 18:33

1 Answer 1


There are two separate issues with the code in your MWE:

  • You need to affix \arabic{equation}, not \arabic{figure}, to the various redefinitions of \theequation. This has already been pointed out by David Carlisle. (This is why the first couple of equation numbers terminate in .0. My guess is that your document has two figure environments prior to the second batch of equations you show; it's the most straightforward explanation of why the final digit of both equation numbers is stuck at .2.)

  • You're missing the following statements (adapted from @egreg's earlier answer):


If you don't include these commands, the final digit of the composite equation "number" will happily increase from 1 to 2 to 3 and so on regardless of the sectioning level the equations happen to be in.

An off-topic comment: Don't typeset "max" and "min" in plain math-italic mode. Use \max and \min where they occur as math operators, and write C_{\textup{max}} and C_{\textup{min}} for the subscript instances. If you have a lot of those instances, you define some macros in the preamble, say \newcommand{\Cmax}{C_{\textup{max}}}, and use \Cmax throughout the document.

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.