# Merge two latex files

I'm trying to append to the end of my manuscript the supplementary information to form one latex file. The resulting file will of course have two bibliographies, corresponding to the one in the manuscript and the one in the SI separately.

So the manuscript looks like this:

\begin{document}

Text_1 (some text with citations)

Bibliography_1

\end{document}


The supplementary information looks like this

\begin{document}

Text_2 (some other text with citations)

Bibliography_2

\end{document}


Now, I want to merge the two into one latex file that will output this:

Text_1

Bibliography_1

Text_2

Bibliography_2

Could anyone show me how to write this?

Thanks!

• what is the "supplementary information"? How do you intend to fuse those files? I think it's unclear what you ask – Moriambar Apr 19 '17 at 14:43
• supplementary information = appendix – Adam Gosztolai Apr 19 '17 at 14:45
• related: e.g., tex.stackexchange.com/questions/364627/… – Marijn Apr 19 '17 at 14:46
• please edit your question, explaining what you have in each file, what you intend to do, and what is the problem. As it stands I think it's hard to answer – Moriambar Apr 19 '17 at 14:47
• I included additional information. Is it clear now? – Adam Gosztolai Apr 19 '17 at 15:02

## 1 Answer

I found the solution.

One can simply use the chapterbib package.

\documentclass{article}
\usepackage{chapterbib}

\begin{document}

\input{file1}

\input{file2}

\end{document}


It is important that one runs pdflatex on the main file first and then bibtex on file1.tex and then file2.tex before running pdflatex twice on the main file.