Flavio
March 1, 2025, 8:15pm
1
Hi, I’m facing an issue that I can’t solve myself.
In my templates, small part outlines was styled as follow:
set text(size: textSize, fill: textColor, weight: textWeight)
box(width: 1.1cm, inset: (y: insetSize), align(left, number))
h(0.1cm)
box(inset: (y: insetSize), width: 100% - 1.2cm, )[
#link(location, title)
#box(width: 1fr, repeat(text(weight: "regular")[. #h(4pt)]))
#link(location, heading_page)
]
This code was working until Typst 0.12.0, but with Typst 0.13.0 I’m facing an unwanted align when the text is too long to fit in one line.
This was the same result with Typst 0.12.0
This is the minimum reproducible example.
https://typst.app/project/rji1x14t2hEFf5ZS7ZwhFp
Do you have any idea? Thanks a lot.
Hi, could you provide a minimal reproducible example?
Flavio
March 2, 2025, 12:25pm
3
Hi, this is the example, thanks: Typst
Eric
March 2, 2025, 2:29pm
4
You have your whole outline wrapped in an align(bottom + right, ..)
block. The alignment of the outline then propagates to the outline entries, thus the individual lines of the title are also right-aligned. You can fix this by overriding the alignment inside the box containing the title, similar to how you did it for the number:
#let my-outline-row(..) = {
set text(size: textSize, fill: textColor, weight: textWeight)
box(width: 1.1cm, inset: (y: insetSize), align(left, number))
h(0.1cm)
box(inset: (y: insetSize), width: 100% - 1.2cm, )[
#set align(left) // <-- Add this line
#link(location, title)
#box(width: 1fr, repeat(text(weight: "regular")[. #h(4pt)]))
#link(location, heading_page)
]
}
Flavio
March 3, 2025, 8:13am
5
Thanks a lot. I don’t understand why the behavior changed with 0.13.0. Maybe it was a bug of the previous versions…
PgBiel
March 3, 2025, 3:32pm
6
Hey @Flavio , glad you’ve solved your problem. I’ve marked @Eric ’s response as a solution. Please let us know if this was a mistake.
In addition, I’ve renamed your post so it is a question per our guidelines: How to post in the Questions category
Hope you have a great time at the forum!