LaTeX:将枚举环境添加到表格环境
我正在尝试将有序列表(enumerate
)添加到 LaTeX
中的表格(tabular
),其中包含以下内容:
\begin{tabular}{|l|l|}
\hline
Event Flow &
\begin{enumerate}
\item This is item 1
\item This is item 2
\end{enumerate}
\\
\hline
\end{tabular}
但我得到以下内容错误:
! LaTeX 错误:有什么 错误——可能缺少\item。
参见 LaTeX 手册或 LaTeX 求同伴解释。 H型 立即寻求帮助。 ...
<前><代码> l.34 \项目 T 他是第 1 项?
谁能告诉我到底是什么问题吗?
因为当我将 enumerate
环境置于 tabular
环境之外时,它就可以工作了;所以我猜我目前在表格示例中遗漏了一些东西。
I am trying to add an ordered list (enumerate
) to a table (tabular
) in LaTeX
with the following:
\begin{tabular}{|l|l|}
\hline
Event Flow &
\begin{enumerate}
\item This is item 1
\item This is item 2
\end{enumerate}
\\
\hline
\end{tabular}
But I am getting the following error:
! LaTeX Error: Something's
wrong--perhaps a missing \item.See the LaTeX manual or LaTeX
Companion for explanation. Type H
for immediate help. ...l.34 \item T his is item 1 ?
Can anyone please tell me what is the problem exactly?
Because when I put the enumerate
environment outside of the tabular
environment, it works; so guess I am currently missing something with my example of the table.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下工作:
我猜问题是枚举环境需要处于垂直模式:您可以尝试使用 \vbox。
The following works:
I'm guessing the trouble is that the enumerate environment needs to be in vertical mode: you could experiment with a \vbox.
您可以使用以下解决方案:
换句话说,您可以通过简单地创建段落类型列(具有指定的宽度)来避免对
minipage
的需要。这会编译为You could use the following solution:
In other words, you can avoid the need for a
minipage
by simply creating a paragraph type column (which has a specified width). This compiles to