In latex, something like $$\boxed{\frac12}$$ gives the below.
When just using typst's box, $#box($1/2$, stroke: 0.5pt)$ gives the below.
Ideally, the output would like this #box($1/2$, stroke: 0.5pt, inset: 6pt).
It seems that 6pt's of inset is enough to avoid clipping into contents: #box([abcd $1/2$ $1/2/2/2/2/2/2/2/2/2/2/2/(2/2)$], stroke: 0.5pt, inset: 6pt).
Does it make sense to change how \boxed is converted into typst to match the latex output, or is there a good workaround?
My thoughts for a workaround was to use an iftypst block to replace \boxed with my own call to #box, but I think that would then require another conversion inside of the #box argument from latex to typst.
In latex, something like
$$\boxed{\frac12}$$
gives the below.When just using typst's box,
$#box($1/2$, stroke: 0.5pt)$
gives the below.Ideally, the output would like this
#box($1/2$, stroke: 0.5pt, inset: 6pt)
.It seems that 6pt's of inset is enough to avoid clipping into contents:
#box([abcd $1/2$ $1/2/2/2/2/2/2/2/2/2/2/2/(2/2)$], stroke: 0.5pt, inset: 6pt)
.Does it make sense to change how
\boxed
is converted into typst to match the latex output, or is there a good workaround?My thoughts for a workaround was to use an
iftypst
block to replace\boxed
with my own call to#box
, but I think that would then require another conversion inside of the#box
argument from latex to typst.