2015-06-10 16:44:30 +00:00
|
|
|
#+TITLE: LaTeX Layer for Spacemacs
|
2015-11-08 18:04:44 +00:00
|
|
|
#+HTML_HEAD_EXTRA: <link rel="stylesheet" type="text/css" href="../../../css/readtheorg.css" />
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
[[file:img/latex.png]]
|
|
|
|
|
2015-10-30 11:20:58 +00:00
|
|
|
* Table of Contents :TOC_4_org:noexport:
|
|
|
|
- [[Description][Description]]
|
|
|
|
- [[Features][Features]]
|
|
|
|
- [[Install][Install]]
|
|
|
|
- [[Layer][Layer]]
|
|
|
|
- [[Auto-completion][Auto-completion]]
|
|
|
|
- [[Previewing][Previewing]]
|
|
|
|
- [[Build command][Build command]]
|
|
|
|
- [[Auto-fill][Auto-fill]]
|
|
|
|
- [[Keybindings][Keybindings]]
|
|
|
|
- [[RefTeX][RefTeX]]
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Description
|
|
|
|
This layer adds support for LaTeX files with [[https://savannah.gnu.org/projects/auctex/][AucTeX]].
|
|
|
|
|
2015-06-10 21:16:01 +00:00
|
|
|
** Features
|
2015-08-11 11:46:59 +00:00
|
|
|
- Auto-build with [[https://github.com/tom-tan/auctex-latexmk/][auctex-latexmk]]
|
2015-07-30 07:44:46 +00:00
|
|
|
- Auto-completion with [[https://github.com/alexeyr/company-auctex][company-auctex]]
|
2015-06-10 21:16:01 +00:00
|
|
|
- Tags navigation on ~%~ with [[https://github.com/redguardtoo/evil-matchit][evil-matchit]]
|
|
|
|
- Labels, references, citations and index entries management with [[http://www.gnu.org/software/emacs/manual/html_node/reftex/index.html][RefTeX]]
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Install
|
|
|
|
** Layer
|
|
|
|
To use this contribution add it to your =~/.spacemacs=
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq-default dotspacemacs-configuration-layers '(latex))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
** 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=
|
2015-09-28 06:05:18 +00:00
|
|
|
under =dotspacemacs/user-config=:
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(add-hook 'doc-view-mode-hook 'auto-revert-mode)
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Then when you open up a compiled PDF, the preview will update automatically
|
|
|
|
when you recompile.
|
|
|
|
|
|
|
|
** Build command
|
2015-08-11 11:46:59 +00:00
|
|
|
A build command can be specified via the layer variable =latex-build-command=.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
2015-08-11 11:46:59 +00:00
|
|
|
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.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
dotspacemacs-configuration-layers '(
|
2015-08-11 11:46:59 +00:00
|
|
|
(latex :variables latex-build-command "LaTeX"))
|
2015-06-10 16:44:30 +00:00
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
** 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
|
2015-10-24 14:20:03 +00:00
|
|
|
=auto-fill-mode= will be inhibited.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
dotspacemacs-configuration-layers '(
|
|
|
|
(latex :variables latex-enable-auto-fill t))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
* Keybindings
|
|
|
|
|
2015-11-25 14:44:43 +00:00
|
|
|
| Key Binding | Description |
|
|
|
|
|---------------+---------------------------------------------------------|
|
|
|
|
| ~SPC m *~ | TeX documentation, can be very slow |
|
|
|
|
| ~SPC m b~ | build |
|
|
|
|
| ~SPC m c~ | close LaTeX environment |
|
|
|
|
| ~SPC m C~ | TeX command on master file |
|
|
|
|
| ~SPC m e~ | insert LaTeX environment |
|
|
|
|
| ~SPC m i~ | insert =\item= |
|
|
|
|
| ~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 |
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
** 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 |
|