Site icon texblog

Structuring a report/book with \input{filename}

When I started using LaTex, I never bothered about dividing my report into several files. I ended up scrolling down hundreds of lines every time I wanted to make a little change somewhere in the document. It was only later that I learnt how to structure the whole story into different files and therefore omit scrolling the mouse wheel until the finger hurts.

Probaby the best way to structure a report or book is simply by using one file per chapter. In order to include the file as part of your work, use the command \input{(path)\filename}.

It is also a nice way to generate part of a larger work in order to see where errors are. Also, dividing your work into several files can shorten the PDF generation time if you are only working on one chapter at the time and comment out the rest of the input files. This is far more effective than commenting out whole regions in a document.

Exit mobile version