Change to AUCTeX

This commit is contained in:
Alexander Rosenberg 2024-10-04 12:49:16 -07:00
parent a5672f9284
commit cf50a7c5b7
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 36 additions and 15 deletions

View File

@ -145,3 +145,18 @@
;; :config ;; :config
;; (company-quickhelp-mode 1) ;; (company-quickhelp-mode 1)
;; (setopt company-quickhelp-delay nil)) ;; (setopt company-quickhelp-delay nil))
;; (La)TeX
;; (use-package tex-mode
;; :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)))

32
init.el
View File

@ -574,9 +574,11 @@ visual states."
:hook (text-mode . my/-cape-setup-text-mode) :hook (text-mode . my/-cape-setup-text-mode)
:init :init
(defun my/-cape-setup-text-mode () (defun my/-cape-setup-text-mode ()
;; Only run this if we are not in `TeX-mode'
(unless (bound-and-true-p TeX-mode-p)
(setq-local completion-at-point-functions (setq-local completion-at-point-functions
'(cape-dict cape-dabbrev) '(cape-dict cape-dabbrev)
corfu-auto nil))) corfu-auto nil))))
;; xref ;; xref
(use-package xref (use-package xref
@ -915,20 +917,24 @@ COMMAND and COMINT are like `compile'."
`(,(concat `(,(concat
(regexp-opt '("gschema" "gresource" "ui")) "\\'") . nxml-mode))) (regexp-opt '("gschema" "gresource" "ui")) "\\'") . nxml-mode)))
;; (La)TeX ;; AUCTeX
(use-package tex-mode (use-package auctex
:hook ((latex-mode . eglot-ensure) :hook ((LaTeX-mode . turn-on-reftex)
(tex-mode . my/-setup-tex-mode-compile-command)) (LaTeX-mode . LaTeX-math-mode))
:init :init
(defun my/-setup-tex-mode-compile-command () (add-to-list 'major-mode-remap-alist '(plain-tex-mode . plain-TeX-mode))
"Setup `compile-command' for `tex-mode'." (add-to-list 'major-mode-remap-alist '(latex-mode . LaTeX-mode))
(let ((quoted-name (shell-quote-argument buffer-file-name))) (add-to-list 'major-mode-remap-alist '(ams-tex-mode . AmSTeX-mode))
(setq-local compile-command (add-to-list 'major-mode-remap-alist '(context-mode . ConTeXt-mode))
(concat "latexmk -pdf " (add-to-list 'major-mode-remap-alist '(texinfo-mode . Texinfo-mode))
"-auxdir=" quoted-name "-build" (add-to-list 'major-mode-remap-alist '(doctex-mode . docTeX-mode))
" " quoted-name)))) (add-to-list 'auto-mode-alist '("/\\.latexmkrc\\'" . perl-mode))
:config :config
(add-to-list 'auto-mode-alist '("/\\.latexmkrc\\'" . perl-mode))) (setq TeX-auto-save t
TeX-parse-self t
reftex-plug-into-AUCTeX t)
(setq-default TeX-master nil)
(TeX-global-PDF-mode 1))
;; blueprint ;; blueprint
(use-package blueprint-ts-mode (use-package blueprint-ts-mode