ltxtable: longtable meets tabularx

David Carlisle

1995/12/11

Since tabularx was put on the archives in 1992 or so I have had a constant stream of email messages asking for a merged tabularx/longtable package.

Well here it is! (First draft, anyway.) Rules of the game:

• Put the longtable environment using tabularx style X column specifiers in a file file on its own. (You can use the filecontents environment to include it back into the main document file, if you wish.)

• If you want to input the file at some point, using the X columns to force the table width to be width wide, go \LTXtable{width}{file}.

• \multicolumn: If you read the tabularx and longtable docs you will find that both packages have a lot of fun with this command. In order to keep my sanity, for this merger I disable longtable’s version of \multicolumn. This means that the column widths calculated are not always the same (not as good as) the widths that would be calculated by an equivalent tabularx environment. Perhaps one day I will do something about this. Perhaps.

A 300pt rule, just so can see the required width. First a tabularx

the  head  line
the  foot  line !!!
a  b  b
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx c

a b

b b b b b b b b b b b b b b b b b b b b b b b b b b

a a  b b  c c

a a b b

c c c c c c c c c c c c c c c c c c c c c c c c c c c c c cc cc

a a aaaa b b  c ccccc

Then a longtable

the  head  line
a  b  b
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx c

a b

b b b b b b b b b b b b b b b b b b b b b b b b b b

a a  b b  c c
the  foot  line

the  head  line

a a b b

c c c c c c c c c c c c c c c c c c c c c c c c c c c c c cc cc

a a aaaa b b  c ccccc
the  foot  line