Extension:SimpleMathJax/ru

Category:MIT licensed extensions/ru
Справка по расширениям MediaWiki
SimpleMathJax
Статус релиза: стабильноCategory:Stable extensions/ru
Реализация Тег Category:Tag extensions/ru
Описание Allows to render mathematical formulas using MathJax with MediaWiki math style
Автор(ы)
  • jmnote
  • vedmaka
  • jamesmontalvo3
  • badshah400
Последняя версия 0.8.5 (2024-07-02)
MediaWiki 1.29+Category:Extensions with manual MediaWiki version
Изменения в БД Нет
Лицензия MIT License
Скачать Category:Extensions in GitHub version control/ru
README
Пример zetawiki.com
  • $wgSmjUseCdn
  • $wgSmjUseChem
  • $wgSmjDisplayMath
  • $wgSmjExtraInlineMath
  • $wgSmjScale
  • $wgSmjEnableMenu
  • $wgSmjDisplayAlign
  • $wgSmjWrapDisplaystyle
Использование общедоступными вики 909 (Ranked 270th)
Category:All extensions/ru

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.

Установка

  • Download и распакуйте файл(ы) в папку с названием SimpleMathJax в вашей папке extensions/.
  • Добавьте следующий код в конце вашего файла LocalSettings.php :
    wfLoadExtension( 'SimpleMathJax' );
    
  • Configure at your convenience
  • Yes Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.

Or you can git clone.

$ git clone --depth 1 https://github.com/jmnote/SimpleMathJax.git

If you want to use local MathJax scripts (and not a CDN), then you can use git clone recursive. In most cases, CDN is much faster than your server. However, a CDN may not be available if you have a hardened PHP installation due to disabled_functions restrictions.

$ git clone --depth 1 --recursive --shallow-submodules 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.

Configuration

The following variables can be defined in your "LocalSettings.php" file after calling wfLoadExtension( 'SimpleMathJax' );. Note that for a simple site adding $wgSmjScale = 1.1; might be all you need to make it Just Work™.

Версия Название настройки Значение по умолчанию Описание
0.7.0+ $wgSmjUseCdn true Using CDN or Local resource
0.7.0+ $wgSmjUseChem true enable <chem> tags
( defaults to use chem tags )
0.8.0+ $wgSmjEnableMenu true Make MathJax context menu available
This setting is missed since 0.8.0; it would be a mistake
0.8.0+ $wgSmjExtraInlineMath [] can add some additional inlineMath symbols pairs
0.8.1+ $wgSmjScale 1 The default font size for SimpleMathJax
0.7.4 $wgSmjShowMathMenu false (удалено)
(заменено на $wgSmjEnableMenu)
0.6.1 $wgSmjSize 110 (удалено)
(заменено на $wgSmjScale)
0.6.1 $wgSmjInlineMath [] (удалено)
(заменено на $wgSmjExtraInlineMath)
0.6.1 $wgSmjDisableChem false (удалено)
(заменено на $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']
(удалено)
(заменено на $wgSmjUseCDN)
can use local or another remote scripts
( defaults to use cloudflare CDN )
0.6 $wgSimpleMathJaxSize 125 (удалено)
(заменено на $wgSmjSize)
0.6 $wgSimpleMathJaxUseCDN true (удалено)
(заменено на $wgSmjScripts)
0.6 $wgSimpleMathInlineMath [] (удалено)
(заменено на $wgSmjInlineMath)

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

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

If you want to enable some additional inlineMath symbol pairs, set $wgSmjExtraInlineMath like below.

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

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

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

Samples

Сравнение
More examples

:

См. также

Category:TeX/ru Category:Math display extensions/ru
Category:All extensions/ru Category:Extensions in GitHub version control/ru Category:Extensions included in Canasta/ru Category:Extensions included in MyWikis/ru Category:Extensions with manual MediaWiki version Category:MIT licensed extensions/ru Category:Math display extensions/ru Category:ParserFirstCallInit extensions/ru Category:Stable extensions/ru Category:Tag extensions/ru Category:TeX/ru