I am using Sphinx to write some notes. I am using the Mathjax extension for Math in the notes. The default size of the math is little larger than I would like. On the Mathja
In Sphinx 3.0 and later, the easiest way to add short snippets of JavaScript configuration is to call app.add_js_file(None, body="...JS code...") in your conf.py setup function. Example:
# In your Sphinx project's conf.py:
# 1. Add whatever JS code you need as a string constant.
# (This example is from the original question.)
MATHJAX_CONFIG_JS = """
MathJax.Hub.Config({
"HTML-CSS": {scale: 90}
});
"""
# 2. Create a setup() function if you don't already have one.
# (If you do, just add to your existing setup() function.)
def setup(app):
# 3. Tell Sphinx to add your JS code. Sphinx will insert
# the `body` into the html inside a