> 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/tex-latex-ji-yuan/12-synctex.md).

# \synctex

该 `\synctex` 原语是由以下内容提供给 TEX 的一个附加功能： [SyncTEX 扩展](https://ctan.org/tex-archive/support/synctex-parser?lang=en)。SyncTEX 可以通过 TEX 引擎命令行选项激活或停用，也可以直接在 TEX 源文件中通过以下 `\synctex` 原语：

**用法示例**

* 要激活 SyncTEX，请使用 `\synctex=1` 到你的 `.tex` 文件；
* 要禁用 SyncTEX，请使用 `\synctex=0` 到你的 `.tex` 文件；

引用自以下说明： [CTAN](https://ctan.org/tex-archive/support/synctex-parser?lang=en):

> 同步 TeX 技术，名为 SyncTEX，是 TEX 引擎的一项功能。它允许输入与输出之间同步，这意味着可以在源文档与排版结果之间双向导航。其工作方式如下：在排版 `foo.tex`的过程中，TEX 引擎会将一些几何信息写入一个名为 `foo.synctex`的辅助文件中，然后编辑器或查看器利用这些信息在输入与输出之间导航。

Overleaf 支持 SyncTEX。

#### 关于 SyncTEX 的更多信息

* [Jérôme Laurens 撰写的 TUGBoat 文章](http://www.tug.org/TUGboat/tb29-3/tb93laurens.pdf)，他是 SyncTEX 的作者。
* 该 [GitHub 仓库](https://github.com/jlaurens/synctex) 关于 SyncTEX 解析器的。


---

# 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/tex-latex-ji-yuan/12-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.
