Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better LaTeX for My Contrib Module #58

Merged
merged 1 commit into from Oct 31, 2014
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1,20 +1,48 @@
(defvar trishume-packages
'(
auctex
cdlatex
smooth-scrolling
helm-ag
))

(defun trishume/init-auctex ()
(use-package tex
:defer t
:config
(progn
(setq-default TeX-auto-save t)
(setq-default TeX-parse-self t)
(setq-default TeX-master nil)
(setq-default TeX-PDF-mode t))))
(defun load-auctex-on-demand ()
(interactive)
(use-package tex
:config
(progn
(use-package smartparens
:config (require 'smartparens-latex))

(defun build-view ()
(interactive)
(if (buffer-modified-p)
(progn
(let ((TeX-save-query nil))
(TeX-save-document (TeX-master-file)))
(setq build-proc (TeX-command "LaTeX" 'TeX-master-file -1))
(set-process-sentinel build-proc 'build-sentinel))
(TeX-view)))

(defun build-sentinel (process event)
(if (string= event "finished\n")
(TeX-view)
(message "Errors! Check with C-`")))

(add-hook 'LaTeX-mode-hook '(lambda () (local-set-key (kbd "H-r") 'build-view)))
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)

(evil-leader/set-key
"oe" 'LaTeX-environment
"oc" 'LaTeX-close-environment)

(setq-default TeX-auto-save t)
(setq-default TeX-parse-self t)
(setq-default TeX-master nil)
(setq-default TeX-PDF-mode t))))
(evil-leader/set-key
"el" 'load-auctex-on-demand))

(defun trishume/init-smooth-scrolling ()
(use-package smooth-scrolling
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.