Katex: Break in tall delimiters

Created on 12 May 2019  路  4Comments  路  Source: KaTeX/KaTeX

Describe the bug:
Left and right floor brackets, when containing a large expression, appear to to break in the middle. This disappears on zooming but makes for suboptimal rendering.

(La)TeX code:

5 = \left\lfloor{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{(4!)!}}}}}}\right\rfloor

Expected behavior:
Expected vertical bar portion of left and right floor braces to be continuous.

Screenshots:
Taken from the demo.
image

Environment (please complete the following information):

  • KaTeX Version: 0.10.1
  • Device: Desktop
  • OS: Ubuntu 18.10
  • Browser: Chrome
  • Version: 74.0.3729.131 (Official Build) (64-bit)
bug

Most helpful comment

I think this can be fixed without SVG. We just need to adjust the vertical alignment calculation in makeStackedDelim(). That calculation should include a small overlap where glyphs meet. Otherwise floating point rounding error can result in the gap we see in @OisinMoran's screenshots.

I'll take a look sometime in the next week.

All 4 comments

We could probably use SVG to avoid this situation. @OisinMoran are you seeing similar issues with tall parens and tall square brackets?

Yes, with

5 \ne \left[{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{(4!)!}}}}}}\right]

I get:
image

And with

5 \ne \left({\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{(4!)!}}}}}}\right)

I get:
image

Thanks for confirming my suspicions.

I think this can be fixed without SVG. We just need to adjust the vertical alignment calculation in makeStackedDelim(). That calculation should include a small overlap where glyphs meet. Otherwise floating point rounding error can result in the gap we see in @OisinMoran's screenshots.

I'll take a look sometime in the next week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sophiebits picture sophiebits  路  3Comments

fabiospampinato picture fabiospampinato  路  4Comments

shaunc picture shaunc  路  4Comments

mbourne picture mbourne  路  3Comments

oddhack picture oddhack  路  3Comments