The answer at When should I use \input vs. \include? mentions:
\include
gets you the speed bonus, but it also can't be nested, can't appear in the preamble, and forces page breaks around the included text.
But I have written an example that seems to contradict this.
foo.tex
\documentclass{article}
\include{bar}
\begin{document}
\maketitle
Foo
\end{document}
bar.tex
\title{Bar}
I could compile foo.tex
successfully and I also see the title rendered in the generated PDF when I view it with a PDF reader.
$ pdflatex foo.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./foo.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 2 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
\@input{bar.aux}
(./bar.tex)
No file foo.aux.
LaTeX Warning: No \author given.
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./foo.aux) )</usr/share
/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texliv
e/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texmf
-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb>
Output written on foo.pdf (1 page, 24969 bytes).
Transcript written on foo.log.
Why was I able to \include
in the preamble when the answer I have linked to says it should not be possible?
\clearpage
that is mandatory in\include
has no effect in the preamble`