# Embed distributed LaTeX file/code to the PDF?

I have read of the possibility to embed the LaTeX source in a generated PDF, see the question here.

Do you know of a way to do this with distributed TeX file, i.e. for a TeX file which is stored in many separate parts and put together using `include` an `input`?

I'd rather not have to manually include all the `.tex` files, as this will surely at some point lead to me forgetting one of the many files (think title.tex, acknowledgment.tex, abstract.tex, chapter1.tex, ..., appendix1.tex, ...,backmatter.tex, etc...).

-
How about adding a zip file with all the LaTeX (and other) sources. Depending on what build system and/or versioning system you use, it may help you automate the task. –  Johan_E Feb 27 '13 at 15:39
+1 for zipping -- in fact, any sort of archive system (`tar` comes to mind) would be the best solution here, IMO. You don't want your consumer to have to fiddle with the directory structure of your project -- it's asking for headaches. –  Sean Allred Feb 27 '13 at 16:22
Though I also would prefer the ZIP file embedding, you can embed more than one file, the regarding packages are `attachfile2` and `embedfile` depending of what you really want to do. –  Speravir Feb 27 '13 at 23:06
Has anyone an idea how I could automate the creation/inclusion of an archive? Bonus points if the solution is configuration-free (on the editor side) and/or works with pure LaTeX... (I know this is probably possible by creating a makefile and using that to compile my TeX, but if possible I'd rather use something that does not require me to change config in every editor I use, i.e. something that works with pdflatex...) –  fgysin Feb 28 '13 at 8:59

2) You could use the `attachfile2` and `embedfile` packages, as described by speravir
3) As per question Is there some way to embed LaTeX source code in a PDF file?, `navigator` is another package you may use.