Permalink
Browse files

Use Mathjax's jsMath2jax extension to provide backwards compatibility…

… with div/spans that have "math" class

Some worksheets have div/spans that delimit math, in the jsMath style, in the html annotations.  Those stopped working when we upgraded to MathJax.  For example, Rob Beezer's worksheets converted from his book had this issue.
  • Loading branch information...
1 parent 2bc16ba commit 6105159d400752b4c0bda436a927a1ef01a2f44b @jasongrout jasongrout committed Aug 24, 2012
Showing with 11 additions and 4 deletions.
  1. +11 −4 sagenb/data/sage/js/mathjax_sage.js
@@ -1,8 +1,15 @@
MathJax.Hub.Config({
- tex2jax: {
- inlineMath: [['$','$'],['\\(','\\)']],
- processEscapes: true,
- ignoreClass: 'cell_input_print', // "input cells" in published worksheets
+ // Need jsMath2jax so that worksheets with div/span class "math" elements still render correctly
+ // This is important for backwards compatibility (notably Rob Beezer's books)
+ extensions: ["jsMath2jax.js"],
+ tex2jax: {
+ inlineMath: [['$','$'],['\\(','\\)']],
+ processEscapes: true,
+ // "cell_input_print" because those are input cells in published worksheets
+ // "math" so that the tex2jax plugin leaves the spans/divs with class math alone
+ // (since jsMath2jax will take care of it); if we don't, then tex2jax and jsMath2jax conflict.
+ // See https://groups.google.com/forum/?fromgroups=#!topic/mathjax-users/qzWdxiQvNrw
+ ignoreClass: 'cell_input_print|math'
},
styles: {

0 comments on commit 6105159

Please sign in to comment.