# [NTG-context] Using lua with the command line for "macros"

luigi scarso luigi.scarso at gmail.com
Mon Oct 14 03:17:28 CEST 2013

```On Mon, Oct 14, 2013 at 3:01 AM, Kumar Appaiah <a.kumar at alumni.iitm.ac.in>wrote:

> Hi.
>
> At the outset, I understand that this is a slight abuse of LuaTeX and
> this can be done with plain TeX. Nevertheless, I'd like to see if a
> solution exists for this approach.
>
> I'm trying to use Lua with ConTeXt as a macro preprocessor. To be more
> clear, I have files A.lua, B.lua which define some variables:
>
> A.lua:
> var1 = "something for a"
> var2 = "something else for a"
>
> B.lua:
> var1 = "something for b"
> var2 = "something else for b"
>
> And, in my ConTeXt file, I would write:
> …
> I will get \directlua{tex.print(var1) and \directlua{tex.print(var2)}.
> …
>
> Now, with lualatex, I use the --lua command line option to pass the
> initial lua file name. However, for context, I've not found a way to
>

Have you seen