From f0178e56f727468d9a5a52fc8ffe28be1257e93e Mon Sep 17 00:00:00 2001 From: Lucas Sta Maria Date: Mon, 1 Apr 2024 11:17:37 -0400 Subject: [PATCH] fix(emacs): introduce align keybinds for latex Signed-off-by: Lucas Sta Maria --- .emacs.d/include/latexconfig.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.emacs.d/include/latexconfig.el b/.emacs.d/include/latexconfig.el index 1cf624d..c58b414 100644 --- a/.emacs.d/include/latexconfig.el +++ b/.emacs.d/include/latexconfig.el @@ -84,6 +84,12 @@ (insert "\\frac{" content "}{}") (backward-char))) +(defun latex-tab () + "Multi-purpose tab for LaTeX." + (interactive) + (align-current) + (cdlatex-tab)) + (defun configure-latex () "Configure my custom LaTex environment." (electric-indent-mode -1) @@ -95,7 +101,8 @@ (setq-local flycheck-disabled-checkers '(tex-chktex)) - + + (keymap-local-set "C-c C-a" #'align-current) (keymap-local-set "C-c C-c" #'custom-compile-latex) (keymap-local-set "C-c C-z" #'open-out-pdf) (keymap-local-set "C-c C-b" #'latex-insert-block) @@ -104,6 +111,7 @@ (keymap-local-set "/" #'math-insert-frac) ;; For cases where we actually do want `/' in math... (keymap-local-set "M-/" #'insert-raw-slash) + (keymap-local-set "C-TAB" #'latex-tab) (keymap-substitute cdlatex-mode-map 'cdlatex-dollar 'cdlatex-math-symbol) (setq cdlatex-math-symbol-prefix ?$)