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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.