Extension:Math/advancedSettings/ja

The Math extension provides support for rendering mathematical formulas on-wiki via texvc and other backends. An overview of what can currently be done with this extension is found at the English Wikipedia's documentation.

texvc のインストール
The following steps are required for server-side LaTeX to PNG conversion.

texvc について
The TeX validator and converter texvc takes formulae and produces formatted output in HTML, MathML, and PNG images. Input data is parsed and scrutinized for safety.

On a shared host with a limited shell access
On a shared host with limited command line access, (e.g. under jailshell) compiling with all the dependencies won't be possible. As a workaround compiling texvc will have to be done offline. Use  to to identify the OS of the shared host, and install the same offline. This can be done via a USB boot drive, live CD, virtual machine on a desktop PC or whichever you prefer. Then for example in Ubuntu, all dependencies can be installed using:

Get the Math extension and make texvc etc.:

Upload the  archive to the host and extract the required files  into the $IP/extensions/Math folder.

To test texvc is working (see texvc usage), e.g.:

On a host with full shell access
Compile texvc and texvccheck:

On a (virtual) private server
In some Linux distributions texvc and texvccheck come already built in the MediaWiki Math packages.

See Comparison of extensions in distributions.

For example in Debian or Ubuntu to install it and any other packages on which it depends:

(MediaWiki, Math, texvc and texvccheck ) or

(just texvc)

設定
Please make sure to put the configuration after, otherwise the MW_MATH_XXX constants will be undefined.

Client-side rendering with MathJax
From 1.19/1.20, the Math extension supports rendering via MathJax, a client-side JavaScript library for parsing latex or mathml code and producing in-browser representation using the browser's native support for HTML+CSS, or MathML, or SVG.

This can render math expressions more sharply (using subpixel antialiasing) and larger (scaling up for zoomed view, printing, or high-resolution screens).

Set $wgUseMathJax to enable MathJax rendering mode; it is still somewhat experimental. Users will have a check box on their preferences that will enable MathJax, or set MathJax to the default mode as shown below.


 * 設定 (MW 1.19 - 1.22)


 * 設定 (MW 1.23 - 1.25)

See also How to modify the MathJax contextual menu.


 * Forcing MathJax as the only rendering option (MW 1.23+)

If you have a wiki where MathJax is the only available rendering mode, and wish to force it to be enabled, add the following to LocalSettings.php instead of the above:

This will switch on MathJax by default for all anonymous users and those without preferences saved for the Math extension. Note that if registered users had an alternate rendering mode selected, it will be necessary for them to open Preferences > Appearance and click Save for the new forced setting to take effect. Articles should advise users about the requirement for JavaScript to be enabled in order to see formulae (e.g. through a template for articles including TeX formulae).

Server-side rendering with Mathoid
Beginning from MW 1.23+ you can use a Mathoid server that uses MathJax to convert texvc input on the server side to MathML+SVG rendering. Mathoid is the rendering mode that is going to be used on future Wikipedia. For that the following settings are recommended:

Check out Mathoid to find instructions how to run your own Mathoid server. After enabling the MathML rendering mode you have to run the database update script again to create the required table.

Server-side rendering with LaTeXML
A convenient option to render LaTeX is to use the LaTeXML web service. This service converts LaTeX to high quality MathML.


 * Settings (MW 1.22) most or all of the 1.23+ settings also work


 * 設定 (MW 1.23 以降)

A short guide to install LaTeXML on your own server can be found here: Install LaTeXML

After enabling the LaTeXML rendering mode you have to run the database update script again to create the required table.

Server-side rendering with LaTeX
To use your local webserver to convert the texvc input to PNG images via a local LaTeX installation and OCAML based translation from texvc to LaTeX you have to install texvc; see above for how to do that.

List of all configuration settings
The following variables can be defined in LocalSettings.php after calling :

CSS for the MathML with SVG fallback mode
By default, MathML is only exposed to accessibility tools. However, you can force visual rendering with the following style:

You can then easily change the style of MathML formulas e.g. to set the math font:

is added to get the same font appearance for the entire article text. If you do not want to change your main font, then leave this out. Do not forget to remove the comma, as well!