summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-include.html
blob: e1158bfc6d288497eb4f35264bfaec79d788e7a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<head>
<title>UK TeX FAQ -- question label include</title>
</head><body>
<h3>What&rsquo;s going on in my <code>\</code><code>include</code> commands?</h3>
<p>The original LaTeX provided the <code>\</code><code>include</code> command to address the
problem of long documents: with the relatively slow computers of the
time, the companion <code>\</code><code>includeonly</code> facility was a boon.  With the
vast increase in computer speed, <code>\</code><code>includeonly</code> is less valuable
(though it still has its place in some very large projects).
Nevertheless, the facility is retained in current LaTeX, and causes
some confusion to those who misunderstand it.
<p>In order for <code>\</code><code>includeonly</code> to work, <code>\</code><code>include</code> makes a separate
<code>.aux</code> file for each included file, and makes a &lsquo;checkpoint&rsquo; of
important parameters (such as page, figure, table and footnote
numbers); as a direct result, it <em>must</em> clear the current page
both before and after the <code>\</code><code>include</code> command.  What&rsquo;s more, this
mechanism doesn&rsquo;t work if a <code>\</code><code>include</code> command appears in a file
that was <code>\</code><code>include</code>d itself: LaTeX diagnoses this as an error.
<p>So, we can now answer the two commonest questions about <code>\</code><code>include</code>:
<ul>
<li> Why does LaTeX throw a page before and after <code>\</code><code>include</code>
  commands?
<p>  Answer: because it has to.  If you don&rsquo;t like it, replace the
  <code>\</code><code>include</code> command with <code>\</code><code>input</code> &mdash; you won&rsquo;t be able to use
  <code>\</code><code>includeonly</code> any more, but you probably don&rsquo;t need it anyway, so
  don&rsquo;t worry.
<p><li> Why can&rsquo;t I nest <code>\</code><code>include</code>d files? &mdash; I always used to be
  able to under LaTeX 2.09.
<p>  Answer: in fact, you couldn&rsquo;t, even under LaTeX 2.09, but the failure
  wasn&rsquo;t diagnosed.  However, since you were happy with the behaviour
  under LaTeX 2.09, replace the <code>\</code><code>include</code> commands with <code>\</code><code>input</code>
  commands (with <code>\</code><code>clearpage</code> as appropriate).
</ul>
<p><p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=include">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=include</a>
</body>