Since \operatorname* doesn't seem to be supported in math mode (the starred version is to make a following subscript display under the operator name, as with \lim, as opposed to a usual subscript), I discovered a workaround at some point in the past, which was to use \operatorname{foo}\limits instead. However, this appears not to work anymore either, and must have changed fairly recently. Was this change intentional? In either case, could the starred version simply be supported?
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Invalid | None | T185552 Math rendering behavior change for \limits | |||
Resolved | Physikerwelt | T188879 Remove texvc |
Event Timeline
@Physikerwelt do you remember what was up with \operatorname* I remember at some point it wasn't supported by MathJax, but apparently now it is: https://github.com/mathjax/MathJax/issues/739
Is this a texvccheck issue ?
The desired behaviour of \operatorname followed by \limits was a MathJax bug which is now fixed (so can't be used as a workaround) https://github.com/mathjax/MathJax/issues/1225
I'm not sure if I understand what's wrong? What are typical use cases for \opertorname*?
There was a discussion on this at https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Mathematics/Typography#Apparent_bug_in_rendering_\operatorname*
Referring to this edit
https://en.wikipedia.org/w/index.php?title=Repeated_median_regression&oldid=826875205
Basically the user wanted to do
\operatorname*{median}_{j\,\ne\,i} X_{i,j}
so median appears with the conditions underneath. It looks very odd if the subscripts are to the right. There is a workaround using
\operatorname{\underset{\mathit{j\,\ne\,i}}{median}}
but its pretty cumbersome.
A previous workaround was
\operatorname{median}\limits_{j\,\ne\,i} X_{i,j}
this no longer works as it was a MathJax bug which is now fixed.
For me, both, the workaround and the actual presentation look identical; at least with some configuration of LaTeX, c.f.,
https://www.overleaf.com/14237164mpdkhfwtbjtm#/54944235/
How about adding a short hand for the workaround which we call \limOp or some good name which expands to
\operatorname{\underset{\mathit{j\,\ne\,i}}{median}}
?
Or is there more magic that you can do with the starred version of operatorname?
It works in LaTeX, Overleaf, MathJax... but not in Wikipedia because \operatorname*{median}_{j\ne i} gets replaced by \operatorname {*} {median}_{j\ne i} by texvc. None of the starred commands and environments work. Since this is by far not the only modification breaking the LaTeX markup, the goal should be to not modify the input at all.
@Debenben texvc is neither TeX nor LaTeX. That's why Overleaf or MathJax is another story. To make progress, we need a task definition. Currently, I am not sure what the task is. I see three different options:
- fix the regression, i.e., make \operatorname{median}\limits_{j\,\ne\,i} X_{i,j} operate at it used to do before.
- invent a convenience shortcut such as \operatorname[A]{B} which expands to \operatorname{\underset{\mathit{A}}{B}}
- update the texvc grammar to support starred versions of operators
The task should be
- fix the texvc grammar
however this seems to be very difficult and prone to errors and I don't see a reason to modify the input at all. For the mhchem package it took 2 years for someone to fix the grammar for the very basic examples in the visual editor and then it wasn't without introducing other bugs and weired behaviour for more complex things. Thats why I would suggest
- get rid of texvc
To 3)
If texvc was broken we can and should fix it. However, operatorname* is something that is not defined in texvc thus this would technically be grammar expansion, which could be done if T74240 was resolved.
To 4)
This is a different discussion. texvc has two function 1) checking if a input string is a valid texvc expression 2) if so convert it to a LaTeX expression and a list of packages required to render the expression. As a LaTeX user I personally dislike the way how texvc inserts spaces and curly braces, for instance \frac12 -> {\frac {1}{2}}. I tried to change it to \frac{1}{2} but I did not get it through the code review process. That said, I think chances that texvc is removed is not very likely. But feel free to open a task for that.
I would definitely support the removal of texvc.
Whatever a "valid texvc expression" is, \frac12 is a valid LaTeX expression, I don't know any LaTeX program incapable of rendering it: It does not need any conversion. \operatorname* is also a valid LaTeX expression that gets defined in the same amsmath package as the unstarred \operatorname: It does not need any conversion either and the list of packages required to render it is the same. What texvc is doing is either braking valid LaTeX markup or making it harder to read for those that get to see the source code, I cannot see a reason for doing that. Also, when you enter invalid LaTeX, it often gets past texvc and then fails to render.
I don't see the rationale behind keeping texvc. In case there are people opposed to its removal, I hope they have some plan for fixing the obvious bugs.