czwartek, 26 stycznia 2012

MathJax: math in HTML documents

To process inline math formulas delimited by single ($) or (\() sequence one have to add the following into HTML document preamble:


<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ['\\(','\\)'] ],
processEscapes: true
}
});
</script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=Accessible" type="text/javascript">
</script>

Now ``for all \$n > 2\$ there not exist integeres \$x\$, \$y\$, \$z\$ that \$ x^n + y^n = z^n\$'' will be rendered as: ``for all $n > 2$ there not exist integeres $x$, $y$, $z$ that $ x^n + y^n = z^n$''. (Cf. Fermat's Last Theorem.)

To insert verbatim $ use \$ (processEscapes: true). Single dollar seems to be ignored, only pairs of dollars are processed---for example \$.

.

Brak komentarzy:

Prześlij komentarz