You can also tap into the entire Jupyter system using emacs-jupyter [1] which also includes an org-babel component – and it looks like you can preview the LaTeX in Org mode given a few options options [2].
This really makes me want to give SymPy a proper try. And I didn't know about `org-fragtog`, that's really neat!
I'm a bit confused about the main idea here: doesn't the usage of `:results raw` mean the output will be inserted multiple times, if the code is re-run? As far as I know `replace` doesn't actually work with `raw`. Would love to be wrong though.
ah, you're right. thankfully it looks like 'drawer' (which i only found out about just now) fixes this and retains the spirit of the thing; fragtog doesn't render it immediately though (needs C-u C-u `org-latex-preview`), but it'd probably be straightforward to add a post-(C-c C-c) hook to render it automatically. I'll add a note :)
How I wish papers in science and engineering were written in such format (or were created with org-mode source files with code which one could download and play with), where we could preview steps of derivations in some symbolic manipulation program, instead of "after simple transformation we get..."
Agreed. I'd love it if Confluence was org files, that I could ask developers to point their Emacs at. Then they could run through a how-to document by running each babel source block in turn.
[1] https://github.com/nnicandro/emacs-jupyter
[2] See https://github.com/nnicandro/emacs-jupyter#a-note-on-using-t... and https://github.com/nnicandro/emacs-jupyter/issues/218