Is it possible to detect if the current run is the first (preferably from the Lua end)?
I tried to read the log file, but it is apparently already erased when the Lua engine starts.
I can of course have a file created which I then delete manually after each complete compilation (or create one which is deleted by the first run), but a solution that works "automatically" would be preferred.
\IfFileExists{\jobname.aux}{yes}{no}before the\begin{document}(or an equivalent test from Lua) – David Carlisle Jan 30 '23 at 23:54\IfFileExists{\jobname.aux}– David Carlisle Feb 01 '23 at 00:09open_read_filehook (LuaTeX only) so you can determine which files are read while compiling the document (of course that way you can only determine the number of the run at the end of the run itself) – user202729 Feb 01 '23 at 12:18