74

I've got data that I need to include in a table, but there's a lot if it. I've played with the font size and table formatting as much as I can, but the table still won't fit on the page. Is there anyway to make a table that spans multiple pages with LaTeX?

lockstep
  • 250,273
vanden
  • 30,891
  • 23
  • 67
  • 87

4 Answers4

62

Use the longtable package (see also the documentation).

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
vanden
  • 30,891
  • 23
  • 67
  • 87
13

I would recommend using the xtab package, which is designed as a improvement of the supertabular package.

Leone
  • 576
José Figueroa-O'Farrill
  • 4,125
  • 2
  • 27
  • 35
8

An alternative solution with longtblr environment of the new LaTeX3 package tabularray:

\documentclass[12pt]{article}
\usepackage[a6paper,margin=10mm]{geometry}

\usepackage{tabularray} \usepackage{xcolor}

\usepackage{hyperref} \hypersetup{colorlinks}

\begin{document}

Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text.

\begin{longtblr}[ caption = {Long Long Tabular Long Long Long Tabular}, entry = {Short Caption}, label = {tblr:test}, note{a} = {It is the first footnote.}, note{$\dag$} = {It is the second long long long long long long footnote.}, ]{ colspec = {XXX}, width = 0.85\linewidth, hlines, rowhead = 2, rowfoot = 1, row{1-2} = {purple7}, row{Z} = {blue7}, row{3-Y} = {gray9}, } Head & Head & Head \ Head & Head & Head \ Alpha & Beta & Gamma \ Epsilon & Zeta & Eta \ Iota & Kappa & Lambda \ Nu & Xi & Omicron \ Rho & Sigma & Tau \ Phi & Chi & Psi \ Alpha & Beta & Gamma \ Epsilon & Zeta\TblrNote{a} & Eta \ Iota & Kappa\TblrNote{$\dag$} & Lambda \ Nu & Xi & Omicron \ Rho & Sigma & Tau \ Phi & Chi & Psi \ Alpha & Beta & Gamma \ Epsilon & Zeta & Eta \ Iota & Kappa & Lambda \ Nu & Xi & Omicron \ Rho & Sigma & Tau \ Phi & Chi & Psi \ Foot & Foot & Foot \ \end{longtblr}

Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text.

\end{document}

enter image description here

L.J.R.
  • 10,932
  • This is good with automatic table title in the second page.

    By the way, to use "tabularray", maybe you should do something else.

    For overlef, one way is useful: Menu -> TeX Live Version -> 2021.

    – ML Xu Oct 31 '22 at 08:57
6

Depending on your overall requirements and the shape of the data in the table, you might also consider dropping your longtable into a landscape environment, as provided, e.g., by the pdflscape package.

Leone
  • 576