如何解决“包 longtable 错误:longtable 不是处于 1 列模式。”错误?

如何解决“包 longtable 错误:longtable 不是处于 1 列模式。”错误?

我正在尝试在 tex 文件中使用两个表,如下所示:

\documentclass[pmlr,twocolumn,10pt]{jmlr}

\usepackage{mathtools}
\let\Bbbk\relax
\usepackage{graphicx}
\let\Bbbk\relax

\usepackage[justification=centering]{caption}
\usepackage{color}
\usepackage{rotating}
\definecolor{mygreen}{gray}{0.8}
\usepackage{makecell}
\usepackage{xcolor}
\usepackage{multirow}
\usepackage{float}
\usepackage{longtable}
% \usepackage{tabularx}

\newcommand{\correctitem}{\item[\stepcounter{tabenum}\colorbox{mygreen}{\thetabenumi}]}

\setlength\fboxsep{0pt}


\usepackage{booktabs,colortbl}  
\definecolor{rowgray}{gray}{0.9}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%

\usepackage{booktabs}
\usepackage{siunitx}

\newcommand{\cs}[1]{\texttt{\char`\\#1}}
\newcommand{\equal}[1]{{\hypersetup{linkcolor=black}\thanks{#1}}}
\theorembodyfont{\upshape}
\theoremheaderfont{\scshape}
\theorempostheader{:}
\theoremsep{\newline}
\newtheorem*{note}{Note}

\begin{document}
\pagebreak
\section*{Predictions from the best model}
\label{tab:predictions}
\subsection{Correct Predictions}
\begin{table}[htbp]
\begin{tabular}{|p{18em}|c|c|c|c|b{5em}|c|}
    \hline
        {\bf Question} & {\bf Correct option} & {\bf Options} & {\bf Prediction} \\ \hline
         Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus : & D & \vbox{\hbox{\strut}\hbox{\strut A. Bone conduction hearing aids}\hbox{\strut B. Fenestration}\hbox{C. Stapes fixation}\hbox{D. Cochlear implant}} & D \\ \hline
        Lorem ipsum dolor sit amet, consectetuer adipiscing: & A & \vbox{\hbox{\strut}\hbox{\strut A. Lateral cutaneous nerve of the thigh}\hbox{\strut B. Sural nerve}\hbox{\strut C. Medial cutaneous nerve of the thigh}\hbox{\strut D. Femoral nerve}} & A \\
        \hline
        Lorem ipsum dolor sit amet, consectetuer adipiscing? & A & \vbox{\hbox{\strut}\hbox{\strut A.Tyrosine}\hbox{\strut B.Glycine}\hbox{\strut C.Methionine}\hbox{D.Tryptophan}} & A \\
        \hline
         Lorem ipsum dolor sit amet, consectetuer adipiscing & A & \vbox{\hbox{\strut}\hbox{\strut A.Diazepam}\hbox{\strut B.Phenytoin}\hbox{\strut C. Carbamazepine}\hbox{\strut D.Valproate}} & A \\
        \hline
        Lorem ipsum dolor sit amet, consectetuer adipiscing? & A & \vbox{\hbox{\strut}\hbox{\strut A. Celecoxib}\hbox{\strut B.Acetaminophen}\hbox{\strut C.Ketorolac}\hbox{\strut D.Aspirin}}&A \\
        \hline
\end{tabular}
\end{table}

\bigskip
\subsection{Incorrect Predictions}
\bigskip
\begin{longtable}{|p{20em}|c|c|c|c|b{8em}|c|}
    \hline
        {\bf Question} & {\bf Correct option} & {\bf Options} & {\bf Prediction} \\ \hline
         Lorem ipsum dolor sit amet, consectetuer adipiscing? & D & \vbox{\hbox{\strut}\hbox{\strut A. Miltefosine}\hbox{\strut B. Amphotericin}\hbox{C. Amphotericin}\hbox{D. Amphotericin}} & A \\ \hline
         Lorem ipsum dolor sit amet, consectetuer adipiscing, & C & \vbox{\hbox{\strut}\hbox{\strut A. Amikacin}\hbox{\strut B. Rifampicin}\hbox{\strut C. Vancomycin}\hbox{\strut D. Amphotericin}} & B \\
        \hline
         Lorem ipsum dolor sit amet, consectetuer adipiscing: & A & \vbox{\hbox{\strut}\hbox{\strut A.Neutropenia}\hbox{\strut B.Anemia}\hbox{\strut C.Polycythemia}\hbox{D.Neutrophilia}} & C \\
        \hline
         Lorem ipsum dolor sit amet, consectetuer adipiscing Lorem ipsum dolor sit amet, consectetuer adipiscing Lorem ipsum dolor sit amet, consectetuer adipiscing Lorem ipsum dolor sit amet, consectetuer adipiscing? & C & \vbox{\hbox{\strut}\hbox{\strut A.Staph aureus}\hbox{\strut B.Pneumococcus}\hbox{\strut P. jerovecii}\hbox{\strut Pseudomonas}} & B \\
        \hline
         Lorem ipsum dolor sit amet, consectetuer adipiscing? & B & \vbox{\hbox{\strut}\hbox{\strut A. 34}\hbox{\strut B.50}\hbox{\strut C.Nil}\hbox{\strut D.68}}&A \\
        \hline
\end{longtable}

\end{document}

看起来像这样:

在此处输入图片描述

Package longtable Error: longtable not in 1-column mode.

如何让表格变得更好并解决这个问题?

相关内容