Hello, when I run context by e.g.: context.exe Source.mkiv --result=Result.pdf --mode=Mode is it possible to access the command line arguments from Lua? I'm aware that modes are accessible by 'tex.modes' ('tex.modes.Mode' gives 'true' in this case); but I'd need to get also the source file name ("Source.mkiv") and the option ("--result" -> "Result.pdf"). Is it possible anyhow? Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
On 06/09/11 13:41, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
when I run context by e.g.:
context.exe Source.mkiv --result=Result.pdf --mode=Mode
is it possible to access the command line arguments from Lua?
the 'environment' table has information about this stuff. In particular, environment.rawarguments matches the table that lua calls 'arg'. \directlua{print (table.serialize(environment.rawarguments))} Best wishes, Taco
Hello,
I think the tables document.arguments and documents.files might also
be of interest.
Regards.
-- Cédric
2011/6/9 Taco Hoekwater
On 06/09/11 13:41, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
when I run context by e.g.:
context.exe Source.mkiv --result=Result.pdf --mode=Mode
is it possible to access the command line arguments from Lua?
the 'environment' table has information about this stuff.
In particular, environment.rawarguments matches the table that lua calls 'arg'.
\directlua{print (table.serialize(environment.rawarguments))}
Best wishes, Taco ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
OK, thanks both for the answers.
Lukas
On Thu, 09 Jun 2011 13:57:27 +0200, Taco Hoekwater
On 06/09/11 13:41, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
when I run context by e.g.:
context.exe Source.mkiv --result=Result.pdf --mode=Mode
is it possible to access the command line arguments from Lua?
the 'environment' table has information about this stuff.
In particular, environment.rawarguments matches the table that lua calls 'arg'.
\directlua{print (table.serialize(environment.rawarguments))}
Best wishes, Taco
I think the tables document.arguments and documents.files might also be of interest. Regards. -- Cédric
On Thu, Jun 09 2011, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
but I'd need to get also the source file name ("Source.mkiv") and the option ("--result" -> "Result.pdf").
\starttext result (lua): \ctxlua{context(environment.outputfilename)}\par result (tex): \systemparameter{file} \stoptext -- Peter
participants (4)
-
Cedric Mauclair
-
pmlists@free.fr
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Taco Hoekwater