0

Is there any way to use lua functions after the pdf is generated or to force generation of the pdf at some point in the tex file and still use lua?

Basically I need to modify the pdf and do this from the tex file.

One way I understand what I want to do would be the hypothetical code

\begin{document}
...
\end{document} % Assume this statement would cause the pdf to be generated and written to disk
\directlua{myfunc()}

where myfunc now could access the most recent version of the pdf

Alternatively is there a way to generate the pdf of an \include even if it is not a complete tex document(this is effectively what I'm trying to achieve)?

e.g., if I do

\include{mypart}

it will generate mypart.pdf which is just the pages of the mypart.tex and not the complete document.

topskip
  • 37,020
Uiy
  • 6,132

1 Answers1

4

As Martin Schröder writes: no there is no way to do processing after a file has been written. The finish_pdffile callback can be used to add information to the PDF file, the stop_run callback comes close, but not quite. It is used to replace the statistic information at the end of the run.

Alan Munn
  • 218,180
topskip
  • 37,020