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.

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.

  • 5
    I have the feeling that I have given the same answer several times today. – topskip May 14 '12 at 8:40

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.