MicroTeX icon indicating copy to clipboard operation
MicroTeX copied to clipboard

Peculiar linebreaking in long equations

Open lazingor opened this issue 4 years ago • 1 comments

We seem to get some peculiar linebreaking effects in long equations. Say we run it with

x = y + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a

(enough to fill the drawing width on my screen), then the line never breaks, and we render out of bounds in the sample Cairo program. without3 (The canvas renders dark, I think because the line goes out of bounds.)

But if we add a + 3 somewhere in the middle, it breaks the line before the 3:

x = y + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + 3 + a + a + a + a + a + a + a + a + a + a + a

with3

With \breakEverywhere{true} it seems to break at the correct point:

\breakEverywhere{true} x = y + a + a + a + a + a + a + a + a + a + a + a + a + a + b + a + a + a + b + b + b

breakEverywhere

But \breakEverywhere{true} will probably cause some other issues, so it'd be good to figure out why the first equation isn't being split as one would expect.

I haven't had a chance to dig into the code to figure out what's special about the 3, or why it doesn't break the original equation without breakEverywhere, but I figured I'd file this issue here for later.

lazingor avatar Jun 04 '20 20:06 lazingor

I guess this bug is related to the item type. The character a and 3 are different types, I'll check it soon.

NanoMichael avatar Jun 09 '20 13:06 NanoMichael