To improve the layout of my document I want to increase the space between the last line of text and the beginning of an image or table. I tried adding padding to the figures, but I encountered some problems regarding the combination of the padding and referencing the figures:
Consider this example:
#outline(
title: [Images],
target: figure.where(kind: image),
),
#lorem(50) @myfigure #lorem(50)
#figure(
image("images/image.svg", alt: "this is an image", width: 75%),
caption: [this is an image],
)<myfigure>
#lorem(50)
As far as i know, there are different options to add padding to this figure:
-
#pad( y: 7.5pt, figure( image("images/image.svg", alt: "this is an image", width: 75%), caption: [this is an image], ), )
Using this option, there is no way to add the reference
<myfigure>
. It is not possible to add a reference to a padding (Error:cannot reference pad
) and it is not possible to add a reference to a figure inside of a padding (Error:expected comma
) -
#figure( pad( image("images/Bussysteme.svg", alt: "this is an image", width: 75%), y: 7.5pt, ), caption: [this is an image], )<myfigure>,
Now the reference works, but the padding is only around the image, not around the whole figure, including the caption. The caption still is to close to the text and further away from the image.
-
#figure( pad( image("images/image.svg", alt: "this is an image", width: 75%), top: 3pt, ), caption: pad([this is an image],bottom:3pt), )<myfigure>,
The padding works and the reference works as well, but the padding of the caption is now included in the outline and destroys the layout there.
Is there a different way to combine padding with references?