No line break after enum, text stays adjacent

When there is no line break and only text follows enum, I want the text to be placed right next to enum.

Example

#lorem(1)
+ #lorem(2) // no line break.
#lorem(1)

Expected

Please!! :slightly_frowning_face:

This requires indentation, as I believe that’s treated as a paragraph the way you have provided. To prevent this, you can use:

+ lorem
  ipsum

or

#enum[
  lorem
  ipsum
]
Output

enum-without-line-break

Indentation doesn’t matter for the latter.

There is no longer a line break, but instead a space.

See the PR Allow equation and tight lists/enums to be part of paragraphs by mkorje · Pull Request #7931 · typst/typst

Here is a temporary solution (not perfect):

  #show enum.where(tight: true): set block(spacing: 0.65em) // 0.65em is the default value of par.leading

  #lorem(1)
  + #lorem(2)  // no line break.
  + #lorem(2)  
  #lorem(1)

image

Or use the package parize.

  #import "@preview/parize:0.2.1" :*
  #show : par-indent.with(use-par-leading: true, include-elem: (list, enum, terms, math.equation))
  
  #lorem(1)
  + #lorem(2) // no line break.
  + #lorem(2) // no line break.
  #lorem(1)

  #lorem(1)
  + #lorem(2) // no line break.
  + #lorem(2) 
  
  #lorem(1)