GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.mediawiki.org — Extension:Math - MediaWiki
The Math extension provides support for rendering mathematical formulae. More information about installing and configuring this extension, including for older versions, can be found at Extension:Math/advancedSettings . See an overview of what can currently be done with this extension at Extension:Math/Syntax. InstallationThis extension comes with MediaWiki 1.38 and later, so you do not need to download it. The remaining configuration instructions must still be followed.
You should additionally go to the page Special:MathStatus to see whether all of the components of the Math extension now work. For any problems you see, the best option is to create a task on https://phabricator.wikimedia.org. Unfortunately, there is no well tested guide on installing Mathoid and RESTBase to work with the Math extension, but there is at least a working draft. Extension:Math/RESTBase please contribute. In addition, there is a Guide for Installing and Setting up MediaWiki with RESTBase and Mathoid in MW1.28. UsageOnce installed, you write formulas using TeX markup syntax inside the <math>E=mc^2</math> Renders as:
Viewing mathThe type of output depends on the software that you use to read the page. If it can, the Math extension outputs MathML. Otherwise, it outputs images in SVG (converting characters to <path> elements) or PNG. Basic math support works for all browsers. But, for best results, you might need to change your settings:
Configuration settings
Math output modesThe setting $wgMathValidModes holds an array with the names of output modes that can be used for rendering. If multiple modes are enabled, logged-in users can set a personal preference in the appearance pane of their user preferences page. You can also use the $wgDefaultUserOptions setting to set which of these modes should be the default, e.g.: $wgDefaultUserOptions['math'] = 'mathml'; MathoidMode: 'mathml'
You can use Mathoid, an application that uses MathJax on the server side to convert texvc input to MathML+SVG rendering. Mathoid is currently the Math rendering mode used on Wikipedia. Mathoid as a service"Mathoid as a service" is the recommended approach for the Math extension, and the default one. If you do not add any additional settings to LocalSettings.php, Math will use the Beta cluster's Mathoid and RESTBase services to do all math formula rendering. The default settings are: // Set MathML as default rendering option $wgDefaultUserOptions['math'] = 'mathml'; $wgMathUseInternalRestbasePath = false; $wgMathFullRestbaseURL = 'https://wikimedia.org/api/rest_'; $wgMathMathMLUrl = 'https://mathoid-beta.wmflabs.org';
You can modify these settings to use different Mathoid and RESTBase services, potentially including your own. Mathoid's CLI interfaceYou can instead run Mathoid as a command-line utility on the local server. To use this approach, the following settings are recommended: // Set MathML as default rendering option $wgDefaultUserOptions['math'] = 'mathml'; // Please create a config.yaml in advance. Templates are in the Mathoid repository. $wgMathoidCli = ['/path/to/mathoid/cli.js', '-c', '/path/to/mathoid/config.yaml']; // Raise MediaWiki's memory limit to 1.2G for Mathoid. $wgMaxShellMemory = 1228800; If you run MediaWiki in a system containing SELinux and you get the message
Mathoid cli '/path/to/mathoid/cli.js' is not executable in the error log, you can run the following to make sure that the Apache server allows to change system limits:
setsebool -P httpd_execmem 1 setsebool -P httpd_setrlimit 1 LaTeX
Mode: 'png' Since MediaWiki 1.32, this mode will also require a Mathoid server to work. In older versions, it requires installing texvc and texvccheck, which may require the most setup work. LaTeXMLMode: 'latexml' Uses the LaTeXML utility. The rendering is done via an online service (set with $wgLaTeXMLUrl, which has a default value of https://latexml.formulasearchengine.com/convert). Native MathML
Mode: 'native' This mode will generate MathML from LaTeX via PHP without Mathoid. Note this mode does not have image fallback, so formulas will only be displayed correctly if the browser supports MathML. Firefox and Safari introduced MathML support early (2006 and 2008), but support in Chromium-based browsers is a much more recent addition (Chrome 109, released in 2023). MathJax
Mode: 'mathjax' This mode works the same as Native MathML mode (generating MathML from LaTeX via PHP), but it will use MathJax 3 to render MathML. Therefore it will work for browsers that do not have MathML support, with the overhead of loading MathJax library (bundled in Math extension) on page views.
No renderingMode: 'source' This mode will forward the Latex input without rendering, presenting it in a Make sure to set $wgMathDisableTexFilter to 'always' (see below) if you only want the raw LaTeX formula, else an error will appear due to the failed check for PNG depictions. Tracking categoriesThe extension creates a number of tracking categories to detect errors and deprecated features.
Their message keys begin with
Tips and tricks
Error reportingIf something is wrong with the math extension you can report that at Phabricator. In addition you should check how your problem relates to the automated unit tests that are generated from the page CoverageTest. Further readingSee Extension:Math/advancedSettings for old versions and further information. Subpages
See also
Categories:
Hidden category: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||