JuliaTeX / TikzPictures.jl

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

Bugfix/auto cd revert #45

Closed Shushman closed 5 years ago

Shushman commented 5 years ago

This addresses #44

zsunberg commented 5 years ago

@Shushman Thanks for doing this! You can use a do block to avoid the helper functions, e.g.

foo = "myfile.tex"
cd("temp/dir") do 
    run(`some command`)
    run(`compile $foo`)
end

I think that would be clearer

zsunberg commented 5 years ago

I ran the new branch with this script: https://github.com/JuliaPOMDP/POMDPGallery.jl/blob/v1/problems/LaserTag/script.jl and got the following error:

ERROR: LoadError: UndefVarError: f not defined
Stacktrace:
 [1] savePDFTPHelper(::String, ::String, ::TikzPictures.TikzPicture) at /home/zach/.julia/packages/TikzPictures/2XDDW/src/TikzPictures.jl:259

You could include that script in the tests, but it has a lot of esoteric dependencies on POMDPs stuff. Ideally all the code branches should be tested, but it is really hard to make tests for all :/

Shushman commented 5 years ago

Yeah I'm all for cleaner do blocks, and that f was a silly miss. How about now? @zsunberg

zsunberg commented 5 years ago

Yep, it works perfectly now! Thanks!

Shushman commented 5 years ago

@mykelk can you merge if you're happy