when i want to make a heading style like
the section number lies in a little rect box ahead of a bordered box with the section name in another rect, and the little section number shadows the border line of the big one, i made it like this
#show heading.where(level: 2): t => context {
align(
center,
stack(
dir: btt,
spacing: -0.5em,
rect(width: 100%, fill: white, stroke: blue, inset: 1em)[
#set text(
fill: blue.transparentize(30%),
)
#t.body
],
rect(fill: white, stroke: none, outset: 0pt)[
#set text(
fill: blue,
)
#math.section #counter(heading).display("1.1")
],
),
)
}
intuitively, i hope i can order it from top to bottom, but hope the z-axis to be from top to bottom, since i expect the white little rect should cover the big one on the border, but no. so i turn to the bottom to top one.
so, i hope there be z-axis arguments to customize the layers’ order for stack func ![]()
and btw, hoping the spacing function can be passed with an array, so that it could be more flexible to order the space between any to ajacent items
