Auctex学习使用

Table of Contents

  • 1 安装
  • 2 配置
  • 3 配置内容
  • 4 使用总结
  • 5 快捷键总结

1 安装

安装方法在网上有很多的教程,大家参考进行安装就可以了,基本也就是下载来来以后 然后,然后make等就可以了,安装起来十分简单。

2 配置

这里的配置是我非常纠结的一个地方,我要稍微罗嗦一些,你可以把这些配置放在.emacs里 也可以放在.emacs.d/init.el里都是可以的,但是我得出的教训是不要把auctex的配置 内容放到上述配置文件的最后位置,而是要放在前面,我不知道原因,但是我扔到最后的时候 这些配置是不管用的,费了很长的时间,才进行了正确的配置。

3 配置内容

 1:  ;;;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2:  (load "auctex.el" nil t t)
 3:  (load "preview-latex.el" nil t t)
 4:  (if (string-equal system-type "windows-nt")
 5:      (require 'tex-mik))
 6:  (setq TeX-auto-save t)
 7:  (setq TeX-parse-self t)
 8:  (setq-default TeX-master nil)
 9:  
10:  (mapc (lambda (mode)
11:          (add-hook 'LaTeX-mode-hook mode))
12:        (list 'auto-fill-mode
13:              'LaTeX-math-mode
14:              ;; 'linum-mode
15:              'turn-on-reftex))
16:  
17:  ;; /usr/texbin
18:  (when (string-equal system-type "gnu/linux");;选择你的系统
19:    (setenv "PATH" (concat "/usr/texbin:/usr/local/bin:" (getenv "PATH")))
20:    (setq exec-path (append '("/usr/texbin" "/usr/local/bin") exec-path)))
21:  
22:  (add-hook 'LaTeX-mode-hook
23:            (lambda ()
24:              (setq TeX-auto-untabify t       ; remove all tabs before saving
25:                    TeX-engine 'xetex         ; use xelatex default,对中文支持比较好
26:                    TeX-global-PDF-mode t)    ; PDF mode enable, not plain
27:              (add-to-list 'TeX-command-list
28:                           '("XeLaTeX" "%'xelatex --synctex=1%(mode)%' %t"
29:                             TeX-run-TeX nil t))
30:              (setq TeX-command-default "XeLaTeX")
31:              (setq LaTeX-command "latex -synctex=1")
32:              (setq TeX-source-correlate-method 'synctex)
33:              (add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
34:              (add-to-list 'TeX-expand-list '("%u" skim-make-url))
35:              (setq TeX-view-program-list
36:                    '(("Evince" "evince %o");;pdf的默认打开软件
37:                      ("Skim" "/Applications/Skim.app/Contents/SharedSupport/displayline %u")))
38:              (when (string-equal system-type "windows-nt")
39:                (setq TeX-view-program-selection
40:                      '((output-pdf "SumatraPDF"))))
41:              (when (string-equal system-type "darwin")
42:                (setq TeX-view-program-selection
43:                      '((output-pdf "Skim"))))
44:              (setq TeX-clean-confirm nil)
45:              (setq TeX-save-query nil)
46:              (imenu-add-menubar-index)
47:              (auto-composition-mode 1)
48:              (outline-minor-mode 1)
49:              (setq TeX-show-compilation nil)
50:              (define-key LaTeX-mode-map (kbd "TAB") 'TeX-complete-symbol)))
51:  ;; http://www.cs.berkeley.edu/~prmohan/emacs/latex.html
52:  (defun skim-make-url ()
53:    "Skim PDF Viewer"
54:    (concat
55:     (TeX-current-line)
56:     " "
57:     (expand-file-name (funcall file (TeX-output-extension) t)
58:                       (file-name-directory (TeX-master-file)))
59:     " "
60:     (buffer-file-name)))
61:  
62:  (require 'reftex)
63:  (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
64:  (setq reftex-plug-into-AUCTeX t)
65:  (setq reftex-enable-partial-scans t)
66:  (setq reftex-save-parse-info t)
67:  (setq reftex-use-multiple-selection-buffers t)
68:  (autoload 'reftex-mode "reftex"
69:    "RefTeX Minor Mode" t)
70:  (autoload 'turn-on-reftex "reftex"
71:    "RefTeX Minor Mode" nil)
72:  (autoload 'reftex-citation "reftex-cite"
73:    "Make citation" nil)
74:  (autoload 'reftex-index-phrase-mode
75:    "reftex-index" "Phrase mode" t)
76:  ;;;;;;;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

4 使用总结

5 快捷键总结

Author: GRC <grc@grc>

Date: 2013-05-25 14:57:58 CST

HTML generated by org-mode 6.33x in emacs 23

你可能感兴趣的:(Auctex学习使用)