Hi @mich_ephr, thanks for your question!. Could you maybe try to revise your post’s title to be a complete question as per the question guidelines:
Good titles are questions you would ask your friend about Typst.
We hope by adhering to this, we make the information in this forum easy to find in the future. In addition, the latex-migration tag would be a good fit for your question. Thanks!
To add some notes about why I did it exactly like this:
The zero-width box is the main component responsible for the smashing, as it prevents the body from expanding to the side.
The inner box with infinite width is required so that the body isn’t split into multiple lines.
The alignment is optional in case you want all the different behaviors you can get in LaTeX with \mathclap, \mathrlap and \mathllap.
The display and script functions are necessary for keeping the font style and size of the subscript or superscript content, as that information would otherwise be lost as soon as a box is introduced.
The script(body) has to be in a block equation so that the bounds of the content are calculated correctly, which is necessary for proper positioning.
You can then use this as in
$ g(t) dot limits(integral)_smash(a+b+c+d)^smash(x+y+z) f(t) dif t $