How to create an adaptive vertical line that dynamically spans the height of its containing box/block

You can use whatever, just need to weigh all pros and cons. I started with stack, because it looks like the perfect contender, and the default dir is already correct, but when I realized the alignment problem (and also the 100% x2), I switched to grid. And because of the stroke not being counted into any bounding box, you need to compensate for half of its thickness in place(). You can automate a lot of it, so you don’t have to manually calculate everything.

Also, a good tool for working with stroke is

#import "@preview/t4t:0.4.2": get
#get.stroke-dict(red + 5pt)

image

But since you’ve mentioned a native way, I didn’t use it.

1 Like