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