diff --git a/emacs/.config/doom/config.org b/emacs/.config/doom/config.org index ef6487e..b909dd8 100644 --- a/emacs/.config/doom/config.org +++ b/emacs/.config/doom/config.org @@ -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: