Re: [NTG-context] Getting the width of an expression inside lua

2009-11-02 Thread Hans Hagen
Matthijs Kooijman wrote: Hi Hans, thanks for the instant reply :-) I haven't tried your suggestion yet, but I've got a few questions first. \startluacode function document.step_one(str) tex.sprint("\\setbox0\\hbox{",str,"}") Would there be any danger of overwriting an existing box by doin

Re: [NTG-context] Getting the width of an expression inside lua

2009-11-02 Thread Matthijs Kooijman
Hi Hans, thanks for the instant reply :-) I haven't tried your suggestion yet, but I've got a few questions first. > \startluacode > function document.step_one(str) > tex.sprint("\\setbox0\\hbox{",str,"}") Would there be any danger of overwriting an existing box by doing this? I'm not quite s

Re: [NTG-context] Getting the width of an expression inside lua

2009-11-02 Thread Hans Hagen
Matthijs Kooijman wrote: Hi all, I'm wondering if there is any way to get the width of some TeX (or rather, ConTeXt) expression inside lua, to do some math with it and output it again. I've found the tex macro \setwidthof, which served me well at first, but I need to do some more complex things