Skip to content

Instantly share code, notes, and snippets.

@rvente
Last active November 12, 2018 01:23
Show Gist options
  • Save rvente/9ae63e213150d60fec464fa0d0b8d63d to your computer and use it in GitHub Desktop.
Save rvente/9ae63e213150d60fec464fa0d0b8d63d to your computer and use it in GitHub Desktop.
This code, when put under dotspacemacs/user-config, enables math preview mode.
;; --------------- begin latex preview configuration ----------------- ;;
;; latex and auxtex layers needed
;; activate using the vim-like binding `[space] , p b`
;; automatically inserts newline at the end of long lines
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-save-query nil)
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(require 'flymake)
(defun flymake-get-tex-args (file-name)
(list "pdflatex"
(list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name)))
(add-hook 'LaTeX-mode-hook 'flymake-mode)
;; enables preview of pictures
(eval-after-load "preview"
'(add-to-list 'preview-default-preamble "\\PreviewEnvironment{tikzpicture}" t)
)
;; --------------- end latex preview configuration ----------------- ;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment