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

Math "accents" (for vectors, hats etc.) are not properly supported #2150

Open
1 of 3 tasks
Omikhleia opened this issue Oct 25, 2024 · 1 comment
Open
1 of 3 tasks
Assignees
Labels
bug Software bug issue

Comments

@Omikhleia
Copy link
Member

Omikhleia commented Oct 25, 2024

Dear SILE 0.15.5 math enthusiasts,

Let's say you want to typeset a vector $\vec{v}$ (with a nice top arrow) in SILE, or a variable with a fancy hat $\hat{n}$, or a long vector $\overrightarrow{AB}$...

How would you do that?

Quick answer: you can't.

I am not discussing here the issue of stretchy operators, which is a different topic1
... but the correct positioning of accents on top of or under other elements...

And as shown in this issue description here, GitHub is not bad at it. So? 🐽
How hard can it be for such an advanced typesetting system as SILE? 🤡

MathML

One is supposed to use <mover>, <munder>, <munderover> to attach accents to other elements, with specific attributes ("accent" and/or "accentunder", see references below). EDIT: And one might not even have to use them for operator symbols in a pre-defined table, where defaults may apply.

For instance,

  • with U+20D7 ("vec"): <mover accent="true"><mi>x</mi><mo>&#x20D7;</mo></mover>
  • with U+2192 ("rightarrow"): <mover accent="true"><mi>x</mi><mo>&#x2192;</mo></mover>

Try these, and see how SILE currently handles them.
The "accent" attribute is not supported, and the position of the accent somewhat off....
From a quick analysis, SILE's OpenType parser is handing the corresponding MATH features, so it would be at hands...

References:

TeX-like math

In LaTeX, one would use \vec{v}, \hat{n}, \overrightarrow{AB} etc.

What does these produce in SILE?
Let's try.
The commands are recognized, defaulting to atoms.
The argument is lost without warning, and the output is not what one would expect.
Of course, adding a custom \def to handle the mapping to MathML would be possible... But it then falls on the same issue as above.

TL;DR

  • Handle (top) accent attribute in MathML
  • Handle bottom accent attribute in MathML
  • Handle LaTeX-compatible \vec{v} etc. in TeX-like math

Footnotes

  1. See Math operators: stretchy or not stretchy #2148 (although the case here would be on horizontal stretching... erm...)

@Omikhleia Omikhleia added the bug Software bug issue label Oct 25, 2024
@Omikhleia Omikhleia added this to Math Oct 25, 2024
@github-project-automation github-project-automation bot moved this to To do in Math Oct 25, 2024
@Omikhleia Omikhleia self-assigned this Oct 25, 2024
@Omikhleia Omikhleia moved this from To do to In progress in Math Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software bug issue
Projects
Status: In progress
Development

No branches or pull requests

2 participants
@Omikhleia and others