Jump to content

Mở rộng:SimpleMathJax

From mediawiki.org
This page is a translated version of the page Extension:SimpleMathJax and the translation is 49% complete.
Outdated translations are marked like this.
Cẩm nang phần mở rộng MediaWiki
SimpleMathJax
Trạng thái phát hành: ổn định
Cài đặt Tag
Mô tả Cho phép hiển thị các công thức toán học sử dụng MathJax với phong cách toán học MediaWiki
Tác giả jmnote and the contirubtors
Phiên bản 0.8.8 (2025-12-14)
MediaWiki 1.29+
Database changes Không

  • $wgSmjUseCdn
  • $wgSmjUseChem
  • $wgSmjDisplayMath
  • $wgSmjExtraInlineMath
  • $wgSmjScale
  • $wgSmjEnableMenu
  • $wgSmjDisplayAlign
  • $wgSmjWrapDisplaystyle
Licence MIT License
Tải xuống
README
Ví dụ zetawiki.com

Extension SimpleMathJax cho phép MathJax , một thư viện JavaScript, cho sắp chữ công thức TeX trong MediaWiki bên trong môi trường toán học . This extension will load resources from cdn.jsdelivr.net on all wiki pages that have math or chem tags.

<math>E=mc^2</math>
Ưu điểm
  • Đơn giản
  • Nhẹ (dung lượng)
  • Hỗ trợ UTF-8
  • Xem trên điện thoại di động OK
  • Thiết lập kích thước Font
  • MediaWiki Style! Xem tại mẫu.

Cài đặt

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.

Cài đặt cấu hình

Các biến sau đây có thể được định nghĩa trong LocalSettings.php sau khi gọi wfLoadExtension( 'SimpleMathJax' );. Chú ý rằng đối với một trang web đơn giản thêm LocalSettings.php có lẽ bạn phải cần làm cho nó Just Work™. Note that for a simple site adding $wgSmjScale = 1.1; might be all you need to make it Just Work™.

Version Thiết lập tên Giá trị mặc ​​định Miêu tả
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 Kích thước font chữ mặc định cho SimpleMathJax ; mặc định là 100

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;

Mẫu

;So sánh
; Các ví dụ khác

Xem thêm