5

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

fgysin
  • 255
  • 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 '13 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. – Sean Allred Feb 27 '13 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 '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 08:59
  • Ok, this is a problem: Adobe does not allow .zip files as attachments. Or rather, the attachment can be embedded, but Acrobat Reader doesn't allow you to open and/or save the attached file later on - which is the whole bloody point of attaching the .zip in the first place... – fgysin Feb 28 '13 at 09:31
  • @fgysin: Let me guess: Zip files are thought to be a security problem? – Martin Schröder Feb 28 '13 at 10:32
  • Yes. And of course users are so irresponsible that they can't even be trusted with a choice to open the .zip file... Just does not work anymore. -.- – fgysin Feb 28 '13 at 10:56
  • @fgysin, simply change the file ending to "txt" and have a note tell about the ending change before doing anything. :) – nickpapior Jun 19 '13 at 15:00
  • Related: http://tex.stackexchange.com/questions/26067/is-it-possible-to-embed-attach-a-file-password-protected-in-a-pdf?rq=1 – alfC Dec 17 '15 at 12:25

1 Answers1

2

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

Mario S. E.
  • 18,609