How to upgrade an in-list `show par: set align(start)` to typst 0.13?

图片

I want to move a small list to the center, but keep its items next to their bullet points, as shown in the above image.

In typst 0.12.0, the following works.

#[
  #show list: set align(center)
  #show par: set align(start)

  - #lorem(5)
  - #lorem(2)
]

#lorem(20)

However in typst 0.13.0/0.13.1, show par: set align(start) makes no difference:

图片

Typst v0.13.0 introduced the distinction between proper paragraphs and just inline-level content. I guess that’s the cause.

Therefore, I try to replace par with list.item, but it also moves the bullet points, which is not desired either:

图片

Then how to restore the original layout in typst 0.13?
Explanation and partial solutions are also welcome. Thanks in advance!

Hi @Y.D.X,

this behavior is a bug #3605, a workaround was mentioned in #3815.

#[
  #show list: it => align(center, block(align(start, it)))

  - #lorem(5)
  - #lorem(2)
]

Thank you!
It’s weird that the issue was created before typst v0.13.

I’m not sure if I’d call it a bug, it has always behaved this way. It’s more of an undesirable behavior at times.

It’s also worth noting that you were using a similar trick but using par inside each item’s body (not the items themselves) instead of block, basically. That’s why it doesn’t work now (the list item bodies no longer are paragraphs unless you add parbreaks), and also why show list.item is undesirable as it applies to each bullet point + body.