[luatex] Building a PDF with Lua code, without a TeX stub

Mojca Miklavec mojca.miklavec.lists at gmail.com
Thu Oct 20 08:55:54 CEST 2016


On 20 October 2016 at 08:25, Deepak Jois wrote:
> Hi
> I would like to invoke the LuaTeX interpreter with a Lua file which
> does the node building etc, and then calls something like
> tex.shipout(), which can generate a PDF. I am aware of the --lua flag,
> but the file passed to that flag executes before the TeX engine is
> fully initialised. So that’s not what I am looking for
>
> For example, lets say I have a Lua file with code:
>
> <code>
> -- Page settings
> tex.pagewidth = "210mm"
> tex.pageheight = "297mm"
> tex.hsize = "210mm"
>
> -- Set the paragraph indentation
> tex.parindent = "20pt"
>
> tex.sprint("hello world")
> </code>
>
> and I want to generate a PDF from it directly using the luatex
> command.

Others will give you a more definitive answer, but this works out of
the box with
    context hello.cld

See for example:
- http://wiki.contextgarden.net/CLD
- http://www.pragma-ade.com/general/manuals/cld-mkiv.pdf

I'm sure there must be a way to switch to a different format (or at
lest it should not be to difficult to add that functionality in case
it's not there yet).

Mojca



More information about the luatex mailing list