Fix tex configurations on Linux platform

This commit is contained in:
lemyx 2024-12-30 17:03:52 +08:00
parent 4478508e94
commit 9bad010a28

View File

@ -3,38 +3,26 @@
;;; Code:
;; cdlatex
(use-package cdlatex
:after tex)
;; Ensure auctex is installed
(require 'tex)
(require 'auctex)
;; TeX Core
(use-package tex
:ensure auctex
:demand t
:custom
; 自动解析新文件 (usepackage, bibliograph, newtheorem) 等信息
(TeX-parse-selt t)
(TeX-PDF-mode t)
; 正反向搜索
(TeX-source-correlate-mode t)
(TeX-source-correlate-method 'synctex)
; 使用 pdf-tools 预览
(TeX-view-program-selection '((output-pdf "PDF Tools")))
(use-package cdlatex
:ensure t
:config
(add-to-list 'auto-mode-alist '("\\.tex$" . LaTeX-mode))
(setq TeX-auto-save t)
(setq TeX-save-query nil)
(setq TeX-show-compilation t)
; 编译时问询主文件名称
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook (lambda ()
(cdlatex-mode)
(reftex-mode)
(prettify-symbols-mode t)
;; (outline-minor-mode)
;; (outline-hide-body)
(add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex --synctex=1%(mode)%' %t" TeX-run-TeX nil t))
)))
(add-hook 'LaTeX-mode-hook 'turn-on-cdlatex))
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq-default TeX-master nil)
(setq TeX-global-PDF-mode t TeX-engine 'xetex)
(add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex --synctex=1%(mode)%' %t" TeX-run-TeX nil t))
(setq TeX-command-default "XeLaTeX")
(setq TeX-parse-self t)
(setq TeX-PDF-mode t)
(setq TeX-source-correlate-mode t)
(setq TeX-source-correlate-method 'synctex)
(setq TeX-view-program-selection '((output-pdf "PDF Tools")))
(provide 'init-tex)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;