Weave.jl/doc/src/getting_started.md

42 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

# Getting started
2020-05-23 12:42:19 +02:00
The best way to get started using Weave.jl is to look at the example input and output documents.
Examples for different formats are included in the package's [`examples`](https://github.com/JunoLab/Weave.jl/tree/master/examples) directory.
2020-05-18 15:59:18 +02:00
First have a look at source document using markdown code chunks and [Plots.jl](https://github.com/JuliaPlots/Plots.jl) for figures:
2020-05-23 12:42:19 +02:00
All the different format documents below are generated from a single Weave document [`FIR_design.jmd`](../examples/FIR_design.jmd):
2020-04-01 10:46:19 +02:00
- HTML: [`FIR_design.html`](../examples/FIR_design.html)
- PDF: [`FIR_design.pdf`](../examples/FIR_design.pdf)
- Pandoc markdown: [`FIR_design.txt`](../examples/FIR_design.txt)
2020-04-01 10:46:19 +02:00
!!! note
Producing PDF output requires that you have XeLateX installed.
2018-08-13 14:51:08 +02:00
Add dependencies for the example if needed:
2017-03-14 17:08:15 +01:00
```julia
2018-08-13 14:51:08 +02:00
using Pkg; Pkg.add.(["Plots", "DSP"])
2017-03-14 17:08:15 +01:00
```
2020-04-01 10:46:19 +02:00
Weave the files to your working directory:
2016-12-12 20:40:05 +01:00
```julia
using Weave
2020-04-01 10:46:19 +02:00
2020-05-23 12:42:19 +02:00
filename = normpath(Weave.EXAMPLE_FOLDER, "FIR_design.jmd")
2020-04-01 10:46:19 +02:00
# Julia markdown to HTML
2020-05-23 12:42:19 +02:00
weave(filename; doctype = "md2html", out_path = :pwd)
2020-04-01 10:46:19 +02:00
# Julia markdown to PDF
2020-05-23 12:42:19 +02:00
weave(filename; doctype = "md2pdf", out_path = :pwd)
2020-04-01 10:46:19 +02:00
# Julia markdown to Pandoc markdown
2020-05-23 12:42:19 +02:00
weave(filename; doctype = "pandoc", out_path = :pwd)
```
2020-05-18 15:59:18 +02:00
!!! tips
2020-05-23 12:42:19 +02:00
`Weave.EXAMPLE_FOLDER` points to [the `examples` directory](https://github.com/JunoLab/Weave.jl/tree/master/examples).