MediaWiki Extension SimpleMathJax
转到文件
Mark A. Hershberger 3158d844b5
Add editorconfig file for MW defaults
and tidy eol w/s
2020-11-10 21:54:56 -05:00
resources add macros to support mediawiki-texvc 2020-10-19 21:04:36 +09:00
.editorconfig Add editorconfig file for MW defaults 2020-11-10 21:54:56 -05:00
.gitmodules . 2020-10-19 03:45:43 +09:00
LICENSE Create LICENSE 2020-10-23 20:07:03 +09:00
README.md Update README.md 2020-10-23 19:29:01 +09:00
SimpleMathJax.php wfLoadExtension 2017-06-12 02:11:02 +09:00
SimpleMathJaxHooks.php Add editorconfig file for MW defaults 2020-11-10 21:54:56 -05:00
extension.json wgSmjWrapDisplaystyle 2020-10-23 19:25:34 +09:00

README.md

The SimpleMathJax extension enables MathJax, a Javascript library, for typesetting TeX formula in MediaWiki inside math environments.

https://www.mediawiki.org/wiki/Extension:SimpleMathJax

Installation

  • git clone in extensions directory
  • Using CDN is recommended. Because it's much faster than using local resources in most cases. ("the benefits of using a CDN")
$ git clone https://github.com/jmnote/SimpleMathJax.git
  • (Optional) If you want to use not CDN but local mathjax scripts, you can use git clone recursive.
$ git clone --recursive https://github.com/jmnote/SimpleMathJax.git
  • LocalSetting.php
wfLoadExtension( 'SimpleMathJax' );

Optional Settings

Setting name Description default value custom value example
$wgSmjUseCdn use CDN or local scripts true false
$wgSmjUseChem enable chem tag true false
$wgSmjEnableMenu MathJax.options.enableMenu true false
$wgSmjDisplayMath MathJax.tex.displayMath [] '$$','$$'],['\[','\]'
$wgSmjExtraInlineMath MathJax.tex.inlineMath [] '\(', '\)'
$wgSmjScale MathJax.chtml.scale 1 1.5
$wgSmjDisplayAlign MathJax.chtml.displayAlign center left
$wgSmjWrapDisplaystyle wrap with displaystyle true false

If you want to change font size, set $wgSmjScale.

wfLoadExtension( 'SimpleMathJax' );
$wgSmjScale = 1.5;

If you want to use local module, set $wgSmjUseCdn.

wfLoadExtension( 'SimpleMathJax' );
$wgSmjUseCdn = false;

If you want to enable some extra inlineMath symbol pairs, set $wgSmjExtraInlineMath.

wfLoadExtension( 'SimpleMathJax' );
$wgSmjExtraInlineMath = [["$","$"],["\\(","\\)"]];

If you want to disable MathJax context menu, set $wgSmjEnableMenu.

wfLoadExtension( 'SimpleMathJax' );
$wgSmjEnableMenu = false;