typst: Paragraph justification sometimes doesn't use the full page width

Description

#set page(margin: (left: 3cm, right: 1cm))
#set text(14pt)
#set par(justify: true)

+ Методология и технология проектирования информационных систем: учебное пособие
  \/ Ю. М. Казаков, А. А. Тищенко, А. А. Кузьменко [и др.]. --- Москва: ФЛИНТА,
  \2018. --- 136 с. --- ISBN 978-5-9765-4013-2. --- Текст: электронный \//
  Электронно-библиотечная система «Лань»: [сайт]. --- URL:
  https://e.lanbook.com/book/113460
+ Ипатова, Э. Р. Методологии и технологии системного проектирования информационных
  систем: учебное пособие / Э. Р. Ипатова. --- 2-е изд., стер. --- Москва: ФЛИНТА,
  \2016. --- 256 с. --- ISBN 978-5-89349-978-0. --- Текст: электронный \//
  Электронно-библиотечная система «Лань»: [сайт]. --- URL:
  https://e.lanbook.com/book/84356
// + #lorem(24)

#v(0cm)

+ https://geekbrains.ru/posts/development_methodology_msf --- Методология MSF
+ http://www.informicus.ru/default.aspx?SECTION=6&id=73&subdivisionid=7 --- Методология
  RUP

image

As soon as I insert + #lorem(24) in the first list, they both become full-width:

image

I cannot explain why would this ever happen. I never noticed this before, but apparently this behavior is the same for previous versions too. I guess I rarely have 2 lists on the same page.

By definition, the justification stretches the content to the full-width of the page. My only hunch is something to do with non-Latin/Unicode stuff.

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 18 (12 by maintainers)

Most upvoted comments

For a grid specifically, it’s best to not create a box or block at all and instead use grid.cell:

#grid(
  columns: (35%, auto),
  column-gutter: 5pt,
  [left side],
  grid.cell(stroke: (right: black))[some text here"],
)

I’m pretty sure the space there doesn’t make much of a difference since what comes after it is also a space, but, if it’s really necessary, you can write #[https://...]#h(1fr).

In principle they are just auto columns, separate lists are separate grids so they aren’t in the same column. The underlying problem has the same cause as the centering equations in lists issue (#529).

However, what isn’t clear is why justification isn’t requesting the full width. Usually, the text would cause the list to resize to full width due to being too long.

In either case, the fix would be similar as the other issue. You can try to add #h(1fr) at the end of a line in the smaller list (or in both).