# Support for "equation" environment #445

Open
opened this Issue Mar 3, 2016 · 16 comments

Projects
None yet
6 participants

### invkrh commented Mar 3, 2016

 It seems that multi-line auto rendering is not possible for the moment. For example: $$x = a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \cfrac{1}{a_3 + \cfrac{1}{a_4} } } }$$  Here is the exception: KaTeX auto-render: Failed to parse  $$x = a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2 + \cfrac{1}{a_3 + \cfrac{1}{a_4} } } }$$\frac{1}{2}  with Error: KaTeX parse error: No such environment: equation at position 21: begin{equation}̲  Any ideas ?

### invkrh commented Mar 3, 2016

 The equation env has not been implemented yet... But the aligned* is implemented according to the wiki page: https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX It does not work neither. \begin{aligned} a&=b&c&=d\\ e&=f \end{aligned}  It gives No such environment: aligned* exception I also tried array. \begin{array}{ccc} a&=&b&c&=&d\\ e&=&f \end{array}  array env works.

### invkrh commented Mar 3, 2016

 It seems that aligned is not recognized by the environment. https://github.com/Khan/KaTeX/blob/master/src/Parser.js#L428
Member

### kevinbarabash commented Mar 3, 2016

 aligned is supported on master but not in the most recent release. I can see how the wiki page is a little confusing. The * after aligned is supposed indicate that there is a note at the bottom of the wiki page that states *Committed to master but not part of the most current release.
Contributor

### xymostech commented Mar 3, 2016

 (I replaced * with † to make things less confusing maybe)

### invkrh commented Mar 3, 2016

 Thank you for the clarification. =)

Closed

### edigleyalexandre commented Jul 18, 2018

 @invkrh I also hope for the implementation of \begin {equation} for Katex. It would be fantastic.
Member

### edemaine commented Jul 19, 2018

 It is possible to add very basic support for $$...$$ by specifying a custom delimiter in auto-render. For example: renderMathInElement(document.body, { delimiters: [ {left: "$$", right: "$$", display: true}, {left: "\$$", right: "\$$", display: false}, {left: "\$", right: "\$", display: true}, {left: "\\begin{equation}", right: "\\end{equation}", display: true} ] }); See https://codepen.io/edemaine/pen/EpNamj for a demo. However, equation numbering isn't supported yet; #350 tracks that. Note that manual numbering via \tag is possible, though.
Member

### edigleyalexandre commented Jul 19, 2018 • edited

 I added as indicated, but it does not render. Look here.
Member

### edemaine commented Jul 19, 2018 • edited

 @edigleyalexandre Can you be specific about an example of $...$ text that doesn't render? I tried adding an example to your page, then running the same renderMathInElement, and it worked fine. You might be running into the ignoredTags setting, because you have $...$ text inside ... elements; see https://github.com/Khan/KaTeX/tree/master/contrib/auto-render for documentation. P.S. @ronkok Probably meant display: false as in {left: "$", right: "$", display: false},

### edigleyalexandre commented Jul 19, 2018 • edited

 @edemaine Here's how to get with Mathjax. On here. The idea is to leave it with Katex. The page shows code and rendering.

### edigleyalexandre commented Jul 20, 2018

 \begin {matrix} and \begin {cases} are supported on Katex. I tested the main page of the Katex website and rendered it, but the blog did not render. What happened? Page with \begin {cases} that did not render.
Collaborator

### ronkok commented Jul 20, 2018

 Well, you did omit a comma that should follow  {left: "$$", right: "$$", display: false}. I don't know if that by itself is enough to stop the script.

### edigleyalexandre commented Jul 21, 2018

 It worked. Forgive me for that.