# [NTG-context] skipping parts in compiling

Mojca Miklavec mojca.miklavec.lists at gmail.com
Wed Feb 22 16:44:38 CET 2006

> > If you mean "can I recompile only page 3 and 4 out of my 100-page book
> > and get the whole document" that answer is no I think. But there are
> > other ways.
> >
>
> I suspected.

Well, you also have
texmfstart newtexexec.rb --pfdcombine | copy | select | trim

I don't know how exactly to use them (to hans: lines 351-359 in
newtexexec.rb, "def copyortrim" seem to be broken a bit - wrong number
of arguments), but I guess that you could combine parts of your
document together again this way (I wouldn't use this approach
however).

But what's wrong with using modular approach (to compile just the
chapter or section you're currently working on, so that it compiles
fast enough and you can fix bugs, and then compile everything together
when you need the whole document)? You don't need to change a single
line if you compile separate chapters or if you compile everything
together. Except that you might need to split the document in separate
files (using projects/products is really a great thing). If you don't
want to split your document, you can also use modes:

\starttext

\startmode[everything]
\enablemode[chapter1]
\enablemode[chapter2]
\stopmode

\chapter{Introduction}

\startmode[chapter1]
\chapter{Chapter A}
\stopmode

\startmode[chapter2]
\chapter{Chapter B}
\stopmode

\stoptext

Then you can compile the document with
texexec --mode=chapter1 filename
or
texexec --mode=chapter1,chapter2 filename
or
texexec --mode=everything filename

Mojca