How to add content overlapping left margin?

You can use place to add content without affecting the layout of other content:

#let accent = context place(
  dx: -measure(sym.triangle.stroked.r).width - 0.5em,
  sym.triangle.stroked.r,
)
#accent #lorem(30)

(If using a fixed symbol like in this example, I would get rid of the context and measure and just tune the -0.5em to my liking.)

I think this works fine if you use place at the start of a paragraph. In the middle of a paragraph it would break the paragraph in two. In this case you’d have to take extra precautions as documented here (this will be in the documentation of the next release i.e. typst 0.12.0).

1 Like