Zulip Chat Archive
Stream: lean4
Topic: mathjax in verso
Stefan Kusterer (Sep 20 2025 at 11:01):
Hi,
I started using verso (v4.23.0) just recently and struggle to get formulas correctly rendered in HTML using expressions like
$`\sum_{i=0}^{10} i`
for Verso.Genre Manual.
I expected that by importing Verso.Output.Html, the mathjax-JavaScript-library would be added and render the formula TeX-like.
However, the output (html-multi) does not contain any script-include that I could relate to MathJax (e.g. *chtml.js).
The HTML-file contains
<code class="math inline">\sum_{i=0}^{10} i</code>
but I would have expected something like
\(\sum_{i=0}^{10} i\)
Can anybody provide me with an example that I can use as a template?
Thanks in advance!
Kind Regards, Stefan
Eric Wieser (Sep 20 2025 at 18:41):
The html looks correct, but it sounds like the JavaScript is either misconfigured or not loaded
Stefan Kusterer (Sep 21 2025 at 08:25):
Hi,
Meanwhile I found out that:
- Verso does not use MathJax but KaTeX, so no wonder that
grep-ing for MathJax doesn't lead to anything - also KaTeX, even though being part of the Verso-package, is not added to the HTML-output by default
- adding
extraJs := [Verso.Output.Html.katex.js, Verso.Output.Html.math.js]
extraCss := [Verso.Output.Html.katex.css]
extraDataFiles := Verso.Output.Html.katexFonts
to the configuration has the effect that math is rendered, but still now quite as I need it, because the parts are shown as formulas (TeX-like) and code.
So, it would be great to see a working example of a Verso-document with math in it.
The verso manual describes how math can be set, but not which include-statement or configuration is required.
Regards, Stefan
Stefan Kusterer (Sep 22 2025 at 06:04):
Hi,
I created issue #534 and with verso-test a simple example for reproducing the problem.
Regards, Stefan
Stefan Kusterer (Oct 11 2025 at 17:14):
Hello,
Thanks to @David Thrane Christiansen , the issue is solved.
For being able to use KaTeX, one must "activate" it by applying addKaTeX to the config.
Repository verso-test contains a minimal and now working :slight_smile: example.
Regards, Stefan
Last updated: Dec 20 2025 at 21:32 UTC