-
Notifications
You must be signed in to change notification settings - Fork 3
/
manual.typ
66 lines (52 loc) · 1.58 KB
/
manual.typ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#import "/src/cetz.typ"
#import "/doc/util.typ": *
#import "/doc/example.typ": example
#import "/doc/style.typ" as doc-style
#import "/src/lib.typ": *
#import "@preview/tidy:0.3.0"
// Usage:
// ```example
// /* canvas drawing code */
// ```
#show raw.where(lang: "example"): example
#show raw.where(lang: "example-vertical"): example.with(vertical: true)
#make-title()
#set terms(indent: 1em)
#set par(justify: true)
#set heading(numbering: (..num) => if num.pos().len() < 4 {
numbering("1.1", ..num)
})
#show link: set text(blue)
// Outline
#{
show heading: none
columns(2, outline(indent: true, depth: 3))
pagebreak(weak: true)
}
#set page(numbering: "1/1", header: align(right)[CeTZ-Plot])
= Introduction
CeTZ-Plot is a simple plotting library for use with CeTZ.
= Usage
This is the minimal starting point:
#pad(left: 1em)[```typ
#import "@preview/cetz:0.3.1"
#import "@preview/cetz-plot:0.1.0"
#cetz.canvas({
import cetz.draw: *
import cetz-plot: *
...
})
```]
Note that plot functions are imported inside the scope of the `canvas` block.
All following example code is expected to be inside a `canvas` block, with the `plot`
module imported into the namespace.
= Plot
#doc-style.parse-show-module("/src/plot.typ")
#for m in ("line", "bar", "boxwhisker", "contour", "errorbar", "annotation", "formats", "violin", "legend") {
doc-style.parse-show-module("/src/plot/" + m + ".typ")
}
= Chart
#doc-style.parse-show-module("/src/chart.typ")
#for m in ("barchart", "boxwhisker", "columnchart", "piechart", "pyramid") {
doc-style.parse-show-module("/src/chart/" + m + ".typ")
}