This is part of the Emacs Starter Kit.
Support for editing LaTeX.
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
- Take this out to compile to DVI, instead.
(add-hook 'LaTeX-mode-hook 'TeX-PDF-mode)
- The location of the LaTeX excecutables is system dependent. AUCTeX calls everything through a shell, so you may or may not need this. This source-code block is turned off by default as it should be added to the user’s personal configuration as needed.
(setenv "PATH" (concat "/usr/texbin:" (getenv "PATH")))
- This is important when editing source code in Org-babel, since the LaTeX source code block being edited probably doesn’t include the \bibliography{} command that RefTeX uses to find bibliographic database(s). Make certain also that RefTeX has a path to the bibliographic databases. This source-code block is turned off be default as it should be configured by the user in a personal file/directory.
(setq reftex-default-bibliography
(quote
("user.bib" "local.bib")))
- Add LaTeX to the list of languages Org-babel will recognize.
;; (org-babel-add-interpreter "latex")
;; (add-to-list 'org-babel-tangle-langs '("latex" "tex"))
;; ; (require 'org-babel-latex)
- Add LaTeX to a list of languages that raise noweb-type errors.
(add-to-list 'org-babel-noweb-error-langs "latex")