This change allows to registered users
to test the new MathML rendering mode.
Invalid settings for math rendering mode
will default to MathMathML.
Change-Id: I75f24cb762609d6728247e3758fcc18f2ebfc6e6
* id: Allows to name equations
and deep link to equations
* forcemathmode: Allows to override the user defined rendering mode.
This feature is useful for help pages and discussions about rendering.
* type: support for MathML and asciimath input
required for MediaWiki instances that want to
incorporate MathML sources like for instance pubmed
Change-Id: I615c7f1a5762e9e662937b70953fb873309d4c07
This change prepares the reactivation of the
MathML rendering mode. It adds configuration
variables for
* the mathoid server url
* the mathoid server timeout
* the debug mode.
Change-Id: I8a2bb9076e571d7769787aac3e863f65637ce553
The LaTeXML class contains some code that is
not specific to LaTeXML but to MathML.
This code can be shared between LaTeXML and Mathoid.
This change introduces a new class called MathMathML
and moves the shared code from the LaTeXML class to this
new class.
Bug: 65973
Change-Id: I50517ba83f9a0d2aa8e237f062f18e4319ddbac8
new LaTeXML instance.
Sponsored by https://www.xsede.org/
Cherry-Pick from Id92ef141c7921a82528b3ba4384e026322499312
Change-Id: Idd1de9da348d473acc6cea8d2d1a855f1f6b07fa
Some simple math tags such as the rendering result of
$\mathcal{ABC}$
are converted to an HTML-div tag by LaTeXML if inline-mode
is used. This change
* makes the $wgMathDefaultLaTeXMLSetting easier to read
* improves the XML validation of the LaTeXML output.
Change-Id: I807dbfa3a45930deec8eb5615133be9a39f3f101
To adjust the selectable math rendering modes in user preferences $wgMathValidModes
is introduced.
* $wgUseLaTeXML becomes unnecessary use $wgMathValidModes[] = MW_MATH_LATEXML;
to enable the LaTeXML rendering mode
* add $wgMathValidModes[] = MW_MATH_MATHJAX; to enable MathJax
Currently, MathJax is bound to the MW_MATH_SOURCE rendering mode.
This change makes the base mode user configurable.
That means before MathJax is loaded the png fallback image could
be displayed.
ATTENTION: This change modifies global variables as follows:
* MW_MATH_MATHJAX is deprecated.
Bug: 57981
Change-Id: Ibf705cb66754d04e4c7eafd1e98608b25d7dbb94
mathchoice.js is necessary for the \mod command. This patch includes it
in the TeX module, so that it is included by ResourceLoader.
Bug: 63621
Change-Id: I624358baee04d396207e87ab81b47718573ea3b3
Declare that ext.math.editbutton.enabler depends on
mediawiki.action.edit.
Follow up to: I3d126c1c252c27fa65ab8fb42ffab66a2d99cfa8
Bug: 60471
Change-Id: Ibcda91bbb164b0b896d4c3f5f7c2c6ea6658468e
Move the code that creates the Editbutton for math from core,
where it is removed in Ib17aa47c7d647e1ed293541adbdd1aa77e25e59e.
Imported button image from:
ssh://gerrit.wikimedia.org:29418/mediawiki/core.git/skins/common/button_math.png
We don't need to vary the icon per language, because there is not a
single language that has a non default icon.
Bug: 60471
Change-Id: I3d126c1c252c27fa65ab8fb42ffab66a2d99cfa8
* Removes the MathJax heuristics that decides
if equations are centered or left-aligned.
* Introduces the attribute display to specify
if the math element is rendered in inline,
display, or inline-displaystyle.
* add css rules for display / inline math images
Bug: 61051
Change-Id: Iba69903f781f0cb1606b8ddcffb90fb86c9b229b
The color and the cancel extension was not RL'ified in the update
to MathJax 2.3
Followup to: I9471b1baf41d2bcc4fdc64a26e7d806e92b9b17f
Bug: 63574
Change-Id: I816db6b66ef48a90e7424372783c69ffe8343957
* Include generated tests for a better test coverage
of the Math extension.
* Compiles texvc in testsuite (if required)
* Test generator now included
* Replaces the old parser tests
* Fixes whitspace issues
Bug: 61090
Change-Id: Iff7eeb5ee72137492c3f6659e4d4d106e5715586
Introduce different error messages for missing texvccheck and
texvc and update the README file.
Bug: 61154
Change-Id: I52f796f181f6a3ab6d65a8e8d89f59d523d5b7b8
* $wg(.*) variables from extension should start with the extension name
i.e. for extension Math $wgMath(.*)
* But keep $wgUseMathJax, because it has been used for 2 years now.
* Add release notes
Change-Id: Ib70a9f7767890cc4618bc10c2610784f5b17e670
Since math has been moved from core to an extension
it should take care of the caching by its own.
Therefore, a call to the parserOptions::getMath is removed
and own caching logic is introduced, once getMath is removed
from core.
Bug: 14202
Change-Id: Ifa847b61264f8d640c9886fd374eb3d6cf482c0c
$wgUseTeX is not needed in the extension. For backwards compatibility,
it's also set in /mediawiki/includes/DefaultSettings.php and used in
/mediawiki/includes/EditPage.php only.
Change-Id: Ie5bcabf9e2e7474a4d41d1efcc5072c144640388
The user input specified in the math tag a. la
<math>E=m <script>alert('attacked')</script>^2 </math>
is verified in PNG rendering mode, but not in plaintext, MathJax
or LaTeXML rendering mode. This is a potential security issue.
Furthermore, the texvc specific commands such as $\reals$
that is expanded to $\mathbb{R}$ might be rendered differently
depended on the rendering mode.
Therefore, the security checking and rewriting portion of texvc
have been extracted from the texvc source
(see I1650e6ec2ccefff6335fbc36bbe8ca8f59db0faa) and are
now available as a separate executable (texvccheck).
This commit will now enable this enhancement in security and
provide even more compatibility among the different rendering
modes.
Bug: 49169
Change-Id: Ida24b6bf339508753bed40d2e218c4a5b7fe7d0c
Make LaTeXML setting configurable with the new global
variable $wgDefaultLaTeXMLSetting.
PS: This variable can be specified as an array or a
string. If specified as an array, the
array('a'=>'b','c'=>array('e','f'))
would be transformed to the equivalent setting
a=b&c=e&c=f
,which is the input format for the LaTeXML daemon.
Change-Id: I2869df27cee83b426c6eb2312306fac9d6203ef2
- Remove MathMathJax.php, which uses exactly the same output as MathSource.php.
- Make wiki2jax able to handle texvc output as a preview before MathJax rendering.
Change-Id: I1199cb34d555d2a1e57da98857f41a22cfe81df4
This change adds test cases for the MathSource class and registers a
hook for loading these tests. Also adds documentation about how to run
these tests in README.
Change-Id: Ie58a273326e0353dfa4437b3de21a2393adb5a87
The Math.body file which contains the MathRender class was split in the following way:
- Math.base contains the base class with the database related stuff and provides an abstract interface
- Math.source and Math.MathJax handle the plain tex string output. There are two classes since they
will differntiate in the future I think.
- Math.texvc contains the "old" implementation of png generation with all the file handling related stuff
- Other implementation of math renderer can be added in the same style.
- Cleanup to better follow coding conventions.
- Changed LockManager to 'fsLockManager'
The first attempt restructure the class layout and introduce LaTeXML at the same
time was dropped. Instead this was split up into two phases.
This commit only deals about the restructuring of the math module design.
Change-Id: I9b1d68c4faa8d177d8d0088fa1a5879caed4f1fe
* drop some of the init lines that don't appear to work/be needed
* only load MathJax.js through ResourceLoader; let MathJax's loader handle the rest
This gets us working in Chrome, where previously we hadn't initialized correctly. Should also help in IE, still needs testing.
Will probably want to swap in the pre-minimized versions of the files at some point, but the expanded ones are fine at this stage of work.
* Pulled in MathJax 1.1 (minus the 112 megabytes of PNG "fonts")
* Pulled in some of <https://en.wikipedia.org/wiki/User:Nageh/mathJax> bits for initialization
This doesn't currently override PNG images, but does replace the text-form if you configure it.
If enabled, by default loads MathJax from a CDN and forces all equations through MathJax when JavaScript is available -- the image or source form gets used only as <noscript> fallback.
This has a couple of problems for us:
* if scripts are missing -- such as when viewed via MobileFrontend -- you end up with no math at all, as the <script type="math/tex"> bits get ignored but the <noscript> still hides the images.
* while MathJax is loading things, blank spots on the page may appear and stuff jumps around
* if loading new text in via ajax, it doesn't trigger there
Also using some fairly default config, no idea how appropriate it is. Hoping to get some insight from Nageh who's done some of the MathJax work on Wikipedia so far - <https://en.wikipedia.org/wiki/User_talk:Nageh#MathJax_integration_into_stock_MediaWiki>
MathML mode was so incomplete most people thought it simply didn't work (bug 25646).
HTML modes often rendered poorly (eg req bug 24207 to set default to PNG on some sites)
This may cause regressions in that simple "equations" of just variables that came out as HTML
will now render as PNGs that don't get aligned properly with the text baseline. Fixing this is
covered by bug 32694: <https://bugzilla.wikimedia.org/show_bug.cgi?id=32694> to retrieve the
baseline info from dvipng and position images to fit.
Note that because of the way user options are pulled in to the oarser cache key, some folks
may see cached pages with their old settings until they get redone or they save their prefs
again and have it normalized.