obsidian-latex-render
obsidian-latex-render copied to clipboard
What should I put into the tex file?
After a lot of searching and staring at code, I was able to find a command which didn't give me an error
latex -interaction=nonstopmode -halt-on-error -shell-escape '/home/bob/example.tex' && dvisvgm '/home/bob/example.dvi'
I am using MX-Linux btw.
This is what is in the example.tex file
\documentclass{standalone}
\begin{document}
Hello, $x^2 + y^2 = r^2$.
\end{document}
This is what is in the example.dvi file(drive link attached)
I don't know what to enter into the latex code block, because no matter what I enter it gives me nothing back.
https://github.com/fenjalien/obsidian-latex-render/assets/105973016/dd74dca1-5ad9-40f7-a6aa-80ee6e47134a
Now, what should I enter in the tex file to get the right output. I am sorry but the read.md doesn't explain well enough.
As the readme says (https://github.com/fenjalien/obsidian-latex-render#usage) the document class is set to standalone
for you by prepending \documentclass{standalone}
to the source.
Maybe try
\begin{document}
Hello, $x^2 + y^2 = r^2$
\end{document}
edit: so when the terminal executes the command it works and creates a svg file but when something happens via the obsidian plugin you created nothing happens. I have had this problems with linux apps before. and I haven't found a solution to it
https://github.com/fenjalien/obsidian-latex-render/assets/105973016/e16a017e-1df8-4d3d-ba4f-644bb2fc3342
so look brother, I don't know how this works,
I will detail everything here, This is the file I am executing, and this is the command I am using to execute it
I have included \documentclass{standalone} because, if I don't it will cause an error inside Obsidian
latex -interaction=nonstopmode -halt-on-error -shell-escape "/home/bob/example.tex" && dvisvgm --exact --font-format=woff2 "/home/bob/example.dvi"
And this command works well enough that it creates a example.svg file. But, it stays in /home/bob/ folder as example.svg There won't be any changes in .obsidian/obsidian-latex-render-svg-cache\ where I assume it's supposed to be in.
I don't know how it's supposed to work, but I reckon it's supposed to create a .svg file and move it into the .obsidian/obsidian-latex-render-svg-cache\ directory and your code will insert the image inside Obsidian.
But, it's not happening. I have tried this for a day and I give up :(
Thanks for trying to help anyway.
last edit, because, I might forget it,
I have found that this command featherpad example.tex && latex -interaction=nonstopmode -halt-on-error -shell-escape "/home/bob/example.tex" && dvisvgm --exact --font-format=woff2 "/home/bob/example.dvi" is the next best thing to your plugin.
It basically opens featherpad, takes my edit and copies the svg to the clipboard so I can paste it into obsidian. Lot of work, but yeah, peace!