测试 TeX 文件
SkillFiles & storageCompile TeX files through a regression testing framework to view rendering results, avoiding extra PDFs in the working directory
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the 测试 TeX 文件 skill
What this skill tells your AI
The instructions your AI receives, as published by open-guji/luatex-cn in .claude/skills/test-tex/SKILL.md and read by ahel’s review.
当需要编译并查看某个 TeX 文件的渲染效果时,必须通过回归测试框架来执行,避免在工作目录中生成多余的 PDF 文件。
参数
$ARGUMENTS:要测试的 tex 文件路径或名称(可选,如果不提供则根据上下文判断)
工作流程
1. 确定测试文件
- 已有文件:如果
test/regression_test/tex/下已存在该文件,直接使用 - 临时测试:如果需要创建临时 tex 文件,将其写入
test/regression_test/tex/目录下,文件名以_tmp_前缀标记(如_tmp_test.tex)
2. 编译并生成 PNG
python3 test/regression_test.py check test/regression_test/tex/<文件名>.tex
这会:
- 编译 TeX 文件生成 PDF
- 将 PDF 所有页面转换为 PNG(300dpi)
- PNG 保存在
test/regression_test/current/目录下 - 如果有基线则进行对比,没有基线也会生成 PNG
3. 查看渲染结果
使用 Read 工具读取生成的 PNG 文件来查看效果:
test/regression_test/current/<文件名>-1.png # 第1页
test/regression_test/current/<文件名>-2.png # 第2页
...
4. 清理临时文件
测试完成后,必须删除临时生成的 tex 文件(以 _tmp_ 前缀标记的文件):
rm test/regression_test/tex/_tmp_*.tex
test/regression_test/tex/ 目录下只保留需要长期持续回归验证的测试文件。
注意事项
- 禁止在其他目录中直接运行
lualatex编译生成 PDF - 禁止使用
pdftoppm等工具手动转换,统一由回归测试框架处理 - 临时文件用
_tmp_前缀,便于识别和清理 - 如果测试结果正确且需要长期保留,去掉
_tmp_前缀并用save保存基线
Signals
- GitHub stars
- 106
- Forks
- 10
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
test-tex- Source
- github.com/open-guji/luatex-cn