KaTeX does not render HTML extension commands despite strict: false
and trust: true
options
#3492
-
I'm trying to embed LaTeX expressions in the web documentation of my library. That's the HTML code that <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css" integrity="sha384-R4558gYOUz8mP9YWpZJjofhk+zx0AS11p36HnD2ZKj/6JR5z27gSSULCNHIRReVs" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js" integrity="sha384-z1fJDqw8ZApjGO3/unPWUPsIymfsJmyrDVWC8Tv/a1HeOtGmkwNd/7xUS0Xcnvsx" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
strict: false,
trust: true,
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\(", right: "\\)", display: false},
{left: "$", right: "$", display: false},
{left: "\\[", right: "\\]", display: true}
]
});
});
</script> The \begin{cases}
\operatorname{try\_get\_len\_of\_closed\_int\_intvl\_from\_0}: \href{Self}{google.com} \rightharpoonup usize \\
\operatorname{try\_get\_len\_of\_closed\_int\_intvl\_from\_0} = i \mapsto \lvert [0..i] \rvert
\end{cases} How can I make KaTeX display the tex properly? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Did you check the console for error messages?
|
Beta Was this translation helpful? Give feedback.
-
That's the whole list of errors,
I didn't find a single one from KaTeX and none of them seems to be able to affect KaTeX in any way. Swapping the arguments of |
Beta Was this translation helpful? Give feedback.
-
The issue was the
I.e. this line
It caused the renderer to be called twice. And the first call happened with the default settings. |
Beta Was this translation helpful? Give feedback.
The issue was the
onload
attribute that crept into the 3rd line in the the head of HTML document: