Latex 问题:使用 /multirow 时未定义控制序列
我只是想在 Latex 中将表格的一行中的一些单元格组合起来。 例如, 我尝试编译下表:
\begin{tabular}{|l|l|l|}
\hline
\multicolumn{3}{|c|}{Team sheet} \\
\hline
Goalkeeper & GK & Paul Robinson \\ \hline
\multirow{4}{*}{Defenders} & LB & Lucus Radebe \\
& DC & Michael Duberry \\
& DC & Dominic Matteo \\
& RB & Didier Domi \\ \hline
\multirow{3}{*}{Midfielders} & MC & David Batty \\
& MC & Eirik Bakke \\
& MC & Jody Morris \\ \hline
Forward & FW & Jamie McMaster \\ \hline
\multirow{2}{*}{Strikers} & ST & Alan Smith \\
& ST & Mark Viduka \\
\hline
\end{tabular}
然后我收到错误:
! Undefined control sequence.
<recently read> \multirow
l.821 \multirow
有人知道我做错了什么吗? 我需要特殊的包裹吗? 有趣的是,多列命令正在工作! 诡异的。
I simple want to combine some cells in a row of a table in Latex. For instance,
I tried to compile the following table:
\begin{tabular}{|l|l|l|}
\hline
\multicolumn{3}{|c|}{Team sheet} \\
\hline
Goalkeeper & GK & Paul Robinson \\ \hline
\multirow{4}{*}{Defenders} & LB & Lucus Radebe \\
& DC & Michael Duberry \\
& DC & Dominic Matteo \\
& RB & Didier Domi \\ \hline
\multirow{3}{*}{Midfielders} & MC & David Batty \\
& MC & Eirik Bakke \\
& MC & Jody Morris \\ \hline
Forward & FW & Jamie McMaster \\ \hline
\multirow{2}{*}{Strikers} & ST & Alan Smith \\
& ST & Mark Viduka \\
\hline
\end{tabular}
Then I get the error:
! Undefined control sequence.
<recently read> \multirow
l.821 \multirow
Does anyone have an idea what I am doing wrong? Do I need a special package? Interestingly enough, the multicolumn command is working! Weird.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试一下怎么样
?
How about trying
?
Multirow 不是一个定义的命令。 这是因为 LaTeX 中的表格结构:逐行。 您可以使用 \cline 命令来确保行之间的水平线不会分隔第一列,但标签“Defenders”仍位于单元格的顶部。
看来多行包(完整的 MikTeX 发行版附带)解决了这个问题。
另请参阅:
多行包手册
多行小教程
Multirow is not a defined command. This is because of the structure of tables in LaTeX: line by line. You can use the \cline command to make sure that horizontal lines between rows do not separate the first column, but the label "Defenders" would still be at the top of the cell.
It seems that the multirow package (which comes with the complete MikTeX distribution) addresses this issue.
See also:
Manual of the multirow package
Small tutorial on multirow
编辑:您不想像您所写的那样将单元格合并到一行中,而是希望将单元格合并到一列中。 只需写入空单元格:
EDIT: You don't want to combine cells in a row, as you have wrote, but you want to combine cells in one column. Simply write empty cells: