You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did some tracing of this bug and made some headway towards a potential fix; while I can’t fix it right now because of time constraints, I can dump my knowledge to reduce repeated effort.
Some additional code needs to be added to handle this case in this function. LaTeX seems to skirt around this issue by having \sup be its own object and special-casing it out. I think that for Typst, the more elegant way to solve this problem is by first checking if the limits attachment are being added to text, then measuring how far the text dips below the baseline, and ensuring a specific amount of clearance is maintained. Because math layout is done after text shaping, this isn’t too hard to do, but it’ll be a bit of spaghetti code because the information about the font measurements is nested like five levels deep into the relevant objects.
Activity
[-]bug: math limit formatting overlap[/-][+]Math limit formatting overlap[/+]rpitasky commentedon Apr 23, 2023
I did some tracing of this bug and made some headway towards a potential fix; while I can’t fix it right now because of time constraints, I can dump my knowledge to reduce repeated effort.
Some additional code needs to be added to handle this case in this function. LaTeX seems to skirt around this issue by having \sup be its own object and special-casing it out. I think that for Typst, the more elegant way to solve this problem is by first checking if the limits attachment are being added to text, then measuring how far the text dips below the baseline, and ensuring a specific amount of clearance is maintained. Because math layout is done after text shaping, this isn’t too hard to do, but it’ll be a bit of spaghetti code because the information about the font measurements is nested like five levels deep into the relevant objects.
laurmaedje commentedon Apr 23, 2023
Maybe the text's top-edge and bottom-edge should be tight bounding boxes in math.
cmoog commentedon Apr 23, 2023
Another issue shown in this example is the alignment / mis-alignment of the baseline of
Pwithin.