diff --git a/init.el b/init.el index be8d93a4f..2e4ff6efe 100644 --- a/init.el +++ b/init.el @@ -82,6 +82,7 @@ module-java ; the poster child for carpal tunnel syndome module-js ; all(hope(abandon(ye(who(enter(here)))))) module-julia ; MATLAB, but fast + module-latex ; for writing papers in Emacs module-lisp ; drowning in parentheses module-lua ; one-based indices? one-based indices. module-org ; for organized fearless leader @@ -101,7 +102,7 @@ extra-demo ; allow me to demonstrate... extra-tags ; if you liked it you should've generated a tag for it extra-tmux ; closing the rift between GUI & terminal - extra-write ; for writing papers and fiction in Emacs + extra-write ; for writing fiction in Emacs ;; Customization my-bindings diff --git a/modules/extra-write.el b/modules/extra-write.el index 482ded837..ce6311e02 100644 --- a/modules/extra-write.el +++ b/modules/extra-write.el @@ -61,40 +61,5 @@ functionality with buffer-local ones, which can be buggy in a minor-mode." (visual-fill-column--adjust-window)))) (apply fn window args)))) -(use-package reftex - :commands turn-on-reftex - :init - (setq reftex-plug-into-AUCTeX t - reftex-ref-style-default-list '("Cleveref" "Hyperref" "Fancyref") - reftex-default-bibliography - `(,(expand-file-name "phys.bib" write-mode-biblio-dir))) - (add-hook! (LaTeX-mode latex-mode) 'turn-on-reftex)) - -(use-package helm-bibtex - :defer t - :init - (setq TeX-auto-save t - TeX-parse-self t - bibtex-dialect 'biblatex - bibtex-align-at-equal-sign t - bibtex-text-indentation 20) - (add-hook! bibtex-mode - (local-set-key (kbd "C-c \\") 'bibtex-fill-entry) - (setq fill-column 140)) - (add-hook! (LaTeX-mode latex-mode) 'turn-on-auto-fill) - - :config - (setq helm-bibtex-bibliography - `(,(expand-file-name "phys.bib" write-mode-biblio-dir)) - - helm-bibtex-library-path - `(,(expand-file-name "phys-pdf" write-mode-biblio-dir)) - - helm-bibtex-notes-path (expand-file-name "notes" write-mode-biblio-dir) - helm-bibtex-notes-extension ".org" - - helm-bibtex-pdf-open-function - (lambda (fpath) (async-start-process "open-pdf" "/usr/bin/open" nil fpath)))) - (provide 'extra-write) ;;; extra-write.el ends here diff --git a/modules/module-latex.el b/modules/module-latex.el new file mode 100644 index 000000000..3eeb09805 --- /dev/null +++ b/modules/module-latex.el @@ -0,0 +1,40 @@ +;;; module-latex.el + +(defvar bibtex-dir "~/Dropbox/docs/biblio") + +(use-package reftex + :commands turn-on-reftex + :init + (setq reftex-plug-into-AUCTeX t + reftex-ref-style-default-list '("Cleveref" "Hyperref" "Fancyref") + reftex-default-bibliography + `(,(expand-file-name "phys.bib" bibtex-dir))) + (add-hook! (LaTeX-mode latex-mode) 'turn-on-reftex)) + +(use-package helm-bibtex + :commands helm-bibtex + :init + (setq TeX-auto-save t + TeX-parse-self t + bibtex-dialect 'biblatex + bibtex-align-at-equal-sign t + bibtex-text-indentation 20) + (add-hook! bibtex-mode + (local-set-key (kbd "C-c \\") 'bibtex-fill-entry) + (setq fill-column 140)) + (add-hook! (LaTeX-mode latex-mode) 'turn-on-auto-fill) + + :config + (setq helm-bibtex-bibliography + (list (f-expand "phys.bib" bibtex-dir)) + + helm-bibtex-library-path + (list (f-expand "phys-pdf" bibtex-dir)) + + helm-bibtex-notes-path (f-expand "notes.org" bibtex-dir) + + helm-bibtex-pdf-open-function + (lambda (fpath) (async-start-process "open-pdf" "/usr/bin/open" nil fpath)))) + +(provide 'module-latex) +;;; module-latex.el ends here