10

I know it is not possible to nest one \include inside another, but what about \input? Is it possible to have something like:

\documentclass{article}

\begin{document}

\include{file1}

\end{document}

and then in file1.tex:

\section{samplesection}
\input{file2}

in file2.tex;

\section{samplesection2}
Hello
11

Quoting Kopka and Daly, Guide to LaTeX, 4th edition (2004), p. 207:

\include commands may not be nested: They may only appear in the main processing file. However, an \input command may be given within a file that is \included.

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.