Last modified: 2014-07-09 18:04:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60201, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58201 - How to reconfigure MathJax to handle MathML as well as TeX, for compatibility with other extensions
How to reconfigure MathJax to handle MathML as well as TeX, for compatibility...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
REL1_21-branch
All All
: Unprioritized normal (vote)
: ---
Assigned To: physikerwelt
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-09 07:36 UTC by Lee Worden
Modified: 2014-07-09 18:04 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Lee Worden 2013-12-09 07:36:18 UTC
I've had a complaint that my extension (WorkingWiki) and the Math extension can't both be used in the same wiki, at least not when both are configured to use MathJax.  It looks like the problem is that you can either have WW configure MathJax to accept MathML input or have the Math extension configure it to accept TeX/texvc input, but not both.  I've had a look in the Math code, and I don't see a straightforward way to tweak its MathJax config to get it to add MathML input to the other things it's doing.  Do you think it's possible?  Would I need to create an alternative to TeX-AMS-texvc_HTML.js and swap in that filename in the mathJax.config object, after the config object is created but before it's used?
Comment 1 physikerwelt 2013-12-09 08:34:08 UTC
Hi Lee,

I see two main problem here:
One problem is, that the Math extension uses the tag name math that causes confusion with the xml element math. I think it would be better if the math tag would be renamed to e.g. m. But I have doubts that this will find a large acceptance since the tagname math is familar to a lot of people.
In the LaTeXML mode you can use MathJax to display MathML.
See http://demo.formulasearchengine.com/ for a demo.
However, with MathJaX 2.2 we did not find a way to accept both inputs (MathML and texvc) on the same page.
I think that has improved with MathJax 2.3 but I did not try that.
Please be aware that MathJax has another (I think much easier way) to adjust the configuration.
MathJax 2.3 has already been ported to the Math extension. However, the code review process did not make any progress in the last two month, which is a little bit unfortunate. I added you as a reviewer so you can have a least a look how the things should change.

Best
Moritz
Comment 2 Lee Worden 2013-12-09 08:45:29 UTC
Thank you, Moritz.  I don't have a problem with a conflict between the extension's math tag and the mathml element, because I'm not looking to include mathml elements in the wiki page source code, only in the HTML output that my extension produces.  I only want to tell MathJax to process the mathml math element in addition to your tex inputs.

Unfortunately I also have a user who wants to use both extensions in MediaWiki 1.21, so the LaTeXML mode isn't available.

What is the easier way to adjust the MathJax configuration?

Best
Lee
Comment 3 physikerwelt 2013-12-09 12:10:04 UTC
Lee,
Since Math2.0 produces MathML output as well the problem should no longer exist. I have just tested the old issue (with MathML and texvc on the same page) and even this problem has been resolved.

I have the impression that the configuration of MathJax is much more structured and easier to understand.
See
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMath/c2d9ed1559a9277b8f757f36bbc44f8b0da3b5b1/modules%2Fext.math.mathjax.enabler.js#L31

jax: ['input/TeX','input/MathML','output/NativeMML','output/HTML-CSS']

For the configuration of MathJax for Math2.0 that accepts MathML and TeX input.

Best
Moritz
Comment 4 Lee Worden 2013-12-09 23:35:13 UTC
Thanks, Moritz!

It sounds like there may be two ways to use WW and Math together: upgrade to 1.22, and Math 1.0's mathjax configuration will handle mathml elements when it's in LaTeXML mode; or install Math 2.0 from the unmerged gerrit patch, and its mathjax will parse mathml in all Math extension modes.  Does that sound right to you?

I assume Math 2.0 requires MW 1.22 or 1.23?

As another possibility, it looks to me from debugging this issue that whichever x-mathjax-config element appears first in the page is the one used.  So it might be that I can have my extension insert one of those early, causing it to load mathjax 1.23 with both kinds of input enabled, and it will work with the output of the current 1.0 Math extension in MW 1.21, overriding the Math extension's mathjax config.  I guess I would have to do some extra work to include the texvc processing, but since this is for non-WMF wikis, people may not care for that anyway.  Do you think that would fail?

Best,
Lee
Comment 5 Peter Krautzberger 2013-12-12 06:08:02 UTC
Just a comment from the MathJax side of things. MathJax will read all configurations and they will be joined up -- but values overwrite each other, so the last output config wins.
Comment 6 physikerwelt 2013-12-12 12:18:38 UTC
Hi Lee,

there is a dependenciy to MW 1.22 if XML Checking is desired.
However not having 1.22 produces a warning only. 

Mathml 2.0 seperates the texvc sanitizing and rewriting of mediawiki specific functions from the actual conversion from latex source to png images.
The output of texvccheck is normal latex output that does not require special treatment.

Best
Moritz
Comment 7 Lee Worden 2013-12-12 19:34:35 UTC
Great - thanks to both of you!

I'll try switching to latexml mode in 1.21 and see if it resolves the problem.

Best
Lee
Comment 8 Lee Worden 2013-12-27 20:20:11 UTC
Yes - this works great!
Comment 9 Gerrit Notification Bot 2014-03-24 05:15:36 UTC
Change 120486 had a related patch set uploaded by Physikerwelt:
Expiremental option MathML input

https://gerrit.wikimedia.org/r/120486
Comment 10 Gerrit Notification Bot 2014-03-24 05:21:59 UTC
Change 120486 merged by jenkins-bot:
Expiremental option MathML input

https://gerrit.wikimedia.org/r/120486
Comment 11 Andre Klapper 2014-07-09 09:15:30 UTC
All patches mentioned in this report are either merged or abandoned - is there more work left to do here (if yes: please reset the bug report status to NEW or ASSIGNED), or can you close this ticket as RESOLVED FIXED?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links