I am including amsmath in my doxygen and I wrote:
\f{equation}{
x=2
\f}
but the result in the doxygen is
\begin{equation} x=2 \end{equation}
rather than the equation
x=2
Does anyone know what going wrong?
I am including amsmath in my doxygen and I wrote:
\f{equation}{
x=2
\f}
but the result in the doxygen is
\begin{equation} x=2 \end{equation}
rather than the equation
x=2
Does anyone know what going wrong?
You are doing it correctly, I do that and it works. The page briefly shows \begin{equation} x=2 \end{equation}
and then the correct equation appears.
Double check that you have USE_MATHJAX = YES
in your config file. The default is NO
See: USE_MATHJAX in the Doxygen reference.
If not set to YES
the page displaying the equation might not include the mathjax scripts (I haven't checked):
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
Instead use
\f$ x=2 \f$
which would output an inline math formula.
Reference: Doxygen Including formulas
I decided to put add some new information to this question as it is 2019 and there is a more easy way to enable MathJax.
When using the Doxygen GUI frontend, You can enable MathJax in the "expert" tab under HTML. By default this will include a CDN. To point to your own downloaded version of MathJax you can set MATHJAX_RELPATH
.