Weave
Weave
Weave
allows to produce dynamic documents where the script that produce the output is embedded directly in the document, with optionally only the output rendered.
Save the document below in a file with extension jmd (e.g. testWeave.jmd)
Here instead I will put in the PDF both the script source code and the output:
Note also that I can refer to variables defined in previous chunks (or "cells", following Jupyter terminology):
Subsubsection
For a much more complete example see the Weave documentation.
References
```
You can then "compile" the document (from within Julia) with:
using Weave; weave("testWeave.jmd", out_path = :pwd, doctype = "pandoc2pdf")
To obtain the following pdf:
In Ubuntu Linux (but most likely also in other systems), weave needs pandora and LaTeX (texlive-xetex
) already installed in the system.
If you use Ununtu, the version of pandora in the official repositories is too old. Use instead the deb available in https://github.com/jgm/pandoc/releases/latest .
While an updated, expanded and revised version of this chapter is available in "Chapter 11 - Utilities" of Antonello Lobianco (2019), "Julia Quick Syntax Reference", Apress, this tutorial remains in active development.
Last updated