\documentclass[main.tex]{subfiles}

\begin{document}
\section{Test with subfile} 
Lorem ipsum...
\end{document}
