I was wondering if there was a simple way to emphasize the content of an important equation, something like LaTeX’s \boxed function. I tried using #rect here and there:
But I do not really like the box being this big, as it must contain the whole equation line, including the number. Besides, if I want to select a specific part of the equation, the following
Is not very satisfying, as I must leave display mode in the rect and the rect borders touch the equation content. Well, I could use display and try to add some padding, but this seems like more inconvenient than necessary. Did I miss a super simple solution?
This is indeed a surprisingly non-trivial problem, as the interaction between math content and regular content isn’t optimal right now. However, there is a very useful package called mannot, which allows the kind of boxing you’re looking for (and much more):
If you want a LaTeX-style \boxed function but with more control over size and padding, consider using \fbox or \colorbox from the xcolor package. For highlighting only part of the equation, \highlight from soul or \tikzmark can work.
Well, my question was more about making this in Typst, as I am mostly satisfied with LaTeX’s function. I did not know about these though, thanks for the input!