Feature requested:
We want MediaWiki to support more LaTeX commands in its <math> environment.
This was a wish in the 2022 wishlist: https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2022/Editing/Missing_LaTeX_capabilities_for_math_rendering
Functionality/software changes
These commands should already be supported by MathJax. So, all we have to do is change texvcjs to allow these commands to be passed to MathJax in the backend.
- Extra commands are supported by texvcjs
Commands which we probably could support. I only looked at commands in the AMSMath package/extension.
Individual commands which will be implemented in this ticket (with the exceptions noted in T318524#8263301):
- \notag
- \nobreakspace
- \dddot
- \ddddot
- \substack
- \ref
- \idotsint
- \negmedspace
- \negthickspace
- \negthinspace
- \rvert
- \lvert
- \shoveright (implemented in T318782)
- \shoveleft (implemented in T318782)
- \label
- \eqref
- \mathring
- \boxed
- \genfrac
- \tag
- \smash
Environments (these will be implemented in T318701):
- gather
- gathered
-
smallmatrix(already implemented) - multline
- CD
- split
- subarray
Other TODO items prior to deployment
- Communicate with the math mailing list (https://lists.wikimedia.org/hyperkitty/list/math@lists.wikimedia.org/thread/H5ASGZTDPVPUS7XZWIDROPM234CTTTST/)
- Update texvcjs npm package
- Update mathoid to include new texvcjs package
- Deploy mathoid to beta for testing
- Deploy mathoid to production
- Update documentation (e.g. https://meta.wikimedia.org/wiki/Help:Displaying_a_formula)
Notes for testing
There are at least three aspects of testing this:
- Aesthetic
- Do newly implemented commands display on a MediaWiki article the same as when rendered locally with LaTeX?
- Examples: P34940
- Other examples can be found on the internet, including https://en.wikibooks.org/wiki/LaTeX and https://www.onemathematicalcat.org/MathJaxDocumentation/TeXSyntax.htm
- Do newly implemented commands display on a MediaWiki article the same as when rendered locally with LaTeX?
- Parsing
- The changes are mostly to how LaTeX gets parsed. We want to make sure that the parser is reasonably robust against a range of possible syntax for expressing the commands.
- Perhaps searching on the internet for real-life examples of the newly implemented commands, rather than contrived examples.
- The changes are mostly to how LaTeX gets parsed. We want to make sure that the parser is reasonably robust against a range of possible syntax for expressing the commands.
- Regression
- Make sure existing LaTeX commands continue to display as they did before. You can take advantage of pages which already make heavy use of LaTeX such as https://meta.wikimedia.org/wiki/Help:Displaying_a_formula.