While my version of LaTeX does not seem to support px, people were using it. It is easy to add support for this, at the cost of the expression no longer being copyable from Wikipedia to LaTeX. I don't have a strong preference for either. But maybe we keep it as is and decide later to deprecate support for px lengths.
Description
Details
| Subject | Author | Repo | Branch | Lines +/- | |
|---|---|---|---|---|---|
| Accept px as a length unit | Physikerwelt | mediawiki/extensions/Math | master | +281 -259 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Stalled | None | T324931 Clean up open RESTBase related tickets | |||
| Open | None | T262315 <CORE TECHNOLOGY> API Migration & RESTBase Sunset | |||
| Open | None | T380348 [EPIC] Re-route services through RESTGateway and remove code from RESTBase codebase | |||
| Open | Feature | JeanCASPAR | T397585 Provide a macro for putting arbitrary Unicode content in <mo> tag | ||
| Open | Physikerwelt | T271001 Transition to client-side MathJax SVG rendering as default | |||
| Open | BUG REPORT | Physikerwelt | T375238 Client-side MathJax rendering problems | ||
| Open | None | T375318 "MathML only" mode formatting bugs (mathmode=native) | |||
| Resolved | BUG REPORT | Physikerwelt | T375295 \begin{align} with font sizes specified show font size annotation [6pt] in MathML mode | ||
| Resolved | Physikerwelt | T380654 vertical space between multline equations is ignored | |||
| Resolved | Physikerwelt | T438415 Support px as LaTeX length unit |
Event Timeline
Change #1342811 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):
[mediawiki/extensions/Math@master] WikiTexVC: Accept px as a length unit
The units advertised by https://en.wikipedia.org/wiki/Help:Displaying_a_formula are:
em, mu, ex, in, pc, pt, cm, mm
(I wouldn't have a problem if we reduce the number of supported units, and do some kind of Wikipedia-wide find/replace to fix any examples which use non-standard units. But we should make sure we don't leave any articles broken.)
We should probably make all our units relative rather than absolute, and base the interpretation of units on whatever currently happens in the "server-side SVG" mode. I don't think most Wikipedia authors are very scrupulous about picking the correct units, so we want to keep the appearance (i.e. relative spacing) the same as the current version, even if font sizes, devices, display resolutions, etc. change.
Ok, the current LaTeX Syntax checker accepts the units from the manual + some extra cases. Anything else is not detected as and thus rendered as Tex in the next line. There is unfortunately jet another problem. The correct MathML spacing is not picked up by mathjax. I will open another ticket.
Maybe we just hold a vote on whether we want px. I would not ask if people would prefer to find [some invalid length spec] because that might make it more difficult to type something that starts with a [ on a new line. Ok?
I make it 119 uses in en wikipedia. Some quite high profile articles like Platonic solid, and Bessel function. So a yes from me.
In the current "server-side SVG" mode, px and pt behave exactly the same.
So 2 possible approaches:
(1) your implementation treats these identically
(2) we run a search and turn every instance of px into pt across English Wikipedia
@Jacobolus, thank you. The downside of (2) is that we can't change history, so permanent links would still show broken formulae. I think, therefore, we can just merge the minimal change I suggested (1).
I'm not too worried about permalinks.
Mediawiki has profoundly broken permalinks, because transclusion (templates) always uses the current version of the transcluded resource rather than the historical version.
But sure, supporting 'px' as an alias for 'pt' would be fine. (I am not seeing where in the code the size of the unit is defined, and I don't really understand why making a trivial change like this requires modifying hundreds of lines of code.)
Change #1342811 merged by jenkins-bot:
[mediawiki/extensions/Math@master] Accept px as a length unit