Skip to content
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

SVG href links with mtextInheritFont:true are misplaced #2588

Closed
dpvc opened this issue Dec 22, 2020 · 2 comments
Closed

SVG href links with mtextInheritFont:true are misplaced #2588

dpvc opened this issue Dec 22, 2020 · 2 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Milestone

Comments

@dpvc
Copy link
Member

dpvc commented Dec 22, 2020

Also, note that there are some bugs with mtextInheritFont: true in v3 in both CommonHTML and SVG output. See #2257 and #2189.

mtextInheritFont: true in v3 in SVG output also upsets the scrolling to labelled equations, targeting the baseline instead of the top of the equation. (This doesn't happen in CHTML output.)

For example, add this option to the equation-refs demo and change the output to SVG, then click on a link to (1): only the lower part of the equation is visible (using Safari and Firefox).

Originally posted by @pdmosses in #2329 (comment)

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team v3 labels Dec 22, 2020
@dpvc
Copy link
Member Author

dpvc commented Dec 22, 2020

This seems to affect Safari only when mtextInheritFont is true, but affects Firefox all the time.

I suspect it is due to the transform that inverts the y-coordinates not being handled properly, but haven't verified that. SVG usually has the y-axis pointing down rather than up, so height would be negative and depth positive. We may eliminate that transform in the font update in 2021.

@pdmosses
Copy link

Thanks for this. (I originally intended to submit it as a separate issue, but when I noticed your comment in #2329 about bugs with mtextInheritFont: true in v3, I thought it might be related.)

I'm now using \smash{\raise{2.4ex}{\cssId{#1}{}}} to make targets of href links visible, following a suggestion for addressing a similar issue with hyperref. It's not a general solution, but it works well enough for me in Firefox.

@dpvc dpvc self-assigned this Jan 31, 2021
@dpvc dpvc added this to the 3.1.3 milestone Jan 31, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 29, 2021
@dpvc dpvc removed their assignment Mar 29, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Apr 14, 2021
Update SVG output so that following a link scrolls to the top of the tag.  (mathjax/MathJax#2588)
@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Apr 14, 2021
@dpvc dpvc added Fixed v3.1 and removed Merged Merged into develop branch labels Apr 27, 2021
@dpvc dpvc closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Projects
None yet
Development

No branches or pull requests

2 participants