Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

如何讲org-mode里面的公式输出到html?

4 views
Skip to first unread message

coder

unread,
May 18, 2012, 2:34:26 PM5/18/12
to
输出到pdf 一切正常,可是输入到html就是一片空白。
--

[m [35m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

coder

unread,
May 18, 2012, 4:10:12 PM5/18/12
to
如果用 #+begin_src/end_src包起来,html一片空白
#+begin_src latex
\begin{displaymath}
T_{m\leqslant n}
\end{displaymath}
#+end_src

但是去掉这个后,就可以了:
\begin{displaymath}
T_{m\leqslant n}
\end{displaymath}

这个是怎么回事呢?


【 在 Algorithmist 的大作中提到: 】
: 输出到pdf 一切正常,可是输入到html就是一片空白。

--

[m [37m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

coder

unread,
May 19, 2012, 5:37:44 AM5/19/12
to
我觉得最理想的状况,应该是同一份org文件, 可以输出不同的格式(比如,pdf, html),而不需要修改org文件。


现在这样, 输出pdf一种写法,输出html一种写法。 不好!


【 在 Algorithmist 的大作中提到: 】
: 如果用 #+begin_src/end_src包起来,html一片空白
: #+begin_src latex
: \begin{displaymath}
: ...................

I love this game!!!

unread,
May 19, 2012, 11:42:05 AM5/19/12
to
在手册里搜索一下begin_src
这个是基本概念,还是应该知道的

【 在 Algorithmist (coder) 的大作中提到: 】
: 如果用 #+begin_src/end_src包起来,html一片空白
: #+begin_src latex
: \begin{displaymath}
: ...................

--
aoccdrnig to rscheearch at an elingsh uinervtisy
it deosn’t mttaer in waht oredr the ltteers in
a wrod are, the olny iprmoetnt tihng is taht
the frist and lsat ltteer is at the rghit pclae


[m [1;34m※ 来源:·水木社区 newsmth.net·[FROM: 221.220.252.*] [m

I love this game!!!

unread,
May 19, 2012, 11:50:20 AM5/19/12
to
你是想输出公式还是src?
输出公式的就是一种写法
直接写$$xxx$$就行了
org导出HTML可以用MathJax
orgmode手册上有用法
简单的说
1.org文件中加入
#+MATHJAX: align:"left" mathml:t path:"./MathJax/MathJax.js"
2.去MathJax主页上下载MathJax包,解压在html目录下就可以用了

【 在 Algorithmist (coder) 的大作中提到: 】
: 我觉得最理想的状况,应该是同一份org文件, 可以输出不同的格式(比如,pdf, html),而不需要修改org文件。
: 现在这样, 输出pdf一种写法,输出html一种写法。 不好!

coder

unread,
May 19, 2012, 12:45:18 PM5/19/12
to
这么写的话,输出pdf就不行了

【 在 icejill 的大作中提到: 】
: 你是想输出公式还是src?
: 输出公式的就是一种写法
: 直接写$$xxx$$就行了
: ...................

--

[m [32m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

coder

unread,
May 19, 2012, 1:06:32 PM5/19/12
to
而且不管公式还是源码都没有输出。。。

【 在 icejill 的大作中提到: 】
: 你是想输出公式还是src?
: 输出公式的就是一种写法
: 直接写$$xxx$$就行了
: ...................

--

[m [33m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

I love this game!!!

unread,
May 19, 2012, 9:37:56 PM5/19/12
to
http://wuyang.yangsheep.net/#sec-2-3-1
这个是你想要的效果吗
我输出了公式和源码

【 在 Algorithmist (coder) 的大作中提到: 】
: 而且不管公式还是源码都没有输出。。。

I love this game!!!

unread,
May 19, 2012, 11:06:48 PM5/19/12
to
我在本版的Wiki上加了MathJax的内容
https://app.iplocal.org/emacs/wiki/CategoryOrgMode/Html#org-mathjax
我也建议大家在回答其他人问题的时候,尽量在wiki中加入内容。
一方面,这是真实的需求,另一方面,时间久了,自己都忘记了:)
【 在 icejill (I love this game!!!) 的大作中提到: 】
: http://wuyang.yangsheep.net/#sec-2-3-1
: 这个是你想要的效果吗
: 我输出了公式和源码
: ...................

coder

unread,
May 20, 2012, 12:42:00 AM5/20/12
to
是啊,是啊!你是怎么做到的?

其他的语言,我能输出源码,但是不能输出latex源码。

【 在 icejill 的大作中提到: 】
: http://wuyang.yangsheep.net/#sec-2-3-1
: 这个是你想要的效果吗
: 我输出了公式和源码
: ...................

--

[m [35m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

I love this game!!!

unread,
May 20, 2012, 12:48:04 AM5/20/12
to
#+NAME: Fibonacci MathJax Demo
#+begin_src latex
f(n)=\left\{
\begin{array}{l l}
0, & n=0 \\
1, & n=1 \\
f(n-1)+f(n-2), & x \geq 2
\end{array}
\right.
#+end_src

【 在 Algorithmist (coder) 的大作中提到: 】
: 是啊,是啊!你是怎么做到的?
: 其他的语言,我能输出源码,但是不能输出latex源码。

coder

unread,
May 20, 2012, 4:47:12 AM5/20/12
to
我的代码是这样的, 无论代码, 公式都没有输出。

#+MATHJAX: align:"left" mathml:t path:"/Home/Qiang/MathJax/MathJax.js"

#+NAME: Fibonacci MathJax Demo
#+begin_src latex
\LaTex
#+end_src



#+begin_src latex :file latex-logo.png
\LaTeX
#+end_src



【 在 icejill 的大作中提到: 】
: #+NAME: Fibonacci MathJax Demo
: #+begin_src latex
: f(n)=\left\{
: ...................

--

[m [37m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

I love this game!!!

unread,
May 20, 2012, 6:06:38 AM5/20/12
to
我想可能是我们对双方的输出理解不一样
你输出是怎么操作的?

【 在 Algorithmist (coder) 的大作中提到: 】
: 我的代码是这样的, 无论代码, 公式都没有输出。
: #+MATHJAX: align:"left" mathml:t path:"/Home/Qiang/MathJax/MathJax.js"
: #+NAME: Fibonacci MathJax Demo
: ...................

coder

unread,
May 20, 2012, 6:16:53 AM5/20/12
to
C-c C-e b

【 在 icejill 的大作中提到: 】
: 我想可能是我们对双方的输出理解不一样
: 你输出是怎么操作的?
:

--

[m [32m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

I love this game!!!

unread,
May 20, 2012, 8:37:24 AM5/20/12
to
把你的org文件贴上来看看
操作系统,emacs版本,org版本

【 在 Algorithmist (coder) 的大作中提到: 】
: C-c C-e b

coder

unread,
May 20, 2012, 10:13:00 AM5/20/12
to
ubuntu 12.04
emacs: GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.1) of 2012-05-10 on rhenium, modified by Debian

org: Org-mode version 7.8.09


附件里面的3段src, 只有python的那段输出到1.html了。

【 在 icejill 的大作中提到: 】
: 把你的org文件贴上来看看
: 操作系统,emacs版本,org版本
:

--

[m [37m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

coder

unread,
May 20, 2012, 10:15:09 AM5/20/12
to
刚才忘记上传附件了。



【 在 Algorithmist 的大作中提到: 】
: ubuntu 12.04
: emacs: GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.1) of 2012-05-10 on rhenium, modified by Debian
: org: Org-mode version 7.8.09
: ...................
[upload=1][/upload]

I love this game!!!

unread,
May 20, 2012, 10:22:20 AM5/20/12
to
我这里用你的文件输出正常
org版本和你一样
操作系统是window 7
Emacs版本是23.4
难道是Emacs24的问题?不知道,没用过


【 在 Algorithmist (coder) 的大作中提到: 】
: ubuntu 12.04
: emacs: GNU Emacs 24.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.1) of 2012-05-10 on rhenium, modified by Debian
: org: Org-mode version 7.8.09
: ...................

coder

unread,
May 20, 2012, 11:23:50 AM5/20/12
to
我用emacs -q 启动后, 可以输出latex block.

不知道我的哪个设置把这个过滤掉了。:(

【 在 icejill 的大作中提到: 】
: 我这里用你的文件输出正常
: org版本和你一样
: 操作系统是window 7
: ...................

--

[m [32m※ 来源:·水木社区 http://newsmth.net·[FROM: 84.208.185.*] [m

猫王

unread,
May 20, 2012, 11:27:23 AM5/20/12
to
ubuntu? I really don't know if ubuntu does more good than
debian to newbies.
If it does not, why not debian?

【 在 icejill (I love this game!!!) 的大作中提到: 】
: 我这里用你的文件输出正常
: org版本和你一样
: 操作系统是window 7
: ...................

--

[36m※ 修改:·stid 于 May 20 23:27:22 2012 修改本文·[FROM: 111.193.187.*] [m
[m [1;36m※ 来源:·水木社区 newsmth.net·[FROM: 111.193.187.*] [m

猫王

unread,
May 20, 2012, 11:26:46 AM5/20/12
to
paste your .emacs

【 在 Algorithmist (coder) 的大作中提到: 】
: 我用emacs -q 启动后, 可以输出latex block.
: 不知道我的哪个设置把这个过滤掉了。:(


--

coder

unread,
May 20, 2012, 11:36:43 AM5/20/12
to
我把下面设置注释掉后就可以了:

(org-babel-do-load-languages
(quote org-babel-load-languages)
(quote ((emacs-lisp . t)
(dot . t)
(ditaa . t)
(R . t)
(python . t)
(ruby . t)
(gnuplot . t)
(clojure . t)
(sh . t)
(ledger . t)
(org . t)
(plantuml . t)
(scheme . t)
(latex . t))))

不知道什么原因。


【 在 stid 的大作中提到: 】
: paste your .emacs
:

猫王

unread,
May 20, 2012, 11:38:10 AM5/20/12
to
那这段话是什么意思?

【 在 Algorithmist (coder) 的大作中提到: 】
: 我把下面设置注释掉后就可以了:
: (org-babel-do-load-languages
: (quote org-babel-load-languages)
: ...................

猫王

unread,
May 20, 2012, 11:44:58 AM5/20/12
to
那就不懂了。也许是冲突吧

【 在 Algorithmist (coder) 的大作中提到: 】
: 这段话应该是在 org-mode 里面可以 执行的语言吧。
: 只要把 (latex . t)从这个list去掉后,就可以输出到html了, 不过就不能通过C-c C-c 执行latex src code了。

coder

unread,
May 20, 2012, 11:42:22 AM5/20/12
to
这段话应该是在 org-mode 里面可以 执行的语言吧。


只要把 (latex . t)从这个list去掉后,就可以输出到html了, 不过就不能通过C-c C-c 执行latex src code了。



【 在 stid 的大作中提到: 】
: 那这段话是什么意思?

coder

unread,
May 20, 2012, 11:48:00 AM5/20/12
to
把 (latex . t) 从babel list去掉后, 尽管可以输入#begin_src latex #end_src 里面的代码,但是不能显示为 MathJax显示为数学公式。

而不用#begin_src latex #end_src 包起来的, 可以显示为公式。

【 在 icejill 的大作中提到: 】
: 我这里用你的文件输出正常
: org版本和你一样
: 操作系统是window 7
: ...................

0 new messages