Hi, The document of mathjax says the configurations should be placed inside <script type="text/x-mathjax-config">. But your example adds it as text/javascript. I guess it is wrong way. https://docs.mathjax.org/en/latest/configuration.html#using-in-line-configuration-options
BTW, Sphinx-1.8 starts to support the configuration via `mathjax_config`: https://www.sphinx-doc.org/en/master/usage/extensions/math.html?highlight=math#confval-mathjax_config How about using it instead? Thanks, Takeshi KOMIYA 2018年11月1日(木) 20:15 John Kendrick <jandh.kendr...@gmail.com>: > > Hi, > I am using some macros in my maths blocks and it was working succesfully. > However I am not seeing some of the maths not being shown correctly. If I > remove the async parameter from the html <script which load MathJax.js. Then > the maths is displayed correctly. I am assuming that loading MathJax > asynchronously means that when my macro definitions are read MathJax is not > initialised properly yet. > Has any any suggestions as to how to proceed? > > In my conf.py file I have; > > preamble = r''' > \usepackage{svg} > \usepackage{hyperref} > \usepackage{bm} > \usepackage{float} > \usepackage{parskip} > \usepackage{amsmath} > \newcommand{\water}{H_{2}O} > \newcommand{\tensor}[1]{\bar{\bar{#1}}} > \newcommand{\tensorbs}[1]{\bar{\bar{\bm{#1}}}} > \newcommand{\tensorbf}[1]{\bar{\bar{\bm{#1}}}} > \newcommand{\fieldbf}[1]{\bar{\bm{#1}}} > ''' > extensions = [ > 'sphinx.ext.mathjax', > 'sphinx.ext.githubpages', > 'sphinxcontrib.bibtex', > 'cloud_sptheme.ext.table_styling', > ] > > There us a _static/mathjax.js file which contains; > MathJax.Hub.Config({ > TeX: { > extensions: ['AMSmath.js'] , > Macros: { > bm: ['{\\boldsymbol{#1}}', 1], > tensor: ['{\\bar{\\bar{#1}}}', 1], > tensorbs: ['{\\bar{\\bar{\\bm{#1}}}}', 1], > tensorbf: ['{\\bar{\\bar{\\bm{#1}}}}', 1], > fieldbf: ['{\\bar{\\bm{#1}}}', 1], > water: "\\H_{2}O" > } > } > }); > > > The html file has the following in it; > <script type="text/javascript" id="documentation_options" > data-url_root="./" src="_static/documentation_options.js"></script> > <script type="text/javascript" src="_static/jquery.js"></script> > <script type="text/javascript" src="_static/underscore.js"></script> > <script type="text/javascript" src="_static/doctools.js"></script> > <script async="async" type="text/javascript" > src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> > <script type="text/javascript" src="_static/mathjax.js"></script> > <script type="text/javascript" src="_static/mathjax.js"></script> > > I am not sure why my mathjax.js is included twice. But as I have said if I > remove async="async" from loading MathJax.js everything works properly. > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sphinx-users+unsubscr...@googlegroups.com. > To post to this group, send email to sphinx-users@googlegroups.com. > Visit this group at https://groups.google.com/group/sphinx-users. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users+unsubscr...@googlegroups.com. To post to this group, send email to sphinx-users@googlegroups.com. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.