Change compile-command for tex-mode

This commit is contained in:
Alexander Rosenberg 2024-09-10 15:27:10 -07:00
parent f316065c93
commit 745d704eb7
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

11
init.el
View File

@ -819,7 +819,16 @@ COMMAND and COMINT are like `compile'."
;; (La)TeX
(use-package tex-mode
:hook (latex-mode . eglot-ensure)
:hook ((latex-mode . eglot-ensure)
(tex-mode . my/-setup-tex-mode-compile-command))
:init
(defun my/-setup-tex-mode-compile-command ()
"Setup `compile-command' for `tex-mode'."
(let ((quoted-name (shell-quote-argument buffer-file-name)))
(setq-local compile-command
(concat "latexmk -pdf "
"-auxdir=" quoted-name "-build"
" " quoted-name))))
:config
(add-to-list 'auto-mode-alist '("/\\.latexmkrc\\'" . perl-mode)))