On Sun, Apr 07 2024 23:36, Karthik Chikmagalur wrote: > You can ignore `org-latex-preview-live--src-buffer-setup', this is for > previewing when using `org-edit-special' (C-c '), which does not apply > to any other major mode. So `org-latex-preview-live--ensure-overlay' is > the only function you need to rewrite, which should be easy.
Oh, indeed, you are right; seems like it only looked intimidating! I quickly hacked this in just now, and it works just fine. As a very brief summary, one currently needs to—in addition to supplying a preamble and a way to recognise maths and environments—patch the following functions: · org-latex-preview--place-from-elements · org-latex-preview-auto--regenerate-overlay · org-latex-preview-auto--maybe-track-element-here · org-latex-preview-live--ensure-overlay The last two are only needed for the "live" part of the live previews to work. I will clean the code up a little bit (hopefully by the weekend, but no promises), and try to add support for LaTeX environments instead of just maths. I reckon that once this is finished one can get a pretty good idea in which direction org-latex-preview.el would need to be nudged to more easily facilitate this kind of integration. After that I guess there's still the issue of caching and numbering, but I'll cross that bridge once we get to it :) Tony -- Tony Zorman | https://tony-zorman.com/