I have arranged 700 individual files in 18 different folders, as shown in the attached image. This was open source project to get it typed page by page. The number of pages varies for each folder.
Now my trouble is how to integrate into one file in book layout.
When I was creating document in this fashion, I thought I would manually put all in one folder and run it, which I can still do but just wanted to know if there is any easier way to do it.
Thanks for your help.
Best Answer
I am not sure of want you have in this files and what you want obtain, but supposing that you have a main file
book.tex
in the directory "Bellankonda", and files as chap_page_015 are only chunks of body text (no fully compilable LaTeX documents) and you want obtain a unique PDF merging all these chunk, then the book file could be somethig as this:If the subfiles are something as whole chapters, that must start-end newpages, may be you want use
\include
instead of\input
. Please see When should I use \input vs. \include?If the child documents are complete LaTeX files with preamble (starting with
\documentclass
and ended with \end{document} you can use the same file put including in the preample the packagesstandalone
, ordocmute
, orsubfiles
(in this case use\subfiles
instead of\input
). The child documents must be all of the same class, in other case, you can try thecombine
class, but usually this usually this means asking for troubles. Another option in this case could be produce PDF files of individual pages and merge all withpdfpages
package.Edit
As the comment of Aku ask for a loop to write automatically the
\input
commands, a solution could be the\foreach
command. The code below is a simple example where the main document include frompage1.tex
topage5.tex
using this command:With the subdocuments made from the commandline in this way:
The results must be the following: