> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/zh-cn/latex-cuo-wu/17-latex-error-something-s-wrong-perhaps-a-missing-item.md).

# LaTeX 错误：有问题——也许是缺少 \item

当你忘记包含一个 **`\item`** 命令。它也可能出现在试图在表格中错误地使用列表时。

## 常见原因

**忘记写 \item：**

这种错误最基本的例子是：你已经告诉 LaTeX 你要编写一个列表，但你还没有用 **`\item`** 标签标记你的列表条目。下面显示了一个例子

```latex
\begin{itemize}
这是我们列表中的第一个条目
\end{itemize}
```

在这里，你是通过使用 **`itemize`** 环境告诉 LaTeX 你正在编写一个列表。所犯的错误是你没有用 **`\item`**。这将产生如下所示的错误：

main.tex，第 6 行

LaTeX 错误：出了点问题——也许缺少 \item。

请参阅 LaTeX 手册或 LaTeX Companion 以获得说明。键入 H 可立即获得帮助。... l.6 \end{itemize} 尝试键入以继续。如果那不起作用，键入 X 退出。

编写该列表的正确方式是：

```latex
\begin{itemize}
\item 这是我们列表中的第一个条目
\end{itemize}
```

参见 [这里](/latex/zh-cn/latex-ji-chu/04-lists.md) 以了解更多关于如何在 LaTeX 中创建不同类型列表的信息。

**在表格中错误地编写列表：**

如果你尝试使用列表为表格中的单元格编号，也会出现此错误，如下所示。

```latex
\begin{tabular}{l}
  \begin{enumerate}
  \item 这是第一个条目\\ \hline
  \item 这是第二个条目
  \end{enumerate}
\end{tabular}
```

这是一个错误，因为列表不能以这种方式用于给表格单元格编号。解决上述问题的一种方法是创建一个计数器。可以通过添加

```latex
\newcounter{rownumbers}
\newcommand\rownumber{\stepcounter{rownumbers}\arabic{rownumbers}}
```

到你的文档导言区（参见 [这里](http://tex.stackexchange.com/questions/21243/automatic-table-row-numbers)）。然后你可以将上面的示例写成

```latex
\begin{tabular}{l r}
  \rownumber & 这是第一个条目\\ \hline
  \rownumber & 这是第二个条目
\end{tabular}
```

![Listexample.PNG](/files/15854b381769022bdffc734168c98213594d94cf)

要了解更多关于如何创建计数器的信息，请查看我们的 [文档](/latex/zh-cn/ge-shi-hua/10-counters.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/zh-cn/latex-cuo-wu/17-latex-error-something-s-wrong-perhaps-a-missing-item.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
