dsh-zju-lecture-note 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +8 -7
- package/docs/technical.md +26 -4
- package/mcp_server.py +1 -1
- package/package.json +1 -1
- package/skills/scholia-notes/SKILL.md +8 -1
- package/skills/scholia-notes/references/format-spec.md +57 -6
- package/skills/scholia-notes/references/prelude.typ +42 -0
- package/skills/scholia-notes/references/typography-spec.md +4 -4
- package/skills/scholia-notes.manifest.json +9 -9
- package/skills/zju-lecture-summarizer/SKILL.md +13 -1
- package/skills/zju-lecture-summarizer.manifest.json +4 -4
- package/zju_lecture/client.py +741 -741
- package/zju_lecture/handout.py +353 -57
- package/zju_lecture/handout_prelude.typ +35 -2
- package/zju_lecture/prelude.typ +42 -0
- package/zju_lecture/study_notes.py +296 -1
- package/zju_lecture/typst-packages/VENDORED.md +1 -1
- package/zju_lecture/typst-packages/preview/noteworthy/0.4.0/LICENSE +20 -20
- package/zju_lecture/typst-packages/preview/noteworthy/0.4.0/lib.typ +128 -128
- package/zju_lecture/typst-packages/preview/noteworthy/0.4.0/typst.toml +15 -15
- package/zju_lecture/typst-packages/preview/scholia/0.1.0/src/lib.typ +2 -2
- package/zju_lecture/typst-packages/preview/showybox/2.0.4/LICENSE +21 -21
- package/zju_lecture/typst-packages/preview/showybox/2.0.4/lib/func.typ +142 -142
- package/zju_lecture/typst-packages/preview/showybox/2.0.4/lib/id.typ +11 -11
- package/zju_lecture/typst-packages/preview/showybox/2.0.4/lib/pre-rendering.typ +50 -50
- package/zju_lecture/typst-packages/preview/showybox/2.0.4/lib/sections.typ +141 -141
- package/zju_lecture/typst-packages/preview/showybox/2.0.4/lib/shadows.typ +118 -118
- package/zju_lecture/typst-packages/preview/showybox/2.0.4/showy.typ +267 -267
- package/zju_lecture/typst-packages/preview/showybox/2.0.4/typst.toml +11 -11
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ShowyBox - A package for Typst
|
|
3
|
-
* Pablo González Calderón and Showybox Contributors (c) 2023
|
|
4
|
-
*
|
|
5
|
-
* lib/sections.typ -- The package's file containing all the
|
|
6
|
-
* internal functions for drawing sections.
|
|
7
|
-
*
|
|
8
|
-
* This file is under the MIT license. For more
|
|
9
|
-
* information see LICENSE on the package's main folder.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
#import "func.typ": *
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
* Function: showy-get-title-props()
|
|
16
|
-
*
|
|
17
|
-
* Description: Returns the title's properties
|
|
18
|
-
*
|
|
19
|
-
* Parameters:
|
|
20
|
-
* + sbox-props: Showybox properties
|
|
21
|
-
*/
|
|
22
|
-
#let showy-get-title-props(sbox-props) = {
|
|
23
|
-
/*
|
|
24
|
-
* Properties independent of `boxed`
|
|
25
|
-
*/
|
|
26
|
-
let props = (
|
|
27
|
-
spacing: 0pt,
|
|
28
|
-
fill: sbox-props.frame.title-color,
|
|
29
|
-
inset: showy-section-inset("title", sbox-props.frame)
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
/*
|
|
33
|
-
* Properties dependent of `boxed`
|
|
34
|
-
*/
|
|
35
|
-
if sbox-props.title-style.boxed-style != none {
|
|
36
|
-
props = props + (
|
|
37
|
-
width: auto,
|
|
38
|
-
radius: sbox-props.title-style.boxed-style.radius,
|
|
39
|
-
stroke: showy-stroke(sbox-props.frame),
|
|
40
|
-
)
|
|
41
|
-
} else {
|
|
42
|
-
props = props + (
|
|
43
|
-
width: 100%,
|
|
44
|
-
radius: (
|
|
45
|
-
top-left: showy-value-in-direction("top-left", sbox-props.frame.radius, 5pt),
|
|
46
|
-
top-right: showy-value-in-direction("top-right", sbox-props.frame.radius, 5pt),
|
|
47
|
-
bottom: 0pt
|
|
48
|
-
),
|
|
49
|
-
stroke: showy-stroke(sbox-props.frame, bottom: sbox-props.title-style.sep-thickness)
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
return props
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/*
|
|
56
|
-
* Function: showy-title()
|
|
57
|
-
*
|
|
58
|
-
* Description: Returns the title's block
|
|
59
|
-
*
|
|
60
|
-
* Parameters:
|
|
61
|
-
* + sbox-props: Showybox properties
|
|
62
|
-
*/
|
|
63
|
-
#let showy-title(sbox-props) = block(
|
|
64
|
-
..showy-get-title-props(sbox-props),
|
|
65
|
-
align(
|
|
66
|
-
sbox-props.title-style.align,
|
|
67
|
-
text(
|
|
68
|
-
sbox-props.title-style.color,
|
|
69
|
-
weight: sbox-props.title-style.weight,
|
|
70
|
-
sbox-props.title
|
|
71
|
-
)
|
|
72
|
-
)
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
/*
|
|
76
|
-
* Function: showy-body()
|
|
77
|
-
*
|
|
78
|
-
* Description: Returns the body's block
|
|
79
|
-
*
|
|
80
|
-
* Parameters:
|
|
81
|
-
* + sbox-props: Showybox properties
|
|
82
|
-
* + body: Body content
|
|
83
|
-
*/
|
|
84
|
-
#let showy-body(sbox-props, ..body) = block(
|
|
85
|
-
width: 100%,
|
|
86
|
-
spacing: 0pt,
|
|
87
|
-
breakable: sbox-props.breakable,
|
|
88
|
-
inset: showy-section-inset("body", sbox-props.frame),
|
|
89
|
-
align(
|
|
90
|
-
sbox-props.body-style.align,
|
|
91
|
-
text(
|
|
92
|
-
sbox-props.body-style.color,
|
|
93
|
-
body.pos()
|
|
94
|
-
.map(block.with(spacing:0pt, width: 100%, breakable: sbox-props.breakable))
|
|
95
|
-
.join(
|
|
96
|
-
block(
|
|
97
|
-
spacing: sbox-props.sep.gutter,
|
|
98
|
-
align(
|
|
99
|
-
left, // Avoid alignment errors
|
|
100
|
-
showy-line(sbox-props.frame)(
|
|
101
|
-
stroke: (
|
|
102
|
-
paint: sbox-props.frame.border-color,
|
|
103
|
-
dash: sbox-props.sep.dash,
|
|
104
|
-
thickness: sbox-props.sep.thickness
|
|
105
|
-
)
|
|
106
|
-
)
|
|
107
|
-
)
|
|
108
|
-
)
|
|
109
|
-
)
|
|
110
|
-
)
|
|
111
|
-
)
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
/*
|
|
115
|
-
* Function: showy-footer()
|
|
116
|
-
*
|
|
117
|
-
* Description: Returns the footer's block
|
|
118
|
-
*
|
|
119
|
-
* Parameters:
|
|
120
|
-
* + sbox-props: Showybox properties
|
|
121
|
-
* + body: Body content
|
|
122
|
-
*/
|
|
123
|
-
#let showy-footer(sbox-props, footer) = block(
|
|
124
|
-
width: 100%,
|
|
125
|
-
spacing: 0pt,
|
|
126
|
-
inset: showy-section-inset("footer", sbox-props.frame),
|
|
127
|
-
fill: sbox-props.frame.footer-color,
|
|
128
|
-
stroke: showy-stroke(sbox-props.frame, top: sbox-props.footer-style.sep-thickness),
|
|
129
|
-
radius: (
|
|
130
|
-
bottom-left: showy-value-in-direction("bottom-left", sbox-props.frame.radius, 5pt),
|
|
131
|
-
bottom-right: showy-value-in-direction("bottom-right", sbox-props.frame.radius, 5pt),
|
|
132
|
-
top: 0pt
|
|
133
|
-
),
|
|
134
|
-
align(
|
|
135
|
-
sbox-props.footer-style.align,
|
|
136
|
-
text(
|
|
137
|
-
sbox-props.footer-style.color,
|
|
138
|
-
weight: sbox-props.footer-style.weight,
|
|
139
|
-
footer
|
|
140
|
-
)
|
|
141
|
-
)
|
|
1
|
+
/*
|
|
2
|
+
* ShowyBox - A package for Typst
|
|
3
|
+
* Pablo González Calderón and Showybox Contributors (c) 2023
|
|
4
|
+
*
|
|
5
|
+
* lib/sections.typ -- The package's file containing all the
|
|
6
|
+
* internal functions for drawing sections.
|
|
7
|
+
*
|
|
8
|
+
* This file is under the MIT license. For more
|
|
9
|
+
* information see LICENSE on the package's main folder.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#import "func.typ": *
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Function: showy-get-title-props()
|
|
16
|
+
*
|
|
17
|
+
* Description: Returns the title's properties
|
|
18
|
+
*
|
|
19
|
+
* Parameters:
|
|
20
|
+
* + sbox-props: Showybox properties
|
|
21
|
+
*/
|
|
22
|
+
#let showy-get-title-props(sbox-props) = {
|
|
23
|
+
/*
|
|
24
|
+
* Properties independent of `boxed`
|
|
25
|
+
*/
|
|
26
|
+
let props = (
|
|
27
|
+
spacing: 0pt,
|
|
28
|
+
fill: sbox-props.frame.title-color,
|
|
29
|
+
inset: showy-section-inset("title", sbox-props.frame)
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* Properties dependent of `boxed`
|
|
34
|
+
*/
|
|
35
|
+
if sbox-props.title-style.boxed-style != none {
|
|
36
|
+
props = props + (
|
|
37
|
+
width: auto,
|
|
38
|
+
radius: sbox-props.title-style.boxed-style.radius,
|
|
39
|
+
stroke: showy-stroke(sbox-props.frame),
|
|
40
|
+
)
|
|
41
|
+
} else {
|
|
42
|
+
props = props + (
|
|
43
|
+
width: 100%,
|
|
44
|
+
radius: (
|
|
45
|
+
top-left: showy-value-in-direction("top-left", sbox-props.frame.radius, 5pt),
|
|
46
|
+
top-right: showy-value-in-direction("top-right", sbox-props.frame.radius, 5pt),
|
|
47
|
+
bottom: 0pt
|
|
48
|
+
),
|
|
49
|
+
stroke: showy-stroke(sbox-props.frame, bottom: sbox-props.title-style.sep-thickness)
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
return props
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
* Function: showy-title()
|
|
57
|
+
*
|
|
58
|
+
* Description: Returns the title's block
|
|
59
|
+
*
|
|
60
|
+
* Parameters:
|
|
61
|
+
* + sbox-props: Showybox properties
|
|
62
|
+
*/
|
|
63
|
+
#let showy-title(sbox-props) = block(
|
|
64
|
+
..showy-get-title-props(sbox-props),
|
|
65
|
+
align(
|
|
66
|
+
sbox-props.title-style.align,
|
|
67
|
+
text(
|
|
68
|
+
sbox-props.title-style.color,
|
|
69
|
+
weight: sbox-props.title-style.weight,
|
|
70
|
+
sbox-props.title
|
|
71
|
+
)
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* Function: showy-body()
|
|
77
|
+
*
|
|
78
|
+
* Description: Returns the body's block
|
|
79
|
+
*
|
|
80
|
+
* Parameters:
|
|
81
|
+
* + sbox-props: Showybox properties
|
|
82
|
+
* + body: Body content
|
|
83
|
+
*/
|
|
84
|
+
#let showy-body(sbox-props, ..body) = block(
|
|
85
|
+
width: 100%,
|
|
86
|
+
spacing: 0pt,
|
|
87
|
+
breakable: sbox-props.breakable,
|
|
88
|
+
inset: showy-section-inset("body", sbox-props.frame),
|
|
89
|
+
align(
|
|
90
|
+
sbox-props.body-style.align,
|
|
91
|
+
text(
|
|
92
|
+
sbox-props.body-style.color,
|
|
93
|
+
body.pos()
|
|
94
|
+
.map(block.with(spacing:0pt, width: 100%, breakable: sbox-props.breakable))
|
|
95
|
+
.join(
|
|
96
|
+
block(
|
|
97
|
+
spacing: sbox-props.sep.gutter,
|
|
98
|
+
align(
|
|
99
|
+
left, // Avoid alignment errors
|
|
100
|
+
showy-line(sbox-props.frame)(
|
|
101
|
+
stroke: (
|
|
102
|
+
paint: sbox-props.frame.border-color,
|
|
103
|
+
dash: sbox-props.sep.dash,
|
|
104
|
+
thickness: sbox-props.sep.thickness
|
|
105
|
+
)
|
|
106
|
+
)
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Function: showy-footer()
|
|
116
|
+
*
|
|
117
|
+
* Description: Returns the footer's block
|
|
118
|
+
*
|
|
119
|
+
* Parameters:
|
|
120
|
+
* + sbox-props: Showybox properties
|
|
121
|
+
* + body: Body content
|
|
122
|
+
*/
|
|
123
|
+
#let showy-footer(sbox-props, footer) = block(
|
|
124
|
+
width: 100%,
|
|
125
|
+
spacing: 0pt,
|
|
126
|
+
inset: showy-section-inset("footer", sbox-props.frame),
|
|
127
|
+
fill: sbox-props.frame.footer-color,
|
|
128
|
+
stroke: showy-stroke(sbox-props.frame, top: sbox-props.footer-style.sep-thickness),
|
|
129
|
+
radius: (
|
|
130
|
+
bottom-left: showy-value-in-direction("bottom-left", sbox-props.frame.radius, 5pt),
|
|
131
|
+
bottom-right: showy-value-in-direction("bottom-right", sbox-props.frame.radius, 5pt),
|
|
132
|
+
top: 0pt
|
|
133
|
+
),
|
|
134
|
+
align(
|
|
135
|
+
sbox-props.footer-style.align,
|
|
136
|
+
text(
|
|
137
|
+
sbox-props.footer-style.color,
|
|
138
|
+
weight: sbox-props.footer-style.weight,
|
|
139
|
+
footer
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
142
|
)
|
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* ShowyBox - A package for Typst
|
|
3
|
-
* Pablo González Calderón and Showybox Contributors (c) 2023-2024
|
|
4
|
-
*
|
|
5
|
-
* lib/shadows.typ -- The package's file containing all the
|
|
6
|
-
* internal functions for drawing shadows.
|
|
7
|
-
*
|
|
8
|
-
* This file is under the MIT license. For more
|
|
9
|
-
* information see LICENSE on the package's main folder.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
#import "func.typ": *
|
|
13
|
-
#import "id.typ": *
|
|
14
|
-
#import "sections.typ": *
|
|
15
|
-
|
|
16
|
-
/*
|
|
17
|
-
* Function: showy-shadow()
|
|
18
|
-
*
|
|
19
|
-
* Description: Draws the showybox main shadow
|
|
20
|
-
* (excludes boxed title shadows).
|
|
21
|
-
*
|
|
22
|
-
* Parameters:
|
|
23
|
-
* + sbox-props: Showybox properties
|
|
24
|
-
* + sbox: Pre-rendered showybox
|
|
25
|
-
*/
|
|
26
|
-
#let showy-shadow(sbox-props, sbox, id) = context {
|
|
27
|
-
if sbox-props.shadow == none {
|
|
28
|
-
return sbox
|
|
29
|
-
}
|
|
30
|
-
let my-state = state("showybox-" + id, 0pt)
|
|
31
|
-
|
|
32
|
-
/* If it has a boxed sbox-props.title, leave some space
|
|
33
|
-
* to avoid collisions with other elements next to the
|
|
34
|
-
* showybox */
|
|
35
|
-
if sbox-props.title != "" and sbox-props.title-style.boxed-style != none {
|
|
36
|
-
if sbox-props.title-style.boxed-style.anchor.y == bottom {
|
|
37
|
-
v(my-state.at(here()))
|
|
38
|
-
} else if sbox-props.title-style.boxed-style.anchor.y == horizon{
|
|
39
|
-
v(my-state.at(here())/2)
|
|
40
|
-
} // Otherwise, no space is needed
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
block(
|
|
45
|
-
breakable: sbox-props.breakable,
|
|
46
|
-
radius: sbox-props.frame.radius,
|
|
47
|
-
fill: sbox-props.shadow.color,
|
|
48
|
-
width: sbox-props.width,
|
|
49
|
-
spacing: 0pt,
|
|
50
|
-
outset: (
|
|
51
|
-
left: -sbox-props.shadow.offset.x,
|
|
52
|
-
right: sbox-props.shadow.offset.x,
|
|
53
|
-
bottom: sbox-props.shadow.offset.y,
|
|
54
|
-
top: -sbox-props.shadow.offset.y
|
|
55
|
-
),
|
|
56
|
-
/* If it have a boxed title, substract some space to
|
|
57
|
-
avoid the shadow to be body + title height, and only
|
|
58
|
-
body height */
|
|
59
|
-
if sbox-props.title != "" and sbox-props.title-style.boxed-style != none {
|
|
60
|
-
if sbox-props.title-style.boxed-style.anchor.y == bottom {
|
|
61
|
-
v(-my-state.at(here()))
|
|
62
|
-
} else if sbox-props.title-style.boxed-style.anchor.y == horizon {
|
|
63
|
-
v(-my-state.at(here())/2)
|
|
64
|
-
} // Otherwise do nothing
|
|
65
|
-
|
|
66
|
-
sbox
|
|
67
|
-
} else {
|
|
68
|
-
sbox
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/*
|
|
74
|
-
* Function: showy-boxed-title-shadow()
|
|
75
|
-
*
|
|
76
|
-
* Description: Draws the showybox's boxed title shadow
|
|
77
|
-
*
|
|
78
|
-
* Parameters:
|
|
79
|
-
* + sbox-props: Showybox properties
|
|
80
|
-
* + tbox: Pre-rendered boxed-title
|
|
81
|
-
*/
|
|
82
|
-
#let showy-boxed-title-shadow(sbox-props, id) = context {
|
|
83
|
-
if sbox-props.shadow == none {
|
|
84
|
-
return
|
|
85
|
-
} else if sbox-props.title == "" or sbox-props.title-style.boxed-style == none {
|
|
86
|
-
return
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
let my-state = state("showybox-" + id, 0pt)
|
|
90
|
-
|
|
91
|
-
return place(
|
|
92
|
-
top + sbox-props.title-style.boxed-style.anchor.x,
|
|
93
|
-
dx: sbox-props.title-style.boxed-style.offset.x,
|
|
94
|
-
dy: sbox-props.title-style.boxed-style.offset.y + if sbox-props.title-style.boxed-style.anchor.y == bottom {
|
|
95
|
-
-my-state.final()
|
|
96
|
-
} else if sbox-props.title-style.boxed-style.anchor.y == horizon {
|
|
97
|
-
-my-state.final()/2
|
|
98
|
-
},
|
|
99
|
-
block(
|
|
100
|
-
spacing: 0pt,
|
|
101
|
-
inset: (x: 1em),
|
|
102
|
-
block(
|
|
103
|
-
breakable: sbox-props.breakable,
|
|
104
|
-
radius: sbox-props.title-style.boxed-style.radius,
|
|
105
|
-
fill: sbox-props.shadow.color,
|
|
106
|
-
spacing: 0pt,
|
|
107
|
-
outset: (
|
|
108
|
-
left: -sbox-props.shadow.offset.x,
|
|
109
|
-
right: sbox-props.shadow.offset.x,
|
|
110
|
-
top: -sbox-props.shadow.offset.y,
|
|
111
|
-
bottom: sbox-props.shadow.offset.y
|
|
112
|
-
),
|
|
113
|
-
hide(showy-title(sbox-props))
|
|
114
|
-
)
|
|
115
|
-
)
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
|
|
1
|
+
/*
|
|
2
|
+
* ShowyBox - A package for Typst
|
|
3
|
+
* Pablo González Calderón and Showybox Contributors (c) 2023-2024
|
|
4
|
+
*
|
|
5
|
+
* lib/shadows.typ -- The package's file containing all the
|
|
6
|
+
* internal functions for drawing shadows.
|
|
7
|
+
*
|
|
8
|
+
* This file is under the MIT license. For more
|
|
9
|
+
* information see LICENSE on the package's main folder.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#import "func.typ": *
|
|
13
|
+
#import "id.typ": *
|
|
14
|
+
#import "sections.typ": *
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* Function: showy-shadow()
|
|
18
|
+
*
|
|
19
|
+
* Description: Draws the showybox main shadow
|
|
20
|
+
* (excludes boxed title shadows).
|
|
21
|
+
*
|
|
22
|
+
* Parameters:
|
|
23
|
+
* + sbox-props: Showybox properties
|
|
24
|
+
* + sbox: Pre-rendered showybox
|
|
25
|
+
*/
|
|
26
|
+
#let showy-shadow(sbox-props, sbox, id) = context {
|
|
27
|
+
if sbox-props.shadow == none {
|
|
28
|
+
return sbox
|
|
29
|
+
}
|
|
30
|
+
let my-state = state("showybox-" + id, 0pt)
|
|
31
|
+
|
|
32
|
+
/* If it has a boxed sbox-props.title, leave some space
|
|
33
|
+
* to avoid collisions with other elements next to the
|
|
34
|
+
* showybox */
|
|
35
|
+
if sbox-props.title != "" and sbox-props.title-style.boxed-style != none {
|
|
36
|
+
if sbox-props.title-style.boxed-style.anchor.y == bottom {
|
|
37
|
+
v(my-state.at(here()))
|
|
38
|
+
} else if sbox-props.title-style.boxed-style.anchor.y == horizon{
|
|
39
|
+
v(my-state.at(here())/2)
|
|
40
|
+
} // Otherwise, no space is needed
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
block(
|
|
45
|
+
breakable: sbox-props.breakable,
|
|
46
|
+
radius: sbox-props.frame.radius,
|
|
47
|
+
fill: sbox-props.shadow.color,
|
|
48
|
+
width: sbox-props.width,
|
|
49
|
+
spacing: 0pt,
|
|
50
|
+
outset: (
|
|
51
|
+
left: -sbox-props.shadow.offset.x,
|
|
52
|
+
right: sbox-props.shadow.offset.x,
|
|
53
|
+
bottom: sbox-props.shadow.offset.y,
|
|
54
|
+
top: -sbox-props.shadow.offset.y
|
|
55
|
+
),
|
|
56
|
+
/* If it have a boxed title, substract some space to
|
|
57
|
+
avoid the shadow to be body + title height, and only
|
|
58
|
+
body height */
|
|
59
|
+
if sbox-props.title != "" and sbox-props.title-style.boxed-style != none {
|
|
60
|
+
if sbox-props.title-style.boxed-style.anchor.y == bottom {
|
|
61
|
+
v(-my-state.at(here()))
|
|
62
|
+
} else if sbox-props.title-style.boxed-style.anchor.y == horizon {
|
|
63
|
+
v(-my-state.at(here())/2)
|
|
64
|
+
} // Otherwise do nothing
|
|
65
|
+
|
|
66
|
+
sbox
|
|
67
|
+
} else {
|
|
68
|
+
sbox
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* Function: showy-boxed-title-shadow()
|
|
75
|
+
*
|
|
76
|
+
* Description: Draws the showybox's boxed title shadow
|
|
77
|
+
*
|
|
78
|
+
* Parameters:
|
|
79
|
+
* + sbox-props: Showybox properties
|
|
80
|
+
* + tbox: Pre-rendered boxed-title
|
|
81
|
+
*/
|
|
82
|
+
#let showy-boxed-title-shadow(sbox-props, id) = context {
|
|
83
|
+
if sbox-props.shadow == none {
|
|
84
|
+
return
|
|
85
|
+
} else if sbox-props.title == "" or sbox-props.title-style.boxed-style == none {
|
|
86
|
+
return
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let my-state = state("showybox-" + id, 0pt)
|
|
90
|
+
|
|
91
|
+
return place(
|
|
92
|
+
top + sbox-props.title-style.boxed-style.anchor.x,
|
|
93
|
+
dx: sbox-props.title-style.boxed-style.offset.x,
|
|
94
|
+
dy: sbox-props.title-style.boxed-style.offset.y + if sbox-props.title-style.boxed-style.anchor.y == bottom {
|
|
95
|
+
-my-state.final()
|
|
96
|
+
} else if sbox-props.title-style.boxed-style.anchor.y == horizon {
|
|
97
|
+
-my-state.final()/2
|
|
98
|
+
},
|
|
99
|
+
block(
|
|
100
|
+
spacing: 0pt,
|
|
101
|
+
inset: (x: 1em),
|
|
102
|
+
block(
|
|
103
|
+
breakable: sbox-props.breakable,
|
|
104
|
+
radius: sbox-props.title-style.boxed-style.radius,
|
|
105
|
+
fill: sbox-props.shadow.color,
|
|
106
|
+
spacing: 0pt,
|
|
107
|
+
outset: (
|
|
108
|
+
left: -sbox-props.shadow.offset.x,
|
|
109
|
+
right: sbox-props.shadow.offset.x,
|
|
110
|
+
top: -sbox-props.shadow.offset.y,
|
|
111
|
+
bottom: sbox-props.shadow.offset.y
|
|
112
|
+
),
|
|
113
|
+
hide(showy-title(sbox-props))
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|