Skip to content

Instantly share code, notes, and snippets.

@jozefg
Created July 22, 2020 16:20
Show Gist options
  • Save jozefg/51a1e0fa04ff2b7d03a7e20e325951dd to your computer and use it in GitHub Desktop.
Save jozefg/51a1e0fa04ff2b7d03a7e20e325951dd to your computer and use it in GitHub Desktop.
;; auctex is under the name auctex on elpa but provides
;; the symbol tex. No clue why..
(require-package 'auctex 'tex)
(require-package 'reftex)
(require-package 'auctex-latexmk)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-engine 'default)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'auto-fill-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-PDF-mode t)
(setq reftex-plug-into-AUCTeX t)
(define-key reftex-mode-map (kbd "C-c g g") 'reftex-goto-label)
(auctex-latexmk-setup)
;; Previews are nice
(require-package 'latex-preview-pane)
;(add-hook 'LaTeX-mode-hook 'latex-preview-pane-mode)
(setq auctex-latexmk-inherit-TeX-PDF-mode t)
;; Pass shell-escape everywhere
;(custom-set-variables
; '(pdf-latex-command "~/.emacs.d/bin/latex"))
(provide 'init-latex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment