So I want to have KaTeX inline formulas like with MathJax.
But so far I\'ve found only render()
function which \"draws\" a string to an element.
And I need
Yes, you can render all $
-delimited formulas inline using KaTeX's auto-render extension. Per the documentation on that page, $
is not one of the default delimiters so you'll need to set it when you call renderMathInElement()
and set display
to false
, which renders inline. Below is one example and another from KaTeX can be found here.
Note that \\
in the JavaScript corresponds to \
in the HTML.
The formula $a^2+b^2=c^2$ will be rendered inline, but $$a^2+b^2=c^2$$ will be rendered as a block element.
The formula \(a^2+b^2=c^2\) will be rendered inline, but \[a^2+b^2=c^2\] will be rendered as a block element.