How to set raw inline box without slight offset at the bottom?

I am tyring to add a box to raw text and I get a slight offset at the bottom of the text. Here is an example:

#show raw.where(block: false): box.with(fill: luma(240), inset: 3pt, radius: 4pt)

This is `raw` text.

Output:

image

I feel this is because of the inset, and if I use outset, it works but the space before and after the raw text is gone.

How should I make this inline and align with other texts?

Use dictionary for inset/outset. See box.outset example.

#show raw.where(block: false): box.with(
  fill: luma(240),
  inset: (x: 3pt),
  outset: (y: 3pt),
  radius: 4pt,
)

This is `raw` text.
1 Like