Only install auctex if xelatex is found.

This commit is contained in:
tastytea 2019-04-03 14:21:56 +02:00
parent ca12f55334
commit 29b6f5502f
1 changed files with 19 additions and 19 deletions

38
init.el
View File

@ -1,5 +1,5 @@
;;; init.el --- tastytea's Emacs init file.
;;; Time-stamp: <2019-04-02 15:16:18 CEST>
;;; Time-stamp: <2019-04-03 14:21:51 CEST>
;;; Commentary:
;;; I am using this file with Emacs 26, but most of it will probably work with
@ -676,24 +676,24 @@
(find-file . auto-insert))
;;;;;;;;;;;;;;;;;;;; LaTeX ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package tex-site
:if (executable-find "xelatex")
:ensure auctex
:custom
(TeX-parse-self t) ; Enable parse on load.
(TeX-auto-save t) ; Enable parse on save
(TeX-PDF-mode t) ; PDF mode (rather than DVI-mode)
(TeX-engine 'xelatex)
;; To use pdf-tools with auctex.
;; https://emacs.stackexchange.com/a/21764/21935
(TeX-view-program-selection '((output-pdf "PDF Tools")))
(TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)))
:mode
("\\.tex\\'" . LaTeX-mode)
:config
;; To have the buffer refresh after compilation.
(add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer))
(if (executable-find "xelatex")
(use-package tex-site
:ensure auctex
:custom
(TeX-parse-self t) ; Enable parse on load.
(TeX-auto-save t) ; Enable parse on save
(TeX-PDF-mode t) ; PDF mode (rather than DVI-mode)
(TeX-engine 'xelatex)
;; To use pdf-tools with auctex.
;; https://emacs.stackexchange.com/a/21764/21935
(TeX-view-program-selection '((output-pdf "PDF Tools")))
(TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view)))
:mode
("\\.tex\\'" . LaTeX-mode)
:config
;; To have the buffer refresh after compilation.
(add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer)))
;; Auto complete for LaTeX.
(use-package company-auctex