Creating LaTeX math macros within Sphinx

后端 未结 5 776
梦谈多话
梦谈多话 2020-12-14 11:03

I\'m writing some mathematical code in Python and using Sphinx to produce the documentation. I know that Sphinx can handle LaTeX code in Python docstrings; see https://www.s

5条回答
  •  醉话见心
    2020-12-14 11:31

    If you're using the pngmath extension, you can put that in the preamble by inserting this into the conf.py script:

    pngmath_latex_preamble = r"\newcommand{\cG}{\mathcal{G}}"
    

提交回复
热议问题