Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

What should I put into the tex file? #3

Open
PrajwalS1234 opened this issue Aug 17, 2023 · 2 comments
Open

What should I put into the tex file? #3

PrajwalS1234 opened this issue Aug 17, 2023 · 2 comments

Comments

@PrajwalS1234
Copy link

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)

image

I don't know what to enter into the latex code block, because no matter what I enter it gives me nothing back.

githubProject2.mp4

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.

@fenjalien
Copy link
Owner

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}

@PrajwalS1234
Copy link
Author

PrajwalS1234 commented Aug 17, 2023

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

Untitled.Project.mp4

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

image

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants