AUCTex 安裝

AUCTex 安裝

我在 Ubuntu 13.10 中使用以下程式碼安裝了帶有 AUCTex 的 Emacs:

 sudo apt-get install texlive-base emacs23 auctex preview-latex

我跟著這些指令,但應複製到檔案的程式碼~/.emacs會發出錯誤:

Warning (initialization): An error occurred while loading `/home/dbelal/.emacs':

Symbol's value as variable is void: ’LaTeX-mode-hook

To ensure normal operation, you should investigate and remove the cause of the error in 
your initialization file.  Start Emacs with the `--debug-init' option to view a
complete error backtrace.

~/.emacs文件包含:

;;For Auctex < 11.82 exchange ";;" in the following 2 lines
;;(require ’tex-site)
(load "auctex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-PDF-mode t) ;; .pdf instead of .dvi per default:
2;;Zeilenumbruch
(add-hook ’LaTeX-mode-hook ’turn-on-auto-fill)
;;Syntax Higlighting
(add-hook ’LaTeX-mode-hook ’turn-on-font-lock)
;; Math Mode
(add-hook ’LaTeX-mode-hook ’LaTeX-math-mode)
;; loading Reftex 
(setq reftex-plug-into-AUCTeX t)
(add-hook ’LaTeX-mode-hook ’turn-on-reftex)
;; Satzende ". " statt ". ". " f¨ur M-k: l¨oschen bis Satzende usw.
(setq sentence-end "[.?!][]\"’)}]*\\($\\| \\| \\)[
;;]*") ;; Da ist ein "Newline in der Zeile!"
(setq sentence-end-double-space nil)
;;german spell correction
;;(add-hook ’LaTeX-mode-hook ’flyspell-mode)
;; Use only with Auctex > 11.81 with preview-latex:
(load "preview-latex.el" nil t t)
;; aspell is better than ispell.
;; Comment line if not installed
(setq-default ispell-program-name "aspell")
;; German Spell Correction falls \usepackage{ngerman}
;; oder german benutzt wird
(add-hook ’TeX-language-de-hook
(function (lambda () (ispell-change-dictionary "german8"))))

我是 Emacs 初學者。我不會說 Lisp(但會說 C ;-) )。

答案1

您的.emacs文件包含語法錯誤。所有評估的行add-hook都不使用'(十進位值 39)字符,而是使用一些非 ASCII 字符。 (我同意@zeroth的猜測,這是因為PDF說明中的複製貼上)。

將所有替換'應該可以解決此問題。

(這很重要的原因是因為 Elisp 程式語言(Emacs 中用於配置的語言)將 定義'為程式語言中的函數。另一個字元沒有與之關聯的函數或值。正在評估的函數是quote函數- 引用是一個主題,我認為這裡實際上並不相關- 並且不是一個小主題- 如果有人有興趣,可以閱讀Elisp 手冊中有關引用的部分(或在有關 Lisp 語言家族中其他語言的引用的討論中))

相關內容