Page LayoutTwo papers in separat latex with one output pdf file

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
khurram
Posts: 2
Joined: Fri Aug 20, 2010 11:32 am

Two papers in separat latex with one output pdf file

Post by khurram »

Hi,
I am writing my thesis report in latex. I have a specific report format provided by the University. I have written two research papers in latex as two different Tex files.
Now my question is how do I merge the following such that when I compile the report tex file it produces one out put in pdf/dvi

i. Thesis report
ii. Paper 1
iii. Paper 2

Each is in different tex and BibTex file.

I want that each paper has its own separate bibliography section.

Regards,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Two papers in separat latex with one output pdf file

Post by meho_r »

Here's a simplified version with main concepts only:

1. Create a new .tex document (let's call it Main.tex) which will serve as a master document. This document should be the only one having the preamble, so move all relevant entries from the preambles of your two documents (let's call them DocOne.tex and DocTwo.tex) and put them into Main.tex.

2. Now that you have one central preamble, in DocOne.tex and DocTwo.tex remove (or comment out) all lines that come before \begin{document} (including \begin{document} itself) and all lines that come after \end{document} (including \end{document} itself). As for Main.tex, naturally, it must contain \begin{document} and \end{document} commands.

3. In Main.tex use \include command to include both files into a single document.

4. Use bibtopic package to create bibliographies from both .bib files (let's call them First.bib and Second.bib).

You may do the testing of these basic steps on files in the attachment. Don't forget that you must be following this order (and number of runs) when compiling the document:

Code: Select all

pdflatex Main.tex
bibtex Main1.aux
bibtex Main2.aux
pdflatex Main.tex
pdflatex Main.tex
Attachments
Example.zip
A ZIP archive containing the files for testing purposes...
(1001 Bytes) Downloaded 224 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Two papers in separat latex with one output pdf file

Post by gmedina »

If the conditions mentioned in the first post are the only ones to be fulfilled, a simpler option would be to compile each document separately to obtain three different PDFs and then to merge them with the pdfpages package.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
khurram
Posts: 2
Joined: Fri Aug 20, 2010 11:32 am

Re: Two papers in separat latex with one output pdf file

Post by khurram »

Thanks both of you, I will try both options and ask for further comments.
Post Reply