How to align bibliography numbers to the right?

Any idea how to align bibliography number into right?
align left will leave too many space, and looks informal.

image

There are no show rules for the bibliography entries available yet. You can however apply a show rule to the grid that is used internally by the bibliography. The show rule below targets the first column in the grid which holds the numbers of the citations.

#show bibliography: it => {
  show grid.cell.where(x: 0): it => align(right, it)
  it
}
4 Likes

You are really a genius. This issue stuck me for a longtime. You script solve my problem.

Hi @kongdd, welcome and thank you for your question! I have changed your post’s title to bring it in line with the question guidelines and thus make it easier to understand from the title:

Good titles are questions you would ask your friend about Typst.

I also moved it to Questions and added the literature tag, as it makes your question easier to find.

Finally, if you feel the response you got has sufficiently answered your question, be sure to give it a checkmark :ballot_box_with_check:. This will help others find the solution in the future. Thanks!

I have done it for you :smile:

whoops, I guess I forgot to save :P