#How to give raw (code) a rounded gray background?

6 messages · Page 1 of 1 (latest)

candid wolf
#

Currently I've tried this but clearly the hacky inset+move is adding vertical spacing unintentionally.

#

?r

#show raw: it => box(
  move(dy: 2pt,
    box(
      fill: luma(27.5%),
      inset: 2pt,
      radius: 2pt,
      it
    )
  )
)
#lorem(35) `test_code` #lorem(19)
quiet parrot
#

you can use outset for the y-direction and inset for x:

box(inset: (x: 2pt), outset: (y: 2pt), ..)
candid wolf
#

oh ok, ill give it a try

#

Ok it works! thank you