I just finished my Ph.D thesis using LaTeX and I create it in a structured way with several folders and .tex documents inside. I have a master main.tex file and add the different chapters, sections etc. with \include or \input in the master file.

Now I want to create only one .tex file with all my thesis. I wonder if there is a what to do that (not cropping or copy/paste) maybe using some package or a script? I appreciate any information.

  • Congratulations! Copy pasting is not an option? – percusse Mar 4 '14 at 17:50
  • 1
    Thanks. Copy pasting is always possible but since it is a very large document with a lot of \inputs and \includes nested, I prefer to find another easiest solution. – Rogelio Yoyontzin Mar 4 '14 at 17:56
  • 1
    at least some editors (e.g. emacs) provide the means to insert the contents of another file by name into the "working" file; that is what i would do, but only if i was required to. – barbara beeton Mar 4 '14 at 18:04

I'm guessing that this is due to some submission requirement or similar otherwise I would advise against doing this as your current method is much tidier and user friendly (in my opinion). Assuming that you have a large number of .tex your best bet would be to use your preferred programming language to search from string of \include or \input and then to open that file and insert the text (as one long string) to replace the original command.

If I understand your question correctly then there are several examples in the answer to this question which you may want to look into.

Not the answer you're looking for? Browse other questions tagged or ask your own question.