-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve \sqrt #810
Improve \sqrt #810
Conversation
Make \sqrt out of inline SVGs to ensure a perfect match at the junction between surd and viniculum.
regenerate screenshot tests with sqrts
Some of the radical symbols seem to be missing padding on the left that's built into the glyph. Highlighting the outermost sqrt of the first superscript shows that there is no left padding in that sqrt. The large sqrt symbols seem to be the ones that are affected as there should be a gap between the first superscript and the second. There should also be more space to the left of the leftmost sqrt. I looked at KaTeX_Size1-Regular and KaTeX_Size2-Regular fonts in opentype.js to confirm that there is indeed left padding built into the glyphs. @ronkok can you update the inline SVGs to include the missing left padding? Sorry for not catching this in in the original review. |
I was hoping to avoid this. I didn't catch it before I minified the SVG code. Before that point, I have things somewhat automated, but afterwards a change is pretty tedious. No matter. I'll do it. I have already added the correct |
Do you have a script? Would it be possible to add the padding via bounding box change? |
I have scripts that do matrix transformations of the original geometry. I shift all of them so that the SVG has no negative coordinates, because IE 9 reportedly doesn't deal well with negative coordinates. But then there are non-scripted changes to make the viniculum absurdly long. And the tall surd got some custom changes of its own. Don't worry about it. I have found copies from an intermediate step in the process. That will make things pretty easy for sizes 1 thru 4. |
Edit the SVG paths so that they have the correct left bearing and advance width values. This will correct the spacing on the left side of each surd and it will also improve the placment of a root indice.
@kevinbarabash It turned out to be pretty easy. Thank you for the nudge. |
In the `main` size, delimiters *do* scale with scriptstyle and scriptscriptstyle.
update screenshot images containing sqrts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/delimiter.js
Outdated
sizeMultiplier = newOptions.sizeMultiplier; | ||
|
||
span.height = 1 / sizeMultiplier; | ||
span.height = 1 * sizeMultiplier; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad you were able to simplify this.
Yes, it took a few tries to focus in on the target, but we got there eventually. Thanks for your help and your patience. |
Nice work guys! |
Very cool! |
Make
\sqrt
out of inline SVGs to ensure a perfect match at the junction between surd and viniculum.