In LaTeX, the bar in fractions periodically disappears

#1

Steps to reproduce

Create a bunch of bullet points, all with fractions displayed in LaTeX, e.g.

• $$\frac34$$
• $$\frac34$$
• $$\frac34$$
• $$\frac34$$
• $$\frac34$$
• $$\frac34$$
• $$\frac34$$
• $$\frac34$$

Expected result

Each fraction displays the same way, 3 over a bar, 4 under the bar.

Actual Result

Sometimes the bar disappears, e.g.

Environment

Chrome, Windows 10.

I do not see the same problem in the Windows app.

Here’s the Windows app (1.0.54):

#2

I tried a few times and can’t repro. Do you know approximate how often this issue happens, like 1 in 10 times or 1 in 5?

It could be that the newer versions of Chrome broke KaTeX’s layout. I’ll check their GitHub issues and see if others are having the same issue.

#3

It sort of follows a pattern.

If I do

-$$\frac12$$
-$$\frac12$$
-$$\frac12$$

etc.

then line 1, 5, 6, 10, 11, 15, 16, 20, 21, etc. all have the bar disappear.

However, the pattern changes a bit when I change the levels of indent or the content of the fraction.

Approximately 1 in 5 lines is about right. It doesn’t have to be a bunch of fractions. I can type one fraction, move the cursor above it, and repeatedly hit enter to add blank lines. The bar in the fraction will periodically disappear and then come back as it gets pushed down the screen.

Here is a video of this happening:

#4

Thanks for the video!

Followed the steps but still can’t repro it. I tried having 20 1/2 fractions or pressing Enter before it as what’s shown in the video.

I’m running Chrome 64 on Windows 10. Is that the same as yours?

#5

Yes,

Windows 10 Pro
Chrome Version 64.0.3282.186 (Official Build) (64-bit)

#6

I can’t repro though. Any chance it’s because of some browser extension?

#7

I can confirm this bug. It appears only on Chrome. I’ve tested it on Ubuntu and Mac, both times Chrome Version 64.0.3282.186 (Official Build) (64-bit), without any special extensions.

Firefox and standalone Dynalist app display it perfectly fine.

I’ve set up a test document here:
https://dynalist.io/d/NeEwVRR3_AVffM6ZcdUN0vBH

This is how it looks with my account logged in:

And this is how it looks with incognito-mode or not signed-in Chrome:

Funnily, the fraction bars appear and disappear depending on where the focus of the cursor is. For this i’ve made a copy of the document above and made it editable via link for testing without being logged in.
https://dynalist.io/d/hdduNYdqzckP7rKViE-MJN3S

I hope you can see this in both documents on your system.

#8

It might be interesting for those interested to see if the behavior varies as a function of the browser zoom level. I’ve noted a similar loss of thin horizontal lines in various pdf viewers over the years and zooming in provided an higher resolution rendering that made the lines “appear”.

In the context of Dynalist, I personally had to increase the height of Powerpack separators to “2” so that my separators would be consistently rendered in Chrome at all zoom levels I use. Unfortunately with LaTeX a similar option doesn’t really exist so I’m not sure how the problem might be addressed here.

#9

Great point, BryanN. I have my browser set to 90% by default. The issue went away when I set it to 100%.

#10

Thanks, detectives!

I was able to repro the issue at 80% zoom level on Chrome, using this document: https://dynalist.io/d/NeEwVRR3_AVffM6ZcdUN0vBH

I guess whether you see it at 90% zoom or 80% zoom also depend on your screen?

From my quick testing, I think it has something to do with how subpixels are rendered in Google Chrome.

You can see that the element exists and the height is 0.86 pixels. However, it’s not visible.

This doesn’t happen for the 2nd equation.