I have this bit of code for displaying multiple images in a figure :
#let img_dir = "../imgs/"
#let figure_two_images(path1, path2, caption) = figure(
grid(
columns: 2, gutter: 2mm,
image(img_dir + path1),
image(img_dir + path2),
),
caption: caption
)
Would it be possible to extend this to an array with an arbitrary number of paths ? Equivalent to
#grid(
columns: 2, gutter: 2mm,
image(img_dir + path1),
image(img_dir + path2),
image(img_dir + path3),
etc.
)
My try was the following:
#let paths = (
"path/to/img/1.png",
"path/to/img/2.png"
)
#grid(
columns: 2,
for path in paths {
image(img_dir + path, width:30%)
}
)
but the loop returns content, displaying it in a single column.