Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

MathJax integration to stock MediaWiki Math extension? (was RFC: math options)

 

 

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


brion at pobox

Nov 28, 2011, 4:42 PM

Post #1 of 5 (1536 views)
Permalink
MathJax integration to stock MediaWiki Math extension? (was RFC: math options)

On Mon, Nov 28, 2011 at 3:16 PM, Brion Vibber <brion [at] pobox> wrote:

> On Mon, Nov 28, 2011 at 3:05 PM, MZMcBride <z [at] mzmcbride> wrote:
>
>> Brion Vibber wrote:
>>
> [.snip my notes about removing the non-PNG non-source options, wanting
> higher-resolution renderings]
>
>> Did you have a chance to evaluate MathJax? <http://www.mathjax.org/> I
>> know
>> it's come up in past math discussions and that a lot of math folks think
>> it
>> looks promising. A technical analysis of its feasibility on Wikimedia
>> wikis
>> would be great. Killing the less-used, ancient math options is great, but
>> perhaps adding one wouldn't be too bad to do too. :-)
>>
>
> That's an excellent thing to bring up -- MathJAX *does* look very
> promising, and things seem to render pretty nicely. Need to make sure that
> we can either do that type of rendering cleanly with the PNG fallback
> (older browsers will still need the PNGs, so it may still be worth spending
> the time to fix baselines).
>

I've done a quick experimental mode commit:
<https://www.mediawiki.org/wiki/Special:Code/MediaWiki/104521>

definitely promising in terms of things look nice. :)

Total library size is pretty large but that includes a bunch of fallback
images which will be rarely used; don't have a good sense of the 'weight'
of including the library yet. It does load a bit slowly, but hopefully
won't interfere much while it does so.

The initial method I'm using is to output the latex source in a <script
type="math/tex"> which MathJax recognizes, and then putting the image or
text source form in a <noscript> next to it. Browsers with JS off or
unavailable will use the fallback image/text silently, while those with
script will get the pretty math inserted at runtime.

This isn't perfect though, and for instance breaks on MobileFrontend
because the <script> that actually _loads_ MathJax doesn't get loaded, and
on top of that the fallback images are still in <noscript>. ;) Also,
browsers that have script support but don't work with MathJax won't load
images, so this is insufficient.

Most compatible thing is probably to let it include the images/text form
as-is, then make sure MathJax goes over and replaces them in-place. It
might need tweaks to understand the images (source in alt text).

I'm hoping to get some feedback and advice from folks who have worked with
MathJax previously; I'll whip up some detail notes as an RFC page in a bit.

-- brion
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


z at mzmcbride

Nov 28, 2011, 5:25 PM

Post #2 of 5 (1474 views)
Permalink
Re: MathJax integration to stock MediaWiki Math extension? (was RFC: math options) [In reply to]

Brion Vibber wrote:
> On Mon, Nov 28, 2011 at 3:16 PM, Brion Vibber <brion [at] pobox> wrote:
>
>> On Mon, Nov 28, 2011 at 3:05 PM, MZMcBride <z [at] mzmcbride> wrote:
>>
>>> Brion Vibber wrote:
>>>
>> [.snip my notes about removing the non-PNG non-source options, wanting
>> higher-resolution renderings]
>>
>>> Did you have a chance to evaluate MathJax? <http://www.mathjax.org/> I
>>> know
>>> it's come up in past math discussions and that a lot of math folks think
>>> it
>>> looks promising. A technical analysis of its feasibility on Wikimedia
>>> wikis
>>> would be great. Killing the less-used, ancient math options is great, but
>>> perhaps adding one wouldn't be too bad to do too. :-)
>>>
>>
>> That's an excellent thing to bring up -- MathJAX *does* look very
>> promising, and things seem to render pretty nicely. Need to make sure that
>> we can either do that type of rendering cleanly with the PNG fallback
>> (older browsers will still need the PNGs, so it may still be worth spending
>> the time to fix baselines).
>>
>
> I've done a quick experimental mode commit:
> <https://www.mediawiki.org/wiki/Special:Code/MediaWiki/104521>
>
> definitely promising in terms of things look nice. :)
>

Sweet, thanks! I forwarded it to some math folks.

I also saw your comments at
https://bugzilla.wikimedia.org/show_bug.cgi?id=31406#c6

Nice work. :-)

MZMcBride



_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


roan.kattouw at gmail

Nov 29, 2011, 12:44 AM

Post #3 of 5 (1442 views)
Permalink
Re: MathJax integration to stock MediaWiki Math extension? (was RFC: math options) [In reply to]

On Tue, Nov 29, 2011 at 1:42 AM, Brion Vibber <brion [at] pobox> wrote:
> Most compatible thing is probably to let it include the images/text form
> as-is, then make sure MathJax goes over and replaces them in-place. It
> might need tweaks to understand the images (source in alt text).
>
You may want to do a quick check for MathJax support in a script in
the <head> (which executes before the browser renders the page) which
then adds some CSS that ensures the images aren't loaded but the space
is still reserved (something like visibility: hidden; on the image).

Roan

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


cbm.wikipedia at gmail

Nov 29, 2011, 5:02 AM

Post #4 of 5 (1476 views)
Permalink
Re: MathJax integration to stock MediaWiki Math extension? (was RFC: math options) [In reply to]

On Mon, Nov 28, 2011 at 7:42 PM, Brion Vibber <brion [at] pobox> wrote:
> I've done a quick experimental mode commit:
> <https://www.mediawiki.org/wiki/Special:Code/MediaWiki/104521>

This sounds great. MathJax is used on some other math-intensive sites,
e.g. MathOverflow.net, and in general it does a very nice rendering
job.

When the Mediawiki support for MathJax gets to the right stage, it
would be helpful to have it enabled on the labs wiki, so people can
test it out.

- Carl

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


brion at pobox

Dec 5, 2011, 5:25 PM

Post #5 of 5 (1440 views)
Permalink
Re: MathJax integration to stock MediaWiki Math extension? (was RFC: math options) [In reply to]

On Tue, Nov 29, 2011 at 12:44 AM, Roan Kattouw <roan.kattouw [at] gmail>wrote:

> On Tue, Nov 29, 2011 at 1:42 AM, Brion Vibber <brion [at] pobox> wrote:
> > Most compatible thing is probably to let it include the images/text form
> > as-is, then make sure MathJax goes over and replaces them in-place. It
> > might need tweaks to understand the images (source in alt text).
> >
> You may want to do a quick check for MathJax support in a script in
> the <head> (which executes before the browser renders the page) which
> then adds some CSS that ensures the images aren't loaded but the space
> is still reserved (something like visibility: hidden; on the image).
>

I've started on integrating some of User:Nageh's customizations for the
loader & configuration, which includes special support to find the latex
source bits as we label them with 'tex' class and replace them in-place.

It should be possible to tweak that a bit further so that the image forms
can also get detected and transformed (since the source is on the alt text,
we can use that).

This last update also bundles the MathJax source (Apache license) with the
extension, minus the 112 megabytes of PNG "font" fallbacks. We'll have to
check whether we actually need to be able to use those images for some
browsers or something...

-- brion
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.