Mở rộng:SimpleMathJax
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, vedmaka, jamesmontalvo3, badshah400 |
Phiên bản | 0.8.1 (2020-10-23) |
MediaWiki | 1.29+[1] |
Database changes | Không |
Giấy phép | GNU General Public License 3.0 |
Tải xuống | GitHub: Note: 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
- Download và đặt (các) tệp trong một thư mục với tên
SimpleMathJax
trong thư mụcextensions/
của bạn. - Thêm mã sau vào dưới cùng tệp LocalSettings.php của bạn:
wfLoadExtension( 'SimpleMathJax' );
- Nếu cần thiết, bạn có thể cấu hình lại để sử dụng thuận tiện nhất
Xong – Chuyển tới Special:Version trên wiki của bạn để xác nhận phần mở rộng được cài đặt thành công.
Dành cho những người đang dùng MediaWiki 1.24 trở xuống:
Những chỉ dẫn bên trên diễn tả cách mới để cài phần mở rộng này sử dụng wfLoadExtension()
.
Nếu bạn muốn cài đặt phần mở rộng này trong những phiên bản cũ hơn, thay vì wfLoadExtension( 'SimpleMathJax' );
, bạn cần dùng:
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.
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 require_once "$IP/extensions/SimpleMathJax/SimpleMathJax.php";
. Chú ý rằng đối với một trang web đơn giản thêm$wgSimpleMathJaxSize = 120;
có lẽ bạn phải cần làm cho nó Just Work™.
Version | Thiết lập tên | Giá trị mặc định | Miêu tả |
---|---|---|---|
0.6.1+ | $wgSmjSize | 110
|
Kích thước font chữ mặc định cho SimpleMathJax ; mặc định là 100 |
0.6.1+ | $wgSmjInlineMath | []
|
can add some additional inlineMath symbols pairs |
0.7.0+ | $wgSmjUseCDN | true
|
Using CDN or Local resource |
0.7.0+ | $wgSmjUseChem | true
|
enable <chem> tags( defaults to use chem tags ) |
0.7.4+ | wgSmjShowMathMenu | false
|
Make MathJax context menu available |
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;
Making SimpleMathJax work with live preview (versions < 0.8.0)
Prior to version 0.8.0, the following had to be added to MediaWiki:Common.js in order to have the live preview in the editor show rendered math output instead of raw LaTeX source code:
function waitForMathJax($content) {
if (typeof MathJax === 'undefined') {
setTimeout(function () { waitForMathJax($content); }, 1000);
} else {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, $content[0]]).execute();
}
}
mw.hook('wikipage.content').add(waitForMathJax);
Mẫu
- So sánh
- en:user:Jmkim dot com/TeX Samples (rendering với các công cụ toán học wikipedia ,tiếng Anh )
- ko:user:Jmkim dot com/TeX 샘플 ( rendering với các công cụ toán học wikipedia , tiếng Hàn Quốc )
- http://zetawiki.com/wiki/TeX_샘플 (rendering với SimpleMathJax)
- Các ví dụ khác
- http://zetawiki.com/wiki/TeX_문법 (Ngữ pháp)
- http://zetawiki.com/wiki/TeX_행렬 (Ma trận)
- http://zetawiki.com/wiki/TeX_특수문자 (Các kí tự đặc biệt)
- http://zetawiki.com/wiki/Mhchem_테스트 (chem tags)
Xem thêm
External links
- ↑ SimpleMathJax 0.8.0+ uses manifest_version 2. Manual:Extension.json/Schema