Added compile on save to LaTeX mode

This commit is contained in:
paul-loedige
2023-11-06 03:02:04 +01:00
parent b18a6f584c
commit 075f832295
+11 -2
View File
@@ -409,7 +409,16 @@ Enables use of multiple dictionaries. In my case German and English
(setq +latex-viewers '(zathura))
#+end_src
** 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
(add-hook 'tex-mode-hook
(lambda () (add-hook 'after-save-hook 'Tex-command-master)))
(defun custom-tex-compile ()
(interactive)
(TeX-command-run-all nil))
(add-hook 'TeX-mode-hook
(lambda ()
(add-hook 'after-save-hook #'custom-tex-compile nil t)))
#+end_src
#+RESULTS: