As the title says, $P=V^2/R$ has $V^2$ which appears to move away from the $R$, because of the $^2$: what would you recommend for aligning the $V$ to the $R$ (and also avoiding the fraction line going so forwards, again for the $^2$)?
I don’t know if you can stop fraction line from consuming the whole content, but for one-line alignment you can use hide.
#let sq(body) = $body std.hide(""^2)$
$P = V^2/sq(R)$
![]()
But with more hacks, you can.
#import "@preview/cetz:0.4.2"
#import "@preview/mannot:0.3.2" as mannot: annot-cetz
#let mark(body, tag) = mannot.mark(body, tag: label(tag))
#let pow(tag, pow) = annot-cetz((label(tag),), cetz, {
cetz.draw.content(tag + ".east", anchor: "west")[$""^sscript(pow)$]
})
$P = mark(V, "v")/R pow("v", 2)$
![]()
I would recommend to not do this at all, or find/create a feature request for this. Though if there are no practical evidence that other programs can do this, then Typst won’t supprt it either.
1 Like
Nice hacks! Indeed this calls for a change within Typst - or maybe I’m used to writing it in a different way that it is conventionally typeset!
1 Like