Page MenuHomePhabricator

Not possible to use \overarc
Closed, ResolvedPublic

Description

Currently, it is not possible to use \overarc with <math>. But it seems \overarc is a standard LaTeX symbol. So no idea if the problem comes from AMS-LaTeX or elsewhere.

An acceptable workaround for the moment is to use \overset{\frown}{AB} instead.

PS and off-topic: It took me some time to find out this "Math (texvc)" component in this product. I was looking for AMS-LaTeX in other product.


Possible Solution:

\overarc is currently not listed in the "math" extensions list about available macros.

The consent from the discussion about this topic seems to be implementing the \overarc function using the &#x23DC; character only for the new native MathML rendering mode.

This can be done by

  • adding \overarch to the list of available macros and then
  • implementing it the same way as, e.g., \overbrace, just with the 23DC character instead of 23DE.

The current workaround from this template https://en.wikipedia.org/wiki/Template:Overarc uses a <span> element, creating a curved line as text decoration in HTML. While this looks more accurate, it cannot be easily replicated using unicode characters in a <math> element. Therefore, I would suggest the approach mentioned above.


Version: unspecified
Severity: normal
See Also:
https://github.com/mathjax/MathJax/issues/567

Details

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:52 PM
bzimport added projects: Math, Upstream.
bzimport set Reference to bz30215.
bzimport added a subscriber: Unknown Object (MLST).

\overarc is not a standard symbol as far as I can tell, it seems to be part of \usepackage{arcs}. It's also not part of MathJax.

Not a standard symbol of what?

Nevertheless, can Wikimedia/AMS-LaTeX/whatever evolve to include this? The arc notation is not something invented in the last 100 years. It's very weird it's not a part of whatever-standard!

Is \overarc supposed to be used in math mode?

\overarc should be easy to implement in the MathJax TeX parser (there is no upstream report so far, though). If the goal is to make the symbol stretch to cover the base, then stretchy variants will need to be supported by the MathJax font (I haven't checked if that's the case).

(In reply to comment #3)

Is \overarc supposed to be used in math mode?

I don't understand the question. If <math> is used, we are in math mode, right?
I want to be able to write <math>\overarc{AB}</math> to show the arc notation.

\overarc should be easy to implement in the MathJax TeX parser (there is no
upstream report so far, though). If the goal is to make the symbol stretch to
cover the base, then stretchy variants will need to be supported by the
MathJax
font (I haven't checked if that's the case).

Please take a look at http://www.codecogs.com/latex/eqneditor.php and put \overarc{AB} inside the text box to see what's supposed to be rendered.

physik wrote:

I'm closing all feature requests that are older than one year... It seems unlikely that someone waits more than a year for a new feature. If the bug is reopened, we see that the feature is still important.

Then let me show you I'm still waiting and it's important.

That's an easy macro to add to texvc.js but there are some technical problems. Mainly, the "right(tm)" way of doing this in MathML would be using the frown entity but only the STIX fonts have the necessary stretchy characters AFAIK.

However, both MathJax and Firefox can stretch overparens, so something like \overset{\mmlToken{mo}{&#x23DC;}}{XYZ} would do the trick.

MathML...? You're talking about the native support from browsers? Well, this bug is talking about <math> inside Wikimedia/Wikipedia. And in the case when end-user browser cannot accept MathML, Wikimedia should generate an image. So, please limit this bug on the server side.

On the other hand, I have just found this article:
http://www.tex.ac.uk/ctan/info/symbols/comprehensive/symbols-a4.pdf
overarc is inside it, so it looks pretty "standard".

physik wrote:

MathML is part of HTML5, so it should be quite standard. And I think it's a good idea to the HTML standard and not to invent custom notation or allow the use of the turing complete programming language \TeX.
"And in the case when end-user browser cannot accept MathML, Wikimedia should generate an image"
That's what's being done.
So back to the question: Do you think
\overset{\mmlToken{mo}{&#x23DC;}}{XYZ}
would solve the problem?

@石庭豐 the new version of the math extension is moving towards MathML, both internally and externally. I.e., TeX input is converted into MathML and rendered into image formats (or just left as is in Firefox). In particular, the mathoid component uses MathJax-node, hence my example of a MathJax-compatible macro.

You can try the macro mentioned above on e.g., http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic-2.html to see a sample rendering. It's not ideal but it seems much better than nothing.

Note that this is not easy in TeX/LaTeX either, see e.g., http://tex.stackexchange.com/questions/86044/represent-an-arc-over-letters for a solution which is why the old (LaTeX+dvi2png based solution) never added it. IMHO, another plus of physikerwelt's awesome work of moving the extension towards MathML.

(In reply to Peter Krautzberger from comment #10)

@石庭豐 the new version of the math extension is moving towards MathML, both
internally and externally. I.e., TeX input is converted into MathML and
rendered into image formats (or just left as is in Firefox).[deleted]

Thanks! That's the missing part of information I needed to understand.

Converting TeX --> MathML --> PNG .... well, that's quite an indirect way of rendering math expressions. But if you are sure it's working at 100%, why not? :)

You can try the macro mentioned above on e.g.,
http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic-2.html to see a
sample rendering. It's not ideal but it seems much better than nothing.

I have tried it but nothing is rendered - I could provide a screenshot if you like. I had also put it inside <math>...</math> tags but still nothing. I had also tried it in Wikipedia's sandbox but nothing came out (which was expected, I suppose)

(In reply to physikerwelt from comment #9)

[deleted]
So back to the question: Do you think
\overset{\mmlToken{mo}{&#x23DC;}}{XYZ}
would solve the problem?

There are two aspects to this question: 1) rendered result and 2) facility.
For 1: as I cannot see any result, I cannot answer.
For 2: are you saying that
a) Wiki editors have to type your expression instead of \overarc{XYZ} in order to have the arc symbol? or
b) \orverarc{XYZ} will be translated into your expression internally?

If you're implying a), then the answer is "no, it would not solve the problem" because
i) the TeX syntax is overarc (for those who know TeX, of course) but you force users to use undocumented tweak without telling them what to do exactly;
ii) in the case \overarc is not supported, I would the TeX syntax I provided (\overset{\frown}{AB}) which is a LOT shorter and cleaner. So the answer is still "No"

If you're implying b), of course, that would solve the problem.

Typo error - I wanted to write:
... in the case \overarc is not supported, I would *prefer* the TeX syntax I provided ...

physik wrote:

peters preview

石庭豐, thank you very much for providing feedback here.
Of course users are supposed to type \overarc{XYZ} which would then be internally translated to something else similar to the newcommand LaTeX command.
See a screenshot of Peters demo page attached.
Screenshots aver very helpful for this kind of bug.

Attached:

overarc.png (422×372 px, 55 KB)

(In reply to physikerwelt from comment #13)

Created attachment 16813 [details]
peters preview

Oh, the dollar sign! :D

OK, visually it's acceptable --> point 1 is OK

Of course users are supposed to type \overarc{XYZ} which would then be
internally translated to something else similar to the newcommand LaTeX command.

--> point 2 is OK too.

So in all, YES!, the proposal would solve the problem :)

Thanks

Attached:

overarc.png (422×372 px, 55 KB)

Pkra moved this task from texvc to New TeX macro proposals on the Math board.

This template implements a workaround using the CSS border-radius property, though built-in support would be much more semantically correct.

Ni1313 updated the task description. (Show Details)
Ni1313 updated the task description. (Show Details)
Ni1313 updated the task description. (Show Details)

Change 980019 had a related patch set uploaded (by Ni1313; author: Ni1313):

[mediawiki/extensions/Math@master] added support for \overarc according to T32215

https://gerrit.wikimedia.org/r/980019

Change 980019 had a related patch set uploaded (by Ni1313; author: Ni1313):

[mediawiki/extensions/Math@master] added support for \overarc according to T32215

https://gerrit.wikimedia.org/r/980019

tested locally, looks fine

image.png (50×170 px, 6 KB)

Change 980019 had a related patch set uploaded (by Physikerwelt; author: Ni1313):

[mediawiki/extensions/Math@master] add support for \overarc

https://gerrit.wikimedia.org/r/980019

Change 980019 merged by jenkins-bot:

[mediawiki/extensions/Math@master] add support for \overarc

https://gerrit.wikimedia.org/r/980019

Ni1313 updated the task description. (Show Details)
Ni1313 updated the task description. (Show Details)

Change 991318 had a related patch set uploaded (by Ni1313; author: Ni1313):

[mediawiki/extensions/Math@master] Manually added test for \overarc to TexUtil-Ref.json

https://gerrit.wikimedia.org/r/991318