问题
In MediaWiki if you add in formulas non english text it cuts. For example if you write \text{щfбb}
(щ
and б
russian (cyrillic) symbols) output will be fb
not щfбb
.
回答1:
First of all if you have MediaWiki version lower than 1.18 then open file includes/Math.php and find (this code for version 1.16):
escapeshellarg( $wgTmpDirectory ).' ';
escapeshellarg( $this->tex ).' ';
and replace with:
escapeshellarg( $wgTmpDirectory ).' '; setlocale(LC_CTYPE, "en_US.utf8"); $cmd .=
escapeshellarg( $this->tex ).' '; setlocale(LC_ALL, "C"); $cmd .=
this needed because escapeshellarg
cut UTF8 symbols. If you see in that place function wfEscapeShellArg
instead of escapeshellarg
then you need to set $wgShellLocale to en_US.utf8
.
Second, download latest Math extension and extract math
folder. Open file texutil.ml
and find line:
"\\usepackage{cancel}\n\\pagestyle{empty}\n\\begin{document}\n$$\n"
add your alphabet:
"\\usepackage[russian]{babel}\n\\usepackage{cancel}\n\\pagestyle{empty}\n\\begin{document}\n$$\n"
Delete all files from your current math
folder and upload files from extension. Open console, cd
to math
folder and do make
:
$ aptitude install ocaml /* install ocaml if needed */
$ make
Also add to LocalSettings.php
(change folder to yours):
putenv('HOME=/home/user');
Now new alphabet should work. ;)
来源:https://stackoverflow.com/questions/19276411/how-to-add-other-languages-to-tex