Merge LaTeX Files
Quick answer
To merge LaTeX files online, add up to 50 .tex files below, drag them into order and click Merge and Download. The tool keeps the first \documentclass, merges the preambles without duplicate lines, and joins every document body in order. Compile the result to check for package conflicts.
Click here or Drop files to upload
How to use it
- 1 Click the upload area, or drag your .tex files onto it.
- 2 Drag the files into the order you want the content in.
- 3 Click Merge and Download to save merged-file.tex, then compile it.
What to expect
- Only the first file's \documentclass is used.
- Identical preamble lines are kept once. Different options for the same package are both kept, so resolve any clashes.
- Files without \begin{document} (chapter fragments) are added to the body as they are.
- Images and \input files are not bundled. Keep them in the same folder as the merged file.
Frequently asked questions
Should I merge LaTeX files or use \input?
For a project you keep editing, a main file with \input or \include per chapter is cleaner. Merge into one file when a journal or tool needs a single .tex.
Why does the merged file fail to compile?
Usually two files load the same package with different options, or define the same command. Remove the duplicate from the preamble.
What if two files use different document classes?
Only the first file's \documentclass is kept. Put the file with the class you want first, and check class-specific commands in the others.
Related guides
- How to Convert LaTeX to Word (Pandoc, make4ht and Equations) The most reliable way to convert LaTeX to Word is Pandoc: run pandoc paper.tex -o paper.docx --citeproc --bibliography=refs.bib. Equations become editable Word equations, images are embedded and citations are formatted. Add --reference-doc=template.docx to apply your Word styles. For a single formula, paste it into Word's equation editor in LaTeX mode.
- How to Convert LaTeX to Google Docs (Files and Equations) Google Docs can't open .tex files, but you can get LaTeX into a Doc two ways. For a whole document, convert it with Pandoc (pandoc paper.tex -o paper.docx) and open the .docx in Google Docs. For individual formulas, use the built-in equation editor, or an add-on such as Auto-LaTeX Equations to render LaTeX code.
- How to Refer to a Table in LaTeX (\ref, \autoref, \cref) To refer to a table in LaTeX, put \label{tab:results} right after \caption{...} inside the table environment, then write Table~\ref{tab:results} in your text. LaTeX inserts the number and keeps it up to date. With hyperref, \autoref{tab:results} adds the word Table for you; with cleveref, use \cref. Compile twice.