manubot / rootstock

Clone me to create your Manubot manuscript
https://manubot.github.io/rootstock/
Other
451 stars 177 forks source link

Right-clicking MathJax pops up context menu in wrong position #164

Open vincerubinetti opened 5 years ago

vincerubinetti commented 5 years ago

This is due to the fact that we are adding margins to the <body> element, which is not typically done (but is definitely not super rare either). When MathJax calculates the x-position to show the menu, it believes the origin of the page (x = 0) is at the left side of the "paper" that is centered on the page, instead of the absolute left edge of the page, so it puts the menu much further right than it should be.

We can fix this with our own javascript that manually moves the menu left the same amount as the <body>'s left margin, but it's a bit hacky/ugly. It seems like MathJax tries to account for body elements having margins, but it still doesn't work. Need to look into making sure pandoc is including the latest version of mathjax, whether or not they truly have claimed to fix it yet (1, 2, 3), and then finally make open an issue with mathjax.

vincerubinetti commented 5 years ago

The actual issue is this one. Removing position: relative or max-width: from <body> fixes the issue.

Issue is upstream in MathJax.

dhimmel commented 5 years ago

Great. Fingers crossed for an upstream fix.