Starter Kit LaTeX

This is part of the Emacs Starter Kit.

Starter Kit LaTeX

Support for editing LaTeX.

Load Packages

Load AucTeX

(load "auctex.el" nil t t)

Load Preview LaTeX

(load "preview-latex.el" nil t t)

Load RefTeX

(add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode

Configure AucTeX

Use pdfLaTeX

  • Take this out to compile to DVI, instead.
(add-hook 'LaTeX-mode-hook 'TeX-PDF-mode)

Set a Path to Executables (optional)

  • 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")))

Configure RefTeX

Default Bibliography

  • 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")))

Configure Org-babel

  • 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")