想用Mediawike做教程,当然主要是高中数学教程。
不能像博客里老用word截图,所以得在Mediawiki里启用LaTex公式服务。
它有自带的,但安装比较麻烦,不是自己的服务器,似乎无法进行。
能不能直接使用公用的LaTex公式服务呢?
结论当然是肯定喽。
两步就可以搞定:
1.将Mediawiki中includes/目录下的Math.php中的内容修改为:
<?php
class MathRenderer {
public static function renderMath( $tex ) {
$url = htmlspecialchars( "http://latex.codecogs.com/png.latex?$tex");
$alt = trim(str_replace("\n", ' ', htmlspecialchars( $tex )));
return "<img class='tex' src=\"$url\" alt=\"$alt\" />";
}
}
其中
是公用的LaTex服务,可以修改其他可用。
2.启用LocalSettings.php中的“$wgUseTeX = true;”
完毕,上图。
不能像博客里老用word截图,所以得在Mediawiki里启用LaTex公式服务。
它有自带的,但安装比较麻烦,不是自己的服务器,似乎无法进行。
能不能直接使用公用的LaTex公式服务呢?
结论当然是肯定喽。
两步就可以搞定:
1.将Mediawiki中includes/目录下的Math.php中的内容修改为:
<?php
class MathRenderer {
public static function renderMath( $tex ) {
$url = htmlspecialchars( "http://latex.codecogs.com/png.latex?$tex");
$alt = trim(str_replace("\n", ' ', htmlspecialchars( $tex )));
return "<img class='tex' src=\"$url\" alt=\"$alt\" />";
}
}
其中
http://latex.codecogs.com/png.latex?
是公用的LaTex服务,可以修改其他可用。
2.启用LocalSettings.php中的“$wgUseTeX = true;”
完毕,上图。
苦涩的数学
纪念华罗庚诞辰101周年

