1

Is is possible to number automatic number equations in doxygen markdown documentation?

Example:

page1.md:

This is Equation 1:

\f[
\label{Eq:1}
\bbox[Pearl, 10px,border:1px solid black]
{
    \rho = \frac{m}{V}
}
\f] 

If I put a \tag{#numberOfTheEquation} I will get the number.

But has you build the document it is very inconvenient to change every equation number if one inserts a new equation in the middle of the document.

Best Regards!

Manuel Oliveira
  • 527
  • 5
  • 19
  • Which version of doxygen? Using fixed numbers is of course not a good idea what is your output format? – albert Jul 26 '21 at 09:52

1 Answers1

2

When we have a file like:

/** \file

# Math references

\f{equation}{
\alpha = \beta * \gamma
  \label{eq:my_system}
\f}

The reference: \f$\eqref{eq:my_system}\f$

*/

We can use a Doxyfile like:

USE_MATHJAX = YES
EXTRA_PACKAGES = amsmath amssymb
MATHJAX_EXTENSIONS     = amssymb amsmath
MATHJAX_CODEFILE       = mycode.js

with mycode.js:

MathJax.Hub.Config({
  TeX: { equationNumbers: { autoNumber: "AMS" } }
});

This will result in:

enter image description here

albert
  • 8,285
  • 3
  • 19
  • 32
  • Based on your question I also looked at the output in case MathJax was not used and here the reference was `??` instead of `1`. For this I've just pushed a proposed patch to github (pull request 8691, https://github.com/doxygen/doxygen/pull/8691). – albert Jul 26 '21 at 11:24