diff --git a/contrib/auto-render/auto-render.js b/contrib/auto-render/auto-render.js index d1c830d1..cf816755 100644 --- a/contrib/auto-render/auto-render.js +++ b/contrib/auto-render/auto-render.js @@ -96,7 +96,14 @@ const renderMathInElement = function(elem, options) { {left: "\\(", right: "\\)", display: false}, // LaTeX uses $…$, but it ruins the display of normal `$` in text: // {left: "$", right: "$", display: false}, - // $ must come after $$ + // $ must come after $$ + + // Render AMS environments even if outside $$…$$ delimiters. + {left: "\\begin{equation}", right: "\\end{equation}", display: true}, + {left: "\\begin{align}", right: "\\end{align}", display: true}, + {left: "\\begin{alignat}", right: "\\end{alignat}", display: true}, + {left: "\\begin{gather}", right: "\\end{gather}", display: true}, + {left: "\\[", right: "\\]", display: true}, ]; optionsCopy.ignoredTags = optionsCopy.ignoredTags || [ diff --git a/contrib/auto-render/index.html b/contrib/auto-render/index.html index 71b49613..d0849b5c 100644 --- a/contrib/auto-render/index.html +++ b/contrib/auto-render/index.html @@ -25,13 +25,15 @@
This is some text $math \frac12$ other text $\unsupported$ - Other node \[ displaymath \frac{1}{2} \] blah $$ \int_2^3 $$ + Other node \[ \text{displaymath} \frac{1}{2} \] blah $$ \int_2^3 $$ and some more text \(and math\) blah. And $math with a \$ sign$.
         Stuff in a $pre tag$
       
+

An AMS environment without $$…$$ delimiters.

+

\begin{equation} \begin{split} a &=b+c\\ &=e+f \end{split} \end{equation}