-
Notifications
You must be signed in to change notification settings - Fork 0
/
local2.satyh
78 lines (64 loc) · 2.36 KB
/
local2.satyh
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
67
68
69
70
71
72
73
74
75
76
77
@require: stdjabook
@require: hdecoset
@require: vdecoset
@require: code
@require: list
let-block ctx +centering it =
line-break true true ctx (inline-fil ++ read-inline ctx it ++ inline-fil)
let-block ctx +image-frame content =
let pads = (10pt, 10pt, 10pt, 10pt) in
let decoset = VDecoSet.simple-frame-stroke 1pt Color.black in
block-frame-breakable ctx pads decoset (fun ctx -> read-block ctx '<+centering{#content;}>)
let-inline ctx \insert-image w path =
let img = load-image path in
use-image-by-width img w
let-block ctx +frame content =
let pads = (10pt, 10pt, 10pt, 10pt) in
let decoset = VDecoSet.simple-frame-stroke 1pt (Color.gray 0.75) in
block-frame-breakable ctx pads decoset (fun ctx -> read-block ctx content)
let-block ctx +display-boxes content code =
read-block (ctx |> set-paragraph-margin 12pt 0pt) '<+frame(content);>
+++ read-block (ctx |> set-paragraph-margin 0pt 12pt) '<+code(code);>
let single cp = string-unexplode [cp]
let-math \cdot = math-char MathRel `⋅`
let-math \vec = math-char MathOrd (single 0x20D7)
let-math \nabla = math-char MathPrefix (single 0x2207)
let-math \nab = math-char MathOrd (single 0x2207)
let-math \nablavec = math-char MathPrefix (string-unexplode [0x2207; 0x20D7])
let-math \ln = math-char MathPrefix `ln`
let-math \sinh = math-char MathPrefix `sinh`
let-math \cosh = math-char MathPrefix `cosh`
let-math \arsinh = math-char MathPrefix `arsinh`
let-math \exp = math-char MathPrefix `exp`
let greek-uppercase cp cpb cpr cprb =
let s = single cp in
let sb = single cpb in
let sr = single cpr in
let srb = single cprb in
math-variant-char MathOrd (|
italic = s;
bold-italic = sb;
roman = sr;
bold-roman = srb;
script = s;
bold-script = sb;
fraktur = s;
bold-fraktur = sb;
double-struck = s;
|)
let greek-lowercase cp cpb =
let s = single cp in
let sb = single cpb in
math-variant-char MathOrd (|
italic = s;
bold-italic = sb;
roman = s;
bold-roman = sb;
script = s;
bold-script = sb;
fraktur = s;
bold-fraktur = sb;
double-struck = s;
|)
let-math \lambda= greek-lowercase 0x1D706 0x1D740
let-math \mu = greek-lowercase 0x1D707 0x1D741