Weave.jl/doc/src/publish.md

55 lines
1.7 KiB
Markdown
Raw Normal View History

2016-12-15 20:08:49 +01:00
# Publishing to html and pdf
2016-04-22 14:04:15 +02:00
2019-03-04 14:42:16 +01:00
You can also publish any supported input format using markdown for doc chunks to html and pdf documents. Producing pdf output requires that you have pdflatex installed and in your path.
2016-04-22 14:04:15 +02:00
2016-12-15 20:08:49 +01:00
You can use a YAML header in the beginning of the input document delimited with "---"
to set the document title, author and date e.g.
2016-04-22 14:04:15 +02:00
2016-12-15 20:08:49 +01:00
```
---
title : Weave example
author : Matti Pastell
date: 15th December 2016
---
```
2016-04-22 14:04:15 +02:00
2016-12-15 20:08:49 +01:00
Here is a a sample document and output:
2016-04-22 14:04:15 +02:00
2019-03-04 14:42:16 +01:00
[FIR_design_plots.jl](../examples/FIR_design_plots.jl), [FIR_design_plots.html](../examples/FIR_design_plots.html) , [FIR_design_plots.pdf](../examples/FIR_design_plots.pdf).
2016-04-22 14:04:15 +02:00
2016-12-12 20:40:05 +01:00
```julia
2018-08-13 14:51:08 +02:00
weave("FIR_design_plots.jl")
weave("FIR_design_plots.jl", docformat = "md2pdf")
2016-04-22 14:04:15 +02:00
```
2016-12-15 20:08:49 +01:00
**Note:** docformats `md2pdf` and `md2html` use Julia markdown and `pandoc2pdf` and `pandoc2html`
use Pandoc.
2016-12-19 20:45:01 +01:00
## Templates
You can use a custom template with `md2pdf` and `md2html` formats with `template`
2018-08-13 14:51:08 +02:00
argument (e.g) `weave("FIR_design_plots.jl", template = "custom.tpl"`). You can use
2016-12-19 20:45:01 +01:00
the existing templates as starting point.
For HTML: [julia_html.tpl](https://github.com/mpastell/Weave.jl/blob/master/templates/julia_html.tpl) and LaTex: [julia_tex.tpl](https://github.com/mpastell/Weave.jl/blob/master/templates/julia_tex.tpl)
Templates are rendered using [Mustache.jl](https://github.com/jverzani/Mustache.jl).
2019-03-04 14:42:16 +01:00
## Supported Markdown syntax
2019-11-03 14:00:37 +01:00
The markdown variant used by Weave is [Julia markdown](https://docs.julialang.org/en/v1/stdlib/Markdown/#). In addition Weave supports few additional Markdown features:
2019-03-04 14:42:16 +01:00
**Comments**
You can add comments using html syntax: `<!-- -->`
**Multiline equations**
You can add multiline equations using:
```
$$
x^2 = x*x
$$
```