emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestion: add org-latex-preview to org-ctrl-c-ctrl-c


From: Akira Kyle
Subject: Suggestion: add org-latex-preview to org-ctrl-c-ctrl-c
Date: Thu, 22 Sep 2022 20:38:10 -0600
User-agent: mu4e 1.6.11; emacs 29.0.50


I recently thought to add ~org-latex-preview~ to ~org-ctrl-c-ctrl-c~ and it has been quite the productivity booster! Two arguments as to why this should be done: - ~org-ctrl-c-ctrl-c~ currently does nothing when inside latex-fragment or latex-environment so why not make it ~org-latex-preview~? - This intuitively matches my muscle memory from using babel. LaTeX is code after all, and I'm often making mistakes, so I want the fastest "edit-compile-edit" loop possible.

Here's what I currently have to achieve this in case anyone wants to give it a try right now :)

#+begin_src emacs-lisp
(defun my-org-ctrl-c-ctrl-c-latex-preview-hook ()
 (let ((element (car (org-element-context))))
(if (or (eq element 'latex-fragment) (eq element 'latex-environment))
       (org-latex-preview))))

(add-hook 'org-ctrl-c-ctrl-c-final-hook
             'my-org-ctrl-c-ctrl-c-latex-preview-hook)
#+end_src



reply via email to

[Prev in Thread] Current Thread [Next in Thread]