I am using org-mode files with equations and code blocks in lectures,
and it is problematic that C-c C-c removes the equation overlays when
running a code block. First, you have to press C-c C-c twice to run the
block, since the first one gets rid of the equations, but then you have
run C-c C-x C-l to get the equations back! and the cycle repeats
throughout a lecture.

I would prefer that the equations stay untouched, and that the code
blocks run without modifying them. 

I think the best behavior would be for C-c C-x C-l to toggle the
equations, and to remove the C-c C-c behavior for latex overlays
completely. But it would be ok if this was done by a C-c C-c hook
function, so that a user could remove the latex overlay without touching
the org-code.

Maybe a new function like this:

#+BEGIN_SRC emacs-lisp
(defun org-toggle-latex-overlays (arg)
  "Toggle LaTeX fragments."
  (interactive "P")
  (if org-latex-fragment-image-overlays
      (org-remove-latex-fragment-image-overlays)
    (org-preview-latex-fragment arg)))
#+END_SRC

 could be added. Any thoughts?



-- 
-----------------------------------
John Kitchin
Professor


Reply via email to