Hello all. My friend was trying to put together a resume using typst and was trying to put together a header with a personal logo, some contact info, and a summary side-by side (see examples in the messages below). My question is about why the stack function is causing this strange behavior and what the "right way" to do this sort of thing would be. How can I better understand how stack works?
#Confusion around stack and side-by-side placement
5 messages · Page 1 of 1 (latest)
Here's the copypasta'd version of his first attempt:
#columns(2)[
#align(
center,
stack(
dir: ltr,
image("im.svg", fit: "contain", height: 100pt),
align(
left + horizon,
stack(
spacing: 10pt,
text(size: 16.2pt)[*Johnathy Commonname*],
[*Website:* #link("https://johnathywebsite.xyz")],
[*Email:* johnathy\@email.xyz],
[*Phone/SMS:* (000) 000-0000],
),
),
),
)
#colbreak()
= Summary
The convex hull operation is simply the left adjoint functor to the inclusion functor from the category of convex subsets of a space and subset relations to the category of all subsets of the same space with subset relations
]
#lorem(200)
But this caused the contact info and summary to overlap.
Second, he changed the format to this:
#stack(
dir: ltr,
image("im.svg", fit: "contain", height: 100pt),
align(
left + horizon,
stack(
spacing: 12pt,
text(size: 16.2pt)[*Johnathy Commonname*],
[#link("https://johnathywebsite.xyz") #h(1em) johnathy\@email.xyz #h(1em) (000) 000-0000],
[The convex hull operation is simply the left adjoint functor to the inclusion functor from the category of convex subsets of a space and subset relations to the category of all subsets of the same space with subset relations.],
),
),
)
#lorem(200)
But this cause the summary to overflow into the margin.
Finally, he tried this:
#stack(
dir: ltr,
image("im.svg", fit: "contain", height: 100pt),
align(
left + horizon,
stack(
spacing: 12pt,
text(size: 16.2pt)[*Johnathy Commonname*],
[#link("https://johnathywebsite.xyz") #h(1em) johnathy\@email.xyz #h(1em) (000) 000-0000],
[The convex hull operation is simply the left adjoint functor to the inclusion functor from the category of convex subsets of a space and subset relations to the category of all subsets of the same space with subset relations.],
),
),
)
#lorem(200)
And that worked.
If grid does it ok but stack has problems, then this is maybe issue https://github.com/typst/typst/issues/2422
For now, I think it makes sense to always prefer grid?