Extensión:SimpleMathJax
SimpleMathJax Estado de lanzamiento estable |
|
---|---|
Implementación | Etiqueta |
Descripción | Allows to render mathematical formulas using MathJax with MediaWiki math style |
Autor(es) | jmnote, vedmaka, jamesmontalvo3, badshah400 |
Última versión | 0.8.1 (2020-10-23) |
MediaWiki | 1.29+[1] |
Cambios de la base de datos | No |
Licencia | GNU Licencia Pública general 3.0 |
Descarga | GitHub: Note: README |
Ejemplo | zetawiki.com |
|
|
The SimpleMathJax extension enables MathJax, a JavaScript library, for typesetting TeX formula in MediaWiki inside math environments.
This extension will load resources from cdn.jsdelivr.net
on all wiki pages that have math or chem tags.
<math>E=mc^2</math>
- Advantages
- Simple
- Lightweight
- UTF-8 Support
- Mobile View OK
- Setting Font Size
- chem tag support for chemistry
- additional inlineMath symbols pairs support
- MediaWiki Style! Look at the samples.
Instalación
- Descarga y extrae los archivos en el directorio «
SimpleMathJax
» dentro del directorioextensions/
existente. - Añade el siguiente código a tu LocalSettings.php (preferiblemente al final):
wfLoadExtension( 'SimpleMathJax' );
- If necessary configure at your convenience
Hecho – Navega a Special:Version en tu wiki para verificar que la apariencia se haya instalado correctamente.
Para quienes usan MediaWiki 1.24 o versiones anteriores:
Estas instrucciones describen la nueva forma de instalar extensiones usando wfLoadExtension()
.
Si necesitas instalar esta extensión en versiones anteriores (MediaWiki 1.24 y anteriores), debes usar lo siguiente en lugar de wfLoadExtension( 'SimpleMathJax' );
:
require_once "$IP/extensions/SimpleMathJax/SimpleMathJax.php";
Or you can git clone.
$ git clone https://github.com/jmnote/SimpleMathJax.git
If you want to use not CDN but local mathjax scripts, you can use git clone recursive. ( In most cases, CDN is much faster than your server. )
$ git clone --recursive https://github.com/jmnote/SimpleMathJax.git
SimpleMathJax is meant to be used as an alternative to the Math extension. If the Math extension is installed it may take precedence and cause SimpleMathJax to not work. The SimpleMathJax extension is the only thing you need to start rendering equations.
Preferencias de configuración
The following variables can be defined in LocalSettings.php after calling wfLoadExtension( 'SimpleMathJax' );
. Note that for a simple site adding $wgSmjSize = 110;
might be all you need to make it Just Work™.
Versión | Establecer nombre | Valor predeterminado | Descripción |
---|---|---|---|
0.6.1+ | $wgSmjSize | 110
|
The default font size for SimpleMathJax |
0.6.1+ | $wgSmjInlineMath | []
|
can add some additional inlineMath symbols pairs |
0.7.0+ | $wgSmjUseCDN | true
|
Using CDN or Local resource |
0.7.0+ | $wgSmjUseChem | true
|
enable <chem> tags( defaults to use chem tags ) |
0.7.4+ | wgSmjShowMathMenu | false
|
Make MathJax context menu available |
0.6.1 | $wgSmjDisableChem | false | removed (replaced by $wgSmjUseChem) |
0.6.1 | $wgSmjScripts | ['//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/extensions/TeX/mhchem.js'] |
removed (replaced by $wgSmjUseCDN) can use local or another remote scripts ( defaults to use cloudflare CDN ) |
0.6 | $wgSimpleMathJaxSize | 125 | removed (replaced by $wgSmjSize )
|
0.6 | $wgSimpleMathJaxUseCDN | true | removed (replaced by $wgSmjScripts )
|
0.6 | $wgSimpleMathInlineMath | [] | removed (replaced by $wgSmjInlineMath )
|
If you want to change font size, set $wgSmjSize
like below.
wfLoadExtension( 'SimpleMathJax' );
$wgSmjSize = 150;
If you want to enable some additional inlineMath symbol pairs, set $wgSimpleMathJaxInlineMath
like below.
wfLoadExtension( 'SimpleMathJax' );
$wgSmjInlineMath = [ [ "$", "$" ], [ "\\(", "\\)" ] ];
If you want to use local module, set $wgSmjUseCDN like below.
wfLoadExtension( 'SimpleMathJax' );
$wgSmjUseCDN = false;
Making SimpleMathJax work with live preview (versions < 0.8.0)
Prior to version 0.8.0, the following had to be added to MediaWiki:Common.js in order to have the live preview in the editor show rendered math output instead of raw LaTeX source code:
function waitForMathJax($content) {
if (typeof MathJax === 'undefined') {
setTimeout(function () { waitForMathJax($content); }, 1000);
} else {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, $content[0]]).execute();
}
}
mw.hook('wikipage.content').add(waitForMathJax);
Muestras
- Comparación
- en:user:Jmkim dot com/TeX Samples (rendering with wikipedia math engines, English)
- ko:user:Jmkim dot com/TeX 샘플 (rendering with wikipedia math engines, Korean)
- http://zetawiki.com/wiki/TeX_샘플 (rendering with SimpleMathJax)
- Más ejemplos
- http://zetawiki.com/wiki/TeX_문법 (Gramática)
- http://zetawiki.com/wiki/TeX_행렬 (Matriz)
- http://zetawiki.com/wiki/TeX_특수문자 (Caracteres especiales)
- http://zetawiki.com/wiki/Mhchem_테스트 (chem tags)
Véase también
External links
- ↑ SimpleMathJax 0.8.0+ uses manifest_version 2. Manual:Extension.json/Schema