I'm trying to set up a buffer-local behavior so that optionally, only after I execute the babel section, Org exports to LaTeX asynchronously after each save. I tried the following:
(defun kdm/org-save-and-export ()
(interactive)
(org-latex-export-to-latex t))
(add-hook 'after-save-hook 'kdm/org-save-and-export)
But it creates file.tex.tex.tex.tex
indefinitely. How do I modify this to only save 1x, and be a buffer-local change?