-
-
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
Thick / Double Fraction Bar showing up #1114
Comments
@arlohosk what browser are you using? Also there are multiple pre-release versions of 0.9.0, can you be more specific? Have you tried the latest one, v0.9.0-beta? |
Thanks for the quick reply. I am using chrome, but have tested in IE (edge) + Firefox as well, same issue. I am pulling the npm package directly from here https://www.npmjs.com/package/katex and updated it today, so I believe it is using v0.9.0-beta (though this issue was present 3-4 months ago as well). Note: I am using the autorender functionality (In my case, I'm using Meteor, so I had to take the full auto-render.js and copy it into my app), not sure if that would affect the formatting though. |
@arlohosk Are you using KaTeX to render something inside an SVG? |
@ronkok Nope, just a standard html (with some css applied of course - hence the green background in one of the pictures) |
Can you provide a link? I'd like to go investigate. |
@ronkok hmm...Its not deployed (and won't be until fixed) into our prod site + behind a log in page. Is there a messaging function on github I'm missing or some way to reach you directly? I could try to screenshare code or send you a log in on a dev site |
My first hypothesis is that the root cause of this issue is the same as issue #1088. Some external SVG styling has caused the frac-line, which is an SVG path, to render with a black border and a white fill. PR #1089 was merged into master yesterday. If my hypothesis, is correct, then both problems will be fixed when that PR is released. |
@ronkok Gotcha. Ok, happy to wait and see on that. |
Btw, behavior is also weirdly inconsistent - I haven't changed anything on this page (although I did activate MathJax on another HTML template - this is a "SPA" Meteor web app, I'm assuming that's what caused it), and that causes Katex to go haywire: |
The v0.9.0-beta1 was released a few hours ago. Could you try it? |
@ylemkimon thanks for the heads up. Will give it a shot later this week (due to other reqs) |
@mbourne I think that @arlohosk's double line is being caused by something different than your thick line. I hope that the double line has just been solved by release 0.9.0-beta1. Also, @mbourne , the second SVG line is there by design. I have an explanation in two versions. The short version is that the second line is there to prevent the frac-line from blurry edges. Read on if you want to hear the long winded second version. Imagine that a frac-line is positioned on a monitor screen so it is centered exactly on the border between two rows of screen pixels. The frac-line is only 0.04em thick, so let's say that it covers 30% of the upper pixel and 30% of the lower pixel. How that will render varies with the browser and with the way we draw the line.
So I wrote the SVG with two lines, written directly on top of each other. I think of this as similar to two brush strokes. The browser adds some gray to the pixel for each brush stroke and it ends up black (or near black). And we perceive a frac-line with crisp edges instead of blurry edges. Unfortunately, we also sometimes get lines that are too thick. That's better than a missing line, and I think a few thick lines are better than a lot of blurry lines. If I ever think of a way to make all the problems go away, I'll change it. If I can't think of anything, well as time goes by, we'll all migrate to screens with higher pixel density. The frac-lines will get closer to the 0.04em value that Donald Knuth intended. |
Still getting the same double-bar issue with 0.9.0-beta1 Not sure if this and the earlier image I posted (https://imgur.com/a/QpbOl) is related with the haywire fraction layout when mathjax is activated (on another part of the app) |
@soichih what OS/Browser are you using? Also, it looks like there's some issue with the spacing around the |
@mbourne can you post a link to that page? |
@kevinbarabash I am using Ubuntu16 / Chrome. I am seeing the same issue with Firefox also. I've added the text Katex syntax here |
@soichih I'm seeing the same thing in Safari. I'm confused. It's using a sqrt character but we use SVG for |
@soichih I think you are using the new version of KaTeX CSS, but old version of KaTeX JS. |
@ylemkimon I am using vue-markdown which uses markdown-it-katex which currently uses katex 0.6.0
I believe I should ask the maintainer of markdown-it-katex to upgrade to the 0.9. |
@mbourne How do Such a change would also seem to clear up the problem for @arlohosk. The |
@kevinbarabash Are you contemplating getting some space there by using a taller |
@ronkok will you have time to give that a try? |
@ronkok Thank you for the explanation regarding double lines - makes perfect sense and explains why I was seeing grey lines when experimenting with 1 line and/or thinner line widths. All the square root signs seem fine. Here's a case where the fraction line is thick, but the square root sign is good: Yes, please try using @kevinbarabash As mentioned in my post, I haven't upgraded to 0.9.0beta1 on my server. 0.9.0alpha1 works well for all fractions - no disappearing lines, none blurry and none that are too thick. |
@kevinbarabash Yes, I can put together a couple of PRs. One to change frac-lines from SVG But that will be in a few days, when I'm feeling better. I'm a little under the weather at the moment. |
Great! Marking this resolved. Feel free to open a new issue if there are any remaining problems. |
Trying to write some simple fractions to the screen, but
(a) a double lined fraction bar keeps showing up - my config is pretty standard (using latest 0.9.0 katex version), and using the below expression.
Note: The issue is definitely the "type" of line (looks like a "double border"), and not the thickness - see third image.
(b) the division symbol is misaligned when the font is small, but gets resolved when the font is bigger (not a big deal, jw if there is an easy fix)
$\\frac{1}{2} \\div \\frac{3}{4}$
Any ideas if I'm doing something wrong, or if this is a known issue?
Thanks
The text was updated successfully, but these errors were encountered: