Jump to content

Talk:Community Wishlist/W141

Add topic
From Meta, a Wikimedia project coordination wiki

First step

[edit]

As a first step

  1. Provide insert options in the source and visual editors for, e.g.,
    • ‎<math>...‎</math>
    • {{mvar}}
  2. Provide copy and paste source options in the visual editor.

This should be much easier than rendering to en:MathML. -- Chatul (talk) 14:27, 30 July 2024 (UTC)Reply

MathML is supported

[edit]

There is an option in your preferences to use MathML. However support is not complete among browser vendors and there are still some issues with the browser support. But it is getting better a lot lately. —TheDJ (talk • contribs) 09:20, 31 July 2024 (UTC)Reply

Sorry, I should've been clearer: yes, MathML is supported; however, in my humble opinion, it should be enabled by default if the user agent supports it. Jean Abou Samra (talk) 10:06, 31 July 2024 (UTC)Reply
[edit]

Please note that there are a lot of discussions and pages on this topic, including:

Mathwriter2718 (talk) 17:57, 31 July 2024 (UTC)Reply

[edit]

I notice it just says Wikipedia, but were such a gadget to be deployed, it would be of great use on Wikibooks as well. --SHB2000 (t • c) 11:01, 10 August 2024 (UTC)Reply

Visual editor

[edit]

@Jean Abou Samra, have you tried inserting formulas using the visual editor? You may find it easier than typing TeX source manually. Perhaps it already addresses your wish. Amir E. Aharoni (talk) 16:13, 11 August 2024 (UTC)Reply

Thanks for the tip, but even with the annoyance of <math></math>, I can type much faster in plain text than with virtually any rich text editor. Jean Abou Samra (talk) 18:24, 11 August 2024 (UTC)Reply

Response to the wish

[edit]

@Jean Abou Samra Thank you for submitting your wish! We are working with internal stakeholders to figure out next steps, such as feasibility and prioritization. We’ll keep you posted about it. Sannita (WMF) (talk) 14:51, 27 November 2025 (UTC)Reply

Thanks for your patience! This is currently in progress with the help of a volunteer - see the Phabricator ticket: https://phabricator.wikimedia.org/T419104 MikeZ-WMF (talk) 16:17, 17 March 2026 (UTC)Reply

Potentially helpful features from CodeMirror

[edit]

As noted above, auto-closing tags as you type them is being looked into at phab:T419104. A gracious volunteer, @析石父, already has a working patch up for review. I wanted to run it by watchers of this wish to make sure it meets our needs.

The idea is that, with CodeMirror (syntax highlighting) enabled, you only have to type the opening <math> tag, and the closing one will be added automatically after typing </ (and same for any HTML tag), saving you a bit of typing. Even for the opening tag, the autocompletion feature can reduce the number of keystrokes. Say you type <ma then choose <math> from the list of suggestions. The closing is tag added also, and the cursor is put in between the opening and closing tag.

That I hope is an improvement, but I think we can go even further. We could introduce a dedicated keyboard shortcut to add <math></math> and put the cursor in the middle. That I assume would help, too? Maybe Ctrl+m, as that doesn't seem to be used by anything at the moment. There could also be a button in the editor toolbar. We could even make it only apply on Math-related articles, such by searching whether there are already ‎<math>...‎</math> tags on the page, or that the page was in the automatically-added tracking category for the Math extension.

As for shorter syntax like $x$, indeed as mentioned in the wish, this is only something we could only offer as an opt-in feature, such as through a new CodeMirror preference. Given how MediaWiki parsing works, however, we would need to make it so that typing $x$ immediately transforms to <math>x</math>, so the $ symbols wouldn't stay there after saving. Would that still be useful? Similar to above, we could make this feature only function on Math articles to avoid unwanted side effects on other pages.

Let us know how this sounds! Unrelated to CodeMirror, I think we could probably fix or improve the copy/pasting of formulas, too.

Pinging the proposer @Jean Abou Samra for input. Best, MusikAnimal (WMF) (talk) 00:32, 18 March 2026 (UTC)Reply

Follow-up to the above: We have implemented phab:T419104 which works similarly. Now, when you type an opening tag, the closing tag is automatically inserted and the cursor placed in between. This should reduce the keystrokes needed to simply type i.e. <math>E</math>. The auto-closing of tags was also deemed of strategic benefit for editors in general, so it was great we got that added as a result of this wish!
In addition, we've done phab:T420524, which adds a button to insert math formulas (inline or block) in the 2010 editor. This is available in the "Advanced" section of the toolbar. I did not bother with detecting if the page was Math-related, as that turned out to be a bit tricky. Regardless, I assume users may always want access to the formulas buttons as they might occasionally want a math formula on a page that didn't previously have one.
Beyond that, as we haven't heard back from @Jean Abou Samra, I've been sort of working in the dark. Making $X$ would be feasible, but comes with the above mentioned caveats. I also think the new auto-closing of tags should should help in that regard, so possibly the $X$ solution isn't really needed after all. Copying and pasting formulas is something we can look into, but I think that might be better fit for a separate wish.
With that, I'm going to mark this wish as "Done". Thanks for participating in the Community Wishlist! MusikAnimal (WMF) (talk) 18:03, 31 March 2026 (UTC)Reply