PaperMirror: VS Code / Cursor LaTeX 中文镜像预览插件写英文 TeX,右侧读中文镜像:面向论文作者的 LaTeX 中文预览、TeX AI 翻译与写作审阅工具。 VS Code Marketplace · GitHub Releases · English 如果 PaperMirror 对你的写作流程有帮助,欢迎在 VS Code Marketplace 评分或给 GitHub 仓库点 Star,这会帮助更多需要 LaTeX 中文预览的人找到它。 PaperMirror 是一个面向中文科研作者的 VS Code / Cursor 插件,用于把当前英文 常见搜索词:VS Code LaTeX 翻译、Cursor LaTeX preview、TeX 中文预览、LaTeX Chinese preview、LaTeX AI translation、OpenAI-compatible paper translation。 PaperMirror 不是 PDF 翻译器,也不是 TeX 编译器。它的核心是 只翻译新增或修改过的 LaTeX block,未变化内容尽量复用本地缓存,因此更适合在写作期间持续打开使用。 适合这些场景
核心特性
安装VS Code Marketplace在 VS Code 或 Cursor 扩展面板中搜索:
如果按功能搜索,也可以尝试: VSIX也可以从 GitHub Releases 下载
Cursor 也支持相同的 VSIX 安装方式。 快速开始
保存后,PaperMirror 会刷新右侧中文预览。命中缓存时,只会请求改动过的 block。如果验证命令提示 provider 没有真正输出中文,请先更换模型或 provider,再清空 cache 重刷整篇论文。 首次配置四步在 VS Code / Cursor Settings 里搜索
填完后运行 使用建议
Provider 配置PaperMirror 使用 OpenAI-compatible Chat Completions 接口。当前支持的 provider 预设:
DeepSeek 示例:
SiliconFlow 常用设置:
Marketplace 分类与关键词扩展分类:
关键词覆盖: 重要设置
每次修改 provider、base URL、model 或 API key 后,都建议先运行 当前边界
隐私PaperMirror 不修改 常见问题PaperMirror 会修改我的
|
| Order | Setting | Required? | Notes |
|---|---|---|---|
| 1 | paperMirror.provider |
Required | Choose OpenAI, DeepSeek, Ollama, SiliconFlow, or Custom. |
| 2 | API key | Required for cloud providers | Prefer PaperMirror: Set API Key, which stores the key in VS Code SecretStorage. paperMirror.apiKey also works but is less secure. Ollama usually does not need a key. |
| 3 | paperMirror.baseUrl |
Required for Custom | DeepSeek, SiliconFlow, OpenAI, and Ollama can use preset defaults. Custom endpoints must set this. Do not include /chat/completions. |
| 4 | paperMirror.model |
Depends on provider | DeepSeek and SiliconFlow have defaults. OpenAI, Ollama, and Custom usually need an explicit model name. |
After changing these fields, run PaperMirror: Validate API Connection. Native VS Code Settings does not provide an embedded test button, so validation is available from the Command Palette (Ctrl+Shift+P) or the PaperMirror preview menu. When validation fails, PaperMirror tries to explain the exact layer: missing required fields, API key source and format, base URL, model, JSON Mode, timeout, or provider-side errors.
Usage Tips
- First translation of a long document: place the TeX cursor near the paragraph or section you want to read first before opening or refreshing the preview. PaperMirror captures the cursor position at refresh start and prioritizes nearby blocks.
- Normal writing flow: edit the
.texfile and pressCtrl+S. Save-triggered refreshes send only newly added or modified blocks when cache is available. - Use full retranslation carefully:
Full Retranslate (costs tokens)in the preview...menu clears cache and retranslates the current file as a fresh document. Use it mainly for cache problems, large English fallback areas, or clearly broken preview state.
Provider Configuration
PaperMirror uses OpenAI-compatible Chat Completions APIs. Supported provider presets:
- OpenAI
- DeepSeek
- Ollama
- SiliconFlow
- Custom OpenAI-compatible endpoint
DeepSeek example:
{
"paperMirror.provider": "deepseek",
"paperMirror.baseUrl": "https://api.deepseek.com",
"paperMirror.model": "deepseek-v4-flash",
"paperMirror.updateMode": "onSave",
"paperMirror.translateComments": false,
"paperMirror.showReferenceMarkersInTranslations": false
}
Common SiliconFlow settings:
{
"paperMirror.provider": "siliconflow",
"paperMirror.baseUrl": "https://api.siliconflow.cn/v1",
"paperMirror.model": "Pro/zai-org/GLM-4.7"
}
paperMirror.baseUrl should be the base URL only. Do not include /chat/completions; PaperMirror appends it automatically. Run PaperMirror: Validate API Connection after changing provider, base URL, or model.
Marketplace Categories And Keywords
Categories:
- Other
Keywords include latex, tex, latex translation, tex translation, latex preview, chinese preview, AI translation, academic writing, paper writing, research writing, MathJax, OpenAI, DeepSeek, Ollama, SiliconFlow, OpenAI-compatible, and Cursor.
Key Settings
| Setting | Type | Description |
|---|---|---|
paperMirror.provider |
Required | Provider preset: openai, deepseek, ollama, siliconflow, or custom. |
paperMirror.apiKey |
Optional alternative | Not recommended for long-term use; PaperMirror: Set API Key is safer. |
paperMirror.baseUrl |
Endpoint | Preset providers can leave this empty; Custom must set it. Use the base URL only. |
paperMirror.model |
Model | DeepSeek and SiliconFlow have defaults; OpenAI, Ollama, and Custom usually need an explicit model. |
paperMirror.updateMode |
Common | onSave or manual. Default: onSave. |
paperMirror.maxBlocksPerRequest |
Advanced | Maximum blocks per provider request. |
paperMirror.maxBlocksPerRefresh |
Advanced | Maximum blocks to translate per refresh. 0 means unlimited. |
paperMirror.translateComments |
Optional | Whether to translate LaTeX comments. Default: false. |
paperMirror.showReferenceMarkersInTranslations |
Optional | Whether to show [cite], [ref], and [url] in translations. Default: false. |
paperMirror.previewFontFamily / paperMirror.previewFontSize |
Appearance | Font family and font size for the Chinese preview. |
paperMirror.requestTimeoutMs |
Advanced | Timeout for each provider request. |
After changing provider, base URL, model, or API key, run PaperMirror: Validate API Connection to confirm that the endpoint works and the selected model actually returns Chinese. The failure message reports whether the key came from SecretStorage or Settings; if Settings looks correct but validation returns 401, rerun PaperMirror: Set API Key first.
Current Scope
- v0.1.9 supports the active
.texfile only. - Full recursive
\input/\includeproject parsing is not supported yet. - Long-document preview reuses cache, fills content progressively, and prioritizes blocks near the current cursor or missing from cache; actual completion speed still depends on provider latency.
- If
paperMirror.maxBlocksPerRefreshis set above0, one refresh may process only part of the missing queue, and remaining content needs another refresh. Retranslate blockretries only the selected preview block; if the provider still returns English or invalid output, that block stays as English fallback with a warning.Full Retranslate (costs tokens)is a recovery action: it clears the current-file cache and retranslates the current.tex, so it is not intended for normal save refreshes.- PaperMirror is not a TeX compiler and does not guarantee final PDF layout fidelity.
- Complex tables, TikZ,
algorithm2e, and custom macros are mostly shown as placeholders. - Math rendering uses MathJax and supports complex TeX package syntax on a best-effort basis.
- The Chinese preview is a writing aid, not a formal translation or submission artifact.
Privacy
PaperMirror does not modify your .tex source file. Text blocks that need translation are sent to the provider you configure. When using PaperMirror: Set API Key, the API key is stored in VS Code SecretStorage by default.
FAQ
Does PaperMirror modify my .tex file?
No. It reads the active .tex file and renders a Chinese preview beside it.
Is PaperMirror a PDF translator?
No. PaperMirror is designed for .tex drafting and lightweight writing-time review.
Can it protect formulas and citations?
PaperMirror tries to protect equations, citations, labels, URLs, and common LaTeX commands. Complex package-specific syntax is handled on a best-effort basis.
Does it re-translate the whole paper after every save?
No. It caches translations by block and prioritizes newly added or modified content.
What if the preview turns English after clearing cache?
Run PaperMirror: Validate API Connection first. PaperMirror tries to detect provider output that is still English and avoids caching it. If validation fails, switch to a model, provider, or endpoint that follows the Chinese translation prompt more reliably. If cache or preview state looks wrong, use Full Retranslate (costs tokens) from the preview ... menu to clear cache and retranslate the current file.
What does Stop Translating stop?
It stops only the current translation refresh request. It does not modify the .tex source file and does not clear the already visible preview. Click Refresh again to continue unfinished blocks.
License
MIT.