# [TriLUG] LaTeX gurus: is it possible to ignore lines on 'include'

Douglas Kojetin djkojeti at unity.ncsu.edu
Wed Mar 24 19:09:36 EST 2004

I figured I'd send this out to the local LaTeX gurus out there (many
thanks for all the previous help!).

I'm starting to develop a skeleton for my dissertation text.  I plan on
having a main document that sources my chapter files (using
'\include{chapter1}', etc.) so as to keep the main file relatively
small.  I'd like to be able to just work with the chapter files
individually as I'm working on them, but every once and a while I'd
like to be able to compile the entire document to see how it all looks.

This is where I foresee (and have seen) problems.  I have document
formatting statements at the beginning of the chapter files that, upon
compilation of the entire document (where main.tex uses the \include
command to source the chapters), I get the obvious errors due to the
document formatting lines appearing after \begin{document} in the main
tex file.

Is there a way to comment or ... format, somehow ... the
document/usepackage(s) in the chapter files so they *are* sourced when
the individual files are typeset but *not* sourced when the entire
document is typeset (i.e. upon sourcing a file, it would ignore any
document/usepackage information)?

If it matters, I'm using TeXShop.

Many thanks (again)!
Doug