I'd like to use LaTeX as an document generation backend in my application (mainly because it is well known, feature rich and output is of very high quality). Let's assume the application creates a small set of documents with content generated (or calculated) from user input.
Of course, I could require a working installation of TeX with the (relatively small) set of used packages on the installation target. Another option would be providing this during the installation process of the application itself. This would allow for feeding the generated LaTeX source to the latex command.
This adds a large and perhaps unstable dependency to the (comparatively) small application. As TeX installations can easily exceed several hundred MB in size, I'd rather not like to bother users with this.
What I'm looking for is a way of embedding LaTeX in my application, specifically tailored to the used document class and packages in the generated documents, ideally without the need to kpathsea the required files.
I assume this has been done before, but I haven't managed to find any traces of this.
Best Answer
This is fairly straight-forward: