<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 25, 2015 at 7:12 PM, David Carlisle <span dir="ltr"><<a href="mailto:d.p.carlisle@gmail.com" target="_blank">d.p.carlisle@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">If you process the  following with (plain) pdftex<br>
<br>
%&pdflatex<br>
<br>
\stop<br>
<br>
then you get<br>
<br>
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015)<br>
(preloaded format=pdflatex)<br>
<br>
<br>
showing that the first line comment has been read to load pdflatex.fmt<br>
<br>
The analogous file for (plain) luatex<br>
<br>
%&lualatex<br>
<br>
\stop<br>
<br>
<br>
<br>
produces<br>
<br>
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)<br>
 restricted \write18 enabled.<br>
(./xx.tex<br>
! Undefined control sequence.<br>
l.3 \stop<br>
<br>
showing that the file is being processed by plain.<br>
<br>
luatex --help  and page 30 of the (0.80) manual indicate that there are<br>
  --(no-)parse-first-line command line options which at least implies<br>
that the web2c style first line parsing should be active?<br>
<br>
If it isn't intended to work could those options be removed thanks, also<br>
in that case is it possible to do a similar thing from lua at the top<br>
of the file?<br>
<br></blockquote><div>(no-)parse-first-line are recognized but currently do nothing, apart a message on the log.<br></div><div>I will fix the  manual.</div><div><br></div></div><div>One can use the lua interpreter in this way:</div><div><br></div><div><div>-- myscript.lua </div><div>print("arg[1]=",arg[1])</div><div>print("arg[2]=",arg[2])</div><div>print("arg[3]=",arg[3])</div></div><div><br></div><div><br></div><div>$> luatex --luaonly myscript.lua -i latex test.tex <br></div><div class="gmail_extra"><br></div><div class="gmail_extra">that gives</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">arg[1]=<span class="" style="white-space:pre">        </span>-i</div><div class="gmail_extra">arg[2]=<span class="" style="white-space:pre">    </span>latex</div><div class="gmail_extra">arg[3]=<span class="" style="white-space:pre"> </span>test.tex</div><div><br></div><div>(note that  the standard lua options are not recognized as such)</div></div><div class="gmail_extra">Of course in you case the script can parse the first line of test.tex and eventually run luatex with the right</div><div class="gmail_extra">options (i.e. luatex --fmt=lualatex test.tex) with os.execute .</div><div class="gmail_extra"><br></div>-- <br><div>luigi<br></div>
</div></div>