> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-pro.ayaka.space/latex/zh-cn/tex-latex-yuan-yu/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):

> 名为 SyncTEX 的同步 TeX 技术是 TEX 引擎的一项功能。它允许输入和输出之间同步，这意味着可以从源文档导航到排版结果，反之亦然。其工作方式如下：在排版 foo.tex 的过程中，TEX 引擎会在名为 foo.synctex 的辅助文件中写入一些几何信息，这些信息随后被编辑器或查看器用于在输入和输出之间导航。 `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://ayakaleaf-pro.ayaka.space/latex/zh-cn/tex-latex-yuan-yu/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.
