Closed paniash closed 4 years ago
Hello!
Following your issue I have added support for KaTeX for math typesetting (#2). You can enable it on a per-page basis by including math: true
on your content files or globally by adding math: true
to your project configuration. It is disabled by default.
Use $$
for block expressions and $
for inline expressions like so:
Inline math: $\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…$
Block math:
$$
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
$$
Check the doc for the available math functions.
I am not familiar with KaTeX and did not test it extensively so feel free to report any bugs :). I'm closing the issue in the meantime.
Hello @ojroques! Thanks for adding KaTeX support. I was testing it and found that environments are not rendered at all. For example,
$$
f(x) = \int_{-\infty}^\infty \hat{f} (\xi), e^{2 \pi i \xi x} d\xi
$$
is rendered properly but when using environments, say when writing a matrix
$$
\begin{pmatrx}
a & b \\
c & d
\end{matrix}
$$
It doesn't render at all. Any idea what is going on?
Hello,
It seems that new lines in block environment are not correctly interpreted by KaTeX. Hugo introduces
tags when it sees newlines which breaks KaTeX. You can write your matrices on a single-line (make sure to escape \\
):
$$ \begin{pmatrix} a & b \\\\ c & d \end{pmatrix} $$
It is not very readable though. I added a math
shortcode to do that for us. You can use it for block environments:
{{< math >}}
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
{{< /math >}}
Or even inline:
In-line: {{< math >}} f(x) = \int_{-\infty}^\infty \hat{f} (\xi), e^{2 \pi i \xi x} d\xi {{< /math >}}
Hello there!
How do I get LaTeX snippets to be properly rendered. I tried using
from the official website but the rendering is pretty bad. I'd be glad if you could help.