I'm using the following tags to generate a project:
\documentclass{book}
\begin{document}
\frontmatter
\include{fm}
\mainmatter
\include{ch01}
...
\include{ch10}
\backmatter
\bibliographystyle{...}
\bibliography{...}
\printindent
\end{document}
This was produced the output in a nice manner, but today I saw some post regarding \usepackage{subfiles}
, and the usage is:
\documentclass{book}
\usepackage{subfiles}
\begin{document}
\frontmatter
\subfile{fm}
\mainmatter
\subfile{ch01}
...
\subfile{ch10}
\backmatter
\bibliographystyle{...}
\bibliography{...}
\printindent
\end{document}
This also working fine, and this is allowed to treat each chapter as separate compilation, i.e., we able to use \documentclass...\end{document}
in each file, but the first method doesn't allow to run each chapter as separate file.
Kindly suggest which one is opt to use, please
I'm not an expert in TeX
, so can't able to take decision, please advise.
\include
is the standard latex command.subfiles
is OK but is quite an invasive change as it has to change a lot of file handling, so you may get package conflicts. I would use the standard system until you are used to that but feel free to experiment with alternatives\include
by using\includeonly{ch10}
this is good for quick editing when working on chapter 10. It formats a chapter10 not as a new document, which is better or worse depending on what you wantsubfiles
package, and also suggest to avoid thesubfiles
package unless really needed, for the reason David gave. Personally, I usually use\input
commands in the main file and comment/uncomment them as needed.subfiles
package, so the recommendation is not to use it (as it potentially may have side-effects). Your question is not so specific that there is a clear-cut answer for other users as well. I know that there are quite some people out there who like to usesubfiles
.