> 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/21-latex-error-unknown-graphics-extension-.xxx.md).

# LaTeX 錯誤：未知的圖形副檔名：.XXX

當你使用了 LaTeX 無法辨識的圖形副檔名時，就會出現此錯誤。當你使用了不正確的檔案路徑，導致 LaTeX 混淆時，也可能出現此錯誤。

LaTeX 中允許的圖片格式取決於你所使用的編譯器。這可在左側選單中指定，如下所示。

![Choosecompiler.PNG](/files/348ae28858bae119d7006de162e4a6c255510f61)

**使用……編譯 `pdfLaTeX`:**

當使用……編譯時 `pdfLaTeX`，你可以選擇多種圖片格式。如下所列

* JPG - 這是最常見的基本用途圖片格式。它不佔太多空間，而且在大多數情況下都很適合插入圖片。
* PNG - 這也是另一種非常常見的格式。由於它是無損格式，因此更適合需要較高解析度的圖片。圖表應以 PNG 格式插入
* EPS - 若要在使用 `pdfLaTeX`編譯時使用 EPS 圖片，你必須使用 [`epstopdf` 套件](https://www.google.ie/#q=ctan+etstopdf).
* PDF - 這對於在你的 LaTeX 專案中加入文件很有用。它像 EPS 一樣支援向量圖形，因此當你想為海報等大型文件使用高解析度圖片時非常實用。

**使用 LaTeX 編譯：**

當使用 LaTeX 編譯時，你唯一可以使用的圖片格式是 *封裝式 PostScript* 或 *EPS*。EPS 檔案是以向量為基礎，這表示影像在縮放時不會失真，因此當你想建立海報等大型文件並使用高品質圖片時非常有用。EPS 檔案會自然宣告圖片的尺寸，所以 LaTeX 更容易以良好的方式安排文字和圖形。

## 常見原因

**使用不受支援的圖片格式：**

此錯誤最常見的原因，是使用了某個編譯器不支援的圖片格式，例如 **`.gif`** 或 **`.ps`** 。最好的解決方法是在可行時將其轉換為受支援的格式。

**使用不良的檔名：**

只要 LaTeX 看到句點，就會將其後的內容解讀為副檔名。因此，如果檔名中有句點，例如 `image.logo.jpg`，LaTeX 就會混淆，因為它會以為副檔名是 `.logo.jpg`。因此，你必須一律為圖片命名，並確保標題中不要有句點。


---

# 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/21-latex-error-unknown-graphics-extension-.xxx.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.
