% Hans, sorry for having replied on the wrong channel before.
On Tue, 3 Nov 2020 at 09:03, Hans Hagen
On 11/3/2020 4:05 AM, Sylvain Hubert wrote:
as tables like those in setuphead({somehead}, {somesettings}) are actual Lua tables and follow Lua, not TeX, rules But there are lua apis that support delayed TeX like `context.chapter(context.delayed'text')`. Whether or not the function is stored in a table should be theoretically irrelevant. I guess there should be a switch somewhere that let the command recognized delayed function. all is possible but not all is reasonable to support .. adding layer upon layed doesn't make it more pretty
Indeed, but still it would be nice to have a complete and consistent interface between tex and lua unless it would harm the functionality.
anyway, chapter (section) titles go tinto a toc table and storing lua delayed function definitions there makes not much sense
It might be helpful in cases like alternative coloring. Writing
"function() local x=1; return function() x=1-x; return ({'black', 'gray'})[x] end end" can be way much easier for lua speakers than digging up a bunch of documentations to figure out whether it's implemented, or how it can be implemented in a language like TeX, or both which is worse. In such cases, it would also be much natural to write 'before=function()..' than 'before=\ctxlua{function()...}` unless, again, the former harms the functionality. Sylvain