Table of Contents
1 默认安装texlive套件
我默认你已经安装texlive套件,安装方法可以参考我的另一篇文章。
2 下载AUCTex和CDLatex安装包
到该网站下载:
http://www.gnu.org/software/auctex/
3 解压
tar zxf auctex-11.86.tar.gz cd auctex-11.86
4 安装
./configure --with-emcs ;; 加上这个选项的目的就是让emacs识别 make sudo make install
5 配置.emacs文件
5.1 Emacs加载AUCtex
(load "auctex.el" nil t t) (load "preview-latex.el" nil t t) (setq Tex-auto-save t) (setq Tex-parse-self t) (setq-default Tex-master nil)
5.2 设置xelatex为默认编辑命令,evience为默认阅读器
(setq Tex-output-view-style
(quote (("^pdf$" "." "evince &o %(outpage)"))))
(add-hook 'LaTex-mode-hook
(lambda()
(add-to-list 'Tex-command-list '("XeLaTex" "%`xelatex%(mode)'
%t" Tex-run-Tex nil t))
(setq Tex-command-default "XeLaTex")
))
5.3 设置org导出tex模板,使其支持中文
(require 'org-latex)
(unless (boundp 'org-export-latex-classes)
(setq org-export-latex-classes nil))
;; 输出latex模板
(add-to-list 'org-export-latex-classes
'("article"
"\\documentclass{article}
\\usepackage{ctex}"
("\\section{%s}" . "\\section*{%s}")
;;("\\subsection{%s}" . "\\subsection{%s}")
;;("\\subsubsection{%s}" . "\\subsubsection{%s}")
("\\paragraph{%s}" . "\\paragraph{%s}")
("\\subparagraph{%s}" . "\\subparagraph{%s}")
))
6 添加CDLatex辅模式
6.1 下载cdlatex.el
这个直接在网上搜索就行了,我就不说了。
6.2 复制到.emacs.d/下
cp cdlatex.el ~/.emacs.d/
6.3 在.emacs中添加如下配置
(require 'cdlatex) ;; 将cdlatex设置为AUCtex的辅模式 (add-hook 'LaTex-mode-hook 'turn-on-cdlatex)
3143

被折叠的 条评论
为什么被折叠?



