Katex: support small caps

Created on 5 May 2016  路  3Comments  路  Source: KaTeX/KaTeX

It'd be cool if KaTeX supported \textsc. I think it's just a matter of adding the style font-variant: small-caps in the right place. If someone can suggest to me the right place(s) to change in buildHTML.js, I could potentially take a crack at it sometime.

enhancement fonts

Most helpful comment

We would love if you could implement this! We use KaTeX through Gradescope and would really like to mention algorithms in a nice font for our online exams.

- Design and Analysis of Algorithms teaching team at MIT

All 3 comments

If anyone is interested in the picking this up, the PR was a good start. There were a couple of issues that still need to be resolved, namely:

  • getting the correct vertical metrics for each of the glyphs
  • having the spaces render as spaces

The browser generates the small-cap glyphs on the fly. In order to get the heights we'd need to use a library like cap-height to calculate the cap height of the font(s) in question.

Recently got a feature request for this. I think the right approach is probably to add to our font, as in https://github.com/KaTeX/katex-fonts/issues/28

We would love if you could implement this! We use KaTeX through Gradescope and would really like to mention algorithms in a nice font for our online exams.

- Design and Analysis of Algorithms teaching team at MIT

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pvnr0082t picture pvnr0082t  路  4Comments

ylemkimon picture ylemkimon  路  3Comments

yawnoc picture yawnoc  路  3Comments

oddhack picture oddhack  路  3Comments

asmeurer picture asmeurer  路  3Comments