summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-include.html
blob: baf7f0ec470fd743b746a284c0cb0de4331ac00b (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&#8217;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 &#8216;checkpoint&#8217; 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&#8217;s more, this
mechanism doesn&#8217;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&#8217;t like it, replace the
  <code>\</code><code>include</code> command with <code>\</code><code>input</code> &#8212; you won&#8217;t be able to use
  <code>\</code><code>includeonly</code> any more, but you probably don&#8217;t need it anyway, so
  don&#8217;t worry.
<p/><li> Why can&#8217;t I nest <code>\</code><code>include</code>d files? &#8212; I always used to be
  able to under LaTeX 2.09.
<p/>  Answer: in fact, you couldn&#8217;t, even under LaTeX 2.09, but the failure
  wasn&#8217;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>