您的位置:首页 > Web前端 > HTML

用Emacs MUSE生成HTML报告时包含数学公式

2012-09-08 20:59 323 查看
需求如题,现在首先明白,最新版本的emacs自带了muse-latex2png.el文件。该程序会将latex转换成png,然后显示在html图片上。
在~/.emacs中添加:
(require 'muse-latex2png)但是依赖另一个程序转成png,在Ubuntu下安装:
apt-get install dvipng
好了,打开Muse文档,输入如下标记:
<latex>
\[
E = mc^2
\]
</latex>
会显示:



觉得生成的公式图片太大了?可以在~/.emacs中设置变量muse-latex2png-scale-factor的值。
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.

'(muse-latex2png-scale-factor 1.2))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)


参考这篇文章,有一些选项设置可借鉴。
http://lifegoo.pluskid.org/wiki/MuseLatex2Png.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: