Is there any way to call a lua script automatically immediately after lualatex finishes(and pass the jobname)?

Basically I need to do some post process and cannot do it within the same job so I would like to run a script immediately after if it exists and pass to the script the jobname.


No, there is no solution for this in LuaTeX. You need to write a small wrapper around your LuaTeX call.

  • I've spent all day yesterday writing a luatex script to make it easier to use \include (instead of commenting them out or using includeonly) and then it turns out luatex doesn't have the proper callbacks before and after the pdf output creation. One or two extra lines of code that could have been added to lualatex without any drawbacks have cost me several hours... Unfortunately I deal with this kinda stuff on a daily basis and it becomes a huge waste of time(not just with tex/latex). I'll just go back to using % and hope lualatex will be updated in the future to support this functionality – Uiy May 14 '12 at 12:05
  • 3
    @Uiy "If so then forget it..." - Just to get the record right: It is not me who is trying to get something done, but you. – topskip May 14 '12 at 12:27
  • 1
    @Uiy: LuaTeX is free software. Where's your patch? – Martin Schröder May 15 '12 at 7:10
  • @MartinSchröder Yeah, then I go to build it and send hours trying to get it to build correctly because it won't build on my machine since I'm actually keep my stuff up to date and do not use linux. For example, I just tried to install luarocks. Guess what? When I try to install the sockets package I can't because when it tries to build it the .sln file is not uptodate and msbuild will not build the solution since it is too old. Which means I'll have to go figure out how to do that if I want to to use luarocks... worth it? No! Again, I got better things to do than waste more of my time. – Uiy May 15 '12 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.