Katex: \sqrt doesn't scale properly when browser is zoomed in or out on Safari

Created on 15 Sep 2017  路  8Comments  路  Source: KaTeX/KaTeX

\sqrt{\frac{1}{x}} produces the following output when zoom in:
screen shot 2017-09-15 at 12 07 12 am
and out:
screen shot 2017-09-15 at 12 07 18 am

All 8 comments

It works fine in Chrome and Firefox.

I'll look into it.

It seems to be a problem with all the nested SVGs. The non-nested SVGs (\cancel, \widehat, etc) seem to be working okay. But in nested SVGs, the inner SVG is scaling taller than the outer SVG. The bottom of each one is being cut off and what can be seen is too large. I'll keep looking and report as I learn more.

I think it probably is possible to re-write all the nested SVGs and instead use two or three single-level SVGs placed side by side. The variable-length arrow shafts will require CSS calc(...) if this scheme is to work.

During very early drafts of PR #670, I tried this approach and had it working, sort of. I ended up using nested SVGs because I was getting better quality images. Maybe the side-by-side, CSS-controlled approach can succeed if I work it a little smarter.

This will take time. I'll make a progress report in a couple of days. I sure wish that Safari was better.

I'll try this out in the nightly webkit build and see if there's any info on the status of this bug anywhere. If the bug's being fixed in Safari, no need to rework things.

@kevinbarabash PR #890 fixes sqrt and single-ended arrows, but it does not fix double-ended arrows or horizontal braces. It may be a couple of weeks before I can address them.

@ronkok sounds good. We can close this issue when #980 is merged and open another issue just for double-ended arrow and horizontal braces.

I believe that this issue is now resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ylemkimon picture ylemkimon  路  3Comments

mbourne picture mbourne  路  3Comments

StaloneLab picture StaloneLab  路  3Comments

hagenw picture hagenw  路  3Comments

trollanfer picture trollanfer  路  5Comments