Skip to content
Skills Library
Documents & office · Review & audit

did-it-sub

/did-it-sub

检查并规范文章与 PPT 中化学式的大小写和上下标(角标),重点是角标是否真正生效。生成或编辑含化学式的 Word、PowerPoint、Markdown、HTML、纯文本内容时使用,尤其适合交付前校验。触发词:化学式格式、化学式检查、角标、上下标、下标、上标、H2O、Ca2+、SO4 2-、化学排版、chemical formula、subscript、superscript。

Repository
did-it-sub ↗
Licence
MIT
Last repository change
13.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
3
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 3 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/check_chemistry.py, scripts/chem_data.py, scripts/fix_chemistry.py

What it does and when to use it

检查并规范文章与 PPT 中化学式的大小写和上下标(角标),重点是角标是否真正生效。生成或编辑含化学式的 Word、PowerPoint、Markdown、HTML、纯文本内容时使用,尤其适合交付前校验。触发词:化学式格式、化学式检查、角标、上下标、下标、上标、H2O、Ca2+、SO4 2-、化学排版、chemical formula、subscript、superscript。

Original author description

检查并规范文章与 PPT 中化学式的大小写和上下标(角标),重点是角标是否真正生效。生成或编辑含化学式的 Word、PowerPoint、Markdown、HTML、纯文本内容时使用,尤其适合交付前校验。触发词:化学式格式、化学式检查、角标、上下标、下标、上标、H2O、Ca2+、SO4 2-、化学排版、chemical formula、subscript、superscript。

How it works

  1. Overview
  2. 何时使用
  3. 工作流
  4. 脚本用法
  5. 问题类型
  6. 误报与边界
  7. 资源
Original SKILL.md headings · 90 lines, 330 words
SKILL.md preview
---
name: did-it-sub
display_name: 下标了没 · 化学式角标检查器
display_name_en: Did It Sub? - Chemical Notation Checker
description: 检查并规范文章与 PPT 中化学式的大小写和上下标(角标),重点是角标是否真正生效。生成或编辑含化学式的 Word、PowerPoint、Markdown、HTML、纯文本内容时使用,尤其适合交付前校验。触发词:化学式格式、化学式检查、角标、上下标、下标、上标、H2O、Ca2+、SO4 2-、化学排版、chemical formula、subscript、superscript。
description_zh: AI 生成的 H2O 常常看着没问题,那个 2 却根本没有下标格式。本技能按载体读取真正的角标属性,逐处报出位置、原文、问题与改法,并检查元素大小写、电荷上标、计量系数、同位素与单位指数。纯本地运行,零第三方依赖。
description_en: Verify chemical formula notation in articles and slide decks - real subscripts and superscripts (Word vertAlign, PowerPoint baseline, HTML sub/sup), element capitalization, ionic charges, stoichiometric coefficients, isotopes and unit exponents. Fully local, zero dependencies.
examples_zh:
  - "检查这份 PPT 里的化学式角标"
  - "帮我看看这篇稿子的 H2O、Ca2+ 格式对不对"
  - "交付前跑一遍化学式格式校验"
examples_en:
  - "Check the chemical subscripts in this deck"
  - "Verify H2O and Ca2+ notation in my draft"
  - "Run a final chemical notation check before delivery"
version: 1.0.3
author: "独立开发者"
agent_created: true
---

# 下标了没 · Did It Sub?|化学式格式检查(文章 / PPT 交付前必做)

> 研究时的副产品,按 MIT 开源,不承诺持续维护。规范与规则表见 `references/`。

## Overview

把化学式角标当作**格式属性**而非普通字符来校验。检查器会按载体读取真实的角标信息(Word 的 `w:vertAlign`、PPT 的 `a:rPr@baseline`、HTML 的 `<sub>/<sup>`、Markdown 的 Unicode/LaTeX 角标),因此能发现「看起来写了 H2O 但 2 根本没下标」这类在文章和 PPT 里最常见的错误,也避免在 PPT 里用 Unicode 下标字符冒充角标导致字体缺字。

核心能力:元素符号大小写、原子个数下标、离子电荷上标、计量系数与结晶水系数、同位素与单位指数、反应箭头、大小写歧义(CO/Co)。

## 何时使用

- 生成或编辑任何含化学式的文章、报告、论文、讲义、实验记录(`.docx` / `.md` / `.html` / `.txt`)。
- 制作或改写含化学式的 PPT(`.pptx`),尤其是幻灯片、表格、图表标签、备注页。
- 交付前做最后一道格式校验,或把检查接入生成流水线作门禁。
- 用户提到「角标」「上下标」「化学式格式不对」「H2O 要改成 H₂O」等。

不用于:配平方程式、判断物质是否真实存在、结构式/SMILES、中文命名规范、字体正斜体的自动判定(后者需人工复核)。

## 工作流

### 阶段 1 — 生成阶段:写入前就写对

1. 读取 `references/notation-rules.md`,确认大小写、上下标、系数、电荷、单位的判定规则。
2. 读取 `references/carrier-guide.md`,**按目标载体选择角标实现方式**:
   - Word:把化学式拆成多个 run,只对数字设 `run.font.subscript = True`,对电荷设 `run.font.superscript = True`。
   - PPT:把数字/电荷拆成独立 `a:r`,设置 `baseline="-25000"` / `"30000"`。**不要用 Unicode 下标字符充数**——中文主题字体常缺字形。
   - HTML:用 `<sub>` / `<sup>` 标签。
   - Markdown / 纯文本:直接写 Unicode 角标 `H₂O`、`Ca²⁺`,或用 `$H_2O$`、`H~2~O`。
3. 若已有纯文本/Markdown 草稿,先跑 `scripts/fix_chemistry.py` 做一次规范化,再进入排版环节。该脚本只改 `.md` / `.txt`,**不要用于 `.docx` / `.pptx`**(会破坏 run 级格式)。
4. 元素符号一律用**正体**。公式编辑器默认斜体,务必人工改正(检查器无法自动判定字体)。

### 阶段 2 — 交付前:必须跑校验

1. 对最终交付文件运行检查器,生成报告:

   ```bash
   python3 scripts/check_chemistry.py <文件或目录> --report report.md --json result.json
   ```

2. 读报告,按级别处理:
   - **error**:必须修正。逐条按「建议改法」列里针对该载体的动作改,不要只把文本换成 `H₂O` 了事——在 Word/PPT 里要改的是 run 属性。
   - **warning**:PPT 的 Unicode 角标、元素符号被下沉等,建议改。
   - **info**:歧义(CO/Co)、单位写法、同位素、文本箭头,结合上下文人工确认;确认无误可忽略。
3. 修正后**重跑**,直到 error 为 0。自动化流水线加 `--fail-on-error`,让不合格直接返回退出码 1。
4. 人工复核两项检查器不覆盖的内容:元素符号是否正体、化学式本身是否正确/配平是否成立。
5. 向用户交付时,简要说明检查了哪些文件、发现并修正了什么、剩余 warning/info 有哪些。

## 脚本用法

> **按操作系统选解释器**:macOS / Linux 用 `python3`(macOS 默认**没有** `python` 命令);Windows 用 `python`。下表以 macOS 为例,Windows 上把 `python3` 换成 `python` 即可。脚本仅用标准库,无需 pip 安装。

| 脚本 | 用途 | 命令 |
|---|---|---|
| `scripts/check_chemistry.py` | 主检查器,多载体、出报告 | `python3 scripts/check_chemistry.py out.pptx --fail-on-error --report report.md` |
| `scripts/fix_chemistry.py` | 生成阶段规范化 Markdown/TXT | `python3 scripts/fix_chemistry.py draft.md --output draft.normalized.md --dry-run` |
| `scripts/chem_data.py` | 元素表、常见物质词典、白名单(供扩展) | 被前两个脚本引用,不直接执行 |

主检查器参数:

- `--report <path>`:Markdown 报告,含位置、原文、问题、按载体给出的建议改法。
- `--json <path>`:结构化结果,便于接 CI。
- `--fail-on-error`:存在 error 时退出码 1(默认 0)。
- `--quiet`:控制台只显示 error。
- `--ignore-types a,b` / `--ignore-list file.txt`:按类型关闭不需要的规则(类型清单见 `references/notation-rules.md` 第六节)。
- 支持传目录批量检查;支持 `.md` `.markdown` `.txt` `.html` `.htm` `.docx` `.pptx` `.pdf`。
- 零第三方依赖,仅 Python 标准库;PDF 为尽力而为(有 `pdftotext` 才检查,且无法判断真角标,优先检查源文件)。

规范化脚本参数:`--output`、`--in-place`、`--dry-run`。含 `$...$`、`~2~`、`^2^` 的行会整行保守跳过,避免破坏已有角标语法;这些行单独人工确认。

## 问题类型

**error**:`element_case`、`subscript_missing`、`subscript_partial`、`subscript_as_superscript`、`charge_not_superscript`、`coefficient_subscripted`。
**warning**:`unicode_subscript_in_pptx`、`unicode_superscript_in_pptx`、`element_subscripted`。
**info**:`ambiguous_symbol`、`unit_superscript`、`isotope_superscript`、`text_arrow`。

## 误报与边界

- 检查器是启发式的:代码块跳过,单位区间不参与解析,`B2B` / `G20` / `5G` / `3D` 等缩写走白名单;不确定项标 `confidence: low/medium`。遇到误报,编辑 `scripts/chem_data.py` 的 `NON_CHEM_TOKENS`、`COMMON_FORMULAS`、`CHEM_CONTEXT_WORDS` 扩展词典。
- `SO4 2-` 这类电荷前带空格的写法,解析时会折叠空格,报告「原文」列显示折叠后的形式。
- Word OMML 公式对象内部整段跳过(视为由公式编辑器正确排版),需人工确认正体。
- PDF 只剩字符,无法判断真角标属性,务必检查源 `.docx` / `.pptx`。

## 资源

- `references/notation-rules.md` — 完整排版规范、正误对照表、歧义清单、问题类型速查、误报控制与词典扩展。
- `references/carrier-guide.md` — Word / PPT / HTML / Markdown / LaTeX 的角标实现代码、PPT 字体缺字坑、交付前检查清单。
- `scripts/` — 检查器、规范化器、化学数据(均无需第三方依赖)。
Files in this package (6)
  • SKILL.md 8 KB
  • references/carrier-guide.md 7 KB
  • references/notation-rules.md 8 KB
  • scripts/check_chemistry.py 40 KB
  • scripts/chem_data.py 9 KB
  • scripts/fix_chemistry.py 5 KB

Versions

The database has no other skills named did-it-sub.

Database snapshot: 13.11.2026 · package version 34cba3ac1d81 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 85foliq
    Search, read and cite local documents (PDF, Word, PowerPoint, Excel, HTML, Markdown) with the foliq CLI. Use when a question needs facts from the user's documents or files in an indexed folder.
  • 90office-documents
    Create, edit and convert Word, Excel, PowerPoint and PDF artifacts with format-aware verification. Use when producing docx, xlsx, pptx or PDF files; preserve templates and actual document structure, and render or recalculate before delivery.
  • 95report-ppt-generator-pro
    Generate professional PowerPoint presentations from text manuscripts and style examples. Use when users want to create PPT slides from written content, especially for work reports. Triggers: generate PPT, create slides, make presentation, convert to PowerPoint, PPT from…
  • 95officecraft
    Create, edit, review, automate, and publish professional PowerPoint (.pptx) presentations and Microsoft Word (.docx) documents. Trigger on PowerPoint, PPT, PPTX, Word, DOCX, reports, proposals, research talks, slide decks, document formatting, and office workflows.
  • 95md-to-docx
    把 Markdown (.md) 转成 Word (.docx) 并套用固定中文论文/公文排版(宋体 + Times New Roman、正文小四、标题四号且分多级、全文两端对齐、段前段后 0、首行缩进 2 字符、1.5 倍行距、Unicode 上下标转 Word 上下标、删中英文空格);也能反向检查已有 .docx 里残留的 Markdown 标记(`**加粗**`、`## 标题`、`- 列表`、`| 表格 |`、`[文本](链接)`、`&nbsp;`)并输出清理后的新文件和检查报告。Use this whenever the user wants…
  • 90annotation-everything
    从原始材料生成逐页报告初稿、本机逐页审阅、批注、分析和改稿。生成走内置默认范式(需求澄清、材料读取登记、逐页 HTML、可选讲稿、核验记录、公开核验入口);审阅将 HTML 报告、Word/DOCX 文档(按原分页直接审阅)或 PowerPoint/PPTX 演示文稿(每张幻灯片一页、本机渲染、幻灯片定位批注)与讲稿并排展示,收集引用、删除、改写、点或区域标注,接收提交后按批注同步修改报告和讲稿。用户说「帮我生成一份报告」「从这份材料做汇报」「审阅这份报告」「审阅这份 Word / DOCX」「审阅这份 PPT /…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.