Tectonic
$ tectonic 社区开源 低风险Tectonic 是基于 Rust 编写的现代化 XeTeX 衍生排版引擎。与需要手动多次执行编译和 BibTeX 的传统 TeX Live 流程不同,tectonic -X compile 会自动多轮编译直至收敛,并按需下载缺失的样式宏包。
brew install tectonic 本地 LaTeX 转 PDF 属于文件系统构建任务,直接调用 tectonic -X compile 比经由 MCP 更加高效。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
单条 -X compile 命令即可自动完成多轮 LaTeX/BibTeX 收敛且出错返回非零退出码,无交互阻塞,但诊断日志为纯文本而非 JSON。
- Automatic multi-pass convergence eliminates manual
pdflatex+bibtexloops - Plain-text diagnostics with no
--jsonoutput flag
默认不开启类似 pdflatex 的 --shell-escape 命令执行能力,且支持 --only-cached 禁用联网,但常规首次运行会通过 HTTPS 下载宏包。
--only-cached(-C) enforces offline cache-only builds
单个 Rust 二进制即可通过 brew install tectonic、Cargo 或发布包安装,免去数 GB 规模的 TeX Live 安装。
- No multi-gigabyte TeX Live upfront download required
自动化宏包解析与多轮编译,显著减少 Agent 处理现有 .tex 工程的样板命令。
- Drop-in XeTeX-compatible compilation with automatic package fetching
由活跃社区(tectonic-typesetting/tectonic)维护的 MIT 开源项目。
- Open-source MIT repository on GitHub
官方 Tectonic 手册详尽记录了 V2(-X)子命令、缓存机制与 CLI 参数。
- Official Tectonic V2 book documentation
安全边界、鉴权与放权指南
无需凭据;仅在本地磁盘缓存下载的 TeX Live 资源包。
100% 免费且遵循 MIT 开源协议;仅在首次使用时拉取公开 TeX 资源包。
# Tectonic Agent Rules - Always specify `--outdir <dir>` so generated PDFs and auxiliary files stay isolated. - Pass `--only-cached` (`-C`) in air-gapped sandboxes or CI checks after the cache is warmed.
Agent 高频安全命令配方
只读查询(安全推荐)
tectonic -X compile main.tex --only-cached --outdir /tmp/tectonic-check
借助 --outdir 临时输出目录与 --only-cached 验证并构建 main.tex,避免网络请求或污染仓库。
受控写入与预演
tectonic -X compile main.tex --outdir build
自动解析引用并将生成的 PDF 写入 build,避免产物散落在源码目录中。
核心优势
- + 单二进制 Rust TeX 引擎省去数 GB 的 TeX Live 安装与手动多轮重编译。
- + 缓存预热后可使用
--only-cached实现确定性的离线构建。 - +
--outdir可将生成的 PDF 与源文件清晰隔离。
注意事项与踩坑点
- ! 首次用到新宏包时需要联网下载,除非事先缓存完备并启用
--only-cached。 - ! 不支持
--json诊断输出,编译报错以纯文本形式返回。