[texhax] End of file

Barbara Beeton bnb at ams.org
Thu Jan 12 23:28:17 CET 2006

    > Is there a command in (La)TeX that would define EOF anywhere in
> the file, so
> the rest of the text in the file (below the command) would be
> omitted while
> compiling the document. That would apply to input file(s). I
> would like to
> avoid commenting or deleting the rest of the text - I would like
> to preserve
> it as it is.

Just put in \end{document} where you want to stop compilation; everything
that follows will be ignored.  Make sure it's not inside some environment
or other group though!

that works just fine if it's the last file for the document.
if you want to shorten an \input{...} or \include{...} file,
use \endinput instead; that way the job will continue to
the real \end{document}.

the caution against interrupting an environment or group is
still important.
-- bb