2019-01-05 17:45:42 -05:00
|
|
|
#+TITLE: lang/latex
|
|
|
|
#+DATE: January 16, 2017
|
|
|
|
#+SINCE: v1.3
|
|
|
|
#+STARTUP: inlineimages
|
|
|
|
|
|
|
|
* Table of Contents :TOC_3:noexport:
|
2019-09-28 18:28:48 +02:00
|
|
|
- [[#description][Description]]
|
|
|
|
- [[#module-flags][Module Flags]]
|
|
|
|
- [[#plugins][Plugins]]
|
2019-11-21 14:45:18 -05:00
|
|
|
- [[#prerequisites][Prerequisites]]
|
2019-09-28 18:28:48 +02:00
|
|
|
- [[#features][Features]]
|
|
|
|
- [[#customization][Customization]]
|
|
|
|
- [[#specifying-the-location-of-a-bibtex-file--corresponding-pdfs][Specifying the location of a bibtex file & corresponding PDFs]]
|
|
|
|
- [[#changing-the-pdfs-viewer][Changing the PDFs viewer]]
|
2020-02-07 12:36:07 +02:00
|
|
|
- [[#using-cdlatexs-snippets-despite-having-yasnippet][Using cdlatex's snippets despite having yasnippet]]
|
2019-01-05 17:45:42 -05:00
|
|
|
|
|
|
|
* Description
|
2018-01-01 20:48:23 +01:00
|
|
|
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
|
2019-01-05 17:45:42 -05:00
|
|
|
+ Spell checking with ~flycheck~
|
2018-01-01 20:48:23 +01:00
|
|
|
+ Change PDF viewer to Okular or ~latex-preview-pane~
|
|
|
|
+ Bibtex editor
|
|
|
|
+ Autocompletion using ~company-mode~
|
|
|
|
+ Ivy or Helm for selecting bibliography
|
|
|
|
+ Compile your .tex code only once using LatexMk
|
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
** Module Flags
|
2020-02-07 12:36:07 +02:00
|
|
|
+ =+latexmk= Use LatexMk instead of LaTeX to compile documents.
|
|
|
|
+ =+cdlatex= Enable [[https://github.com/cdominik/cdlatex][cdlatex]] for fast math insertion.
|
2018-01-01 20:48:23 +01:00
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
** Plugins
|
|
|
|
+ [[http://www.gnu.org/software/auctex/][auctex]]
|
|
|
|
+ [[http://elpa.gnu.org/packages/adaptive-wrap.html][adaptive-wrap]]
|
|
|
|
+ [[https://github.com/jsinglet/latex-preview-pane][latex-preview-pane]]
|
|
|
|
+ [[https://github.com/tom-tan/auctex-latexmk][auctex-latexmk]]*
|
|
|
|
+ [[https://github.com/alexeyr/company-auctex][company-auctex]]*
|
|
|
|
+ [[https://github.com/TheBB/company-reftex][company-reftex]]*
|
|
|
|
+ [[https://github.com/vspinu/company-math][company-math]]*
|
|
|
|
+ [[https://github.com/tmalsburg/helm-bibtex][ivy-bibtex]]* or [[https://github.com/tmalsburg/helm-bibtex][helm-bibtex]]*
|
2020-02-07 12:36:07 +02:00
|
|
|
+ [[https://github.com/cdominik/cdlatex][cdlatex]] (=+cdlatex=)
|
2018-01-01 20:48:23 +01:00
|
|
|
|
2019-11-21 14:45:18 -05:00
|
|
|
* TODO Prerequisites
|
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
* TODO Features
|
2018-04-11 13:02:58 +02:00
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
* Customization
|
|
|
|
** Specifying the location of a bibtex file & corresponding PDFs
|
|
|
|
The reftex and bibtex-completion packages have two variables that allow you to
|
|
|
|
specify where it should find your bibliography file(s) and their corresponding
|
|
|
|
PDFs:
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq reftex-default-bibliography "/your/bib/file.bib")
|
|
|
|
;; Optionally specifying a location for the corresponding PDFs
|
|
|
|
(setq bibtex-completion-library-path (list "/your/bib/pdfs"))
|
2018-04-11 13:02:58 +02:00
|
|
|
#+END_SRC
|
2018-01-01 20:48:23 +01:00
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
** Changing the PDFs viewer
|
|
|
|
This module provides integration for four supported pdf viewers. They are
|
2018-01-01 20:48:23 +01:00
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
+ [[https://skim-app.sourceforge.io/][Skim.app]] (MacOS only)
|
2019-09-28 18:28:48 +02:00
|
|
|
+ Evince
|
|
|
|
+ Sumatra PDF
|
2019-01-05 17:45:42 -05:00
|
|
|
+ Zathura
|
2019-09-28 18:28:48 +02:00
|
|
|
+ Okular
|
2019-01-05 17:45:42 -05:00
|
|
|
+ pdf-tools (requires =:tools pdf= module)
|
2018-04-11 13:02:58 +02:00
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
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:
|
2018-04-11 13:02:58 +02:00
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq +latex-viewers '(zathura))
|
2018-04-11 13:02:58 +02:00
|
|
|
#+END_SRC
|
|
|
|
|
2019-01-05 17:45:42 -05:00
|
|
|
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~.
|
2020-02-07 12:36:07 +02:00
|
|
|
|
|
|
|
** Using cdlatex's snippets despite having yasnippet
|
|
|
|
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:
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(map! :map cdlatex-mode-map
|
|
|
|
:i "TAB" #'cdlatex-tab)
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
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.
|