-
I understand that Katex does not officially support alternative fonts, because Katex needs to know certain metrics about each character. On the other hand, it is very simple to just change the fonts listed in the CSS. I have tried this and the results look reasonable to me. Perhaps I am not typesetting anything terribly complicated. My question is:
An additional question is: what would be required to change the font in Katex "the right way", assuming I am willing to put in some effort? I have noticed the katex-fonts repository but it appears to be deprecated. Would this still be the right approach for the latest Katex? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The main issue with different fonts, other than checking that all the Unicode symbols line up (there are often some discrepancies around some symbols), is in the metrics. See The font building code is in |
Beta Was this translation helpful? Give feedback.
-
A couple more possible bad consequences are tied to KaTeX's close coupling with its font.
|
Beta Was this translation helpful? Give feedback.
The main issue with different fonts, other than checking that all the Unicode symbols line up (there are often some discrepancies around some symbols), is in the metrics. See
src/fontMetricsData.js
and the associated build code insrc/metrics
. If these are incorrect for your font, then you'll find vertical alignments to be off. Try\frac
and\begin{matrix}
and so on and the layout will probably look bad.The font building code is in
src/fonts
in this repository (it moved fromkatex-fonts
). You shouldn't need to touch that if you already have a font.