Math in line with the text using $ .. $ instead of \ (.. \)
See original GitHub issueHi.
I have a website in html5 where I put the rendering code of KaTeX v0.10.1 between the <head> .. </ head> tags
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous"> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
And it displays the mathematical symbols delimited with $$ .. $$ and with \ [ .. \], but it does not work when I want to put mathematics in line with the text, that is, mathematical symbols inside a paragraph with simple dollar $ .. $, instead only works \( .. \)
I’ve already tried putting the following in the <body>..>/body> :
<script>
renderMathInElement(document.body,{delimiters: [
{left: "$", right: "$", display: false},
{left: "$$", right: "$$", display: true}
]});
</script>
but nothing.
The website where I am doing this testing is:
https://matematicauniversitaria.com/matlai/ (notice the $y^2$ that appears there)
Any suggestions?
How do I make the mathematical symbols appear in line with the text using $ … $?
Thanks in advance.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8

Top Related StackOverflow Question
Ah yes, silly mistake. The
\character needs an escape.I do not pretend to be an expert in security issues. I don’t really know the intended effect of declarations like
integrity="sha384-...or howdefermight interact with that sort of thing. I do that if I strip that out and move therenderMathInElementscript to the end of thebody, then the page loads fine. To be specific, my<head>includes:and the
renderMathInElementcomes after the math.