The function support page of KaTeX states that the dimension of KaTeX units used for font dimensions are computed with respect to the surrounding HTML text. In particular, it states that
G = 1.21 by default, because KaTeX font-size is normally 1.21 × the surrounding font size. This value can be over-ridden by the CSS of an HTML page. For example, on this page, G = 1.0.
Now the question is, where I should change the value of G?
KaTeX is a cross-browser JavaScript library that displays mathematical notation in web browsers. It puts special emphasis on being fast and easy to use. KaTeX. Stable release. v0.15.2 / January 12, 2022.
As stated in the KaTex wiki, that can be reset in CSS as, for example,
.katex { font-size: 1em !important; }
Edit
The documentation is no more hosted on the wiki of the project. You can see the same information in the new official documentation page here.
This is now documented at: https://katex.org/docs/font.html
By default, KaTeX math is rendered in a 1.21× larger font than the surrounding context, which makes super- and subscripts easier to read. You can control this using CSS, for example, to set to 1.1×:
.katex { font-size: 1.1em; }
Doc source at: https://github.com/KaTeX/KaTeX/blob/v0.10.2/docs/font.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With