-
-
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
Scrolling with equation refs does not always work with SVG output #2586
Comments
Thanks for reporting the issue. The ID works if I add it to the URL by hand, and the link form the reference is picked up buy the browser as an actual link, but it doesn't seem to follow the link. Very peculiar. It appears to be a WebKit bug. It is interesting that the links seem to work when there is a special character in the label that must be escaped as part of a URL. We can use that to get all the labels to work by using the MathJax = {
loader: {
load: ['[tex]/tagformat']
},
tex: {
tags: 'ams',
packages: {'[+]': ['tagformat']},
tagformat: {
id: (id) => 'mjx-eqn:' + id.replace(/\s/g, '_')
}
}
}; would do it. This seems to work for me. You will need to merge this into your configuration for now. |
Thanks for the quick response. The suggested use of However, when using Getting It seems odd that an BTW, when putting links to my test page manually in the browser, Firefox seems to scroll accurately (to the target baseline) whereas Safari scrolls to the top of the page. Might that be related to the suspected WebKit bug? |
Try using |
Ah, of course, thanks! And the |
Glad we could figure out something that works. There still seems to be a WebKit bug, but we do seem to have a way to work around it for now. I'm going to leave this open so that I can change the default tag format to include a colon, as suggested above. |
Use a colon in link anchor ids so that links work in Safari in SVG output. (mathjax/MathJax#2586)
Issue Summary
Clicking on links produced by
\eqref
sometimes doesn't scroll to the target location when using SVG output with MathJax v3.1.2 in Safari. Clicking on the same links scrolls correctly in Firefox.Issue #297 reported a similar problem with
\eqref
and SVG in v2.1.Strangely, the Safari behaviour appears to depend on the form of the label:
x:z
scrolls correctly, whereasxyz
doesn't!Steps to Reproduce:
(2)
. The window does not scroll up to show the target equation.(1)
. The window does scroll up to show the target equation.Clicking on a valid link to an equation should always scroll to reveal the targeted equation text.
(In fact the link to
(1)
scrolls up only to the baseline of the equation, so the equation text isn't actually visible; but that is a relatively minor, separate issue.)Technical details:
Supporting information:
Please supply a link to a (live) minimal example page, when possible.
https://pdmosses.github.io/eqref.html
Check your browser console window for any error messages, and include them here.
None.
Include the MathJax configuration you are using, and the script tag that loads MathJax itself.
The text was updated successfully, but these errors were encountered: