> On 23 May 2020, at 01:49, Rik Kabel <cont...@rik.users.panix.com> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________