2015-06-06 04:46:47 +00:00
|
|
|
;;; packages.el --- Latex Layer packages File for Spacemacs
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2012-2014 Sylvain Benner
|
|
|
|
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
|
|
(setq latex-packages
|
2014-12-01 23:20:24 +00:00
|
|
|
'(
|
|
|
|
auctex
|
2015-05-04 06:29:34 +00:00
|
|
|
auctex-latexmk
|
2015-04-09 04:13:15 +00:00
|
|
|
company
|
2015-04-06 20:49:53 +00:00
|
|
|
company-auctex
|
2015-04-09 04:13:15 +00:00
|
|
|
evil-matchit
|
2015-05-03 23:17:41 +00:00
|
|
|
flycheck
|
2015-06-06 04:31:07 +00:00
|
|
|
flyspell
|
|
|
|
smartparens
|
|
|
|
yasnippet
|
2014-12-01 23:20:24 +00:00
|
|
|
))
|
|
|
|
|
2015-06-06 04:46:47 +00:00
|
|
|
(defun latex/init-auctex ()
|
2015-01-11 20:33:45 +00:00
|
|
|
(use-package tex
|
|
|
|
:defer t
|
2015-06-06 04:31:07 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2015-06-06 04:46:47 +00:00
|
|
|
(setq TeX-command-default latex-build-command
|
2015-06-06 04:31:07 +00:00
|
|
|
TeX-auto-save t
|
|
|
|
TeX-parse-self t
|
|
|
|
TeX-syntactic-comment t
|
|
|
|
TeX-PDF-mode t
|
|
|
|
;; Synctex support
|
|
|
|
TeX-source-correlate-mode t
|
|
|
|
TeX-source-correlate-start-server nil
|
|
|
|
;; Setup reftex style (RefTeX is supported through extension)
|
|
|
|
reftex-use-fonts t
|
|
|
|
;; Don't insert line-break at inline math
|
|
|
|
LaTeX-fill-break-at-separators nil)
|
2015-06-06 04:46:47 +00:00
|
|
|
(when latex-enable-auto-fill
|
2015-06-06 09:04:37 +00:00
|
|
|
(add-hook 'LaTeX-mode-hook 'latex/auto-fill-mode))
|
2015-06-06 04:31:07 +00:00
|
|
|
(add-hook 'LaTeX-mode-hook 'latex-math-mode))
|
2015-01-11 20:33:45 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2015-05-04 06:29:34 +00:00
|
|
|
;; Key bindings for plain TeX
|
|
|
|
(evil-leader/set-key-for-mode 'tex-mode
|
|
|
|
"m\\" 'TeX-insert-macro
|
2015-06-06 09:04:37 +00:00
|
|
|
"mb" 'latex/build
|
2015-06-06 04:31:07 +00:00
|
|
|
"mC" 'TeX-command-master
|
|
|
|
;; Find a way to rebind tex-fonts
|
|
|
|
"mf" 'TeX-font
|
|
|
|
"mv" 'TeX-view)
|
2015-05-04 06:29:34 +00:00
|
|
|
|
|
|
|
;; Key bindings for LaTeX
|
2015-01-11 20:33:45 +00:00
|
|
|
(evil-leader/set-key-for-mode 'latex-mode
|
2015-05-04 06:29:34 +00:00
|
|
|
"m\\" 'TeX-insert-macro
|
2015-06-06 09:04:37 +00:00
|
|
|
"mb" 'latex/build
|
2015-01-11 20:33:45 +00:00
|
|
|
"mc" 'LaTeX-close-environment
|
2015-06-06 04:31:07 +00:00
|
|
|
"mC" 'TeX-command-master
|
|
|
|
"me" 'LaTeX-environment
|
|
|
|
;; Find a way to rebind tex-fonts
|
|
|
|
"mf" 'TeX-font
|
|
|
|
"mhd" 'TeX-doc
|
|
|
|
"mi" 'LaTeX-insert-item
|
|
|
|
;; TeX-doc is a very slow function
|
2015-01-11 20:33:45 +00:00
|
|
|
"mpb" 'preview-buffer
|
2015-06-06 04:31:07 +00:00
|
|
|
"mpc" 'preview-clearout
|
2015-01-11 20:33:45 +00:00
|
|
|
"mpd" 'preview-document
|
|
|
|
"mpe" 'preview-environment
|
|
|
|
"mpf" 'preview-cache-preamble
|
2015-06-06 04:31:07 +00:00
|
|
|
"mpp" 'preview-at-point
|
|
|
|
"mpr" 'preview-region
|
|
|
|
"mps" 'preview-section
|
|
|
|
"mv" 'TeX-view))))
|
2015-05-04 06:29:34 +00:00
|
|
|
|
2015-06-06 04:46:47 +00:00
|
|
|
(when (string= latex-build-command "LatexMk")
|
|
|
|
(defun latex/init-auctex-latexmk ()
|
2015-06-06 04:31:07 +00:00
|
|
|
(use-package auctex-latexmk
|
|
|
|
:defer t
|
|
|
|
:init (add-hook 'LaTeX-mode-hook 'auctex-latexmk-setup))))
|
2015-05-03 23:17:41 +00:00
|
|
|
|
2015-04-07 20:02:53 +00:00
|
|
|
(when (configuration-layer/layer-usedp 'auto-completion)
|
2015-06-06 04:46:47 +00:00
|
|
|
(defun latex/post-init-company ()
|
2015-04-09 04:13:15 +00:00
|
|
|
(spacemacs|add-company-hook LaTeX-mode))
|
|
|
|
|
2015-06-06 04:46:47 +00:00
|
|
|
(defun latex/init-company-auctex ()
|
2015-04-09 04:13:15 +00:00
|
|
|
(use-package company-auctex
|
|
|
|
:if (configuration-layer/package-usedp 'company)
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(push 'company-auctex-labels company-backends-LaTeX-mode)
|
|
|
|
(push 'company-auctex-bibs company-backends-LaTeX-mode)
|
|
|
|
(push '(company-auctex-macros company-auctex-symbols company-auctex-environments)
|
|
|
|
company-backends-LaTeX-mode)))))
|
2015-06-06 04:31:07 +00:00
|
|
|
|
2015-06-06 04:46:47 +00:00
|
|
|
(defun latex/post-init-evil-matchit ()
|
2015-06-06 04:31:07 +00:00
|
|
|
(add-hook 'LaTeX-mode-hook 'evil-matchit-mode))
|
|
|
|
|
2015-06-04 23:59:40 +00:00
|
|
|
(defun latex/post-init-flycheck ()
|
2015-06-06 04:31:07 +00:00
|
|
|
(add-hook 'LaTeX-mode-hook 'flycheck-mode))
|
|
|
|
|
2015-06-06 04:46:47 +00:00
|
|
|
(defun latex/post-init-flyspell ()
|
2015-06-06 04:31:07 +00:00
|
|
|
(add-hook 'LaTeX-mode-hook 'flyspell-mode))
|
|
|
|
|
2015-06-06 04:46:47 +00:00
|
|
|
(defun latex/post-init-smartparens ()
|
2015-06-06 04:31:07 +00:00
|
|
|
(add-hook 'LaTeX-mode-hook 'smartparens-mode))
|
|
|
|
|
2015-06-06 04:46:47 +00:00
|
|
|
(defun latex/post-init-yasnippet ()
|
2015-06-06 04:31:07 +00:00
|
|
|
(add-hook 'LaTeX-mode-hook 'spacemacs/load-yasnippet))
|