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
To add to @Keta's answer since Aug 2018 and this commit (https://github.com/sphinx-doc/sphinx/pull/5230/files) you can use mathjax_config
in the conf.py according to the documentation (http://www.sphinx-doc.org/en/master/usage/extensions/math.html?#confval-mathjax_config)
So for example the following can be added,
mathjax_config = {
"TeX": {
"Macros": {
"RR": '{\\bf R}',
"bold": ['{\\bf #1}',1]
}
}
}