shd101wyy / vscode-markdown-preview-enhanced

One of the "BEST" markdown preview extensions for Visual Studio Code
https://shd101wyy.github.io/markdown-preview-enhanced
Other
1.46k stars 173 forks source link

"Unable to open file" when using latex (tikz) #1180

Open 31415926535x opened 4 years ago

31415926535x commented 4 years ago

When using latex to get tikz and others, may appear "Unable to open file", but the tex and pdf2svg is working, there should be appearing Chinese path for current document, try to change it.

like this: shd101wyy/vscode-markdown-preview-enhanced#1630

31415926535x commented 3 years ago

I think the bug which is "Unalbe to open file" maybe is the permisson error https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues/1630 or the md file's path is not english path . maybe need to translate So, try use Administrator to open vscode Or rename and copy the file are the better ideas. 😀

sasasqt commented 7 months ago

i have the same issue EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open ... \0ea88b042d041d36889cebb14ea77e77_1.svg?0.1653175875535262

the svg file is there, but without strings after ? mark image

latex engine: pdflatex (by MiKTeX) This is pdfTeX, Version 3.141592653-2.6-1.40.25 (MiKTeX 24.1 Portable) (preloaded format=pdflatex.fmt) restricted \write18 enabled.

https://github.com/shd101wyy/crossnote/blob/b64a355d496a6380f61bd76473f7b1f691bbafe5/src/tools/pdf.ts#L45 i guess the .svg?0.1653175875535262 came from the here https://github.com/shd101wyy/crossnote/blob/b64a355d496a6380f61bd76473f7b1f691bbafe5/src/tools/pdf.ts#L118 where

svgMarkdown += `![](${svgFilePath}?${r})\n`; and const r = Math.random();

blackgolfer commented 5 months ago

I have the same problem as @sasasqt under ubuntu 22.04 with texlive, EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open '/tmp/crossnote_pdf2024327-359-1h3qmyd.v0d5f/8babd794a01815792b8c6ffd77bfbf9b_1.svg?0.8224879772515272', the file /tmp/crossnote_pdf2024327-359-1h3qmyd.v0d5f/8babd794a01815792b8c6ffd77bfbf9b_1.svg is there.

NeoVerto commented 5 months ago

I have the same problem as @sasasqt under Windows 11 23H2 with MikTeX, EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open 'c:\Users\admin\AppData\Local\Temp\crossnote_pdf2024329-8780-d651cl.ezmw\66987bef93864457c2153b86d4ef73d9_1.svg?0.2530605881846413', the file 66987bef93864457c2153b86d4ef73d9_1.svg is there

sasasqt commented 5 months ago

@blackgolfer @NeoVerto

add latex_zoom=xx or latex_width=xx or latex_height=xx is a workaround.

As the logic is handled differently: https://github.com/shd101wyy/crossnote/blob/b64a355d496a6380f61bd76473f7b1f691bbafe5/src/tools/pdf.ts#L111

image

blackgolfer commented 5 months ago

Thanks, it works.

NeoVerto commented 4 months ago

@sasasqt Thanks, it works

ericsunplus commented 3 months ago

@sasasqt Save my day, thank you!