列宽格式随表格变化

列宽格式随表格变化

我肯定是做错了什么,但是我严格按照示例进行操作(尽可能严格地保证),而 LaTeX 仍然拒绝编译该文档:

ERROR: LaTeX Error: Illegal character in array arg.

--- TeX said ---

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.4 \begin{tabular}{>{\bfseries}rl}

--- HELP ---
There is an illegal character in the argument of an array or tabular
environment, or in the second argument of a \multicolumn command.

这是我的 MWE:

\documentclass{article}

\begin{document}
\begin{tabular}{>{\bfseries}rl}
  hi & bye
\end{tabular}
\end{document}

答案1

我明白了——曾是一个相当愚蠢的错误。

我的来源没有提到你必须\usepackage{array}

\documentclass{article}
\usepackage{array}

\begin{document}
\begin{tabular}{>{\bfseries}rl}
  hi & bye
\end{tabular}
\end{document}

按预期工作。

相关内容