073fe39b38
This commit makes the latex layer automatically configure pdf-tools as latex pdf-viewer if the pdf layer is installed. Additionally it adds a layer variable to configure pdf-tools to open in a split-window. (Strangely, finding out how to achieve that is far from trivial, and also not easy to google, because many hits do not provide the "correct" answer (see the typical example [here](https://emacs.stackexchange.com/questions/28056/spacemacs-latex-how-to-make-view-command-tile-vertically-with-emacs-window)). Update layers/+lang/latex/funcs.el Co-authored-by: Lucius Hu <1222865+lebensterben@users.noreply.github.com>
88 lines
3.6 KiB
EmacsLisp
88 lines
3.6 KiB
EmacsLisp
;;; config.el --- Latex Layer Configuration File for Spacemacs
|
|
;;
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
|
;;
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
;;
|
|
;; This file is not part of GNU Emacs.
|
|
;;
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
;; it under the terms of the GNU General Public License as published by
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
;; (at your option) any later version.
|
|
;;
|
|
;; This program is distributed in the hope that it will be useful,
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
;; GNU General Public License for more details.
|
|
;;
|
|
;; You should have received a copy of the GNU General Public License
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
;; variables
|
|
|
|
;; Even though AUCTeX uses TeX-latex-mode rather than latex-mode, major-mode
|
|
;; will still be bound to 'latex-mode (since AUCTeX uses an advice to override
|
|
;; latex-mode with TeX-latex-mode), so the keymap's name should use the
|
|
;; lowercase form, since bind-map uses the value of major-mode...
|
|
(spacemacs|define-jump-handlers latex-mode)
|
|
;; ...but AUCTeX runs LaTeX-mode-hook rather than latex-mode-hook, so:
|
|
(add-to-list 'spacemacs-jump-handlers-latex-mode 'LaTeX-mode-hook)
|
|
|
|
(defvar latex-view-with-pdf-tools (configuration-layer/layer-used-p 'pdf)
|
|
"Use pdf-tools for viewing latex output pdf's.
|
|
When the pdf layer is installed, then automatically configure
|
|
Spacemacs to view latex output pdf's with pdf-tools. For using a
|
|
different viewer set this value to `nil' and configure the
|
|
output-pdf viewer in `TeX-view-program-selection'.")
|
|
|
|
(defvar latex-view-pdf-in-split-window nil
|
|
"If non-nil then open pdf in split window.
|
|
Requires pdf-tools to be configured as output-pdf viewer.")
|
|
|
|
(defvar latex-backend (if (configuration-layer/layer-used-p 'lsp) 'lsp 'company-auctex)
|
|
"The backend to use for IDE features.
|
|
Possible values are `lsp' and `company-auctex'.
|
|
If `nil' then 'company-auctex` is the default backend unless `lsp' layer is used")
|
|
|
|
(defvar latex-build-command (if (executable-find "latexmk") "LatexMk" "LaTeX")
|
|
"The default command to use with `SPC m b'")
|
|
|
|
(defvar latex-build-engine (if (and (executable-find "xetex")
|
|
(or (configuration-layer/layer-used-p 'chinese)
|
|
(configuration-layer/layer-used-p 'japanese)))
|
|
'xetex
|
|
'default)
|
|
"The default TeX engine to use with `SPC m b'. It's set to `xetex' when `xetex' is found on PATH
|
|
and either `chinese' layer or `japanese' layer is in use.
|
|
|
|
Allowed values are defined in `TeX-engine-alist'. The default allowed values are:
|
|
* `default'
|
|
* `luatex'
|
|
* `omega'
|
|
* `xetex'")
|
|
|
|
(defvar latex-enable-auto-fill t
|
|
"Whether to use auto-fill-mode or not in tex files.")
|
|
|
|
(defvar latex-enable-folding nil
|
|
"Whether to use `TeX-fold-mode' or not in tex/latex buffers.")
|
|
|
|
(defvar latex-enable-magic nil
|
|
"Whether to enable \"magic\" symbols in the buffer.")
|
|
|
|
(defvar latex-nofill-env '("equation"
|
|
"equation*"
|
|
"align"
|
|
"align*"
|
|
"tabular"
|
|
"tabular*"
|
|
"tabu"
|
|
"tabu*"
|
|
"tikzpicture")
|
|
"List of environment names in which `auto-fill-mode' will be inhibited.")
|
|
|
|
(defvar latex-refresh-preview nil
|
|
"Whether non-nil, refresh the preview buffer when file changes.")
|