I have some long tables which take large space in my main tex file. Can i get rid of it and transfer it to another file and indicate the main tex file to fill up the code from the external file. It is just like functions work in codes. You can write your entire code in one file but it is easy if you have your entire latex code divided among multiple files. Is that possible?


\input can be used for this purpose:

The external file mytable.tex:


The main file includes it:


Longer parts that begin and end at page breaks (e.g. chapters) can use \include:


with Introduction.tex:


If the main file is organized this way:


Then just a chapter can be compiled by calling \includeonly in the preamble:


Then chapter "Introduction" is excluded from the compile run. However, the numbers (chapters, equations, ...) are still taken from the .aux file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.