simplify reftex declaration
This commit is contained in:
parent
e7465018fc
commit
6e67e5b3e4
1 changed files with 7 additions and 9 deletions
|
@ -1,13 +1,8 @@
|
||||||
;;; lang/latex/+ref.el -*- lexical-binding: t; -*-
|
;;; lang/latex/+ref.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defvar +latex-bibtex-file ""
|
|
||||||
"File AUCTeX (specifically RefTeX) uses to search for citations.")
|
|
||||||
|
|
||||||
(def-package! reftex
|
(def-package! reftex
|
||||||
:hook ((latex-mode LaTeX-mode) . turn-on-reftex)
|
:defer t
|
||||||
:init
|
:hook (LaTeX-mode . reftex-mode)
|
||||||
(setq reftex-plug-into-AUCTeX t
|
|
||||||
reftex-toc-split-windows-fraction 0.3)
|
|
||||||
:config
|
:config
|
||||||
;; Get ReTeX working with biblatex
|
;; Get ReTeX working with biblatex
|
||||||
;; http://tex.stackexchange.com/questions/31966/setting-up-reftex-with-biblatex-citation-commands/31992#31992
|
;; http://tex.stackexchange.com/questions/31966/setting-up-reftex-with-biblatex-citation-commands/31992#31992
|
||||||
|
@ -18,7 +13,9 @@
|
||||||
(?s . "\\smartcite[]{%l}")
|
(?s . "\\smartcite[]{%l}")
|
||||||
(?f . "\\footcite[]{%l}")
|
(?f . "\\footcite[]{%l}")
|
||||||
(?n . "\\nocite{%l}")
|
(?n . "\\nocite{%l}")
|
||||||
(?b . "\\blockcquote[]{%l}{}")))
|
(?b . "\\blockcquote[]{%l}{}"))
|
||||||
|
reftex-plug-into-AUCTeX t
|
||||||
|
reftex-toc-split-windows-fraction 0.3)
|
||||||
(unless (string-empty-p +latex-bibtex-file)
|
(unless (string-empty-p +latex-bibtex-file)
|
||||||
(setq reftex-default-bibliography (list (expand-file-name +latex-bibtex-file))))
|
(setq reftex-default-bibliography (list (expand-file-name +latex-bibtex-file))))
|
||||||
(map! :map reftex-mode-map
|
(map! :map reftex-mode-map
|
||||||
|
@ -31,14 +28,15 @@
|
||||||
:e "q" #'kill-buffer-and-window
|
:e "q" #'kill-buffer-and-window
|
||||||
:e "ESC" #'kill-buffer-and-window)))
|
:e "ESC" #'kill-buffer-and-window)))
|
||||||
|
|
||||||
|
;; set up completion for citations and references
|
||||||
(def-package! company-reftex
|
(def-package! company-reftex
|
||||||
:when (featurep! :completion company)
|
:when (featurep! :completion company)
|
||||||
:after reftex
|
:after reftex
|
||||||
:config
|
:config
|
||||||
(set-company-backend! 'reftex-mode 'company-reftex-labels 'company-reftex-citations))
|
(set-company-backend! 'reftex-mode 'company-reftex-labels 'company-reftex-citations))
|
||||||
|
|
||||||
|
;; set up mode for bib files
|
||||||
(def-package! bibtex
|
(def-package! bibtex
|
||||||
:defer t
|
|
||||||
:config
|
:config
|
||||||
(setq bibtex-dialect 'biblatex
|
(setq bibtex-dialect 'biblatex
|
||||||
bibtex-align-at-equal-sign t
|
bibtex-align-at-equal-sign t
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue