> On 23 May 2020, at 01:49, Rik Kabel wrote: > > If the OP simply wants the width of a string, one can use \setwidthof#1\to#2. > > \define\String{pqrs} > \setwidthof{\String}\to\Wdth > \String\ is \Wdth\ wide. > > \setwidthof{{\tfb\em\String}}\to\Wdth > {\tfb\em\String} is \Wdth\ wide. > > I do not know if that is different from the width of the same string unboxed from the paragraph. There may be some adjustments made in justification, expansion, and such that are not treated. Additionally: suppose I am in lua. Would it be possible to get the width (and height) of a string back in lua as a value? So, in lua something like this: width = tex.widthofstring(“I have a string with some $\frac{1}2{}$ (math) in it") G