1

I am trying to use memoir class with longtable environment, but no success:

\documentclass{memoir}
\usepackage{longtable}

\begin{document}

\begin{longtable}
    \centering
    \caption{Caption of the normal \texttt{table} environment.}
    \begin{tabular}{rrrrrrrrr}
        1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
        1 & 1 & 1 & 1 & 1 & 1 & 1 & 1
    \end{tabular}
    \label{table}
\end{longtable}

\end{document}

Do the error:

 test2.tex:7: Class memoir Error:  Illegal pream-token (\centering): `c' used. [    \centering]

Changing longtable by table does work correctly with no errors or warnings. How to make the longtable to also work?


Related questions:

  1. How can I make a table that takes up more than a single page?
  2. Make a table span multiple pages
  3. Formatting captions in longtable tables
Werner
  • 603,163
user
  • 4,745

1 Answers1

2

\centering is automatic for long tables, and the caption is part of the environment. So try with this syntax:

\begin{longtable}{*{8}{c}}
    \caption{Caption of the normal \texttt{table} environment.}
    \label{table}\\
  \endfirsthead
\multicolumn{8}{c}{\tablename~\thetable\enspace(continued)}\\
  \endhead
        1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\
        1 & 1 & 1 & 1 & 1 & 1 & 1 & 1
\end{longtable}
Bernard
  • 271,350