1. Add ,, and ,k for C-c C-c and C-c C-k. 2. Add useful auctex commands (C-c C-[key] => ,[key]).
5.8 KiB
LaTeX layer
Description
This layer adds support for LaTeX files with AucTeX.
Features
- Auto-build with auctex-latexmk
- 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 '(latex))
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/user-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.
Build command
A build command can be specified via the layer variable latex-build-command
.
If LatexMk
is specified, the appropriate LatexMk
configuration
will be applied. (the default on systems with latexmk
in the path)
This variable can be set to any of the entities in TeX-command-list
,
including any custom entries you may have added there. To use the
regular AucTeX
command set latex-build-command
to LaTeX
as shown
below.
dotspacemacs-configuration-layers '(
(latex :variables latex-build-command "LaTeX"))
Auto-fill
To enable auto-fill set the variable latex-enable-auto-fill
to t
.
The variable latex-nofill-env
provide the list of environment names where
auto-fill-mode
will be inhibited.
dotspacemacs-configuration-layers '(
(latex :variables latex-enable-auto-fill t))
Keybindings
Key Binding | Description |
---|---|
SPC m - |
recenter output buffer |
SPC m , |
TeX command on master file |
SPC m . |
mark LaTeX environment |
SPC m * |
mark LaTeX section |
SPC m b |
build |
SPC m c |
close LaTeX environment |
SPC m e |
insert LaTeX environment |
SPC m f f |
fold TeX buffer |
SPC m f e |
fold TeX environment |
SPC m f m |
fold TeX macro |
SPC m f = |
fold TeX math |
SPC m f r |
fold TeX region |
SPC m i |
insert \item |
SPC m k |
kill TeX job |
SPC m l |
recenter output buffer |
SPC m m |
insert LaTeX macro |
SPC m s |
insert LaTeX section |
SPC m v |
view output |
SPC m h d |
TeX documentation, can be very slow |
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 v |
view |
SPC m x b |
make font bold |
SPC m x B |
make font medium weight |
SPC m x c |
make font monospaced (for code) |
SPC m x e |
make font emphasised |
SPC m x i |
make font italic |
SPC m x o |
make font oblique |
SPC m x r |
remove font properties |
SPC m x f a |
use calligraphic font |
SPC m x f c |
use small-caps font |
SPC m x f f |
use sans serif font |
SPC m x f n |
use normal font |
SPC m x f r |
use serif font |
SPC m x f u |
use upright font |
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 TAB |
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 |