ASCIIMath4Wiki
天下维客,你可以修改的网络知识库
| Template:If | |
| Type: | {{{type}}} |
|---|---|
| Maturity: | {{{maturity}}} |
| MediaWiki: | 1.6+ |
| Version: | 1.0 |
| Last Update: | 2006-06-12 |
| Description: | 添加数学符号解析标记 ASCIIMath as MathML. |
| MediaWiki extensions | |
<asciimath>标签显示输出数学公式.
比较起 LaTeX 这是个简易的版本, LaTeX需要更高的存储空间. 此扩展并不生成图像, 但需要第三方扩展的支持, 或者依赖浏览器的数学符号解析. ASCIIMath的用法非常简单并且比 LaTeX更加人性化.
目录 |
[编辑]
使用方法
[编辑]
语法
数学公式例子可以在下面网址找到ASCIIMath syntax, contained by the custom<asciimath>tag:
<asciimath>ASCIIMath_expressions</asciimath>
[编辑]
浏览器兼容
MathML 属于互联网标准, 但是并不是所有浏览器都支持.
- Firefox 支持 MathML, 但需要安装一种特殊字体; 查看 字体安装指南.
- Internet Explorer 不支持 MathML; Internet Explorer 可以通过 Math Player 插件查看MathML.
[编辑]
安装
该扩展需要 MediaWiki 1.6以上 并且需要 ASCIIMathPHP 1.1+ PHP 扩展, 皮肤文件必须修改包括 MathML DTD. 避免在此扩展中使用 TeX; 如果你正在使用 TeX, 就不要再使用本插件.
- 下载 (包括 ASCIIMath4Wiki 和 ASCIIMathPHP).
解压文件 /extensions/ 到mediawiki扩展目录. 该压缩包包括 ASCIIMath4Wiki.php, ASCIIMathPHP.cfg.php, 和 ASCIIMathPHP.class.php.修改 LocalSettings.php (接近文件底部):
include("extensions/ASCIIMath4Wiki.php");
在皮肤文件中修改 DTD 包含 MathML (<a href="#Changing_DTD" title="">下面</a>).
[编辑]
修改 DTD
注意: 所有wiki页面都输出兼容XHTML的代码, 但是要留意其他扩展的 HTML 不规范的代码. 留意这些问题将导致解析时发生错误; XHTML 是非常严谨的.
打开 /skins/MonoBook.php 找到以下内容; (注意这里指的是你的mediawiki的皮肤文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang')?>" lang="<?php $this->text('lang')?>" dir="<?php $this->text('dir')?>">
改成:
<?php header('Content-type: application/xhtml+xml;;charset=utf-8');
header('Vary: Accept');
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [
<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang')?>" lang="<?php $this->text('lang')?>" dir="<?php $this->text('dir')?>">
[编辑]


