Closed OneForward closed 4 years ago
I've tested some other demos and found the same problem. It seems that Hugo itself and its markdown parser Goldenmark were the cause. Hugo will render a <br />
which will mess with the katex, and single \\
will be rendered to \
as escape characters.
You can write the katex code in one line and use \\\\
to render as \\
directly in markdown file.
$$
\begin{matrix}
a & b \\\\ c & d
\end{matrix}
$$
Or you can try updating the theme to use the new math shortcode I just committed:
-> display style
{{< math >}}
\begin{matrix}
a & b \\
c & d
\end{matrix}
{{</ math >}}
-> inline style
{{< math "inline" >}}
\begin{matrix}
a & b \\
c & d
\end{matrix}
{{</ math >}}
I had the exact same issue today and \\\\
won't make it right in the {aligned}
environment. Tried to replace \\
with \cr
and it worked. It's not an elegant solution though. @OneForward
I've tried to render this demo equation in markdown but the local hugo server failed to render it properly. Normal katex equations can be rendered very nicely, though.