Re: [NTG-context] TeX expansion within lua

2012-09-05 Thread Marco Patzer
On 2012-09-05 Hans Hagen wrote: Hi Hans, > you probably over code things Yes, that's not unlikely, I tend to do that (unintentional). > instead of storing you can pass the valus directly > > \def\largerthantextwidth#1% >{\cldcontext > {if \number\dimexpr#1 "is smaller" >

Re: [NTG-context] TeX expansion within lua

2012-09-05 Thread Hans Hagen
On 4-9-2012 19:40, Marco Patzer wrote: On 2012-09-04 Martin Schröder wrote: Hi Martin, http://tracker.luatex.org/view.php?id=682 It seems that I just hit a very hard to solve issue which needs not yet available support from the luatex side. Patricks solution seems not very practical and er

Re: [NTG-context] TeX expansion within lua

2012-09-04 Thread Marco Patzer
On 2012-09-04 Wolfgang Schuster wrote: > What prevents you from setting the dimen value in Lua? Some background: The code is part of a smarter float placement. It takes the size of the float into account and decides for a location. For example, it positions the float in the margin if it fits or

Re: [NTG-context] TeX expansion within lua

2012-09-04 Thread Wolfgang Schuster
Am 04.09.2012 um 20:11 schrieb Marco Patzer : > On 2012-09-04 Wolfgang Schuster wrote: > >> Is there a good reason why you put \newdimen because dimen/count >> etc. registers should always be defined once. > > The definitions are not in a macro, they are defined at the top of > the file. I mes

Re: [NTG-context] TeX expansion within lua

2012-09-04 Thread Marco Patzer
On 2012-09-04 Wolfgang Schuster wrote: > Is there a good reason why you put \newdimen because dimen/count > etc. registers should always be defined once. The definitions are not in a macro, they are defined at the top of the file. I messed around while creating a minimal example. However, the pr

Re: [NTG-context] TeX expansion within lua

2012-09-04 Thread Wolfgang Schuster
Am 04.09.2012 um 19:40 schrieb Marco Patzer : > On 2012-09-04 Martin Schröder wrote: > > Hi Martin, > >> http://tracker.luatex.org/view.php?id=682 > > It seems that I just hit a very hard to solve issue which needs > not yet available support from the luatex side. > > Patricks solution seems

Re: [NTG-context] TeX expansion within lua

2012-09-04 Thread Marco Patzer
On 2012-09-04 Martin Schröder wrote: Hi Martin, > http://tracker.luatex.org/view.php?id=682 It seems that I just hit a very hard to solve issue which needs not yet available support from the luatex side. Patricks solution seems not very practical and error prone, so I settled with this ugly bu

Re: [NTG-context] TeX expansion within lua

2012-09-04 Thread Martin Schröder
2012/9/4 Marco Patzer : > I am just interested in a text string, not a box with typeset > material. I guess that's more difficult, since macros are expanded > and not just simply read. http://tracker.luatex.org/view.php?id=682 Best Martin ___

Re: [NTG-context] TeX expansion within lua

2012-09-04 Thread Marco Patzer
On 2012-09-04 Aditya Mahajan wrote: Hi Aditya, > Instead of > >context(tex.toks.mytoks) > > use > >context(function () context(tex.toks.mytoks) end) > > See the ConTeXt Lua Document manual for explanation. Thanks. This works indeed. But what to do in the following case? It's hard to

Re: [NTG-context] TeX expansion within lua

2012-09-04 Thread Aditya Mahajan
On Tue, 4 Sep 2012, Marco Patzer wrote: Hi, please have a look at the following example: \starttext \def\cmd{% \def\mymacro{Foobar} \newtoks\mytoks \mytoks={mytoks}} \startluacode context.cmd() context.mymacro() -- this fails -- context(tex.toks.mytoks) \stopluacode -- this works \st

[NTG-context] TeX expansion within lua

2012-09-04 Thread Marco Patzer
Hi, please have a look at the following example: \starttext \def\cmd{% \def\mymacro{Foobar} \newtoks\mytoks \mytoks={mytoks}} \startluacode context.cmd() context.mymacro() -- this fails -- context(tex.toks.mytoks) \stopluacode -- this works \startluacode context(tex.toks.mytoks