[Tex/LaTex] Differences between longtable and xtab

longtablepackagessupertabulartablesxtab

I have a pretty simple table that needs to span multiple pages. This seems like a job for either the supertabular/xtab package or the longtable package.

The voting on the answers to this question suggest that longtable is the preferred package, yet xtab is much newer and has been revised since that question was asked.

What are the differences between xtab and longtable and when is one preferable to the other?

Best Answer

longtable is part of the core LaTeX distribution so guaranteed to be present, however that is less of a difference these days as most people use TeX distributions such as MiKTeX or TEX Live which ensure that contributed packages as well as the core latex distribution are present.

As egreg noted in comments, the main difference between longtable and supertabular/xtab is that longtable preserves column widths across page boundaries. It also uses the normal output routine mechanism of page breaking which (compared to the original supertabular at least) tended to give rather better page breaks if row sizes are irregular. Especially if you are printing double sided and the table covers a two page spread, having different column widths on different pages can be distracting and make it look more like two tables than one long one (or at least I thought so, that was one reason for producing longtable:-).

The main disadvantages to longtable are (1) the reliance on the output routine which makes it tricky to use with different output routines such as the standard latex twocolumn or multicol package and (2) the way the table head and foot are managed as boxes means that it is harder to have varying material such as marks or running totals in longtable heads than in supertabular/xtab.