Created
May 1, 2015 20:13
-
-
Save pkra/749f8a3106ae52fd979a to your computer and use it in GitHub Desktop.
MathJax: automatic equation numbering: set counter macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.MathJax = { | |
jax: ["input/TeX", "output/HTML-CSS"], //just some defaults | |
extensions: ["tex2jax.js", "MathMenu.js", "MathZoom.js"], | |
TeX: { | |
extensions: ["AMSmath.js", "AMSsymbols.js"], | |
equationNumbers: { | |
autoNumber: "AMS" | |
} | |
}, | |
AuthorInit: function() { | |
MathJax.Hub.Register.StartupHook("TeX AMSmath Ready", function() { | |
MathJax.InputJax.TeX.Definitions.Add({ | |
macros: { | |
setCounter: "setCounter" | |
} | |
}, null, true); | |
MathJax.InputJax.TeX.Parse.Augment({ | |
setCounter: function(name) { | |
var num = parseInt(this.GetArgument(name)); | |
MathJax.Extension["TeX/AMSmath"].number = num; | |
} | |
}); | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment