1

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?

1
4

\input can be used for this purpose:

The external file mytable.tex:

\begin{tabular}{...}
...
\end{tabular}

The main file includes it:

\input{mytable}

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

\include{Introduction}

with Introduction.tex:

\chapter{Introduction}
\label{chap:Introduction}
...

If the main file is organized this way:

\include{Introduction}
\include{ChapterA}
...

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

\includeonly{ChapterA}
...
\begin{document}

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.