Provide a helping hand when working with LaTeX documents.
- Sane defaults
- Fontification of many popular commands
- Pretty indentation of wrapped lines using the
adaptive-wrap
package - Spell checking with
flycheck
- Change PDF viewer to Okular or
latex-preview-pane
- Bibtex editor
- Autocompletion using
company-mode
- Compile your .tex code only once using LatexMk
+latexmk
Use LatexMk instead of LaTeX to compile documents.+cdlatex
Enable cdlatex for fast math insertion.+lsp
Start LSP automatically in `tex-mode-hook`. This requires the:tools lsp
module. Supported servers are `digestif` and `TexLab`.+fold
Use TeX-fold (from auctex) to fold LaTeX macros to unicode, and make folding hook-based and less manual.
- auctex
- adaptive-wrap
- evil-tex (when
:editor evil +everywhere
) - latex-preview-pane
- auctex-latexmk*
- company-auctex*
- company-reftex*
- company-math*
- cdlatex (
+cdlatex
)
You will need ghostscript and a latex compiler. All this is provided by
the texlive
bundle, available through many OS package managers.
Ghostscript <= 9.27 is reported buggy and doesn’t work with auctex’s math
previews. (You can check you ghostscript version with gs --version
.) Most
package managers already have newer versions, but if not you might have to build
gs from source.
apt-get install texlive
pacman -S texlive-core
brew cask install basictex
# If the above doesn't work, then
brew cask install mactex # WARNING: large 4gb download!
This has not been verified.
environment.systemPackages = [ pkgs.texlive.combined.scheme-medium ];
Reftex has a variable that allow you to specify where it should find your bibliography file(s):
(setq reftex-default-bibliography "/your/bib/file.bib")
This module provides integration for four supported pdf viewers. They are
- Skim.app (MacOS only)
- Evince
- Sumatra PDF
- Zathura
- Okular
- pdf-tools (requires
:tools pdf
module)
They are searched for in this order. See +latex-viewers
to change the order,
or remove tools from the search altogether. If you want to exclusively use one
tool, for instance:
(setq +latex-viewers '(zathura))
If none of these tools are found, latex-preview-pane
(uses DocView
in Emacs)
is used as a fallback. You can use this exclusively by setting +latex-viewers
to nil
.
cdlatex has a snippet insertion capability which is disabled in favor of
yasnippet when using :editor snippets
. If you still wanna use it, simply rebind
the TAB
key for cdlatex, which takes care of snippet-related stuff:
(map! :map cdlatex-mode-map
:i "TAB" #'cdlatex-tab)
This would favor yasnippet’s expansion and cursor movement over cdlatex’s expansion and movement, but that shouldn’t matter if you’re not using yasnippet in latex buffers.