I use org-mode to write documents that are both exported into PDF via latex and HTML.
I use the package siunitx to typeset numbers with si-units. It is a bit tedious to do but I got used to it (unless I figure out how to make this work under org-mode).
When I export to HTML the things written in the siunitx-syntax are exported as plain text. I found out that org-mode uses MathJax for its HTML export. There is a third-party extensions for MathJax that is supposed to export siunitx syntax correctly to HTML.
How do I get org-mode to use this third party extension when exporting via HTML?
UPDATE:
Using the suggestion from @Nick I pasted the code into my user.el file. The code appears correctly in the org-html-mathjax-template
variable. The HTML did not how the units correctly in a test file.
Looking at the HTML file, the script appears just before the </head>
and beginning of the document in this form:
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<script type="text/javascript">
<!--/*--><![CDATA[/*><!--*/
MathJax.Hub.Config({
// Only one of the two following lines, depending on user settings
// First allows browser-native MathML display, second forces HTML/CSS
jax: ["input/TeX", "output/HTML-CSS"],
extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js",
"TeX/noUndefined.js", "[Contrib]/siunitx/siunitx.js", "[Contrib]/mhchem/mhchem.js"],
tex2jax: {
inlineMath: [ ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"], ["\\begin{displaymath}","\\end{displaymath}"] ],
skipTags: ["script","noscript","style","textarea","pre","code"],
ignoreClass: "tex2jax_ignore",
processEscapes: false,
processEnvironments: true,
preview: "TeX"
},
TeX: {extensions: ["AMSmath.js","AMSsymbols.js", "[Contrib]/siunitx/siunitx.js", "[Contrib]/mhchem/mhchem.js"]},
showProcessingMessages: true,
displayAlign: "center",
displayIndent: "0em",
"HTML-CSS": {
scale: 100,
availableFonts: ["STIX","TeX"],
preferredFont: "TeX",
webFont: "TeX",
imageFont: "TeX",
showMathMenu: true,
},
MMLorHTML: {
prefer: {
MSIE: "MML",
Firefox: "MML",
Opera: "HTML",
other: "HTML"
}
}
});
/*]]>*///-->
</script>
@Nick also suggested to check the developer mode in the browser (Chromium on OSX in my case). However, I have no idea what to look for.
**UPDATE:*
Since MathJax is not hosted on its normal cdn.mathjax.org siunitx and mchem are not working (in addition to accesibility-menu.js ??). I am not able to solve the issue but this is as for as I got:
(setq org-html-mathjax-template
"
<script type=\"text/javascript\" src=\"%PATH\"></script>
<script type=\"text/javascript\">
<!--/*--><![CDATA[/*><!--*/
MathJax.Ajax.config.path['mhchem'] = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax-mhchem/3.2.0';
MathJax.Ajax.config.path['siunitx'] = 'http://rawgit.com/burnpanck/MathJax-siunitx/master/';
MathJax.Hub.Config({
jax: [\"input/TeX\", \"output/HTML-CSS\"],
extensions: [\"tex2jax.js\",\"TeX/AMSmath.js\",\"TeX/AMSsymbols.js\",
\"TeX/noUndefined.js\", \"[siunitx]/siunitx.js\", \"[mhchem]/mhchem.js\"],
tex2jax: {
inlineMath:[[\"\\\\(\",\"\\\\)\"] ],
displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"], [\"\\\\begin{displaymath}\",\"\\\\end{displaymath}\"] ],
skipTags: [\"script\",\"noscript\",\"style\",\"textarea\",\"pre\",\"code\"],
ignoreClass: \"tex2jax_ignore\",
processEscapes: false,
processEnvironments: true,
preview: \"TeX\"
},
TeX: {extensions: [\"AMSmath.js\",\"AMSsymbols.js\", \"[siunitx]/siunitx.js\", \"[mhchem]/mchem.js\"]},
showProcessingMessages: true,
displayAlign: \"%ALIGN\",
displayIndent: \"%INDENT\",
\"HTML-CSS\": {
scale: %SCALE,
availableFonts: [\"STIX\",\"TeX\"],
preferredFont: \"TeX\",
webFont: \"TeX\",
imageFont: \"TeX\",
showMathMenu: true,
},
MMLorHTML: {
prefer: {
MSIE: \"MML\",
Firefox: \"MML\",
Opera: \"HTML\",
other: \"HTML\"
}
}
});
/*]]>*///-->
</script>"
)
Any idea how to get them running again? @Nick