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...).

  • 5
    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, 2013 at 15:39
  • 1
    +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. Feb 27, 2013 at 16:22
  • 2
  • 1
    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, 2013 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, 2013 at 8:59

1 Answer 1


Trying to summarize all that was stated in the comments, there seems to be a few things you can try:

1) If you want to include files then you can use tar or any other compression method to include everything in a single folder. Of course this could lead to you forgetting some of the files, but if you are organized you shouldn't have any problems.

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.

4) As another answer to question mentioned in 3), you can try using ConTeXt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .