# ExactTeX：让 LaTeX 拥有类型检查

Original title: ExactTex. A gradually-typed superset of LaTeX

> Hacker News story 49521631 · language: zh · submitted 2026-09-01
> Web version: https://zeli.app/zh/story/49521631
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 28 · by [camilochs](<https://news.ycombinator.com/user?id=camilochs>) · 💬 20
[original](<https://github.com/camilochs/exacttex>) · [HN discussion](<https://news.ycombinator.com/item?id=49521631>)

## Summary

ExactTeX 是一个为 LaTeX 引入渐进式类型系统的超集。它允许用户在保留原有 .tex 文件兼容性的同时，通过添加少量注解来获得引用检查、安全重命名和错误提示。与传统 LaTeX 不同，ExactTeX 能在生成 PDF 之前就发现引用错误，并用用户自定义的命名来报告问题。该项目由 Rust 编写，零依赖，支持 WebAssembly 在浏览器中运行，并提供了 LSP 支持。通过渐进式类型系统，用户可以选择性地对文档进行注解，未注解部分仍作为普通 LaTeX 处理，确保了平滑的迁移路径。

## Key quote

> 在查看 PDF 之前，你就能知道文档是否无误。

## HN discussion (20 comments)

### [cvanelteren](<https://news.ycombinator.com/item?id=49572973>)

> 我希望 tex 能被 typst 取代。在我看来，用 typst 写东西要愉快得多。

### [yiyu_earth](<https://news.ycombinator.com/item?id=49573248>)

> 我不认为在 AI 辅助编程如此普及的今天，编写原生 LaTeX 代码会很难。相比之下，使用“输出 LaTeX 代码的编译器”可能稳定性更差。

### [podocarp](<https://news.ycombinator.com/item?id=49573349>)

> LaTeX 的问题肯定不在类型系统，除非你要维护上百行的宏和定义。我觉得一个主要问题在于，很难用一维形式表达二维内容。咱们先不说公式，光画 tikz 就够让人头疼了。这感觉就像写正则表达式，画完一次我就再也不想碰它了。
>
> 有时候我宁愿直接用 inkscape 画好，然后嵌入 PDF。
>
> 还有审美问题。现在这行当还是有点像西部荒野，你经常看到有人用斜体的 d 表示导数，而不是用正体粗体的微分算子形式。我猜是因为输入那些符号比直接打个“d”要麻烦得多。肯定还有很多其他例子，但这是最常见的。有些在白板上很自然的东西，用 LaTeX 敲出来就不那么直观了。
>
> 总之，LaTeX 作为它现在的样子已经够用了，而且有了 AI，未来可能会更好。也许以后我只要让 AI 自动把所有斜体的“d”改过来就行，这样排版上的小瑕疵就能在后期自动修复。不过这么做可能会惹恼一些人吧 :)

---

## Cite

- Page: https://zeli.app/zh/story/49521631
- Date: 2026-09-01
- Source: github.com (https://github.com/camilochs/exacttex)
- Hacker News: https://news.ycombinator.com/item?id=49521631

## Other languages

- en: https://zeli.app/story/49521631 · markdown: https://zeli.app/story/49521631.md
- ja: https://zeli.app/ja/story/49521631 · markdown: https://zeli.app/ja/story/49521631.md
- ko: https://zeli.app/ko/story/49521631 · markdown: https://zeli.app/ko/story/49521631.md
- de: https://zeli.app/de/story/49521631 · markdown: https://zeli.app/de/story/49521631.md
- es: https://zeli.app/es/story/49521631 · markdown: https://zeli.app/es/story/49521631.md
- ru: https://zeli.app/ru/story/49521631 · markdown: https://zeli.app/ru/story/49521631.md
