I am not able to enable math display/latex on the mediawiki. In standard instructions to enable latex, I need to compile texvc files, but I cannot do that because I am on a shared host (Linux Radhat).
(http://www.mediawiki.org/wiki/Manual:Enable_TeX)
I tried with precompiled binaries, but no succe开发者_运维百科ss. I tried JsMath alternative, and I am getting this error
"Fatal error: Call to undefined method ParserOptions::getUseTeX() in /Shulabh/MediaWikiS/extensions/JsMath/JsMath.php on line 159"
(http://www.mediawiki.org/wiki/Extension:JsMath)
I cannot find any clear instructions as to how to do that. I am new to Linux as well. Can someone provide some clear instructions to enable math formulae wither using JsMath, or some other alternative such as MathJax?
Thank you.
..Shulabh
I've managed to get the MathJax extension working. The details are explained there. In summary you
- Download MathJax (I took the beta) and put it in the root of the directory you serve from so that Apache (or whatever web server you use) can see it. I called this directory mathjax-1.1b but any name will do. You should now be able to check its working by going to the URL /mathjax-1.1b/test/index.html. This shows some math.
- Follow the instructions at the above page and create a new "MathJax/" sub-directory of the "extensions/" subdirectory of your MediaWiki install. This will have two files in it, "MathJax.php" and "mwMathJaxConfig.js".
- Now add the following lines at the bottom of the "LocalSettings.php" file at the root of your MediaWiki install
require_once("$IP/extensions/MathJax/MathJax.php");
$wgMathJaxJS = array("/mathjax-1.1b/MathJax.js" =>
"$IP/extensions/MathJax/mwMathJaxConfig.js");
I just have fixed this. Just comment (//
) all lines with errors :)
for me that were:
line 88 code: $wgMessageCache->addMessages( $langMessages, $lang );
line 209: $state->general->mergeArray( $generalItems );
and I have removed $parser->mOptions->getUseTeX() &&
from line 159:
if( $parser->mOptions->getUseTeX() && $wgUser->getOption('math') == MW_MATH_JSMATH ) {
see also: Error_in_jsMath
精彩评论