这些资料基本是从网上复制来的,当然经过我自己的整理添加。

先是基本语法:
1.常见使用
*加粗* 加粗
/倾斜/ 倾斜
_下划线_ 下划线
导出文件的标题在特定行给出
#+TITLE: This is the title of the document
目录表通常会直接插入在文档第一个标题之前
#+OPTIONS: toc:2 (目录中只显示二级标题)
#+OPTIONS: toc:nil (无目录)
当从另外一个文档中引用一段话时通过会让它左右都缩进
#+BEGIN_QUOTE
Everything should be made as simple as possible,
but not any simpler -- Albert Einstein
#+END_QUOTE
如果你想让某些文本居中
#+BEGIN_CENTER
Everything should be made as simple as possible, \\
but not any simpler
#+END_CENTER
这是一个很奇葩的功能,当你使用这句语法的时候,输出html,会自动播放你指定的音乐……
#<bgsound src="d:/自用/0/Music/1.mp3" loop=5>
“loop”表示循环次数。
当导出文档时,你可以包含其他文件中的内容。比如,想包含你的“.emacs”文件,你可以用:
#+begin_src org
, #+INCLUDE: "~/.emacs" src emacs-lisp
#+end_src
可选的第二个第三个参数是组织方式(例如,“quote”,“example”,或者“src”),如果是 “src”,语言用来格式化内容。组织方式是可选的,如果不给出,文本会被当作 Org 模式的正常处理。用 C-c , 访问包含的文件。
当 Org 标题含有很多星号并且标题下面的文字缩进
* Top level headline
** Second level
*** 3rd level
some text
*** 3rd level
more text
* Another top level headline
如果你用的 Emacs 23.1.50.3 和 Org 6.29 的更高版本,这种视图可以用 org-indent-mode 模式动态地实现。也可以通过设置变量 org-startup-indented 为所有的文件打开 org-indent-mode 模式,或者用
#+STARTUP: indent
如果你希望为图片定义一个标题,或者一个标签方便内部交叉引用,可以让图片单独一行
#+CAPTION: This is the caption for the next figure link (or table)
#+LABEL: fig:SED-HR4049
[[./img/a.jpg]]
对于需要包含数学符号和特殊方程的科学笔记,Org 模式支持嵌入 LaTeX 代码到文件中。你可以直接使用类 TeX 的宏来输入特殊符号,输入方程,或者整个 LaTeX 环境。
#+begin_src org
,Angles are written as Greek letters \alpha, \beta and \gamma. The mass if
,the sun is M_sun = 1.989 x 10^30 kg. The radius of the sun is R_{sun} =
,6.96 x 10^8 m. If $a^2=b$ and $b=2$, then the solution must be either
,$a=+\sqrt{2}$ or $a=-\sqrt{2}$.
,\begin{equation}
,x=\sqrt{b}
,\end{equation}
#+end_src
特殊设置之后,导出 HTML 时 LaTeX 代码片断会生成图片并包含进来。
关于链接
C-c C-l 编辑链接
C-c C-o 打开链接
链接的格式
[[link][description]] 或者 [[link]]
常用link类型
http://www.sina.com Web
file:paper/lastdoc.pdf 本地文档,用相对路径表示
file:/path/to/filename 本地文档,用绝对路径表示
news:comp.emacs 新闻组
[email protected] 邮件地址
关于自定义css
#+STYLE: <link rel="emacs" type="/home/mudan/Documents/org/css" href="emacs.css" /> 自定义css
#test{font-size:14px;} 设置字体大小
下面贴一下我的自定义css:
#+STYLE: <link rel="stylesheet" type="text/css" href="C:/Documents and Settings/Mu/My Documents/worg.css" />
#+INFOJS_OPT: view:info mouse:underline up:think_world.html home:http://www.orgmode.org toc:t
我有几个挺好的css文件,打包了一下,可以在链接中下载:http://pan.baidu.com/share/link?shareid ... 1963878638
段落、分行和引用
段落之间至少要有一空行。如果你想实现段内分行,可以在行后加上“\\”。
要想在一个区域内实现分行,而其他地方使用正常格式,你可以使用下面的语法实行:
#+BEGIN_VERSE
Great clouds overhead
Tiny black birds rise and fall
Snow covers Emacs
-- AlexSchroeder
#+END_VERSE
排版源码
#+begin_src 语言
...
#+end_src
例如:
#+begin_src c -t -h 7 -w 40
int main(void)
{
printf("Hello, World!\n");
return 0;
}
#+end_src
语法详解:
-n 显示行号
-t 清除格式
-h 7 设置高度为 7 行
-w 40 设置宽度为 40 列
关于导出
C-c C-e l 导出 LaTeX 文件
C-c C-e p 导出 LaTeX 文件,并处理成 PDF 文件(需要格外的LaTeX软件支持)
C-c C-e d 导出 LaTeX 文件,处理成 PDF 文件,并打开
C-c C-e D 导出 DocBook 文件
C-c C-e a 导出 ASCII 文件
C-c C-e 用来导出和发布的调度器(我通常使用这个命令,然后在里面选择导出格式)
当导出文档时,你可以包含其他文件中的内容
#+INCLUDE: "~/.emacs" src emacs-lisp
额,开胃菜结束
