You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

LaTeX表格编译报错:Illegal character in array arg. 求修复方案

解决LaTeX表格的“Illegal character in array arg”错误

Hey, let's break down why you're hitting that ! LaTeX Error: Illegal character in array arg. message and fix it up quickly.

错误根源

The main issue is super straightforward: in your tabular environment's column specifier ({1 1 1 1 1}), you used the Arabic numeral 1—but LaTeX only accepts valid column alignment identifiers here, like l (left-aligned), c (centered), or r (right-aligned). Numbers aren't allowed in this position, which triggers the illegal character error.

On top of that, there are two small syntax issues in your code that need fixing:

  • You used HTML-escaped & instead of LaTeX's native column separator &
  • Your \multicolumn commands are missing curly braces around the final content argument (LaTeX requires the format \multicolumn{num}{spec}{content})

修复后的完整代码

Here's the corrected version of your table code that should compile without errors:

%Table
\begin{table}
\caption{Drag Breakdown - Component method}
\label{table:PWDT}
\centering
\small
\renewcommand{\arraystretch}{1.25}
\begin{tabular}{l c c c c} 
\hline\hline
\multicolumn{1}{c}{\textbf{Components}} &
\multicolumn{1}{c}{\textbf{C$_{d-sf}$}} &
\multicolumn{1}{c}{\textbf{C$_{do}$}} &
\multicolumn{1}{c}{\textbf{C$_{di}$}} &
\multicolumn{1}{c}{\textbf{C$_{D}$}} \\
\multicolumn{1}{c}{(1)} &
\multicolumn{1}{c}{(2)} &
\multicolumn{1}{c}{(3)} &
\multicolumn{1}{c}{(4)} &
\multicolumn{1}{c}{(5)} \\
\hline
Wing & 0.1 & 0.2 & 0.3 & 0.4 \\
\hline
\multicolumn{2}{l}{} \\
\hline\hline
\end{tabular}
\normalsize
\end{table}

关键修复点总结

  • Fixed column specifier: Changed {1 1 1 1 1} to {l c c c c} (you can adjust this to all c for full centering, or mix l/r as needed for specific columns)
  • Replaced escaped characters: Swapped all & with LaTeX's standard & column separator
  • Corrected \multicolumn syntax: Added curly braces around the content part of each \multicolumn command (e.g., \multicolumn{1}{c}{\textbf{Components}} instead of \multicolumn{1}{c}\textbf{Components})

内容的提问来源于stack exchange,提问作者Kushal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 10:05:25