I have a task of creating a number of documents with the content generated by some script. The content is substituted in a LaTeX template, and then I simply execute a LaTeX compiler (pdflatex in my case) on each of the resulting source files, getting my PDFs all nice and shiny.
The problem is it takes a very long time to finish (a few seconds per document times 7000 documents is quite a lot). Now it seems that most of the time is taken by LaTeX initializations (packages, fonts, etc.), while the compilation itself is very fast (each document is only two pages with nothing more complex the a couple of images and some text). As far as I understand, the automatisation tools such as latexmk will run LaTeX separately for each file, so this is not much better than me calling pdflatex directly from my script.
So is there a way to run LaTeX once and then feed TeX source files to it one after another?
\inputor\importor the like. – TeXnician Nov 09 '17 at 15:58mylatexformatand: Ultrafast PDFLaTeX with precompiling – Schweinebacke Nov 09 '17 at 16:22