5

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?

gvgramazio
  • 1,115
  • 3
  • 13
  • 30
  • Note that I don't want to override the method that KaTeX uses to compute the font dimension, I want to change the value of G. – gvgramazio Jun 17 '18 at 11:08

2 Answers2

9

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.

gvgramazio
  • 1,115
  • 3
  • 13
  • 30
  • This worked for me, thanks. Do you know why you need to write "!important" ? It only worked for me when I wrote that. – Normajean Jul 24 '20 at 22:49
  • @Normajean it’s used to avoid that other selectors override the provide value, even if they have an higher specificity. So, it’s used when that value is really... important. – gvgramazio Jul 24 '20 at 22:57
1

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

Community
  • 1
  • 1
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
  • Do you know how to change the size of superscripts? I have a fraction, like 3^(1/2) but the 1 and the 2 are huge! they are the same size as the 3! I can make them smaller but then they are too far away from the divide line. I need the whole fraction smaller. – Normajean Jul 24 '20 at 03:03
  • @Normajean nope! :-) Try creating an issue on their tracker, and link to it from here. – Ciro Santilli OurBigBook.com Jul 24 '20 at 07:14