0

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
  • Do you need longtable? – Werner Aug 15 '17 at 17:48
  • Well, the table by itself does not fit in only one page. So would be nice if it split by itself. – user Aug 15 '17 at 17:49
  • 1
    I'd suggest starting with longtable by using the example code at the end of the longtable doumentation. – Werner Aug 15 '17 at 17:54
  • @Werner, the one at the page 10? – user Aug 15 '17 at 18:01
  • Indeed. Start there, and remove the content you don't need, and change whatever you want to keep. You won't see the construction you started with. Starting with the documentation is always good. – Werner Aug 15 '17 at 18:46
1

\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}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.