Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including full LaTeX documents within others

Tags:

latex

pdflatex

I'm currently finishing off my dissertation, and would like to be able to include some documents within my LaTeX document.

The files I'd like to include are weekly reports done in LaTeX to my supervisor. Obviously all documents are page numbered seperately. I would like them to be included in the final document.

I could concatenate all the final PDFs using GhostScript or some other tool, but I would like to have consistent numbering throughout the document.

I have tried including the LaTeX from each document in the main document, but the preamble etc causes problems and the small title I have in each report takes a whole page...

In summary, I'm looking for a way of including a number of 1 or 2 page self-complete LaTeX files in a large report, keeping their original layouts, but changing the page numbering.

like image 693
Chris Clarke Avatar asked Apr 28 '09 12:04

Chris Clarke


People also ask

How do I insert one file into another in LaTeX?

The standard tools to insert a LaTeX file into another are \input and \include . Use this command in the document body to insert the contents of another file named filename. tex ; this file should not contain any LaTeX preamble code (i.e. no \documentclass , \begin{document} or \end{document} ).

What is the difference between \include and \input in LaTeX?

\input is a more lower level macro which simply inputs the content of the given file like it was copy&pasted there manually. \include handles the file content as a logical unit of its own (like e.g. a chapter) and enables you to only include specific files using \includeonly{filename,filename2,...} to save times.

How do I merge overleaf files?

If you want to consolidate the projects now, the only feasible way is probably to download them as ZIP files, compile them into a single ZIP file as needed and upload this single ZIP file as a new project.

How do I use Subfiles package?

In this case, the solution is a package called subfiles. This package allows you to define the main document as its documentclass consequently making it possible to compile the included file by itself. Simply include the package in your main document and use the command \subfile{filename} inside your document.


1 Answers

For a possible solution of \input-ing the original LaTeX files while skipping their preamble, the newclude package might help.

Otherwise, you can use pdfpages for inserting pre-existing PDFs into your dissertation. I seem to recall that it has a feature of "suppressing" the original page numbers by covering them up with white boxes.

like image 126
Will Robertson Avatar answered Oct 21 '22 08:10

Will Robertson