# Mutiple file documents with all files compilable [closed]

I have a main tex file:

\documentclass{article}

\begin{document}
\input{chapter2.tex}

this is main document.
\end{document}


and a subsidiery file included in the main file:

This is a chapter in another file.


An IDE like texmaker can compile only the main file and is not smart enough to have a multiple file project. Is there a way to make all subsidiary files compilable?

This will make it easier to fix them.

• Are you referring to making the subfile compilable on their own? Which might be problematic when it comes to references to other subfiles. Texmaker has the master file feature, such that you can be in a subfile, hit compile, and it will compile the master file. – daleif Oct 25 '15 at 6:32
• @daleif I was thinking about a similar procedure to adding header files in C programming. adding a header more than one time does not produce a problem there. With it I think I can make all files runnable. Where is the master file option in texmaker? – Minimus Heximus Oct 25 '15 at 6:43
• Are you searching for standalone package and class? It does something like that. – user11232 Oct 25 '15 at 6:46
• Another option is using the subfiles package: tex.stackexchange.com/a/261180/74960 – MarcoG Oct 25 '15 at 8:37
• why not use \include and \includeonly{chapter2} ? – David Carlisle Oct 25 '15 at 9:18