Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF and SVG ouput not working on Windows on Julia 1.4 #53

Closed
VinciTec opened this issue Apr 1, 2020 · 11 comments
Closed

PDF and SVG ouput not working on Windows on Julia 1.4 #53

VinciTec opened this issue Apr 1, 2020 · 11 comments

Comments

@VinciTec
Copy link

VinciTec commented Apr 1, 2020

Trying to save TikzPicture as PDF or SVG on windows seems to give a LaTeX error.
I think the error lies in how the path is given to LuaLaTeX.

Example:

tp = TikzPicture("\\draw (0,0) -- (10,10);\n\\draw (10,0) -- (0,10);\n\\node at (5,5) {tikz \$\\sqrt{\\pi}\$};", options="scale=0.25", preamble="")
save(PDF("testPic"), tp)

Error:

ERROR: LaTeX error
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] (::TikzPictures.var"#6#7"{PDF,TikzPicture,String})() at C:\Users\jesse\.julia\packages\TikzPictures\x0ZWu\src\TikzPictures.jl:269
 [3] cd(::TikzPictures.var"#6#7"{PDF,TikzPicture,String}, ::String) at .\file.jl:93
 [4] save(::PDF, ::TikzPicture) at C:\Users\jesse\.julia\packages\TikzPictures\x0ZWu\src\TikzPictures.jl:213
 [5] top-level scope at REPL[3]:1

The LaTeX error:

! Emergency stop.
<*> /jllOleMv\testPic
                  .tex
End of file on the terminal!



Here is how much of LuaTeX's memory you used:
 4 strings out of 481351
 100000,319454 words of node,token memory allocated 270 words of node memory still in use:
   1 hlist, 39 glue_spec nodes
   avail lists: 2:12,3:1,4:1,5:3
 17247 multiletter control sequences out of 65536+600000
 24 fonts using 2830079 bytes
 0i,0n,0p,0b,6s stack positions out of 5000i,500n,10000p,200000b,100000s
!  ==> Fatal error occurred, no output PDF file produced!

The temporary directory seems to be made in the root folder, of my D: drive in this case.
I could not find out whether this was wanted behaviour, but I think this directory should be local.

The problem does not appear to be with my TeX distribution: when I manually execute
lualatex --enable-write18 testpic.tex I do get the correct PDF.

Hope this is enough information.
Thank you very much for helping in advance.

@mykelk
Copy link
Member

mykelk commented Apr 1, 2020

I ran your code on Windows 10 with TikzPictures v3.0.5 and it worked just fine. Can you confirm your version of Windows and TikzPictures?

@VinciTec
Copy link
Author

VinciTec commented Apr 1, 2020

I can confirm I'm running Windows 10 with TikzPictures v3.0.5.
I did just update Windows and reinstalled TikzPictures, but the same issue persists unfortunately.

Might it be related to me having the Julia installation on a different drive than my user (and thus also .julia) directory?

@mykelk
Copy link
Member

mykelk commented Apr 1, 2020

That shouldn't be an issue, but maybe git it a try? Out of curiosity, does naming it "mypic" fix this? I wonder if the \t in the path is interpreted as a tab character.

@VinciTec
Copy link
Author

VinciTec commented Apr 1, 2020

Thanks again for the quick replies.
Changing the filename does not fix the problem; note that I am able to safe the picture as TEX (and then compile it manually).
Also when trying to save as SVG the same problem seem to arise, but in this case the temporary folder is not removed, causing me to end up with a lot of temporary folders in my root directory: was this meant to be implemented for windows in this way (apart from being not removed of course)?

I will try to use a clean Julia installation and see if the issue is still present.

@mykelk
Copy link
Member

mykelk commented Apr 1, 2020

It could be an issue with the creation of the temporary directory. What version of Julia are you using?

@VinciTec
Copy link
Author

VinciTec commented Apr 1, 2020

I just performed a clean install of Julia with packages, so I'm runnning:

  • Julia 1.4.0
  • TikzPictures 3.0.5
    And the exact same issue is still present.

@VinciTec
Copy link
Author

VinciTec commented Apr 1, 2020

I thought the issue might be related to the REPL, which I was using for all tests.
But I just tried running the same code in a Julia file and the same error message still appears.

@mykelk
Copy link
Member

mykelk commented Apr 1, 2020

Ah, okay. I'm using Julia 1.3. I know 1.4 had some changes with how temporary directories work. I'll check it out.

@VinciTec
Copy link
Author

VinciTec commented Apr 1, 2020

Ah alright thank you.
I just tried downgrading to 1.3.1, this indeed fixed the issue.
So there might be something there.

@mykelk mykelk changed the title PDF and SVG ouput not working on Windows PDF and SVG ouput not working on Windows on Julia 1.4 Apr 1, 2020
@mykelk mykelk closed this as completed in 1baee78 Apr 1, 2020
@mykelk
Copy link
Member

mykelk commented Apr 2, 2020

Works on Julia 1.4 now.

@VinciTec
Copy link
Author

VinciTec commented Apr 2, 2020

I noticed, thanks

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

No branches or pull requests

2 participants