JuliaTeX / TikzPictures.jl

Creating PGF/TikZ pictures and saving them in various formats
Other
89 stars 28 forks source link

standalone.cls not found #68

Closed ucalyptus closed 3 years ago

ucalyptus commented 3 years ago

On running this snippet

using TikzPictures
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("test"), tp)

I get this error in Julia (REPL)

! LaTeX Error: File `standalone.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Enter file name: 
! Emergency stop.
<read *> 

l.2 

End of file on the terminal!

Here is how much of LuaTeX's memory you used:
 14 strings out of 494577
 100000,89155 words of node,token memory allocated 243 words of node memory still in use:
   1 dir, 2 glue, 32 glue_spec nodes
   avail lists: 2:12,3:1,4:1
 4190 multiletter control sequences out of 65536+600000
 14 fonts using 591559 bytes
 10i,0n,7p,54b,15s stack positions out of 5000i,500n,10000p,200000b,100000s
!  ==> Fatal error occurred, no output PDF file produced!

ERROR: LaTeX error
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] (::TikzPictures.var"#15#16"{PDF,TikzPicture,String})() at /home/codespace/.julia/packages/TikzPictures/T36kb/src/TikzPictures.jl:308
 [3] cd(::TikzPictures.var"#15#16"{PDF,TikzPicture,String}, ::String) at ./file.jl:104
 [4] save(::PDF, ::TikzPicture) at /home/codespace/.julia/packages/TikzPictures/T36kb/src/TikzPictures.jl:252
 [5] top-level scope at REPL[16]:1

Does this not work on Julia REPL?Do I specifically need a notebook for this?

mykelk commented 3 years ago

You need to make sure your latex installation includes standalone.cls. On ubuntu, you can install it like this:

sudo apt-get install texlive-latex-extra

Or you can use tlmgr to install it through texlive.

ucalyptus commented 3 years ago

Hi @mykelk , that helped.

diegozea commented 3 years ago

I got the same error when using the PGFPlotsX as a Plots backend. In Ubuntu 18.04.2 LTS, I needed to do tlmgr install standalone to solve the problem. texlive-latex-extra doesn't install standalone on that Ubuntu version.

diegozea commented 3 years ago

In fact, I also needed tikz.sty and sudo apt-get install texlive-latex-base and sudo apt-get install texlive-binaries didn't install it on Ubuntu 18.04. So, I did the following to install everything I needed for PGFPlotsX:

tlmgr install standalone
tlmgr install luatex85
tlmgr install pgf  # this installs tikz.sty
tlmgr install pgfplots
tlmgr update --self --all
mykelk commented 3 years ago

For reference, line 50 here does the install for Github's CI.

diegozea commented 3 years ago

P.S.: I have also needed: tlmgr install pagecolor for PGFPlotsX

khazaddim commented 1 year ago

You need to make sure your latex installation includes standalone.cls. On ubuntu, you can install it like this:

sudo apt-get install texlive-latex-extra

Or you can use tlmgr to install it through texlive.

sudo apt-get install texlive-latex-extra
This fixed my issue with: ValueError: latex error converting to dvi. See log output above or the log file: media/Tex/8e6bcf61491e43f2.log

I have Ubuntu 20.04

Thank you very much