2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/latex/config.el -*- lexical-binding: t; -*-
|
2016-05-08 18:27:28 -04:00
|
|
|
|
2017-02-19 18:57:16 -05:00
|
|
|
(defvar +latex-bibtex-dir "~/work/writing/biblio/"
|
|
|
|
"Where bibtex files are kept.")
|
|
|
|
|
|
|
|
(defvar +latex-bibtex-default-file "default.bib"
|
|
|
|
"TODO")
|
2016-05-08 18:27:28 -04:00
|
|
|
|
|
|
|
|
2017-02-19 18:57:16 -05:00
|
|
|
;;
|
|
|
|
;; Plugins
|
|
|
|
;;
|
|
|
|
|
2017-03-08 21:30:16 -05:00
|
|
|
;; Because tex-mode is built-in and AucTex has conflicting components, we need
|
|
|
|
;; to ensure that auctex gets loaded instead of tex-mode.
|
2017-03-08 21:36:57 -05:00
|
|
|
(load "auctex" nil t)
|
|
|
|
(load "auctex-autoloads" nil t)
|
2017-03-08 21:30:16 -05:00
|
|
|
(push '("\\.[tT]e[xX]\\'" . TeX-latex-mode) auto-mode-alist)
|
|
|
|
|
2017-03-09 00:27:50 -05:00
|
|
|
(add-transient-hook! 'LaTeX-mode-hook
|
2016-05-08 18:27:28 -04:00
|
|
|
(setq TeX-auto-save t
|
|
|
|
TeX-parse-self t
|
2017-03-08 21:30:16 -05:00
|
|
|
TeX-save-query nil
|
2017-02-19 18:57:16 -05:00
|
|
|
TeX-source-correlate-start-server nil
|
2017-03-08 21:30:16 -05:00
|
|
|
LaTeX-fill-break-at-separators nil
|
|
|
|
LaTeX-section-hook
|
|
|
|
'(LaTeX-section-heading
|
|
|
|
LaTeX-section-title
|
|
|
|
LaTeX-section-toc
|
|
|
|
LaTeX-section-section
|
|
|
|
LaTeX-section-label))
|
|
|
|
|
2017-04-17 02:17:10 -04:00
|
|
|
(add-hook! (latex-mode LaTeX-mode) #'turn-on-auto-fill)
|
|
|
|
(add-hook! 'LaTeX-mode-hook #'(LaTeX-math-mode TeX-source-correlate-mode))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2017-03-08 21:30:16 -05:00
|
|
|
(set! :popup " output\\*$" :regexp t :size 15 :noselect t :autoclose t :autokill t)
|
|
|
|
|
2017-03-09 00:27:50 -05:00
|
|
|
(map! :map LaTeX-mode-map "C-j" nil)
|
2017-03-08 21:30:16 -05:00
|
|
|
|
|
|
|
(def-package! company-auctex
|
2017-03-19 22:47:50 -04:00
|
|
|
:when (featurep! :completion company)
|
2017-03-08 21:30:16 -05:00
|
|
|
: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-19 18:57:16 -05:00
|
|
|
|
2017-04-17 02:17:10 -04:00
|
|
|
(add-hook! (latex-mode LaTeX-mode) #'turn-on-reftex)
|
2017-03-09 00:27:50 -05:00
|
|
|
|
2017-03-08 21:30:16 -05:00
|
|
|
:config
|
|
|
|
(map! :map reftex-mode-map
|
2017-06-19 00:30:41 +02:00
|
|
|
:localleader :n ";" 'reftex-toc)
|
2017-03-09 00:27:50 -05:00
|
|
|
|
|
|
|
(add-hook! 'reftex-toc-mode-hook
|
|
|
|
(reftex-toc-rescan)
|
|
|
|
(doom-hide-modeline-mode +1)
|
2017-04-17 02:17:10 -04:00
|
|
|
(map! :Le "j" #'next-line
|
|
|
|
:Le "k" #'previous-line
|
|
|
|
:Le "q" #'kill-buffer-and-window
|
|
|
|
:Le "ESC" #'kill-buffer-and-window)))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! bibtex ; built-in
|
2017-02-19 18:57:16 -05:00
|
|
|
:config
|
|
|
|
(setq bibtex-dialect 'biblatex
|
2016-05-08 18:27:28 -04:00
|
|
|
bibtex-align-at-equal-sign t
|
2017-02-19 18:57:16 -05:00
|
|
|
bibtex-text-indentation 20
|
|
|
|
bibtex-completion-bibliography (list +latex-bibtex-default-file))
|
|
|
|
|
2017-04-17 02:17:10 -04:00
|
|
|
(map! :map bibtex-mode-map "C-c \\" #'bibtex-fill-entry))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2017-06-11 00:59:02 +02:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! ivy-bibtex
|
2017-03-19 22:47:50 -04:00
|
|
|
:when (featurep! :completion ivy)
|
2017-02-19 18:57:16 -05:00
|
|
|
:commands ivy-bibtex)
|
2016-05-08 18:27:28 -04:00
|
|
|
|
2017-06-11 00:59:02 +02:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! helm-bibtex
|
2017-03-19 22:47:50 -04:00
|
|
|
:when (featurep! :completion helm)
|
2017-02-19 18:57:16 -05:00
|
|
|
:commands helm-bibtex)
|
2016-05-08 18:27:28 -04:00
|
|
|
|