You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MathJax state: \newcommand and friends, numbered eqs #2
Turns out MathJax has stateful support for \newcommand, and it works.
However it depends on the order they're typeset, which might not correspond to document order
To make it usable:
Undocumented: \newcommand alters MathJax.InputJax.TeX.Definitions.macros and MathJax.InputJax.TeX.Definitions.environment. Could try to save/restore them instead of re-typesetting all following math.
However, it's rare enough that re-typesetting should be acceptable.
Activity
cben commentedon Sep 14, 2013
Turns out MathJax has stateful support for \newcommand, and it works.
However it depends on the order they're typeset, which might not correspond to document order
To make it usable:
$\newcommand{...}$in source form instead of becoming invisible (special case of Dont allow empty formula rendering #10).$\newcommand...$formula, re-typeset all (or all following) math.cben commentedon Sep 25, 2013
\[re]newcommand...without any$etc delimiters to mathjax.Pandoc does this.
cben commentedon Oct 28, 2013
Undocumented:
\newcommandaltersMathJax.InputJax.TeX.Definitions.macrosandMathJax.InputJax.TeX.Definitions.environment. Could try to save/restore them instead of re-typesetting all following math.However, it's rare enough that re-typesetting should be acceptable.
cben commentedon Nov 22, 2013
Simular (but worse?) issues of rendering order sensitivity happen with
\begin{equation}numbering. See mathjax/MathJax#422.This is going to be more acute if I optimize initial pass (#14) to be partial/out-of-order.
UPDATE: MJ 2.7 added
resetEquationNumbers()API https://docs.mathjax.org/en/v2.7/advanced/typeset.html#reset-automatic-equation-numbering, in MJ 3 it'stexReset(): https://docs.mathjax.org/en/v3.2/web/typeset.html#resetting-automatic-equation-numberingcben commentedon Nov 22, 2013
http://jsfiddle.net/89r6p/3/ demonstates mathjax running again (click) on labels, numbers & refs.
cben commentedon Feb 11, 2014
Numbering state is in
MathJax.Extension["TeX/AMSmath"].numberandMathJax.Extension["TeX/AMSmath"].startNumber; there is a host of other variables to handle labels&refs: https://github.com/mathjax/MathJax/blob/master/unpacked/extensions/TeX/AMSmath.js#L562Recognize \begin{foo}...\end{foo} not surrounded by math delimiters.
Recognize \newcommand & \renewcommand, display source in its rendering (
cben commentedon Feb 12, 2014
cben commentedon Feb 12, 2014
\DeclareMathOperatornot wrapped inShould check how pandoc handles those.
Better demo of numbering problems (#2)