I installed Emacs with AUCTex using the following code in Ubuntu 13.10:

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

I followed these instructions, but the Code that should be copied to the ~/.emacs file issues an error:

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.

The ~/.emacs file contains:

;;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:
(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"))))

I am an Emacs beginner. I do not speak Lisp (but C ;-) ).how can I get Emacs and AUCTex up and running?

  • 1
    Please provide all the information in your post (linking to a German document is not very informative). Post the content of .emacs. Welcome to TeX.SE! :)
    – nickpapior
    Commented Jan 2, 2014 at 17:00
  • 5
    I believe it is because you have copy pasted directly from the pdf, you have (add-hook ’LaTeX-mode-hook where it should be: (add-hook 'LaTeX-mode-hook. Notice that it is a single quotation mark, I am not too sure what your mark is. Of course this correction should be applied all places.
    – nickpapior
    Commented Jan 2, 2014 at 17:24
  • 1
    On a current Linux distribution it should work out of the box after apt-get install .... Try without any .emacs file.
    – Alex
    Commented Jan 4, 2014 at 23:05
  • 2
    @doed 's bounty seems to suggest that the information here is not from a credible source. As zeroth pointed out, a basic syntax error that was the cause of the problem, which I suppose you could confirm by reference to the manual: gnu.org/software/emacs/manual/html_node/elisp/index.html
    – Tyler
    Commented Jan 6, 2014 at 21:27
  • 1
    Perhaps @zeroth could turn his/her advice into an answer? Perhaps incorporating the fact that the .emacs file could alternatively be dispensed with altogether?
    – cfr
    Commented Jan 7, 2014 at 21:41

1 Answer 1


Your .emacs file contains a syntax error. All the lines evaluating add-hook are not using the ' (decimal value 39) character but some non-ascii character. (I agree with @zeroth's speculation that it is because of copy-and-paste from the PDF instructions).

Replacing all the with ' should correct this problem.

(The reason that this is important is because the Elisp programming language (which is what is used in Emacs for configuration) defines the ' as a function in the programming language. The other character has no function or value associated with it. The function being evaluated is the quote function - quoting is a topic I don't think is actually relevant here - and is not a small topic - If one is interested one can read about in the Elisp manual section on quoting (or in discussions about quoting in other languages in the Lisp family of languages))

  • but what is the non-ascii character? why does the expression interprets it differently? why does ' is the official recommendation? where does the implementation of the ' character originate from? per your answer, are there other values that could be used?
    – doed
    Commented Jan 11, 2014 at 2:20
  • 3
    @doed What do you mean? The answer specifies the non-ascii character which needs replacing. As to why it is interpreted differently, why does TeX interpret a left curly bracket differently from a left square bracket or from the capital A or from the equals sign? Any language must involve interpreting particular characters in particular ways and the parser cannot tell if it 'looks a bit like...' the way a human can. The implementation is going to be in the programming of the parser, just as the interpretation of \ is somewhere in Knuth's code. No idea what you mean about other values.
    – cfr
    Commented Jan 11, 2014 at 3:02
  • 1
    @doed - thanks for the feedback on my answer. I have added a bit of detail about why the character is important - however I didn't go into too much detail because I thought it not entirely relevant to the problem.
    – verdammelt
    Commented Jan 11, 2014 at 13:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .