close

最近在幫某個學會建置及管理論壇及Wiki,

由於會涉及到數學公式,就必須在Wiki中要能夠寫數學公式,

所以,要安裝數學公式的模組,

然而在試過幾種方式,是既複雜又難懂(英文不好吧~XDDD),

終於找到一個只要在網頁<head>中加入一行script 的指令行即可。

我的環境如下:

1. MediaWiki 1.19 使用Vector預設模組

2. MathJax    2.0 適用 Mediawiki 1.18及1.19版

最好不要用MathJax 1.X版,步驟很多,我設不起來(大概英文不好人又笨吧~)

步驟如下:

1.在下載MathJax 2.0 後,解壓縮到Wiki下的路徑中,我是放在Wiki\extensions\MathJax\ 的路徑下。

2.在Wiki的路徑中,找到 Vector.php 中的程式中有一段是:

------------------------------------------------------

 public function initPage( OutputPage $out ) {
        global $wgLocalStylePath;

        parent::initPage( $out );

        // Append CSS which includes IE only behavior fixes for hover support -
        // this is better than including this in a CSS fille since it doesn't
        // wait for the CSS file to load before fetching the HTC file.
        $min = $this->getRequest()->getFuzzyBool( 'debug' ) ? '' : '.min';

        $out->addHeadItem( 'mathjax','<script type="text/javascript" src="../extensions/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>'
);
// 加入以上黃底內容

        $out->addHeadItem( 'csshover',
            '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
                htmlspecialchars( $wgLocalStylePath ) .
                "/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->"
        );

------------------------------------------------------

請加入黃底紅字段,並在黃底紅字中的 scr="../extensions/MathJax/MathJax.js 請依您實際的路徑填好,如果您實在不會寫,請寫上src="http://cdn.mathjax.org/mathjax/latest/MathJax.js ,其餘依上面程式段內容,這樣就ok啦~

 

arrow
arrow
    文章標籤
    Mediawiki MathJax LaTex
    全站熱搜

    醬. 發表在 痞客邦 留言(0) 人氣()