DS-635 Add MathJax to Mirage2 theme

This commit is contained in:
Peter Dietz
2014-10-05 11:34:16 -04:00
parent 6e792e9e17
commit 699eca5ba2

View File

@@ -295,6 +295,33 @@
<meta name="{@element}" content="{.}"></meta>
</xsl:for-each>
<!-- Add MathJAX CDN to render scientific formulas -->
<xsl:if test="confman:getProperty('webui.browse.render-scientific-formulas') = 'true'">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
ignoreClass: "detail-field-data|detailtable"
},
TeX: {
Macros: {
AA: '{\\mathring A}'
}
}
});
</script>
<xsl:choose>
<xsl:when test="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='scheme']='https'">
<script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">&#160;</script>
</xsl:when>
<xsl:otherwise>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">&#160;</script>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</head>
</xsl:template>