Print

Print


Hans Aberg writes:

> P.S. Why is \include doing a newpage? I find this inconvenient.

To staticise the .aux file output (as it were).

The sequence is

  \include{foo}
  \clearpage %gets rid of all outstanding floats, which may write to
             %\@auxout (=jobname.aux at this stage) for their
             %captions' labels

  \immediate\write\@auxout{\string\@[log in to unmask]
  \immediate\openout\@partaux foo.aux
  \let\@auxout\@partaux

  <process file> % may write to \@auxout

  \clearpage %to get rid of outstanding floats, again
  \@writeckpt{foo} %writes checkpoint for the case when \includeonly
                   %has said this file isn't going to be read
  \immediate\closeout\@partaux

  \let\@auxout\@mainaux % restore to \jobname.aux

Thus the \clearpage is a consequence of the definition of
\includeonly: each sub-file has to have its own .aux file, so that the
important parts of its effects can be recovered in case that
\includeonly has said that the file isn't to be included.

Matt Swift was (when I last saw him, in 1995) in the process of
writing code to deal with the requirement for a \clearpage.  I haven't
heard from him for ages, so it may be that the *very* complicated
scheme he had has proved not to be satisfactory, or something.

The stuff was all part of his ideas on modularity in LaTeX: you can
see some of his stuff (which outlines his ideas) on CTAN in

  macros/latex/contrib/supported/monster
  macros/latex/contrib/other/swift

and he gave a paper at TUG'95, which you can read in TUGboat v16#3 (I
think it was ... nominally Autumn '95, actually early '96).

Robin Fairbairns