Weave pkg to produce reports in Julia

Hi. I’d like to do some reports in Julia as I used to do in R through RMarkdown. I found a pkg called Weave to do the same thing but it seems for me that it is necessary a greater integration with Latex (and also Python??) than R, not just run the code in Julia and get the pdf as RMarkdown used to be. Is there someone who has some experience with Weave and could help me?

Thanks in advance

I’ve used Weave.jl a number of times (not recently) and was quite happy with it. I am pleased to see that it still looks like it’s under very active development (I’m not a contributor myself). As I recall everything worked out of the box for me and was completely pain free.

I’m not sure what you mean by “greater integration with latex”. Are you looking for it to output latex source code? I don’t think it does this. You should have no trouble inserting latex into your script however. I’m also not sure what Python integration you are looking for. You could always use PyCall.jl from within your weave script to call python. In 0.7, once they update PyCall to use getproperty it will be possible to get Julia syntax to look very close to Python syntax if you so desire.

My interpretation of the OP is that Weave seems to require some kind of Latex/Python support to do its thing. @mvcavalcanti can you clarify what problem you’re running into? It would be easier to help out if you have a more specific error message you’re getting.

This is not a direct answer to your question but might be helpful.
RMarkdown and knitr also support julia chunk through the R package JuliaCall, see https://github.com/yihui/knitr/releases/tag/v1.18. If your knitr version is newer than v1.18 (the current release is v1.20.), you can just install the package JuliaCall and have julia chunk in your RMarkdown document like this:

```{julia}
1 + 1
```

```{julia}
using Plots
gr()
plot([1, 2, 3, 4, 5])
```

Another tool I am currently developing to automatically generated PDF from a LaTeX note database:

This tool is fully functional as of now, but it will not be officially released and documented for another month.

Thank you guys. So, I’ll tell you briefly what is going on. I’m trying to run that example “gadfly_md_sample.jmd” before apply in my code. My first problem starts in Julia with:

WARNING: Error converting document to pdf. Try running latex manually

The .tex document is created, but not converted. Then I open this .tex file and try to run with TexStudio. But I get another error:

Package minted Error: You must have ‘pygmentize’ installed to use this package. \begin{document}

After all this, I don’t know more what to do. I don’t want to make any integration, but all this effort seems to me that coding just in Julia is not enough.

The error message suggests that the tex file generated by Weave uses the latex package minted, which depends on pygmentize, which is not installed on your system. As far as I know, RMarkdown does a similar Rmd -> tex -> pdf thing, but I guess the tex file generated by RMarkdown doesn’t use the minted package.

And searching about mint in documentation of Weave, I found that it may be possible to generate tex file which doesn’t use minted, see http://weavejl.mpastell.com/stable/usage/#supported-formats.

2 Likes

It might be helpful to configure your Latex distribution to download packages on the fly. Perhaps it is not automatically downloading things as it encounters them.