Agent skill

Compare Layouts

by open-guji in open-guji/luatex-cn

比较 Original (ltc-guji.cls) 和 Digital (ltc-guji-digital.cls) TeX 文件的 layout 输出

Apache-2.0Auto-check passedDocuments & Office

Install Compare Layouts

skills CLI
$ npx skills add open-guji/luatex-cn --skill compare-layouts -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install open-guji/luatex-cn compare-layouts --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/open-guji/luatex-cn.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/compare-layouts .claude/skills/compare-layouts && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
compare-layouts
GitHub stars
119
Token cost
~550 tokens
SKILL.md length
85 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
Apache-2.0

At a glance

比较 Original (ltc-guji.cls) 和 Digital (ltc-guji-digital.cls) TeX 文件的 layout 输出

  • Works in 3 steps: 智能编译检测 → page_summary 比较 → 详细 Markdown 报告
  • Tasks that involve LaTeX
  • SKILL.md covers 使用方法, 手动分步操作, Layout JSON 结构 and 相关文件
  • Calls python3

What it does

Compare Layouts is an agent skill from open-guji/luatex-cn. 比较 Original (ltc-guji.cls) 和 Digital (ltc-guji-digital.cls) TeX 文件的 layout 输出

Its SKILL.md is about 550 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering LaTeX. The repository describes itself as: 基于LuaTeX的中文排版宏包,支持古籍版式精确复刻,以及符合W3C《中文排版需求》的现代中文排版. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve LaTeX

Example prompts

  • “/compare-layouts”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. 智能编译检测
  2. page_summary 比较
  3. 详细 Markdown 报告

What it can do on your machine

Read from SKILL.md and the folder at commit 8c48bdc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Compare Layouts loads about 550 tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 85 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~550

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from open-guji/luatex-cn at commit 8c48bdc, republished under its Apache-2.0 licence (© open-guji). 85 words, ~550 tokens.

Download SKILL.mdSave it as .claude/skills/compare-layouts/SKILL.md (or your agent's skills folder).
name
compare-layouts
description
比较 Original (ltc-guji.cls) 和 Digital (ltc-guji-digital.cls) TeX 文件的 layout 输出

Guji Layout Compare

比较原始和数字化 TeX 文件的排版一致性。

使用方法

Python 脚本(推荐)
bash
# 基本用法:自动检测编译、比较、生成报告
python3 scripts/digitalize/compare_guji_layouts.py original.tex digital.tex

# 强制重新编译
python3 scripts/digitalize/compare_guji_layouts.py original.tex digital.tex --force

# 指定报告输出路径
python3 scripts/digitalize/compare_guji_layouts.py original.tex digital.tex -o report.md

# 只比较已有的 JSON(跳过编译)
python3 scripts/digitalize/compare_guji_layouts.py original.tex digital.tex --no-compile
功能特性
  1. 智能编译检测

    • 自动检查 layout JSON 是否存在
    • 验证 JSON 中的 source_mtime 字段与 TeX 文件修改时间
    • 仅在需要时编译,避免重复编译浪费时间
  2. page_summary 比较

    • 优先使用简化的 page_summary 字段(无坐标,仅文字内容)
    • 支持夹注双列([右小列|左小列] 格式显示)
    • 自动统计总字数
    • 兼容旧版 JSON(fallback 到 pages 字段逐字符比较)
  3. 详细 Markdown 报告

    • 概要统计(页数、字数、匹配率)
    • 差异总结表格
    • 第一处差异的详细逐列对比
    • PDF 页面截图对比(需要 pdftoppm)
输出示例
## 步骤三:比较排版
  原始 48 页 / 数字化 41 页
  匹配页数:14
  总字数:13224(一致)
  前 10 页完全一致
  第一处差异在 PDF第11页(对开第5页·右)

## 步骤四:生成报告
  详细报告已保存至:排版一致性比较报告.md

手动分步操作

如果需要手动控制编译流程:

步骤 1: 导出 Layout JSON
bash
cd path/to/tex && ENABLE_EXPORT=1 lualatex yourfile.tex
# → yourfile-layout.json

ENABLE_EXPORT=1 lualatex yourfile-digital.tex
# → yourfile-digital-layout.json
步骤 2: 只比较(跳过编译)
bash
python3 scripts/compare_guji_layouts.py yourfile.tex yourfile-digital.tex --no-compile

Layout JSON 结构

从 v0.2.9 开始,导出的 layout JSON 包含:

json
{
  "version": "1.0",
  "generator": "luatex-cn",
  "source_file": "yourfile.tex",
  "source_mtime": 1771885547,
  "document": { ... },
  "page_summary": [
    {"page": 0, "type": "spread_right", "cols": ["欽定四庫全書", "", ...]},
    ...
  ],
  "pages": [ ... ]
}
  • page_summary: 每页每列的简化文字内容(用于快速比较)
  • pages: 完整的字符位置/坐标信息(用于精确分析)

相关文件

  • 比较脚本: scripts/digitalize/compare_guji_layouts.py
  • Export 模块: tex/core/luatex-cn-core-export.lua
  • 转换工具:
    • scripts/digitalize/semantic_to_digital.py — 语义→数字化转换
    • scripts/digitalize/digital_to_semantic.py — 数字化→语义逆向转换
    • scripts/digitalize/plugins/ — 转换插件(如四库全书简明目录)

© open-guji, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/compare-layouts of open-guji/luatex-cn.

Open the folder on GitHubat commit 8c48bdc

Compare with similar skills

Compare Layouts next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Compare Layouts compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Compare Layouts this skillopen-guji/luatex-cn119—~550Automated safety check: PassApache-2.0
Research Writingalfonso0512/research-writing-skill4881 repos~818Automated safety check: PassMIT
Paper WritingMLNLP-World/Paper-Writing-Tips4.7k—~630Automated safety check: PassNone
Evomath TaoEvoScientist/EvoSkills4762 repos~3.8kAutomated safety check: PassApache-2.0
Math Modeling to EI Conference Paperjihe520/MathModelAgent6.2k—~688Automated safety check: PassNone
PaperjurySpark-To-Paper-Skills/paperjury1.2k—~5.3kAutomated safety check: PassMIT

Similar skills

  • Research Writing

    alfonso0512/research-writing-skill

    科研论文写作助手,提供 30 个 Prompt 模板覆盖论文写作全流程. An agent skill from alfonso0512/research-writing-skill.

    488 GitHub starsUsed in 1 repo~818 tokens
    Documents & OfficeAuto-check passed
  • Paper Writing

    MLNLP-World/Paper-Writing-Tips

    学术论文写作检查与优化助手。基于 MLNLP-World 社区整理的论文写作技巧,帮助检查和优化学术论文。Use when: (1) 检查论文 LaTeX 格式和排版, (2) 优化公式符号使用, (3) 改进图表设计, (4) 润色英文学术表达, (5) 检查参考文献格式, (6) 投稿前终稿检查, (7) 用户询问论文写作技巧或规范。

    4.7k GitHub stars~630 tokensUpdated 13 days ago
    Documents & OfficeAuto-check passed
  • Evomath Tao

    EvoScientist/EvoSkills

    A skill your agent uses whenever the user submits a non-trivial mathematical claim that needs a rigorous proof or audit.

    476 GitHub starsUsed in 2 repos~3.8k tokens
    Documents & OfficeAuto-check passed
  • Rewrites a math modeling competition paper into an English EI conference submission, using a bundled IEEE LaTeX template, with evidence tracked back to the original paper.

    6.2k GitHub stars~688 tokensUpdated 6 days ago
    Documents & OfficeAuto-check passed
  • Paperjury

    Spark-To-Paper-Skills/paperjury

    Three modes for CS-conference papers (CVPR/ICCV/ECCV vision, ACL/EMNLP/NAACL NLP, ICLR/NeurIPS/ICML/AAAI ML).

    1.2k GitHub stars~5.3k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Compiledeck

    scunning1975/MixtapeTools

    Create and compile beautiful Beamer presentations following the Rhetoric of Decks philosophy.

    473 GitHub starsUsed in 2 repos~3.1k tokens
    Documents & OfficeAuto-check passed

More from open-guji/luatex-cn

All 8 skills in this repo
  • Convert To Digital

    open-guji/luatex-cn

    将 ltc-guji.cls 文件转换为 ltc-guji-digital 格式. An agent skill from open-guji/luatex-cn.

    119 GitHub stars~747 tokensUpdated 7 days ago
    Auto-check passed
  • Prepare Next Version

    open-guji/luatex-cn

    准备下一个补丁版本 (Prepare next patch version release). An agent skill from open-guji/luatex-cn.

    119 GitHub stars~412 tokensUpdated 7 days ago
    Auto-check passed
  • Regression Test

    open-guji/luatex-cn

    运行视觉回归测试验证代码更改是否正确,支持 basic/pastissue/complete 套件及基线更新. An agent skill from open-guji/luatex-cn.

    119 GitHub stars~350 tokensUpdated 7 days ago
    Auto-check passed
  • Test Tex

    open-guji/luatex-cn

    通过回归测试框架编译并查看 TeX 文件的渲染效果,避免在工作目录生成多余 PDF. An agent skill from open-guji/luatex-cn.

    119 GitHub stars~278 tokensUpdated 7 days ago
    Auto-check passed
  • Fix GitHub Issue

    open-guji/luatex-cn

    修复 GitHub Issue 的完整工作流

    119 GitHub stars~2k tokensUpdated 7 days ago
    Auto-check passed
  • Refactor

    open-guji/luatex-cn

    清理重构代码 (Code cleanup and refactoring)

    119 GitHub stars~532 tokensUpdated 7 days ago
    Auto-check passed

Questions about Compare Layouts

What does Compare Layouts do?

比较 Original (ltc-guji.cls) 和 Digital (ltc-guji-digital.cls) TeX 文件的 layout 输出. Compare Layouts is an agent skill from open-guji/luatex-cn.

When should I use Compare Layouts?

Compare Layouts fits situations like: tasks that involve LaTeX.

How do I install Compare Layouts in Claude Code?

Run `npx skills add open-guji/luatex-cn --skill compare-layouts -a claude-code`. Or copy the skill folder (.claude/skills/compare-layouts in open-guji/luatex-cn) into .claude/skills/compare-layouts in your project. Claude Code loads it when a task matches its description.

How do I install Compare Layouts in Codex?

Run `npx skills add open-guji/luatex-cn --skill compare-layouts -a codex`. Or copy the skill folder (.claude/skills/compare-layouts in open-guji/luatex-cn) into .agents/skills/compare-layouts in your project. Codex loads it when a task matches its description.

Can I use Compare Layouts in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add open-guji/luatex-cn --skill compare-layouts -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/compare-layouts, .gemini/skills/compare-layouts, .github/skills/compare-layouts and .opencode/skills/compare-layouts in your project.

What does Compare Layouts need to run?

Going by SKILL.md and its folder, Compare Layouts needs the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Compare Layouts access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Compare Layouts safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Compare Layouts use?

Compare Layouts is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Compare Layouts use?

About 550 tokens (SKILL.md is roughly 2.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Compare Layouts?

Skills that share tags, products or a category with Compare Layouts: Research Writing (alfonso0512/research-writing-skill, 488 stars), Paper Writing (MLNLP-World/Paper-Writing-Tips, 4.7k stars), Evomath Tao (EvoScientist/EvoSkills, 476 stars) and Math Modeling to EI Conference Paper (jihe520/MathModelAgent, 6.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Compare Layouts?

open-guji (a GitHub organization) maintains it in open-guji/luatex-cn, which has 119 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 2, 2026.

Source: open-guji/luatex-cn on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.