Latex module revamped
Latex language module with previews, latexmk, reftex, bibtex and others. Completion with company mode. Selection of bibliography using Ivy or Helm. Later preview panel or okular as viewers. LatexMk for compiling code. Prettified indentation with adaptive-wrap along with good indentation of environments. Additional fontification of common commands.
This commit is contained in:
parent
35594f0729
commit
e91cb11243
5 changed files with 372 additions and 47 deletions
43
modules/lang/latex/autoload.el
Normal file
43
modules/lang/latex/autoload.el
Normal file
|
@ -0,0 +1,43 @@
|
|||
;;; lang/latex/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +latex/LaTeX-indent-item ()
|
||||
"Provide proper indentation for LaTeX \"itemize\",\"enumerate\", and \"description\" environments.
|
||||
|
||||
\"\\item\" is indented `LaTeX-indent-level' spaces relative to
|
||||
the the beginning of the environment.
|
||||
|
||||
Continuation lines are indented either twice
|
||||
`LaTeX-indent-level', or `LaTeX-indent-level-item-continuation'
|
||||
if the latter is bound."
|
||||
(save-match-data
|
||||
(let* ((offset LaTeX-indent-level)
|
||||
(contin (or (and (boundp '+latex-indent-level-item-continuation)
|
||||
+latex-indent-level-item-continuation)
|
||||
(* 4 LaTeX-indent-level)))
|
||||
(re-beg "\\\\begin{")
|
||||
(re-end "\\\\end{")
|
||||
(re-env "\\(itemize\\|\\enumerate\\|description\\)")
|
||||
(indent (save-excursion
|
||||
(when (looking-at (concat re-beg re-env "}"))
|
||||
(end-of-line))
|
||||
(LaTeX-find-matching-begin)
|
||||
(current-column))))
|
||||
(cond ((looking-at (concat re-beg re-env "}"))
|
||||
(or (save-excursion
|
||||
(beginning-of-line)
|
||||
(ignore-errors
|
||||
(LaTeX-find-matching-begin)
|
||||
(+ (current-column)
|
||||
(if (looking-at (concat re-beg re-env "}"))
|
||||
contin
|
||||
offset))))
|
||||
indent))
|
||||
((looking-at (concat re-end re-env "}"))
|
||||
indent)
|
||||
((looking-at "\\\\item")
|
||||
(+ offset indent))
|
||||
(t
|
||||
(+ contin indent))))))
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue