Mediawiki extensions: math: Difference between revisions
From wikinotes
No edit summary |
(→Usage) |
||
Line 49: | Line 49: | ||
|} | |} | ||
</blockquote><!-- Usage --> | </blockquote><!-- Usage --> | ||
= Cheat Sheet = | |||
<blockquote> | |||
Some of the more common items. | |||
<syntaxhighlight lang="latex"> | |||
\texttt{compounding-periods} # arbitrary text | |||
\dfrac{1}{2} # 1/2 | |||
\times{1}{2} # 1*2 | |||
1^{2} # 1**2 | |||
\bigg( \dfrac{1}{2} \bigg) # brackets (each 'g' makes larger) | |||
</syntaxhighlight> | |||
</blockquote><!-- Cheat Sheet --> | |||
= Configuration = | = Configuration = |
Revision as of 00:41, 11 April 2022
Renders MathML in <math>
blocks, falling back onto SVG.
I believe this extension is used by wikipedia itself as of 2021.
Documentation
official docs https://www.mediawiki.org/wiki/Extension:Math supported LaTeX syntax https://www.mediawiki.org/wiki/Extension:Math/Help:Formula#Formatting_using_Template:TeX
Install
1. First, download the extension for your mediawiki version, extract to
${www}/mediawiki/extensions
.2. enable extension
# ${www}/mediawiki/LocalSettings.php wfLoadExtension( 'Math' );
3. (backup then) run database updatercd ${www}/mediawiki/maintenance mysqldump --all-databases > out.sql php update.php4. Confirm plugin detected on Special:Version
5. Confirm plugin renders math alright on Special:MathStatus
Usage
Simply write tex between math tags.
Here are some examples:
<math>\exp_a b = a^b, \exp b = e^b, 10^m</math>
Cheat Sheet
Some of the more common items.
\texttt{compounding-periods} # arbitrary text \dfrac{1}{2} # 1/2 \times{1}{2} # 1*2 1^{2} # 1**2 \bigg( \dfrac{1}{2} \bigg) # brackets (each 'g' makes larger)
Configuration
Rendering Modes
All math is expressed in tex, but can be rendered in a variety of ways:
- MathML
- LaTex
- LaTeXML