[LaTeX] Improve align handling

master
Jacopo De Simoi 7 years ago
parent e24e8ca43d
commit 3fa9e1ecd3
  1. 10
      global.org

@ -1121,11 +1121,17 @@
(interactive "P") (interactive "P")
(if arg (if arg
(LaTeX-insert-environment "align") (LaTeX-insert-environment "align")
(LaTeX-insert-environment "align*"))) (LaTeX-insert-environment "align*"))
(indent-according-to-mode))
(defun wilder/TeX-insert-align-dwim (arg) (defun wilder/TeX-insert-align-dwim (arg)
(interactive "P") (interactive "P")
(if (texmathp) (wilder/TeX-promote-inline-math arg) (if (texmathp)
(let ((why (car texmathp-why)))
(cond ((string-prefix-p "$" why) (wilder/TeX-promote-inline-math arg))
((string-equal "equation*" why) (LaTeX-modify-environment "align*"))
((string-equal "equation" why) (LaTeX-modify-environment "align"))
((string-equal "align*" why) (when arg (LaTeX-modify-environment "align")))))
(wilder/TeX-insert-align arg))) (wilder/TeX-insert-align arg)))
#+END_SRC #+END_SRC
This replaces horizontal space with a tilde This replaces horizontal space with a tilde

Loading…
Cancel
Save