<div dir="ltr"><div>\directlua {</div><div>    function followup(n)</div><div>        print(tex.box[n].list.width)</div><div>        print(tex.box[n].list.height)</div><div>        print(tex.box[n].list.depth)</div><div>        tex.print(tex.box[n].list.width  .. "\string\\par")</div><div>        tex.print(tex.box[n].list.height .. "\string\\par")</div><div>        tex.print(tex.box[n].list.depth  .. "\string\\par")</div><div>    end</div><div>}</div><div>\directlua {</div><div>    tex.print([[\string\setbox0=\string\hbox{foo}]])</div><div>    tex.print([[\string\directlua{followup(0)}]])</div><div>}</div><div><br></div><div>(credit: H. Hagen)</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 20, 2014 at 5:16 PM, Andreas Matthias <span dir="ltr"><<a href="mailto:andreas.matthias@gmail.com" target="_blank">andreas.matthias@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Is it possible to call the TeX scanner from within Lua?<br>
<br>
I would like to put a string into a box and then work on the node list.<br>
If the string were available on the TeX side I would<br>
<br>
  \setbox0\hbox{...}<br>
<br>
and the use it on the Lua side<br>
<br>
  tex.box[0]<br>
<br>
But what should I do if the string is generated on the Lua side and<br>
thus no available on the TeX side? Is it possible to call the TeX<br>
scanner to read this string?<br>
<br>
<br>
Ciao<br>
<span class=""><font color="#888888">Andreas<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><div>\directlua {</div><div>    function followup(n)</div><div>        print(tex.box[n].list.width)</div><div>        print(tex.box[n].list.height)</div><div>        print(tex.box[n].list.depth)</div><div>        tex.print(tex.box[n].list.width  .. "\string\\par")</div><div>        tex.print(tex.box[n].list.height .. "\string\\par")</div><div>        tex.print(tex.box[n].list.depth  .. "\string\\par")</div><div>    end</div><div>}</div><div>\directlua {</div><div>    tex.print([[\string\setbox0=\string\hbox{foo}]])</div><div>    tex.print([[\string\directlua{followup(0)}]])</div><div>}</div><div><br></div><div>(the code is from H. Hagen)</div></div>-- <br>luigi<br>
</div></div>