2017-10-08 20:36:28 +02:00
|
|
|
;;; TeX
|
|
|
|
|
2018-02-13 13:42:11 +01:00
|
|
|
(dolist (fun '(ambrevar/turn-on-indent-tabs
|
|
|
|
;; ambrevar/turn-on-newline-paragraph
|
2018-01-19 16:56:18 +01:00
|
|
|
prettify-symbols-mode))
|
|
|
|
(add-hook 'tex-mode-hook fun))
|
2013-09-21 13:03:55 +02:00
|
|
|
|
2018-02-15 13:28:49 +01:00
|
|
|
(defun ambrevar/tex-toggle-escape-char ()
|
2014-03-13 15:48:34 +01:00
|
|
|
"Make backslash part of the word syntax or not.
|
|
|
|
This does not interfere with `subword-mode'."
|
|
|
|
(interactive)
|
|
|
|
(if (equal (char-syntax ?\\) ?\\)
|
|
|
|
(progn
|
|
|
|
(modify-syntax-entry ?\\ "w")
|
|
|
|
(message "\\ is a not an escape character"))
|
|
|
|
(modify-syntax-entry ?\\ "\\")
|
|
|
|
(message "\\ is a an escape character")))
|
|
|
|
|
2018-01-19 16:56:18 +01:00
|
|
|
(with-eval-after-load 'tex ; AUCTeX
|
|
|
|
(setq TeX-auto-save t
|
|
|
|
TeX-parse-self t
|
|
|
|
;; Use pdf-tools to open PDF files
|
|
|
|
TeX-view-program-selection '((output-pdf "PDF Tools"))
|
|
|
|
TeX-source-correlate-start-server t
|
|
|
|
;; TeX-fold-auto t
|
|
|
|
TeX-electric-escape t
|
|
|
|
;; TeX-electric-math t
|
|
|
|
TeX-electric-sub-and-superscript t)
|
|
|
|
(setq-default TeX-master nil)
|
|
|
|
|
|
|
|
(when (require 'helm-config nil t)
|
2019-09-01 16:21:13 +02:00
|
|
|
(define-key TeX-mode-map (kbd "M-s f") 'helm-imenu-in-all-buffers))
|
2018-01-19 16:56:18 +01:00
|
|
|
|
|
|
|
;; Update PDF buffers after successful LaTeX runs
|
|
|
|
(add-hook 'TeX-after-compilation-finished-functions
|
|
|
|
#'TeX-revert-document-buffer))
|
2014-02-18 12:13:18 +01:00
|
|
|
|
2017-10-08 20:36:28 +02:00
|
|
|
;;; Not sure how useful that is:
|
2017-05-28 14:15:51 +02:00
|
|
|
;; (set (make-local-variable 'use-hard-newlines) t)
|
|
|
|
|
2017-06-18 18:50:31 +02:00
|
|
|
(provide 'init-tex)
|