Try adding a '
to the immediate left of LaTeX-mode-hook
. Also, you need to (require 'tex)
before using the LaTeX-mode-hook
.
Because the library AUCTeX defines the variable LaTeX-mode-hook
(i.e., brings it into existence), placing (require 'tex)
inside a hook that does not yet exist will not work. [See line 5017 of ~/.emacs.d/elpa/auctex-11.87.3/latex.el
)
(require 'tex)
(add-hook 'LaTeX-mode-hook (lambda ()
(TeX-global-PDF-mode t)
))
Normally, I see this used: (setq TeX-PDF-mode t)
. However, the original poster is correct regarding the existence of a function named TeX-global-PDF-mode
-- see line 1729 of ~/.emacs.d/elpa/auctex-11.87.3/tex.el
.
(source: lawlist.com)