Skip to content

Instantly share code, notes, and snippets.

@pkra
Created May 1, 2015 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkra/749f8a3106ae52fd979a to your computer and use it in GitHub Desktop.
Save pkra/749f8a3106ae52fd979a to your computer and use it in GitHub Desktop.
MathJax: automatic equation numbering: set counter macro
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