rened / LaTeX.jl

Create LaTeX documents from within Julia, including image handling
Other
54 stars 15 forks source link

Working example #3

Closed carlosloslas closed 9 years ago

carlosloslas commented 9 years ago

Hello,

Really nice and useful Julia Package, well done for thinking of it :) ! I was trying to get a basic working example, but I am unable to follow what is on the readme.md file. I was wondering if you could provide a more detailed description.

Thanks in advance

carlosloslas commented 9 years ago

Hi @rened,

I am happy to help with coming up with detailed examples and docs :) I think it could potentially benefit both of us, since I will better understand the package development in Julia, and you could benefit from my work. I would only need some help solving questions and that sort of thing.

Let me know how this reads (I have two weeks until exams, but after that I am pretty much free!)

rened commented 9 years ago

Hi, sorry for the late response! Sure, sounds great! Does the example from the readme work for you? If not, what is the error message? What do you feel is missing, more examples or a more detailed documentation of the functions?

carlosloslas commented 9 years ago

No worries, Im quite busy myself so sometimes i will take a while to reply. I will let you know as exams get closer.

So by straight up copying and pasting what is on the readme.md I get the following:

screen shot 2015-05-04 at 14 11 22

The line that is not completely visible says:

could not spawn `pdflatex -halt-on-error -output-directory /var/folders/1m/..../T/JuliaHwtuzS/document.tex`: no such file or directory (ENOENT) 

I have dugg around LaTeX.jl and fund that in the openpdf() function generates a tempname() random directory, which seems to cause the issue.

My knowledge on Julia and unix is limited, but i am keen on learning. Running on :

OS X 10.10.3
Intel Core i7
8GB

Julia version:

Version 0.3.6 (2015-02-17 22:12 UTC)
x86_64-apple-darwin14.0.0

Hope this all helps narrow the issue down. As for the suggestions, should I post them here as well or open another issue where I will fire questions both to understand the package and to start coming up with examples and docs. (this quite likely may need to wait until the end of exams)

Thanks in advance both for the help and for the welcome to contributing to LaTeX.jl

rened commented 9 years ago

It seems that you do not have pdflatex installed? E.g. you get the same error when running

julia> run(`aaaa`)
ERROR: could not spawn `aaaa`: no such file or directory (ENOENT)
 in _jl_spawn at process.jl:217
 in sort! at ./sort.jl:258
 in spawn at /Users/rene/local/julia/usr/lib/julia/sys.dylib
 in version at ./pkg/git.jl:34

I would recommend the https://www.tug.org/texlive/ distribution.

carlosloslas commented 9 years ago

I don't quite understand what you mean. I have the MacTex distribution installed, which is what i normally use for creating my LaTeX documents (TeXShop Version 3.51). I think this is what you are asking about, right?

By looking in the directory that the .tex files are generated, the .tex files seem to be written as expected and the plot figures are added on the directory above. If I open the .tex file with TeXShop and typeset it, the .pdf file and all the relevant .log, .aux, and .gz are generated.

Should the package do this automatically? if not why then does the openpdf() function attempt also to generate the .pdf file?

rened commented 9 years ago

Yes, the package should to this automatically - could you please check what the output is when you run this in Julia:

run(`pdflatex`)

and

which pdflatex

in your shell? I believe that your Julia simply does see pdflatex.

carlosloslas commented 9 years ago

Output for run(pdflatex):

julia> run(`pdflatex`)
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
 restricted \write18 enabled.
**
Please type the name of your input file.
**

Output for which pdflatex:

julia> which pdflatex
ERROR: syntax: extra token "pdflatex" after end of expression
rened commented 9 years ago

Hm, I do not understand this... because run(pdflatex) does work. Did you try to run the code from the readme in the REPL as well or only in Juno? I am just guessing at this point, looking for a possible cause.

carlosloslas commented 9 years ago

I run the code in Juno, but it is copied straight from the readme. Adding only the `using LaTeX' line to call the package. Literally what is shown on the picture I sent earlier.

rened commented 9 years ago

Ok, last thing, could you please try to run it in the REPL? Because julia> run(pdflatex) seems to have been run from the REPL and there it seems to have worked?

carlosloslas commented 9 years ago

By that, I imagine you mean from the terminal, right?

carlosloslas commented 9 years ago

ok, so, it does work from the terminal! There must be something strange in Juno then...

rened commented 9 years ago

Great that it works! Unfortunately I don't know anything about Juno, sorry. It is ok to close this issue for know and you simply open new ones when issues come up?

carlosloslas commented 9 years ago

Is there any way we can open an issue in Juno... so that more people can get access to the package. What Julia editor do you use? Straight on the terminal, Jupyer notebooks, or something else?

rened commented 9 years ago

I use a mixture of Jupyter (to play around) and vim (to then write packages/modules), with https://github.com/rened/Watcher.jl for running the unit tests.

I just installed Juno, and running the example works for me - 10.9.5, julia 0.3.7. Perhaps run Pkg.update(), restart Juno and try again?

carlosloslas commented 9 years ago

It still doesn't seem to work. the only difference is the version of Julia...I am going to try and update to 0.3.7, hopefully that will make the difference

carlosloslas commented 9 years ago

Can't seem to be able to make it work. Thanks very much for the help. Will give it a go some other time, probably after exams. It would then be interesting to exchange a few ideas and to get some questions answered, from a documentation and development point of view.

Let me know how this sounds Thanks Carlos

rened commented 9 years ago

Absolutely, any time! Good look with your exams!