I would like to retain the multifile structure of my LaTeX projects, but journals usually require a single .tex file. Is there any way to print such a combined document as a 'cached' file with the help of LaTeX? The solutions provided for this problem (Submitting a journal article as a single tex file) did not seem practical to me.
Here is a trivial MWE:
sub1.tex:
This is the content of sub1.tex.
sub2.tex:
This is the content of sub2.tex.
main.tex:
\documentclass{article}
\begin{document}
This is a test document.
\input{sub1.tex}
\input{sub2.tex}
\end{document}
The combined file would contain the following:
\documentclass{article}
\begin{document}
This is a test document.
This is the content of sub1.tex.
This is the content of sub2.tex.
\end{document}