[NTG-context] \ctxlua and \startluacode ... \stopluacode

Rudolf Bahr quasi at quasi.de
Mon Oct 14 18:50:44 CEST 2019

Dear List!

THis MWE must be faulty, but where is the error?



userdata = userdata or {}

function userdata.file_exists (name)

   local name = name
   local f    = assert ( io.open ( name, "r" ))

   if f then
      f:close ()
      context ( name )
      context ( "  exists!" )
      context ( name )
      context ( "  doesn't exist!" )




\lookupfile{"$HOME/context-tests/AAA.lua"}	% "AAA.lua" intentionally does    exist
\lookupfile{"$HOME/context-tests/BBB.lua"}	% "BBB.lua" intentionally doesn't exist



It makes no difference in commenting out the first or the second "\lookupfile" command.
The error message eventually is always nearly the same:

token call, execute: [ctxlua]:8: "$HOME/context-tests/AAA.lua": No such file or directory
token call, execute: [ctxlua]:8: "$HOME/context-tests/BBB.lua": No such file or directory

I'm using:
LuaMetaTeX, Version 2.00.0 
ConTeXt  ver: 2019.10.10 18:15 MKIV beta  fmt: 2019.10.12  int: english/english

Please, any ideas?


More information about the ntg-context mailing list