请问 reStructuredText 里如何写化学分子式

13 views
Skip to first unread message

HuangJiahua

unread,
Jan 7, 2006, 5:49:22 AM1/7/06
to python.cn
请问 reStructuredText 里如何嵌入化学分子式

或者,reStructuredText 里能嵌入 LaTex 代码么


谢谢

limodou

unread,
Jan 7, 2006, 9:04:38 AM1/7/06
to pyth...@googlegroups.com
在 06-1-7,HuangJiahua<jhuang...@gmail.com> 写道:

> 请问 reStructuredText 里如何嵌入化学分子式
>
> 或者,reStructuredText 里能嵌入 LaTex 代码么
>

没看见过,好象不行。

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit

HuangJiahua

unread,
Jan 7, 2006, 12:27:32 PM1/7/06
to python.cn
谢谢 limodou 的回复~

不过我在 docutils 的 sandbox 里看到一个 latex_math 的
http://docutils.sourceforge.net/sandbox/jensj/latex_math/

==================
LaTeX-math plug-in
==================

The plug-in adds a latex-math role and directive that transforms ReST
+ LaTeX-math to html + MathML. The script (in the ``tools`` directory)
does exactly what rst2html.py does - only difference is that a
latex-math role and directive is added to the parser before parsing.

It works like this::

python rst2mathml.py document.txt > document.xhtml

(try the test file from the ``test`` directory).

Documentation is in the ``docs`` directory.

The script is a quick hack that we can use for testing until we have
real plug-in support.

Any feedback is appreciated.

limodou

unread,
Jan 7, 2006, 10:56:56 PM1/7/06
to pyth...@googlegroups.com
2006/1/8, HuangJiahua <jhuang...@gmail.com>:
没有用过。

hoxide Ma

unread,
Jan 8, 2006, 9:29:04 AM1/8/06
to pyth...@googlegroups.com
我以前在moin中加入过latex的支持, 这些插件都是要根据具体应用的.

在 06-1-8,limodou<lim...@gmail.com> 写道:


--
==========================================================

A student of Math in Soochow University in China.
Intrested in Math, Python, Octave, Lisp, Maxima, Prolog and .NET/MONO.

Blog: http://blog.sina.com.cn/blog/1142604745
Wiki: http://wiki.woodpecker.org.cn/moin/Hoxide

HuangJiahua

unread,
Jan 8, 2006, 10:59:59 AM1/8/06
to python.cn
现在的思路
http://www.livejournal.com/users/huangjiahua/6804.html

把 LaTex 编译为图片来显示


1. 在 gif/png 图片文件的 meta 里记录 LaTex 代码
让 restword 读取图片的meta 信息
好处:
1. 不用修改标准的 reStructuredText
2. 图片跟 LaTex 标记绑定,不会弄混图片

坏处:
1. rst 里不带 LaTex
信息,不能用文本工具修改,只能在 restword 里编辑
LaTex
2. 由于 LaTex 都在图片里, rst 文件必须跟 图片
一块放置


2. 在 image 标记里用 alt="latex:LaTex 标记" 来记录 LaTex
好处:
1. 公式、分子式的 LaTex 标记都在 rst 里,
可以用其它文本编辑器直接编辑
2. 可以不用附带图片

坏处:
1. LaTex 标记跟图片可能不一致

附图:
编辑 LaTex 和图片

Zoom Quiet

unread,
Jan 8, 2006, 7:56:18 PM1/8/06
to pyth...@googlegroups.com
2006/1/8, HuangJiahua <jhuang...@gmail.com>:
> 现在的思路
> http://www.livejournal.com/users/huangjiahua/6804.html
>
唉呀呀!!!"编辑 LaTex 和图片" 你使用的是什么编辑器?太神了!!
有M$ 版本的?!

> 把 LaTex 编译为图片来显示
>
>
> 1. 在 gif/png 图片文件的 meta 里记录 LaTex 代码
> 让 restword 读取图片的meta 信息
> 好处:
> 1. 不用修改标准的 reStructuredText
> 2. 图片跟 LaTex 标记绑定,不会弄混图片
>
> 坏处:
> 1. rst 里不带 LaTex
> 信息,不能用文本工具修改,只能在 restword 里编辑
> LaTex
> 2. 由于 LaTex 都在图片里, rst 文件必须跟 图片
> 一块放置
>
>
> 2. 在 image 标记里用 alt="latex:LaTex 标记" 来记录 LaTex
> 好处:
> 1. 公式、分子式的 LaTex 标记都在 rst 里,
> 可以用其它文本编辑器直接编辑
> 2. 可以不用附带图片
>
> 坏处:
> 1. LaTex 标记跟图片可能不一致
>
> 附图:
> 编辑 LaTex 和图片
>


--
# Time is unimportant, only life important!
## 面朝开源,我心自由!

hoxide Ma

unread,
Jan 8, 2006, 11:21:49 PM1/8/06
to pyth...@googlegroups.com
我来解释一下moin的latex插件中的流程, 和HuangJiahua类似, 不过也有不同

{{{#!latex2
....
}}}
中是latex的代码, moin找到latex2这个后缀自动调用解析器, 解析之, 而解析器则对这段代码作md5, 得到代码串,
若对应目录已有相关的图片则不生成, 若无, 则用latex生成图片, 并上传到对应目录.

因此修改latex代码后图片自动重新生成.


2006/1/9, Zoom Quiet <zoom....@gmail.com>:

hoxide Ma

unread,
Jan 8, 2006, 11:22:27 PM1/8/06
to pyth...@googlegroups.com
Zoomq? 有兴趣在Woodpecker 的moin中加入latex的支持吗?

在 06-1-9,hoxide Ma<hox...@gmail.com> 写道:

Zoom Quiet

unread,
Jan 9, 2006, 12:22:38 AM1/9/06
to pyth...@googlegroups.com
在 06-1-9,hoxide Ma<hox...@gmail.com> 写道:
> Zoomq? 有兴趣在Woodpecker 的moin中加入latex的支持吗?
>
好哪!!原先就尝试过的,但是一直没有成功哪!!!呜乎哀哉!
关键是需要两个宏的配合,你有成功的体验,分享一下子哪!

HuangJiahua

unread,
Jan 9, 2006, 2:50:59 AM1/9/06
to python.cn
谢谢~~
是小弟写的一个玩具
跟 hoxide Ma 前辈的 moin 插件一样都是用
latex生成图片,只是是用 PyGtk 的 GUI ,

等放寒假后跟 所见所得 reStructuredText
编辑器一块放出来

hoxide Ma

unread,
Jan 10, 2006, 5:02:36 AM1/10/06
to pyth...@googlegroups.com
2006/1/9, HuangJiahua <jhuang...@gmail.com>:

> 谢谢~~
> 是小弟写的一个玩具
> 跟 hoxide Ma 前辈的 moin 插件一样都是用
> latex生成图片,只是是用 PyGtk 的 GUI ,

moin 插件可不是偶写的阿, 偶只是配置一下而已.

> 等放寒假后跟 所见所得 reStructuredText
> 编辑器一块放出来

好东西阿, 是web的吗? 偶最近在研究Pyblosxom, 正缺给blog配个编辑器, 用reST, 加web editor 就完美了.

Zoom Quiet

unread,
Jan 10, 2006, 5:05:23 AM1/10/06
to pyth...@googlegroups.com
在 06-1-10,hoxide Ma<hox...@gmail.com> 写道:

> 2006/1/9, HuangJiahua <jhuang...@gmail.com>:
> > 谢谢~~
> > 是小弟写的一个玩具
> > 跟 hoxide Ma 前辈的 moin 插件一样都是用
> > latex生成图片,只是是用 PyGtk 的 GUI ,
>
> moin 插件可不是偶写的阿, 偶只是配置一下而已.
>
> > 等放寒假后跟 所见所得 reStructuredText
> > 编辑器一块放出来
>
> 好东西阿, 是web的吗? 偶最近在研究Pyblosxom, 正缺给blog配个编辑器, 用reST, 加web editor 就完美了.
PyBlosxom 绝对简单的Blog 系统!!我也在研究是也乎!!!
共同Happy hack!!!

>
>
> --
> ==========================================================
>
> A student of Math in Soochow University in China.
> Intrested in Math, Python, Octave, Lisp, Maxima, Prolog and .NET/MONO.
>
> Blog: http://blog.sina.com.cn/blog/1142604745
> Wiki: http://wiki.woodpecker.org.cn/moin/Hoxide
>

HuangJiahua

unread,
Jan 11, 2006, 3:11:56 AM1/11/06
to python.cn
WEB 的话,
zope-cps 里带有一个

hoxide Ma

unread,
Jan 11, 2006, 3:15:24 AM1/11/06
to pyth...@googlegroups.com
恩~~ 研究研究 谢谢,

2006/1/11, HuangJiahua <jhuang...@gmail.com>:
> WEB 的话,
> zope-cps 里带有一个

Reply all
Reply to author
Forward
0 new messages