-
Notifications
You must be signed in to change notification settings - Fork 0
/
test20-optional.saty
37 lines (34 loc) · 1.11 KB
/
test20-optional.saty
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
let-inline ctx \figure ?:labelopt caption inner =
let s-num = arabic 0 in
let () =
match labelopt with
| Some(label) -> register-cross-reference (label ^ `:num`) s-num
| None -> ()
in
let it-num = embed-string s-num in
let bb-inner =
let d (_, _) _ _ _ = [] in
block-frame-breakable ctx (2pt, 2pt, 2pt, 2pt) (d, d, d, d) (fun ctx -> (
read-block ctx inner
+++ line-break true true ctx (inline-fil ++ read-inline ctx {図#it-num; #caption;} ++ inline-fil)
))
in
inline-nil
let figure ctx ?:labelopt caption inner =
let s-num = arabic 0 in
let () =
match labelopt with
| Some(label) -> register-cross-reference (label ^ `:num`) s-num
| None -> ()
in
let it-num = embed-string s-num in
let bb-inner =
let d (_, _) _ _ _ = [] in
block-frame-breakable ctx (2pt, 2pt, 2pt, 2pt) (d, d, d, d) (fun ctx -> (
read-block ctx inner
+++ line-break true true ctx (inline-fil ++ read-inline ctx {図#it-num; #caption;} ++ inline-fil)
))
in
inline-nil
in
figure