summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-longtab.html
blob: bb98b0bf4d59a3e3311bd019e6a05642f11fd042 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<head>
<title>UK TeX FAQ -- question label longtab</title>
</head><body>
<h3>Tables longer than a single page</h3>
<p/>Tables are, by default, set entirely in boxes of their own: as a
result, they won&#8217;t split over a page boundary.  Sadly, the world keeps
turning up tables longer than a single page that we need to typeset.
<p/>For simple tables (whose shape is highly regular), the simplest
solution may well be to use the <code>tabbing</code> environment,
which is slightly tedious to set up, but which doesn&#8217;t force the whole alignment
onto a single page.
<p/>The <i>longtable</i> package builds the whole table (in chunks), in
a first pass, and then uses information it has written to the <code>.aux</code>
file during later passes to get the setting &#8220;right&#8221; (the package
ordinarily manages to set tables in just two passes).  Since the
package has overview of the whole table at the time it&#8217;s doing
&#8220;final&#8221; setting, the table is set &#8220;uniformly&#8221; over its entire
length, with columns matching on consecutive pages.
<i>longtable</i> has a reputation for failing to interwork with
other packages, but it does work with <i>colortbl</i>, and its
author has provided the <i>ltxtable</i> package to provide (most
of) the facilities of <i>tabularx</i> (see

<a href="FAQ-fixwidtab.html">fixed-width tables</a>) for long tables:
beware of its rather curious usage constraints &#8212; each long table
should be in a file of its own, and included by
<code>\</code><code>LTXtable{</code><em>width</em><code>}{</code><em>file</em><code>}</code>.  Since <i>longtable</i>&#8217;s
multiple-page tables can&#8217;t possibly live inside floats, the package
provides for captions within the <code>longtable</code> environment
itself.
<p/>A seeming alternative to <i>ltxtable</i> is <i>ltablex</i>; but
it is outdated and not fully functional.  Its worst problem is its
strictly limited memory capacity (<i>longtable</i> is not so
limited, at the cost of much complication in its code);
<i>ltablex</i> can only deal with relatively small tables, it doesn&#8217;t seem
likely that support is available; but its user interface is much
simpler than <i>ltxtable</i>, so if its restrictions aren&#8217;t a
problem for you, it may be worth a try.
<p/>The <i>supertabular</i> package starts and stops a
<code>tabular</code> environment for each page of the table.  As a
result, each &#8216;page worth&#8217; of the table is compiled independently, and
the widths of corresponding columns may differ on successive pages.
However, if the correspondence doesn&#8217;t matter, or if your columns are
fixed-width, <i>supertabular</i> has the great advantage of doing
its job in a single run.
<p/>Both <i>longtable</i> and <i>supertabular</i> allow definition
of head- and footlines for the table; <i>longtable</i> allows
distinction of the first and last head and foot.
<p/>The <i>xtab</i> package fixes some infelicities of
<i>supertabular</i>, and also provides a &#8220;last head&#8221; facility
(though this, of course, destroys <i>supertabular</i>&#8217;s advantage
of operating in a single run).
<p/>The <i>stabular</i> package provides a simple-to-use &#8220;extension to
<code>tabular</code>&#8221; that allows it to typeset tables that run over
the end of a page; it also has usability extensions, but doesn&#8217;t have
the head- and footline capabilities of the major packages.
<p/>Documentation of <i>ltablex</i> is to be found in the package file.
<dl>
<dt><tt><i>longtable.sty</i></tt><dd>Distributed as part of <a href="http://www.tex.ac.uk/tex-archive/macros/latex/required/tools.zip">macros/latex/required/tools</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/required/tools/">browse the directory</a>); <a href="http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/longtable.html">catalogue entry</a>
<dt><tt><i>ltablex.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/ltablex/ltablex.sty">macros/latex/contrib/ltablex/ltablex.sty</a>
<dt><tt><i>ltxtable.sty</i></tt><dd>Generate by running <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/carlisle/ltxtable.tex">macros/latex/contrib/carlisle/ltxtable.tex</a>
<dt><tt><i>stabular.sty</i></tt><dd>Distributed as part of <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/sttools.zip">macros/latex/contrib/sttools</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/sttools/">browse the directory</a>); <a href="http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/stabular.html">catalogue entry</a>
<dt><tt><i>supertabular.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/supertabular.zip">macros/latex/contrib/supertabular</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/supertabular/">browse the directory</a>)
<dt><tt><i>xtab.sty</i></tt><dd><a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/xtab.zip">macros/latex/contrib/xtab</a> (or <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/xtab/">browse the directory</a>)
</dl>
<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=longtab">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=longtab</a>
</body>