ubuntu - 在 MediaWiki 1.24.1 (Ubuntu) 中显示数学方程

标签 ubuntu math mediawiki mediawiki-extensions

数学扩展 2.0.0
媒体维基 1.24.1
Ubuntu 14.04.3

我已按照 https://www.mediawiki.org/wiki/Extension:Math 中的步骤进行操作

在我的 LocalSettings.php 的底部,我有:

require_once "$IP/extensions/Math/Math.php";
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathFullRestbaseURL= 'https://api.formulasearchengine.com/';

这要归功于 Tgr 的回答。所以我正在尝试使用远程 Mathoid 服务。

但是,如果我尝试使用以下内容创建 wiki 页面:
<math>x^2</math>

...它被渲染为:
Failed to parse (Missing <code>texvc</code> executable. 
    Please see math/README to configure.): 

...而且这个 README 文件似乎只包含构建 texvc 的说明.但鉴于 Tgr 的回答,我不想使用 texvc .我想使用远程 Mathoid 服务。

尽管说明中没有建议,但感谢#mediawiki IRC 上的人,我这样做:
pi@PiDroplet:~$ cd web/wiki/extensions/Math/

pi@PiDroplet:~/web/wiki/extensions/Math$ make
cd math; make 
make[1]: Entering directory `/home/pi/web/wiki/extensions/Math/math'
ocamlopt -c util.ml
make[1]: ocamlopt: Command not found
make[1]: *** [util.cmx] Error 127
make[1]: Leaving directory `/home/pi/web/wiki/extensions/Math/math'
make: *** [texvc] Error 2

安装 ocamlopt , 我愿意 apt-get install ocaml-nox -- 现在 make 完成了,我遇到了另一个渲染错误:
"Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)):"

关注 https://www.mediawiki.org/wiki/Manual:Troubleshooting_math_display_errors#.22Failed_to_parse_.28PNG_conversion_failed.3B_check_for_correct_installation_of_latex.2C_dvips.2C_gs.2C_and_convert.29.22我愿意:
ls -lH `which gs` `which latex` `which dvips` `which convert`

...这告诉我我没有“转换”——其他一切都存在。
sudo apt-get install imagemagick ...所以现在我有一个/usr/bin/convert

看来我也需要sudo apt-get install dvipng
仍然在同一个链接工作,我必须做 sudo apt-get install texlive-latex-extra然后重新启动服务器,它可以正确渲染!

但是,如果我打开我的错误:
# DEBUG
error_reporting( -1 );
ini_set( 'display_errors', 1 );

$wgShowSQLErrors = true;
$wgDebugDumpSql  = true;
$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;

我在页面顶部:
PHP Notice:  Missing <code>texvccheck</code> executable. 
Please see math/README to configure. 
in /var/www/wiki/extensions/Math/MathInputCheckTexvc.php on line 65

https://www.mediawiki.org/wiki/Extension_talk:Math#Please_see_math.2FREADME_to_configure.in.2Fvar.2Fwww.2Fwiki.2Fextensions.2FMath.2FMathInputCheckTexvc.php_on_line_65有一个解决方案:
sudo apt-get install ocaml
cd extensions/Math/texvccheck
make

我从页面更上方得到了第一个命令。
$wgMathTexvcCheckExecutable = "$IP/extensions/Math/texvccheck/texvccheck";

哈!最后,正确的输出和0错误!

最佳答案

使用 Math 曾经涉及编译 texvc; older versions扩展页面的告诉你怎么做。当前版本使用 Mathoid(一种在不同机器上运行的服务,wiki 引擎可以通过 HTTP 与之交互);再一次,扩展页面告诉你如何。您可能不想在自己的服务器上安装 Mathoid,这需要付出很多额外的努力。

关于ubuntu - 在 MediaWiki 1.24.1 (Ubuntu) 中显示数学方程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34779164/

相关文章:

linux - 如何从每个具有匹配文本的文件中删除行?

c++ - C++ 中的费马分解

java - 如何判断一个double变量是否有整型值?

MediaWiki 返回查询字符串的最佳匹配

c++ - 编译boost c++代码错误

postgresql - Postgres 密码验证失败

php - 在 MediaWiki 上上传视频时出现 AVFilterGraph 错误

mysql - MediaWiki MySQL 数据库字符集,使用哪一个?

MongoDB GPG - 无效签名

javascript - 三点之间的 Angular 数学解释