Latex 问题:使用 /multirow 时未定义控制序列

发布于 2024-07-26 20:21:13 字数 873 浏览 3 评论 0原文

我只是想在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梅窗月明清似水 2024-08-02 20:21:13

尝试一下怎么样

\usepackage{multirow}

How about trying

\usepackage{multirow}

?

娇纵 2024-08-02 20:21:13

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

喜你已久 2024-08-02 20:21:13

编辑:您不想像您所写的那样将单元格合并到一行中,而是希望将单元格合并到一列中。 只需写入空单元格:

\begin{tabular}{|l|l|l|}  
\hline  
\multicolumn{3}{|c|}{Team sheet} \\  
\hline  
Goalkeeper & GK & Paul Robinson \\ \hline  
Defenders & LB & Lucus Radebe \\  
 & DC & Michael Duberry \\  
 & DC & Dominic Matteo \\  
 & RB & Didier Domi \\ \hline  
Midfielders & MC & David Batty \\  
 & MC & Eirik Bakke \\  
 & MC & Jody Morris \\ \hline  
Forward & FW & Jamie McMaster \\ \hline  
Strikers & ST & Alan Smith \\  
 & ST & Mark Viduka \\  
\hline  
\end{tabular}

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:

\begin{tabular}{|l|l|l|}  
\hline  
\multicolumn{3}{|c|}{Team sheet} \\  
\hline  
Goalkeeper & GK & Paul Robinson \\ \hline  
Defenders & LB & Lucus Radebe \\  
 & DC & Michael Duberry \\  
 & DC & Dominic Matteo \\  
 & RB & Didier Domi \\ \hline  
Midfielders & MC & David Batty \\  
 & MC & Eirik Bakke \\  
 & MC & Jody Morris \\ \hline  
Forward & FW & Jamie McMaster \\ \hline  
Strikers & ST & Alan Smith \\  
 & ST & Mark Viduka \\  
\hline  
\end{tabular}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文