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

KaTeX css is not rendering correctly \overline #916

Closed
thiagopnobre opened this issue Oct 2, 2017 · 6 comments
Closed

KaTeX css is not rendering correctly \overline #916

thiagopnobre opened this issue Oct 2, 2017 · 6 comments
Labels

Comments

@thiagopnobre
Copy link

thiagopnobre commented Oct 2, 2017

Sometimes katex just not renders the line of the \overline, depending on the zoom or the font-size.

  • Example without zoom:
    bug-katex

  • Example with zoom:
    bug-katex-02

@thiagopnobre
Copy link
Author

Maybe the problem is because of the em used in <span class="overline-line" style="border-bottom-width:0.04em;"></span>. I think that might be a good idea to change it to 1px or something like that.

@edemaine
Copy link
Member

edemaine commented Oct 2, 2017

I suspect that this is a further consequence of #824. We're still at a loss for the right fix.

Note that 1px in CSS does not mean 1 pixel -- it means 1/96 inches. (On the other hand, 1px is supposed to be guaranteed to look nice.) We'd like to match LaTeX's lengths, but we obviously want to get the browser to round up instead of down.

@edemaine edemaine added the bug label Oct 2, 2017
@trimbonz
Copy link

trimbonz commented Oct 2, 2017

I can confirm that fraction lines do not appear in old Android webView clients up to and including API 19 (KitKat). I can work around this by making the fraction line a bit bigger - in katex.min.js I changed the first entry of the DefaultRuleThickness array from 0.04 to 0.06. This changes the inline style for the fraction line to 0.06em, which is apparently enough for it to show up in a WebView. Playing with the values I found that 0.059 doesn't display but 0.5999 does, so there is a threshold there somewhere.

kevinbarabash pushed a commit that referenced this issue Oct 14, 2017
* Prevent disappearing fraction lines.

Set a CSS min-height that will ensure that fraction lines will display at least one screen pixel.

Addresses issues #824 and #916.

* Change from dppx to dpi

Change the break point spec from 2dppx to 192dpi. They mean the same thing. I'm making the change because IE supports dpi but not dppx.
@edemaine
Copy link
Member

Just-merged #931 should fix the frac line issue, thanks to @ronkok! Please test against master if you can.

@kevinbarabash
Copy link
Member

@thiagopnobre this should be fixed with the release of v0.9.0-alpha1. Please re-open if this is still an issue.

@thiagopnobre
Copy link
Author

thiagopnobre commented Oct 17, 2017

Sorry for the delay guys. It worked. 🙂

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

No branches or pull requests

4 participants