doomemacs/modules/lang/latex/config.el

77 lines
2.0 KiB
EmacsLisp
Raw Normal View History

2017-02-20 07:57:16 +08:00
;;; lang/latex/config.el
2016-05-09 06:27:28 +08:00
2017-02-20 07:57:16 +08:00
(defvar +latex-bibtex-dir "~/work/writing/biblio/"
"Where bibtex files are kept.")
(defvar +latex-bibtex-default-file "default.bib"
"TODO")
2016-05-09 06:27:28 +08:00
2017-02-20 07:57:16 +08:00
;;
;; Plugins
;;
;; Because tex-mode is built-in and AucTex has conflicting components, we need
;; to ensure that auctex gets loaded instead of tex-mode.
(load "auctex")
(load "auctex-autoloads")
(push '("\\.[tT]e[xX]\\'" . TeX-latex-mode) auto-mode-alist)
(after! tex-site
2016-05-09 06:27:28 +08:00
(setq TeX-auto-save t
TeX-parse-self t
TeX-save-query nil
2017-02-20 07:57:16 +08:00
TeX-source-correlate-start-server 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))
2017-02-20 07:57:16 +08:00
(set! :popup " output\\*$" :regexp t :size 15 :noselect t :autoclose t :autokill t)
(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)
2017-02-20 07:57:16 +08:00
(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))
2017-02-20 07:57:16 +08:00
(def-package! bibtex ; built-in
2017-02-20 07:57:16 +08:00
:config
(setq bibtex-dialect 'biblatex
2016-05-09 06:27:28 +08:00
bibtex-align-at-equal-sign t
2017-02-20 07:57:16 +08:00
bibtex-text-indentation 20
bibtex-completion-bibliography (list +latex-bibtex-default-file))
(map! :map bibtex-mode-map "C-c \\" 'bibtex-fill-entry))
2017-02-20 07:57:16 +08:00
2016-05-09 06:27:28 +08:00
(def-package! ivy-bibtex
2017-02-20 07:57:16 +08:00
:commands ivy-bibtex)
2016-05-09 06:27:28 +08:00
(def-package! helm-bibtex
2017-02-20 07:57:16 +08:00
:commands helm-bibtex)
2016-05-09 06:27:28 +08:00