renderingace-editorkatex

KaTeX does not render math between dollars sign on not the same line


I want to create an editor with ace + katex. Problem is that double dollars sign does not compiles correctly

For example:

Good

$$\mathcal D = 25+4\cdot6\cdot1=49=7^2$$

Bad

$$
\mathcal D = 25+4\cdot6\cdot1=49=7^2
$$

Katex render options:

renderMathInElement(this.katexView, { delimiters: [
      {left: "$$", right: "$$", display: true},
      {left: "$", right: "$", display: false},
    ]});

Solution

  • Found my mistake, I inserted text for katex node via innerText, but katex need innerHTML