Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with absolute dimensions #296

Closed
gagern opened this issue Jul 7, 2015 · 1 comment
Closed

How to deal with absolute dimensions #296

gagern opened this issue Jul 7, 2015 · 1 comment

Comments

@gagern
Copy link
Collaborator

gagern commented Jul 7, 2015

In KaTeX, all dimensions are given in em, which is relative to the current font size. However, there are some dimensions in the TeX world which are given in pt or some similar absolute value. Currently, expressing such dimensions in the DOM is either pretty complicated (manually resetting the size and style up front) or not accurate (if the current font is not the 10pt default).

The prime example which comes to my mind here is the \nulldelimiterspace=1.2pt discussed in #135 (diff) and #249 (comment). If things are to look the way they do in TeX, then we have to make that box always 1.2/ptPerEm times the size of the unsized text style font size.

But how? I can think of several alternatives.

  1. Add classes to reset to textstyle and size5, so that the size is always relative to the default font size. This is what I did in @7dc8b68.
  2. Express the spacing as kerning (using makeKern) and then provide some function which takes the current options and the size in pt and does all the neccessary computation. Added support for \cfrac #135 is using makeKern, but so far the resulting size is still relative to the current size and style.
  3. Deliberately deviate from LaTeX and declare that all dimensions should scale with the font size.
@kevinbarabash
Copy link
Member

This has been addressed in #732.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants