# multipage tables with ctable package

Does anybody know if it is possible to have a multipage table with the package ctable (I know that it is possible with longtable)?

My code is the following:

 \documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{subfig}
\usepackage{rotating}
\usepackage{ctable}

\begin{document}
\ctable[
caption = Data Definitions and Sources,
label = data,
sideways
]
{>{\bfseries}l p{0.3\columnwidth} c  c  p{0.3\columnwidth}}
{
}
{ \FL
....
}
\end{document}

-
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. Could you reduce your example only with the needed packages? –  Claudio Fiandrino Dec 27 '12 at 13:42
\ctable makes a floating object; you need longtable for this application. –  egreg Dec 27 '12 at 13:53

If you want to keep the ctable input syntax and easily switch between tabularx based formatting and longtable based formatting you could do something like the following which adds a long key to ctable.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\usepackage[backend=bibtex8, style=authoryear]{biblatex}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{ctable}
\usepackage{multirow}
\usepackage{pbox}
\usepackage{longtable}

\makeatletter

\newif\if@ctbl@long
\define@key{ctbl}{long}[]{\@ctbl@longtrue}

\long\def\foo#1\sbox#2!!{%
\long\expandafter\def\csname\string\ctable\endcsname[##1]##2##3##4{%
#1\if@ctbl@long\ctbl@long\fi\sbox#2}}

\expandafter\expandafter\expandafter\foo
\csname\string\ctable\endcsname[#1]{#2}{#3}{#4}!!

\def\ctbl@long\fi\sbox#1#2#3\@ctblend{\fi
\ctbl@@long#2%
}

\long\def\ctbl@@long#1#2#3#4#5#6{%
\ctbl@@@long#6%
}

\def\ctbl@@@long#1\begin#2#3#4\end#5{%
\def\@tempa{#5}%
\def\@tempb{tabular}%
\ifx\@tempa\@tempb\else\show\@tempa\ERROR\fi
\begin{longtable}{#3}%
\caption{\@ctblcaption\ifx\@ctbllabel\empty\else\label{\@ctbllabel}\fi}%
\caption*{\@ctblcaption\space(continued)}%
#4\end{longtable}}

\makeatother

\begin{document}
\ctable[
caption = Data Definitions and Sources,
label = data,
long
]
{>{\bfseries}l p{0.3\columnwidth} c  c  p{0.3\columnwidth}}
{
}
{ \FL
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\a&b&c\\
}
\end{document}

-
@Wybo Dekker: For your consideration: I'd love to see this as a regular option in the ctable-Package, precisely to be able to switch easily from one layout to the other! Preferably together with further options (ctable-style) to handle tableheads and -tails etc. This would finally make ctable the one solution as an interface to all table-packages I've ever needed... –  Florian Jul 18 at 14:11