我在 Overleaf 中遇到了一些类似的红点错误,但它仍然可以顺利编译。缩小问题范围后,我发现这是因为使用了数学模式Shortunderstack
。
我该如何解决这个问题?以下是错误:
unclosed \begin{adjustbox} found at \end{array} unclosed \begin{adjustbox} found at \end{table} unexpected \end{array} after $ unexpected \end{array} after \begin{adjustbox} unclosed $ found at \end{table} unclosed open group { found at $ unexpected $ after open group { unexpected $ after \begin{array} unclosed $ found at \end{array}
\documentclass[journal]{IEEEtran}
\usepackage{array}
\usepackage{mathtools}
\usepackage{booktabs,capt-of}
\usepackage[export]{adjustbox}
\usepackage[usestackEOL]{stackengine}
\begin{document}
\begin{table}[!t]
\centering
\caption{A table}
\label{tab:table 1}
\begin{adjustbox}{max width=\linewidth}
$\setlength{\arraycolsep}{1pt}
\begin{array}{cc@{}cccccccl @{\quad}l }
\toprule
\textbf{No} & \multicolumn{9}{c}{\textbf{List}} & \multicolumn{1}{c}{\textbf{Note}} \\
\midrule
1 & ( & x_1, & x_2, & x_3, & x_1, & x_5, & x_6, & x_7 & ) & \Shortunderstack[l]{This is an example \\ of two line text}\\
\addlinespace
2 & ( & y_1, & y_2, & y_3, & y_4, & y_5, & y_6, & y_7 & ) & \Shortunderstack[l]{Math expression error $x_1+x_2$ } \\
\bottomrule
\end{array}$
\end{adjustbox}
\end{table}
%
\end{document}
答案1
除了通知 Overleaf 的工作人员之外,你对此没有其他办法。
另一方面,adjustbox
和\Shortunderstack
是不需要的。
\documentclass[journal]{IEEEtran}
\usepackage{array}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{lipsum} % for mock text
\begin{document}
\lipsum[1-5]
\begin{table}[t]
\centering
\caption{A table}
\label{tab:table 1}
% local command
\newcommand{\stack}[1]{\begin{tabular}[t]{@{}l@{}}#1\end{tabular}}
$\setlength{\arraycolsep}{1pt}
\begin{array}{@{}cc@{}cccccccl @{\enspace}l@{}}
\toprule
\textbf{No} & \multicolumn{9}{c}{\textbf{List}} & \multicolumn{1}{c}{\textbf{Note}} \\
\midrule
1 & ( & x_1, & x_2, & x_3, & x_1, & x_5, & x_6, & x_7 & ) &
\stack{This is an example \\ of two line text}\\
\addlinespace
2 & ( & y_1, & y_2, & y_3, & y_4, & y_5, & y_6, & y_7 & ) &
\stack{Math expression error \\ $x_1+x_2$ } \\
\bottomrule
\end{array}$
\end{table}
\lipsum
\end{document}