KristofferC / PGFPlotsX.jl

Plots in Julia using the PGFPlots LaTeX package
Other
301 stars 40 forks source link

Correct PATH to latex on windows? #289

Closed JianghuiDu closed 2 years ago

JianghuiDu commented 2 years ago

I added latex path on my windows but it still cannot find it. I tried in my environment variables C:\Users\Jianghui\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64 C:\Users\Jianghui\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\lualatex.exe It works because I can use it in cmd but doesn't work for Julia. What kind for path format is required?

KristofferC commented 2 years ago

Can you show ENV["PATH"] and Sys.which("lualatex") in Julia?

JianghuiDu commented 2 years ago

ENV["PATH"] returns a list that doesn't include C:\Users\Jianghui\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64 C:\Users\Jianghui\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\lualatex.exe which I added to windows, but it included other paths that are in my windows path list. Sys.which("lualatex") returns empty. So it seems the ENV["PATH"] was not updated after I added the new paths, despite it taking immediate effect in windows? Restarting Julia doesn't help. Do I need to restart my windows?

JianghuiDu commented 2 years ago

It's a vscode problem. Just restarting julia doesn't work, needs to restart vscode after modifying windows path.

KristofferC commented 2 years ago

Yes, you need to restart programs for them to see an updated PATH. Julia inside a vscode (or, in general, processes spawned by other processes) will inheret the path of the parent.