title: Creating LaTeX math macros within Sphinx
body: <p>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 <a href="https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathbase" rel="nofollow noreferrer">https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathbase</a>. How can I create LaTeX macros, such as <code>\newcommand{\cG}{\mathcal{G}}</code>, to use in the Python docstrings?</p>