This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/contrib/auctex
JP-Ellis cfcce3efa7 A few improvements to AucTeX:
- Move function definitions from inside package.el to funcs.el;
- Add a few variables to allow some configuration with .spacemacs;
- Enable RefTeX support;
- Move key-binding-prefixes to config.el (similar to git layer);
- Use auto-fill-mode, with a environment-aware auto-fill function;
- Provide a few additional sane defaults (some of the more "annoying"
  ones are configurable from .spacemacs)
- Remove `build-view` in favour of just `build` as it seemed to be
  broken and introduce `SPC m v` to view;
- Add support to LatexMk.

!squash Added auctex-reftex-plugin variable.

Signed-off-by: JP-Ellis <coujellis@gmail.com>
2015-06-05 23:31:41 -04:00
..
img Resize latex logo 2015-01-18 00:32:27 -05:00
config.el A few improvements to AucTeX: 2015-06-05 23:31:41 -04:00
extensions.el A few improvements to AucTeX: 2015-06-05 23:31:41 -04:00
funcs.el A few improvements to AucTeX: 2015-06-05 23:31:41 -04:00
packages.el A few improvements to AucTeX: 2015-06-05 23:31:41 -04:00
README.md A few improvements to AucTeX: 2015-06-05 23:31:41 -04:00

Auctex Layer for Spacemacs

logo

Table of Contents

Description

This layer adds support for LaTeX files with AucTeX.

Features:

  • auto-completion with [company-auctex][]
  • tags navigation on % with evil-matchit
  • labels, references, citations and index entries management with RefTeX

Install

Layer

To use this contribution add it to your ~/.spacemacs

(setq-default dotspacemacs-configuration-layers '(auctex))

Auto-completion

Add the layer auto-completion to the variable dotspacemacs-configuration-layers of your dotfile ~/.spacemacs.

Previewing

To perform full-document previews (that is, aside from the inline previewing under SPC m p), add the following to your .spacemacs under dotspacemacs/config:

(add-hook 'doc-view-mode-hook 'auto-revert-mode)

Then when you open up a compiled PDF, the preview will update automatically when you recompile.

Configuration

The AucTeX layer can be customized by setting some variables in your .spacemacs as follows:

dotspacemacs-configuration-layers '(
    ;; ...
    (auctex :variables
            auctex-build-command "LatexMk"
            auctex-electric-escape t))

The variables and associated default values are:

  • auctex-build-command -- "LaTeX": The default command to build when using SPC m b. If "LatexMk" is specified, the appropriate LatexMk configuration will be applied.
  • auctex-auto-fill -- t: Toggles the use of a smart auto-fill.
  • auctex-nofill-env -- '(<see source>): List of environment in which auto-fill-mode is disabled (default includes math environments, tabular and tikzpicture).
  • auctex-electric-sub-and-supercript -- t: Toggle the AucTeX electric _ and ^ in math mode
  • auctex-electric-escape -- nil: Toggle the AucTeX electric \
  • auctex-reftex-plugin -- '(nil nil t t t): Sets the reftex-plug-into-AUCTeX variable; by default it is set to provide existing labels but not create new ones.

Keybindings

Key Binding Description
SPC m b build
SPC m v view
SPC m e insert LaTeX environment
SPC m c close LaTeX environment
SPC m i insert \item
SPC m f insert LaTeX font - full bindings here: AUCTeX documentation
SPC m C TeX command on master file
SPC m p r preview region
SPC m p b preview buffer
SPC m p d preview document
SPC m p e preview environment
SPC m p s preview section
SPC m p p preview at point
SPC m p f cache preamble for preview
SPC m p c clear previews
SPC m * TeX documentation, can be very slow

RefTeX

Key Binding Description
SPC m r c reftex-citation
SPC m r g reftex-grep-document
SPC m r i reftex-index-selection-or-word
SPC m r I reftex-display-index
SPC m r C-i reftex-index
SPC m r l reftex-label
SPC m r p reftex-index-phrase-selection-or-word
SPC m r P reftex-index-visit-phrases-buffer
SPC m r r reftex-reference
SPC m r s reftex-search-document
SPC m r t reftex-toc
SPC m r T reftex-toc-recenter
SPC m r v reftex-view-crossref

Maintainer

This layer was created by and is maintained by @trishume, ping me in the Gitter chat if you have questions. Feel free to submit PRs for this layer though if you have improvements.