Equations in doxygen

倖福魔咒の 提交于 2019-12-07 09:31:48

问题


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?


回答1:


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>



回答2:


Instead use

\f$ x=2 \f$

which would output an inline math formula.

Reference: Doxygen Including formulas




回答3:


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.



来源:https://stackoverflow.com/questions/27257282/equations-in-doxygen

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!