doomemacs/modules/lang/latex
Henrik Lissner 037b018cdd
feat: add .doommodule files
These optional dotfiles indicate the root of a module or module
group (:lang), and will later contain module metadata. They will also
serve as an alternative to packages.el and doctor.el, and will aide the
parts of the v3.0 module API concerned with resolving the current module
from a path (`doom-module-from-path`), which currently rely too heavily
on parsing path strings.

For now, however, they're simply placeholders.
2024-09-14 20:47:39 -04:00
..
+fontification.el nit(latex): table d'hôte 2021-11-24 13:08:34 +01:00
+ref.el refactor: deprecate featurep! for modulep! 2022-08-14 20:43:35 +02:00
+viewers.el fix(latex): reorder viewers wrt +latex-viewers 2024-09-05 15:30:22 -04:00
.doommodule feat: add .doommodule files 2024-09-14 20:47:39 -04:00
autoload.el docs(default,mu4e,latex): fix repetition of the in docs 2024-03-12 20:16:29 -04:00
config.el fix(latex): run after-compilation-finished hook after Tex-Tex-sentinel 2024-09-06 04:46:36 -04:00
packages.el bump: :lang 2024-09-07 19:04:37 -04:00
README.org bump!: :lang latex 2024-07-08 13:59:16 -04:00

:lang latex

Description   unfold

Provide a helping hand when working with LaTeX documents.

Module flags

+cdlatex
Enable doom-package:cdlatex for fast math insertion.
+fold
Use TeX-fold (from doom-package:auctex) to fold LaTeX macros to unicode, and make folding hook-based and less manual.
+lsp
Enable LSP support in latex buffers. Requires doom-module::tools lsp and a langserver (supports digestif and TexLab).

TODO Hacks

󱌣 This module's hacks haven't been documented yet. Document them?

TODO Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

This module requires ghostscript and a latex compiler. These are provided by the texlive bundle, available through many OS package managers.

 Ghostscript <= 9.27 is reportedly 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.

Ubuntu

apt-get install texlive

Arch Linux

pacman -S texlive-basic texlive-latexrecommended texlive-plaingeneric

TODO macOS

brew install --cask basictex
# If the above doesn't work, then
brew install --cask mactex  # WARNING: large 4gb download!

󱌣 This has not been verified.

NixOS

environment.systemPackages = [ pkgs.texlive.combined.scheme-medium ];

Formatter

Formatting is handled using the doom-module::editor format module via latexindent.

TODO Usage

󱌣 This module has no usage documentation yet. Write some?

Configuration

Specifying the location of a bibtex file & corresponding PDFs

Reftex has a variable that allow you to specify where it should find your bibliography file(s):

;; in $DOOMDIR/config.el
(setq reftex-default-bibliography "/your/bib/file.bib")

Changing the PDFs viewer

This module provides integration for four supported pdf viewers. They are

  • Skim.app (MacOS only)
  • Evince
  • Sumatra PDF
  • Zathura
  • Okular
  • pdf-tools (requires doom-module::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:

;; in $DOOMDIR/config.el
(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.

Using cdlatex's snippets despite having yasnippet

doom-package:cdlatex has a snippet insertion capability which is disabled in favor of doom-package:yasnippet when using doom-module::editor snippets. If you still wanna use it, simply rebind the TAB key for cdlatex, which takes care of snippet-related stuff:

;; in $DOOMDIR/config.el
(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.

Troubleshooting

There are no known problems with this module. Report one?

Frequently asked questions

This module has no FAQs yet. Ask one?

TODO Appendix

󱌣 This module has no appendix yet. Write one?