Ppw caption

From Chanw-research/claude-code-paper-writing · View interactive version

Ppw caption is an AI agent skill from the GitHub repository Chanw-research/claude-code-paper-writing. Generate or optimize figure/table captions for academic papers. Geography-aware: study area, CRS notation, data source. Writes output to .tex file. 图表标题生成与优化。

How to use this skill

Skill file

Purpose

This Skill generates or optimizes LaTeX figure and table captions for academic papers. For spatial figures (maps, GIS outputs, aerial photos), the Skill proactively collects study area, data source, and CRS metadata using a geography-aware Ask Strategy. For non-spatial figures and tables, geography questions are skipped entirely. Output is written directly to the user's .tex file at the correct \caption{} location using the Read-before-Write pattern. When a target journal is specified, caption length and style are adapted to the journal template.

Core Prompt

Source: awesome-ai-research-writing — 生成图的标题 + 生成表的标题

图标题 Prompt:

# Role
你是一位经验丰富的学术编辑,擅长撰写精准、规范的论文插图标题。

# Task
请将我提供的【中文描述】转化为符合顶级会议规范的【英文图标题】。

# Constraints
1. 格式规范:
   - 如果翻译结果是名词性短语:请使用 Title Case 格式,即所有实词的首字母大写,末尾不加句号。
   - 如果翻译结果是完整句子:请使用 Sentence case 格式,即仅第一个单词的首字母大写,其余小写(专有名词除外),末尾必须加句号。

2. 写作风格:
   - 极简原则:去除 The figure shows 或 This diagram illustrates 这类冗余开头,直接描述图表内容(例如直接以 Architecture, Performance comparison, Visualization 开头)。
   - 去 AI 味:尽量避免使用复杂的生僻词,保持用词平实准确。

3. 输出格式:
   - 只输出翻译后的英文标题文本。
   - 不要包含 Figure 1: 这样的前缀,只输出内容本身。
   - 必须对特殊字符进行转义(例如:`%`、`_`、`&`)。
   - 保持数学公式原样(保留 `$` 符号)。

表标题 Prompt:

# Role
你是一位经验丰富的学术编辑,擅长撰写精准、规范的论文表格标题。

# Task
请将我提供的【中文描述】转化为符合顶级会议规范的【英文表标题】。

# Constraints
1. 格式规范:
   - 如果翻译结果是名词性短语:请使用 Title Case 格式,即所有实词的首字母大写,末尾不加句号。
   - 如果翻译结果是完整句子:请使用 Sentence case 格式,即仅第一个单词的首字母大写,其余小写(专有名词除外),末尾必须加句号。

2. 写作风格:
   - 常用句式:对于表格,推荐使用 Comparison with, Ablation study on, Results on 等标准学术表达。
   - 去 AI 味:尽量避免使用 showcase, depict 等词,直接使用 show, compare, present。

3. 输出格式:
   - 只输出翻译后的英文标题文本。
   - 不要包含 Table 1: 这样的前缀,只输出内容本身。
   - 必须对特殊字符进行转义(例如:`%`、`_`、`&`)。
   - 保持数学公式原样(保留 `$` 符号)。

Trigger

Activates when the user asks to:

Example invocations:

Modes

| Mode | Default | Behavior |

|------|---------|----------|

| direct | Yes | Single-pass caption output after Ask Strategy questions |

| batch | | Not supported — each caption requires its own figure/table context |

Default mode: direct. User provides figure/table context and receives a complete LaTeX caption in one pass.

Path selection (within direct mode):

References

Required (always loaded)

| File | Purpose |

|------|---------|

| references/expression-patterns.md | Academic expression patterns overview — always loaded as entrypoint |

Leaf Hints (loaded conditionally)

| File | When to Load |

|------|--------------|

| references/expression-patterns/geography-domain.md | When figure type is spatial (map, photo, GIS output); provides study area framing, spatial description patterns, planning language |

Journal Template (conditional)

Ask Strategy

Before starting, collect:

  1. Figure or table type (always required — determines whether spatial questions apply):

map / chart / diagram / photo / data table?

  1. Target journal if not specified (ask once; if declined, use general academic style)
  1. If figure type is spatial (map, photo, GIS output):
  1. If figure type is non-spatial (bar chart, line chart, schematic, data table):

Skip all geography questions. Ask only for data source if not mentioned.

Rules:

Workflow

Step 0: Workflow Memory Check

Step 1: Collect Context

Step 2a: Generate Path (new caption from content description)

| Type | Caption Focus |

|------|--------------|

| Map | Spatial extent, CRS (if provided), data source, scale bar mention |

| Chart / Diagram | Variables described, trend or comparison purpose, data source |

| Photo | Subject, location (if provided), data source or photographer credit |

| Table | Row/column semantics, statistical context, units, data source |

\caption{[Subject / study area]. [Key content description]. [Data source statement].}

Step 2b: Optimize Path (improve existing weak caption)

Step 3: Write to File

Output Contract

| Output | Format | Condition |

|--------|--------|-----------|

| caption_latex | LaTeX \caption{...} string written to .tex file | Always — file input and Write succeeds |

| caption_latex | LaTeX \caption{...} string in conversation | Fallback — Write fails, or pasted text input |

LaTeX caption format examples:

Figure (spatial):

\caption{Distribution of urban green space in Shenzhen Nanshan District. Data derived from OpenStreetMap 2023. Projected in WGS 84 / UTM Zone 50N.}

Figure (non-spatial):

\caption{Comparison of model accuracy across three benchmark datasets. All values are F1 scores. Data from the COCO 2017 validation set.}

Table:

\caption{Descriptive statistics of land use change by category, 2010--2020. All areas reported in km\textsuperscript{2}. Data from the Third National Land Survey.}

Edge Cases

| Situation | Handling |

|-----------|----------|

| Journal specified but template not found | Refuse: "Journal template for [X] not found. Available: CEUS." |

| Figure type is spatial but no study area or data source provided | Generate from available content; skip missing clauses; do NOT use [MISSING: ...] |

| .tex file has multiple \caption{} commands | Ask which \label{} is the target before writing |

| User provides both existing caption and content description | Default to Optimize path; confirm if ambiguous |

| Figure type unclear ("my figure") | Ask type before any branching logic |

| Input is only a file path with no description | Read the file; ask for clarification if content is ambiguous |

| Non-standard caption format in journal template | Journal template overrides default three-part format rules |

| User declines to provide CRS | Skip CRS clause entirely; do not leave placeholder |

Fallbacks

| Scenario | Fallback |

|----------|----------|

| Structured Interaction unavailable | Ask 1-3 plain-text questions (figure type, journal, study area if spatial) |

| geography-domain.md leaf missing | Proceed with general spatial description; warn user of reduced quality |

| Journal template missing (no journal specified) | Ask once; if declined, use general academic style |

| Write tool fails | Present caption in conversation; advise user to paste at \caption{} location |

| .tex file not found or unreadable | Present caption in conversation |

Examples

Invocation: "Write a caption for my map figure showing urban heat island distribution in Guangzhou."

Ask Strategy exchange:

Generated caption (after loading CEUS template and geography-domain.md):

\caption{Spatial distribution of urban heat island intensity in Guangzhou. Land surface temperature derived from Landsat-8 imagery (2022). City boundary data from the National Geomatics Center of China.}

Write step: Skill reads paper.tex, locates \caption{} at \label{fig:uhi}, replaces content, writes file.


Skill: caption-skill

Conventions: references/skill-conventions.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.