LaTeX Includes

Latex offers a very nice way to divide large documents into manageable files – the include command.  Combined with the includeonly command you have a very powerful method of compiling your document.

Typically,  each included file is a chapter – this is apparently how it was designed, and is certainly how I – and every other LaTeX user I know – use it.  Today I decided that one chapter was far too big, and split it up into a few smaller files for easy management.  Took seconds, no problem.

Only later, when I was annotating a hard copy for my supervisor did I realise that every include finished with an implicit clearpage.  Just what you want when you’re starting a chapter, and so I’d never noticed it.  When you’re starting a new section though, that’s not what you want.

In this case, use the input command  – same format, same effect, but no implicit clearpage.  You lose the includeonly functionality, but it fixes your section breaks.


Problem: Unwanted page breaks around include statements.

Solution:  Use the near-identical input command instead.

Leave a Reply

Post Navigation