Closed jlperla closed 5 years ago
Sounds good @jlperla. Thanks for breaking this down for me.
Also note this PR: https://github.com/mpastell/Weave.jl/pull/126 which mentions https://github.com/Evizero/Augmentor.jl/blob/master/docs/exampleweaver.jl
OK, @jlperla, I've spent some time with this and think this is done. Long story short, essentially all of this stuff but PDF is easily possible. I put an example in the folder under economics_examples.jmd
.
Specifically:
There's great LaTeX support for things like numbered systems of equations, referencing equations by label, splitting equations over several lines using align
, etc.
Writing to HTML is flawless. Writing to Jupyter doesn't chunk out the LaTeX, so you'd need to post-process it. The tangled option works great (just spits out all the Julia code as if it was in one REPL), so we could run that to test.
There's support for "silent" code (like boilerplate for setup). There's also support for capturing plot output and resizing it.
Headers and footers work great; it's just editing HTML or TeX, using the variables we define in the .jmd
and the syntax for calling them given in mustache.jl
.
The story on PDF, I think, is twofold. First, there's running it straight with "md2pdf"
, which I believe fails partly (mainly?) because LaTeX needs to be in shell-escape mode (something to do with minted
). I guess we could hack a post-process to enable that (I think you just add a brief note at the top of the document).
If you try and download the PDF from a notebook, it complains because nbconvert
can't find Inkscape, which is used to convert SVG images to PDF. People have reported success by installing inscape using Conda, changing the svg2pdf.py
file inside nbconvert
to point to the install, and downloading.
Sounds great. We can discuss tomorrow. How is it executing the latex? Can you pass in command line parameters? I suspect there is a way to get the shell escape working...
Will check re that. I tried running it manually escaped a while back (i.e., go to the repo, do pdflatex [shell-escape flag] ...
). I suspect there may be some other roadblocks, but this is the nearest one.
@Nosferican this is where we discussed some of this.
A few thoughts:
jldoctests
and use the typical tools for running those with Documenter.jl, which would give anyone contributing code a proper regression test (perhaps even under Travis for a PR, which would be awesome).md2tex
. But check the output, as sometimes it has fragments or incorrect math environments
With Weave.jl, we need to see if the following are possible (and if they are easy). Where it is not easily possible, we can discuss alternatives.
You can take over and replace my old attempts in https://github.com/ubcecon/computing_and_datascience/blob/master/julia_sandbox/Weave/README.md and https://github.com/ubcecon/computing_and_datascience/blob/master/julia_sandbox/Weave/
Basic Setup:
Weave.jl
example there, focusing entirely on the.jmd
input format..jl
. All tests below would refer to all of these.Things to check:
Plots.jl
andGR
based output in all of the above output forms (except the tangling).jl
and.pynb
output?Some of the things that I am pretty sure are not there, but we can discuss with others about:
jldoctest
style addition to Weave.jl? Can we use the tangled output for a test?