Added compile on save to LaTeX mode
This commit is contained in:
@@ -409,7 +409,16 @@ Enables use of multiple dictionaries. In my case German and English
|
|||||||
(setq +latex-viewers '(zathura))
|
(setq +latex-viewers '(zathura))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Add auto-compile hook for TeX mode
|
** Add auto-compile hook for TeX mode
|
||||||
|
Because TeX-command-run-all is an interactive command we need a helper function for the hook.
|
||||||
|
This function could also become useful if we ever want to extend the compile command
|
||||||
#+begin_src emacs-lisp :tangle config.el
|
#+begin_src emacs-lisp :tangle config.el
|
||||||
(add-hook 'tex-mode-hook
|
(defun custom-tex-compile ()
|
||||||
(lambda () (add-hook 'after-save-hook 'Tex-command-master)))
|
(interactive)
|
||||||
|
(TeX-command-run-all nil))
|
||||||
|
|
||||||
|
(add-hook 'TeX-mode-hook
|
||||||
|
(lambda ()
|
||||||
|
(add-hook 'after-save-hook #'custom-tex-compile nil t)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
#+RESULTS:
|
||||||
|
|||||||
Reference in New Issue
Block a user