lang/latex: improve auctex+reftex config
This commit is contained in:
parent
49ccdd3349
commit
3c6e1c52af
1 changed files with 38 additions and 22 deletions
|
@ -1,7 +1,5 @@
|
||||||
;;; lang/latex/config.el
|
;;; lang/latex/config.el
|
||||||
|
|
||||||
;; TODO Test me
|
|
||||||
|
|
||||||
(defvar +latex-bibtex-dir "~/work/writing/biblio/"
|
(defvar +latex-bibtex-dir "~/work/writing/biblio/"
|
||||||
"Where bibtex files are kept.")
|
"Where bibtex files are kept.")
|
||||||
|
|
||||||
|
@ -13,21 +11,51 @@
|
||||||
;; Plugins
|
;; Plugins
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(def-package! auctex
|
;; Because tex-mode is built-in and AucTex has conflicting components, we need
|
||||||
:mode ("\\.tex$" . LaTeX-mode)
|
;; to ensure that auctex gets loaded instead of tex-mode.
|
||||||
:init
|
(load "auctex")
|
||||||
(add-hook 'LaTeX-mode-hook 'turn-on-auto-fill)
|
(load "auctex-autoloads")
|
||||||
:config
|
(push '("\\.[tT]e[xX]\\'" . TeX-latex-mode) auto-mode-alist)
|
||||||
|
|
||||||
|
(after! tex-site
|
||||||
(setq TeX-auto-save t
|
(setq TeX-auto-save t
|
||||||
TeX-parse-self t
|
TeX-parse-self t
|
||||||
|
TeX-save-query nil
|
||||||
TeX-source-correlate-start-server nil
|
TeX-source-correlate-start-server nil
|
||||||
LaTeX-fill-break-at-separators nil)
|
LaTeX-fill-break-at-separators nil
|
||||||
|
LaTeX-section-hook
|
||||||
|
'(LaTeX-section-heading
|
||||||
|
LaTeX-section-title
|
||||||
|
LaTeX-section-toc
|
||||||
|
LaTeX-section-section
|
||||||
|
LaTeX-section-label))
|
||||||
|
|
||||||
|
(add-hook! (latex-mode LaTeX-mode) 'turn-on-auto-fill)
|
||||||
(add-hook! LaTeX-mode '(LaTeX-math-mode TeX-source-correlate-mode))
|
(add-hook! LaTeX-mode '(LaTeX-math-mode TeX-source-correlate-mode))
|
||||||
|
|
||||||
(set! :company-backend 'LaTeX-mode '(company-auctex)))
|
(set! :popup " output\\*$" :regexp t :size 15 :noselect t :autoclose t :autokill t)
|
||||||
|
|
||||||
(def-package! company-auctex)
|
(map! :map LaTeX-mode-map "C-j" nil
|
||||||
|
:leader
|
||||||
|
:n ";" 'reftex-toc)
|
||||||
|
|
||||||
|
(def-package! company-auctex
|
||||||
|
:init
|
||||||
|
(set! :company-backend 'LaTeX-mode '(company-auctex))))
|
||||||
|
|
||||||
|
|
||||||
|
(def-package! reftex ; built-in
|
||||||
|
:commands (turn-on-reftex reftex-mode)
|
||||||
|
:init
|
||||||
|
(setq reftex-plug-into-AUCTeX t
|
||||||
|
reftex-default-bibliography (list +latex-bibtex-default-file)
|
||||||
|
reftex-toc-split-windows-fraction 0.2)
|
||||||
|
|
||||||
|
(add-hook 'reftex-toc-mode-hook 'doom-hide-modeline-mode)
|
||||||
|
(add-hook! (latex-mode LaTeX-mode) 'turn-on-reftex)
|
||||||
|
:config
|
||||||
|
(map! :map reftex-mode-map
|
||||||
|
:leader :n ";" 'reftex-toc))
|
||||||
|
|
||||||
|
|
||||||
(def-package! bibtex ; built-in
|
(def-package! bibtex ; built-in
|
||||||
|
@ -40,18 +68,6 @@
|
||||||
(map! :map bibtex-mode-map "C-c \\" 'bibtex-fill-entry))
|
(map! :map bibtex-mode-map "C-c \\" 'bibtex-fill-entry))
|
||||||
|
|
||||||
|
|
||||||
(def-package! reftex ; built-in
|
|
||||||
:commands turn-on-reftex
|
|
||||||
:init
|
|
||||||
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
|
|
||||||
:config
|
|
||||||
(setq reftex-plug-into-AUCTeX t
|
|
||||||
reftex-default-bibliography (list +latex-bibtex-default-file))
|
|
||||||
|
|
||||||
(map! :map reftex-mode-map
|
|
||||||
:leader :n ";" 'reftex-toc))
|
|
||||||
|
|
||||||
|
|
||||||
(def-package! ivy-bibtex
|
(def-package! ivy-bibtex
|
||||||
:commands ivy-bibtex)
|
:commands ivy-bibtex)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue