Understanding KaTeX's Handling of Math Sizes (Why is it the way it is?) #3543
Replies: 1 comment
-
This decision predates me joining the project. One guess is that the decision was for compatibility with MathJax (at least, the version at the time). I agree that it's not ideal — perhaps Part of the limitation here is that KaTeX is given only math mode content, not text mode content (#604). In LaTeX, if you use |
Beta Was this translation helpful? Give feedback.
-
I've been using the
\small
,\tiny
,\scriptsize
etc commands in LaTeX for a long time -- unaware that they aren't actually supported in math mode (because, apparently, they accidentally work in various situations which must've overlapped with my use), so I didn't think twice when I saw that KaTeX uses these commands for resizing math.However, a recent issue led me to research these commands & every LaTeX reference I find, including the tex.SE, says that these commands aren't meant for use in math mode. This made me curious to know why these commands have been implemented if they are not (meant to be) supported on LaTeX? and what is the recommended way of handling font-size changes with KaTeX?
Also: are these commands meant to be used as switches or macros in KaTeX? i.e. should it be
\small \sin^2\beta + \cos^2 \beta
,\small{\sin^2\alpha + \cos^2\alpha}
or{\small \sin^2 \gamma + \cos^2 \gamma}
? I've run into an issue with a custom tooltip element undoing these size commands and thought it may be because I'm not using them as intended.FWIW -- it doesn't seem like there is a single recommended method for handling different font-sizes in math content in LaTeX, but a recurring suggesting is to use
\scalebox
(which IINM is not supported on KaTeX, ATM).Beta Was this translation helpful? Give feedback.
All reactions