> 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/zhi-shi-ku/069-how-to-jump-to-the-source-code-from-the-typeset-pdf-synctex.md).

# 如何從排版後的 PDF 跳至原始碼（SyncTeX）

Overleaf 可讓您從排版後的 PDF 中某個位置跳到 LaTeX 原始碼中對應的位置，反之亦然。 **注意**: 如果您的專案主 `.tex` 檔案儲存在資料夾內，這項功能將無法運作（也就是說，它必須放在專案的最上層（根）層級）。其他幾個可能的原因列於 [這裡](/latex/zh-tw/zhi-shi-ku/132-synctex-errors.md).

您可以選擇以下其中一種方式：

* 在 PDF 上按兩下，Overleaf 編輯器就會捲動到原始碼中對應的位置；或者
* 使用位於原始碼面板與預覽面板之間分隔線上的箭頭鍵，從原始碼跳到預覽，或從預覽跳到原始碼：

![顯示 Overleaf 箭頭的圖片，可從原始碼跳到預覽，或從預覽跳到原始碼](/files/b255831dbef24adcd878210cf084cae7cff12523)

如果您沒有看到那些箭頭，或是雙擊 PDF 沒有效果，您需要確認專案的 PDF 檢視器已設為「Overleaf」，而不是「Browser」。這裡有一段短片，示範如何設定專案的 PDF 檢視器，並展示 Overleaf 的原始碼／PDF 同步功能。

{% embed url="<https://videos.ctfassets.net/nrgyaltdicpt/2xt7xSOvXcVqKZEAkxoaJi/76436c82c9382f8e78c84140c96deb40/SyncTeX_video.mp4>" %}

### SyncTeX：這項 Overleaf 功能背後的 TeXnology

Overleaf 的「跳到原始碼位置」與「跳到 PDF 位置」功能是使用 SyncTeX 實作的；這是所有 TeX 引擎都內建的一項標準功能。對 SyncTeX 簡介有興趣的讀者可以在……中進一步了解 [這篇 Overleaf 文章](/latex/zh-tw/geng-duo-zhu-ti/39-mltex-enctex-and-synctex-tex-extensions.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/zhi-shi-ku/069-how-to-jump-to-the-source-code-from-the-typeset-pdf-synctex.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.
