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

Wrong rendering of \overset{\leftarrow} and \overset{\rightarrow} #2800

Closed
tigran123 opened this issue Nov 12, 2021 · 3 comments
Closed

Wrong rendering of \overset{\leftarrow} and \overset{\rightarrow} #2800

tigran123 opened this issue Nov 12, 2021 · 3 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed v2 v3 v3.2
Milestone

Comments

@tigran123
Copy link

Issue Summary

The arrows are rendered incorrectly when \overset{\leftarrow}{a}\overset{\rightarrow}{b} is used.

Steps to Reproduce:

Type $$\overset{\leftarrow}{a}{\overset{\righarrow}{b}$$ in Obsidian and observe the rendered result.

Technical details:

  • MathJax Version: Whatever is used in the latest Obsidian
  • Client OS: Ubuntu Linux 18.04.5
  • Browser: N/A (Obsidian)

Supporting information:

I originally reported this problem on the Obsidian's forum https://forum.obsidian.md/t/wrong-rendering-of-overset/27012 but they said that it is probably a MathJax issue and should be reported here directly.

The correct rendering can be seen on my website here (formula 8 in the section "Hamiltonian Dynamics") http://quantuminfodynamics.com/ which is using whatever MathJax version that is served by the following URL: <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"></script>

or here is the screenshot how it should look like:

Screenshot from 2021-11-12 10-05-48

The incorrect rendering is produced in Obsidian, here is the screenshot:

Screenshot from 2021-11-12 10-03-38

Someone recommended using \overleftarrow and \overrightarrow instead and, indeed, this improved the situation somewhat (the arrow sizes are correct now), but still the vertical alignment is imperfect, see the screenshot:

Screenshot from 2021-11-12 14-43-17

@tigran123
Copy link
Author

tigran123 commented Nov 12, 2021

Just to add that I have reproduced the problem with MathJax live editor at https://decadroid.github.io/mathjax-live-editor/, see the screenshot below:

Screenshot from 2021-11-12 20-34-44

@dpvc dpvc self-assigned this Jan 11, 2022
@dpvc
Copy link
Member

dpvc commented Jan 25, 2022

Sorry for the long delay in responding to this. The issue misrelated to how MathJax translates TeX into MathML. The same construction is used for both accents and other stacked content like that produced by \overset, but the display rules are a bit different in those cases (e.g., non-accents use a smaller font size, and have more room between them and the base). Some characters that are used as accents (like tildes, hats, and arrows) are converted from their normal characters to unicode positions intended for accents, like U+2192 (rightwards arrow) is converted to U+20D7 (combining right arrow above). That should not be done for \overset, however, so this macro should mark such characters as non-accents explicitly. I will make a pull request that fixes the problem.

For now, you can use something like \overset{{}\rightarrow}{a} to avoid MathJax's automatic substitution of accents (since the top now includes non-accent material, the empty braces).

@tigran123
Copy link
Author

Thank you!

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 v2 v3 v3.2
Projects
None yet
Development

No branches or pull requests

2 participants