3

I have a problem when I use the longtable package in a beamer environment. This is my code :

\documentclass[12pt]{beamer}
\documentclass[aspectratio=169]{beamer}
\usepackage{graphicx}

\usepackage{graphics}
\usepackage{hyperref}
\usepackage{wrapfig}
\usepackage{verbatim, longtable}

\usepackage[frenchb]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc} 
\usepackage{lmodern}

\newenvironment{wideitemize}{\itemize\addtolength{\itemsep}{10pt}}{\enditemize}

\begin{document}
    \begin{frame}[t,allowframebreaks]
        \begin{longtable}{|p{7cm}|p{2.5cm}|p{2.5cm}|}
            \caption{\textit{Power test comparison}} \\ \endhead
            \hline
            \multicolumn{3}{|c|}{Single} \\
            \hline
            & Acceptance & Rejection\\
            \hline \hline 
            50\% of MCAR & 95.2 & 95.8 \\
            \hline
            50\% of MAR, first  & 0 & 3\\   
            \hline
            50\% of MAR, second  & 0 & 1.2\\   
            \hline
            50\% of MAR, third  & 0 & 3.4\\   
            \hline
            50\% of MAR, fourth  & 0 & 2.9\\   
            \hline \newpage \hline
            \multicolumn{3}{|c|}{Mixed} \\
            \hline
            & Acceptance & Rejection\\
            \hline \hline
            40\% of MAR and 10\% of MCAR & 0 & 4.6 \\
            hline
            30\% of MAR and 20\% of MCAR & 0 & 6.9 \\
            \hline
            20\% of MAR and 30\% of MCAR & 0 & 12 \\
            \hline
            10\% of MAR and 40\% of MCAR & 0 & 24.9 \\
            \hline
            5\% of MAR and 45\% of MCAR & 0 & 50.6 \\
            \hline
            4\% of MAR and 46\% of MCAR & 0 & 57.6 \\
            \hline
            3\% of MAR and 47\% of MCAR & 1.8 & 71.1 \\
            \hline
            2\% of MAR and 48\% of MCAR & 31.4 & 82.6 \\
            \hline
            1\% of MAR and 49\% of MCAR & 82.8 & 92.4 \\
            \hline
            \end{longtable}
    \end{frame}
\end{document}

Latex says that there are different error types :

  • Undefined control sequence
  • Use of \LT@array doesn't match its definition.
  • Argument of \beamer@sortzeroread has an extra }.
  • Paragraph ended before \beamer@sortzeroread was complete.
  • Missing \endcsname inserted.

Can you please help me? What should I do knowing that I don't want to redo everything by using a simple table, because I need this size for my table parts. Moreover, I would like to have the possibility of cutting the longtable in different frames.

  • 5
    I doubt this could work without a lot of effort (unless someone has already done it and made a package) beamer is designed for no automatic page breaking with the allowframebreaks as a get out clause to allow something, so it has a different output routine longtable also uses a differemt output routine but has to make some assumptions about the current one to hand over at the changes. Really in a beamer presentation in 999 times out of a 1000 you want to manually control the breaks, just add \end{tabular}\end{frame}\begin{frame}\begin{tabular}{....} at each point where you want a break. – David Carlisle Mar 30 '16 at 11:37
5

I doubt this could work without a lot of effort (unless someone has already done it and made a package) beamer is designed for no automatic page breaking with the \allowframebreaks as a get out clause to allow something, so it has a different output routine, longtable also uses a different output routine but has to make some assumptions about the current one to hand over at the changes. Really in a beamer presentation in 999 times out of a 1000 you want to manually control the breaks, just add

\end{tabular}\end{frame}\begin{frame}\begin{tabular}{....} 

at each point where you want a break.

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.