-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal.satyh
147 lines (125 loc) · 4.87 KB
/
local.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
@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-math \sums m1 m2 =
${\upper{\lower{\sum}{#m1}}{#m2}}
let single cp = string-unexplode [cp]
let-math \cup = math-char MathRel `∪`
let-math \cross = math-char MathRel `⨯`
let-math \cap = math-char MathRel `∩`
let-math \approx = math-char MathRel `≈`
let-math \symeq = math-char MathRel `≃`
let-math \le = math-char MathRel `≤`
let-math \leqq = math-char MathRel `≦`
let-math \ge = math-char MathRel `≥`
let-math \geqq = math-char MathRel `≧`
let-math \cdot = math-char MathRel `⋅`
let-math \nyoro = math-char MathRel `~`
let-math \arrow = math-char MathRel `→`
let-math \partial = math-char MathPrefix `∂`
let-math \ordd = math-char MathPrefix `d`
let-math \all = math-char MathPrefix `∀`
let-math \prime = math-char MathOrd `′`
let-math \phat = math-char MathOrd `𝑝̂`
let-math \hbar = math-char MathOrd `ℏ`
let-math \qhat = math-char MathOrd `𝑞̂`
let-math \muhat = math-char MathOrd `𝜇̂`
let-math \hat = math-char MathOrd `̂`
let-math \xbar = math-char MathOrd `𝑥̄`
let-math \ybar = math-char MathOrd `𝑦̄`
let-math \bar = math-char MathOrd `̄`
let-math \vec = math-char MathOrd `⃗`
let-math \nabla = math-char MathPrefix (single 0x2207)
let-math \nablavec = math-char MathPrefix `∇⃗`
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-math \Res = math-char MathPrefix `Res`
let-math \mg = math-char MathPrefix `mg`
let-math \product = math-big-char MathOp `∏`
let-math \overline m1 = ${#m1 \bar}
let-math \prods m1 m2 =
${\upper{\lower{\product}{#m1}}{#m2}}
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 \Delta = greek-uppercase 0x1D6E5 0x1D71F 0x0394 0x1D6AB
let-math \alpha = greek-lowercase 0x1D6FC 0x1D736
let-math \beta = greek-lowercase 0x1D6FD 0x1D737
let-math \gamma = greek-lowercase 0x1D6FE 0x1D738
let-math \delta = greek-lowercase 0x1D6FF 0x1D739
let-math \lambda= greek-lowercase 0x1D706 0x1D740
let-math \mu = greek-lowercase 0x1D707 0x1D741
let-math \nu = greek-lowercase 0x1D708 0x1D742
let-math \xi = greek-lowercase 0x1D709 0x1D743
let-math \omicron=greek-lowercase 0x1D70A 0x1D744
let-math \pi = greek-lowercase 0x1D70B 0x1D745
let-math \rho = greek-lowercase 0x1D70C 0x1D746
let-math \sigma2= greek-lowercase 0x1D70D 0x1D747
let-math \sigma = greek-lowercase 0x1D70E 0x1D748
let-math \tau = greek-lowercase 0x1D70F 0x1D749
let-math \upsilon=greek-lowercase 0x1D710 0x1D74A
let-math \phi = greek-lowercase 0x1D711 0x1D74B
let-math \chi = greek-lowercase 0x1D712 0x1D74C
let-math \psi = greek-lowercase 0x1D713 0x1D74D
let-math \omega = greek-lowercase 0x1D714 0x1D74E
let-math \P m1 =
${\app{P}{#m1}}
let-math \condP m1 m2 =
${\P{#m1 \| #m2}}
let-math \limto m1 m2 =
${\lower{\lim}{#m1 \to #m2}}
% 「定義する能力はありますが,伸縮する括弧の定義の説明は正直なところ大変なので少々お待ちください」
% https://twitter.com/bd_gfngfn/status/962499833813647360
% と言われたので、とりあえず仮定義
let-math \boundary m a b =
${#m \|_{#a}^{#b}}
let-math \abs m =
${\| #m \|}