I am using typst to render some stuff, I want a side by side display of 2 images I gured out how to get things vertically:
#figure(
(image("eulerian.svg", width: 10%),
image("lagrangian.svg", width: 10%)).join(),
caption: [A curious figure.],
) <glacier>
I am wondering how to get things horizontally now.

@honkbug gives a good example but without an explanation of the solution. Thus, I want to show the document and what happens with different parameters.
1. Using
gridTypst has a function
grid, which allows us to arrange contents. And this is the function we can use to place subfigures.The most important parameter of
gridiscolumnshere:When we give only one integer number,
gridwill create auto-sized columns and place contents automatically. Say we have two images and want to put them side by side; we can achieve this in this simple way:And we get this as a result:
We tell Typst we need two auto-sized columns with 2mm between them. But what if we provide more than two images? Let's test with 3:
columnsto3, they will be in the same row.2. Using
stackWe can also use
stackto achieve the goal:Here we place the images in a horizontal stack with the direction `left-to-right.
In this way, there is no
columnsto limit the number of pictures but we can only have one row. Thus, if we place too many images, they might be outside of the page.