3.14.1.9. sphinx.ext.pngmath.render_math

sphinx.ext.pngmath.render_math(self, math)[source]

Render the LaTeX math expression math using latex and dvipng.

Return the filename relative to the built document and the “depth”, that is, the distance of image bottom and baseline in pixels, if the option to use preview_latex is switched on.

Error handling may seem strange, but follows a pattern: if LaTeX or dvipng aren’t available, only a warning is generated (since that enables people on machines without these programs to at least build the rest of the docs successfully). If the programs are there, however, they may not fail since that indicates a problem in the math source.