[WordPress] 外掛分享: MathJax-LaTeX

首頁外掛目錄 › MathJax-LaTeX
10,000+
安裝啟用
★★★★
4.4/5 分(11 則評價)
430 天前
最後更新
問題解決
WordPress 3.0+ PHP 7.0.0+ v1.3.13 上架:2010-10-19

內容簡介

MathJax 可以在 HTML 網頁中渲染 LaTeX 或 MathML 的內嵌式程式碼,此外掛為 WordPress 新增了這項功能。此外掛只會在需要時才會動態注入 MathJax JavaScript 到該頁面,以確保 MathJax 不會在全部網頁載入時進行載入,進而拖慢頁面載入速度。

MathJax JavaScript 可從您自己的伺服器傳送,或是您可以使用 Cloudflare 內容傳送網絡 (CDN),因其提供更快、更穩定的服務,而成為推薦的機制。

在此掛入您可以使用多種語法來嵌入 LaTeX,其中 shortcode 語法是推薦的。像是 [latex]E=mc^2[/latex] 即可使用,這也會導致 MathJax 被載入。

此外,您也可以使用原生的 MathJax 語法,例如 $$E=mc^2$$ 或 \(E=mc^2\)。然而,如果只有這種語法被使用,這項外掛必須被明確告知當前頁面需要載入 MathJax,這可以透過在文章中加入 [mathjax] shortcode 達成。如果文章同時使用 [latex] 和 $$x$$ 語法,這是不必要的。

您可以使用 wp-latex 語法,例如 $latex E=mc^2$。可以像使用 wp-latex 一樣加上參數,但是這些參數將被忽略。這意味著 MathJax-LaTeX 可以成為 wp-latex 的插件替代方案。此外,由於 wp-latex 和 MathJax-LaTeX 產生衝突,此外掛會在 wp-latex 被檢測到時阻止此功能,需在設定中明確啟用。

您也可以加入 [nomathjax] 來阻止當前頁面使用 MathJax,無論其他標籤系統是否存在。

MathJax-LaTeX 的開發在 GitHub 上進行。

版權聲明

此外掛版權歸屬於紐卡斯爾大學的 Phillip Lord,並採用 GPLv2 授權。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.3.13) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「MathJax-LaTeX」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

MathJax enables enables rendering of embedded LaTeX or MathML in HTML pages. This plugin adds this functionality to WordPress. The MathJax JavaScript is inject on-demand only to those pages which require it. This ensures that MathJax is not loaded for all pages, which will otherwise slow loading down.
The MathJax JavaScript can be delivered from your own server, or you can use the Cloudflare Content Distribution Network (CDN), which is the preferred mechanism as it offers increased speed and stability over hosting the JavaScript and configuring the library yourself.
You may embed latex using a variety of different syntaxes. The shortcode (https://codex.wordpress.org/Shortcode_API) syntax is preferred. So [latex]E=mc^2[/latex] will work out of the box. This also forces loading of MathJax.
Additionally, you can use native MathJax syntax — $$E=mc^2$$ or \(E=mc^2\). However, if this is the only syntax used, the plugin must be explicitly told to load MathJax for the current page. This can be achieved by adding a [mathjax] shortcode anywhere in the post. For posts with both [latex]x[/latex] and $$x$$ syntaxes this is unnecessary.
You can use wp-latex syntax, $latex E=mc^2$. Parameters can be specified as with wp-latex but will be ignored. This means that MathJax-LaTeX should be a drop-in replacement for wp-latex. Because this conflicts with wp-latex, this behaviour is blocked when wp-latex is present, and must be explicitly enabled in the settings.
You can also specify [nomathjax] — this will block mathjax on the current page, regardless of other tags.
MathJax-LaTeX is developed on GitHub.
Copyright
This plugin is copyright Phillip Lord, Newcastle University and is licensed under GPLv2.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon