==== HOWTO install ==== (courtesy of Bernhard Kast) (几乎为翻译[[http://johannes.sipsolutions.net/Projects/new-moinmoin-latex|原文]]) * 依赖: * LaTeX (debian package tetex-bin ; win上可选CTeX套件) * LaTeX的UTF-8支持 (debian package latex-ucs ; win上CTeX已包含) * [[http://sourceforge.net/projects/dvipng|dvipng]] (debian package dvipng ; win上CTeX已包含) * 安装: * 从 [[http://johannes.sipsolutions.net/Projects/new-moinmoin-latex/parser?action=raw]] 获取 parser 代码(见原文的code section) (用"显示源码"方式) 保存在Wiki的Path/plugin/parser下取名latex.py. (win下, 我的存在f:\Python24\Lib\site-packages\MoinMoin\parser\latex.py) * 从 [[http://johannes.sipsolutions.net/Projects/new-moinmoin-latex/macro?action=raw]] 获取 macro code 代码 (见原文的 code section) 保存在Wiki的Path/plugin/macro. (win下, 我的存在f:\Python24\Lib\site-packages\MoinMoin\parser\latex.py) * 在你的wikiconfig.py 中开启上传文件功能 (allowed_actions = ['Attach``File']) (如果尚未开启) * 测试, 将``[``[latex(\usepackage{dsfont} % $$\mathds{C}$$)]] 拷贝到你的页面, 得到反馈"<>" , 完成 :) ==== Windows 安装注记 ==== Windows下出于安全等因素考虑, 新版本依赖于runlimit.exe这个程序, 从[[http://johannes.sipsolutions.net/files/runlimit.zip|runlimit.zip (built by Alexander Schremmer)]]下载源码和可执行版本. 然后将runlimit.exe放在搜索路径, 或者修改\parser\latex.py中的相应位置. ==== inline latex ==== 使用``{``{{ #!latex ... }}}使用环境会产生换行 ,想将latex嵌入到moin的行中有两种方法: * 用 <>形式, 如{{{ [[latex(\usepackage{graphics,color} % \newsavebox{\mysquare} \savebox{\mysquare}{\textcolor{blue}{\rule{1cm}{1cm} } } \usebox{\mysquare} )]]}}} 为一个蓝色的方框 * 更简洁的方法, 使用inline latex程序. 从[[http://johannes.sipsolutions.net/Projects/new-moinmoin-latex/inline?action=raw|inline]]下载代码, 保存在Path/plugin/parser中名为inline_latex.py, 对希望inline的页面加入{{{#format inline_latex}}}, 于是你就可以使用{{{$ ... $}}}的形式书写latex公式了 ==== 例子 ==== {{{#!latex %%anchor: red-square \usepackage{graphics,color} %%end-prologue%% \newsavebox{\mysquare} \savebox{\mysquare}{\textcolor{red}{\rule{1in}{1in} } } \usebox{\mysquare} }}}