mac OS X 10.9.3 上emacs 24.1 org-mode8.26 输出中文pdf

来源:互联网 发布:mac上隐藏文件夹的软件 编辑:程序博客网 时间:2024/05/22 16:59

1. 安装macTex 大概2.4G,默认安装就可以。

2.mac上的中文字体笔记少,可以在 应用程序 -》 font book(在lanch pad上面搜索就行)上打开查看。

  我看比较好的支持时 Songti SC

3. 在你的 .emacs 或 .emacs.d/init.el 上添加对xelatex 的支持。xelatex在刚才安装的macTex已经安装了。

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/texlive/2013/bin/x86_64-darwin/"))

  (setq exec-path (append exec-path '("/usr/local/texlive/2013/bin/x86_64-darwin/")))

4. 同样在配置文件上应该配置使用xelate 输出中文pdf

org-mode默认调用的是pdflatex, 因此需要重新设置编译引擎为xelatex

(setq org-latex-pdf-process '("xelatex -interaction nonstopmode %f" 

                                                    "xelatex -interaction nonstopmode %f"))

5.如果输出 中文pdf的话,在org文件的开头添加:

#+LATEX_HEADER: \usepackage{fontspec}

#+LATEX_HEADER: \setmainfont{你要用的中文字体Songti SC}



6 测试代码

#+LATEX_HEADER: \usepackage{fontspec}
#+LATEX_HEADER: \setmainfont{Songti SC}
#+TITLE: 测试中文是否可以正常输出 
#+AUTHOR: chen-wenhuan
#+EMAIL: wenhuan_chen@163.com


* 测试一下中文字体输出
     本单元测试org-mode的中文字体是否可以输出。


参考文章:

http://kuanyui.github.io/2014/05/10/emacs-org-mode-xelatex-output-chinese-pdf/

http://yzprofile.me/2013/01/14/emacs-org-mode-xelatex.html

http://www.tuicool.com/articles/An2yam


0 0
原创粉丝点击