[Tex/LaTex] How to combine several tex files into one

automationauxiliary-files

In my paper I have several tex files, mainly produced by some other tools (.bbl by bibtex, .eps_tex by inkscape etc.).

I would like to combine them into a single tex file as required by my publisher.

If possible, I'd like to automate it, so that even if any of my references of figures changes I still have an up-to-date version of the manuscript.

Is it possible to do that in LaTeX, or are there any third-party tools for that?

Best Answer

If you need to have your bibliography in the same file as your main text, you can use the filecontents environment:

\begin{filecontents}{bibliography.bbl}
% <contents of bibliography.bbl>
\end{filecontents}
\documentclass{article} % or whatever
\begin{document}
...

When you run latex on this file, it will write a bibliography.bbl file to the same folder as the tex file is in. Note the filecontents environment comes before the document class.

In this way, you need only send one file to the publisher.

As for images, I would check the publisher requirements vis-à-vis pictures: they might require them in a particular format, but I doubt they want them all embedded in the actual file...

the filecontents package allows for more flexible use of filecontents environments.

Related Question