Hi, I am trying to add some spacing around my figures. This seems to not be as simple as it ought to be. I have found this:
https://stackoverflow.com/questions/78622060/add-spacing-around-figure-in-typst
and from there have created the following:
#let figure_spacing = 6em
#show figure: it => {
if it.placement == none {
block(it, inset: (y: figure_spacing))
} else if it.placement == top {
place(
it.placement + center,
float: true,
block(it, below: figure_spacing)
)
} else if it.placement == bottom {
place(
it.placement + center,
float: true,
block(it, above: figure_spacing)
)
} else {
place(
it.placement,
float: true,
block(it)
)
}
}
6em spacing for testing purposes only.
For manual placement to top and bottom, this works great. However, for automatic placement (to top or bottom) this does not work. What do I have to put in the last else case to get proper spacing above the figure if its at the bottom, or below the figure if its at the top?