28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

210 Chapter 9. Document Management<br />

applies <strong>to</strong> all other structure counters. Their correct values can only be<br />

guaranteed when the files have been reprocessed in their proper order.<br />

In spite of these restrictions, the \include comm<strong>and</strong> is extremely useful<br />

for large documents, saving considerable computation time. Longer<br />

documents are normally written <strong>and</strong> edited in many stages. The \include<br />

comm<strong>and</strong> permits one <strong>to</strong> reprocess selective alterations in a short time,<br />

even if the numbering systems temporarily go awry. This can be repaired<br />

later on with a complete reprocessing of the entire document, by<br />

deactivating the \includeonly comm<strong>and</strong> in the preamble.<br />

A file that is read in with \include may not contain any \newcounter<br />

declarations. This is not much of a restriction, since they should normally<br />

be given in the preamble.<br />

For example, each chapter of a book might be written <strong>to</strong> a separate<br />

file with names chap1.tex, chap2.tex, . . . . The processing file itself<br />

contains the text<br />

\documentclass{book}<br />

. . . . . . . . . . . . . . . .<br />

\includeonly{...}<br />

\begin{document}<br />

\frontmatter<br />

\include{<strong>to</strong>c}<br />

\mainmatter<br />

\include{chap1}<br />

\include{chap2}<br />

. . .<br />

\backmatter<br />

\include{back}<br />

\end{document}<br />

where the file <strong>to</strong>c.tex contains only comm<strong>and</strong>s for the title page, table<br />

of contents, <strong>and</strong> other listings:<br />

\begin{titlepage} ... \end{titlepage}<br />

\tableofcontents \lis<strong>to</strong>ftables \lis<strong>to</strong>ffigures<br />

<strong>and</strong> back.tex those for bibliography <strong>and</strong> index:<br />

\bibliography{..}<br />

\printindex<br />

The chapters <strong>to</strong> be processed are selected by adding them <strong>to</strong> the argument<br />

of \includeonly, not by changing the \include comm<strong>and</strong>s, which must<br />

always be present <strong>to</strong> ensure that all the .aux are input every time. For<br />

example, by giving \includeonly{<strong>to</strong>c,chap3} one processes the table<br />

of contents <strong>and</strong> chapter 3.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!