Page MenuHomePhabricator

Let users click on a list of all the formula fragments to insert them
Closed, ResolvedPublic40 Estimated Story Points

Description

Math formulae are currently edited using a live inspector, and a knowledge of LaTeX is required. We could make the process easier for people who are not LaTeX experts by offering a syntax helper, similar to those found in other tools. Three elements common to such tools are: an input in which to write LaTeX directly, symbol buttons that insert LaTeX into the input and a live rendering.

Most of this functionality can be achieved by combining classes that already exist in ooui, and putting them together in a dialog. This is a tracker bug for making a new math dialog to replace the math inspector.

Event Timeline

Tchanders claimed this task.
Tchanders raised the priority of this task from to Needs Triage.
Tchanders updated the task description. (Show Details)
Tchanders added a project: VisualEditor.
Tchanders subscribed.
Tchanders set Security to None.
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from To Triage to Blocked on the VisualEditor board.

By the way... I like http://www.wiris.com/ maybe this gives additional inspirations

@Jdforrester-WMF @Tchanders

https://phabricator.wikimedia.org/M96/285/ what about something like this?
tabs on top to scroll to the correct section of the vertical list. the tabs represent the group of formulae.
the first one is a clock (frequent, often) next one if a function, so for example if you click on the 'theta" sign, it will scroll down to the trigonometric functions.

@Nirzar: Thank you for your nice draft.
I have a few comments:

  1. \begin{equation} -> this should be handled by the inline/displaystyle flat that is currently used.
  2. \label{simple_equation} -> this is the current id field
  3. I have data on the frequency distributions on the tokens used https://gitlab.tubit.tu-berlin.de/data/wikiFormulae/tree/master additional statistics are really simple to obtain from that dataset
  4. I'm working on a program that evaluates the "quality" of the texvc TeX code and will give suggestions on possible bad input such as using $sin x$ instead of $\sin x$. T116264 Would that fit into your design?

@Hcohl: I think this is a really cool draft. What do you think as a mathematician?

Now we have access to Ace Editor in VE (https://gerrit.wikimedia.org/r/#/c/247851/) we can also put LaTeX syntax highlighting in the text input.

Jdforrester-WMF renamed this task from Make math syntax helper dialog to Let users click on a list of all the formula fragments to insert them.Nov 14 2015, 12:41 AM

Change 253374 had a related patch set uploaded (by Tchanders):
WIP Make math dialog with clickable list of formula fragments

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

@Physikerwelt Thanks for your comments.

We could use the frequency data to have a special group of frequently used commands at the top of the menu. We are also planning a card-sort style survey to inform the grouping (https://en.wikipedia.org/wiki/Card_sorting).

The quality tool could help. The buttons should of course always insert the better quality commands, but also the user is also able to type freely into the text input, so bad quality commands could still creep in.

Jdforrester-WMF raised the priority of this task from Low to High.Nov 20 2015, 7:58 PM

The math dialog is currently looking like this:

Screenshot from 2015-11-23 16-53-31.png (721×1 px, 56 KB)

...and the latest patch set is here: https://gerrit.wikimedia.org/r/253374
Comments and suggestions welcome.
@Physikerwelt @Hcohl Any comments as mathematicians/LaTeX users?

@Tchanders that looks really nice. Is there a demo where one can try that?
Some general ideas:

  • Do you have plans to support autocompletion? I tried autocompletion yestday the first time and it seems to be extremly easy to implement...http://www.formulasearchengine.com/sites/formulasearchengine.com/files/android.txt is a list that I use for my phone to type math into wikis...
  • The rendering looks like the preview rendering looks like the old PNG rendering. A lot of users have already switched to the new MathML SVG rendering. So it would be nice if VE could also support that. (I'm happy to help if there a questions on that).
  • Where does the script to generate the SVG images point to? Is there a documentation how one can change the layout in the future?
  • Why not using MathML as button Layout for Firefox users?

Change 253374 merged by jenkins-bot:
Make math dialog with clickable list of formula fragments

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

@Tchanders that looks really nice. Is there a demo where one can try that?
Some general ideas:

Doing as T119549: Make use of Ace Editor's autocompletion in the math dialog.

  • The rendering looks like the preview rendering looks like the old PNG rendering. A lot of users have already switched to the new MathML SVG rendering. So it would be nice if VE could also support that. (I'm happy to help if there a questions on that).

That's T62728: Parsoid doesn't have a mode to tailor rendered content based on user preferences, yup. Would be lovely to fix that.

  • Where does the script to generate the SVG images point to? Is there a documentation how one can change the layout in the future?

It uses mathoid via RESTbase. It's possible to change

  • Why not using MathML as button Layout for Firefox users?

I think that would add huge complexity for very little value compared to the pre-rendered SVG icons.