Last modified: 2014-10-19 18:02:56 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 T37477, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35477 - Remove (or improve) hack for integrals from wiki2jax.js
Remove (or improve) hack for integrals from wiki2jax.js
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://leuksman.com/mw/index.php/Inte...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-26 09:15 UTC by Michael M.
Modified: 2014-10-19 18:02 UTC (History)
6 users (show)

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


Attachments

Description Michael M. 2012-03-26 09:15:06 UTC
The ConvertMath function in MathJax/extensions/wiki2jax.js contains a strange hack which should be removed in my opinion, or at least improved and documented properly.

It transforms various hacks used to produce multiple integral signs with a circle to something, which probably should look more nicely. That it doesn't work as expected is shown on http://leuksman.com/mw/index.php/Integral, where the first formula is destroyed. If hacks in TeX produce ugly output, well, then those hacks should be avoided, not other hacks used.
Comment 2 Derk-Jan Hartman 2013-04-28 10:32:09 UTC
@Micheal, do you still have that integral example somewhere ?
Comment 3 Gerrit Notification Bot 2013-04-28 10:32:20 UTC
Related URL: https://gerrit.wikimedia.org/r/61253 (Gerrit Change I1159f6ca33314aa985a44f357c8c4c6ccbc4b188)
Comment 4 Michael M. 2013-04-30 08:49:58 UTC
(In reply to comment #2)
> @Micheal, do you still have that integral example somewhere ?

Sorry, but no. I think it was something like
\iiint\!\!\!\!\!\subset\!\supset x = \iiint\!\!\!\!\!\subset\!\supset x
where the greedy .* removes everything between the two integrals.
Comment 5 nageh 2013-06-16 22:34:35 UTC
Thanks Michael, I was not aware of this bug. Fixed in https://en.wikipedia.org/w/index.php?title=User%3ANageh%2FmathJax%2Fconfig%2FTeX-AMS-texvc_HTML.js&diff=560211605&oldid=556755207

@DJ: Is this the issue mentioned at https://gerrit.wikimedia.org/r/#/c/61253/ and at my talk page? If not, make sure \oiint and \oiiint are defined as macros in texvc.js. In that case, either will MathJax substitute these commands by their respective characters (STIX fonts) or setupPrefilter (wiki2jax.js) will replace the commands by some lengthy complicated macros that simulate their appearance (TeX fonts).
Comment 7 Derk-Jan Hartman 2013-06-26 15:57:57 UTC
@Nageh, this is mathjax specific ? We don't have it as part of texvc ?
Comment 8 Derk-Jan Hartman 2013-06-26 16:03:58 UTC
LaTeX packages providing \oiint and/or \oiiint : mathdesign, wasysym, mathabx, txfonts

http://tug.org/pipermail/texhax/2004-September/002706.html
Comment 9 Derk-Jan Hartman 2013-06-26 16:11:12 UTC
and esint apparently
Comment 10 nageh 2013-06-26 17:26:22 UTC
Not sure what you mean. MathJax isn't TeX, it only emulates standard (mostly math mode) commands and macros as well as a subset of the widely used AMSsymbols and AMSmath packages (and parts of a few other packages), so we can't include other TeX packages as such. (I guess you knew that.)

\oiint and \oiiint are supported by neither MathJax nor texvc; however, hacks to emulate these symbols are so widespread on en.wiki (see https://en.wikipedia.org/wiki/Help:Latex#.5Coiint_and_.5Coiiint) that I have decided to let mathJax automatically detect these hacks and to either replace them by native symbols (STIX fonts) or to at least fix the visual appearance of these hacks (TeX fonts). In addition, in both cases, what is presented to the reader as TeX code (MathJax menu -> Show Math As -> Tex Commands) is "\oiint" and "\oiiint" rather than the (unreadable) hacks.

It might be a concern if \oiint and \oiiint are supported by mathJax but not by the default texvc implementation. There are two obvious solutions to this: add support for these symbols to MediaWiki's default texvc implementation, or prevent users from directly using the symbols in MathJax (I'd need to think about how to best implement that).
Comment 11 Derk-Jan Hartman 2013-07-01 13:49:01 UTC
We should not support things in our MathJax mode that are not supported by texvc. (There are a few already and that is a different ticket).

So yes, my idea was to add support for these symbols to texvc, possibly using the esint package (it seems the 'slimmest' package that is adding these symbols.
Comment 12 Derk-Jan Hartman 2013-07-01 13:53:50 UTC
BTW, however added that advice of the workaround to the page should have just thrown the workaround into a template. This is gonna be a nightmare to 'retroactively' fix.....
Comment 13 Gerrit Notification Bot 2013-07-01 14:02:52 UTC
Change 61253 abandoned by TheDJ:
Bug 35477: Improve transformations of iint and oiint

Reason:
After consultation with Nageh, this should probably be removed from the MathJax mode.

https://gerrit.wikimedia.org/r/61253
Comment 14 nageh 2013-07-01 22:47:12 UTC
Hm, my regex code is certainly versatile enough to catch all these hacks and transform them into ordinary symbols. I'm not sure leaving the situation as is is the best idea. Certainly, I would prefer adding oiint and oiiint support to both MathJax and texvc. It would be interesting what others think of this.
Comment 15 nageh 2013-07-01 22:53:07 UTC
Btw, \oiiint is only supported by txfonts/pxfonts (and mathdesign in a somewhat less pretty shape).
Comment 16 nageh 2013-07-01 22:55:37 UTC
Oh, and if you remove the code from the MathJax mode then the hacks will look horrible, that is, they will be incompatible between MathJax and texvc. So, even if you do not want to directly support the symbols in MathJax mode the code should still stay - only the symbols should be precluded from directly being used by a user.
Comment 17 physikerwelt 2014-10-19 18:02:56 UTC
https://en.wikipedia.org/wiki/Gauss%27s_law#Integral_form_2 looks good for me now.

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


Navigation
Links