> 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-tw/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`**&#x6A19;示你的清單項目。這將產生如下所示的錯誤：

main.tex，第 6 行

LaTeX 錯誤：出了點問題——也許是少了 \item。

請參閱 LaTeX 手冊或《LaTeX Companion》以取得說明。輸入 H 可立即取得幫助。... l.6 \end{itemize} 試著輸入以繼續。如果沒有用，輸入 X 結束。

撰寫此清單的正確方式是：

```latex
\begin{itemize}
\item 這是我們清單中的第一個項目
\end{itemize}
```

參見 [這裡](/latex/zh-tw/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/4f5c61497aac2a7f26d9026866657064b97f136a)

若要進一步了解如何建立計數器，請查看我們的 [說明文件](/latex/zh-tw/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-tw/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.
