Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
4  
AFAIK no and no. But I see an XY problem here. What problem are you trying to solve? –  Martin Schröder May 13 '12 at 22:28
    
@MartinSchröder luatex says it has a callback finish_pdffile but it doesn't seem to be working ;/ –  Uiy May 13 '12 at 22:34
    
Seems like one has to use stop_run instead –  Uiy May 13 '12 at 22:45
    
So that is your problem? :-) –  Martin Schröder May 14 '12 at 6:56
    
add comment

1 Answer

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.

share|improve this answer
5  
I have the feeling that I have given the same answer several times today. –  topskip May 14 '12 at 8:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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