From 745d704eb70fe164a08285f9aaae2ab1b4a2d624 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 10 Sep 2024 15:27:10 -0700 Subject: [PATCH] Change compile-command for tex-mode --- init.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 244d68d..6508c06 100644 --- a/init.el +++ b/init.el @@ -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)))