Merging Multiple Latex Files
13 Dec 2020 | latex mergeMany folks prefer writing different sections of the paper in separate tex files and including them in the main document using the include
directive. This has several advantages:
- Coauthors often feel comfortable working on their individual sections.
- Makes versioning a little easier.
- Navigating is less painful.
There are situations where merging those sections into a single document is needed. For example, when some publications ask you to limit the number of files. After a little bit googling, this good old perl script seems to get the job done. To merge multiple sections run
perl latexpand main.tex > merged.tex