obsidian-execute-code
obsidian-execute-code copied to clipboard
[FR] LaTeX Support
Would it be possible to add latex support to evaluate blocks of latex? This would be useful for those of us who use LaTeX packages not available in mathjax (LaTeX as applied in obsidian). Ideally an svg of the results would be embedded below the codeblock. Please let me know if any further info would be helpful!
I'm trying to make a PR to address this. I just wanted to check with the maintainers that this would be an acceptable PR given that latex is not really a programming language so there wouldn't be any output to stdout. What I'm hoping to do is make a custom non-interactive executor for latex which writes to a temporary directory as in embedded inline plots and then renders the resulting pdf below the codeblock (either as an embed or (if possible) an internal link depending on a setting). I don't plan to give any saving functionality or anything else since for this, all that is needed is to copy the codeblock into a tex file and run from terminal.
The reason I think this would be very useful is that it would be very helpful to those learning LaTeX for document creation (something mathjax isn't meant for at all) and if users store a lot of online tex markup from different sources, it would be handy to actually see what the output is. Furthermore, it would actually allow users to use and learn latex packages to render diagrams or other latex packages not available in mathjax.
Please let me know what you think.
Also would you have any advice on how to embed a pdf below the codeblock. The current magic command use tags but this wouldn't work for a pdf. I could use a hyperlink to the file but that would be inline. I'm hoping to get a pdf embed as built into obsidian so its seamless.