Auctex學習使用

gaorongchao1990626發表於2013-05-25

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

相關文章