Erweiterungen:SimpleMathJax

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:SimpleMathJax and the translation is 15% complete.

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎Tiếng Việt • ‎català • ‎dansk • ‎español • ‎français • ‎italiano • ‎polski • ‎português • ‎português do Brasil • ‎sicilianu • ‎suomi • ‎svenska • ‎中文 • ‎日本語 • ‎한국어
MediaWiki-Erweiterungen
OOjs UI icon advanced.svg
SimpleMathJax
Erscheinungsstatus: stabil
Einbindung Tag
Beschreibung Allows to render mathematical formulas using MathJax with MediaWiki math style
Autor(en) jmnote, vedmaka, jamesmontalvo3, badshah400
Letzte Version 0.7.3 (2018-04-01)
MediaWiki 1.25+
Datenbankänderungen Nein
Lizenz GNU General Public License 3.0
Herunterladen
README
Beispiel zetawiki.com
Parameter

  • $wgSmjSize
  • $wgSmjUseCDN
  • $wgSmjUseChem
  • $wgSmjInlineMath
Verwendete Hooks
ParserFirstCallInit
Übersetze die SimpleMathJax Erweiterung wenn sie auf translatewiki.net verfügbar ist
Prüfe die Benutzungs- und Versionsmatrix.

The SimpleMathJax extension enables MathJax, a JavaScript library, for typesetting TeX formula in MediaWiki inside math environments. This extension will load resources from cdnjs.cloudflare.com 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.

Installation

  • Download und lege die Datei(en) in ein Verzeichnis namens SimpleMathJax in deinem Ordner extensions/ ab.

An Nutzer, die MediaWiki 1.24 und früher betreiben:

Die oben stehenden Anweisungen beschreiben den neuen Weg der Installation von diese Erweiterung per wfLoadExtension(). Falls du diese Erweiterung in einer dieser früheren Versionen (MediaWiki 1.24 und früher)  – an Stelle von wfLoadExtension( 'SimpleMathJax' ); – installieren musst, benutze:

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.

Configuration settings

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™.

Version Setting name Default value Beschreibung
0.6.1+ $wgSmjSize 110 The default font size for SimpleMathJax
0.7.0+ $wgSmjUseCDN true Using CDN or Local resource
0.7.0+ $wgSmjUseChem true enable <chem> tags
( defaults to use chem tags )
0.6.1+ $wgSmjInlineMath [] can add some additional inlineMath symbols pairs
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;

Samples

Vergleich
Mehr Beispiele

Siehe auch

External links