Extension:Math
Math リリースの状態: 安定 | |||
---|---|---|---|
![]() | |||
実装 | Tag | ||
説明 | 数式をレンダリングできるようにする | ||
作者 | Tomasz Wegrzanowski、Brion Vibber、他 | ||
最新バージョン | continuous updates | ||
MediaWiki | 1.25+ | ||
データベースの変更 | はい | ||
テーブル | math mathoid mathlatexml | ||
ライセンス | GNU General Public License 2.0 or later | ||
ダウンロード | |||
| |||
| |||
| |||
translatewiki.net で翻訳を利用できる場合は、Math 拡張機能の翻訳にご協力ください | |||
使用状況とバージョン マトリクスを確認してください。 | |||
未解決のタスク · バグを報告 |
Math拡張機能は、数式を表現するためのサポートを提供します。この拡張機能で現在できることの概要は、英語版ウィキペディアのドキュメントにあります。
古いバージョンを含め、この拡張機能のインストールと設定に関する詳細はExtension:Math/高度な設定 にあります。
Contents
Viewing math
Math拡張機能は、MathML出力をSVGまたはPNG画像にそれぞれフォールバックして出力しようとします。 使用しているデバイスの機能に応じて、出力の種類が選択されます。 Basic math support works for all browsers. However, for optimal rendering specific tuning may be needed:
- Firefoxや他のGeckoを使用している他のブラウザでは、ネイティブMathML拡張機能と算術フォントをインストールする必要があります。 アクセシビリティサポートは、NVDA、VoiceOverまたはOrcaによって提供されます。 Additionally, NVDA requires the MathPlayer plugin to read mathematics.
- Safariやその他のWebKitを使用しているブラウザでは、あなたのブラウザー設定のカスタムスタイルシートに数式フォントをインストールし、ネイティブのMathMLレンダリングを有効にしていくつかのCSSルールを挿入することもできます。
アクセシビリティサポートはVoiceOverスクリーンリーダーで提供されますが、まだOrcaでは提供されていません。
- Chromeでは、ChromeVoxやMathJax plugin経由の視覚的レンダリングを利用するには、ブラウザの設定のカスタムスタイルシートにいくつかのCSSルールを挿入する必要があります。
- いくつかのバージョンのInternet Explorerでは、MathPlayerを支援技術として使用することができます。
インストール
- Vagrant を使用している場合は、
vagrant roles enable math --provision
でインストールしてください
手動インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のMath
という名前のディレクトリ内に配置します。
- 以下のコードを LocalSettings.php の末尾に追加します:
wfLoadExtension( 'Math' ); // インストール要件と構成設定については、以下を参照してください。
- 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベース テーブルを自動的に作成します。
- To see math beyond a plain text output, follow instructions below for enabling various math output modes.
完了 - ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
MediaWiki 1.24 以前を稼働させている利用者へ:
上記の手順では、wfLoadExtension()
を使用してこの拡張機能をインストールする新しい方法を記載しています。 この拡張機能をこれらの過去のバージョン (MediaWiki 1.24 以前) にインストールする必要がある場合は、wfLoadExtension( 'Math' );
の代わりに以下を使用する必要があります:
require_once "$IP/extensions/Math/Math.php";
You should additionally go to the page Special:MathStatus to see whether all of the components of the Math extension now work. 何か問題が発生した場合は、https://phabricator.wikimedia.org にタスクを作成することをお勧めします
残念ながら、Mathoid とRestbase のインストールについては、Math拡張機能を使用するための十分にテストされたガイドはありませんが、少なくとも作業用のドラフトはあります。 Extension:Math/Restbase に貢献してください。
さらに、MW1.28にRestbaseとMathoidをインストールしてセットアップするためのガイドがあります。
Math output modes
$wgMathValidModesを設定すると、レンダリングに使用できる出力モードの名前を持つ配列が保持されます。 複数のモードが有効になっている場合、ログインしているユーザーは、自分の個人設定ページの表示から設定できます。
$wgDefaultUserOptions設定を使用して、これらのモードのどれをデフォルトにするかを設定することもできます。例:
$wgDefaultUserOptions['math'] = 'mathml';
Mathoid
モード: 'mathml' (pre-July 2015: MW_MATH_MATHML)
MW 1.23以上の場合、MathJaxを使用するMathoidサーバーを使用して、サーバー側のtexvc入力をMathML+SVGレンダリングに変換できます。 これが最も推奨されるオプションです。Mathoidは将来Wikipediaで使用されるレンダリングモードです。
Mathoidを使用する場合には、次の設定をお勧めします。
// 既定のレンダリング設定としてMathMLを設定する
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathFullRestbaseURL= 'https://en.wikipedia.org/api/rest_';
独自のMathoidサーバーを実行する方法については、Mathoidを参照してください。 Note that as of March 2017 this is likely to also require a RESTbase server/installation (see タスク T154394).
LaTeX
モード: 'png' (pre-July 2015: MW_MATH_PNG)
This is the mode that requires the most setup work, since at least the texvc utility has to be installed for it to work, and ideally texvccheck as well. See Installing texvc for how to install both of these.
LaTeXML
モード: 'latexml' (pre-July 2015: MW_MATH_LATEXML)
Uses the LaTeXML utility. The rendering is done via an online service (set with $wgLaTeXMLUrl, which has a default value).
No rendering
モード: 'source', (pre-July 2015: MW_MATH_SOURCE)
This mode will forward the Latex input without rendering, presenting it in a <span> element, surrounded by $ :formula $.
Make sure to set $wgMathDisableTexFilter to 'always' (see below) if you only want the raw latex formula, else an error will appear due to the failed check for PNG depictions.
MathJax
モード: MW_MATH_MATHJAX
This mode uses the MathJax application for client-side rendering. It is now deprecated, and requires MediaWiki 1.25 or lower in order to run. See Client-side rendering with MathJax for how to use it.
重要な構成設定のリスト
設定名 | 既定値 | 説明 |
---|---|---|
$wgMathValidModes | array( 'png', 'source', 'mathml' )
|
サーバー上で許可されるモードを定義します。 |
$wgMathDisableTexFilter | 'never'
|
Option to disable the tex filter. If set to true any LaTeX espression is parsed this can be a potential security risk. If set to false only a subset of the TeX commands is allowed. See the wikipedia page Help:Math for details. この機能を無効にするには「always」を使用してください。 |
$wgMathFullRestbaseURL | false | The math extension gets the default config from the Visual Editor, if available. 詳細 |
Tips and tricks
- You can use the Firefox MathML copy addon to copy formulae to other applications such as Microsoft Word (video), or Google docs with the g(Math) plugin (video)
エラーの報告
If something is wrong with the math extension you can report that at Phabricator. In addition you should check how your problem relates to the automated unit tests that are generated from the page CoverageTest.
更なる情報
See Extension:Math/高度な設定 for old versions and further information.
下位ページ
関連項目
- Extension:Math/Roadmap
- Mathoid
- Extension:SimpleMathJax - an alternative way to provide support for rendering mathematical formulas on-wiki, without texvc or LaTeX
- texvc - description of texvc
- TexvcのPHPでの代替
- LaTeX on a shared host
- Another alternative is to use: LaTeX with google chart
- Manual:Enable TeX/problems
- Manual:数式
![]() | この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
- Pages using duplicate arguments in template calls
- GPL licensed extensions/ja
- Stable extensions/ja
- Tag extensions/ja
- Extensions in Wikimedia version control/ja
- ParserFirstCallInit extensions/ja
- GetPreferences extensions/ja
- LoadExtensionSchemaUpdates extensions/ja
- ParserTestTables extensions/ja
- PageRenderingHash extensions/ja
- EditPageBeforeEditToolbar extensions/ja
- WikibaseClientDataTypes extensions/ja
- WikibaseRepoDataTypes extensions/ja
- ParserAfterTidy extensions/ja
- All extensions/ja
- Extensions used on Wikimedia/ja
- TeX/ja
- Math display extensions/ja
- Extensions with VisualEditor support/ja