Skip to content

Commit

Permalink
DS-635 Add MathJax to Mirage2 theme
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdietz committed Oct 5, 2014
1 parent 6e792e9 commit 699eca5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dspace-xmlui-mirage2/src/main/webapp/xsl/core/page-structure.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit 699eca5

Please sign in to comment.